Skip to content

Commit f61531d

Browse files
committed
fix vtabbar width across the workspace. fix add tab button
1 parent 2b81a88 commit f61531d

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

frontend/app/tab/vtabbar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ export function VTabBar({ workspace, className }: VTabBarProps) {
245245
>
246246
<div
247247
ref={scrollContainerRef}
248-
className="relative flex min-h-0 flex-1 flex-col overflow-y-auto"
248+
className="relative flex min-h-0 flex-col overflow-y-auto"
249249
onDragOver={(event) => {
250250
event.preventDefault();
251251
updateScrollFromDragY(event.clientY);

frontend/app/workspace/workspace-layout-model.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,14 @@ class WorkspaceLayoutModel {
265265

266266
// ---- Registration & sync ----
267267

268+
syncVTabWidthFromMeta(): void {
269+
const savedVTabWidth = globalStore.get(this.getVTabBarWidthAtom());
270+
if (savedVTabWidth != null && savedVTabWidth > 0 && savedVTabWidth !== this.vtabWidth) {
271+
this.vtabWidth = savedVTabWidth;
272+
this.commitLayouts(window.innerWidth);
273+
}
274+
}
275+
268276
registerRefs(
269277
aiPanelRef: ImperativePanelHandle,
270278
outerPanelGroupRef: ImperativePanelGroupHandle,

frontend/app/workspace/workspace.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ const WorkspaceElem = memo(() => {
7474
return () => window.removeEventListener("resize", workspaceLayoutModel.handleWindowResize);
7575
}, []);
7676

77+
useEffect(() => {
78+
const handleFocus = () => workspaceLayoutModel.syncVTabWidthFromMeta();
79+
window.addEventListener("focus", handleFocus);
80+
return () => window.removeEventListener("focus", handleFocus);
81+
}, []);
82+
7783
const innerHandleVisible = vtabVisible && aiPanelVisible;
7884
const innerHandleClass = `bg-transparent hover:bg-zinc-500/20 transition-colors ${innerHandleVisible ? "w-0.5" : "w-0 pointer-events-none"}`;
7985
const outerHandleVisible = vtabVisible || aiPanelVisible;

0 commit comments

Comments
 (0)