Skip to content

feat(appearance): frame & browser-content density - #1776

Merged
l0gicgate merged 5 commits into
lgse:mainfrom
Danielelston:feat/1774-frame-browser-density
Oct 21, 2026
Merged

l0gicgate merged 5 commits into
lgse:mainfrom
Danielelston:feat/1774-frame-browser-density

Conversation

@Danielelston

Copy link
Copy Markdown
Contributor

What

Unit 1 of the Frame & Browser-Content Density feature (first of several
units landing on this one branch/PR):

  • BrowserDensity gains a Custom(u8) variant (0-16 logical px, clamped on
    every construction path). FrameDensity (Compact/Airy/Custom(u8)
    0-12) is added alongside it so the next unit doesn't re-derive the type;
    it is not applied anywhere yet.
  • PreferenceManager persists browser_density_custom_px, frame_density,
    and frame_density_custom_px (all serde-defaulted; an existing settings
    file with only browser_density keeps loading unchanged) and exposes
    accessors/setters for both areas. Each area's *_custom_px holds its last
    valid Custom value independent of the currently active mode (first-ever
    value is 4px; switching to a preset and back restores it).
  • Browser/Content Custom is applied live in Columns, List, and Icons: a
    density-custom CSS class plus a small generated, display-wide
    stylesheet (via ThemeManager, the same mechanism the existing
    token/text-size CSS uses, so it's live across every open window) set only
    vertical margin/padding, scaled from the one stored px value. Horizontal
    spacing, icon/image size, and text size are untouched. Icons' max grid
    columns in Custom is fixed at 20 regardless of the previously selected
    preset.
  • Documented the exact selector mapping in docs/preferences.md.

No UI surface changes yet (the Appearance menu still shows the flat
Compact/Airy radio group) — that's a later unit. Frame density fields exist
and are defaulted but not applied to any chrome yet.

Closes part of #1774 (tracked across multiple units on this branch).

How to test

  1. On a clean profile, BrowserView::set_density(BrowserDensity::Custom(n))
    (currently reachable only via a saved browser_density = "custom" /
    browser_density_custom_px = n in settings.toml, since the menu isn't
    wired yet) changes only vertical row/gap spacing in Columns, List, and
    Icons, live, without touching horizontal spacing or icon size.
  2. Existing saved browser_density = "compact" / "airy" files keep
    loading and rendering unchanged, including the 20/16 icon-column caps.
  3. cargo test coverage: ui::preferences::tests, ui::browser_modes::tests,
    ui::theme::tests, ui::window::tests, i18n:: all pass (see below).

Expected result

Browser/Content density has a working Custom mode end-to-end at the
preference/application layer; Frame density is stamped but inert; nothing
else regresses.

Checks run

  • cargo check --all-targets --all-features, cargo clippy --all-targets --all-features, cargo fmt --check — all clean.
  • ./scripts/test-headless.py ui::preferences::tests — 34 passed.
  • ./scripts/test-headless.py ui::browser_modes::tests — 7 passed.
  • ./scripts/test-headless.py ui::theme::tests — 29 passed.
  • ./scripts/test-headless.py ui::window::tests — 188 passed.
  • ./scripts/test-headless.py i18n:: — 12 passed.

@Danielelston
Danielelston force-pushed the feat/1774-frame-browser-density branch from da6a41e to fc28651 Compare October 21, 2026 00:31
…ity controls

- Browser/Content, Frame Top Bar, and Frame Side Bar each get an independent
  Compact/Airy/Custom density row in the Appearance menu's accordion rows,
  with live, saved, per-area state.
- Top Bar density also scales the horizontal spacing between its icons.
- Custom-px controls use a [decrease][value][increase] stepper.
- Updated docs, i18n (12 locales), and tests to match.
@Danielelston
Danielelston force-pushed the feat/1774-frame-browser-density branch 2 times, most recently from e456705 to 20487fb Compare October 21, 2026 00:48
…er-density

# Conflicts:
#	src/ui/browser_modes/tests.rs
…liders

- Content (0-16 px) and Frame (0-12 px) are sliders with tick marks at
  Compact and Airy; clicking a tick label snaps to that preset.
- Frame is one inset applied in lock step to the header, tab strip, sidebar
  rows, and Miller, Icons/List, and preview headers. The sidebar toggle keeps
  its alignment with the sidebar icons.
- Custom Content values interpolate through the Compact and Airy rules so the
  slider never jumps at a preset.
- Density CSS lives in its own provider and reloads only when a density
  changes, so dragging never reapplies the theme.
@l0gicgate
l0gicgate force-pushed the feat/1774-frame-browser-density branch from 20487fb to dc4b879 Compare October 21, 2026 02:20
@l0gicgate

Copy link
Copy Markdown
Contributor

Demo

Custom.spacing.mp4

@l0gicgate
l0gicgate merged commit cdf0323 into lgse:main Oct 21, 2026
9 checks passed
wmfeht added a commit to wmfeht/strata that referenced this pull request Oct 21, 2026
lgse#1776 replaced the Compact and Airy radio items with density sliders, so the appearance scenarios wait on and wheel over the Columns item instead, as their Python twins now do.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants