Skip to content

feat(spotlight): align tab navigation with full launcher - #3205

Merged
purian23 merged 3 commits into
duxlabs-dev:masterfrom
hthienloc:feat/spotlight-tab-actions-followup
Aug 28, 2026
Merged

purian23 merged 3 commits into
duxlabs-dev:masterfrom
hthienloc:feat/spotlight-tab-actions-followup

Conversation

@hthienloc

Copy link
Copy Markdown
Member

Please review PR #3204 first.

Align Spotlight keyboard navigation with Full Launcher. Tab and Shift+Tab navigate the action panel, while Ctrl+Tab and Ctrl+Shift+Tab cycle launcher categories.

Closes #3172

@hthienloc

Copy link
Copy Markdown
Member Author

/claude review

Comment on lines +479 to +486
ActionPanel {
id: actionPanel
anchors.top: resultsContainer.bottom
anchors.left: parent.left
anchors.right: parent.right
selectedItem: root.controller.selectedItem
controller: root.controller
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The panel is never reset when the selection moves. LauncherContent.qml:757 has a Connections on the controller that does if (actionPanel.expanded && !actionPanel.hasActions) actionPanel.hide(); there is no equivalent here, so with the panel open, arrowing to another result keeps expanded true and selectedActionIndex stale.

Two ways it breaks:

  • New item has fewer actions (e.g. plain app with only the primary action, so actions.length === 1): index stays at 1, executeSelectedAction() hits the selectedActionIndex >= actions.length guard and returns — the Key_Return branch at line 199 already took the action-panel path, so Enter does nothing at all.
  • New item has hasActions === false: height collapses to 0 but expanded stays true, so Enter fires an action from an invisible panel and Escape only closes it instead of the launcher.

Adding function onSelectedItemChanged() { if (actionPanel.expanded) actionPanel.hide() } to the existing Connections { target: root.controller } block fixes both.

confirmed: true

}

implicitHeight: _searchAreaH + resultsContainer.height
implicitHeight: _searchAreaH + resultsContainer.height + actionPanel.height

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Growing implicitHeight works for the two hosts that size from it (DankLauncherV2ModalSpotlight, NiriOverviewOverlay), but not for the island: DankIsland/Activities/LauncherExpanded.qml fills a fixed 560px sheet (launcherExpandedTarget) with clip: true and sets maxResultsHeight: launcherExpandedTarget.height - Theme.spacingM - bottomInset - searchAreaHeight, i.e. the search bar plus a full results list already consume the whole height. With showResultsWithoutQuery: true the list is normally at that cap, so Tab expands a panel anchored entirely below the clip edge — invisible, while Enter now routes to it.

Subtracting the panel from the results cap keeps it on screen (no binding loop, actionPanel.height only depends on expanded/hasActions):

root.maxResultsHeight > 0 ? Math.max(0, root.maxResultsHeight - actionPanel.height) : Math.min(430, ...)

@claude

claude Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Claude review

Two issues with the action panel now that Spotlight can open it: stale state on selection change, and it being clipped out of view in the island host.

  • Panel is not hidden when the selected item changes, unlike LauncherContent; Enter can silently do nothing or fire an action from a collapsed panel — quickshell/Modals/DankLauncherV2/SpotlightLauncherContent.qml:479
  • implicitHeight growth does not help DankIsland/Activities/LauncherExpanded.qml, which is a fixed 560px clipped sheet with the results cap already filling it, so the panel lands below the clip edge — quickshell/Modals/DankLauncherV2/SpotlightLauncherContent.qml:50

Checked: key handling parity with LauncherContent, the cycleAction wrap fix, and all three SpotlightLauncherContent hosts for layout impact. Model: claude-opus-5.

@hthienloc

Copy link
Copy Markdown
Member Author

/claude review

@claude

claude Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Claude review

No issues found.

Both findings from the previous run are fixed: onSelectedItemChanged now resets the panel (SpotlightLauncherContent.qml:288), and the island host reserves the panel height in its results cap (LauncherExpanded.qml:82).

Checked: the actionPanelHeight → maxResultsHeight → _resultsH chain for a binding loop (none — ActionPanel.height only depends on expanded/hasActions); layout fit in all three hosts (DankLauncherV2ModalSpotlight and NiriOverviewOverlay size from implicitHeight, island now fits 56 + results + 52 inside the 560px sheet); the cycleAction reverse wrap; Tab/Backtab reaching _handleKey through DankTextField.Keys.forwardTo without double-dispatch; Enter/Escape parity with LauncherContent; and that spotlight rows do not change selection on hover, so the new hide-on-selection-change does not collapse the panel out from under the mouse. No new user-facing strings, catalogs untouched.

Checked: key handling, panel lifecycle, and layout across all three SpotlightLauncherContent hosts. Model: claude-opus-5.

@purian23
purian23 merged commit d8ceb12 into duxlabs-dev:master Aug 28, 2026
1 check passed
@hthienloc
hthienloc deleted the feat/spotlight-tab-actions-followup branch November 15, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Spotlight launcher tab actions

2 participants