fix(update): 'l' key now selects package in interactive update (#26265)

## Summary
- The 'l' key in `bun update --interactive` now correctly selects the
package when toggling between Target and Latest versions
- Previously, pressing 'l' would toggle `use_latest` but not mark the
package as selected, causing the underline indicator to disappear and
the package not being included when confirming

## Test plan
- [x] Added regression test `test/regression/issue/24131.test.ts` that
verifies 'l' selects the package
- [x] Test fails with system bun (before fix) and passes with debug
build (after fix)
- [x] `bun bd test test/regression/issue/24131.test.ts` passes

Fixes #24131

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
robobun
2026-01-19 22:46:36 -08:00
committed by GitHub
parent 3a4daa95ac
commit 5f470278d1
3 changed files with 74 additions and 3 deletions

View File

@@ -1687,8 +1687,9 @@ pub const UpdateInteractiveCommand = struct {
}
}
} else {
// Individual selection mode, just toggle current cursor package
// Individual selection mode, just toggle current cursor package and select it
state.packages[state.cursor].use_latest = !state.packages[state.cursor].use_latest;
state.selected[state.cursor] = true;
}
},
'j' => {