Skip to content

Conversation

@ammar-agent
Copy link
Collaborator

Summary

Implements IDE-like "dock-lite" functionality for the RightSidebar with persistent nested splits, tabsets, drag-and-drop tab moving (including reordering), and stable embedded Terminal behavior.

Key Changes

Sidebar Width Unification

  • Unified sidebar width across all tabs (was previously separate for costs vs review)
  • Single RIGHT_SIDEBAR_WIDTH_KEY replaces per-tab width keys

Global Drag Layer

  • Added SidebarDragLayer component for consistent drag preview across panes
  • Drag preview remains visible when crossing pane boundaries in split layouts

Drag Interruption Fix

  • DragAwarePanelResizeHandle disables pointer events during tab drags
  • Edge drop zones always rendered (visibility toggled) to avoid mount/unmount issues

E2E Test Infrastructure

  • Created dragElement helper using programmatic DragEvent dispatch
    • Bypasses Playwright mouse.move() which hangs in Xvfb environments
    • Works correctly with react-dnd HTML5Backend
  • New sidebarDragDrop.spec.ts with 3 tests:
    • Tab reordering via drag-and-drop
    • Tab click interactions
    • Split layout rendering from localStorage

Testing

# Unit tests
bun test src/browser/utils/rightSidebarLayout.test.ts

# UI integration tests  
TEST_INTEGRATION=1 bun x jest tests/ui/rightSidebar.integration.test.ts

# E2E tests (requires xvfb)
MUX_E2E_LOAD_DIST=1 xvfb-run -a bun x playwright test tests/e2e/scenarios/sidebarDragDrop.spec.ts

Generated with mux • Model: anthropic:claude-opus-4-5 • Thinking: high

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent ammar-agent force-pushed the window-layout-614q branch 3 times, most recently from ff4881d to 0fd9247 Compare December 27, 2025 18:51
@ammar-agent
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent
Copy link
Collaborator Author

@codex review

1 similar comment
@ammar-agent
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@ammar-agent
Copy link
Collaborator Author

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. More of your lovely PRs please.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Implements an IDE-like dock-lite sidebar with nested split/tabset layout:

- Terminal tab embedded in RightSidebar (stable, not destroyed on tab switch)
- Tab dragging with @dnd-kit for reliable click vs drag disambiguation
- Edge docking to create horizontal/vertical splits
- Unified sidebar width across all tabs (resizing affects all equally)
- Layout state persisted in localStorage

Technical highlights:
- Migrated from react-dnd HTML5Backend to @dnd-kit with PointerSensor
- 8px distance activation constraint prevents accidental drags
- DragOverlay for smooth cursor-following preview
- No tooltip interference (not built on HTML5 Drag API)
- Proper MUX_ROOT support for e2e tests

---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
When switching between workspaces (e.g., SSH → Local), the TerminalTab
was passing the old workspace's session ID to TerminalView before the
useEffect synced the state. This caused errors like 'trying to open SSH
terminal for local project'.

Fix: Read sessionId directly from the Map instead of caching in useState.
The Map lookup always returns the correct session for the current
workspaceId, eliminating the timing bug.

---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
Sidebar layout (splits, tabs, terminal instances) is now stored per-
workspace instead of globally. This allows each workspace to have its
own pane configuration, including different numbers of terminals.

Global settings that remain shared across workspaces:
- Sidebar width (prevents layout flash when switching)
- Collapsed state

Changes:
- RIGHT_SIDEBAR_LAYOUT_KEY → getRightSidebarLayoutKey(workspaceId)
- Command palette layout commands only available with workspace context
- Updated stories and tests to use workspace-specific keys

---
_Generated with `mux` • Model: `anthropic:claude-opus-4-5` • Thinking: `high`_
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