Skip to content

[Feature] Surface auto-sync status: drift badges + notifications (#1178) - #1188

Merged
chronoai-shining merged 5 commits into
developfrom
feature/1178-auto-sync-ui
Jul 1, 2026
Merged

[Feature] Surface auto-sync status: drift badges + notifications (#1178)#1188
chronoai-shining merged 5 commits into
developfrom
feature/1178-auto-sync-ui

Conversation

@chronoai-shining

Copy link
Copy Markdown
Collaborator

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

  • Backend enablement — the GET skill response now serializes source.driftState / lastCheckedAt / upstreamHeadSha (so the badge reads real state; etag stays internal).
  • SourceDriftBadge — a passive, read-only pill driven by driftState, 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 upstream
    • broken → "Source unavailable" (danger) + tooltip
    • The manual "Refresh from GitHub" button is preserved as an override.
  • Notificationsskill.auto_synced / skill.auto_sync_failed / skill.source_broken render with proper category labels (modal + notifications page); backend-provided title/body already carry the specifics.
  • Lazy on-view refetch (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 -soft fills and /40 borders) — 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

  • Full web suite: 606 pass, 0 fail (89 files), incl. the i18n en/zh parity test.
  • New tests: 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 --noEmit clean; eslint clean.

Commits (dependency-ordered, buildable per commit)

  1. feat(api) surface driftState on the skill GET response
  2. feat(web) mirror drift fields + notification categories
  3. feat(web) passive drift badge on the detail surfaces (+ bilingual strings)
  4. feat(web) lazy on-view refetch + notification labels
  5. docs changeset

Closes #1178

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)

Extend the frontend SkillSource with driftState / upstreamHeadSha / lastCheckedAt, and add the skill.source_broken / skill.auto_synced / skill.auto_sync_failed notification categories.

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
@chronoai-shining
chronoai-shining merged commit 898a26b into develop Jul 1, 2026
17 checks passed
@chronoai-shining
chronoai-shining deleted the feature/1178-auto-sync-ui branch July 1, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Surface auto-sync status: drift badges + notifications

1 participant