fix: prioritize checkmarked selections over idle/active focus on enter
When items are selected with checkmarks, pressing enter now always launches them instead of being intercepted by idle panel or active session focus logic. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
14
src/index.ts
14
src/index.ts
@@ -640,18 +640,22 @@ async function handleKeypress(key: KeyEvent) {
|
|||||||
break
|
break
|
||||||
|
|
||||||
case "return": {
|
case "return": {
|
||||||
// Focus idle session from idle panel
|
const hasSelections = selectedProjects.size > 0 || selectedSessions.size > 0
|
||||||
|
// If user has checkmarked items, always launch them
|
||||||
|
if (hasSelections) {
|
||||||
|
doLaunch()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
// Focus idle session from idle panel (only when nothing selected)
|
||||||
if (bottomPanelMode === "idle" && cachedIdleSessions.length > 0 && idleCursor < cachedIdleSessions.length) {
|
if (bottomPanelMode === "idle" && cachedIdleSessions.length > 0 && idleCursor < cachedIdleSessions.length) {
|
||||||
const focused = await focusTerminalByPath(cachedIdleSessions[idleCursor].projectPath)
|
const focused = await focusTerminalByPath(cachedIdleSessions[idleCursor].projectPath)
|
||||||
if (focused) return
|
if (focused) return
|
||||||
}
|
}
|
||||||
// If cursor is on a project row with active session and nothing selected, focus it
|
// If cursor is on a project row with active session, focus it
|
||||||
const returnRow = displayRows[cursor]
|
const returnRow = displayRows[cursor]
|
||||||
if (
|
if (
|
||||||
returnRow.type === "project" &&
|
returnRow.type === "project" &&
|
||||||
projects[returnRow.projectIndex].activeSessions > 0 &&
|
projects[returnRow.projectIndex].activeSessions > 0
|
||||||
selectedProjects.size === 0 &&
|
|
||||||
selectedSessions.size === 0
|
|
||||||
) {
|
) {
|
||||||
const focused = await focusTerminalByPath(projects[returnRow.projectIndex].path)
|
const focused = await focusTerminalByPath(projects[returnRow.projectIndex].path)
|
||||||
if (focused) return
|
if (focused) return
|
||||||
|
|||||||
Reference in New Issue
Block a user