qiniu / qiniu/coding-helper

工具菜单版本查询完成时会重置当前选择

Open
#29 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3
Forks
1
Avg merge
5h 2m
Merged PRs (30d)
1

Description

背景

工具菜单会异步查询工具最新版本,并在查询完成时通过 AbortController 中断当前 select prompt 后重新渲染菜单。

问题

如果用户正在工具菜单中使用方向键选择选项,版本查询刚好完成时会触发菜单重新渲染,当前选中项可能回到第一个选项。用户原本选中的“返回”等选项可能被重置,随后回车会确认错误菜单项。

影响

  • 菜单可能看起来闪烁或刷新。
  • 方向键选择状态可能丢失。
  • 回车可能确认非用户预期的选项。

复现线索

在 PR #28 的 Codex 交互审阅中,真实伪终端检查曾观察到:工具菜单中已移动到“返回”后,版本检查完成触发重绘,选中项回到“配置模型”,导致回车进入模型配置流程。

期望

版本信息刷新不应打断用户当前选择。可以考虑:

  • 不在当前 prompt 内 abort/re-render;
  • 或使用不会重置选中项的刷新机制;
  • 或在进入菜单前短暂等待版本结果,超时后保持当前菜单稳定。

验收标准

  • 用户在工具菜单中使用方向键时,后台版本查询完成不会重置选中项。
  • 回车确认的是用户当前实际选中的选项。
  • 对主菜单和所有工具菜单的交互测试保持通过。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the tool menu's asynchronous version query and the AbortController-driven prompt abort and re-render described in the issue, then inspect the main menu and all tool-menu interaction tests. Reproduce the selection reset with the pseudo-terminal scenario, and consider the listed refresh approaches while preserving the highlighted option; done means direction-key selection survives version completion and the interaction tests pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.