Skip to content

Show sync progress in a running toast through push, pull, and preview - #4451

Draft
shaunandrews wants to merge 1 commit into
stu-2162-publish-modalfrom
stu-2162-sync-toasts
Draft

Show sync progress in a running toast through push, pull, and preview#4451
shaunandrews wants to merge 1 commit into
stu-2162-publish-modalfrom
stu-2162-sync-toasts

Conversation

@shaunandrews

Copy link
Copy Markdown
Contributor

Related issues

⚠️ Visual change: needs human review in light + dark mode.

How AI was used in this PR

Claude Code built and iterated on this live in the running app (including tracking down a Notice-hook crash); verified with typecheck and unit tests.

Proposed Changes

A push, pull, or preview can run for a while, and the header only has room to spin. This adds a running toast that opens when the sync starts, updates in place as it progresses, and is replaced in place by the result — one message for the whole operation, no pile-up.

  • Push shows "Uploading… X%" from the upload byte-fraction Agentic UI: Port selective sync #4377 already emits (sync-upload-progress) — the push connector now surfaces it via an onProgress callback, mirroring pull. No main-process changes.
  • Pull shows the CLI's narration + percentage.
  • Preview shows a publishing → published toast.

Progress is throttled (~3/sec) so the aria-live announcer isn't re-rendered dozens of times a second, and the toast store treats a non-positive duration as "persist until replaced." Also folds in the fix for a crash when a toast is replaced in place with a different shape (a running toast losing its description at the result) — the Notice is keyed on its shape so it re-mounts cleanly. (That's the same fix as the trunk-side #4443, which this #4377-based stack doesn't have.)

Testing Instructions

  1. Open a connected site → Sync → Push. Confirm a single "Pushing to live → Uploading… X%" toast that resolves in place to "Push complete" — no flicker, no crash.
  2. Pull → confirm the running toast shows the CLI progress and resolves to "Pull complete".
  3. Share → New preview → confirm "Publishing preview link" → "Preview link published".
  4. Both light and dark.

Pre-merge Checklist

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.
  • I have added or updated tests to cover my changes, if applicable.
  • I have tested my changes in both light and dark mode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.

1 participant