Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

feat(tui): open a Skills-only picker with $ - #2579

Merged
yyhhyyyyyy merged 3 commits into
mainfrom
tui/2574-dollar-skills
Dec 4, 2026
Merged

yyhhyyyyyy merged 3 commits into
mainfrom
tui/2574-dollar-skills

Conversation

@zjywill

@zjywill zjywill commented Dec 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Fixes #2574.

  • In scrollback and fullscreen, $ in an empty composer opens a picker with bare Skill names and descriptions. Filtering matches only Skill names.
  • Enter or Tab completes the canonical /skill:<name> reference without sending. With no match, Enter keeps the query; Esc clears it, then closes the list.
  • The / command menu, /skills management, @ picker, and ordinary $ in a draft are unchanged. See the command menu contract.

Screenshots

Scrollback — full list and filtered results

Scrollback Skills picker

Fullscreen — full list and filtered results

Fullscreen Skills picker

Design rule checklist

  • The shared composer owns the query, selection, and draft. No new part, service, dependency, configuration, or loader row; scope, service faces and mechanism requirements are not applicable.
  • Timeline, dispatcher, event envelope, assembly, lifecycle, and Session/branch facades are unchanged. No command events, batch, before callback, handover or new context path. After completion, ordinary submission still loads the Skill through the existing reference path.
  • The picker uses the Skill catalog already read by the composer and does not read or modify another plugin's internal state.

Documentation

  • Updated the English and Chinese command-menu contracts and the local tmux scenario list. No ADR, other module's design, or delivery-status document is changed.

Verification

  • node --test scripts/tui-tmux.test.mjs, Rust formatting, git diff --check, and the ADR freeze check passed.
  • Local native build and both $ picker tmux scenarios passed, including no-match Enter/Esc, selecting a Skill without sending, and submitting the completed reference. The pending-question tmux scenarios also passed in both layouts.

Use the shared composer palette for both terminal layouts. Show skill names without invocation syntax and keep the canonical reference for completion. An unmatched query stays in the composer instead of being sent.

Amp-Thread-ID: https://ampcode.com/threads/T-01a23fb7-1bb9-729f-8c51-080d53bfcd3c
@zjywill
zjywill marked this pull request as ready for review December 4, 2026 07:01

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Request changes for one history regression. In both layouts, the new picker showed names and descriptions, filtered by name, handled unmatched Enter and Escape, and completed a Skill reference before submission. Tab also completed without sending. Picker scenarios

With a Skill named review-demo, bracket-paste and submit the literal message $review-demo. After the reply, type $ draft in the empty composer and press Home, Up, then Enter. Up recalls the literal message but also reopens the Skills picker because the previous draft's $ trigger survived history recall. Enter then replaces the recalled text with /skill:review-demo . In the base, that recall stayed an ordinary draft and Enter sent it unchanged. Please clear the trigger when history loads a different draft, or keep the trigger tied to the draft that opened it. The same sequence should recall $review-demo without a picker and send that exact text on Enter in both layouts. Picker activation · History replacement

Scripts, macOS native, and Windows CLI CI passed. Linux verification was running at review time.

No other formal reviews were present at review time.

Merge awaits the history fix, required approvals, and required checks.

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

REQUEST_CHANGES

Scope: this PR adds $ as a second composer trigger. In scrollback and fullscreen, a $ typed into an empty composer opens a Skills-only picker with bare names, filters by Skill name, and completes /skill:<name> without sending; docs and local tmux scenarios are updated. The combined / menu, /skills, @, and $ inside an existing draft are meant to stay as they are.

Agree with zerob13's open history-recall blocker on this head (review 6184993143); I did not duplicate it. I checked the sibling draft replacement paths: set_draft, put_draft and restore_palette do reset the trigger; load_history (crates/dim-cli/src/ui/composer/mod.rs:1282-1293) is the one that does not.

Implementation

P2: $ cannot open the picker while a permission request or an unedited question waits

Root cause and same-source scope. The $ key is handled only inside Composer::handle_key (crates/dim-cli/src/ui/composer/mod.rs:575-581). App::handle_input sends a key to the composer over a decision prompt only when command_entry_open is true (crates/dim-cli/src/ui/tui.rs:2222-2227, 4395-4404), and that predicate is false for an empty $ draft. / has an explicit opener in the same block (tui.rs:4406-4410); $ has none. The added palette_open() clause (tui.rs:2224) only keeps a picker alive that was opened before the prompt arrived.

