Replace separate sidebar stores with a unified panel store that uses a discriminated union state machine on mobile. This makes it impossible for both the agent list and file explorer sidebars to be open at the same time on mobile. Mobile state machine (mobileView): - 'agent': Main agent view (no overlay panel) - 'agent-list': Agent list sidebar (left overlay) - 'file-explorer': File explorer sidebar (right overlay) Desktop retains independent boolean toggles since sidebars sit alongside content rather than overlaying it. Key changes: - Created stores/panel-store.ts with unified state - Deleted stores/sidebar-store.ts and explorer-sidebar-store.ts - Updated all components to use new panel store - Animation contexts derive isOpen from unified state
26 lines
1.0 KiB
TypeScript
26 lines
1.0 KiB
TypeScript
import { test, expect } from './fixtures';
|
|
import { gotoHome, ensureHostSelected, setWorkingDirectory } from './helpers/app';
|
|
|
|
test('preserves prompt text when trying to create agent with non-existent directory', async ({ page }) => {
|
|
const nonExistentDir = '/non/existent/directory/that/does/not/exist';
|
|
const promptText = `Test prompt that should be preserved ${Date.now()}`;
|
|
|
|
await gotoHome(page);
|
|
await ensureHostSelected(page);
|
|
await setWorkingDirectory(page, nonExistentDir);
|
|
|
|
// Enter prompt text
|
|
const input = page.getByRole('textbox', { name: 'Message agent...' });
|
|
await expect(input).toBeEditable();
|
|
await input.fill(promptText);
|
|
|
|
// Try to submit - this should fail with an error about the directory not existing
|
|
await input.press('Enter');
|
|
|
|
// Verify error message is displayed (error includes the path)
|
|
await expect(page.getByText(/Working directory does not exist/)).toBeVisible();
|
|
|
|
// Verify the prompt text is still preserved in the input
|
|
await expect(input).toHaveValue(promptText);
|
|
});
|