Centre the star on the task timeline
Constrained the live marker’s grid slot so the oversized star stays centred on full and compact timelines, leaving animation, labels and timestamps unchanged. Added desktop and mobile regression coverage, including reduced motion, that measures the main star rather than its satellite sparkles. Formatting passed, but dependency downloads and Chromium execution were blocked, so the fix still needs browser verification. Equipo task tk3pi43fqzjj, Engineering step attempt 1.
2 files changed,
+47
−0
internal/equipo/static/equipo.css+3 −0internal/thintest/inner_browser_test.go+44 −0
CI failed — run details
diff --git a/internal/equipo/static/equipo.css b/internal/equipo/static/equipo.css| index 016e7664..1f78b0f2 100644 |
| --- a/internal/equipo/static/equipo.css |
| +++ b/internal/equipo/static/equipo.css |
| @@ -464,6 +464,9 @@ a[equipo-source]:hover { color: var(--rst-text); text-decoration: underline; tex |
| [equipo-track-full] li[data-s="current"][data-tone="attention"] [equipo-dot]::after { background: var(--rst-tone-warning-fg); border-color: var(--rst-tone-warning-fg); box-shadow: 0 0 0 4px var(--rst-tone-warning-bg); } |
| [equipo-track-full] li[data-live] [equipo-dot]::after { display: none; } |
| [equipo-track-full] li[data-live] [equipo-mark] { font-size: 1.2rem; } |
| +/* Keep the oversized live mark centred in its node, not an implicit |
| + grid track enlarged to the mark's minimum size. */ |
| +[equipo-track] li[data-live], [equipo-track-full] li[data-live] [equipo-dot] { grid-template: minmax(0, 1fr) / minmax(0, 1fr); } |
| [equipo-track-full] li[data-s="current"] > span:not([equipo-dot]) { color: var(--rst-text); font-weight: 600; } |
| [equipo-track-full] li > span { text-align: center; white-space: nowrap; } |
| [equipo-track-full] li > small { color: var(--rst-text-faint); margin-block-start: -.3rem; } |
diff --git a/internal/thintest/inner_browser_test.go b/internal/thintest/inner_browser_test.go| index 3b78f079..b60ea603 100644 |
| --- a/internal/thintest/inner_browser_test.go |
| +++ b/internal/thintest/inner_browser_test.go |
| @@ -136,6 +136,50 @@ func (p *innerPage) shot(name string) { |
| func jsString(s string) string { raw, _ := json.Marshal(s); return string(raw) } |
| +// Measure the central star path, not the asymmetric satellite sparkles. |
| +func TestBrowserTrackStarCentre(t *testing.T) { |
| + g := newGallery(t) |
| + for _, width := range []int64{1280, 390} { |
| + for _, motion := range []string{"no-preference", "reduce"} { |
| + t.Run(fmt.Sprintf("%d/%s", width, motion), func(t *testing.T) { |
| + p := openInner(t, g.a.inst.URL, g.a.inst.Cookie(), width, 900, width == 390, "light", motion) |
| + defer p.stop() |
| + for _, full := range []bool{true, false} { |
| + path, selector := "/tasks", `[equipo-row][data-task="`+g.running+`"] [equipo-track]` |
| + if full { |
| + path, selector = "/tasks/"+g.running, "[equipo-track-full]" |
| + } |
| + p.open(path) |
| + // Sample while animations are running as well as with reduced motion. |
| + for sample := 0; sample < 2; sample++ { |
| + offsets := eval[[]float64](p, `(()=>{ |
| + const track=document.querySelector(`+jsString(selector)+`); |
| + const li=track.querySelector('[data-live]'); |
| + const node=li.querySelector('[equipo-dot]') || li; |
| + const n=node.getBoundingClientRect(), l=li.getBoundingClientRect(); |
| + const star=li.querySelector('[equipo-mark] svg path').getBoundingClientRect(); |
| + const x=(star.left+star.right)/2, y=(star.top+star.bottom)/2; |
| + const line=getComputedStyle(li,'::before'); |
| + const lineY=track.hasAttribute('equipo-track-full') |
| + ? l.top+parseFloat(line.top)+parseFloat(line.height)/2 |
| + : (l.top+l.bottom)/2; |
| + return [x-(n.left+n.right)/2,y-(n.top+n.bottom)/2,y-lineY]; |
| + })()`) |
| + for axis, offset := range offsets { |
| + // The hairline starts at the node centre, so its painted |
| + // centre is half a CSS pixel lower. |
| + if offset < -0.6 || offset > 0.6 { |
| + t.Fatalf("full=%v sample=%d axis=%d: star offset %.3fpx", full, sample, axis, offset) |
| + } |
| + } |
| + time.Sleep(100 * time.Millisecond) |
| + } |
| + } |
| + }) |
| + } |
| + } |
| +} |
| + |
| // fits: nothing wider than the viewport, the screen's own text visible. |
| func (p *innerPage) fits(what string) { |
| p.t.Helper() |