⌘K: first ↓ keeps the top result selected, so moving down takes two presses

未关闭 适合新手
#42,253 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
frontend

调研方向

从 ⌘K 命令面板组件及其键盘处理程序开始。问题在于,选中索引从一个未设置或哨兵值开始,第一次按 ↓ 只是把它规范化为 0,真正的移动要到第二次按键才会发生。找到选择器选中索引的初始化位置以及 ↓ 对其递增的位置,并让第一次按键在某个项目已视觉选中时移动到索引 1。根据报告,⌘N 选择器也会复现该问题,因此请检查它是否共享同一个 hook 或列表组件,并通过现有的选择器测试或用键盘操作面板来验证。

由索引模型根据 Issue 内容生成。

描述

Area

Command palette (⌘K) / keyboard navigation

Steps to reproduce
  1. Press ⌘K.
  2. Type a search, for example fleet. The first result is shown as selected.
  3. Press ↓ once.
Expected behavior

The second result is selected after one ↓.

Actual behavior

The first ↓ keeps the first result selected; only the second ↓ moves to the second result. Enter right after typing does open the first result, so it is selected, but the first ↓ is spent re-selecting it. The same happens in the ⌘N picker.

Impact

Every keyboard pick below the top result takes one extra keypress, and it looks like the key was missed.

Version or commit

T3 Code (Beta) 0.1.11 desktop app on macOS, server 0.1.11. Also seen in the web client served by the same server.

Workaround

Press ↓ one extra time.

主要语言
TypeScript
星标
24.8k
派生
6.4k
平均合并
1 小时 27 分钟
30 天内合并 PR
530

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingdotgg/t3code 的其他 Issue

查看 pingdotgg/t3code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。