Skip to content

feat(navigation): give the You tab's photo slot an unselected state - #1383

Merged
bmc08gt merged 1 commit into
code/cashfrom
feat/nav-you-tab-avatar-states
Aug 31, 2026
Merged

feat(navigation): give the You tab's photo slot an unselected state#1383
bmc08gt merged 1 commit into
code/cashfrom
feat/nav-you-tab-avatar-states

Conversation

@bmc08gt

@bmc08gt bmc08gt commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

The You tab's photo slot wore the same 2dp solid white ring whether or not the tab was selected, so the only unselected cue was the slot's 0.5 alpha. Node 9713:664 gives the photo an unselected state of its own: a 1px ring in white at 50%, which the slot's 50% opacity halves again to the 25% the frame composes to.

The ring width animates alongside the existing icon fade, and the ring colour's alpha comes from that same animation, so the two stay in step through a tab switch. The padding around the ring stays at thickBorder in both states, so the photo keeps its size as the ring thins — only the inset ring changes.

The glyph state (no photo) is untouched.

States

Node 9713:664 Rendered
Active, photo 2px solid white 2dp ring, #FFFFFF
Not active, photo 1px white 50%, frame at 50% opacity 1dp ring measuring (125, 117, 112) over the dimmed photo — white at 25%
No image 32x32 glyph, no ring unchanged

The rendered column is sampled from a Robolectric capture at mdpi, where a dp is a pixel, so those widths compare against the design's px values directly.

Previews and capture

The existing NavigationBarPreview passes no avatar, so neither photo state showed up in previews. This adds one preview per state, and a NavigationBarAvatarScreenshotTest that writes all three states to build/screenshots/ — the same shape as TokenCardWatermarkScreenshotTest and BlocklistScreenshotTest. A flat fill stands in for the photo, since neither a preview nor a Robolectric test has a profile to read.

The photo slot wore the same 2dp solid white ring whether or not the tab was
selected, so the only unselected cue was the slot's 0.5 alpha. Node 9713:664
draws the unselected ring thinner and dimmer: 1px white at 50%, which the slot
alpha halves again to the 25% the frame composes to.

Animate the ring width alongside the existing icon fade, and take the ring
colour's alpha from that same animation so the two stay in step. The padding
around the ring stays at thickBorder in both states, so the photo doesn't
resize as the ring thins.

The existing preview passes no avatar, so neither photo state was visible in
previews. Add one per state, plus a Robolectric capture of all three states in
the shape of the two screenshot tests already in this module — at mdpi, where a
dp is a pixel and the ring measures against the design's px values directly.
@bmc08gt bmc08gt self-assigned this Aug 31, 2026
@github-actions github-actions Bot added the type: feature New functionality label Aug 31, 2026
@bmc08gt
bmc08gt merged commit 7700298 into code/cash Aug 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant