Skip to content

ui: the overscan frame becomes a bound, and six screens were outside it - #61

Merged
GLinnik21 merged 1 commit into
mainfrom
b9-overscan
Aug 23, 2026
Merged

GLinnik21 merged 1 commit into
mainfrom
b9-overscan

Conversation

@GLinnik21

Copy link
Copy Markdown
Collaborator

Unit B9 — LG App Self Checklist #2 (overscan frame), #5 (display/resolution), #7 (focus states).

What was wrong

docs/lg-self-checklist.md marked #2 a pass on this sentence:

UI authored at 1920×1080 with MARGIN_X 90 (4.7%), inside the 5% overscan frame.

That reads as clearance and is the opposite. A 4.7% margin puts content nearer the edge than a 5% one, so every screen in the app began six pixels inside the exclusion zone. Nobody had ever measured a screen — the number stood in for the measurement, exactly as the splash's "63% black" did until somebody looked at the panel.

The vertical half was worse, because it did not exist. There was no MARGIN_Y anywhere in the tree, so nothing bounded the top or bottom of anything.

The audit — measured, at a real 1920×1080

Every screen was booted in the simulator at SIM_W=1920 SIM_H=1080 and overlaid with the 5% frame (x 96…1823, y 54…1025). SIM_W/SIM_H are not optional here: left empty the window fits the display, which on a 1× screen is half the authored canvas and makes every margin measurement wrong.

Screen / element Where it was Frame Out by
Top tab track (Home, Library, Search) y 36 y ≥ 54 18 px
Top tab pills / profile chip y 44 y ≥ 54 10 px
Profile chip, focused capsule x 82 x ≥ 96 14 px
Library A–Z rail x 1834…1878 x ≤ 1824 32 px ⚠ worst
Detail pinned compact title y 40 band top; y 22 for a square clearLogo y ≥ 54 14 / 32 px
Library grid last column, item count x → 1830 x ≤ 1824 6 px
Library toolbar chips, grid first column x 90 x ≥ 96 6 px
Home hero logo / meta / synopsis / action row x 90 x ≥ 96 6 px
Detail hero column + right-aligned people column x 90 → 1830 96…1824 6 px
Person portrait + shelves; Onboard copy column x 90 x ≥ 96 6 px
Search field, headings, result shelves x 90 x ≥ 96 6 px
Chapters strip, every card_row shelf x 90 x ≥ 96 6 px
Player HUD scrubber / title / bottom tabs x 90 x ≥ 96 6 px
Player HUD control discs (right: 80) x → 1840 x ≤ 1824 16 px
Track menu + … overflow panels (right: 80) x → 1840 x ≤ 1824 16 px
Account menu panel x 80 x ≥ 96 16 px
Item menu / Also-available panels (edge clamp) x 64 worst case x ≥ 96 32 px
Stats read-out panel x 60 x ≥ 96 36 px
Home / Library / Person scroll reveal, focused card caption 24 / 16 / 40 px above the edge ≥ 54 30 / 38 / 14 px
Library last row's caption (scroll ceiling) 20 px above the edge ≥ 54 34 px

Clean on both axes already, and unchanged: Login (QR + code, centred), the profiles picker, the exit alert, About / Track-information / Person-bio alerts (EDGE_CLEAR 68, centred), the failure read-out (centred).

Measured confirmation (ink extremes against the page ground, dev FPS counter masked — it is devtools, compiled out of RELEASE):

Screen before after
Library x 77…1877, y 36…1060 x 83…1823, y 54…1078
Search x 89…1460, y 36…1079 x 95…1466, y 54…1079

The residual 83 / 95 on the left is the focused card's own drop shadow and the field capsule's antialiased edge — the drawn rects are at exactly 96. The residual bottom is the scrolling shelf's peek, which is by design.

What changed

Tokens (ui/consts.rs): MARGIN_X 90 → 96, new MARGIN_Y 54, plus SAFE: Rect and inside_safe(r) so nothing re-derives the frame and gets a sign wrong.

