-
Notifications
You must be signed in to change notification settings - Fork 129
fix(windows): 拆分 Capsule 平台承载并恢复完整视口 #188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Cooper-X-Oak
wants to merge
3
commits into
Open-Less:main
from
Cooper-X-Oak:codex/windows-capsule-upstream-redo
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
74 changes: 74 additions & 0 deletions
74
docs/2026-05-02-windows-capsule-platform-split-design.zh-CN.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| # Windows Capsule 平台分离设计 | ||
|
|
||
| 日期:2026-05-02 | ||
|
|
||
| ## 目标 | ||
|
|
||
| 同一个产品目标: | ||
|
|
||
| - 录音胶囊在出现、处理中、结束时都稳定可读 | ||
| - 用户只看到胶囊本体,不看到宿主矩形 | ||
| - 状态切换不裁切、不变形、不撞边 | ||
|
|
||
| 不同 OS 使用不同承载手段: | ||
|
|
||
| - macOS / 非 Windows:保留现有通用胶囊实现 | ||
| - Windows:单独使用 Windows 原生承载思路和独立组件 | ||
|
|
||
| ## 设计决策 | ||
|
|
||
| ### 决策 1:`Capsule.tsx` 只做平台路由 | ||
|
|
||
| - `win -> WindowsCapsule` | ||
| - 其他平台 -> `SharedCapsule` | ||
|
|
||
| `Capsule.tsx` 不再负责布局、状态订阅或视觉分支。 | ||
|
|
||
| ### 决策 2:状态数据共享,视觉承载分离 | ||
|
|
||
| 共享层只保留: | ||
|
|
||
| - `CapsulePayload` | ||
| - `CapsuleState` | ||
| - Tauri 事件订阅 | ||
| - `cancel_dictation` / `stop_dictation` | ||
|
|
||
| 平台层各自负责: | ||
|
|
||
| - 宿主尺寸 | ||
| - 可视 pill 尺寸 | ||
| - processing / error / done 布局 | ||
| - 状态切换动画和裁切策略 | ||
|
|
||
| ### 决策 3:Windows 只显示 pill,不显示宿主矩形 | ||
|
|
||
| Windows 宿主窗口继续存在,但视觉上应完全透明。 | ||
|
|
||
| Windows 组件只允许渲染: | ||
|
|
||
| - 左右动作按钮 | ||
| - 中间 processing / error / done 内容 | ||
| - 可选 translation badge | ||
|
|
||
| 不允许继续暴露一层白色矩形宿主框。 | ||
|
|
||
| ## 文件边界 | ||
|
|
||
| - `openless-all/app/src/components/Capsule.tsx` | ||
| - 平台路由入口 | ||
| - `openless-all/app/src/components/WindowsCapsule.tsx` | ||
| - Windows 独立组件 | ||
| - `openless-all/app/src/components/SharedCapsule.tsx` | ||
| - 非 Windows 胶囊实现 | ||
| - `openless-all/app/src/components/useCapsuleState.ts` | ||
| - 通用状态数据 hook | ||
| - `openless-all/app/src/lib/capsuleLayout.ts` | ||
| - 平台尺寸数据 | ||
|
|
||
| ## 本轮验收标准 | ||
|
|
||
| - `Capsule.tsx` 只剩平台路由 | ||
| - Windows 独立使用 `WindowsCapsule.tsx` | ||
| - Windows `thinking / error / done` 不再复用通用外观层 | ||
| - `npm run build` 通过 | ||
| - `cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml` 通过 |
22 changes: 22 additions & 0 deletions
22
docs/2026-05-02-windows-capsule-platform-split-plan.zh-CN.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # Windows Capsule 平台分离实施清单 | ||
|
|
||
| 日期:2026-05-02 | ||
|
|
||
| ## 步骤 | ||
|
|
||
| 1. 新增通用状态 hook | ||
| - 抽出 capsule 事件订阅和动作命令 | ||
| 2. 拆出非 Windows 组件 | ||
| - 把现有非 Windows 渲染迁到 `SharedCapsule.tsx` | ||
| 3. 接入 Windows 独立组件 | ||
| - `Capsule.tsx` 只做 `win -> WindowsCapsule` | ||
| 4. 验证 | ||
| - `npm run build` | ||
| - `cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml` | ||
| - Windows 启动并前置主窗口 | ||
|
|
||
| ## 本轮不做 | ||
|
|
||
| - helper-window lifecycle 重构 | ||
| - QA panel 交互修复 | ||
| - 业务状态流改写 |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The setup path now returns immediately after starting listeners and no longer checks
OPENLESS_SHOW_MAIN_ON_START, so the existing Windows automation paths that still set this variable (for examplescripts/windows-cold-start.ps1inForceImmediateShowmode and other smoke scripts) have lost their explicit backend-driven “show + focus main window” override. This is a regression in test/dev workflow behavior because those flows can no longer force the foreground activation path that previously calledshow_main_window(show/unminimize/set_focus).Useful? React with 👍 / 👎.