Skip to content

fix(wework): isolate attachments between split panes - #2733

Merged
qdaxb merged 2 commits into
mainfrom
fix/wework-split-pane-attachments
Aug 16, 2026
Merged

qdaxb merged 2 commits into
mainfrom
fix/wework-split-pane-attachments

Conversation

@qdaxb

@qdaxb qdaxb commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • scope attachment state and attachment actions by runtime task for each workbench pane
  • pass pane-scoped attachment state into each split-pane composer
  • add unit coverage for attachment isolation between composer scopes
  • extend the real desktop split-workbench E2E to paste an image into one pane and assert that it appears only there
  • ignore stale running: true runtime transcript snapshots after the current turn has already settled
  • document the split-pane composer state isolation contract

Root cause

Text input already used the runtime task scope, but split-pane composers read attachments from the provider's currently selected global project-chat scope. Every pane therefore rendered and mutated the same attachment collection.

The first merge-queue run also exposed an independent runtime lifecycle race in the existing temporary-chat E2E: a transcript poll started while a turn was running could return running: true after the completion event had already settled the turn. That stale snapshot restarted the executor state, leaving the thinking indicator busy indefinitely. The lifecycle store now rejects that stale transition.

Impact

Pasting, removing, restoring, or sending attachments in one split pane no longer changes attachment badges or upload state in another pane. Completed temporary-chat turns also remain settled when an older transcript poll returns late.

Validation

  • pre-push ESLint: passed
  • pre-push TypeScript: passed
  • pre-push unit tests: passed
  • DesktopWorkbenchLayout.test.tsx: 189 tests passed
  • runtime lifecycle focused suite: 2 files, 52 tests passed
  • desktop E2E split-workbench: passed, including the new pasted-attachment isolation assertion
  • desktop E2E temporary-chat: passed in 1m 41s with no assertion errors
  • ai:verify was attempted twice; its isolated launcher/control process terminated during startup without a product stack trace. The equivalent packaged Tauri desktop E2E completed successfully.

Summary by CodeRabbit

  • Bug Fixes

    • Isolated composer attachments, upload progress, and errors between split-pane conversations.
    • Prevented sending, editing, interruption, and recovery actions in one pane from affecting another pane’s attachments.
    • Prevented stale runtime updates from restarting a task after its current turn has completed.
  • Tests

    • Added coverage for scoped attachment handling.
    • Extended desktop split-pane testing to verify attachment isolation and upload behavior.
    • Added regression coverage for completed tasks remaining idle after stale updates.

@coderabbitai

coderabbitai Bot commented Aug 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e638eb8a-a9f0-4ada-ae96-5768df4290bf

📥 Commits

Reviewing files that changed from the base of the PR and between ea61621 and 934ff78.

📒 Files selected for processing (2)
  • wework/src/features/workbench/runtimeTaskLifecycle/RuntimeTaskLifecycleStore.test.ts
  • wework/src/features/workbench/runtimeTaskLifecycle/RuntimeTaskLifecycleStore.ts

Included review availability: Your plan includes up to 4 reviews per rolling hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

The workbench now scopes composer attachments by task pane, including upload state, errors, removal, reset, and send flows. Split-pane tests verify isolation. Runtime transcript synchronization no longer reactivates settled tasks from stale running snapshots.

Changes

Scoped composer attachments

Layer / File(s) Summary
Attachment state contract and scoped operations
wework/src/features/workbench/useWorkbenchAttachments.ts, wework/src/features/workbench/workbenchContextTypes.ts
Attachment state and operations now support explicit scopes. Default-scope wrappers remain available.
Context scope wiring
wework/src/features/workbench/WorkbenchProvider.tsx
Project and pane contexts expose scoped attachment state and handlers.
Pane session and composer integration
wework/src/components/layout/useWorkbenchPaneSession.ts, wework/src/components/layout/DesktopWorkbenchMain.tsx
Pane send, restore, reset, and queued-message flows use active scoped attachments. The composer receives scoped state and handlers.
Isolation validation and supporting fixtures
wework/src/features/workbench/workbenchProjectChatHooks.test.tsx, wework/src/components/layout/*test.tsx, wework/src/App.plugins.test.tsx, wework/e2e/desktop/scenarios/split-workbench.scenario.mjs, wework/DESIGN.md
Tests, fixtures, E2E coverage, screenshots, and design guidance cover split-pane attachment isolation.

Runtime lifecycle settlement

Layer / File(s) Summary
Stale transcript settlement guard
wework/src/features/workbench/runtimeTaskLifecycle/RuntimeTaskLifecycleStore.ts, wework/src/features/workbench/runtimeTaskLifecycle/RuntimeTaskLifecycleStore.test.ts
Settled turns ignore stale running transcript snapshots. Regression coverage verifies idle lifecycle state and the preserved settled outcome.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Merge Risk: 🔵 Low · up to 934ff

The change isolates attachment state between split panes, with unit and desktop validation reported as passing. A bounded lifecycle edge case involving late runtime snapshots and newer active turns still needs explicit owner confirmation or follow-up before merge.

Sequence Diagram(s)

sequenceDiagram
  participant Composer
  participant useWorkbenchPaneSession
  participant WorkbenchProvider
  participant useWorkbenchAttachments
  Composer->>useWorkbenchPaneSession: Select or remove attachment for active scope
  useWorkbenchPaneSession->>WorkbenchProvider: Invoke scoped attachment handler
  WorkbenchProvider->>useWorkbenchAttachments: Update target scope state
  useWorkbenchAttachments-->>Composer: Return scoped attachments and upload state
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: isolating attachment state between split panes.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/wework-split-pane-attachments

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@qdaxb
qdaxb added this pull request to the merge queue Aug 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 16, 2026
@qdaxb
qdaxb added this pull request to the merge queue Aug 16, 2026
Merged via the queue into main with commit f5ea020 Aug 16, 2026
46 checks passed
@qdaxb
qdaxb deleted the fix/wework-split-pane-attachments branch August 16, 2026 19:07
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