Skip to content

Fix Linux titlebar tooltip overlap - #421

Merged
ilysenko merged 2 commits into
ilysenko:mainfrom
lw33:codex/fix-linux-titlebar-tooltips
Jun 6, 2026
Merged

Fix Linux titlebar tooltip overlap#421
ilysenko merged 2 commits into
ilysenko:mainfrom
lw33:codex/fix-linux-titlebar-tooltips

Conversation

@lw33

@lw33 lw33 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Reserve Linux window-control space in the webview safe-area map so header chrome does not render under the native minimize/maximize/close controls.
  • Increase Linux tooltip collision padding near the titlebar so floating tooltips avoid the native controls.
  • Remove the native title attribute from the thread side-panel toggle while keeping aria-label and the Codex tooltip, preventing duplicate tooltips.

Why

On Linux, the top-right thread side-panel toggle could show both the Codex tooltip and the browser/Electron native title tooltip. Tooltips near the native titlebar controls could also overlap the minimize/close buttons because Linux titlebar geometry was not reserved consistently.

Source Of Truth Files Edited

  • scripts/patches/main-process.js
  • scripts/patches/webview-assets.js
  • scripts/patches/core/all-linux/webview/theme-and-sunset/patch.js
  • scripts/patch-linux-window-ui.test.js

Validation

  • node --test scripts/patch-linux-window-ui.test.js passes: 187/187.
  • Dry-ran the new thread side-panel patch against the generated thread-app-shell-chrome chunk and confirmed it removes the native title while preserving aria-label and tooltipContent.

Environment / Limitations

  • Validated against the currently generated local webview assets in this checkout.
  • Did not rebuild native packages; this change is limited to ASAR/webview patch descriptors and patcher tests.

Risks / Follow-up

  • These patches target minified upstream webview chunks and remain fail-soft. If upstream chunk structure drifts, patch reports will warn and the regression tests should be updated with the new bundle shape.

@avifenesh avifenesh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is an auto review done by revuto.


Found one patching invariant issue in the new webview asset helper.

Comment thread scripts/patches/webview-assets.js Outdated

const defaultInset = "applicationMenu:Object.freeze({left:0,right:0})";
if (currentSource.includes(defaultInset)) {
return currentSource.replace(defaultInset, currentInset);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is an auto review done by revuto.


This new webview/ASAR patch uses String.prototype.replace, so it only updates the first matching safe-area literal. The repo's ASAR patching invariant (P1) requires patch helpers to process every eligible occurrence, or to explicitly assert that the needle is unique, because upstream minified bundles can contain duplicate literals/call sites. If applicationMenu:Object.freeze({left:0,right:0}) appears more than once in this chunk after upstream drift, the remaining maps will keep right:0 and titlebar chrome can still render under the Linux window controls. Please switch this to match-index/all-occurrence replacement or add a uniqueness assertion for this needle.

@ilysenko ilysenko left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed current head. The earlier patching invariant issue is fixed by patching all matching occurrences and covering mixed already-patched/default cases in tests.

@ilysenko
ilysenko merged commit 44798b3 into ilysenko:main Jun 6, 2026
6 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.

3 participants