fix(desktop): virtualize composer / and @ menus, drop item caps#3579
Merged
Conversation
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
.slicecaps — the full match set flows to the menu.VirtualMenubuilt 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.VirtualMenuowns the.slashmenuscroll container + keeps the active row in view viascrollToIndex(replaces the old per-itemscrollIntoView).SlashMenuand the@menu (rendered over the existing unifiedatMenuItems) share it;FileMenuis 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-existingwailsjs/*generated-binding errors that appear without awails build).npm run check:css— passes (CSS syntax + z-index tokens).app.Commands()returns 10 builtins (>8) even before skills/custom/mcp, i.e. the old cap was hiding real entries.