Skip to content

fix(web): preserve WSL provider update results after dismissal - #168

Draft
pandec wants to merge 4 commits into
mainfrom
upstream/wsl-update-toast
Draft

fix(web): preserve WSL provider update results after dismissal#168
pandec wants to merge 4 commits into
mainfrom
upstream/wsl-update-toast

Conversation

@pandec

@pandec pandec commented Aug 23, 2026

Copy link
Copy Markdown
Owner

Note

Preview of an upstream PR for pingdotgg/t3code. Never merge this; main here is a clean upstream mirror. Close once the upstream PR is open. The branch carries an intermediate design superseded during review; it will be squashed to one commit before the upstream PR.

Problem

The multi-environment (Windows + WSL) provider update popover owns its update request state inside dismissible toast content. Dismiss it mid-update and the request keeps running while its owner unmounts; the sidebar pill only watches primary providers, so success or failure is never reported anywhere. A hung transport is equally silent.

Fix

Split presentation from result delivery:

  • The popover stays live and per-environment: each row keeps its own Update trigger and moves through pending, terminal, and Retry states inline. Triggering one environment's update leaves the others actionable.
  • Terminal-result delivery is owned by the notification host, which outlives any toast: each dispatch registers a generation-scoped claim (targeted instance ids, dispatch time). Live provider state and the RPC response race to finish it, and Map.delete on the claim is the atomic single-winner — no duplicate toasts, in either arrival order. Snapshots older than the dispatch are rejected, so a previous attempt's state can't be reported as this one's outcome.
  • A result toast fires only when the popover is no longer open to show the result itself. A six-minute expiry reports a failure instead of going silent on a hung transport, and interrupted dispatches surface as retryable failures. An unreachable error branch was removed.

Deliberately not in scope: the running-progress duplication between this popover and the sidebar pill for primary providers. These rows are the only progress surface WSL-side providers have, so suppressing them would trade a cosmetic duplication for missing feedback.

Verification

  • 57 focused tests, including: exactly-once reporting across RPC-first and live-state-first orderings, stale-terminal-state rejection, request generations across retries, the unchanged outcome, dismissal followed by delivery, results shown in the still-open popover (no toast), expiry, and interruption. One test renders the production notification host, not just the hook.
  • Mutation-proofed: removing the delete-as-claim guard fails four tests; removing the recency filter fails the stale-state test.
  • vp check and vp run typecheck clean.

[video placeholder: with Windows + WSL connected, click Update on one environment — the popover stays open, that row shows a spinner while the other row stays actionable. Then repeat and dismiss the popover mid-update — the success/failure toast still arrives.]

Related: pingdotgg#7761 (primary-flow result pattern this mirrors), pingdotgg#7425, pingdotgg#6544.

Implemented by gpt-5.6-sol, orchestrated and reviewed (opus + sol panel) in Claude Code (Fable 5).

@pandec pandec changed the title fix(web): report WSL provider update results like primary providers fix(web): preserve WSL provider update results after dismissal Aug 23, 2026
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