add fitContent option to workspace layout panels

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-01 08:38:31 +00:00
co-authored by Claude Opus 4.6
parent 0a00172e49
commit 776738a983
2 changed files with 6 additions and 2 deletions
@@ -164,15 +164,18 @@ const LayoutNodeRenderer = ({
);
}
const hasFixedChild = node.direction === 'vertical' && node.children.some((c) => getFixedHeight(c.node, registry) !== undefined);
const hasFixedChild =
node.direction === 'vertical' &&
node.children.some((c) => getFixedHeight(c.node, registry) !== undefined || (c.node.type === 'panel' && c.node.fitContent));
if (hasFixedChild) {
return (
<div className="flex h-full w-full flex-col">
{node.children.map((child) => {
const fixed = getFixedHeight(child.node, registry);
const fit = child.node.type === 'panel' && child.node.fitContent;
return (
<div key={child.node.id} className={fixed !== undefined ? 'shrink-0' : 'min-h-0 flex-1'} style={fixed !== undefined ? { height: fixed } : undefined}>
<div key={child.node.id} className={fixed !== undefined || fit ? 'shrink-0' : 'min-h-0 flex-1'} style={fixed !== undefined ? { height: fixed } : undefined}>
<LayoutNodeRenderer
node={child.node}
registry={registry}
@@ -12,6 +12,7 @@ export type LayoutPanel = {
type: 'panel';
id: string;
appType: string | null;
fitContent?: boolean;
};
export type LayoutNode = LayoutGroup | LayoutPanel;