A tab bar's edge fade that stays hidden until something is off the edge

The local-attached covers were as wide as the scroll shadows and solid for
only 40% of that, so most of each shadow showed at rest -- invisible on Moria,
a grey sliver at both ends of every tab bar on Shire. The covers are now twice
the shadow's width and solid across all of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-28 06:53:45 +00:00
co-authored by Claude Opus 5.5
parent db22962164
commit dfd8418d95
4 changed files with 39 additions and 4 deletions
+18
View File
@@ -201,6 +201,24 @@ def test_a_tab_switch_moves_only_the_container_that_scrolls():
assert "outer.scrollTop" in handler
def test_the_tab_bar_edge_fade_is_covered_when_nothing_overflows():
"""The covers were as wide as the shadows and solid for only 40% of that,
so 60% of each shadow showed through with nothing to scroll to. On Shire
that was a grey sliver at both ends of every tab bar. A cover has to be
solid across the whole shadow. Measured in headless Chromium on
/admin/prompts and /settings in both themes before and after.
"""
admin = (ROOT / "web/static/css/admin.css").read_text(encoding="utf-8")
start = admin.index("background-attachment: local, local, scroll, scroll")
block = admin[admin.rindex(".tabs__bar {", 0, start) : start]
cover = re.search(r"linear-gradient\(to right, var\(--bg\) (\d+)%, transparent\)", block)
shadow = re.search(r"var\(--scrim\), transparent ([\d.]+)rem", block)
sizes = re.search(r"background-size: ([\d.]+)rem 100%, [\d.]+rem 100%, ([\d.]+)rem 100%", block)
assert cover and shadow and sizes, "the edge-fade rule changed shape; re-check it by eye"
solid = float(sizes.group(1)) * int(cover.group(1)) / 100
assert solid >= float(shadow.group(1)) == float(sizes.group(2))
def test_the_two_ends_of_the_shell_stay_level():
"""The sidebar footer and the composer sit either side of the same vertical
edge and are both content-sized, so without a common floor they end at