ticket: record panel and analytics implementations

This commit is contained in:
Keisuke Hirata 2026-06-09 19:55:50 +09:00
parent 703176df7c
commit c306339e0a
No known key found for this signature in database
4 changed files with 140 additions and 2 deletions

View File

@ -2,7 +2,7 @@
title: 'Improve workspace panel display and composer key handling' title: 'Improve workspace panel display and composer key handling'
state: 'inprogress' state: 'inprogress'
created_at: '2026-06-09T08:47:25Z' created_at: '2026-06-09T08:47:25Z'
updated_at: '2026-06-09T10:21:06Z' updated_at: '2026-06-09T10:55:20Z'
assignee: null assignee: null
readiness: 'implementation_ready' readiness: 'implementation_ready'
risk_flags: ['tui-input', 'ux-consistency'] risk_flags: ['tui-input', 'ux-consistency']

View File

@ -251,3 +251,95 @@ Parallel-routing rationale:
- Coder was instructed to avoid Ticket backend/tool output changes unless necessary. - Coder was instructed to avoid Ticket backend/tool output changes unless necessary.
--- ---
<!-- event: implementation_report author: coder at: 2026-06-09T10:49:47Z -->
## Implementation report
Implemented panel display/composer key handling updates on branch `panel-display-composer-keys`.
Summary:
- Added shared `composer_keys` keymap for readline-style composer editing and reused it from both normal TUI input handling and workspace panel input handling.
- Removed Panel `Ctrl+T` target switching; Panel now uses `Tab` for global composer target switching. `Ctrl+T` is no longer a Panel target shortcut.
- Kept bare letters as composer text and added focused tests for `j/k/o/r` text entry.
- Added explicit Panel focus state (`global composer`, `selected row`, `item action`) and status/actionbar/title wording that distinguishes global composer target from selected rows.
- `Esc` clears Panel selection/focus back to the global composer target; `Ctrl+C` remains quit.
- Added shared key handling coverage for word motion/delete and Panel focus/target transitions.
Files changed:
- `crates/tui/src/composer_keys.rs`
- `crates/tui/src/lib.rs`
- `crates/tui/src/multi_pod.rs`
- `crates/tui/src/single_pod.rs`
- `crates/tui/src/workspace_panel.rs`
Validation:
- `cargo test -p tui composer_keys` — passed
- `cargo test -p tui multi_composer` — passed
- `cargo test -p tui multi_ctrl_t_does_not_switch_composer_target` — passed
- `cargo test -p tui multi_bare_panel_letters_append_to_composer_and_arrows_select_when_blank` — passed
- `cargo test -p tui multi_esc_clears_panel_focus_without_quitting` — passed
- `cargo fmt --check` — passed
- `git diff --check` — passed
- `cargo run -q -p yoi -- ticket doctor` — passed (`doctor: ok`)
- `cargo check --workspace` — passed
- `nix build .#yoi` — passed
Commit: `20f06b3` (`tui: clarify panel focus and composer keys`).
Reviewer notes:
- The workspace panel does not currently expose an active completion popup/source; the Tab handling path is now isolated as the target-switch path, with completion ownership documented in the shared key handling boundary for future completion integration.
- Row Enter behavior is preserved for dispatch/open, while Right marks item-action focus and status text makes that model explicit.
---
<!-- event: implementation_report author: orchestrator at: 2026-06-09T10:55:20Z -->
## Implementation report
Coder implementation completed and is ready for sibling review.
Coder Pod:
- `coder-panel-display-composer-keys`
- Commit: `20f06b3 tui: clarify panel focus and composer keys`
- Worktree status before review: clean branch `panel-display-composer-keys`
- Stopped after collecting output to reclaim delegated worktree scope.
UI/key handling design:
- Panel target switching moved from `Ctrl+T` to `Tab`.
- `Ctrl+T` no longer switches targets in Panel.
- Bare letters such as `j/k/o/r` remain composer text, not shortcuts.
- Panel focus is explicit: global composer, selected row, or item action.
- Composer send target is displayed as global composer target and does not imply selected Ticket target.
- `Esc` clears Panel selection/focus toward global composer/no-selection; `Ctrl+C` remains quit.
- `Right` can move into item action focus while row `Enter` behavior is preserved.
Implementation summary:
- Added shared `composer_keys` keymap used by normal TUI and workspace panel.
- Shared editing covers insert, Alt+Enter newline, backspace/delete, left/right, word left/right, word delete, Home/End; caller keeps Up/Down history/list/completion context.
- Updated Panel help/top/actionbar wording to remove `Ctrl+T` and ambiguous empty Enter wording.
- Added/updated Panel tests for Tab switching, Ctrl+T non-switching, bare-letter regression, shared word motion/delete, Esc focus clear, and Ctrl+C quit.
Changed files:
- `crates/tui/src/composer_keys.rs`
- `crates/tui/src/lib.rs`
- `crates/tui/src/multi_pod.rs`
- `crates/tui/src/single_pod.rs`
- `crates/tui/src/workspace_panel.rs`
Coder validation reported passed:
- `cargo test -p tui composer_keys`
- `cargo test -p tui multi_composer`
- `cargo test -p tui multi_ctrl_t_does_not_switch_composer_target`
- `cargo test -p tui multi_bare_panel_letters_append_to_composer_and_arrows_select_when_blank`
- `cargo test -p tui multi_esc_clears_panel_focus_without_quitting`
- `cargo fmt --check`
- `git diff --check`
- `cargo run -q -p yoi -- ticket doctor`
- `cargo check --workspace`
- `nix build .#yoi`
Residual note:
- Panel currently has no active completion popup/source, so completion-priority for `Tab` is expressed as the caller consuming Tab before target switching when completion exists.
---

