Skip to content

fix(apps-menu): preselect the first folder item only on keyboard open - #1856

Merged
eythaann merged 1 commit into
eythaann:masterfrom
z1pp090:fix/apps-menu-folder-preselect
Sep 28, 2026
Merged

eythaann merged 1 commit into
eythaann:masterfrom
z1pp090:fix/apps-menu-folder-preselect

Conversation

@z1pp090

@z1pp090 z1pp090 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1774

Problem

FolderModal always initialized its selection to the first item. Opening a folder with the mouse therefore painted that item with the selected style (accent outline and background) as if it were stuck, until the arrow keys moved the selection. The pinned view already starts with no selection.

Fix

FolderItem tells the modal whether it was opened from the keyboard: Enter/Space on the item, or the pinned view's Enter handler, which calls element.click() and so produces a click with detail === 0. Only then is the first item preselected. A mouse open starts with no selection, and the first arrow key press still selects the first item (navigateInDirection already handles a null selection).

Testing

Tested in a dev build on Windows 11 26200 with a pinned folder of four apps:

  • Mouse click on the folder: no item is highlighted (before the fix, the first one was, as in the issue screenshot).
  • Arrow key to the folder + Enter: the first item is highlighted.
  • Not tested live: the arrow keys and Enter inside the modal, and the first arrow key after a mouse open (it goes through navigateInDirection, which selects the first item when nothing is selected).
  • svelte-check: 0 errors. CI green on the fork.

🤖 Generated with Claude Code

FolderModal always initialized its selection to the first item, so opening
a folder with the mouse left that item painted with the selected style
(accent outline and background) as if it were stuck, until arrow keys
moved the selection. The pinned view already starts with no selection.

FolderItem now tells the modal whether it was opened from the keyboard
(Enter/Space on the item, or the view's Enter handler, which calls
element.click() and so produces a click with detail === 0). Only then is
the first item preselected; a mouse open starts with no selection and the
arrow keys still select the first item on the first press.

Fixes eythaann#1774

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 4/5

The behavior appears sound, but the repository’s test requirement should be satisfied before merging.

Summary

The PR makes a folder modal preselect its first app only when opened from the keyboard, leaving mouse-opened folders without a selection.

  • The mouse and keyboard paths need automated regression coverage.

Reviews (1) · Last reviewed commit: "fix(apps-menu): preselect the first fold..."

class:is-dropping={sortable.isDropping}
class:is-drop-target={isActiveDropzone}
onclick={openModal}
onclick={(e) => openModal(e.detail === 0)}

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.

P2 Missing selection tests The click handler now decides whether the modal selects its first item, but there is no automated test for mouse opening, keyboard opening, or the first arrow-key press after a mouse opening. The repository guidance calls for tests when behavior changes. Please add coverage for these paths before merging.

Context Used: AGENTS.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code Fix in Codex

@z1pp090 z1pp090 Sep 24, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The repo has no test runner for the Svelte widgets (npm test is empty; the only TS tests are the libs/core ones under Deno), and this logic lives in component event handlers, so a unit test would need a component test setup that does not exist yet. The mouse path and the keyboard path were checked by hand in a dev build (see the PR description). The first arrow key after a mouse open was not tested live; it relies on navigateInDirection selecting the first item when nothing is selected, the same path the pinned view already uses. Happy to add tests if the maintainer wants that setup.

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.

That context is fair. Since this repository has no Svelte component test runner, adding automated coverage would require introducing a new test setup rather than just adding regression cases. The documented dev-build checks cover the mouse-open, keyboard-open, and first-arrow-key paths, so I’m withdrawing the request for tests for this PR.

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.

That’s fair context. Since there is no Svelte component-test harness and the changed behavior is confined to component event wiring, the dev-build checks are a reasonable validation for this PR; I’ll treat the missing tests as a non-blocking suggestion rather than a merge requirement. The first-arrow behavior is also handled by the existing navigateInDirection null-selection branch, so adding a test specifically for it can wait until component-test infrastructure exists.

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.

Understood. I’ll no longer ask for automated UI/component tests when this repository lacks a component test runner or harness; documented manual validation and existing code-path coverage will be sufficient in that situation.

View rule

Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.

@eythaann
eythaann merged commit 09ed80f into eythaann:master Sep 28, 2026
2 checks passed
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.

[BUG] App menu folder app interface stuck

2 participants