fix(plugins): add viewport scrolling to marketplace and installed lists#1281
fix(plugins): add viewport scrolling to marketplace and installed lists#1281mikewong23571 wants to merge 1 commit into
Conversation
|
edb0b79 to
c59ad95
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca437794f2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The PluginsPanelComponent rendered every plugin entry regardless of terminal height. When the list exceeded the screen, the framework clipped from the top, so the default selection (first item) was off screen and arrow-key navigation provided no visible feedback. Add a line-based viewport: - Pass the terminal from the slash-command host to the panel. - Compute available rows after accounting for panel chrome. - Pre-render all item lines and slice only the visible window. - Adjust scrollOffset so the selected item stays in view when the user moves the cursor. Also reset scrollOffset when switching tabs. Fixes marketplace navigation on long plugin lists.
c59ad95 to
3daa58f
Compare
Problem
When opening
/plugins marketplacewith a long plugin list, the panel rendered every entry unconditionally. Once the output exceeded the terminal height, the TUI framework clipped from the top, so the default selection (the first item) was scrolled off-screen. Arrow-key navigation produced no visible feedback because the selected item was outside the viewport.Fix
Add a line-based viewport to
PluginsPanelComponent:scrollOffsetand adjust it wheneverselectedIndexmoves so the selected item stays visible.scrollOffsetwhen switching tabs.Both the marketplace tabs (Official / Third-party) and the Installed tab use the same viewport logic, so long installed-plugin lists are also handled.
Verification
pnpm --filter @moonshot-ai/kimi-code test test/tui/components/dialogs/plugins-selector.test.ts— 27/27 passingpnpm --filter @moonshot-ai/kimi-code run typecheck— cleankimi.exelocally and confirmed the marketplace selection stays visible while scrolling.