Skip to content

Fix: keep badges from losing their rounded shape in Safari - #29

Merged
SandObserver merged 1 commit into
mainfrom
fix/badge-repaint-safari
Aug 10, 2026
Merged

SandObserver merged 1 commit into
mainfrom
fix/badge-repaint-safari

Conversation

@SandObserver

Copy link
Copy Markdown
Owner

Summary

  • Skip the badge DOM writes in bupd() when the computed appearance matches what the element already shows, tracked per element in a WeakMap.
  • Add badgeSignature() to badge-logic.js, covering every returned field that reaches the element, NUL-separated so fields cannot pack into one another.
  • Pin .badge to a stable compositing layer with transform:translateZ(0) so WebKit stops promoting and demoting it as classes and inline colours change next to the transformed icon wrapper.

Testing
All green. Added 4 frontend tests covering signature stability, per-field sensitivity, field packing and the stale variant.

Checklist

  • Stays within the project constraints: one container, no runtime dependencies, no build step (see CONTRIBUTING.md).
  • Tests added or updated for new logic, and the full suite, lint, and typechecks pass.
  • Docs updated if behavior or configuration changed.
  • CHANGELOG.md updated under Unreleased if the change is user-visible.

@SandObserver SandObserver added the bug Something isn't working label Aug 10, 2026
Badge updates rewrote className, textContent, background and colour on every
poll cycle for every registered badge, and once more per child update for a
folder badge, whether or not the values had changed. Over a long session that
repaint churn left WebKit rasterising the badge's clipped corners torn.

Skip the DOM writes when the computed appearance is identical to what the
element already shows, and pin the badge to a stable compositing layer so
WebKit stops promoting and demoting it as its classes and inline colours
change.
@SandObserver
SandObserver force-pushed the fix/badge-repaint-safari branch from 95d661d to 3f14c08 Compare August 10, 2026 22:16
@SandObserver
SandObserver merged commit c359256 into main Aug 10, 2026
4 checks passed
@SandObserver
SandObserver deleted the fix/badge-repaint-safari branch August 10, 2026 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant