-
Notifications
You must be signed in to change notification settings - Fork 129
fix(windows): 补齐 QA helper-window 的原生交互语义 #184
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/issue-153-native-drag-repro
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
100 changes: 100 additions & 0 deletions
100
docs/github-tracking/issue-153-qa-helper-native-spec.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,100 @@ | ||
| ## Issue #153 Native Spec | ||
|
|
||
| Scope: Windows-native helper-window implementation for QA panel | ||
|
|
||
| Status: | ||
|
|
||
| - This document is the implementation-spec layer for `#153` | ||
| - It replaces "keep trying shared drag carriers" with a platform-layered plan | ||
| - Product goal stays shared with macOS; implementation becomes Windows-native | ||
|
|
||
| ### Shared Product Contract | ||
|
|
||
| The QA panel must satisfy the same product goal across platforms: | ||
|
|
||
| 1. Non-disruptive to the source app context | ||
| 2. Clickable controls: | ||
| - close | ||
| - pin | ||
| 3. Draggable from toolbar/background drag affordance | ||
| 4. Safe multi-turn follow-up usage | ||
| 5. Dismiss means non-participating, not merely visually hidden | ||
|
|
||
| ### Windows Native Contract | ||
|
|
||
| Windows should not reuse macOS's implementation shape as the primary carrier. | ||
|
|
||
| Instead, the Windows-specific helper-window must explicitly define: | ||
|
|
||
| 1. Window creation attributes | ||
| - topmost helper window | ||
| - transparent window is allowed only if it does not break hit-test semantics | ||
| - no taskbar entry | ||
| - activation behavior must be explicitly chosen, not inherited accidentally | ||
|
|
||
| 2. Native drag semantics | ||
| - drag region must be recognized at the native window/message layer | ||
| - do not depend on shared async drag helpers as the primary mechanism | ||
| - toolbar drag and control-hit regions must be natively separated | ||
|
|
||
| 3. Native click semantics | ||
| - close and pin controls must remain clickable | ||
| - drag region must not swallow control clicks | ||
| - hit-test mapping must distinguish: | ||
| - drag region | ||
| - control buttons | ||
| - normal client area | ||
|
|
||
| 4. Source-app context relation | ||
| - normal show path should avoid stealing the user's upstream context unnecessarily | ||
| - if Windows drag requires temporary focus/activation semantics, this must be treated as an explicit transition, not an accident | ||
| - after drag/dismiss, helper-window semantics must be restored | ||
|
|
||
| ### Current Baseline Findings | ||
|
|
||
| Upstream-based repro branch confirms: | ||
|
|
||
| - QA feature exists | ||
| - hotkey path can be made healthy | ||
| - close path can be healthy | ||
| - drag is the remaining isolated interaction gap | ||
|
|
||
| This means the implementation target is now narrow: | ||
|
|
||
| ```text | ||
| Fix Windows-native draggable semantics for QA helper-window | ||
| without reopening unrelated QA / UI / hotkey scope. | ||
| ``` | ||
|
|
||
| ### Implementation Boundaries | ||
|
|
||
| In scope: | ||
|
|
||
| - Windows QA helper-window creation/runtime behavior | ||
| - native hit-test / message routing for drag region | ||
| - preserving clickable controls while enabling drag | ||
|
|
||
| Out of scope: | ||
|
|
||
| - main window frame/radius/shadow issues | ||
| - Capsule geometry / lifecycle work from other families | ||
| - unrelated provider / insertion / polish changes | ||
|
|
||
| ### Acceptance Criteria | ||
|
|
||
| - [ ] `Ctrl+Shift+;` still opens and closes QA panel | ||
| - [ ] close button remains clickable | ||
| - [ ] pin remains clickable | ||
| - [ ] toolbar drag works on Windows | ||
| - [ ] no regression in follow-up QA flow | ||
| - [ ] implementation remains scoped to Windows-native helper-window semantics only | ||
|
|
||
| ### Notes | ||
|
|
||
| The key design rule is: | ||
|
|
||
| ```text | ||
| Same product goal, different OS carriers. | ||
| Windows must own its native helper-window carrier instead of inheriting | ||
| macOS-shaped interaction assumptions. | ||
| ``` |
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,65 @@ | ||
| ## Summary | ||
|
|
||
| Closes #153 | ||
|
|
||
| This code PR is the upstream-based delivery branch for the narrowed Windows repair: | ||
|
|
||
| ```text | ||
| Windows native drag semantics for QA helper-window | ||
| ``` | ||
|
|
||
| This PR follows a layered strategy: | ||
|
|
||
| - keep the same product goal as macOS | ||
| - stop assuming the same implementation carrier works on Windows | ||
| - move Windows behavior toward a native helper-window contract | ||
|
|
||
| ## Scope | ||
|
|
||
| In scope: | ||
|
|
||
| - Windows-native QA helper-window interaction semantics | ||
| - drag-region / click-region separation | ||
| - preserving non-disruptive QA workflow | ||
|
|
||
| Out of scope: | ||
|
|
||
| - main window appearance | ||
| - Capsule family work | ||
| - unrelated QA renderer redesign | ||
|
|
||
| ## Shared Product Goal | ||
|
|
||
| The PR keeps the same product target: | ||
|
|
||
| - non-disruptive helper window | ||
| - clickable close / pin | ||
| - draggable toolbar region | ||
| - follow-up QA flow stays healthy | ||
| - dismiss returns to non-participating state | ||
|
|
||
| ## Windows-native Direction | ||
|
|
||
| This PR is not meant to keep stacking shared drag workarounds. | ||
|
|
||
| It exists to drive the implementation toward: | ||
|
|
||
| - Windows-specific helper-window carrier | ||
| - native hit-test / message ownership where needed | ||
| - explicit separation of drag surface and control surface | ||
|
|
||
| ## Validation Target | ||
|
|
||
| - [x] upstream-based branch exists and builds | ||
| - [x] narrowed baseline established: hotkey + close can be healthy while drag remains broken | ||
| - [ ] Windows drag becomes healthy on this branch | ||
| - [ ] reviewer-side Windows regression confirms: | ||
| - open | ||
| - close | ||
| - drag | ||
| - follow-up QA | ||
|
|
||
| ## Related Anchors | ||
|
|
||
| - #156 remains the tracking / design-convergence PR | ||
| - #158 remains the governance anchor for helper-window / native-window contract thinking |
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.
WM_NCHITTESTcoordinates andGetClientRectare in physical pixels, but the drag thresholds here (toolbar_height = 32,right_controls_width = 76) are hard-coded as if they were CSS/logical pixels. On Windows displays using 125%/150% scaling, the non-draggable controls area becomes too small and the draggable caption zone intrudes into the pin/close buttons, so clicks on controls can be interpreted as drag starts. Please derive these bounds from the current DPI (or from runtime window scale factor) before comparing against hit-test coordinates.Useful? React with 👍 / 👎.