Skip to content

🎨 Palette: Add pagination indicator and tab-completion hint to command suggestions - #415

Open
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
palette-command-suggestions-pagination-16988221816722197227
Open

🎨 Palette: Add pagination indicator and tab-completion hint to command suggestions#415
google-labs-jules[bot] wants to merge 2 commits into
mainfrom
palette-command-suggestions-pagination-16988221816722197227

Conversation

@google-labs-jules

Copy link
Copy Markdown
Contributor

💡 What: Added dynamic pagination indicators (e.g., 1-5 of 12) and explicit shortcut hints (⇥ complete) to the status bar of the CommandSuggestionList component.
🎯 Why: To improve user situational awareness when the list of suggestions is truncated due to terminal height constraints, and to make tab-completion functionality more discoverable.
📸 Before/After:
Before: ↑↓ nav · ⏎ select · esc close
After: 1-5 of 12 · ↑↓ nav · ⇥ complete · ⏎ select · esc close
Accessibility: Improves discoverability of alternative keyboard navigation and provides clearer context about list size without relying solely on visual scrolling.


PR created automatically by Jules for task 16988221816722197227 started by @YoungSx

@google-labs-jules

Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@YoungSx

YoungSx commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

需要修改后重新提交 🔧

功能方向认可 —— 分页指示器 (1-5 of 12) 和 ⇥ complete 提示确实补上了 CommandSuggestionList 缺失的情境感知, 提示也与 CommandInput.tsx:170key.tab → applySelection 实际行为吻合。但有 3 个问题需要先解决。

🔴 阻塞项 1:journal 文件目录名大小写错误

PR 新建的是 .Jules/palette.md(大写 J),而仓库里已存在 .jules/palette.md(小写)。

后果:在 Linux/CI(大小写敏感)上会产生两个并存的目录,journal 从此分裂;在 macOS/Windows(大小写不敏感)上则会出现 checkout 冲突。

修复:

git rm -r --cached .Jules && rm -rf .Jules
# 把内容 append 到既有的 .jules/palette.md 末尾

注意 .jules/palette.md 已经有一条 2026-08-29 - Truncation Awareness 记录(来自已合入的 #412),请追加而不是覆盖。同时补上文件末尾换行符(当前缺失)。

🟡 阻塞项 2:混入了无关的 prettier 重排

CommandInput.tsx 里对 <Box borderStyle="round"><Text color={...}> 的多行重排跟本 PR 的功能目标无关,属于噪音,让 review 很难分辨真实改动。

本仓库的格式化工具是 oxfmt(见 package.jsonformat / format:check),不是 prettier。请回退这些纯格式改动,只保留第 324-328 行传 totalSuggestions / startIndex 这两个必要的 prop。如需格式化请跑 bun run format

🟡 阻塞项 3:可选 prop 掩盖了契约

totalSuggestions?: number;   // = 0
startIndex?: number;         // = 0

totalSuggestions = 0 配合 totalSuggestions > suggestions.length 判断,在漏传时会静默隐藏分页指示器 —— 这类 bug 不会报错,只会让功能悄悄失效。

CommandSuggestionList 目前只有 CommandInput.tsx 一个调用方(已全库确认),没有兼容包袱。建议直接声明为必填:

totalSuggestions: number;
startIndex: number;

让类型系统兜住,而不是靠默认值兜。

✅ 重新提交前请确认

bun run verify   # 全量门禁:format:check + lint + typecheck + 边界检查 + 全部测试

另外建议补一个 CommandSuggestionList 的渲染测试,覆盖两种情形:截断时显示 1-5 of 12、未截断时不显示分页段。


供参考:本轮同批 PR 的处置是 #388 / #393 / #414 已合入 main,其余因重复或已被 #412 覆盖而关闭。这个 PR 是唯一带来新增 UX 价值的,所以打回而不是关闭 —— 修好上面 3 点后请重新提交。

@google-labs-jules

Copy link
Copy Markdown
Contributor Author

需要修改后重新提交 🔧

功能方向认可 —— 分页指示器 (1-5 of 12) 和 ⇥ complete 提示确实补上了 CommandSuggestionList 缺失的情境感知, 提示也与 CommandInput.tsx:170key.tab → applySelection 实际行为吻合。但有 3 个问题需要先解决。

🔴 阻塞项 1:journal 文件目录名大小写错误

PR 新建的是 .Jules/palette.md(大写 J),而仓库里已存在 .jules/palette.md(小写)。

后果:在 Linux/CI(大小写敏感)上会产生两个并存的目录,journal 从此分裂;在 macOS/Windows(大小写不敏感)上则会出现 checkout 冲突。

修复:

git rm -r --cached .Jules && rm -rf .Jules
# 把内容 append 到既有的 .jules/palette.md 末尾

注意 .jules/palette.md 已经有一条 2026-08-29 - Truncation Awareness 记录(来自已合入的 #412),请追加而不是覆盖。同时补上文件末尾换行符(当前缺失)。

🟡 阻塞项 2:混入了无关的 prettier 重排

CommandInput.tsx 里对 <Box borderStyle="round"><Text color={...}> 的多行重排跟本 PR 的功能目标无关,属于噪音,让 review 很难分辨真实改动。

本仓库的格式化工具是 oxfmt(见 package.jsonformat / format:check),不是 prettier。请回退这些纯格式改动,只保留第 324-328 行传 totalSuggestions / startIndex 这两个必要的 prop。如需格式化请跑 bun run format

🟡 阻塞项 3:可选 prop 掩盖了契约

totalSuggestions?: number;   // = 0
startIndex?: number;         // = 0

totalSuggestions = 0 配合 totalSuggestions > suggestions.length 判断,在漏传时会静默隐藏分页指示器 —— 这类 bug 不会报错,只会让功能悄悄失效。

CommandSuggestionList 目前只有 CommandInput.tsx 一个调用方(已全库确认),没有兼容包袱。建议直接声明为必填:

totalSuggestions: number;
startIndex: number;

让类型系统兜住,而不是靠默认值兜。

✅ 重新提交前请确认

bun run verify   # 全量门禁:format:check + lint + typecheck + 边界检查 + 全部测试

另外建议补一个 CommandSuggestionList 的渲染测试,覆盖两种情形:截断时显示 1-5 of 12、未截断时不显示分页段。


供参考:本轮同批 PR 的处置是 #388 / #393 / #414 已合入 main,其余因重复或已被 #412 覆盖而关闭。这个 PR 是唯一带来新增 UX 价值的,所以打回而不是关闭 —— 修好上面 3 点后请重新提交。

I have addressed all the blocking issues:

  1. Journal file directory case error: I removed the incorrect .Jules directory and appended the new entry properly to the existing .jules/palette.md file, including a trailing newline.
  2. Reverted formatting noise: I restored CommandInput.tsx and re-applied only the necessary prop additions (totalSuggestions={suggestions.length} and startIndex={startIndex}).
  3. Mandatory props: I updated CommandSuggestionListProps in CommandSuggestionList.tsx to make totalSuggestions and startIndex mandatory (removed ? and default values) so the type system enforces them.
  4. Added rendering tests: I added tests/unit/cli/ui/components/command-suggestion-list.test.tsx to verify that the pagination indicator is hidden when totalSuggestions <= suggestions.length and shown correctly otherwise.

The specific unit test passes and the formatting was fixed using oxfmt. Submitting the changes now.

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