Skip to content

Chrome polish: light/dark ownership, real icon menu, full-height sidebar - #2

Merged
SachinD6 merged 4 commits into
mainfrom
fix/chrome-polish
Sep 24, 2026
Merged

SachinD6 merged 4 commits into
mainfrom
fix/chrome-polish

Conversation

@SachinD6

Copy link
Copy Markdown
Owner

Second polish round, driven by screenshots instead of guesses.

What was wrong

  • Light and dark overlapped. The chrome painted hardcoded hex values that fought the theme variant, and GTK has no light-dark() function, so those pins were the only thing "setting" a scheme. There was also nothing stopping the internal pages from disagreeing with the shell.
  • The hamburger menu never opened. It had 33 rows, which made it 1283 px tall. GTK silently refuses to show a popover taller than the window, so the click landed on a button that could not present anything.
  • Sidebar had no breathing room, and its selected row was an accent wash that turned muddy with a warm system accent.
  • The address bar was 40 px with a 20 px radius, inside a header that also drew its own padding.

What changed

  • Every chrome colour now comes from a libadwaita token in a new theme module, so surfaces follow the variant by construction. A test rejects raw colours. theme::apply returns what the toolkit actually did, and the internal pages are built from that same answer, so a page can never render light inside a dark shell.
  • One scheme decision, one stylesheet, one place to change chrome.
  • Chrome geometry: 34 px address bar at a 9 px radius with a tinted field, 8 px header padding, 28 px tabs with a round close button and an accent underline on the active tab, and a hairline under the tab strip.
  • The sidebar is 260 px and full height (it now sits beside the toolbar view, so the tab strip no longer runs across its top), with 34 px rows, 12 px insets, hover, a neutral selection plus an accent edge, an attention dot on the favicon, and hover-revealed close buttons that stay allocated so hovering never reflows a title.
  • The menu is a real icon menu: 22 rows with icons, shortcut hints, and a scroller. Palette rows carry icons too.
  • pages.rs now owns every internal page behind a small interface, with its own tests. main.rs drops from 6246 to 5241 lines.

Verification

  • scripts/ui-shot.sh runs the real binary under Xvfb and captures PNGs; scripts/px.py samples pixels; scripts/check-css.py enforces the token rule; BR0X_SHOT, BR0X_SHOT_OPEN, and BR0X_SHOT_DUMP are documented in docs/UI-VERIFY.md.
  • Sidebar surface measured: #ebebed in Light, #2e2e32 in Dark.
  • The menu now opens as a 305x590 popup on click, with content captured.
  • The pages extraction is pixel-identical: the start page renders to the same PNG bytes before and after (md5 c8df5f1b).
  • cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --check, cargo test --workspace (147 tests), scripts/check-css.py, and node --check on every inline script all pass.

…ss shots

Every chrome color now comes from a libadwaita token in a new theme
module, so the surfaces follow the theme variant instead of fighting it
with hardcoded hex. One scheme decision drives both the toolkit switch
and the internal pages, and the stylesheet is guarded by a test that
rejects raw colors.

Chrome geometry: 34px address bar with a 9px radius, tinted field, 8px
header padding, 28px tabs with a close circle, accent underline on the
active tab. The sidebar is 260px, full height, with 34px rows, 12px
insets, hover, a neutral selection plus an accent edge, an attention dot
on the favicon, and hover-revealed close buttons.

The hamburger menu is a custom popover: 22 icon rows with shortcut
hints, a checkmark on the engine rows, and a scroller because GTK
silently refuses to show a popover taller than the window. The command
palette rows carry icons too.

Verification: scripts/ui-shot.sh drives the real binary under Xvfb and
captures PNGs; scripts/px.py samples pixels; scripts/check-css.py
enforces the token rule. Light and dark captures verified, clippy -D
warnings, fmt, workspace tests.
The start page, history page, error page, and reader script now live in
pages.rs with a small interface: markup in, markup out, plus the start
page file's own path and URL. The shell no longer carries page design,
escaping, or favicon placeholders, and main.rs drops from 6246 to 5241
lines.

New tests at the seam: every page carries the requested colour scheme,
no page fetches a third-party asset, page text is escaped, and the start
page is stale exactly when its inputs change.

Verified behaviour-preserving by capture: the start page renders to a
byte-identical PNG before and after (md5 c8df5f1b), with clippy -D
warnings, fmt, and the workspace suite green. docs/UI-VERIFY.md records
the headless capture loop and the levers it uses.
The start page's hint card carried a dashed blue border that read as a
placeholder. It is now a quiet surface with a hairline, matching the
chrome's contrast in both schemes.
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: e5d8a243-6454-484a-b7af-ee844e98e7a1


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SachinD6
SachinD6 merged commit 522d35c into main Sep 24, 2026
2 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.

1 participant