feat: backport Space-to-preview in /resume session picker (#3605)#182
Conversation
QwenLM#3605) * feat(cli): add Space-to-preview in resume session picker Press Space on a highlighted session to open a read-only transcript preview; Enter resumes, Esc returns. Works from both in-session `/resume` and standalone `qwen --resume`. The standalone path runs before `loadCliConfig`, so no real Config / LoadedSettings exist when its render tree mounts. `StandaloneSessionPicker` wraps the picker in stub Providers — every downstream access in the preview render path is either optional-chained or gated on states (Confirming / Executing) that never occur in resumed session data, so the stubs' methods are only read, never invoked for real work. Tool descriptions degrade to the raw function-call name in preview; users get full fidelity after pressing Enter to resume. Co-Authored-By: Qwen-Coder <noreply@qwen.ai> * fix(cli): guard SessionPreview separator width on narrow terminals `'─'.repeat(boxWidth - 2)` would throw RangeError when columns < 6 (tmux splits, small panes). Clamp boxWidth to a safe minimum and compute separatorWidth with Math.max(0, …). Co-Authored-By: Qwen-Coder <noreply@alibabacloud.com> * fix(cli): gate Space-to-preview behind enablePreview prop `SessionPicker` is shared by the resume dialog and the delete-session dialog. Preview's Enter shortcut forwards to `onSelect`, which for delete is `handleDelete` — so Space → preview → Enter would silently delete the session while the preview UI still says "Enter to resume". Add `enablePreview?: boolean` (default false). Resume callers (the in-app resume dialog and `--resume` standalone) opt in; the delete dialog stays opt-out and behaves exactly as before. Footer hint and preview render branch are both gated on the prop. Add a regression test that emulates the delete dialog and asserts Space is a no-op, the hint is absent, and Enter still flows straight to onSelect. Co-Authored-By: Qwen-Coder <noreply@alibabacloud.com> --------- Co-authored-by: Qwen-Coder <noreply@qwen.ai> Co-authored-by: Qwen-Coder <noreply@alibabacloud.com>
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (8)
✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 0/5 reviews remaining, refill in 7 minutes and 49 seconds. Comment |
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
Summary
Backport from upstream QwenLM/qwen-code: pressing Space on a session in the
/resumepicker renders an inline preview of the conversation; Enter resumes; Esc returns to the list. Reuses theHistoryItemDisplaypipeline so previews look identical to live sessions.SessionPreview.tsx(new) — renders an excerpt from the resumed historyuseSessionPicker.ts— Space/Esc keymap to enter/exit preview modeStandaloneSessionPicker.tsx— mountsConfigContext/SettingsContextstubs since--resumeruns beforeloadCliConfigSessionPicker.tsx— opt-inenablePreviewprop (off by default; destructive flows shouldn't auto-trigger Enter resume)Adaptations from upstream
Upstream's PR also passed
initialSessionsto the picker, but that prop depends on un-ported state (uiState.resumeMatchedSessionsfrom a prior PR not in our fork). Dropped that; we keep the simpler "load all sessions" path. Also dropped acustomTitlereference that depends on the not-yet-ported QwenLM#3093 session rename feature.Tier 2 ordering note
Originally planned to bundle with QwenLM#3093 (session rename/delete) and QwenLM#3540 (auto-title via fast model). Aborted those after seeing the cherry-pick blast radius:
vscode-ide-companionpackage (8 modify/delete conflicts)MemoryDialogfrom un-ported feat(memory): managed auto-memory and auto-dream system QwenLM/qwen-code#3087 auto-memory workWill revisit those as a focused, dedicated effort rather than path-of-least-resistance.
Test plan
npm run typecheckcleanvitest runfor the four touched component tests: 24/24 passed (StandaloneSessionPicker, SessionPreview, SessionPicker preview-mode tests)qwen --resume, press Space on a session — see inline preview; Enter resumes; Esc returns🤖 Generated with Claude Code