mirror of
https://github.com/stablyai/orca.git
synced 2026-10-17 08:03:14 +00:00
fix(native-chat): tolerate missing layout state
This commit is contained in:
@@ -146,6 +146,10 @@ describe('selectTabAgentTypesByTabId', () => {
|
||||
).toEqual({ 'tab-1': 'claude' })
|
||||
})
|
||||
|
||||
it('treats a missing layout map as no unsafe split evidence during hydration', () => {
|
||||
expect(selectNativeChatTabWideFallbackUnsafeTabsById()).toEqual({})
|
||||
})
|
||||
|
||||
it('resolves the active leaf through nested splits and ignores expanded siblings', () => {
|
||||
const layout: TerminalLayoutSnapshot = {
|
||||
root: {
|
||||
|
||||
@@ -64,8 +64,10 @@ export function selectTabAgentTypesByTabId(
|
||||
}
|
||||
|
||||
export function selectNativeChatTabWideFallbackUnsafeTabsById(
|
||||
terminalLayoutsByTabId: Record<string, TerminalLayoutSnapshot>
|
||||
terminalLayoutsByTabId: Record<string, TerminalLayoutSnapshot> = {}
|
||||
): Record<string, true> {
|
||||
// Why: legacy and hydrating store shapes may not expose layout state yet;
|
||||
// absence carries no unsafe split evidence and must not crash tab rendering.
|
||||
const unsafeTabs: Record<string, true> = {}
|
||||
for (const [tabId, layout] of Object.entries(terminalLayoutsByTabId)) {
|
||||
if (!isNativeChatTabWideFallbackSafe(layout)) {
|
||||
|
||||
Reference in New Issue
Block a user