7 Commits

Author SHA1 Message Date
aaddrick
0fc8286943 fix: add isDestroyed guard in setApplicationMenu and TODO for getWindow fallback
Add isDestroyed() check in the setApplicationMenu interceptor to skip
destroyed windows when hiding menu bars, matching the defensive pattern
used elsewhere in the codebase.

Add TODO comment on getWindow() popup fallback limitation to flag that
callers like getIsMaximized() may behave unexpectedly when a popup is
returned instead of the main window.

Co-Authored-By: Claude <claude@anthropic.com>
2026-02-16 11:38:04 -05:00
aaddrick
75841f0813 fix: address code review feedback for PR #232
- Drop isVisible() filter from getWindow() fallback so flashFrame()
  works on minimized windows, which is its primary use case
- Add isDestroyed() guard to setTimeout resize callback to prevent
  errors if the window is closed within the 50ms delay

Co-Authored-By: Claude <claude@anthropic.com>
2026-02-16 11:30:26 -05:00
aaddrick
b544a7bb6c style: simplify comments and eliminate dead variable
- Trim verbose comments to be concise while preserving references
- Shorten log message to fit 80-char line width
- Remove intermediate `compositor` variable in launcher-common.sh
  since Niri is the only auto-detected compositor
- Combine local declaration with assignment

Co-Authored-By: Claude <claude@anthropic.com>
2026-02-16 11:25:24 -05:00
aaddrick
9410db246e docs: add cross-reference comments for flashFrame interaction
Add comments linking frame-fix-wrapper.js and claude-native-stub.js
for the flashFrame feature: the stub provides the API that the app
calls, while the wrapper auto-clears the attention state on focus.
This helps future maintainers understand the two-file relationship.

Addresses #231 item 9.

Co-Authored-By: Claude <claude@anthropic.com>
2026-02-16 10:12:53 -05:00
aaddrick
2245808836 fix: filter destroyed/invisible windows in getWindow() fallback
getAllWindows()[0] returns windows in arbitrary order, including
destroyed windows, DevTools, or popups. Calling flashFrame() on a
destroyed window throws; getIsMaximized() on a popup returns wrong
results. Filter to only visible, non-destroyed windows.

Also adds console.warn to the catch block so failures are logged
instead of silently swallowed.

Fixes: #231 item 3

Co-Authored-By: Claude <claude@anthropic.com>
2026-02-16 10:09:48 -05:00
vboi
83cbb9a022 fix: improve Linux UX with popup detection, functional stubs, and Wayland compositor support
- frame-fix-wrapper.js: Add popup/Quick Entry window detection (#223),
  CSS injection for scrollbar styling and font rendering, persistent
  menu bar hiding (#172), KDE attention flash fix (#149), and content
  resize fix (#84)
- claude-native-stub.js: Make getIsMaximized, flashFrame, setProgressBar
  functional using Electron's native Linux support instead of no-ops
- launcher-common.sh: Auto-detect Niri/Sway/Hyprland compositors and
  force native Wayland mode (#226), safe variable expansion with ${VAR:-}

Fixes #84, #149, #172, #223, #226

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:30:22 +01:00
aaddrick
4bf59866a3 refactor: extract embedded JS files from build.sh
- Extract frame-fix-wrapper.js to scripts/frame-fix-wrapper.js
- Extract claude-native stub to scripts/claude-native-stub.js
- Remove duplicate claude-native stub (was defined twice)
- Reduces build.sh by ~145 lines

Part of #179

Co-Authored-By: Claude <claude@anthropic.com>
2026-01-22 16:28:56 -05:00