Failure path and evidence. With an ask_user question pending and the composer empty, press $: AskUserPrompt::handle_key either ignores it (crates/dim-cli/src/ui/prompts.rs:1345-1421) or, when the custom row is selected, starts the free-text answer with $ (prompts.rs:1335-1344). With a permission request pending, PermissionPrompt::handle_key ignores it (prompts.rs:914-972, _ => Effect::None at 972). The Skills picker never opens. The same key works when the picker was opened before the question arrived, which the modified question_arrives_during_completion scenario exercises, so behavior depends on arrival order. The new contract at docs/design/cli-commands.md:335 states the trigger unconditionally, while the / over-prompt behavior is contractual at docs/design/cli-commands.md:282 and 4035-4047.

Fix and acceptance. Mirror / in the decision_allows_commands block: a plain $ on an empty, non-shell composer routes to the composer so the picker opens, and the question or permission keeps its state. If this state is out of scope, qualify the new contract sentence and the README. Add a component test next to a_command_runs_over_a_question_that_keeps_its_answers (crates/dim-cli/src/ui/tui.rs:26478) asserting palette_open() after $ over an unedited question.

Expression

P2: the $commit example contradicts the new Skill row format

Root cause and same-source scope. The new paragraph says $ rows show the bare Skill name without the /skill: prefix (docs/design/cli-commands.md:335-337), and line 320 says / menu Skill rows read /skill:<name>. The Commands example earlier in the same section still shows $commit as a Skill row (docs/design/cli-commands.md:432; docs/zh/design/cli-commands.md:196). The code agrees with the prose: rows_for builds /skill:<name> for / and the bare name for $ (crates/dim-cli/src/ui/composer/palette.rs:214-221), and completion always uses the reference.

Failure path and evidence. A reader of the amended contract sees $commit in the fixed command table, which now reads as the new $ picker's row; the picker actually shows commit, and the / menu shows /skill:commit. The example and the /skill: sentence arrived together in the initial contract, so the contradiction predates this PR; the new $ trigger makes $commit read as the new picker's row, and this PR edits the same section and both mirrors.

Fix and acceptance. Change the example row to /skill:commit, or remove the Skill row from that command example and let the new $ example show the bare commit, in both docs/design/cli-commands.md and docs/zh/design/cli-commands.md. No $-prefixed Skill row remains in either contract.

Optional

  • P3 tests: the new tmux scenarios are local only (scripts/tui-tmux.test.mjs asserts no workflow runs the suite, and AGENTS.md keeps component render and keyboard tests in CI). No Rust component test covers $; the / equivalents are at crates/dim-cli/src/ui/composer/mod.rs:2549, 2659 and 2702. Add tests for opening, name-only filtering, unmatched Enter, both Esc levels, Tab completion and a literal $ so CI exercises the trigger.
  • P3 docs: crates/dim-cli/README.md:924, 1109 and 1227 still name only /, Ctrl+O and Ctrl+P for palette entry and question behavior, and the palette description at 1242-1244 discusses only / rows. Add $, with the limitation if the P2 above is resolved by documenting it.

Blocks inspected

  • Composer: $ trigger and dollar_palette lifecycle; palette_query; palette key handling and submission; completion path (crates/dim-cli/src/ui/composer/mod.rs:527-744, 918-1014, 1533-1560).
  • Palette: query parsing, name-only filtering, row labels and references, title/footer and fullscreen query rendering (crates/dim-cli/src/ui/composer/palette.rs:104-255, 330-438).
  • App routing: command entry, prompt precedence, palette overlay and input budget (crates/dim-cli/src/ui/tui.rs:2209-2232, 4275-4461, 7620-7725).
  • Docs and tests: the command-menu section in both languages, the tui-e2e row, and the new and modified tmux scenarios.
  • Deletions: none.
  • The open peer finding on history recall was checked in the same code and is not duplicated.

Not verified

  • Native build and the tmux suite were not run in this review; the author reports them and the peer manually exercised the picker.
  • CI at draft time: macos-native, scripts and windows-cli passed; verify (linux) was pending; static-checks, web, acp-registry and dependencies were skipped.
  • Cross-PR checks were merge-tree and file-overlap only: clean with main a611e65 and the current #2578 (9aefe7d) and #2575 (50eb455); no combined build.
  • Windows terminal input coalescing and IME behavior were inspected in code only.


fn command_entry_open(&self) -> bool {
(self.composer.skill_draft
|| self.composer.palette_open()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This keeps a $ picker alive that was opened before a decision prompt, but an empty composer cannot open one there. handle_input only special-cases / at line 4406; a $ pressed while a permission request or an unedited question waits is swallowed by PermissionPrompt::handle_key (crates/dim-cli/src/ui/prompts.rs:914-972) or starts a custom answer in AskUserPrompt (prompts.rs:1335-1344). The new contract at docs/design/cli-commands.md:335 states the trigger unconditionally. Mirror the / entry for a plain $ on an empty, non-shell composer, or qualify the contract and README, and add a component test beside tui.rs:26478.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Withdrawn at bfe7040. The question contract at docs/design/cli-commands.md:4035-4047 reserves /, Ctrl+O and Ctrl+P and lets any other typed character start the custom answer, so $ over a decision panel is answer text; #2574 accepts the empty message composer as the scope. zerob13's approval 6185288457 withdraws the same request, and I agree.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Still withdrawn at dedaf3e. The docs-only commit does not change the decision-panel path; the question contract at docs/design/cli-commands.md:4035-4047 reserves /, Ctrl+O and Ctrl+P and lets another typed character start the custom answer, and #2574 scopes the $ entry to the empty message composer. zerob13's approval 6185682652 at this head keeps the request withdrawn. No change requested.

command keeps both rows, the command first.

In scrollback and fullscreen, typing `$` into an empty composer opens a Skills-only
list with the same eligible entries. Each row shows the Skill's bare name and

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The bare-name sentence here contradicts the Commands example at line 432, which still shows $commit as a Skill row (same in docs/zh/design/cli-commands.md:196). With $ now a picker trigger, $commit reads as this picker's row, but the picker shows commit and the / menu shows /skill:commit (crates/dim-cli/src/ui/composer/palette.rs:214-221). Change the example to /skill:commit, or move the bare commit into this example, in both mirrors. The contradiction predates this PR; the new $ trigger makes $commit read as this picker's row, and this PR edits the same section and both mirrors.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Remains at bfe7040. The $commit row still stands at docs/design/cli-commands.md:432 and docs/zh/design/cli-commands.md:196, against the bare-name sentence at docs/design/cli-commands.md:335-337; the code renders commit for $ and /skill:commit for / (crates/dim-cli/src/ui/composer/palette.rs:214-227). The same sweep finds two more statements that are now false: docs/feature-list.md:55 and docs/design/plugins/Skills.md:503 still call / the only trigger. Update both to name $, and change the example row to /skill:commit or move the bare commit into the $ example, in both cli-commands mirrors.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Fixed in dedaf3e. docs/feature-list.md:55 now names $ for the empty native composer in scrollback and fullscreen; docs/design/plugins/Skills.md:503 no longer says / is the only trigger, and 518-519 defer native shortcuts to the CLI contract. Both command examples now read /skill:commit (docs/design/cli-commands.md:432, docs/zh/design/cli-commands.md:196), while the $ examples keep bare names. No /-only statement remains. zerob13 confirmed the same in approval 6185682652.

if (mode === 'fullscreen') args.push('--fullscreen');
const terminal = await tui.launch(args, {waitForComposer: true});

terminal.send('$');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is local-only coverage: scripts/tui-tmux.test.mjs asserts no workflow runs the tmux suite, and AGENTS.md keeps component render and keyboard tests in CI. No Rust test covers the $ trigger; the / equivalents are at crates/dim-cli/src/ui/composer/mod.rs:2549, 2659 and 2702. Add component tests for opening, name-only filtering, unmatched Enter, both Esc levels, Tab completion and a literal $ so CI exercises the key.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Partly addressed in bfe7040: the tmux scenario now covers history recall and exact resubmission in both layouts (scripts/tui-tmux/scenarios.mjs:2511-2523, inside the scrollback and fullscreen map), and docs/architecture/tui-e2e.md:136 records it. What remains: the suite is still local only (AGENTS.md:74, scripts/tui-tmux.test.mjs:113), and no Rust or CI test covers the $ trigger. Optional at this head.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unchanged at dedaf3e, which is docs only. The tmux scenarios added earlier cover opening, name-only filtering, no-match Enter and Esc, and completion without sending in both layouts, but they run only locally (AGENTS.md:74, scripts/tui-tmux.test.mjs:113); no Rust or CI test covers $. Remains Optional P3.

Clear the Skills picker trigger when history replaces the draft. Cover recall and exact resubmission in both tmux layouts.

Amp-Thread-ID: https://ampcode.com/threads/T-01a23fb7-1bb9-729f-8c51-080d53bfcd3c

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

复审 bfe704033defd3bc70922c3104fe9d815fd308e8,请求修改。

上一轮我报告的历史草稿问题已解决。load_history 在替换文本时清除 $ 触发状态。两种布局共用的 tmux 场景现在先发送字面量 $review-note,再从 $ draft 用 Home、Up 召回它,并检查第二次 Enter 交给模型的仍是完整的 $review-note。修复与回归

Implementation · Blocking 我复核了同行报告的决策提示路径。command_entry_open() 只在选择器已经打开或有命令草稿时把按键交给 composer。在空草稿上先收到未编辑的提问或权限提示,再按 $,分派会落到提示本身。先打开 $ 再收到同一提示,选择器却能继续接收按键。该路径在本次增量中未变。请统一这两种到达顺序下的输入行为,让提示保留原有答案或权限状态。已经在自定义答案中输入文字时,$ 应继续作为答案文本。建议在仓内组件测试中覆盖先收到提示的顺序。同行发现 · 当前按键分派

Expression · Optional 建议同步修订中英文命令表的 $commit 示例。目前 / 菜单显示 /skill:commit,$ 选择器显示 commit。沿用同行的原讨论即可。契约示例

PR 通过 Fixes #2574 关联同仓已受理的 P2,满足 issue 准入。当前提交的 PR check 在运行。独立的 issue-gate 返回 startup_failure。受理决定 · PR check · issue-gate

Blocks inspected 历史召回和草稿替换、composer 的触发与 Enter/Esc、提示与选择器的按键归属、Skill 列表文案、中英文契约、双布局 tmux 场景。本次增量扩展了原场景,没有删除断言。

Not verified 本次复审核查了提交与测试断言,未在本机重新运行原生 TUI 或 tmux。CI 的脚本检查不执行这两个 tmux 场景。当前提交的完整 CI 结果尚待回报。

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approve. Loading a history entry now clears the previous draft’s $ trigger. In both layouts, a bracket-pasted $review-note was submitted literally, then recalled after typing $ draft and submitted again unchanged, even with review-note available as a Skill. A literal with no matching Skill also submitted unchanged after recall. This satisfies the history acceptance criterion from the first review. First review · Fix · Regression scenarios

I rechecked the focus issue raised in the intervening review. A decision panel replaces the message composer when it owns input. Both layouts let / open command entry over an unedited question, and both send a leading $ literally when it starts the selected custom answer. The accepted scope specifies typing into the empty message composer. The question contract explicitly reserves /, Ctrl+O and Ctrl+P and permits another typed character to start the custom answer. On that evidence I withdraw the request to intercept $ on a decision panel. Was a global shortcut over a focused decision panel also intended? Such a change would need a decision about how to enter a custom answer beginning with $. Intervening review · Accepted scope · Question contract

Scripts, macOS native, and Windows CLI passed. Linux verification was still running at rereview.

The peer changes request was submitted on the previous head. Peer review

Merge awaits the required approvals, checks, and review thread resolution.

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

REQUEST_CHANGES

Scope: this PR adds $ as a second composer trigger. In scrollback and fullscreen, a $ typed into an empty composer opens a Skills-only list with bare names, filters by Skill name, and completes /skill:<name> without sending; /, /skills, @, and $ inside an existing draft keep their behavior. Linked issue 2574 accepts $ as the one new Skills entry and asks for the command-menu contract plus coverage of name filtering, no-match Enter and Esc, and completion without sending in both layouts; this PR does that. I re-reviewed the full a611e65...bfe7040 change at bfe7040 against origin/main 62bea12 and read the earlier reviews 6184993143 and 6185148279, all three threads, and zerob13's two reviews at this head: 6185275566 (CHANGES_REQUESTED) and 6185288457 (APPROVED). He withdrew the decision-panel request in the approval, and I withdraw it with him.

The history regression is fixed in bfe7040. load_history now clears dollar_palette when history replaces the draft (crates/dim-cli/src/ui/composer/mod.rs:1290), and it is called only from browse_history (mod.rs:1259, 1268), so Up and Down still walk history and only the revived trigger is gone. The other replacement paths already reset the trigger: clear (mod.rs:510), put_draft (mod.rs:244), set_draft via clear (mod.rs:264-268), and restore_palette via clear (mod.rs:546-554). The Down path returns the saved draft without reviving the trigger; the only $ drafts that can reach history browsing contain whitespace, so no picker would show anyway, and a bare $ picker intercepts Up as list navigation. The new tmux block (scripts/tui-tmux/scenarios.mjs:2511-2523) runs inside the scrollback and fullscreen map: it submits a pasted literal $review-note into history, types $ draft, recalls with Home and Up, asserts the picker hint is absent, then checks that Enter resubmits exactly $review-note. A revived picker would complete instead of send, so the check is decisive. docs/architecture/tui-e2e.md:136 matches. I found no defect in the one-line fix or its siblings.

Expression and contract (blocking, P2): two design docs still call / the only trigger

Root cause and same-source scope: the PR makes $ a second trigger and amends docs/design/cli-commands.md:335-341, but two design documents still state the old rule. docs/feature-list.md:55 says "/ is the only trigger, and @ remains the file picker"; docs/design/plugins/Skills.md:503 says "/ stays the only trigger and @ stays the file picker". Both statements are false at this head, and origin/main 62bea12 carries the same text, so no other change updates them. The $commit example (docs/design/cli-commands.md:432; docs/zh/design/cli-commands.md:196) is a separate, older expression issue noted under Optional.

Failure path: a reader of the feature list or the Skills design learns that / is the only trigger and plans or documents around that rule while the TUI opens a Skills list on $. The amended command contract and these two documents disagree about the trigger set, which is the kind of contract contradiction the review rules treat as blocking.

Acceptance: update docs/feature-list.md:55 and docs/design/plugins/Skills.md:503 to name $ as the second trigger. No design or feature document says / is the only trigger.

Prior findings

  • Addressed in bfe7040: the history recall revival raised in zerob13's review 6184993143. I verified the path in code and the new tmux block, and I withdraw my earlier note that load_history was the one replacement path without a reset.
  • Withdrawn at bfe7040: thread 4796830096. The question contract at docs/design/cli-commands.md:4035-4047 reserves /, Ctrl+O and Ctrl+P and lets any other typed character start the custom answer, so $ over a decision panel is answer text; #2574 accepts the empty message composer as the scope. zerob13's approval 6185288457 withdraws the same request, and I agree.
  • Remaining at bfe7040: thread 4796830101 (the two design documents above).
  • Partly addressed: thread 4796830105. The tmux scenario now covers recall and exact resubmission in both layouts, but the suite is still local only.

Optional

  • P3 tests: the tmux suite remains local only (AGENTS.md:74, scripts/tui-tmux.test.mjs:113) and no Rust test covers $; the / equivalents are at crates/dim-cli/src/ui/composer/mod.rs:2550, 2660, 2703. Add component tests for opening, name-only filtering, unmatched Enter, both Esc levels, Tab completion, and a literal $ so CI exercises the trigger.
  • P3 docs: crates/dim-cli/README.md:924, 1109 and 1227 still name only /, Ctrl+O and Ctrl+P for palette entry and question behavior, and the palette description at 1242-1244 discusses only / rows. Add $.
  • P3 Expression: the $commit example at docs/design/cli-commands.md:432 and docs/zh/design/cli-commands.md:196 predates this PR but now reads as the new picker's row. Change it to /skill:commit, or move the bare commit into the $ example, in both mirrors.

Blocks inspected

  • Composer: $ trigger, dollar_palette lifecycle, palette_query, palette key handling and submission, completion, and the history replacement paths (crates/dim-cli/src/ui/composer/mod.rs:527-581, 618-621, 633-696, 726-736, 918-935, 1240-1295, 1534-1564).
  • Palette: query parsing, name-only filtering, row labels and reference, title, footer, and both renderers (crates/dim-cli/src/ui/composer/palette.rs:105-255, 316-438).
  • App routing: command entry, prompt precedence, paste routing, palette overlay and input budget (crates/dim-cli/src/ui/tui.rs:2190-2232, 4279-4284, 4395-4411, 4470-4480, 7620-7730).
  • Prompts: PermissionPrompt and AskUserPrompt key handling (crates/dim-cli/src/ui/prompts.rs:914-973, 1328-1408).
  • Docs and tests: the command-menu section and the new paragraph in both languages, the tui-e2e row, the full tmux scenario including the new recall block, and the feature list and Skills design statements above.
  • Deletions: none.
  • Cross-PR: merge trees with origin/main 62bea12 and the open heads sharing a file are clean: #2575 (50eb455), #2578 (2c84688), #2559 (c6ea945), #2455 (f365d80), #2322 (ad80910). #2504 (c6204d2) still conflicts on docs/design/overview.md, docs/design/plugins/README.md, their zh mirrors, and web/src/chat-ui/web-chat-timeline.test.ts independently of this PR; its tui.rs merge with this head is clean. No other open PR touches the changed files.

Not verified

  • I ran cargo test -p dim-cli --lib 'ui::composer' --locked (70 passed, 881 filtered) and a_command_runs_over_a_question_that_keeps_its_answers (1 passed) with LC_ALL=en_US.UTF-8 and the real HOME. I did not run the full dim-cli or workspace suites, clippy, xtask-check, or the tmux suite; the new tmux block was read, not executed.
  • CI at bfe7040: changes, macos-native, scripts, windows-cli and verify (linux) pass; static-checks, web, acp-registry and dependencies are skipped.
  • Cross-PR checks were merge-tree and file overlap only; no combined build.
  • Windows terminal input coalescing and IME behavior were inspected in code only.

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Request changes for one documentation contract issue. The history fix and the native picker behavior verified in the previous review still pass. The new review evidence is that the CLI feature list and the shared Skills design both explicitly call / the only trigger, while the updated native command contract opens the Skills picker on $. The feature list describes target native CLI controls, and the Skills passage sits in shared reference semantics without a Web-only qualifier. Previous approval · CLI feature list · Skills design

Please add the $ shortcut for the focused, empty native composer to the feature list and let the shared Skills reference design defer shortcuts to the client interaction contracts. Removing the exclusivity sentence from Skills §9 is sufficient. The Web composer’s leading / behavior and the existing question shortcuts continue to follow their own contracts. The English and Chinese CLI command pages already agree on $. Native CLI contract · Chinese CLI contract · Web contract · Question contract

Optional

The older / menu example can show /skill:commit in both languages to match the row label. English example · Chinese example

Required CI passed, including Linux and ci-ok.

yyhhyyyyyy identified the conflicting statements and withdrew the earlier question-panel request. Peer review

Merge awaits the documentation correction, required approvals, and review-thread resolution.

Describe the focused native composer shortcut in the feature list and leave shortcut ownership with the client contracts. Show the canonical Skill reference in both slash menu examples.

Amp-Thread-ID: https://ampcode.com/threads/T-01a23fb7-1bb9-729f-8c51-080d53bfcd3c

@Simon-He95 Simon-He95 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed dedaf3e6e435 (feat(tui): open a Skills-only picker with $, fixes #2574). 10 files, +222 −91.

Scope: local.
Direction: aligned with #2574.
Architecture: held — the composer reuses the existing palette and Skill catalog; no new part, service, or state owner.
App Server surface: none.

The $ path is the existing palette with an explicit trigger: an empty composer opens a Skills-only list, filter_skills matches names only for that trigger, and the row holds the canonical /skill:<name> reference separately from the bare label it displays (crates/dim-cli/src/ui/composer/mod.rs:527-557, :577-680, crates/dim-cli/src/ui/composer/palette.rs:107-230). Enter and Tab complete the reference without sending, a no-match Enter keeps the query, Esc clears the filter before closing, and a recalled or pasted $ draft stays literal. /, /skill:, /skills and @ keep their existing paths; the new docs commit updates the command-menu contract, the Skills design, the feature list, and the trace of stale $commit / “/ is the only trigger” text.

Verified

  • Read the full diff and all changed source, docs and tmux-scenario files at dedaf3e6e435; re-checked the delta from bfe704033d.
  • Blocks inspected: composer trigger/query state, palette matching and rendering, key routing/completion, history recall and paste, both layout paths, docs, and the tmux scenarios.
  • CI at dedaf3e6e435: changes, windows-cli, scripts, and macos-native passed; verify (linux) was still running; the rest were skipped. The tmux suite is not a CI job.
  • Cross-PR / consumer checks: TUI-only; no App Server wire, CLI, Web or dim-electron consumer.

Not verified

  • Did not run the native tmux scenarios or the dim-cli suite locally; the author's scenario run and CI are the evidence.
  • verify (linux) had not completed when this review was written.

Verdict: APPROVE — the picker reuses the existing palette and Skill path, and the scenario and documentation changes cover the described behavior.

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

APPROVE。上一轮要求修改的快捷键契约已在 dedaf3e6 修正。功能清单将 $ 限定在 scrollback 与 fullscreen 中已获焦的空消息输入框。共享 Skills 设计把快捷键交给各客户端定义,中英文命令菜单也都用 /skill:commit 展示 / 菜单的行。可按已受理的 #2574 验收。上轮阻塞项 · 本次文档修订 · 议题受理

此前的历史召回问题已修复。两种布局的场景都先粘贴并发送字面量 $review-note,再从另一份草稿中召回,检查第二次 Enter 发给模型的文本仍是 $review-note。此前针对已获焦提问面板的拦截建议维持撤回,该面板按自己的键盘契约接收自定义答案。历史召回场景 · 提问契约

Blocks inspected 核对了输入框触发与历史草稿替换、候选列表的名称筛选、双布局渲染与提示到达时的按键归属。Enter 与 Tab 共用规范引用的补全路径,空结果时普通 Enter 保留查询。双布局 tmux 场景检查了补全后模型请求数仍为零,再检查显式提交时实际加载了选中的 Skill。此次文档增量覆盖功能清单、共享设计及中英文命令菜单,没有删除测试场景。按键分派 · 双布局场景

Not verified 本轮未在本机重跑原生 TUI、tmux 或完整 Rust 测试。提交评审前,脚本、macOS 原生及 Windows CLI 检查已通过,Linux 验证仍在运行。本提交 CI

@yyhhyyyyyy yyhhyyyyyy left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

APPROVE

Scope: this PR adds $ as a second composer trigger. In scrollback and fullscreen, $ typed into an empty composer opens a Skills-only list with bare names, filters by Skill name, and completes /skill:<name> without sending; /, /skills, @, and $ inside an existing draft keep their behavior. Linked issue #2574 accepts the $ entry and asks for the command-menu contract plus coverage of name filtering, no-match Enter and Esc, and completion without sending in both layouts. This round re-reviews the full PR at dedaf3e against origin/main 6a7a76b, with the docs-only delta from bfe7040.

The blocking docs contradiction from bfe7040 is fixed. docs/feature-list.md:55 now names $ for the empty native composer in scrollback and fullscreen; docs/design/plugins/Skills.md:503 no longer says / stays the only trigger, and docs/design/plugins/Skills.md:518-519 defer native shortcuts to the CLI contract, which is the ownership split zerob13 asked for in 6185485798. Both command examples now read /skill:commit (docs/design/cli-commands.md:432, docs/zh/design/cli-commands.md:196), while the $ examples at docs/design/cli-commands.md:344-348 and docs/zh/design/cli-commands.md:125-129 show bare names, so the two row formats no longer collide. A full docs sweep finds no remaining statement that / is the only trigger, and the zh $ paragraph matches the English one.

The wording matches the code at this head. $ opens the picker only on an empty, non-shell composer (crates/dim-cli/src/ui/composer/mod.rs:575-581); / rows render /skill:<name> and $ rows render the bare name (crates/dim-cli/src/ui/composer/palette.rs:214-220); Enter and Tab complete without sending, a no-match Enter keeps the query, and Esc clears the filter before closing (crates/dim-cli/src/ui/composer/mod.rs:660-687). The code is unchanged from bfe7040.

Prior findings

  • Fixed in dedaf3e: thread 4796830101. The two /-only statements are gone, and the $commit row is now /skill:commit in both mirrors. zerob13 approved this head in 6185682652, so no peer blocker is open.
  • Withdrawn at bfe7040 and still withdrawn: thread 4796830096. The question contract at docs/design/cli-commands.md:4035-4047 reserves /, Ctrl+O and Ctrl+P and lets another typed character start the custom answer, and #2574 scopes the $ entry to the empty message composer.
  • Open and optional: thread 4796830105. The tmux scenarios cover the flow in both layouts, but the suite is still local only.

Optional

  • P3 tests: the tmux suite remains local only (AGENTS.md:74, scripts/tui-tmux.test.mjs:113), and no Rust or CI test covers $; the / equivalents are at crates/dim-cli/src/ui/composer/mod.rs:2550, 2660 and 2703. Add component tests for opening, name-only filtering, unmatched Enter, both Esc levels, Tab completion, and a literal $ if this path is kept.
  • P3 docs: crates/dim-cli/README.md:924, 1109 and 1227 still describe palette entry as /, Ctrl+O and Ctrl+P only, and the palette text at 1242-1244 discusses only / rows. Add $ and the bare-name row format.
  • P3 Expression: the /skill:commit row at docs/design/cli-commands.md:432 and docs/zh/design/cli-commands.md:196 starts its description two columns after the other rows in the same block. Re-pad the block or move the Skill row to its own line. Cosmetic only.

Blocks inspected

  • Docs: the command menu section in both languages, the Skills section 9 reference text, the feature list entry, and the tui-e2e row; full diff at dedaf3e against main.
  • Composer: $ trigger and dollar_palette lifecycle, palette_query, palette key handling, completion, and history recall (crates/dim-cli/src/ui/composer/mod.rs:527-581, 633-687, 918-935, 1240-1295).
  • Palette: query parsing, name-only filtering, row labels and references, title and footer, both renderers (crates/dim-cli/src/ui/composer/palette.rs:104-230, 316-438).
  • App routing: command entry and palette overlay (crates/dim-cli/src/ui/tui.rs:2221-2225).
  • Tests: the tmux scenario block at scripts/tui-tmux/scenarios.mjs:2460-2525 and its tui-e2e entry; no deletions.
  • Cross-PR: merge trees with origin/main 6a7a76b and the open heads sharing a file are clean: #2575 (50eb455), #2559 (c6ea945), #2455 (f365d80), #2322 (ad80910). #2504 (c6204d2) still conflicts on docs/design/overview.md, docs/design/plugins/README.md, their zh mirrors, and web/src/chat-ui/web-chat-timeline.test.ts independently of this PR; its tui.rs and feature-list merges with this head are clean.

Not verified

  • I ran cargo test -p dim-cli --lib 'ui::composer' --locked (70 passed, 881 filtered) and a_command_runs_over_a_question_that_keeps_its_answers (1 passed) at dedaf3e with LC_ALL=en_US.UTF-8 and the real HOME. I did not run the full dim-cli or workspace suites, clippy, xtask-check, or the tmux suite; the tmux scenarios were read, not executed.
  • CI at dedaf3e: changes, scripts, windows-cli and macos-native pass; verify (linux) and the PR check were in progress; static-checks, web, acp-registry and dependencies are skipped; the independent issue-gate run returned startup_failure, as it did at bfe7040.
  • Cross-PR checks were merge-tree and file overlap only; no combined build.
  • Windows terminal input coalescing and IME behavior were inspected in code only.

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approve. The CLI feature list now documents $ for the focused, empty native composer in scrollback and fullscreen. Skills §9 now defers native shortcuts to the CLI command contract while retaining the shared /skill:<name> reference format. Both translations also show /skill:commit in the / menu example. This resolves the documentation finding from the prior reviews. Prior review · Feature list · Skills design

Web continues to use its leading / menu, and the existing question contract preserves literal $ in a custom answer. This head changes documentation only, so the previous native picker and literal history results still apply. Native evidence · Web contract · Question contract

Scripts, macOS native, and Windows CLI passed. Linux verification was running at review time.

Simon-He95 approved this revision. The earlier change request from yyhhyyyyyy was on the previous head. Current approval · Earlier review

Merge awaits the applicable approvals, checks, and review-thread resolution.

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.

TUI:在 scrollback 和 fullscreen 中用 $ 打开 Skills 选择器

4 participants