Skip to content

fix(windows): make QA panel close button clickable#240

Merged
H-Chris233 merged 1 commit into
Open-Less:mainfrom
H-Chris233:main
May 4, 2026
Merged

fix(windows): make QA panel close button clickable#240
H-Chris233 merged 1 commit into
Open-Less:mainfrom
H-Chris233:main

Conversation

@H-Chris233
Copy link
Copy Markdown
Collaborator

@H-Chris233 H-Chris233 commented May 4, 2026

User description

Summary

Validation

  • cargo check -q (run in openless-all/app/src-tauri)

Closes #239


PR Type

Bug fix


Description

  • Fix Windows QA panel close clicks
    • Preserve no-activate showing with simpler native call
    • Remove topmost SetWindowPos from show path

Diagram Walkthrough

    flowchart LR
      A["Windows QA window show logic"] -- "simplify" --> B["Use ShowWindow(SW_SHOWNOACTIVATE) only"]
      B -- "improves" --> C["Close button receives clicks"]
Loading

File Walkthrough

Relevant files
Bug fix
lib.rs
Simplify Windows QA window show behavior                                 

openless-all/app/src-tauri/src/lib.rs

  • Simplifies show_qa_window_no_activate on Windows to call only
    ShowWindow(SW_SHOWNOACTIVATE).
  • Removes the extra SetWindowPos(..., HWND_TOPMOST, SWP_NOACTIVATE)
    step.
  • Keeps the existing fallback to window.show() when native no-activate
    display fails.
+5/-21   

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2ba637ee5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread openless-all/app/src-tauri/src/lib.rs Outdated
Comment on lines +648 to +649
if let Err(e) = window.show() {
log::warn!("[qa] show failed: {e}");
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve no-activate behavior when showing QA window on Windows

Replacing the Windows path with window.show() drops the only explicit SWP_NOACTIVATE/SW_SHOWNOACTIVATE handling, so opening the QA panel can reactivate OpenLess. That breaks the contract documented in show_qa_window (must not steal foreground focus) and can regress selection capture: begin_qa_session relies on the previously focused app remaining frontmost so AX/Cmd+C fallback reads the user’s selected text, not the QA webview. In practice, after opening QA on Windows, subsequent recording sessions may capture empty/wrong selection because focus has shifted.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

PR Reviewer Guide 🔍

(Review updated until commit 337eaeb)

Here are some key observations to aid the review process:

🎫 Ticket compliance analysis ✅

239 - PR Code Verified

Compliant requirements:

  • The Windows QA window now uses a simpler no-activate show path.
  • The Windows show path no longer applies the topmost SetWindowPos call.

Requires further human verification:

  • Verify on Windows that the QA popup now opens with a clickable close button in the actual UI.
  • Confirm the popup still appears in the expected z-order for the selection-QA flow after removing the topmost positioning call.
⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

…ction

Issue Open-Less#239 required the close button to be clickable, but a plain window.show() regression can steal focus and break selection capture assumptions in QA flow. Keep an explicit no-activate show on Windows while simplifying the native call path to only SW_SHOWNOACTIVATE.

Constraint: QA panel must not steal foreground focus when opening

Rejected: Keep plain window.show() | violates non-activation contract and risks wrong selection source

Confidence: medium

Scope-risk: narrow

Directive: If Windows QA show logic changes again, verify both close-button clickability and front-app selection capture

Tested: cargo check -q (openless-all/app/src-tauri)

Not-tested: Manual Windows interaction on physical device
@chatgpt-codex-connector
Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

Persistent review updated to latest commit 337eaeb

@H-Chris233 H-Chris233 merged commit f87e598 into Open-Less:main May 4, 2026
2 checks passed
appergb pushed a commit that referenced this pull request May 4, 2026
包含自 1.2.13 以来的修复与新功能:
- feat(autostart): 跨端开机自启 (#194)
- feat(asr): SiliconFlow / GLM-ASR / Groq / OpenAI Whisper preset (#212)
- fix(qa): Windows / Linux 划词追问浮窗 Esc + 拖拽 + 文案 (#205 / #206)
- fix(settings): preset 切换 race + per-provider 凭据隔离 (#219 / #220)
- fix(overview): 概览整屏适配 + 嵌套 scroller 细滚动条 (#243 / #248)
- 一系列 Windows IME (TSF) 模块 (#233 / #240 等)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(windows)划词提问功能的弹窗无法被关闭

1 participant