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.
46 lines
1.9 KiB
TypeScript
46 lines
1.9 KiB
TypeScript
import { expect, test } from '@playwright/test';
|
|
import { getPrimaryE2EUser } from '../../setup/users.mock';
|
|
import { NEW_CHAT_PATH, selectModel } from './helpers';
|
|
|
|
/** Spec with `showOnLanding: true` and an HTML `description` in e2e/config/chat.e2e.yaml. */
|
|
const BRANDED_SPEC = {
|
|
label: 'E2E Branded',
|
|
descriptionText: 'Branded answers',
|
|
descriptionIcon: '/assets/openai.svg',
|
|
};
|
|
|
|
/** The `softDefault: true` spec does not set `showOnLanding`, so it is unbranded. */
|
|
const UNBRANDED_SPEC_LABEL = 'E2E Soft Default';
|
|
|
|
test.describe('model spec branding on landing', () => {
|
|
test('branded spec replaces the greeting with its label and rendered description', async ({
|
|
page,
|
|
}) => {
|
|
await page.goto(NEW_CHAT_PATH, { timeout: 10000 });
|
|
await selectModel(page, BRANDED_SPEC.label);
|
|
|
|
const main = page.getByRole('main');
|
|
await expect(main).toContainText(BRANDED_SPEC.label);
|
|
await expect(main).toContainText(BRANDED_SPEC.descriptionText);
|
|
await expect(main.locator(`img[src$="${BRANDED_SPEC.descriptionIcon}"]`)).toBeVisible();
|
|
|
|
const user = getPrimaryE2EUser();
|
|
await expect(main).not.toContainText(user.name);
|
|
});
|
|
|
|
test('unbranded spec keeps the personalized greeting', async ({ page }) => {
|
|
await page.goto(NEW_CHAT_PATH, { timeout: 10000 });
|
|
await selectModel(page, UNBRANDED_SPEC_LABEL);
|
|
|
|
const user = getPrimaryE2EUser();
|
|
await expect(page.getByRole('main')).toContainText(user.name);
|
|
});
|
|
|
|
/* The third test here asserted the spec's description INSIDE the picker, and
|
|
it is deleted rather than re-selectored: a row is `{icon}{label}` now and
|
|
carries no second line, so there is no longer a description in the menu to
|
|
find. Re-pointing it at the new row would have produced a test that passes
|
|
by looking for nothing. The description still renders, on the landing —
|
|
which is what the first test above already measures. */
|
|
});
|