Derived instead of respelled — the shape that let 90 survive was the margin being spelled twice: player_hud::SB_X, search::FIELD.x, CTRL_RIGHT, both player panels' right: 80, account_menu's px, stats' panel x and CHIP_FRAME now all read the token.

Moved:

  • widgets::TOP_BAR_Y 44 → MARGIN_Y + TAB_TRACK_PAD (62), measured from the band's outermost ink so the whole control clears the frame, not just the part you press. consts::GRID_TOP_Y, library::TOOL_Y/GRID_TOP and search::FIELD.y/CONTENT_TOP follow it by 18px, keeping their stated clearances.
  • CHIP_FRAME.x → MARGIN_X + TAB_TRACK_PAD: it is the capsule that lands on the margin, as the tab track's does.
  • detail::COMPACT_TITLE_BOT is solved from the frame (MARGIN_Y + COMPACT_H_MAX), and TOP_MARGIN follows it — the tallest logo, not the reserved band, is what has to clear the top.
  • Scroll reveals: Home/Library/Person/Search bottom keep-outs are MARGIN_Y. Library's scroll ceiling moved with its reveal bound — they are a pair, and moving only one left the last row 34px short.
  • The two anchored popovers got a per-axis keep-out: space::XL 64 already cleared MARGIN_Y and missed MARGIN_X by 32.

The A–Z rail could not be fixed by moving the rail. With the grid filling SCR_W − 2·MARGIN_X exactly there is no room inside the frame for a 44px control to its right, so the grid now reserves RAIL_BAND unconditionally (LGAP 48 → 35.2). Unconditional because widening the grid when the rail is absent moves every column between two sections of one library, and a grid that reflows as you change tab is worse than one that is slightly narrower and never moves — the same argument draw_rail already makes for top-anchoring rather than centring.

The test — the invariant, not the literal

no_required_content_enters_the_safe_area_exclusion_zone (in ui/consts.rs) grades the composed rect of every screen and panel — 30 rows, contributed by eight #[cfg(test)] overscan_rects probes plus the geometry already public there — against consts::SAFE. There is deliberately no assert_eq!(MARGIN_X, 96.0): that passes today and forbids the very fix an audit needs. Each probe is asserted to contribute individually, because a table-wide row floor cannot see one of eight going silent.

"Required" is doing real work. A full-bleed backdrop, page ground, scrim, focus glow and a shelf peeking off the bottom edge are all supposed to reach the panel edge. Tiles are entered at REST for the same reason: the 1.09 focus pop magnifies ink already inside the frame, strictly contains its resting rect, and does not scale the caption. The compact logo is graded at its spill — there the spill is the logo.

Two more tests pin what the table cannot: the Library's last-row reveal (pure arithmetic over the lo/max_y pair) and the two anchored popovers at their clamp extremes.

One design cost, stated as a trade

Dropping the top bar 18px grows the tab band's backdrop-blur region by 18 rows of a ~1470px-wide grab, which puts widgets::GLASS_TRACK_MAX outside gfx::GLASS_REGION_BUDGET. It is now the min of its two constraints rather than the "must not touch" rule alone, so the glass material comes off a strip wider than ~672px instead of ~848. The product's own strip is 572px, so today's bar is unaffected and one more library still keeps it; two more drop to the flat capsule, which is a designed, shipped alternative rather than a break. If that is judged too tight the lever is the measured budget (docs/glass-hardware-budget.md §11 already records the region term as ~4× conservative on the direct source path), not the frame.

While re-deriving it, GLASS_TRACK_BUDGET_MAX's closed form was found to assume a union left edge of 0 — true when the capsule started at x=82, false now that it starts at 96. Fixed, and the test now re-derives both bounds through gfx::blur_region_union rather than comparing the constant against the two constants it is the min of (which only NaN could fail).

#7 — focus / selected states

Audited screen by screen; nothing needed changing, and the checklist row now says what was looked at rather than what was believed. All three states are distinguishable, and on two surfaces they are visible simultaneously:

  • Tab strip: idle = bare label, no capsule; focused = bright white capsule with dark ink; selected = subtle plated capsule with white bold ink. Captured with focus on Movies while TV Shows was selected.
  • TableView rows (Sort menu): idle = plain label; selected = ✓ in the leading column; focused = white pill spanning the row. Captured with focus two rows below the checked one.
  • Cards: idle vs focused separated by scale, drop shadow and the title/caption band only the focused tile draws.

Two published LG numbers, and which one this is graded against

LG's developer overscan guide states a 20px margin; the checklist item says "overscan frame", which by broadcast convention is 5%. This is graded against 5%, because a layout that satisfies 5% satisfies 20px and not the other way round. Both are recorded in MARGIN_X's doc and in the checklist note.

#5 — display / resolution

No change needed and none made. The UI stays authored at logical 1920×1080; the drawable is read back by surface.rs (1920×1080 on every device so far, scale() = 1.0); the panel's 3840×2160 remains a diagnostic and is not a layout input anywhere in this diff.

Files

ui/consts.rs (tokens + SAFE/inside_safe + the audit test) · ui/theme.rs (logo::COMPACT_H_MAX doc) · ui/widgets.rs (top bar, chip frame, glass cap) · ui/library.rs · ui/detail.rs · ui/home.rs · ui/person.rs · ui/search/mod.rs · ui/search/results.rs · ui/player_hud.rs · ui/account_menu.rs · ui/track_menu.rs · ui/more_menu.rs · ui/item_menu.rs · ui/alt_sources.rs · ui/stats.rs · ui/onboard.rs · docs/lg-self-checklist.md.

ui/widgets.rs is a shared component file rather than a screen: the edits there are TOP_BAR_Y, CHIP_FRAME, TAB_SIDE_CLEAR, the glass cap and one test probe. Naming it explicitly because other lanes are in UI files.

Verification

  • make check — 980 passed, lint clean, both feature configurations type-check (the RELEASE=1 hook ran on every .rs edit).
  • Simulator at 1920×1080: Home, Home grid, Library, Detail, Search, account menu, item menu, Login, Onboarding, plus live-driven tab-row / toolbar / Sort-menu focus states.
  • /code-review high run and its findings applied — including two real bugs it caught that the audit table could not: the Library scroll ceiling and search::results::BOTTOM_PAD.

Not verified on a television. This lane had no device access, so nothing here is a claim about frame rate or text rasterization. The one thing that wants a device pass is the tab bar's glass at the new region size.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist
item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame".
That reads as clearance and is the opposite: a smaller margin puts content
NEARER the edge, so every screen in the app sat six pixels inside the exclusion
zone. Nobody had ever measured one.

The vertical half was worse, because it did not exist. There was no MARGIN_Y
anywhere in the tree, so nothing bounded the top or bottom of anything, and
four places were further out than the horizontal margin ever was:

  - the shared top tab bar + profile chip, 18px (the "main page" the item names)
  - the detail page's pinned compact title, 14px — and 32 for a square
    clearLogo, which spills upward as paint rather than as layout
  - the Library's A-Z rail, 32px, the worst in the app
  - the Home / Library / Person scroll reveals, which settled a focused card's
    caption 24 / 16 / 40px off the bottom edge

Both margins are tokens now (96 / 54), and the requirement is a host test
rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone`
grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a
later audit can move a token — or give one screen a correction of its own —
without the test being rewritten to permit it. Deliberately no
`assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix.

"Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a
focus glow and a shelf peeking off the bottom edge are all supposed to reach
the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus
pop magnifies ink already inside the frame and its caption does not scale —
while the compact logo IS graded at its spill, because there the spill is the
logo.

The A-Z rail could not be fixed by moving the rail: with the grid filling
`SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px
control to its right, so the grid now reserves the band unconditionally (a
reflow between two sections of one library is worse than a slightly narrower
grid that never moves).

One design cost, because it is a trade rather than a fix: dropping the top bar
18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts
`GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its
two constraints now instead of the "must not touch" rule alone, so the glass
comes off a strip wider than ~672px rather than ~848. The product's strip is
572, so today's bar is unaffected and one more library still keeps it. If that
is too tight the lever is the measured budget, not the frame.

Checklist item #7 (idle / focused / selected distinguishable) was audited screen
by screen at the same time and needed no change; the doc row says what was
looked at instead of what was believed.

Verified: `make check` 980 green, and the simulator at a real 1920x1080 —
Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83
is the focused card's own drop shadow, the 1078 the scrolling shelf's peek).
No television: this lane is host-only.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G
@GLinnik21
GLinnik21 merged commit b6c7909 into main Aug 23, 2026
2 checks passed
GLinnik21 added a commit that referenced this pull request Aug 26, 2026
…it (#61)

The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist
item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame".
That reads as clearance and is the opposite: a smaller margin puts content
NEARER the edge, so every screen in the app sat six pixels inside the exclusion
zone. Nobody had ever measured one.

The vertical half was worse, because it did not exist. There was no MARGIN_Y
anywhere in the tree, so nothing bounded the top or bottom of anything, and
four places were further out than the horizontal margin ever was:

  - the shared top tab bar + profile chip, 18px (the "main page" the item names)
  - the detail page's pinned compact title, 14px — and 32 for a square
    clearLogo, which spills upward as paint rather than as layout
  - the Library's A-Z rail, 32px, the worst in the app
  - the Home / Library / Person scroll reveals, which settled a focused card's
    caption 24 / 16 / 40px off the bottom edge

Both margins are tokens now (96 / 54), and the requirement is a host test
rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone`
grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a
later audit can move a token — or give one screen a correction of its own —
without the test being rewritten to permit it. Deliberately no
`assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix.

"Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a
focus glow and a shelf peeking off the bottom edge are all supposed to reach
the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus
pop magnifies ink already inside the frame and its caption does not scale —
while the compact logo IS graded at its spill, because there the spill is the
logo.

The A-Z rail could not be fixed by moving the rail: with the grid filling
`SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px
control to its right, so the grid now reserves the band unconditionally (a
reflow between two sections of one library is worse than a slightly narrower
grid that never moves).

One design cost, because it is a trade rather than a fix: dropping the top bar
18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts
`GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its
two constraints now instead of the "must not touch" rule alone, so the glass
comes off a strip wider than ~672px rather than ~848. The product's strip is
572, so today's bar is unaffected and one more library still keeps it. If that
is too tight the lever is the measured budget, not the frame.

Checklist item #7 (idle / focused / selected distinguishable) was audited screen
by screen at the same time and needed no change; the doc row says what was
looked at instead of what was believed.

Verified: `make check` 980 green, and the simulator at a real 1920x1080 —
Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83
is the focused card's own drop shadow, the 1078 the scrolling shelf's peek).
No television: this lane is host-only.


Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21 added a commit that referenced this pull request Aug 27, 2026
…it (#61)

The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist
item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame".
That reads as clearance and is the opposite: a smaller margin puts content
NEARER the edge, so every screen in the app sat six pixels inside the exclusion
zone. Nobody had ever measured one.

The vertical half was worse, because it did not exist. There was no MARGIN_Y
anywhere in the tree, so nothing bounded the top or bottom of anything, and
four places were further out than the horizontal margin ever was:

  - the shared top tab bar + profile chip, 18px (the "main page" the item names)
  - the detail page's pinned compact title, 14px — and 32 for a square
    clearLogo, which spills upward as paint rather than as layout
  - the Library's A-Z rail, 32px, the worst in the app
  - the Home / Library / Person scroll reveals, which settled a focused card's
    caption 24 / 16 / 40px off the bottom edge

Both margins are tokens now (96 / 54), and the requirement is a host test
rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone`
grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a
later audit can move a token — or give one screen a correction of its own —
without the test being rewritten to permit it. Deliberately no
`assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix.

"Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a
focus glow and a shelf peeking off the bottom edge are all supposed to reach
the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus
pop magnifies ink already inside the frame and its caption does not scale —
while the compact logo IS graded at its spill, because there the spill is the
logo.

The A-Z rail could not be fixed by moving the rail: with the grid filling
`SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px
control to its right, so the grid now reserves the band unconditionally (a
reflow between two sections of one library is worse than a slightly narrower
grid that never moves).

One design cost, because it is a trade rather than a fix: dropping the top bar
18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts
`GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its
two constraints now instead of the "must not touch" rule alone, so the glass
comes off a strip wider than ~672px rather than ~848. The product's strip is
572, so today's bar is unaffected and one more library still keeps it. If that
is too tight the lever is the measured budget, not the frame.

Checklist item #7 (idle / focused / selected distinguishable) was audited screen
by screen at the same time and needed no change; the doc row says what was
looked at instead of what was believed.

Verified: `make check` 980 green, and the simulator at a real 1920x1080 —
Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83
is the focused card's own drop shadow, the 1078 the scrolling shelf's peek).
No television: this lane is host-only.


Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
GLinnik21 added a commit that referenced this pull request Aug 28, 2026
…it (#61)

The margin token said 90 and `docs/lg-self-checklist.md` marked LG checklist
item #2 a pass on the words "MARGIN_X 90 (4.7%), inside the 5% overscan frame".
That reads as clearance and is the opposite: a smaller margin puts content
NEARER the edge, so every screen in the app sat six pixels inside the exclusion
zone. Nobody had ever measured one.

The vertical half was worse, because it did not exist. There was no MARGIN_Y
anywhere in the tree, so nothing bounded the top or bottom of anything, and
four places were further out than the horizontal margin ever was:

  - the shared top tab bar + profile chip, 18px (the "main page" the item names)
  - the detail page's pinned compact title, 14px — and 32 for a square
    clearLogo, which spills upward as paint rather than as layout
  - the Library's A-Z rail, 32px, the worst in the app
  - the Home / Library / Person scroll reveals, which settled a focused card's
    caption 24 / 16 / 40px off the bottom edge

Both margins are tokens now (96 / 54), and the requirement is a host test
rather than a literal. `no_required_content_enters_the_safe_area_exclusion_zone`
grades the COMPOSED rect of every screen and panel against `consts::SAFE`, so a
later audit can move a token — or give one screen a correction of its own —
without the test being rewritten to permit it. Deliberately no
`assert_eq!(MARGIN_X, 96.0)`: that passes today and forbids the fix.

"Required" is load-bearing. A full-bleed backdrop, a page ground, a scrim, a
focus glow and a shelf peeking off the bottom edge are all supposed to reach
the panel edge. Tiles are entered at REST for the same reason — the 1.09 focus
pop magnifies ink already inside the frame and its caption does not scale —
while the compact logo IS graded at its spill, because there the spill is the
logo.

The A-Z rail could not be fixed by moving the rail: with the grid filling
`SCR_W - 2*MARGIN_X` exactly there was no room inside the frame for a 44px
control to its right, so the grid now reserves the band unconditionally (a
reflow between two sections of one library is worse than a slightly narrower
grid that never moves).

One design cost, because it is a trade rather than a fix: dropping the top bar
18px grows the tab band's blur region by 18 rows of a ~1470px grab, which puts
`GLASS_TRACK_MAX` outside `gfx::GLASS_REGION_BUDGET`. It is the `min` of its
two constraints now instead of the "must not touch" rule alone, so the glass
comes off a strip wider than ~672px rather than ~848. The product's strip is
572, so today's bar is unaffected and one more library still keeps it. If that
is too tight the lever is the measured budget, not the frame.

Checklist item #7 (idle / focused / selected distinguishable) was audited screen
by screen at the same time and needed no change; the doc row says what was
looked at instead of what was believed.

Verified: `make check` 980 green, and the simulator at a real 1920x1080 —
Library's ink went x 77..1877 / y 36..1060 to x 83..1823 / y 54..1078 (the 83
is the focused card's own drop shadow, the 1078 the scrolling shelf's peek).
No television: this lane is host-only.


Claude-Session: https://claude.ai/code/session_01GovTtrsD9P7Ld7DnLCMK2G

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@GLinnik21
GLinnik21 deleted the b9-overscan branch September 3, 2026 18:09
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