feat(ux): 三个小改进——Esc 立即收起胶囊 / 概览复制按钮 / 历史页 ⌘R 刷新#790
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
PR Reviewer Guide 🔍(Review updated until commit 9a0d230)Here are some key observations to aid the review process:
|
Collaborator
|
开始审核 |
Contributor
|
Persistent review updated to latest commit 9a0d230 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
三个互相独立的小体验改进,打包在一个 PR 里(各一个 commit)。
① Esc / 主动取消时胶囊立即消失
所有终止态原本共用 2000ms 延迟收起。给「主动取消」(Esc / 点 ✕)单开一条零延迟路径(
CAPSULE_CANCEL_HIDE_DELAY_MS = 0),按 Esc 立刻回 Idle、由前端淡出动画收尾,观感「按下即消失」。完成 / 出错仍保留 2 秒(需要让用户看清结果 / 错误)。② 概览「最近识别」每行加复制按钮
Overview.tsx的RecentRow右侧加复制按钮,复用 History 的规则(润色文本为空时回退到识别原文),点击后图标变 ✓ 并显示「已复制」1.5s。顺带把共享Btn的children改为可选以便复用。③ 历史页 ⌘R 刷新
History.tsx已有键盘监听,加 ⌘R:preventDefault()拦掉 webview 整页 reload,改为只重拉listHistory()。均通过
cargo check/tsc。Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
PR Type
Enhancement, Bug fix
Description
Esc / cancel immediately hides capsule (0ms delay)
Overview "Recent" rows gain a copy button (fallback to raw transcript)
History page ⌘R refreshes list without full reload
Fix cancelled processing sessions not properly finishing (session id check)
File Walkthrough
coordinator.rs
Add cancel-specific capsule hide delay constantopenless-all/app/src-tauri/src/coordinator.rs
CAPSULE_CANCEL_HIDE_DELAY_MS = 0constant for immediate hide oncancel
coordinator_state.rs
Add state function for cancelled processing finishopenless-all/app/src-tauri/src/coordinator_state.rs
finish_cancelled_processing_statewith session id validationHistory.tsx
Add ⌘R refresh shortcut to history pageopenless-all/app/src/pages/History.tsx
refreshto useEffect dependency arrayOverview.tsx
Add copy button to recent recognitionsopenless-all/app/src/pages/Overview.tsx
RecentRowwith copied state and timeoutBtncomponent_atoms.tsx
Make Btn children optionalopenless-all/app/src/pages/_atoms.tsx
childrenprop optional inBtnProps(added?)dictation.rs
Introduce finish_cancelled_processing for clean cancellationopenless-all/app/src-tauri/src/coordinator/dictation.rs
finish_cancelled_processinghelper functionset_phase_idlecalls withfinish_cancelled_processingfor cancelled paths
CAPSULE_CANCEL_HIDE_DELAY_MSfor cancelled sessions