Repository navigation
feat(studio): a badge for changes that are not live yet - #78
Merged
Merged
Conversation
- API `GET /api/sites/:siteId/pending` (site:read, no-store): counts of
what a publish would add, change and remove (`pendingChanges`), by kind;
a site node that differs only by the added or removed page ids is not
counted twice. Never published: `live: false`, everything added.
- Studio: a dot Badge beside Publish ("2 changes", "Not published"),
number-only on phones, with a pluralised tooltip by kind; the count is
in the Publish button's accessible name. One query, refreshed after any
write to the site through the API client (`onApiWrite`), on focus and
every 30 s.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Madraka <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Beside Studio's Publish button: how many changes are not live yet, and of what kind.
API:
GET /api/sites/:siteId/pendingsite:read,no-store. Answers{ live, liveSnapshotId?, counts: { added, changed, removed, total }, byKind }.store.pendingChanges(what a publish would take: releases' held nodes stay live, and the site node's publish pointer is ignored).Site.pageIds, so that site change is not counted twice ("add a page" = 1 page + 0 site). A reorder or a settings edit still counts.live: false, and everything counts as added.Studio
PendingBadgeinSitePublish: a KumoBadgedot with "2 changes", or "Not published" before the first publish; number-only on phones. The tooltip reads e.g. "3 changes aren't live yet · 2 articles and 1 page" (ICUselect+plural).["pending", siteId], 30 s stale, refetch on focus), invalidated by a centralonApiWritehook in the API client after any successful write under/api/sites/<site>(except previews). The Build chat's streamed fetch signals it too. Agent changes over MCP show on the next focus or within 30 s.Bundle
Initial gzip 415.9 → 416.6 kB (budget 420).
Checks (one package at a time)
pending-changes.test.tsx: count, plurals, not published, no badge, refetch after a write but not after a preview or another site)Also passing: typecheck, design lint (350 files), and the size ratchet. Screenshots at 1440 and 390 px passed: "● 2 changes" sits at control height between View site and Publish, and shows "● 2" on phones.
🤖 Generated with Claude Code