chrome: folded Back is a 44px target
Fable on c56314e, MEDIUM: folded to its chevron, Back was 30x44px. It is now at least 44px wide with the chevron centred (TestFoldedBackIsA44pxTarget). The browser check asserts the folded Back's box is at least 44x44; on c56314e it measured 30.0x44.0 in every phone case.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 files changed,
+13
−0
chrome/chrome.css+1 −0chrome/compact_browser_test.go+3 −0chrome/compact_test.go+9 −0
diff --git a/chrome/chrome.css b/chrome/chrome.css| index d534e52..4f46d45 100644 |
| --- a/chrome/chrome.css |
| +++ b/chrome/chrome.css |
| @@ -944,6 +944,7 @@ |
| [estilo-bar~="compact"] [estilo-bar-compact-title] { opacity: 0; visibility: hidden; transition: opacity 150ms ease, visibility 0s linear 150ms; } |
| [estilo-bar~="compact"][estilo-bar-folded]:has(> [estilo-bar-compact-title]) { border-block-end-color: var(--rst-line); } |
| [estilo-bar~="compact"][estilo-bar-folded] [estilo-bar-compact-title] { opacity: 1; visibility: visible; transition: opacity 150ms ease; } |
| + [estilo-bar~="compact"][estilo-bar-folded]:has(> [estilo-bar-compact-title]) [estilo-bar-brand] { min-inline-size: 44px; justify-content: center; padding-inline: 0; } |
| [estilo-bar~="compact"][estilo-bar-folded]:has(> [estilo-bar-compact-title]) [estilo-bar-name] { position: absolute; clip-path: inset(50%); inline-size: 1px; block-size: 1px; overflow: hidden; white-space: nowrap; } |
| } |
| @media (prefers-reduced-motion: reduce) { |
diff --git a/chrome/compact_browser_test.go b/chrome/compact_browser_test.go| index 08662fc..0bfcc2c 100644 |
| --- a/chrome/compact_browser_test.go |
| +++ b/chrome/compact_browser_test.go |
| @@ -291,6 +291,9 @@ func TestTheCompactBarInRealEngines(t *testing.T) { |
| if c.Rest.Title || c.Rest.Name < 10 || c.Rest.Border == c.Folded.Border { |
| t.Errorf("%s: at rest the compact title shows %v, Back's name is %.1fpx, the border %q (folded %q)", where, c.Rest.Title, c.Rest.Name, c.Rest.Border, c.Folded.Border) |
| } |
| + if len(c.Folded.Back) == 4 && (c.Folded.Back[2] < 43.5 || c.Folded.Back[3] < 43.5) { |
| + t.Errorf("%s: folded, Back is %.1fx%.1fpx, under 44", where, c.Folded.Back[2], c.Folded.Back[3]) |
| + } |
| if !c.Folded.Title || c.Folded.Name > 1 || strings.TrimSpace(c.Folded.Label) == "" { |
| t.Errorf("%s: folded, the compact title shows %v, Back's name is %.1fpx wide and Back reads %q", where, c.Folded.Title, c.Folded.Name, c.Folded.Label) |
| } |
diff --git a/chrome/compact_test.go b/chrome/compact_test.go| index a56f70c..c73d00a 100644 |
| --- a/chrome/compact_test.go |
| +++ b/chrome/compact_test.go |
| @@ -302,6 +302,15 @@ func TestACompactBarWithNavKeepsItsSheet(t *testing.T) { |
| } |
| } |
| +// Folded, Back is its chevron alone, still a 44px target (Fable, item 2). |
| +func TestFoldedBackIsA44pxTarget(t *testing.T) { |
| + src := string(CSS()) |
| + src = src[strings.Index(src, "/* ── Compact"):] |
| + if !regexp.MustCompile(`\[estilo-bar~="compact"\]\[estilo-bar-folded\]:has\(> \[estilo-bar-compact-title\]\) \[estilo-bar-brand\] \{[^}]*min-inline-size: 44px;[^}]*justify-content: center;`).MatchString(src) { |
| + t.Error("folded Back is not a centred 44px target") |
| + } |
| +} |
| + |
| // A compact bar fits 360px with room for the title: Back, the lead and a |
| // two-button trail are 300px in the mock-up, and the bar's own padding |
| // and gaps are the small steps. |