Skip to content

fix(plugins): add viewport scrolling to marketplace and installed lists#1281

Open
mikewong23571 wants to merge 1 commit into
MoonshotAI:mainfrom
mikewong23571:fix/plugins-marketplace-viewport
Open

fix(plugins): add viewport scrolling to marketplace and installed lists#1281
mikewong23571 wants to merge 1 commit into
MoonshotAI:mainfrom
mikewong23571:fix/plugins-marketplace-viewport

Conversation

@mikewong23571

Copy link
Copy Markdown

Problem

When opening /plugins marketplace with 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:

  • Pass the terminal from the slash-command host to the panel so it can compute available rows.
  • Pre-render all item lines, then slice only the window that fits inside the panel chrome.
  • Track scrollOffset and adjust it whenever selectedIndex moves so the selected item stays visible.
  • Reset scrollOffset when 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 passing
  • pnpm --filter @moonshot-ai/kimi-code run typecheck — clean
  • Added a new regression test with 30 marketplace entries on a 12-row terminal.
  • Built kimi.exe locally and confirmed the marketplace selection stays visible while scrolling.

@changeset-bot

changeset-bot Bot commented Jul 1, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 3daa58f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@mikewong23571 mikewong23571 force-pushed the fix/plugins-marketplace-viewport branch from edb0b79 to c59ad95 Compare July 1, 2026 13:45

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread apps/kimi-code/src/tui/components/dialogs/plugins-selector.ts Outdated
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.
@mikewong23571 mikewong23571 force-pushed the fix/plugins-marketplace-viewport branch from c59ad95 to 3daa58f Compare July 1, 2026 14:02
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.

1 participant