Skip to content

feat(cockpit): a dot on the favicon while the inbox holds work - #30

Merged
jtomaszewski merged 2 commits into
mainfrom
jtomaszewski/favicon-inbox-dot
Aug 21, 2026
Merged

feat(cockpit): a dot on the favicon while the inbox holds work#30
jtomaszewski merged 2 commits into
mainfrom
jtomaszewski/favicon-inbox-dot

Conversation

@jtomaszewski

Copy link
Copy Markdown
Contributor

The cockpit is a background tab most of the day, and the only part of it still
on screen is the tab icon. Until now that icon said nothing: whether two PRs
were waiting or none, the paw looked the same, so the only way to find out was
to switch to the tab and look.

The bell already covers the loud half of this — it interrupts when a PR lands.
This is the quiet half: while the inbox holds anything, the favicon wears a red
dot, and the dot goes away when the last review is dealt with. No permission to
grant, no switch to find; a glance at the tab strip answers "is there anything
for me?".

What it does

  • web/public/favicon-dot.svg — the badged twin of the paw: the same three
    toes and pad, stood down slightly to make room for a dot in the top-right
    rather than cut away under it (at 16px a chewed toe reads as a broken icon).
    A masked gap keeps the dot a separate shape whatever colour the tab bar
    behind it is, and the dark-mode fills follow favicon.svg's own convention.
  • web/src/favicon.tshasInboxWork is the whole decision, and it is
    deliberately the same walkable list the ‹ › arrows walk and the bell
    announces. Three ways of saying "there is work here" that would be worth
    nothing if they disagreed about which rows count.
  • web/src/api.tsfetchReviews re-badges the tab on every read. Three
    screens poll that list on their own timers; doing it in the one function they
    all go through is the only version of "the tab matches the last queue the
    cockpit saw" that cannot go stale on whichever screen forgot.

The dot tracks the inbox only — not the open-requests tab. Those are PRs you
already settled here; GitHub still listing a request is a fact about GitHub,
not work the tab should nag you about.

Verification

  • pnpm typecheck && pnpm test — 390 passing, including new unit tests for
    hasInboxWork (empty queue, awaiting, ready, all-filed, one live row among
    filed ones) and faviconHref.
  • pnpm build — the new asset ships in web/dist.
  • Rendered both icons at 16/32/128px in a browser: all three toes intact, dot
    legible at 16px.
  • Drove the real cockpit against a running server: empty inbox → favicon.svg;
    with a live row → favicon-dot.svg; back to empty → plain again.

The cockpit is a background tab most of the day, where the only part of it
still on screen is the tab icon. The bell is the loud half of telling you a PR
is waiting; this is the quiet half — the paw wears a red dot while the inbox
has anything in it, and drops it when the last review is dealt with.

Re-derived on every read of the queue, so whichever screen polled last leaves
the tab honest, and off the same `walkable` list the ‹ › arrows walk and the
bell announces — three ways of saying "there is work here" that would be worth
nothing if they disagreed about which rows count.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “work waiting” badge to the cockpit tab icon so users can tell (at a glance, from the tab strip) whether the inbox currently contains actionable items.

Changes:

  • Introduces hasInboxWork, faviconHref, and markFavicon to compute and apply a dotted favicon when the inbox has walkable work.
  • Updates fetchReviews to re-derive favicon state on every queue fetch so it stays in sync across screens.
  • Adds a new favicon-dot.svg asset and documents the behavior in README.md and CLAUDE.md.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
web/src/favicon.ts New favicon state logic (work detection + DOM update).
web/src/favicon.test.ts Unit tests for hasInboxWork and faviconHref.
web/src/api.ts Re-badges favicon during fetchReviews() so the tab stays accurate.
web/public/favicon-dot.svg New dotted favicon asset (dark-mode aware).
README.md Documents the favicon dot behavior for users.
CLAUDE.md Updates architecture notes to include favicon badging behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread web/src/favicon.ts Outdated
…b/src

The single quotes were only there to carry rel="icon" unescaped; the CSS value
takes single quotes just as well, so the file can match its neighbours.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated no new comments.

@jtomaszewski
jtomaszewski merged commit 966c8b7 into main Aug 21, 2026
3 checks passed
@jtomaszewski
jtomaszewski deleted the jtomaszewski/favicon-inbox-dot branch August 21, 2026 10:38
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.22.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants