fix(canvas): align fixed design sidebars

This commit is contained in:
inman
2026-09-07 16:08:17 +08:00
parent e98603435d
commit 6a05992e18
10 changed files with 74 additions and 25 deletions

View File

@@ -79,8 +79,9 @@ export function MainLayout() {
integrated
workspaceLayout={isChatWorkspace}
overlay={isPaintingModule}
sidebarPeekOpen={sidebarPeekOpen}
onSidebarPeekChange={handleSidebarPeekChange}
showSidebarControls={!isCanvasWorkspace}
sidebarPeekOpen={isCanvasWorkspace ? false : sidebarPeekOpen}
onSidebarPeekChange={isCanvasWorkspace ? undefined : handleSidebarPeekChange}
/>
{/* Below the title bar: sidebar + content */}
@@ -88,8 +89,9 @@ export function MainLayout() {
<Sidebar
workspaceLayout={isChatWorkspace}
hideOnCompact={isCanvasWorkspace}
sidebarPeekOpen={sidebarPeekOpen}
onSidebarPeekChange={handleSidebarPeekChange}
forceExpanded={isCanvasWorkspace}
sidebarPeekOpen={isCanvasWorkspace ? false : sidebarPeekOpen}
onSidebarPeekChange={isCanvasWorkspace ? undefined : handleSidebarPeekChange}
/>
<main
data-testid="main-content"

View File

@@ -152,6 +152,7 @@ function getCoarsePointLabel(balance: WorksTokenPointBalance | null): string {
type SidebarProps = {
workspaceLayout?: boolean;
hideOnCompact?: boolean;
forceExpanded?: boolean;
sidebarPeekOpen?: boolean;
onSidebarPeekChange?: (open: boolean, source: SidebarPeekSource) => void;
};
@@ -159,11 +160,13 @@ type SidebarProps = {
export function Sidebar({
workspaceLayout = false,
hideOnCompact = false,
forceExpanded = false,
sidebarPeekOpen = false,
onSidebarPeekChange,
}: SidebarProps = {}) {
const { t } = useTranslation('common');
const sidebarPinnedCollapsed = useSettingsStore((state) => state.sidebarCollapsed);
const storedSidebarCollapsed = useSettingsStore((state) => state.sidebarCollapsed);
const sidebarPinnedCollapsed = !forceExpanded && storedSidebarCollapsed;
const sidebarCollapsed = sidebarPinnedCollapsed && !sidebarPeekOpen;
const projects = useCodingWorkspaceStore((state) => state.projects);
const activeProject = useCodingWorkspaceStore((state) => state.activeProject);

View File

@@ -234,7 +234,7 @@ function ProductTitleBar({
) : (
<div className="flex min-w-0 flex-1 items-center justify-end gap-1 px-2">{children}</div>
)}
{integrated && overlay ? titlebarLogo : null}
{integrated && overlay && (nativeTrafficLights || showSidebarControls) ? titlebarLogo : null}
</div>
);
}