Skip to content

fix(wework): isolate sidebar chat attachments - #2115

Merged
qdaxb merged 4 commits into
mainfrom
fix/sidebar-chat-attachments
Jul 22, 2026
Merged

qdaxb merged 4 commits into
mainfrom
fix/sidebar-chat-attachments

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • isolate attachment selection, upload progress, errors, and cleanup for each temporary side-chat tab
  • pass side-chat attachments explicitly when creating the first ephemeral runtime task
  • default a lone temporary chat panel to a compact 420px width while preserving manual resize behavior
  • preserve direct runtime threadId values while converting and reconciling work-list task addresses
  • add reproducible isolated-Tauri file-drop support to the AI verification CLI
  • document temporary-chat attachment and sizing invariants in Chinese and English

Root cause

TemporaryChatPanel reused the main composer's projectChat attachment controls, so both composers rendered the same attachment collection. The split hook also treated 420px as the main-chat width for every right-workspace view, leaving a lone temporary chat unnecessarily wide.

Real-Tauri verification then exposed a second issue: work-list task address conversion dropped the top-level threadId. A hydrated main conversation could therefore be rejected as an invalid side-chat source when its runtime handle did not repeat that thread id.

Validation

  • pnpm --filter wework test (195 files, 1935 tests)
  • pnpm --filter wework typecheck
  • focused attachment isolation, compact width, runtime-address mapping, and thread-id tests
  • Prettier and ESLint on changed files
  • isolated real-Tauri verification using an actual main conversation and the supplied image.png: upload remained only in the side composer, the 420px side panel remained compact, the image was sent to the temporary thread, the model described it, and the side composer attachment cleared
  • pre-push Wework ESLint, TypeScript, unit tests, Executor cargo fmt/test/clippy

Summary by CodeRabbit

  • New Features

    • Temporary chats now manage attachments independently, including selection, upload progress, and errors.
    • Attachments are included when sending the first message in a temporary chat.
    • Right-side temporary chats open at a compact default width when they are the only active tab; additional tabs restore the standard split layout.
    • User-resized panel widths remain preserved.
  • Documentation

    • Updated English and Chinese guidance for temporary-chat attachments and panel behavior.
  • Tests

    • Added coverage for temporary-chat attachments, runtime thread identification, and panel behavior.

@coderabbitai

coderabbitai Bot commented Jul 22, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 73f049d6-5274-4a2f-9c87-1dccf3b19442

📥 Commits

Reviewing files that changed from the base of the PR and between 953f2c9 and ff58cd0.

📒 Files selected for processing (14)
  • docs/en/wework/developer-guide/wework-chat-state-sources.md
  • docs/zh/wework/developer-guide/wework-chat-state-sources.md
  • wework/scripts/ai-verify.mjs
  • wework/src/components/layout/DesktopWorkbenchLayout.test.tsx
  • wework/src/components/layout/DesktopWorkbenchMain.tsx
  • wework/src/components/layout/workspace-panels/TemporaryChatPanel.tsx
  • wework/src/components/layout/workspace-panels/useResizableWorkspacePanel.ts
  • wework/src/features/workbench/useWorkbenchRuntimeMessaging.test.ts
  • wework/src/features/workbench/useWorkbenchRuntimeMessaging.ts
  • wework/src/features/workbench/workbenchContextTypes.ts
  • wework/src/features/workbench/workbenchReducer.test.ts
  • wework/src/features/workbench/workbenchReducer.ts
  • wework/src/features/workbench/workbenchRuntimeHelpers.test.ts
  • wework/src/features/workbench/workbenchRuntimeHelpers.ts

📝 Walkthrough

Walkthrough

Changes

Temporary chat runtime flow

Layer / File(s) Summary
Isolated temporary-chat attachments
wework/src/components/layout/workspace-panels/TemporaryChatPanel.tsx, wework/src/features/workbench/..., wework/src/components/layout/DesktopWorkbenchLayout.test.tsx, docs/en/...
Temporary chats use isolated attachment state, pass attachments into runtime task creation, and validate attachment rendering without invoking the main chat handler.
Temporary-chat panel sizing
wework/src/components/layout/DesktopWorkbenchMain.tsx, wework/src/components/layout/workspace-panels/useResizableWorkspacePanel.ts
A single temporary chat uses a clamped 420px default width, while other states retain the general split default.
Direct runtime thread identifiers
wework/src/features/workbench/workbenchRuntimeHelpers.ts, wework/src/features/workbench/workbenchReducer.ts, wework/src/features/workbench/useWorkbenchRuntimeMessaging.ts, wework/src/features/workbench/*.test.ts
Runtime task addresses preserve direct thread IDs, and thread resolution prefers them before runtime-handle fallbacks.

AI-verify file-drop command

Layer / File(s) Summary
File-drop command handling
wework/scripts/ai-verify.mjs
The CLI documents and dispatches drop-file, encoding file contents and forwarding filename, MIME type, visibility, and stability fields.

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

Sequence Diagram(s)

sequenceDiagram
  participant BufferedChatInput
  participant TemporaryChatPanel
  participant createTemporaryRuntimeTask
  participant buildSendPayload
  BufferedChatInput->>TemporaryChatPanel: provide side-chat attachments
  TemporaryChatPanel->>createTemporaryRuntimeTask: send attachments
  createTemporaryRuntimeTask->>buildSendPayload: build payload with attachments
Loading

Possibly related PRs

Suggested reviewers: ficohu

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sidebar-chat-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 force-pushed the fix/sidebar-chat-attachments branch from cb0aba1 to ff58cd0 Compare July 22, 2026 07:32
@qdaxb
qdaxb marked this pull request as ready for review July 22, 2026 07:44
@qdaxb
qdaxb merged commit c347d5e into main Jul 22, 2026
28 of 30 checks passed
@qdaxb
qdaxb deleted the fix/sidebar-chat-attachments branch July 22, 2026 07:44
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