View File

@ -2,7 +2,7 @@
title: 'session analyticsにresponse単位のbatching指標を追加する' title: 'session analyticsにresponse単位のbatching指標を追加する'
state: 'inprogress' state: 'inprogress'
created_at: '2026-06-09T08:51:48Z' created_at: '2026-06-09T08:51:48Z'
updated_at: '2026-06-09T10:36:44Z' updated_at: '2026-06-09T10:55:20Z'
assignee: null assignee: null
queued_by: 'workspace-panel' queued_by: 'workspace-panel'
queued_at: '2026-06-09T10:31:14Z' queued_at: '2026-06-09T10:31:14Z'

View File

@ -94,3 +94,49 @@ Parallel-routing rationale:
- Coder was instructed to use synthetic fixtures and preserve the privacy boundary. - Coder was instructed to use synthetic fixtures and preserve the privacy boundary.
--- ---
<!-- event: implementation_report author: orchestrator at: 2026-06-09T10:55:20Z -->
## Implementation report
Coder implementation completed and is ready for sibling review.
Coder Pod:
- `coder-session-analytics-response-batching`
- Commit: `963db29d960d23b40e32d6b07db88f52b914a72d analytics: add response batching metrics`
- Worktree status before review: clean branch `session-analytics-response-batching`
- Stopped after collecting output to reclaim delegated worktree scope.
Response boundary design:
- Best-effort response grouping uses consecutive top-level `kind: "assistant_item"` JSONL entries as one assistant response.
- Non-assistant entries such as `tool_result`, `turn_end`, or `segment_start` close the current response group.
- Seeded `segment_start.history` is excluded from response-level metrics because exact original response boundaries are not explicit; a `response_boundary_approximation` diagnostic records this limitation.
- Metrics live under `response_batches` and remain distinct from user-turn metrics.
Implementation summary:
- Added response-level tool metrics: total responses, tool-call responses, total tool calls, avg/p50/p90/max tools per response, histogram, and top tool-call responses.
- Added Edit batching metrics: responses containing Edit, total Edit calls, calls per response, same-file multi-Edit responses, files touched per Edit response, large-argument summary fields, and `replace_all` count.
- Added consecutive edit round-trip metrics: pure same-file edit-only streaks and interrupted/annotated sequences when Read/Bash/test-like steps intervene.
- Preserved privacy boundary: no raw user input, raw tool args, raw file contents, raw session snippets, or raw tool output content in default JSON output.
Changed files:
- `crates/session-analytics/src/lib.rs`
- `crates/yoi/src/session_cli.rs`
Coder validation reported passed:
- `cargo test -p session-analytics`
- `cargo test -p yoi run_session_analyze_outputs_json`
- `cargo fmt --check`
- `git diff --check`
- `cargo run -q -p yoi -- ticket doctor`
- `cargo check --workspace`
- `nix build .#yoi`
Focused tests covered multiple tools in one response, same-response same-file edits, consecutive edit-only responses, interleaved Read/test-like Bash interruption/annotation, sessions with no edits, existing analytics behavior, and CLI JSON shape.
Residual notes:
- Response boundaries are best-effort for current JSONL shape.
- Percentile/avg output is count-based and `avg_milli` avoids floating-point JSON instability.
- Bash test detection is heuristic and only annotates interrupted edit sequences; it is not blame/policy classification.
---