Skip to content

fix(desktop): virtualize composer / and @ menus, drop item caps#3579

Merged
esengine merged 2 commits into
main-v2from
fix/composer-menu-cap
Jun 8, 2026
Merged

fix(desktop): virtualize composer / and @ menus, drop item caps#3579
esengine merged 2 commits into
main-v2from
fix/composer-menu-cap

Conversation

@esengine

@esengine esengine commented Jun 8, 2026

Copy link
Copy Markdown
Owner

Problem

The desktop composer's / command menu and @ file menu showed incompletely: the slash list was .slice(0, 8) and the @ list .slice(0, 10), so anything past those was unreachable even by scrolling (the data was capped, not just the viewport). Commands() alone returns 10+ builtins before skills / custom / mcp prompts are added, so a user typing / only ever saw 8 of them.

Fix

  • Drop both .slice caps — the full match set flows to the menu.
  • Render both menus through a new shared VirtualMenu built on @tanstack/react-virtual, so a directory with thousands of entries (or a long command list) only mounts the visible rows plus a small overscan. No truncation, no jank.
  • VirtualMenu owns the .slashmenu scroll container + keeps the active row in view via scrollToIndex (replaces the old per-item scrollIntoView). SlashMenu and the @ menu (rendered over the existing unified atMenuItems) share it; FileMenu is removed as redundant.

The @-past-chats sub-menu (search box + session list) is left as-is — separate UI, not part of this report.

Verification

  • npm run typecheck — clean (only the pre-existing wailsjs/* generated-binding errors that appear without a wails build).
  • npm run check:css — passes (CSS syntax + z-index tokens).
  • Confirmed at the API layer that app.Commands() returns 10 builtins (>8) even before skills/custom/mcp, i.e. the old cap was hiding real entries.
  • Not visually smoke-tested in a running Wails build from this environment — worth a quick manual check that scroll + ↑/↓ keyboard nav land correctly in the canary.

The slash menu was sliced to 8 and the @ file menu to 10, so commands and
files past those were unreachable even by scrolling — Commands() alone
returns 10+ builtins before skills/custom/mcp are added. Remove both caps
and render the menus through a shared @tanstack/react-virtual list, so they
scale to any directory size while only mounting the visible rows.
@esengine esengine requested a review from SivanCola as a code owner June 8, 2026 11:24
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development desktop Wails desktop app (desktop/**) and removed v2 Go rewrite (1.x) — main-v2 branch, active development labels Jun 8, 2026
The build uses pnpm (wails.json frontend:install); the new dep must be in
pnpm-lock.yaml or pnpm install --frozen-lockfile fails in CI.
@esengine esengine merged commit 9828086 into main-v2 Jun 8, 2026
9 checks passed
@esengine esengine deleted the fix/composer-menu-cap branch June 8, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant