mirror of
https://github.com/hanzoai/chat.git
synced 2026-09-30 20:51:17 +00:00
The two slices land together because neither is whole alone: the composer drops the model chip, and the header is where the replacement lives. Landing the composer by itself would have put model choice back behind the endpoint drill-down, which is the six clicks both slices exist to remove. Measured in Chromium, not argued: the picker opens onto THREE rows, each an answer rather than a provider to drill into, and a pick closes the menu — two clicks. A named model is one level deeper, behind `Advanced`, which is the whole of that disclosure. The composer row holds Add, Dictate and Send and nothing else. `e2e/specs/chrome/slice.spec.ts` is 15/15 on this commit. CURATION, where the two slices met: - `chrome.spec.ts` TOP_ROW is membership checked against Header's imports. Two files left it and neither was deleted: `Chat/PanelControls` renders nowhere at all now (it is still the only place this app defines a keyboard shortcut, so unmounting it is a decision about those shortcuts, not about this row), and `Menus/OpenSidebar` is mounted by `Agents/Marketplace` — a different surface with its own row. A file that draws no control here cannot disagree with this row's geometry, so scanning it passed for the wrong reason. ModelSelector and ConvoMenu joined; both are in the row. - Filenames now match their exports: `CanvasToggle` → `Sources`, `ExportAndShareMenu` → `Share`. `Menus/Endpoints/` held one component and an icon after the endpoint menu went, and its last outside importer left with the Settings model row, so it is flattened into `Menus/` rather than renamed to a second wrong word. - `Providers/BadgeRowContext` → `ToolsContext`. The badge row is gone; the state it held was never the row's — it is the ephemeral agent's, one field per tool, which the server reads back. TWELVE locale keys, en only, inserted as text so the other 1,691 keep their order. `com_ui_web_search` and `com_nav_settings` already existed and are reused rather than named twice. DEAD, and measured before removing: the `+` command wrote `showPlusPopoverFamily` and nothing read it — the popover it opened left with `AddedConvo`, so typing `+` set a boolean with no reader. Its atom, its permission check, its toggle and `saveBadgesState` (whose `if` block was empty) go with it, plus `store.speechToText`, `store.languageSTT` and the `BadgeItem` type, none of which had a reader. `useHandleKeyUp.spec.ts` is deleted rather than repaired: it reports `Tests: 0 total` on main — it dies at import against a module that does not exist, so it has never run, and it describes a hook signature the source never had. Typecheck is line-for-line unchanged against main with positions and the TranslationKeys union normalized: zero new error lines, six gone.
29 lines
1.3 KiB
TypeScript
29 lines
1.3 KiB
TypeScript
import { expect, test } from '@playwright/test';
|
|
import { getPrimaryE2EUser } from '../../setup/users.mock';
|
|
import { NEW_CHAT_PATH } from './helpers';
|
|
|
|
test.describe('app loads cleanly', () => {
|
|
test('authenticated user lands on a rendered chat view without runtime errors', async ({
|
|
page,
|
|
}) => {
|
|
const user = getPrimaryE2EUser();
|
|
const pageErrors: string[] = [];
|
|
page.on('pageerror', (error) => pageErrors.push(error.message));
|
|
|
|
await page.goto(NEW_CHAT_PATH, { timeout: 10000 });
|
|
|
|
await expect(page).toHaveURL(/\/c\/new$/);
|
|
await expect(page.getByRole('main')).toBeVisible();
|
|
await expect(page.getByRole('main')).toContainText(user.name);
|
|
await expect(page.getByRole('textbox', { name: 'Message input' })).toBeVisible();
|
|
/* By id: the control's accessible name is the effort question, and its text
|
|
is whatever is currently chosen, so both are moving targets for a boot
|
|
check that only wants to know the header rendered. */
|
|
await expect(page.locator('#model-menu-button')).toBeVisible();
|
|
await expect(page.getByTestId('nav-user')).toBeVisible();
|
|
|
|
await expect(page.getByText(/something went wrong/i)).toHaveCount(0);
|
|
expect(pageErrors, `Unexpected runtime errors: ${pageErrors.join(', ')}`).toHaveLength(0);
|
|
});
|
|
});
|