diff --git a/apps/web/tests/markdown-cjk-strong-open.e2e.ts b/apps/web/tests/markdown-cjk-strong-open.e2e.ts new file mode 100644 index 0000000000..bcea84f19c --- /dev/null +++ b/apps/web/tests/markdown-cjk-strong-open.e2e.ts @@ -0,0 +1,57 @@ +/** Asterisk strong emphasis in a settled CJK reply opens after CJK text when the span starts with punctuation. */ +import { readFile } from 'node:fs/promises' +import { join } from 'node:path' +import { fileURLToPath } from 'node:url' +import { chromium, type Browser, type Page } from 'playwright' +import { afterAll, beforeAll, describe, expect, it, onTestFailed } from 'vitest' +import { + assertFixtureInventory, compareOrRefreshGolden, + launchWebScaffold, seedSession, watchConsole, webSnapshotMode, type WebScaffold, +} from './scaffold.ts' +import { newEnglishPage, saveFailureShot } from './support.ts' + +const SNAPSHOT_DIR = fileURLToPath(new URL('../../../snapshots/web/markdown-cjk-strong-open', import.meta.url)) +const MODE = webSnapshotMode() +const STRONG_TEXTS = [ + '“当键盘已经进入深睡眠(彻底断连)时的重连速度”', + '“Wi-Fi 下收不到推送”', + '(内容)', + '「深睡眠」', + '“配对流程”', +] + +describe('web e2e: strong emphasis opening after CJK text', () => { + let scaffold: WebScaffold + let browser: Browser + let page: Page + let tripwire: ReturnType + + beforeAll(async () => { + scaffold = await launchWebScaffold({}) + await seedSession(scaffold, await readFile(join(SNAPSHOT_DIR, 'session.v4.jsonl'), 'utf8'), 'markdown-cjk-strong-open') + browser = await chromium.launch() + page = await newEnglishPage(browser) + tripwire = watchConsole(page) + await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' }) + await page.locator('[role="treeitem"]').first().click() + await page.locator('[role="treeitem"]').nth(1).click() + await page.locator('[class*="markdown"] p', { hasText: '本身。' }).first().waitFor() + }, 120_000) + + afterAll(async () => { + await browser?.close() + await scaffold?.close() + }) + + it('renders each punctuation-led span after CJK text as strong and leaves no bare markers', async () => { + onTestFailed(() => saveFailureShot(page, 'web-e2e-markdown-cjk-strong-open')) + const reply = page.locator('[class*="markdown"]', { has: page.locator('p', { hasText: '本身。' }) }).first() + expect(await reply.locator('strong').allTextContents()).toEqual(STRONG_TEXTS) + expect(await reply.textContent()).not.toContain('**') + const prose = await reply.ariaSnapshot() + await compareOrRefreshGolden(join(SNAPSHOT_DIR, 'reply.expected.md'), prose, MODE) + expect(tripwire.pageErrors).toEqual([]) + expect(tripwire.warnings).toEqual([]) + await assertFixtureInventory(SNAPSHOT_DIR, ['session.v4.jsonl', 'reply.expected.md']) + }) +}) diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json index 8f78803d4b..dd12c56c04 100644 --- a/apps/web/tsconfig.json +++ b/apps/web/tsconfig.json @@ -201,6 +201,7 @@ "tests/thinking-markdown.e2e.ts", "tests/math-rendering.e2e.ts", "tests/markdown-cjk-strong.e2e.ts", + "tests/markdown-cjk-strong-open.e2e.ts", "tests/markdown-inline-code-links.e2e.ts", "tests/clickable-links-gallery.e2e.ts", "tests/queue-actions.e2e.ts", diff --git a/packages/client/ui-primitives/README.i18n.yaml b/packages/client/ui-primitives/README.i18n.yaml index 662fc787a4..ed5d9489ed 100644 --- a/packages/client/ui-primitives/README.i18n.yaml +++ b/packages/client/ui-primitives/README.i18n.yaml @@ -24,8 +24,8 @@ en: 8265fa792c6fd9ec zh: 600d2af4d5a3d183 /deepseek-ai-dsh-client-ui-primitives/use-this-package/rendering-agent-output: - en: e2649937f077d4e0 - zh: 6ad604cb5adfc16b + en: 7fed4894a6d0d568 + zh: c22881bfcef2d4b6 /deepseek-ai-dsh-client-ui-primitives/use-this-package/localizing-copy: en: 3fd7072b662eed0a zh: 88c6c299c0a6f8cd diff --git a/packages/client/ui-primitives/README.md b/packages/client/ui-primitives/README.md index 5c817b94b2..e8f6fef2dd 100644 --- a/packages/client/ui-primitives/README.md +++ b/packages/client/ui-primitives/README.md @@ -115,7 +115,7 @@ The nearest `MarkdownDelegateProvider` supplies optional `openExternalLink` and Explicit `./`, `../`, slash/backslash-rooted paths (including UNC), and Windows drive paths such as `C:/work/file.ts` take precedence over URL parsing. Otherwise, destinations accepted by the absolute URL parser remain URLs: `index.ts:24`, `Makefile:12`, and `localhost:3000` are links, without adding a protocol or testing whether they can open. Use `./index.ts:24` for a file reference. Other destinations are paths. Authored links reject `javascript:`, `vbscript:`, `data:`, and `blob:`; other parseable protocols retain native navigation. HTTP(S) links retain delegated navigation and modified-click behavior. No click-time failure notice is added. -`MarkdownText` renders untrusted GFM and TeX math, blocks unsafe links and images, and can turn resolved file mentions into explicit controls. Copying a selection that lies inside one `MarkdownText` document and includes rendered math puts each whole formula on the clipboard as TeX source in both plain text and HTML, delimited as `$…$` inline and `$$…$$` for display math. Strikethrough requires `~~`; a single `~`, as in `10~20`, stays literal. A bare URL ends before non-ASCII punctuation or symbols, such as `。` or `,`, so CJK prose that follows it stays outside the link. A surrounding `MarkdownDelegateProvider` receives sanitized HTTP(S) URLs from ordinary clicks; modified clicks and links outside a provider retain native external-anchor behavior. `omitHtml` renders raw HTML as nothing instead of literal text, for documents written for HTML renderers. When the owner passes a `pathImages` vocabulary, image destinations that are local media paths rewrite to displayable URLs on settled renders only (the same streaming gate as file mentions); without a vocabulary, local destinations remain inert alt text. Rewritten images accept HTTP(S), data, blob, and the Desktop `dsh-app://app/api/file`, `dsh-app://app/api/plugin-market/detail-file`, and `dsh-app://app/api/plugin-manager/detail-file` routes; authored Desktop URLs remain inert. A load or decode failure replaces the image with its authored alt text, or the original destination when alt is empty; `fileImages` additionally supplies a localized failure prefix. Changing the image source permits a fresh load. Each mounted image appends a `load` query parameter to a resolved Host `api/file` URL, because browsers reuse a same-URL image within one document despite `no-store`; a newly rendered image of an overwritten file therefore loads its current bytes, and every remount requests the file again; the Host file route redirects that request to a cacheable URL for the current file version. While a reply streams, it freezes completed blocks, advances a top-level open fence by completed lines, and highlights that fence from saved Shiki grammar state. Completed token lines enter fixed-size React groups, so later chunks reconcile only the growing group; an unchanged fence retains that DOM when the final full parse resolves cross-document syntax. `TerminalBlock`, `ReadBlock`, `DiffBlock`, `SearchBlock`, and `WebBlock` render the matching tool-result intent with copy controls, overflow handling, and ANSI processing where applicable. `JsonTree` and `JsonBlock` inspect JSON values read-only, while `UserTextRun` renders uninterpreted text and `ReferenceChip` renders business-resolved labels. An explicit `onActivate` makes a chip a keyboard-accessible button; repeated pointer clicks and an existing text selection do not activate it, while keyboard activation remains available. Labels inherit their host’s wrapping policy. Recognition and JSON transforms belong to [ui-conversation](../ui-conversation/README.md#sent-user-text). +`MarkdownText` renders untrusted GFM and TeX math, blocks unsafe links and images, and can turn resolved file mentions into explicit controls. Copying a selection that lies inside one `MarkdownText` document and includes rendered math puts each whole formula on the clipboard as TeX source in both plain text and HTML, delimited as `$…$` inline and `$$…$$` for display math. Strikethrough requires `~~`; a single `~`, as in `10~20`, stays literal. Asterisk strong emphasis opens after CJK text before punctuation and closes after punctuation before CJK text, so `针对**“重连速度”**,` and `**注意:**内容` render bold without spaces around the markers. A bare URL ends before non-ASCII punctuation or symbols, such as `。` or `,`, so CJK prose that follows it stays outside the link. A surrounding `MarkdownDelegateProvider` receives sanitized HTTP(S) URLs from ordinary clicks; modified clicks and links outside a provider retain native external-anchor behavior. `omitHtml` renders raw HTML as nothing instead of literal text, for documents written for HTML renderers. When the owner passes a `pathImages` vocabulary, image destinations that are local media paths rewrite to displayable URLs on settled renders only (the same streaming gate as file mentions); without a vocabulary, local destinations remain inert alt text. Rewritten images accept HTTP(S), data, blob, and the Desktop `dsh-app://app/api/file`, `dsh-app://app/api/plugin-market/detail-file`, and `dsh-app://app/api/plugin-manager/detail-file` routes; authored Desktop URLs remain inert. A load or decode failure replaces the image with its authored alt text, or the original destination when alt is empty; `fileImages` additionally supplies a localized failure prefix. Changing the image source permits a fresh load. Each mounted image appends a `load` query parameter to a resolved Host `api/file` URL, because browsers reuse a same-URL image within one document despite `no-store`; a newly rendered image of an overwritten file therefore loads its current bytes, and every remount requests the file again; the Host file route redirects that request to a cacheable URL for the current file version. While a reply streams, it freezes completed blocks, advances a top-level open fence by completed lines, and highlights that fence from saved Shiki grammar state. Completed token lines enter fixed-size React groups, so later chunks reconcile only the growing group; an unchanged fence retains that DOM when the final full parse resolves cross-document syntax. `TerminalBlock`, `ReadBlock`, `DiffBlock`, `SearchBlock`, and `WebBlock` render the matching tool-result intent with copy controls, overflow handling, and ANSI processing where applicable. `JsonTree` and `JsonBlock` inspect JSON values read-only, while `UserTextRun` renders uninterpreted text and `ReferenceChip` renders business-resolved labels. An explicit `onActivate` makes a chip a keyboard-accessible button; repeated pointer clicks and an existing text selection do not activate it, while keyboard activation remains available. Labels inherit their host’s wrapping policy. Recognition and JSON transforms belong to [ui-conversation](../ui-conversation/README.md#sent-user-text). `MarkdownText` defaults to `variant="body"`. Use `variant="compact"` for secondary content: its 13px text and 20px line height follow the content-size setting, all heading levels use the same size with weight 600, and paragraphs and lists use tighter spacing. Text, links, and code keep the tertiary color; dotted underlines distinguish links. Code headers scroll with their blocks. Tables and math stay enabled at the surrounding text size and scroll horizontally within the available width. Both variants share the parser and streaming cache. `textInteractionSource` marks its existing root as a source for text selection interactions. diff --git a/packages/client/ui-primitives/README.zh.md b/packages/client/ui-primitives/README.zh.md index f3e1c1719a..0842ac696e 100644 --- a/packages/client/ui-primitives/README.zh.md +++ b/packages/client/ui-primitives/README.zh.md @@ -115,7 +115,7 @@ kind: "package-library" 明确的 `./`、`../`、斜杠或反斜杠开头的路径(包括 UNC),以及 `C:/work/file.ts` 这样的 Windows 盘符路径优先于 URL 解析。其余目标若能被绝对 URL 解析器接受,就保留为 URL:`index.ts:24`、`Makefile:12` 和 `localhost:3000` 均为链接,不补协议,也不预先检查能否打开。文件引用使用 `./index.ts:24`。其他目标视为路径。正文链接禁止 `javascript:`、`vbscript:`、`data:` 和 `blob:`;其余可解析的协议保留原生导航。HTTP(S) 链接保留委托导航和修饰键点击行为。不添加点击后的失败提示。 -`MarkdownText` 渲染不可信的 GFM 与 TeX 公式、阻止不安全的链接与图片,并可把已解析的文件提及转换为显式控件。复制位于同一个 `MarkdownText` 文档内且包含已渲染公式的选区时,每个完整公式会以 TeX 源码同时写入剪贴板的纯文本和 HTML 格式,行内公式用 `$…$` 包裹,展示公式用 `$$…$$` 包裹。删除线需要 `~~`;单个 `~`(如 `10~20`)保持字面文本。裸 URL 在非 ASCII 标点或符号(如 `。`、`,`)前结束,紧随其后的中文正文不会并入链接。外层 `MarkdownDelegateProvider` 会接收普通点击产生的已净化 HTTP(S) URL;带修饰键的点击和 Provider 外的链接保留原生外部 anchor 行为。`omitHtml` 不渲染原始 HTML,而不是将其显示为原样文本,用于为 HTML 渲染器编写的文档。当 owner 传入 `pathImages` 词表时,本地媒体路径的图片目标只在落定渲染阶段重写为可展示 URL(与 file mentions 相同的流式门);不传词表时本地目标保持惰性 alt 文本。重写后的图片支持 HTTP(S)、data、blob 及桌面端 `dsh-app://app/api/file`、`dsh-app://app/api/plugin-market/detail-file` 与 `dsh-app://app/api/plugin-manager/detail-file` 路由;正文直接书写的桌面端 URL 仍保持惰性。加载或解码失败后,图片替换为作者的 alt 文本;alt 为空时显示原始目标路径;`fileImages` 还提供本地化的失败提示前缀。图片源变化后可重新加载。每个挂载的图片会为解析得到的 Host `api/file` 地址追加 `load` 查询参数,因为浏览器在同一文档内会无视 `no-store` 复用相同 URL 的图片;因此覆盖后的文件在新渲染的图片中会加载当前内容,每次重新挂载都会重新请求该文件;Host 文件路由会把该请求重定向到当前文件版本的可缓存地址。回复流式输出时,它冻结已完成的块、按已完成行推进顶层未闭合 fence,并从保存的 Shiki grammar state 为该 fence 增量高亮。已完成的 token 行进入固定大小的 React 分组,后续分片只 reconcile 正在增长的分组;最终全量解析解决跨文档语法时,未变化的 fence 会保留该 DOM。`TerminalBlock`、`ReadBlock`、`DiffBlock`、`SearchBlock` 与 `WebBlock` 把对应的工具结果意图渲染为带复制控件、溢出处理及适用时 ANSI 处理的卡片。`JsonTree` 与 `JsonBlock` 以只读方式检查 JSON 值;`UserTextRun` 渲染不做解析的文本,`ReferenceChip` 渲染业务已解析的标签。显式传入 `onActivate` 后,胶囊成为可由键盘操作的按钮;重复指针点击和已有文本选区不触发激活,键盘激活仍然可用。标签继承所属容器的换行规则。识别和 JSON 变换由 [ui-conversation](../ui-conversation/README.zh.md#sent-user-text) 负责。 +`MarkdownText` 渲染不可信的 GFM 与 TeX 公式、阻止不安全的链接与图片,并可把已解析的文件提及转换为显式控件。复制位于同一个 `MarkdownText` 文档内且包含已渲染公式的选区时,每个完整公式会以 TeX 源码同时写入剪贴板的纯文本和 HTML 格式,行内公式用 `$…$` 包裹,展示公式用 `$$…$$` 包裹。删除线需要 `~~`;单个 `~`(如 `10~20`)保持字面文本。星号加粗在汉字之后、标点之前可以开启,在标点之后、汉字之前可以闭合,因此 `针对**“重连速度”**,` 与 `**注意:**内容` 无需在标记两侧加空格也能加粗。裸 URL 在非 ASCII 标点或符号(如 `。`、`,`)前结束,紧随其后的中文正文不会并入链接。外层 `MarkdownDelegateProvider` 会接收普通点击产生的已净化 HTTP(S) URL;带修饰键的点击和 Provider 外的链接保留原生外部 anchor 行为。`omitHtml` 不渲染原始 HTML,而不是将其显示为原样文本,用于为 HTML 渲染器编写的文档。当 owner 传入 `pathImages` 词表时,本地媒体路径的图片目标只在落定渲染阶段重写为可展示 URL(与 file mentions 相同的流式门);不传词表时本地目标保持惰性 alt 文本。重写后的图片支持 HTTP(S)、data、blob 及桌面端 `dsh-app://app/api/file`、`dsh-app://app/api/plugin-market/detail-file` 与 `dsh-app://app/api/plugin-manager/detail-file` 路由;正文直接书写的桌面端 URL 仍保持惰性。加载或解码失败后,图片替换为作者的 alt 文本;alt 为空时显示原始目标路径;`fileImages` 还提供本地化的失败提示前缀。图片源变化后可重新加载。每个挂载的图片会为解析得到的 Host `api/file` 地址追加 `load` 查询参数,因为浏览器在同一文档内会无视 `no-store` 复用相同 URL 的图片;因此覆盖后的文件在新渲染的图片中会加载当前内容,每次重新挂载都会重新请求该文件;Host 文件路由会把该请求重定向到当前文件版本的可缓存地址。回复流式输出时,它冻结已完成的块、按已完成行推进顶层未闭合 fence,并从保存的 Shiki grammar state 为该 fence 增量高亮。已完成的 token 行进入固定大小的 React 分组,后续分片只 reconcile 正在增长的分组;最终全量解析解决跨文档语法时,未变化的 fence 会保留该 DOM。`TerminalBlock`、`ReadBlock`、`DiffBlock`、`SearchBlock` 与 `WebBlock` 把对应的工具结果意图渲染为带复制控件、溢出处理及适用时 ANSI 处理的卡片。`JsonTree` 与 `JsonBlock` 以只读方式检查 JSON 值;`UserTextRun` 渲染不做解析的文本,`ReferenceChip` 渲染业务已解析的标签。显式传入 `onActivate` 后,胶囊成为可由键盘操作的按钮;重复指针点击和已有文本选区不触发激活,键盘激活仍然可用。标签继承所属容器的换行规则。识别和 JSON 变换由 [ui-conversation](../ui-conversation/README.zh.md#sent-user-text) 负责。 `MarkdownText` 默认为 `variant="body"`。次级内容使用 `variant="compact"`:其 13px 字号与 20px 行高跟随内容字号设置,各级标题保持同一字号并使用 600 字重,段落与列表采用更紧凑的间距。正文、链接和代码均保持 tertiary 颜色,以点状下划线区分链接。代码标题栏随代码块滚动。表格和公式仍然启用,使用周围文字的字号,并在可用宽度内横向滚动。两个变体共享解析器与流式缓存。 `textInteractionSource` 将已有根元素标记为文本选区交互的来源。 diff --git a/packages/client/ui-primitives/src/markdown/cjkFriendlyStrong.ts b/packages/client/ui-primitives/src/markdown/cjkFriendlyStrong.ts index aba740d058..3c37fe0ebb 100644 --- a/packages/client/ui-primitives/src/markdown/cjkFriendlyStrong.ts +++ b/packages/client/ui-primitives/src/markdown/cjkFriendlyStrong.ts @@ -1,4 +1,7 @@ -/** Let asterisk strong emphasis close after punctuation when CJK prose continues without whitespace. */ +/** + * Let asterisk strong emphasis open after CJK prose before punctuation, and close after punctuation + * before CJK prose, without whitespace. + */ import { attention } from 'micromark-core-commonmark' import { unicodePunctuation } from 'micromark-util-character' @@ -46,15 +49,19 @@ const tokenizeCjkFriendlyAttention: Tokenizer = function (effects, ok, nok) { const token = effects.exit('attentionSequence') const after = classifyCharacter(code) - const open = !after || (after === constants.characterGroupPunctuation && Boolean(before)) + const commonMarkOpen = !after || (after === constants.characterGroupPunctuation && Boolean(before)) || attentionMarkers.includes(code) const commonMarkClose = !before || (before === constants.characterGroupPunctuation && Boolean(after)) || attentionMarkers.includes(previous) const markerCount = token.end.offset - token.start.offset + const cjkStrongOpen = markerCount >= 2 + && isCjkCharacter(previous) + && unicodePunctuation(code) const cjkStrongClose = markerCount >= 2 && unicodePunctuation(previous) && isCjkCharacter(code) + const open = commonMarkOpen || cjkStrongOpen const close = commonMarkClose || cjkStrongClose token._open = open diff --git a/packages/client/ui-primitives/tests/markdown.client.spec.tsx b/packages/client/ui-primitives/tests/markdown.client.spec.tsx index 13db7b9302..056a7fec85 100644 --- a/packages/client/ui-primitives/tests/markdown.client.spec.tsx +++ b/packages/client/ui-primitives/tests/markdown.client.spec.tsx @@ -104,6 +104,8 @@ describe('MarkdownText', () => { '```', '**普通**内容', '*普通*内容', + 'word**“引号”**word', + '词*“引号”*继续', ].join('\n\n') const { container } = render() @@ -115,6 +117,29 @@ describe('MarkdownText', () => { expect(container.textContent).toContain('**Notice:**text') expect(container.textContent).toContain('*提醒!*继续') expect(container.textContent).toContain('**注意:**内容') + expect(container.textContent).toContain('word**“引号”**word') + expect(container.textContent).toContain('词*“引号”*继续') + }) + + it('opens strong emphasis after CJK text when the span starts with punctuation', () => { + const cases = [ + ['针对**“当键盘已经进入深睡眠(彻底断连)时的重连速度”**,继续', ['“当键盘已经进入深睡眠(彻底断连)时的重连速度”']], + ['一条**“N 小、D 大”**的路', ['“N 小、D 大”']], + ['是**“用大模型少训”与“用小模型多训”之间的抉择**。', ['“用大模型少训”与“用小模型多训”之间的抉择']], + ['采用**(实验性)**方案', ['(实验性)']], + ['导致了**“Wi-Fi 下收不到推送”**的现象,以及包含**(内容)**的列表。', ['“Wi-Fi 下收不到推送”', '(内容)']], + ['用户判定**「还是有点现代」**,根因是**走错了一代**,不是配色', ['「还是有点现代」', '走错了一代']], + ['执行**`bluetoothd`**进程,以及**“深睡眠”**测试', ['bluetoothd', '“深睡眠”']], + ] as const + const source = cases.map(([markdown]) => markdown).join('\n\n') + + for (const streaming of [false, true]) { + const rendered = render() + expect([...rendered.container.querySelectorAll('strong')].map(node => node.textContent)) + .toEqual(cases.flatMap(([, strong]) => strong)) + expect(rendered.container.textContent).not.toContain('**') + rendered.unmount() + } }) it('links complete HTTP(S) inline code without promoting commands, unsafe schemes, or fences', () => { diff --git a/snapshots/web/markdown-cjk-strong-open/reply.expected.md b/snapshots/web/markdown-cjk-strong-open/reply.expected.md new file mode 100644 index 0000000000..1356fe87c0 --- /dev/null +++ b/snapshots/web/markdown-cjk-strong-open/reply.expected.md @@ -0,0 +1,18 @@ +- paragraph: + - text: 针对 + - strong: “当键盘已经进入深睡眠(彻底断连)时的重连速度” + - text: ,我核对了 + - code: bluetoothd + - text: 的日志:唤醒后第一次扫描没有命中。 +- paragraph: + - text: 这导致了 + - strong: “Wi-Fi 下收不到推送” + - text: 的现象,以及包含 + - strong: (内容) + - text: 的列表都刷不出来。 +- paragraph: + - text: 换句话说,问题出在 + - strong: 「深睡眠」 + - text: 阶段,而不是 + - strong: “配对流程” + - text: 本身。 diff --git a/snapshots/web/markdown-cjk-strong-open/session.v4.jsonl b/snapshots/web/markdown-cjk-strong-open/session.v4.jsonl new file mode 100644 index 0000000000..2a9426eb70 --- /dev/null +++ b/snapshots/web/markdown-cjk-strong-open/session.v4.jsonl @@ -0,0 +1,10 @@ +{"version":4,"isSeeded":false,"createdAt":0,"cwd":"{{cwd}}","delegationDepth":0,"type":"session","id":"{{session:1}}"} +{"type":"turn/start","data":{"turn":1}} +{"type":"step/start","data":{"turn":1,"step":1}} +{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:1}}"}},"surfaceOp":"append"} +{"type":"user/message","data":{"content":[{"type":"text","text":"键盘深睡眠后为什么收不到推送?"}],"source":{"kind":"user","rpcId":"{{rpc:1}}"},"role":"user","id":"{{message:2}}"},"surfaceOp":"append"} +{"type":"session/title","data":{"title":"键盘深睡眠重连","messageSeqs":[3],"source":{"kind":"fallback"}}} +{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash"},"tools":"{{tools}}"},"reason":"initial"}} +{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"text","text":"针对**“当键盘已经进入深睡眠(彻底断连)时的重连速度”**,我核对了 `bluetoothd` 的日志:唤醒后第一次扫描没有命中。\n\n这导致了**“Wi-Fi 下收不到推送”**的现象,以及包含**(内容)**的列表都刷不出来。\n\n换句话说,问题出在**「深睡眠」**阶段,而不是**“配对流程”**本身。"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:3}}"},"stream":[]},"surfaceOp":"append"} +{"type":"step/end","data":{"turn":1,"step":1}} +{"type":"turn/end","data":{"turn":1,"reason":{"kind":"completed"}}} diff --git a/snapshots/web/markdown-cjk-strong-open/snapshot.yml b/snapshots/web/markdown-cjk-strong-open/snapshot.yml new file mode 100644 index 0000000000..dc9275ffb8 --- /dev/null +++ b/snapshots/web/markdown-cjk-strong-open/snapshot.yml @@ -0,0 +1,7 @@ +version: 1 +scenario: markdown-cjk-strong-open +profile: web +composition: web-default +recording: authored +header: + class: web-default diff --git a/tsconfig.host.json b/tsconfig.host.json index c2eb718f3a..a90d6dabab 100644 --- a/tsconfig.host.json +++ b/tsconfig.host.json @@ -190,6 +190,7 @@ "apps/web/tests/thinking-markdown.e2e.ts", "apps/web/tests/math-rendering.e2e.ts", "apps/web/tests/markdown-cjk-strong.e2e.ts", + "apps/web/tests/markdown-cjk-strong-open.e2e.ts", "apps/web/tests/markdown-inline-code-links.e2e.ts", "apps/web/tests/clickable-links-gallery.e2e.ts", "apps/web/tests/queue-actions.e2e.ts",