Skip to content

[codex] add right sidebar workspace#6

Merged
Eccentric-jamaican merged 1 commit into
mainfrom
codex/right-sidebar-workspace
Jun 12, 2026
Merged

[codex] add right sidebar workspace#6
Eccentric-jamaican merged 1 commit into
mainfrom
codex/right-sidebar-workspace

Conversation

@Eccentric-jamaican

@Eccentric-jamaican Eccentric-jamaican commented Jun 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • Introduces the right sidebar workspace as a first-class tabbed surface for Review, Terminal, Browser, Open file, and Side chat.
  • Moves file and PDF viewing into the workspace model, including workspace-owned open/close/expand controls and calmer tab chrome.
  • Polishes the integrated browser tab controls and empty state, and keeps native browser overlays from covering workspace menus.
  • Adds lazy/prioritized PDF page rendering so visible pages render first and heavier pages are deferred.
  • Removes duplicate terminal manager helper definitions from the current base so bun run typecheck passes.

Impact

This makes the right side of the app behave more like a persistent workspace instead of a temporary sheet. Users can open, close, and reorder workspace tabs, keep the chat header quieter while the workspace is open, and collapse the workspace from its own chrome.

Validation

  • bun run lint passes with existing warnings only.
  • bun run typecheck passes.
  • bun run --cwd apps/desktop test -- browserRuntime.test.ts passed earlier during the browser final-tab behavior change.

Summary by CodeRabbit

  • New Features

    • Added right sidebar workspace with tabbed interface for browser, files, terminal, and side-chat panels.
    • Introduced terminal panel with flexible layout options (resizable drawer or fixed panel mode).
    • Added PDF preview lazy-loading based on viewport proximity for improved performance.
    • New file viewer surface in diff panel with enhanced navigation controls.
  • Bug Fixes

    • Updated browser tab closing behavior to properly clear state when closing the last tab.
    • Fixed native browser overlay handling during panel interactions.
    • Adjusted toast UI z-index stacking order for correct visibility.

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

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: 94da5d97-0bb1-4afc-878a-cfa9bf8bf8c1

📥 Commits

Reviewing files that changed from the base of the PR and between c92670d and 280a935.

📒 Files selected for processing (17)
  • apps/desktop/src/browserRuntime.test.ts
  • apps/desktop/src/browserRuntime.ts
  • apps/server/src/terminal/Layers/Manager.ts
  • apps/web/src/components/ChatView.browser.tsx
  • apps/web/src/components/ChatView.tsx
  • apps/web/src/components/DesktopBrowserController.tsx
  • apps/web/src/components/DiffPanel.tsx
  • apps/web/src/components/IntegratedBrowserPane.tsx
  • apps/web/src/components/PdfCanvasPreview.tsx
  • apps/web/src/components/RightSidebarWorkspace.tsx
  • apps/web/src/components/Sidebar.browser.tsx
  • apps/web/src/components/ThreadTerminalDrawer.tsx
  • apps/web/src/components/ui/toast.tsx
  • apps/web/src/diffRouteSearch.test.ts
  • apps/web/src/diffRouteSearch.ts
  • apps/web/src/routes/_chat.$threadId.tsx
  • apps/web/src/splitViewStore.ts

📝 Walkthrough

Walkthrough

This PR refactors the right-side panel system from simple browser/diff toggling to a multi-tab workspace supporting browser, diff, files, terminal, and side-chat surfaces. It expands panel type definitions, updates browser tab closing behavior, introduces a new RightSidebarWorkspace component for tab management, and orchestrates all surfaces through the route layer with panel state tracking and recency awareness.

Changes

Right Panel Type System & State

Layer / File(s) Summary
Panel mode type expansion
apps/web/src/diffRouteSearch.ts, apps/web/src/diffRouteSearch.test.ts
RightPanelMode is expanded from "diff" | "browser" to include "picker", "files", "terminal", and "side-chat"; normalization and resolution logic are updated; legacy diff query parameter is removed in favor of panel-based encoding.
ChatView and ChatHeader prop interfaces
apps/web/src/components/ChatView.tsx
ChatViewProps gains rightPanelOpen, onToggleRightPanel, terminalPanelOpen, and onOpenTerminalPanel; panel state expanded to include new modes; ChatHeaderProps simplified to use unified right-panel toggle instead of per-pane booleans.
Split view panel state structure
apps/web/src/splitViewStore.ts
SplitViewPanePanelState.panel is now typed as ChatRightPanel | null; lastOpenPanel made nullable and tool-tab-aware; new lastPanelClosedAt: number | null field added for close timing.

Browser Tab State Changes

Layer / File(s) Summary
Close-last-tab behavior change
apps/desktop/src/browserRuntime.ts, apps/desktop/src/browserRuntime.test.ts, apps/web/src/components/ChatView.browser.tsx, apps/web/src/components/Sidebar.browser.tsx
When closing the last tab, activeTabId is now set to null instead of auto-creating a replacement tab; test expectations and bridge implementations updated to expect empty browser state.

Right Sidebar Workspace UI

Layer / File(s) Summary
RightSidebarWorkspace implementation
apps/web/src/components/RightSidebarWorkspace.tsx
New component manages multi-tab right-panel UI with drag-drop reordering, open/close/move handlers, picker overlay, and tab content switching; includes helper functions for tab validation and array comparison.
IntegratedBrowserPane native overlay & UI
apps/web/src/components/IntegratedBrowserPane.tsx
Adds BrowserEmptyState for no-active-tab case, native overlay blocking event listener, refined tab strip styling, and conditional bounds-sync flow based on overlay state.
ThreadTerminalDrawer layout mode
apps/web/src/components/ThreadTerminalDrawer.tsx
Adds optional layout prop supporting "drawer" (resizable) and "panel" (fixed-height) modes; conditionally renders resize handle.

Right Panel Content Surfaces

Layer / File(s) Summary
DiffPanel review-only mode and file viewer
apps/web/src/components/DiffPanel.tsx
DiffPanel gains optional hideReviewTabHeader prop to suppress header when review-only; new exported ThreadFileViewerSurface provides thread-scoped file viewing with tabs, breadcrumbs, multi-format preview support, and markdown/code options.
PdfCanvasPreview viewport-proximity rendering
apps/web/src/components/PdfCanvasPreview.tsx
Introduces lazy rendering via renderablePages set and IntersectionObserver; PdfPage gains scrollRootRef, shouldRender, and onPageNearViewport props; adds queued render state and fallback ESTIMATED_PAGE_SIZE.
DesktopBrowserController page unload handling
apps/web/src/components/DesktopBrowserController.tsx
Registers pagehide and beforeunload listeners on mount to close native browser pane; replaces prior pathname-based closure logic.

Chat View & Header Wiring

Layer / File(s) Summary
Terminal panel routing and shortcuts
apps/web/src/components/ChatView.tsx
toggleTerminalVisibility and runProjectScript route through onOpenTerminalPanel when provided; keyboard shortcuts (terminal.split, terminal.close, terminal.new) updated to check both terminal state and panel visibility props.
ChatHeader toggle consolidation
apps/web/src/components/ChatView.tsx
Replaces per-pane toggle group with single PanelRightOpenIcon toggle; rightPanelOpen prop combines multiple pane open states; onToggleRightPanel handler wired to toggle logic.

Route Layer Panel Orchestration

Layer / File(s) Summary
Route imports, utilities, and panel surfaces
apps/web/src/routes/_chat.$threadId.tsx
Adds imports for ThreadFileViewerSurface, RightSidebarWorkspace types, terminal state store; introduces panel sizing helpers and tool-tab identification; new ThreadTerminalPanelSurface and SideChatPanelSurface.
ViewerPanelSurface and inline sidebar wiring
apps/web/src/routes/_chat.$threadId.tsx
Refactors ViewerPanelSurface to be tab-driven via RightSidebarWorkspace; adds selection/open-picker callbacks; updates inline sidebar with viewport-width state, resize effects, and surface-mode/focus props.
Split pane integration and panel transitions
apps/web/src/routes/_chat.$threadId.tsx
Extends split panes with right-panel callbacks and shared min-width computation; SplitChatSurface and SingleChatSurface updated with tool-tab-aware state tracking, lastOpenPanel/lastPanelClosedAt management, and panel transition helpers.
Sheet layout finalization
apps/web/src/routes/_chat.$threadId.tsx
Unifies RightPanelSheet to always render ViewerPanelSurface, removing prior browser-vs-diff conditional branching.

Estimated code review effort

🎯 5 (Critical) | ⏱️ ~120 minutes

Poem

🐰 A workspace grows with many a pane,
Tabs flutter where browser once reigned,
Terminal, files, and chats now stand tall,
One sidebar to manage them all!

✨ 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 codex/right-sidebar-workspace

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 and usage tips.

@Eccentric-jamaican Eccentric-jamaican marked this pull request as ready for review June 12, 2026 16:05
@Eccentric-jamaican Eccentric-jamaican merged commit 80e3458 into main Jun 12, 2026
0 of 2 checks passed
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