Repository navigation
fix(input): keep the @file mention highlight on a visible row - #1426
Conversation
The file mention list always rendered the first 5 matches while Up/Down moved over all of them (up to 20), so past the fifth row the highlight vanished and Tab could insert a file that was never shown. Window the list around the selection with the same logic the slash command list uses, now shared as completionWindow, and show "Showing X-Y of Z" when there are more matches than rows. Closes Nano-Collective#1405.
nc-review: nothing to raise@addyCooks — nothing to raise from the automated review. The diff factors out the existing slash-command list's window logic into a shared 🔴 blocking · 🟠 a reviewer would ask for a change · ⚪ optional Automated code review — correctness, security, design, tests, plus duplicates and scope. A human still decides; this is not a substitute for review and is not exhaustive. The required status checks separately cover lint, formatting, types, unused dependencies, the test suite and the build. This bot never merges. Maintainers can rerun with |
|
Beautiful work @addyCooks :) |
|
Thankyou @will-lamerton, |
Description
Closes #1405.
The
@file mention list always rendered the first 5 matches (fileCompletions.slice(0, 5)), but Up/Down moved the selection over the whole list of up to 20. Past the fifth row the ▸ highlight disappeared from the visible list, and Tab inserted a file that was never shown.The slash-command list already solves this by showing a window around the selected row. That logic is now one shared function,
completionWindow, and both lists use it:Showing X-Y of Z, like the command listThe slash-command list behaves exactly as before.
Recording
Type of Change
Changeset
pnpm changeset) describing this change for the changelogTesting
Automated Tests
.spec.ts/tsxfilespnpm test:allcompletes successfully)Manual Testing
Checklist