Files
platform/src/apps/officer-web/Screens/Dashboard/ChatHistory/defaultLayout.ts
T
pastilhasandClaude Opus 5 8f2d80573a actually give existing users the live panel
The previous commit added it to defaultLayout, which anyone who has ever opened /chat never sees:
useDashboardState seeds its default only when the key is ABSENT, so a stored layout keeps the shape it
had when it was first written. appTypes/normalizeLayout does not cover this — it repairs which app a
panel runs, never the tree — so the change was visible only on a fresh account. It was shipped with a
note to reset the layout by hand, which is not a fix.

The screen now replaces a layout with no chat-live panel. Replacing outright is safe here specifically
because the screen is locked: the structure is dictated by code, and the only user contribution is
column sizes. Terminates because the replacement contains the panel it tests for.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-10 01:15:40 +01:00

32 lines
1.1 KiB
TypeScript

import type { LayoutNode } from 'officerdev';
/** Does this tree contain a panel running `appType`? */
export function hasAppType(node: LayoutNode, appType: string): boolean {
if (node.type === 'panel') return node.appType === appType;
return node.children.some((child) => hasAppType(child.node, appType));
}
// The left column is itself a split: what is running now on top, the whole history below. They answer
// different questions from different sources — the agent's in-memory map versus transcripts on disk —
// and the live one is small and usually empty, hence the lopsided 25/75.
export const defaultLayout: LayoutNode = {
type: 'group',
id: 'chat-history-root',
direction: 'horizontal',
children: [
{
node: {
type: 'group',
id: 'chat-sidebar',
direction: 'vertical',
children: [
{ node: { type: 'panel', id: 'chat-live', appType: 'chat-live' }, size: 25 },
{ node: { type: 'panel', id: 'chat-list', appType: 'chat-session-list' }, size: 75 },
],
},
size: 35,
},
{ node: { type: 'panel', id: 'chat-detail', appType: 'chat-detail' }, size: 65 },
],
};