Public: anyone can read this; the crew can change it.

The live-update pill draws §5's badge, and .live-pill leaves the markup and its script #4715

opened this

Merged 44d 22h ago, live in production

The live-update pill in src/web/live.ts is now , so it draws §5's attn badge and no live-pill class is left in src/web markup or script. tsc, the design lint and test/design-lint.test.ts plus test/live-pages.test.ts all pass. I did not run the full bun test; the forge runs the full check on push.

Notes

opened this

The live-update pill in src/web/live.ts is now <a id="live-pill" class="badge" data-variant="attn" href="" hidden>, so it draws §5's attn badge and no live-pill class is left in src/web markup or script. tsc, the design lint and test/design-lint.test.ts plus test/live-pages.test.ts all pass. I did not run the full bun test; the forge runs the full check on push.

  • Script: it already found the pill by document.getElementById('live-pill'), so it needed no change.
  • Test: the new test in test/live-pages.test.ts asserts the badge markup and that no live-pill class is in the output. It also asserts the script selects the pill by id only.
  • Stylesheet: src/web/style/ and docs/DESIGN.md are untouched, as the issue says. The .live-pill rules there (in components.ts and the print rule in base.ts) now match nothing and go in the follow-up. I didn't touch docs/design/baseline.json, since the lint reported no counts to lower.
  • Layout: the pill is still hidden until news arrives, and it sits at the end of the page, so showing it moves nothing above it. The old rules floated it fixed at the bottom of the viewport. Without them it now appears as an inline badge where the mount sits. I didn't add a positioning class, since that would put styles back in this pull. If you want the floating position back, the follow-up has to give the badge a home.

Closes #4702

commented

Both of juniper's points are addressed and pushed to the same branch. tsc, the design lint, test/design-lint.test.ts and test/live-pages.test.ts pass; I didn't run the full bun test, since the forge runs the full check on push.

  • Dead CSS removed. The .live-pill rules in src/web/style/components.ts and its entry in the print rule in src/web/style/base.ts are gone. The stale .live-pill token on the style/base.ts line of docs/DESIGN.md is gone too. No live-pill class remains in src or docs. The only live-pill left is the #live-pill id.
  • Layout: I chose to keep it out of flow. The pill sits in a new .live-news wrapper, which is position: fixed, bottom-centred and pointer-events: none. The #live-pill badge inside it has pointer-events: auto, a 36px minimum height, 14px side padding and 13px text. Showing it inserts nothing into the page flow, so nothing shifts, and the target is the same size as the old pill's.
  • Docs. .live-news is named in a new docs/design/areas/live.md, with the reason a bare .badge can't carry this.
  • Test. A new test asserts the wrapper is position: fixed and the badge rule has min-height: 36px. A second assertion checks the badge's markup sits inside .live-news. These check the stylesheet text, not rendered layout, so they would catch a regression in either rule but not a visual one.
  • One change from the old look. I gave the badge a var(--card) background and --shadow-2 so it stays readable floating over content. The old pill used the primary colour.

I did not check the 360px tap target in a browser. This sandbox has no browser, so it rests on the CSS and the test.

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs