Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions bun.lock
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
"@ai-sdk/openai": "^2.0.72",
"@ai-sdk/xai": "^2.0.36",
"@aws-sdk/credential-providers": "^3.940.0",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@jitl/quickjs-wasmfile-release-asyncify": "^0.31.0",
"@lydell/node-pty": "1.1.0",
"@mozilla/readability": "^0.6.0",
Expand Down Expand Up @@ -63,6 +66,7 @@
"posthog-node": "^5.17.0",
"quickjs-emscripten": "^0.31.0",
"quickjs-emscripten-core": "^0.31.0",
"react-resizable-panels": "^3.0.6",
"react-router-dom": "^7.11.0",
"rehype-harden": "^1.1.5",
"rehype-sanitize": "^6.0.0",
Expand Down Expand Up @@ -532,6 +536,14 @@

"@develar/schema-utils": ["@develar/schema-utils@2.6.5", "", { "dependencies": { "ajv": "^6.12.0", "ajv-keywords": "^3.4.1" } }, "sha512-0cp4PsWQ/9avqTVMCtZ+GirikIA36ikvjtHweU4/j8yLtgObI0+JUPhYFScgwlteveGB1rt3Cm8UhN04XayDig=="],

"@dnd-kit/accessibility": ["@dnd-kit/accessibility@3.1.1", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-2P+YgaXF+gRsIihwwY1gCsQSYnu9Zyj2py8kY5fFvUM1qm2WA2u639R6YNVfU4GWr+ZM5mqEsfHZZLoRONbemw=="],

"@dnd-kit/core": ["@dnd-kit/core@6.3.1", "", { "dependencies": { "@dnd-kit/accessibility": "^3.1.1", "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0", "react-dom": ">=16.8.0" } }, "sha512-xkGBRQQab4RLwgXxoqETICr6S5JlogafbhNsidmrkVv2YRs5MLwpjoF2qpiGjQt8S9AoxtIV603s0GIUpY5eYQ=="],

"@dnd-kit/sortable": ["@dnd-kit/sortable@10.0.0", "", { "dependencies": { "@dnd-kit/utilities": "^3.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@dnd-kit/core": "^6.3.0", "react": ">=16.8.0" } }, "sha512-+xqhmIIzvAYMGfBYYnbKuNicfSsk4RksY2XdmJhT+HAC01nix6fHCztU68jooFiMUB01Ky3F0FyOvhG/BZrWkg=="],

"@dnd-kit/utilities": ["@dnd-kit/utilities@3.2.2", "", { "dependencies": { "tslib": "^2.0.0" }, "peerDependencies": { "react": ">=16.8.0" } }, "sha512-+MKAJEOfaBe5SmV6t34p80MMKhjvUz0vRrvVJbPT0WElzaOJ/1xs+D+KDv+tD/NE5ujfrChEcshd4fLn0wpiqg=="],

"@electron/asar": ["@electron/asar@3.4.1", "", { "dependencies": { "commander": "^5.0.0", "glob": "^7.1.6", "minimatch": "^3.0.4" }, "bin": { "asar": "bin/asar.js" } }, "sha512-i4/rNPRS84t0vSRa2HorerGRXWyF4vThfHesw0dmcWHp+cspK743UanA0suA5Q5y8kzY2y6YKrvbIUn69BCAiA=="],

"@electron/get": ["@electron/get@2.0.3", "", { "dependencies": { "debug": "^4.1.1", "env-paths": "^2.2.0", "fs-extra": "^8.1.0", "got": "^11.8.5", "progress": "^2.0.3", "semver": "^6.2.0", "sumchecker": "^3.0.1" }, "optionalDependencies": { "global-agent": "^3.0.0" } }, "sha512-Qkzpg2s9GnVV2I2BjRksUi43U5e6+zaQMcjoJy0C+C5oxaKl+fmckGDQFtRpZpZV0NQekuZZ+tGz7EA9TVnQtQ=="],
Expand Down Expand Up @@ -3138,6 +3150,8 @@

"react-remove-scroll-bar": ["react-remove-scroll-bar@2.3.8", "", { "dependencies": { "react-style-singleton": "^2.2.2", "tslib": "^2.0.0" }, "peerDependencies": { "@types/react": "*", "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" }, "optionalPeers": ["@types/react"] }, "sha512-9r+yi9+mgU33AKcj6IbT9oRCO78WriSj6t/cF8DWBZJ9aOGPOTEDvdUDz1FwKim7QXWwmHqtdHnRJfhAxEG46Q=="],

"react-resizable-panels": ["react-resizable-panels@3.0.6", "", { "peerDependencies": { "react": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc" } }, "sha512-b3qKHQ3MLqOgSS+FRYKapNkJZf5EQzuf6+RLiq1/IlTHw99YrZ2NJZLk4hQIzTnnIkRg2LUqyVinu6YWWpUYew=="],

"react-router": ["react-router@7.11.0", "", { "dependencies": { "cookie": "^1.0.1", "set-cookie-parser": "^2.6.0" }, "peerDependencies": { "react": ">=18", "react-dom": ">=18" }, "optionalPeers": ["react-dom"] }, "sha512-uI4JkMmjbWCZc01WVP2cH7ZfSzH91JAZUDd7/nIprDgWxBV1TkkmLToFh7EbMTcMak8URFRa2YoBL/W8GWnCTQ=="],

"react-router-dom": ["react-router-dom@7.11.0", "", { "dependencies": { "react-router": "7.11.0" }, "peerDependencies": { "react": ">=18", "react-dom": ">=18" } }, "sha512-e49Ir/kMGRzFOOrYQBdoitq3ULigw4lKbAyKusnvtDu2t4dBX4AGYPrzNvorXmVuOyeakai6FUPW5MmibvVG8g=="],
Expand Down
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@
"@ai-sdk/openai": "^2.0.72",
"@ai-sdk/xai": "^2.0.36",
"@aws-sdk/credential-providers": "^3.940.0",
"@dnd-kit/core": "^6.3.1",
"@dnd-kit/sortable": "^10.0.0",
"@dnd-kit/utilities": "^3.2.2",
"@jitl/quickjs-wasmfile-release-asyncify": "^0.31.0",
"@lydell/node-pty": "1.1.0",
"@mozilla/readability": "^0.6.0",
Expand Down Expand Up @@ -103,6 +106,7 @@
"posthog-node": "^5.17.0",
"quickjs-emscripten": "^0.31.0",
"quickjs-emscripten-core": "^0.31.0",
"react-resizable-panels": "^3.0.6",
"react-router-dom": "^7.11.0",
"rehype-harden": "^1.1.5",
"rehype-sanitize": "^6.0.0",
Expand Down
36 changes: 8 additions & 28 deletions src/browser/components/AIView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ import { PinnedTodoList } from "./PinnedTodoList";
import {
getAutoRetryKey,
VIM_ENABLED_KEY,
RIGHT_SIDEBAR_TAB_KEY,
RIGHT_SIDEBAR_COSTS_WIDTH_KEY,
RIGHT_SIDEBAR_REVIEW_WIDTH_KEY,
RIGHT_SIDEBAR_WIDTH_KEY,
} from "@/common/constants/storage";
import { WORKSPACE_DEFAULTS } from "@/constants/workspaceDefaults";
import { ChatInput, type ChatInputAPI } from "./ChatInput/index";
import { RightSidebar, type TabType } from "./RightSidebar";
import { RightSidebar } from "./RightSidebar";
import { useResizableSidebar } from "@/browser/hooks/useResizableSidebar";
import {
shouldShowInterruptedBarrier,
Expand Down Expand Up @@ -105,34 +103,16 @@ const AIViewInner: React.FC<AIViewProps> = ({
const { workspaceMetadata } = useWorkspaceContext();
const chatAreaRef = useRef<HTMLDivElement>(null);

// Track which right sidebar tab is selected (listener: true to sync with RightSidebar changes)
const [selectedRightTab] = usePersistedState<TabType>(RIGHT_SIDEBAR_TAB_KEY, "costs", {
listener: true,
});

// Resizable RightSidebar width - separate hooks per tab for independent persistence
const costsSidebar = useResizableSidebar({
// Costs + Stats share the same resizable width persistence
enabled: selectedRightTab === "costs" || selectedRightTab === "stats",
defaultWidth: 300,
minWidth: 300,
maxWidth: 1200,
storageKey: RIGHT_SIDEBAR_COSTS_WIDTH_KEY,
});
const reviewSidebar = useResizableSidebar({
enabled: selectedRightTab === "review",
defaultWidth: 600,
// Resizable RightSidebar width - single unified width for all tabs
const sidebar = useResizableSidebar({
enabled: true,
defaultWidth: 400,
minWidth: 300,
maxWidth: 1200,
storageKey: RIGHT_SIDEBAR_REVIEW_WIDTH_KEY,
storageKey: RIGHT_SIDEBAR_WIDTH_KEY,
});

// Derive active sidebar props based on selected tab
const sidebarWidth = selectedRightTab === "review" ? reviewSidebar.width : costsSidebar.width;
const isResizing =
selectedRightTab === "review" ? reviewSidebar.isResizing : costsSidebar.isResizing;
const startResize =
selectedRightTab === "review" ? reviewSidebar.startResize : costsSidebar.startResize;
const { width: sidebarWidth, isResizing, startResize } = sidebar;

const workspaceState = useWorkspaceState(workspaceId);
const storeRaw = useWorkspaceStoreRaw();
Expand Down
Loading
Loading