Skip to content

Scope git toast state by thread ref#1855

Merged
juliusmarminge merged 4 commits intomainfrom
t3code/git-toast-thread-scopes
Apr 9, 2026
Merged

Scope git toast state by thread ref#1855
juliusmarminge merged 4 commits intomainfrom
t3code/git-toast-thread-scopes

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Apr 9, 2026

Summary

  • Scope git action toast state to ScopedThreadRef so progress toasts stay pinned to the environment/thread that started them.
  • Update branch syncing and store writes to target the correct environment instead of the currently active one.
  • Add logic and store coverage for cross-environment thread collisions and legacy thread-id toast behavior.

Testing

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run test

Note

Medium Risk
Updates toast filtering and git branch persistence to be environment-aware via ScopedThreadRef, which can impact cross-environment UX/state if any callers still assume thread-id-only behavior. Includes test coverage, but changes touch shared store and notification behavior.

Overview
Scopes git action progress toasts and toast visibility by ScopedThreadRef (environment + thread), keeping in-flight toasts pinned to the thread/environment that started them while preserving legacy threadId-only toast data via fallback.

Refactors branch syncing to write to the correct environment: setThreadBranch now takes a ScopedThreadRef, and GitActionsControl/BranchToolbarBranchSelector update server threads via environment API + setThreadBranch or update draft threads via setDraftThreadContext when no server thread exists. Adds targeted tests for cross-environment collisions, draft-thread syncing, and toast scoping.

Reviewed by Cursor Bugbot for commit fa9f6e2. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Scope git branch sync and toast visibility by ScopedThreadRef

  • Changes setThreadBranch to accept a ScopedThreadRef instead of a ThreadId, so branch updates target the specific environment of the thread rather than always using activeEnvironmentId.
  • Updates GitActionsControl to sync branch to server threads via the environment API and setThreadBranch, or to draft threads via setDraftThreadContext when no server thread exists.
  • Adds shouldRenderThreadScopedToast to filter toast visibility by ScopedThreadRef (environmentId + threadId), with fallback to legacy threadId-only data.
  • Updates the Toasts and AnchoredToasts components in toast.tsx to derive an active ScopedThreadRef from the route and apply the new predicate.
  • Behavioral Change: toasts and branch state scoped only by threadId will still render correctly via legacy fallback, but multi-environment scenarios now filter by environment as well.

Macroscope summarized fa9f6e2.

- Track thread-scoped toasts by environment plus thread ID
- Update branch sync to write through the full scoped ref
- Add coverage for scoped toast filtering and branch updates
@github-actions github-actions bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Apr 9, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: fb61dd9d-7d38-444a-a86a-81455f192ddb

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch t3code/git-toast-thread-scopes

Comment @coderabbitai help to get the list of available commands and usage tips.

@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 9, 2026

Approvability

A prior Macroscope approval was dismissed. Re-evaluating eb99338

macroscopeapp[bot]
macroscopeapp bot previously approved these changes Apr 9, 2026
- Update branch persistence to write to draft threads when no server thread exists
- Derive toast thread scoping from draft routes
- Add coverage for draft-thread branch sync
@macroscopeapp macroscopeapp bot dismissed their stale review April 9, 2026 19:24

Dismissing prior approval to re-evaluate eb99338

@juliusmarminge juliusmarminge enabled auto-merge (squash) April 9, 2026 19:51
@juliusmarminge juliusmarminge merged commit b547fee into main Apr 9, 2026
13 of 14 checks passed
@juliusmarminge juliusmarminge deleted the t3code/git-toast-thread-scopes branch April 9, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant