mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-28 07:09:50 +00:00
The per-page Open popover deep-linked Scira, ChatGPT, Claude and Cursor with a read-this-page prompt while Hanzo's own assistant was absent from Hanzo's own pages. Add the Enso item before the third-party links: it opens hanzo.chat/c/new with an edit-intent prompt carrying the page URL (chat's composer prefills from ?q=), and the raw MDX every page already exports beside itself gives the assistant the exact source being edited. Title and prompt ride the existing i18n contract (pageActionsOpenEnso, pageActionsEditInLLMPrompt) in both UI twins and both locale packs; the edit intent stays a distinct value from the ask intent. Tests pin the keys across all four translation surfaces and that rendering substitutes the URL without residue. Co-authored-by: Hanzo Dev <[email protected]>
25 lines
993 B
TypeScript
25 lines
993 B
TypeScript
import { describe, expect, test } from 'vitest';
|
|
import { defaultTranslations } from '@hanzo/docs-ui/i18n';
|
|
import { zhCN } from '../src/zh-cn';
|
|
import { zhTW } from '../src/zh-tw';
|
|
|
|
// Every full translation surface must carry the Enso page action: the English
|
|
// defaults and both locale packs. A locale missing the keys would silently fall
|
|
// back at runtime only if typed Partial — these packs are complete by contract.
|
|
describe('Enso page action across translation surfaces', () => {
|
|
const surfaces = [
|
|
['en', defaultTranslations],
|
|
['zh-CN', zhCN().value.ui!],
|
|
['zh-TW', zhTW().value.ui!],
|
|
] as const;
|
|
|
|
test.each(surfaces)('%s carries title and edit prompt', (_name, ui) => {
|
|
expect(ui.pageActionsOpenEnso).toBeTruthy();
|
|
expect(ui.pageActionsEditInLLMPrompt).toContain('{url}');
|
|
});
|
|
|
|
test.each(surfaces)('%s keeps edit and ask prompts distinct', (_name, ui) => {
|
|
expect(ui.pageActionsEditInLLMPrompt).not.toBe(ui.pageActionsOpenInLLMPrompt);
|
|
});
|
|
});
|