Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

rightPanelLayout.ts

19 lines987 Bytes

1export const RIGHT_PANEL_INLINE_LAYOUT_MEDIA_QUERY = "(max-width: 980px)";
2const THREAD_PANEL_INLINE_MIN_WIDTH = 1_104;
3// Applied only while a floating preview overlaps the compact sheet.
4export const RIGHT_PANEL_SHEET_LAYER_CLASS_NAME = "z-[35]";
5export const RIGHT_PANEL_SHEET_CLASS_NAME =
6 "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))]";
7​
8export type ThreadPanelPresentation = "inline" | "popover";
9​
10export function resolveThreadPanelPresentation(
11 workspaceWidth: number | null,
12 occupiedRightPanelWidth: number,
13 rightPanelMaximized: boolean,
14): ThreadPanelPresentation {
15 if (workspaceWidth === null) return "inline";
16​
17 const chatPaneWidth = rightPanelMaximized ? 0 : workspaceWidth - occupiedRightPanelWidth;
18 return chatPaneWidth < THREAD_PANEL_INLINE_MIN_WIDTH ? "popover" : "inline";