diff --git a/apps/web/src/components/ChatView.tsx b/apps/web/src/components/ChatView.tsx index 40cd1b421058..424fae3f3e5d 100644 --- a/apps/web/src/components/ChatView.tsx +++ b/apps/web/src/components/ChatView.tsx @@ -99,7 +99,10 @@ import { useTurnDiffSummaries } from "../hooks/useTurnDiffSummaries"; import { useCommandPaletteStore } from "../commandPaletteStore"; import { buildTemporaryWorktreeBranchName } from "@t3tools/shared/git"; import { useMediaQuery } from "../hooks/useMediaQuery"; -import { RIGHT_PANEL_INLINE_LAYOUT_MEDIA_QUERY } from "../rightPanelLayout"; +import { + RIGHT_PANEL_INLINE_LAYOUT_MEDIA_QUERY, + RIGHT_PANEL_NARROW_SHEET_CLASS_NAME, +} from "../rightPanelLayout"; import { BranchToolbar } from "./BranchToolbar"; import { resolveShortcutCommand, shortcutLabelForCommand } from "../keybindings"; import PlanSidebar from "./PlanSidebar"; @@ -3532,7 +3535,11 @@ export default function ChatView(props: ChatViewProps) { /> ))} {shouldUsePlanSidebarSheet ? ( - + void; + /** + * Override the default sheet sizing classes. Use one of the named exports + * from `rightPanelLayout` (e.g. `RIGHT_PANEL_NARROW_SHEET_CLASS_NAME`) to + * pick a specific width preset; defaults to the wide variant. + */ + className?: string; }) { return ( {props.children} diff --git a/apps/web/src/rightPanelLayout.ts b/apps/web/src/rightPanelLayout.ts index 5528072e57b3..0ea6c19c525b 100644 --- a/apps/web/src/rightPanelLayout.ts +++ b/apps/web/src/rightPanelLayout.ts @@ -1,3 +1,17 @@ export const RIGHT_PANEL_INLINE_LAYOUT_MEDIA_QUERY = "(max-width: 980px)"; -export const RIGHT_PANEL_SHEET_CLASS_NAME = - "w-[min(42vw,28rem)] min-w-80 max-w-[28rem] p-0 max-[760px]:w-[min(88vw,24rem)] max-[760px]:min-w-0 wco:mt-[env(titlebar-area-height)] wco:h-[calc(100%-env(titlebar-area-height))] wco:max-h-[calc(100%-env(titlebar-area-height))]"; + +const RIGHT_PANEL_SHEET_BASE_CLASS_NAME = + "p-0 wco:mt-[env(titlebar-area-height)] wco:h-[calc(100%-env(titlebar-area-height))] wco:max-h-[calc(100%-env(titlebar-area-height))]"; + +/** + * Wide sheet (e.g. diff viewer) — sized for code/diff content with room for + * long lines on tablet-sized viewports. + */ +export const RIGHT_PANEL_SHEET_CLASS_NAME = `w-[min(42vw,28rem)] min-w-80 max-w-[28rem] max-[760px]:w-[min(88vw,24rem)] max-[760px]:min-w-0 ${RIGHT_PANEL_SHEET_BASE_CLASS_NAME}`; + +/** + * Narrow sheet (e.g. plan/task sidebar) — caps at 340px to match the inline + * sidebar width on wide viewports, preventing the sheet from covering most + * of the content area on viewports just below the inline-layout breakpoint. + */ +export const RIGHT_PANEL_NARROW_SHEET_CLASS_NAME = `w-[min(88vw,340px)] max-w-[340px] ${RIGHT_PANEL_SHEET_BASE_CLASS_NAME}`;