Skip to content

Conversation

@Eric-Guo
Copy link
Contributor

@Eric-Guo Eric-Guo commented Jan 17, 2026

What does this PR do?

Fix #9051 and #8666, tested in Windows by built a exe

My seeing error:

TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
TypeError: parameter 1 is not of type 'Element'.
    at getComputedStyle$1 (http://tauri.localhost/assets/index-BMEaQ_KQ.js:1707:91066)
    at isOverflowElement (http://tauri.localhost/assets/index-BMEaQ_KQ.js:1707:89839)
    at getOverflowAncestors (http://tauri.localhost/assets/index-BMEaQ_KQ.js:1707:91733)
    at autoUpdate (http://tauri.localhost/assets/index-BMEaQ_KQ.js:1707:99252)
    at Object.fn (http://tauri.localhost/assets/index-BMEaQ_KQ.js:1707:105253)
    at runComputation (http://tauri.localhost/assets/index-BMEaQ_KQ.js:2:8250)
    at updateComputation (http://tauri.localhost/assets/index-BMEaQ_KQ.js:2:7981)
    at runTop (http://tauri.localhost/assets/index-BMEaQ_KQ.js:2:9466)
    at runUserEffects (http://tauri.localhost/assets/index-BMEaQ_KQ.js:2:10730)
    at http://tauri.localhost/assets/index-BMEaQ_KQ.js:2:10322

Copilot AI review requested due to automatic review settings January 17, 2026 08:38
@github-actions
Copy link
Contributor

Hey! Your PR title fix(app) Added a Windows-only guard that makes window.getComputedStyle fall back to document.documentElement doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a Windows-specific workaround for a WebView2 issue where window.getComputedStyle can be called with non-Element values. The fix wraps the native getComputedStyle function to validate inputs and fall back to a safe element when needed.

Changes:

  • Added Windows platform detection using navigator.platform
  • Override window.getComputedStyle on Windows to handle invalid (non-Element) inputs from WebView2/Floating UI
  • Fall back to document.documentElement when the input is not a valid Element

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ck to document.documentElement when a non-Element slips through, which prevents Floating UI (used by Kobalte tooltips/popovers) from throwing in WebView2 after message submit.
@Eric-Guo Eric-Guo force-pushed the getComputedStyle_no_Element branch from a5bb3f2 to cccb1b9 Compare January 17, 2026 08:43
@Eric-Guo Eric-Guo changed the title fix(app) Added a Windows-only guard that makes window.getComputedStyle fall back to document.documentElement fix(desktop): Added a Windows-only guard that makes window.getComputedStyle fall back to document.documentElement Jan 17, 2026
@adamdotdevin adamdotdevin merged commit c4e4f2a into anomalyco:dev Jan 17, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The latest version of windows often crashes and its Settings are unavailable

2 participants