fix: sync context panel iframe themes
Keeps embedded sessions aligned with parent theme Prevents iframe reloads on theme changes Supports theme hotkeys from focused iframes
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { beforeEach, describe, expect, test } from 'bun:test';
|
||||
import { useUIStore } from './useUIStore';
|
||||
|
||||
beforeEach(() => {
|
||||
useUIStore.setState({ contextPanelByDirectory: {} });
|
||||
});
|
||||
|
||||
describe('useUIStore context panel tabs', () => {
|
||||
test('updates readOnly when an existing chat tab is reopened', () => {
|
||||
const directory = '/repo';
|
||||
|
||||
useUIStore.getState().openContextPanelTab(directory, {
|
||||
mode: 'chat',
|
||||
dedupeKey: 'session:ses_1',
|
||||
label: 'Session',
|
||||
readOnly: true,
|
||||
});
|
||||
|
||||
useUIStore.getState().openContextPanelTab(directory, {
|
||||
mode: 'chat',
|
||||
dedupeKey: 'session:ses_1',
|
||||
label: 'Session',
|
||||
readOnly: false,
|
||||
});
|
||||
|
||||
const tabs = useUIStore.getState().contextPanelByDirectory[directory]?.tabs ?? [];
|
||||
expect(tabs).toHaveLength(1);
|
||||
expect(tabs[0]?.readOnly).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user