Skip to content

fix: v1.5.2 — visibility:hidden keeps title centered (display:none broke layout) - #62

Merged
nesquena-hermes merged 1 commit into
mainfrom
fix-v1.5.2-titlebar-icon-visibility
Apr 25, 2026
Merged

nesquena-hermes merged 1 commit into
mainfrom
fix-v1.5.2-titlebar-icon-visibility

Conversation

@nesquena-hermes

Copy link
Copy Markdown
Collaborator

Summary

One-line followup to v1.5.1. Changes display: none → visibility: hidden on .app-titlebar-icon.

Problem

v1.5.1 hid the icon with display: none !important, which removed it from the flex layout entirely. The title text was centered between the icon (left) and controls (right) — with the icon gone from layout, the title shifted left.

Fix

visibility: hidden renders the element as invisible but preserves its flex slot. The title stays centered exactly as intended. Icon: gone. Layout: intact.

- s.textContent = '.app-titlebar-icon { display: none !important; }';
+ s.textContent = '.app-titlebar-icon { visibility: hidden !important; }';

Pre-merge checklist

  • Mac agent build + visual verification:
cd /tmp/swift-mac-test
git clone https://github.com/hermes-webui/hermes-swift-mac . 2>/dev/null || true
git fetch origin && git checkout fix-v1.5.2-titlebar-icon-visibility && git pull --rebase

swift build -c release 2>&1
swift test 2>&1
bash build.sh 2>&1
open "Hermes Agent.app"
# Verify: icon invisible, title centered, traffic lights unobstructed
  • Independent review from nesquena account

Closes #61

…ntered

display:none (v1.5.1) removed the icon from the flex layout entirely,
shifting the title text left. visibility:hidden keeps the icon's layout
slot occupied so the title stays centered.

Closes #61.

@nesquena nesquena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verified on Mac agent at tip 5e54625.

Build/test results

  • swift build -c release — Build complete (2.51s, 0 warnings)
  • swift test — 22/22 passed
  • bash build.sh — .app built, ad-hoc signed, installed to /Applications

Scope: 9/-1 across 2 files (CHANGELOG + BrowserWindowController). One-character CSS swap.

Code review

The change is display: none → visibility: hidden on .app-titlebar-icon. Correct CSS-semantics fix:

  • display: none removes the element from the layout box tree entirely. In a flex container, that means the icon's flex slot disappears and remaining items reflow — the title text (presumably centered between icon-left and controls-right) shifts left to fill the void.
  • visibility: hidden renders the element invisible but preserves its layout box. The flex slot stays the same width, so the title stays centered exactly where v1.5.1 was supposed to leave it.

Everything else from v1.5.1 is unchanged: documentStart timing, (document.head || document.documentElement) fallback, forMainFrameOnly: true, !important qualifier, IIFE wrapper.

Same lifecycle/safety properties as the v1.5.1 review:

  • Re-injected on every main-frame load (incl. reconnectInPlace reload paths).
  • Static string literal, no XSS surface.
  • The element-creation race is benign — visibility: hidden applies as soon as the .app-titlebar-icon element matches the rule, regardless of whether it existed when the script ran.

Non-blocking follow-ups

None this round. Single-character CSS change, well-targeted to the specific layout break v1.5.1 introduced.

Ready to merge and tag v1.5.2.

@nesquena-hermes
nesquena-hermes merged commit 741e357 into main Apr 25, 2026
1 check passed
@nesquena-hermes
nesquena-hermes deleted the fix-v1.5.2-titlebar-icon-visibility branch April 25, 2026 23:41
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.

fix: title bar text off-center after v1.5.1 (display:none removes layout space)

2 participants