Skip to content

Add workspace chat tabs#347

Closed
Claude-Madera wants to merge 1 commit into
OpenCoworkAI:mainfrom
mussonking:codex/new-conversation-workspace-clean
Closed

Add workspace chat tabs#347
Claude-Madera wants to merge 1 commit into
OpenCoworkAI:mainfrom
mussonking:codex/new-conversation-workspace-clean

Conversation

@Claude-Madera

Copy link
Copy Markdown

Summary

  • Add chat tabs for designs that share the same workspace, with a plus action for starting a fresh conversation in that workspace.
  • Create fresh workspace conversations without copying prior snapshots or chat history.
  • Keep workspace/session state consistent when switching, renaming, deleting, and generating across chat tabs.

Test plan

  • Targeted desktop tests for chat tabs, workspace conversation creation, switching, generation, and rename flows.
  • Desktop typecheck.
  • Full pre-push checks: workspace typecheck, lint, and test suite.
  • Windows desktop build via cmd.exe: pnpm --filter @open-codesign/desktop build.
  • Windows dev app launched from the rebased branch for manual testing.

Principles

  • Compatibility
  • Upgradeability
  • No bloat
  • Elegance

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@github-actions github-actions Bot added the area:desktop apps/desktop (Electron shell, renderer) label May 19, 2026
@Claude-Madera

Copy link
Copy Markdown
Author

Closing for now; branch will be kept for further local validation.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review mode: initial

Findings

  • [Minor] Render-side workspacePathComparisonKey may miscompare on WindowsSidebar.tsx calls workspacePathComparisonKey(path) but the function signature in the renderer copy (if it mirrors the main process) uses process.platform, which is undefined in Electron renderers without nodeIntegration. The extra platform argument passed from chatWorkspaceKey (workspacePathComparisonKey(workspacePath, globalThis.navigator?.platform ?? '')) is ignored by the function. If the renderer hasn't injected a platform check, path comparisons on Windows will be case-sensitive, causing duplicate tab entries and mismatches.
    Suggested fix: Export the platform-aware logic from packages/shared and use a runtime check (e.g., navigator.platform or an env constant) in the renderer. Remove the unused second parameter from the call.

  • [Nit] Unhandled rejection in handleConfirmCloseChatSidebar.tsx:96-103: If switchDesign(fallback.id) throws (e.g., IPC network error), the promise rejection goes unhandled. The softDeleteDesign call would still proceed if the error is swallowed, potentially deleting a conversation while in a stale state.
    Suggested fix: Wrap the switch and delete in a try-catch that logs the error and optionally shows a toast.

  • [Nit] Missing changeset for a user-visible feature — The PR adds chat tabs, the "New conversation" button, workspace collapse in hub, and new i18n strings. Per CLAUDE.md, user-visible changes require a changeset (pnpm changeset).
    Suggested fix: Run pnpm changeset with a patch bump and a short summary. Example: Added workspace chat tabs: create fresh conversations sharing the same workspace, switch/delete from sidebar, collapsed workspace cards in hub.

  • [Minor] canvas.previewTabsAriaLabel i18n key is unused — The CanvasFileTabBar component uses t('canvas.previewTabsAriaLabel'), but the CanvasTabBar component (which now only renders the files tab) uses t('canvas.tabsAriaLabel'). The new key is correctly added to all locales, but the old canvas.previewTab key (removed from the component) is still present in locale files — dead strings. No behavioral harm, but consider removing the orphaned key in a cleanup follow-up.

Summary

This PR adds workspace chat tabs that let users start fresh conversations within the same workspace without copying snapshots or chat history. The changes span IPC (new workspaceReuse parameter), preload, main process (workspace conflict bypass, path comparison key), renderer (sidebar tabs, store action, hub deduplication), and i18n. The diff is well-structured, with strong test coverage for the new IPC path, store action, workspace collision handling, and hub display logic.

Residual risks:

  • The renderer-side platform check for path comparison has a potential gap on Windows (see finding above).
  • The confirmation delete chat UI replaces the previous close-without-confirm for conversation tabs, but existing designs without a workspace are unaffected.
  • No E2E tests for the new sidebar interaction (button toggle, tab switching, deletion flow) were added; the coverage relies on unit tests of the store slice.

Testing

  • New Vitest tests added: design-workspace.test.ts (allowExistingWorkspaceBinding), generation-ipc.test.ts (case-insensitive workspace key on win32), snapshots-ipc.create-design.test.ts (fresh conversation IPC path, conflict protection, missing path rejection), store.test.ts (clean state after creation), RecentTab.test.ts (workspace collapse, active representative).
  • No regression failures expected; existing tests continue to pass (typecheck, lint, test suite passed per PR description).
  • Suggested follow-up: Add a Playwright E2E test that creates a design, opens a second conversation from the sidebar, switches tabs, and deletes one conversation without data loss.

Open-CoDesign Bot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:desktop apps/desktop (Electron shell, renderer)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants