[Feature] Surface auto-sync status: drift badges + notifications (#1178) - #1188
Merged
Conversation
The detail-response serializer now includes source.driftState, source.lastCheckedAt (ISO), and source.upstreamHeadSha so the frontend can render the auto-sync badge from the last scheduled check without a bespoke endpoint. etag stays internal (a conditional-request cache detail, not client-facing). Part of #1178
…#1178) Add SourceDriftBadge (DESIGN.md state tokens: success/info/warning/danger, each paired with copy + a tooltip) and render it in GitHubOriginChip (next to 'Synced from GitHub', manual Refresh button preserved) and the AdvancedOptionsModal 'Currently linked' block. Bilingual strings added to en.json + zh.json. Part of #1178
…#1178) useSourceDriftProbe re-reads the skill detail once when a github source's last drift check is stale (ref-guarded, staleness-gated, no timer/storm; backend surfaces driftState on GET so a plain refetch suffices). Wire it into useSkillDetail and add CATEGORY_LABEL entries for the three new notification categories in both the modal and the notifications page. Part of #1178
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.
Summary
Phase 4 of 5 (final feature phase) for automatic sync of GitHub-sourced skills (
Depends on #1177, merged). Surfaces the now-automatic behavior in the UI so owners see what auto-sync did — closing the loop on the manual-trigger removal.What this does
source.driftState/lastCheckedAt/upstreamHeadSha(so the badge reads real state;etagstays internal).SourceDriftBadge— a passive, read-only pill driven bydriftState, rendered next to the "Synced from GitHub" chip and in the advanced GitHub-link panel:in_sync→ "Auto-synced {relative time}" (success tone)drifted→ "Update in progress" (info)changed_unversioned→ "Upstream changed — version not bumped" (warning) + tooltip to bump the version upstreambroken→ "Source unavailable" (danger) + tooltipskill.auto_synced/skill.auto_sync_failed/skill.source_brokenrender with proper category labels (modal + notifications page); backend-provided title/body already carry the specifics.useSourceDriftProbe) — opening a skill whose last drift check is stale re-reads the detail once (ref-guarded, staleness-gated, no timer, no storm). The cron ([Feature] Scheduled GitHub source drift-check job (auto-detect upstream changes) #1176) remains the primary freshness mechanism, so a plain GET refetch suffices — no bespoke endpoint.Design
Badge tones use only DESIGN.md semantic state tokens (
success/info/warning/danger+ their-softfills and/40borders) — no invented palette. Per DESIGN.md, color is never the only signal: each variant pairs a token with copy, a border, and a tooltip. Strings are bilingual (en.json+zh.json,sourceDrift.*).Testing
SourceDriftBadge.test.tsx(each driftState → correct tone/copy/tooltip; nothing before first check / non-github),GitHubOriginChip.test.tsx(badge + manual button coexist; onRefresh fires),useSourceDriftProbe.test.ts(fires once when stale / never-checked; not when fresh / non-github; at-most-once across re-renders).tsc --noEmitclean;eslintclean.Commits (dependency-ordered, buildable per commit)
feat(api)surface driftState on the skill GET responsefeat(web)mirror drift fields + notification categoriesfeat(web)passive drift badge on the detail surfaces (+ bilingual strings)feat(web)lazy on-view refetch + notification labelsdocschangesetCloses #1178