From 8968fedec21760d8aff71d3fb5d894d271d47e7f Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Thu, 17 Sep 2026 12:49:55 +0800 Subject: [PATCH] feat(client): open message links in Sidebar Browser --- apps/web/tests/clickable-links-gallery.e2e.ts | 15 +++++ .../clickable-links-gallery/ui.expected.md | 5 ++ packages/client/ui-chat/package.json | 1 + packages/client/ui-chat/src/client/apply.ts | 4 ++ .../ui-chat/src/client/chat/ChatView.tsx | 44 ++++++++------- .../ui-chat/src/client/contract/slots.ts | 2 + .../tests/apply-inject.client.spec.tsx | 20 ++++++- .../ui-chat/tests/chat-apply.client.spec.tsx | 2 +- .../ui-chat/tests/chat-view.client.spec.tsx | 1 + packages/client/ui-chat/tsconfig.json | 3 + packages/client/ui-primitives/src/index.ts | 2 + .../src/markdown/MarkdownDelegate.tsx | 38 +++++++++++++ .../src/markdown/MarkdownText.tsx | 10 ++-- .../ui-primitives/src/markdown/render.tsx | 25 +++++++-- .../tests/markdown.client.spec.tsx | 55 ++++++++++++++++++- .../src/client/slot-catalog.ts | 10 ++-- pnpm-lock.yaml | 3 + 17 files changed, 201 insertions(+), 39 deletions(-) create mode 100644 packages/client/ui-primitives/src/markdown/MarkdownDelegate.tsx diff --git a/apps/web/tests/clickable-links-gallery.e2e.ts b/apps/web/tests/clickable-links-gallery.e2e.ts index 834d72d500..5f210b0bab 100644 --- a/apps/web/tests/clickable-links-gallery.e2e.ts +++ b/apps/web/tests/clickable-links-gallery.e2e.ts @@ -50,6 +50,7 @@ const DONE = 'LINK_GALLERY_DONE' const GALLERY_TIME = Date.UTC(2026, 0, 15, 12) const GUIDE_URL = 'https://docs.example.test/guide' +const HTTP_URL = 'http://docs.example.test/plain' const API_URL = 'https://docs.example.test/api' const RELEASES_URL = 'https://docs.example.test/releases' const MAILTO_URL = 'mailto:owner@example.test' @@ -260,6 +261,8 @@ function galleryFixture(imageUrl: string): string { `Docs: [style guide](${GUIDE_URL}) and \`${API_URL}\`; see [the release notes][rel], ` + `contact [the maintainer](${MAILTO_URL}), and check the fine print[^1].`, '', + `Preview: [plain HTTP](${HTTP_URL}).`, + '', `Upstream: [the repository](${REPO_URL}).`, '', `Inert contrasts: \`curl ${API_URL}\`, \`javascript:alert(1)\`, and \`pnpm run build\`.`, @@ -315,6 +318,10 @@ describe('web e2e: clickable links gallery', () => { await seedSession(scaffold, galleryFixture(imageUrl), SEED_ID, undefined, { createdAt: GALLERY_TIME }) browser = await chromium.launch() page = await newEnglishPage(browser) + await page.route(/https?:\/\/docs\.example\.test\/.*/u, async route => route.fulfill({ + contentType: 'text/html', + body: `

${new URL(route.request().url()).pathname}

`, + })) await page.clock.setFixedTime(GALLERY_TIME + 60_000) tripwire = watchConsole(page) await page.goto(scaffold.authenticatedUrl, { waitUntil: 'load' }) @@ -342,6 +349,7 @@ describe('web e2e: clickable links gallery', () => { const markdown = page.locator('[class*="markdown"]') await expect.poll(() => markdown.locator(`a[href="${GUIDE_URL}"]`).count(), { timeout: 10_000 }).toBe(1) expect(await markdown.locator(`a[href="${RELEASES_URL}"]`).count()).toBe(1) + expect(await markdown.locator(`a[href="${HTTP_URL}"]`).count()).toBe(1) expect(await markdown.locator(`a[href="${MAILTO_URL}"]`).count()).toBe(1) const inlineCodeLink = markdown.locator(`code a[href="${API_URL}"]`) expect(await inlineCodeLink.count()).toBe(1) @@ -439,5 +447,12 @@ describe('web e2e: clickable links gallery', () => { expect(await styleOf(mentions.first(), 'text-decoration-style')).toBe('dotted') // The excluded grey affordance: tool-row file links keep their own color. expect(await styleOf(page.locator('button[class*="fileLink"]').first(), 'color')).not.toBe(LINK_BLUE) + + // Ordinary message HTTP(S) links delegate to the right Sidebar Browser. + await guideLink.click() + const browserAddress = page.locator('[data-rightbar-col]').getByRole('textbox', { name: 'Enter an HTTP(S) address' }) + await expect.poll(() => browserAddress.inputValue()).toBe(GUIDE_URL) + await markdown.locator(`a[href="${HTTP_URL}"]`).click() + await expect.poll(() => browserAddress.inputValue()).toBe(HTTP_URL) }, 90_000) }) diff --git a/apps/web/tests/expected/clickable-links-gallery/ui.expected.md b/apps/web/tests/expected/clickable-links-gallery/ui.expected.md index 24b68b3077..f23d5c693e 100644 --- a/apps/web/tests/expected/clickable-links-gallery/ui.expected.md +++ b/apps/web/tests/expected/clickable-links-gallery/ui.expected.md @@ -142,6 +142,11 @@ - text: ", and check the fine print" - superscript: "1" - text: . +- paragraph: + - text: "Preview:" + - link "plain HTTP": + - /url: http://docs.example.test/plain + - text: . - paragraph: - text: "Upstream:" - link "the repository": diff --git a/packages/client/ui-chat/package.json b/packages/client/ui-chat/package.json index 88d97cea84..3741c90845 100644 --- a/packages/client/ui-chat/package.json +++ b/packages/client/ui-chat/package.json @@ -69,6 +69,7 @@ "@deepseek-ai/dsh-client-ui-renderer": "workspace:^", "@deepseek-ai/dsh-client-ui-session": "workspace:^", "@deepseek-ai/dsh-client-ui-settings": "workspace:^", + "@deepseek-ai/dsh-client-ui-sidebar-browser": "workspace:^", "@deepseek-ai/dsh-client-ui-sidebar-documentpreview": "workspace:^", "@deepseek-ai/dsh-client-ui-sidebar-right": "workspace:^", "@deepseek-ai/dsh-client-ui-slots": "workspace:^", diff --git a/packages/client/ui-chat/src/client/apply.ts b/packages/client/ui-chat/src/client/apply.ts index c20d7e7875..a31e581c76 100644 --- a/packages/client/ui-chat/src/client/apply.ts +++ b/packages/client/ui-chat/src/client/apply.ts @@ -6,6 +6,7 @@ import type { SessionBinding } from '@deepseek-ai/dsh-api-session-controller/cli import type { ObservableSnapshot } from '@deepseek-ai/dsh-client-store' import type { SessionId } from '@deepseek-ai/dsh-session/types' import type {} from '@deepseek-ai/dsh-client-ui-sidebar-right/client' +import type {} from '@deepseek-ai/dsh-client-ui-sidebar-browser/client' import type {} from '@deepseek-ai/dsh-client-ui-input-trigger/client' // The `file` entry of `SidebarRightResourceParamsMap`, which types `{ params: { line } }` below. import type {} from '@deepseek-ai/dsh-client-ui-sidebar-documentpreview/client' @@ -142,6 +143,9 @@ export function apply(ctx: Context): void { if (scope === undefined) return ctx.get('inputTriggers')?.sessionOf(scope).openReference('skill', { ref: `/${name}` }) }, + openExternalLink: (url) => { + ctx.sidebarRight.openTab('browser', { params: { url } }) + }, loadOlder: () => { void session.loadOlder() }, loadThrough: seq => session.loadThrough(seq), loadImage: Object.assign( diff --git a/packages/client/ui-chat/src/client/chat/ChatView.tsx b/packages/client/ui-chat/src/client/chat/ChatView.tsx index 00d53507c7..3ad01f83b3 100644 --- a/packages/client/ui-chat/src/client/chat/ChatView.tsx +++ b/packages/client/ui-chat/src/client/chat/ChatView.tsx @@ -7,7 +7,7 @@ import type { } from '@deepseek-ai/dsh-client-ui-conversation/client' import type { SessionSeq } from '@deepseek-ai/dsh-session/types' import type { InboxState } from '@deepseek-ai/dsh-agent/types' -import { Button, IconChevronDownOutline14, Modal } from '@deepseek-ai/dsh-client-ui-primitives' +import { Button, IconChevronDownOutline14, MarkdownDelegateProvider, Modal } from '@deepseek-ai/dsh-client-ui-primitives' import type { ChatViewSlotProps, OpenFileOptions } from '../contract/slots.ts' import type { ChatSnapshot } from '../contract/snapshot.ts' import { PendingSteeringBubble, PendingSubmissionBubble } from './MessageItem.tsx' @@ -217,7 +217,7 @@ const ChatNodeList = memo(function ChatNodeList({ order, ...seatProps }: ChatNod */ export function ChatView({ useSession, useChat, useChatNode, useChatNodeProcess, useSessions, useStore, actions, renderSlot, - sessionId, openFile, openSkill, loadOlder, loadThrough, loadImage, openView, chatScroll, forkAt, fileMentions, + sessionId, openFile, openSkill, openExternalLink, loadOlder, loadThrough, loadImage, openView, chatScroll, forkAt, fileMentions, useTranscriptView, useProjection, t, }: ChatViewSlotProps) { const order = useChat(s => s.order) @@ -782,25 +782,27 @@ export function ChatView({ )} - + + + {/* No pending placeholders: questions (ui-user-questions) and approvals (ApprovalPanel) both take over the composer, so a flow card would double-render the same wait. */} diff --git a/packages/client/ui-chat/src/client/contract/slots.ts b/packages/client/ui-chat/src/client/contract/slots.ts index fa02cc4092..a42670525e 100644 --- a/packages/client/ui-chat/src/client/contract/slots.ts +++ b/packages/client/ui-chat/src/client/contract/slots.ts @@ -142,6 +142,8 @@ export interface ChatViewInjected { } /** Open the current source file of a skill referenced by a sent message. */ openSkill: (name: string) => void + /** Open one HTTP(S) message link in a Sidebar Browser tab. */ + openExternalLink: (url: string) => void openFile: (path: string, options?: OpenFileOptions) => Promise loadOlder: () => void /** Jump loader: page history back through seq; resolves when the window covers it. */ diff --git a/packages/client/ui-chat/tests/apply-inject.client.spec.tsx b/packages/client/ui-chat/tests/apply-inject.client.spec.tsx index 3802528471..76be299d0c 100644 --- a/packages/client/ui-chat/tests/apply-inject.client.spec.tsx +++ b/packages/client/ui-chat/tests/apply-inject.client.spec.tsx @@ -51,7 +51,10 @@ async function bench() { runtime.ctx.provide('settingsScope', { bind: () => stubSettingsScope().scope } as never) const layout = { closeRightbar: vi.fn(), openRightbar: vi.fn() } runtime.ctx.provide('layout', layout as never) - const sidebarRight = { openResource: vi.fn<(address: string) => void>() } + const sidebarRight = { + openResource: vi.fn<(address: string) => void>(), + openTab: vi.fn<(kind: string, options?: unknown) => void>(), + } runtime.ctx.provide('sidebarRight', sidebarRight as never) const openWorkspacePath = vi.fn( () => Promise.resolve({ ok: true, value: { opened: true } }), @@ -145,6 +148,18 @@ describe('Chat inject API', () => { await b.runtime.dispose() }) + it('opens message HTTP(S) links in Sidebar Browser tabs', async () => { + const b = await bench() + const { injected } = b.chatViewApi(b.rootReference) + injected.openExternalLink('http://example.test/path') + injected.openExternalLink('https://example.test/path') + expect(b.sidebarRight.openTab.mock.calls).toEqual([ + ['browser', { params: { url: 'http://example.test/path' } }], + ['browser', { params: { url: 'https://example.test/path' } }], + ]) + await b.runtime.dispose() + }) + it('routes sent skill previews through the viewed Session source and tolerates an absent provider', async () => { const b = await bench() const { injected } = b.chatViewApi(b.rootReference) @@ -198,6 +213,9 @@ describe('Chat inject API', () => { const { injected } = b.chatViewApi(b.rootReference) const owner = {} as never + expect(injected.keyedHooks.chatNode('missing')).toBeDefined() + expect(injected.keyedHooks.chatNodeProcess('missing')).toBeDefined() + expect(injected.fileMentions(owner)).toBeUndefined() const mentions = { resolve: vi.fn() } as never const forClosing = vi.fn(() => mentions) diff --git a/packages/client/ui-chat/tests/chat-apply.client.spec.tsx b/packages/client/ui-chat/tests/chat-apply.client.spec.tsx index 051b78e01d..a761e4eaaa 100644 --- a/packages/client/ui-chat/tests/chat-apply.client.spec.tsx +++ b/packages/client/ui-chat/tests/chat-apply.client.spec.tsx @@ -43,7 +43,7 @@ async function bench() { : stubSettingsScope().scope, } as never) runtime.ctx.provide('layout', { openRightbar: vi.fn(), closeRightbar: vi.fn() } as never) - runtime.ctx.provide('sidebarRight', { openResource: vi.fn() } as never) + runtime.ctx.provide('sidebarRight', { openResource: vi.fn(), openTab: vi.fn() } as never) const openSession = vi.fn<(id: SessionId) => void>() runtime.ctx.provide('uiWorkspace', { openWorkspace: vi.fn(async (_workspaceId: WorkspaceId, beforeOpen: (id: SessionId) => void) => { diff --git a/packages/client/ui-chat/tests/chat-view.client.spec.tsx b/packages/client/ui-chat/tests/chat-view.client.spec.tsx index 8a63203668..ea5af421fc 100644 --- a/packages/client/ui-chat/tests/chat-view.client.spec.tsx +++ b/packages/client/ui-chat/tests/chat-view.client.spec.tsx @@ -408,6 +408,7 @@ function makeHarness( completeViewRequest: () => {}, openFile, openSkill, + openExternalLink: vi.fn(), loadOlder, loadThrough, loadImage: vi.fn(() => Promise.reject(new Error('not used'))), diff --git a/packages/client/ui-chat/tsconfig.json b/packages/client/ui-chat/tsconfig.json index b109b1affc..ece071b757 100644 --- a/packages/client/ui-chat/tsconfig.json +++ b/packages/client/ui-chat/tsconfig.json @@ -86,6 +86,9 @@ { "path": "../ui-session" }, + { + "path": "../ui-sidebar-browser" + }, { "path": "../ui-sidebar-right" }, diff --git a/packages/client/ui-primitives/src/index.ts b/packages/client/ui-primitives/src/index.ts index c720825bbf..ff8bd4213a 100644 --- a/packages/client/ui-primitives/src/index.ts +++ b/packages/client/ui-primitives/src/index.ts @@ -68,6 +68,8 @@ export type { export { CodeBlock } from './markdown/CodeBlock.tsx' export type { CodeBlockProps } from './markdown/CodeBlock.tsx' export { JsonBlock } from './markdown/JsonBlock.tsx' +export { MarkdownDelegateProvider } from './markdown/MarkdownDelegate.tsx' +export type { MarkdownDelegateProviderProps, MarkdownExternalLinkHandler } from './markdown/MarkdownDelegate.tsx' export { MarkdownText } from './markdown/MarkdownText.tsx' export type { MarkdownCodeLabels, MarkdownFileMentions, MarkdownLabels, MarkdownPathImages } from './markdown/MarkdownText.tsx' export { extractMarkdownPlainText } from './markdown/plain-text.ts' diff --git a/packages/client/ui-primitives/src/markdown/MarkdownDelegate.tsx b/packages/client/ui-primitives/src/markdown/MarkdownDelegate.tsx new file mode 100644 index 0000000000..98a82fb8ed --- /dev/null +++ b/packages/client/ui-primitives/src/markdown/MarkdownDelegate.tsx @@ -0,0 +1,38 @@ +/** Consumer-owned navigation for ordinary Markdown HTTP(S) link activation. */ +import { createContext, useContext } from 'react' +import type { ReactNode } from 'react' + +/** + * Handle one sanitized absolute HTTP(S) URL selected from Markdown. + * @param href - destination URL. + */ +export type MarkdownExternalLinkHandler = (href: string) => void + +const MarkdownDelegateContext = createContext(undefined) + +/** Props for one Markdown navigation scope. */ +export interface MarkdownDelegateProviderProps { + readonly children: ReactNode + readonly openExternalLink: MarkdownExternalLinkHandler +} + +/** + * Delegate ordinary Markdown HTTP(S) activation without threading callbacks through renderers. + * @param props - child tree and its link handler. + * @returns the scoped child tree. + */ +export function MarkdownDelegateProvider({ + children, + openExternalLink, +}: MarkdownDelegateProviderProps): ReactNode { + return ( + + {children} + + ) +} + +/** Read the nearest optional Markdown HTTP(S) navigation delegate. */ +export function useMarkdownExternalLinkDelegate(): MarkdownExternalLinkHandler | undefined { + return useContext(MarkdownDelegateContext) +} diff --git a/packages/client/ui-primitives/src/markdown/MarkdownText.tsx b/packages/client/ui-primitives/src/markdown/MarkdownText.tsx index 8eace9bbe2..57b65e12ae 100644 --- a/packages/client/ui-primitives/src/markdown/MarkdownText.tsx +++ b/packages/client/ui-primitives/src/markdown/MarkdownText.tsx @@ -157,12 +157,14 @@ class StreamingRenderer { * identity discards the streaming render cache mid-message. `fileMentions` * links inline-code tokens its resolver recognizes as real files, and * `pathImages` rewrites image destinations that are local file paths into - * displayable URLs its resolver vouches for; both vocabularies are the + * displayable URLs its resolver vouches for. Those two vocabularies are the * single streaming gate — they apply to settled renders only, because a * streaming message's vocabulary is not final and frozen cached elements - * must not bake in handlers that could go stale. `variant="compact"` uses - * secondary text sizing, uniform bold headings, and tight block spacing; - * the default `body` variant uses the full document typography. + * must not bake in handlers that could go stale. A surrounding + * `MarkdownDelegateProvider` can delegate ordinary HTTP(S) activation while + * modified clicks retain native behavior. `variant="compact"` uses secondary + * text sizing, uniform bold headings, and tight block spacing; the default + * `body` variant uses the full document typography. * @returns A GFM document with TeX math rendered through KaTeX; raw HTML, * relative links, and unsafe protocols are disabled, while absolute HTTP(S) * images render directly. diff --git a/packages/client/ui-primitives/src/markdown/render.tsx b/packages/client/ui-primitives/src/markdown/render.tsx index b9a491a012..97b09d7e89 100644 --- a/packages/client/ui-primitives/src/markdown/render.tsx +++ b/packages/client/ui-primitives/src/markdown/render.tsx @@ -25,6 +25,7 @@ import { normalizeUri } from 'micromark-util-sanitize-uri' import { CodeBlock } from './CodeBlock.tsx' import { renderTexToReact } from './katex.tsx' import { LinkIcon, classifyLinkPath } from '../LinkIcon.tsx' +import { useMarkdownExternalLinkDelegate } from './MarkdownDelegate.tsx' import type { PositionedBlock } from './incremental.ts' import css from './MarkdownText.module.css' @@ -525,18 +526,32 @@ function anchorWrapsOnlyImages(children: Md.PhrasingContent[]): boolean { return children.length > 0 && children.every(child => child.type === 'image' || child.type === 'imageReference') } -/** Anchor over an already-authored href: allowlisted or unwrapped, external links get the safe attributes. */ +/** Anchor over an already-authored href: allowlisted or unwrapped, with optional owner navigation for HTTP(S). */ function renderSafeLink(href: string, children: ReactNode[], key: Key, glyph = true): ReactNode { const safeHref = sanitizeUrl(href) if (safeHref === '') return {children} - const external = ['http:', 'https:'].includes(new URL(safeHref).protocol) + return {children} +} + +function MarkdownAnchor({ href, glyph, children }: { + readonly href: string + readonly glyph: boolean + readonly children: ReactNode[] +}): ReactNode { + const openExternalLink = useMarkdownExternalLinkDelegate() + const external = ['http:', 'https:'].includes(new URL(href).protocol) + const open = external ? openExternalLink : undefined return ( { + if (event.button !== 0 || event.metaKey || event.ctrlKey || event.shiftKey || event.altKey) return + event.preventDefault() + open(href) + }} > - {glyph && } + {glyph && } {children} ) diff --git a/packages/client/ui-primitives/tests/markdown.client.spec.tsx b/packages/client/ui-primitives/tests/markdown.client.spec.tsx index a275c174f5..81e22b95d2 100644 --- a/packages/client/ui-primitives/tests/markdown.client.spec.tsx +++ b/packages/client/ui-primitives/tests/markdown.client.spec.tsx @@ -1,8 +1,8 @@ // @vitest-environment jsdom import { cleanup, fireEvent, render, screen } from '@testing-library/react' -import { afterEach, describe, expect, it } from 'vitest' +import { afterEach, describe, expect, it, vi } from 'vitest' import { JsonBlock, MarkdownText } from './markdown-test-components.tsx' -import { LinkIcon } from '../src/index.ts' +import { LinkIcon, MarkdownDelegateProvider } from '../src/index.ts' import { cjkFriendlyStrong } from '../src/markdown/cjkFriendlyStrong.ts' import { mathCompatibility } from '../src/markdown/mathCompatibility.ts' @@ -141,6 +141,57 @@ describe('MarkdownText', () => { expect(container.querySelector('pre code a')).toBeNull() }) + it('delegates ordinary HTTP(S) clicks while preserving modified-click behavior', () => { + const openExternalLink = vi.fn<(href: string) => void>() + render( + + + , + ) + + const secure = screen.getByRole('link', { name: 'secure' }) + const plain = screen.getByRole('link', { name: 'plain' }) + const code = screen.getByRole('link', { name: 'https://example.com/code' }) + expect(fireEvent.click(secure)).toBe(false) + expect(fireEvent.click(plain)).toBe(false) + expect(fireEvent.click(code)).toBe(false) + expect(openExternalLink.mock.calls).toEqual([ + ['https://example.com/a'], + ['http://example.com/b'], + ['https://example.com/code'], + ]) + + for (const modified of [ + { button: 1 }, + { metaKey: true }, + { ctrlKey: true }, + { shiftKey: true }, + { altKey: true }, + ]) expect(fireEvent.click(secure, modified)).toBe(true) + expect(openExternalLink).toHaveBeenCalledTimes(3) + expect(screen.getByRole('link', { name: 'mail' }).getAttribute('target')).toBeNull() + }) + + it('updates the delegated link handler while Markdown is streaming', () => { + const first = vi.fn<(href: string) => void>() + const second = vi.fn<(href: string) => void>() + const source = '[web](https://example.com/)' + const view = render( + + + , + ) + fireEvent.click(screen.getByRole('link', { name: 'web' })) + view.rerender( + + + , + ) + fireEvent.click(screen.getByRole('link', { name: 'web' })) + expect(first).toHaveBeenCalledOnce() + expect(second).toHaveBeenCalledOnce() + }) + it('links inline code through the file-mention resolver: URL first, settled only, never inside links', () => { const opened: string[] = [] const fileMentions = { diff --git a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts index 91d55ce4e6..4f0842f298 100644 --- a/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts +++ b/packages/extensions/cordis-client-runner/src/client/slot-catalog.ts @@ -176,7 +176,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ ], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.chat.assistant-actions\', () => ctx.slots.register(\n { name: \'conversation.chat.assistant-actions\', id: \'my-entry\', order: 100, label: \'My entry\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-chat/src/client/contract/slots.ts:217', + source: 'packages/client/ui-chat/src/client/contract/slots.ts:219', }, { key: 'conversation.chat.commandview', @@ -224,7 +224,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ occupants: [], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.chat.commandview\', () => ctx.slots.register(\n { name: \'conversation.chat.commandview\', key: \'\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-chat/src/client/contract/slots.ts:205', + source: 'packages/client/ui-chat/src/client/contract/slots.ts:207', }, { key: 'conversation.chat.node', @@ -293,7 +293,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ ], replaceRisk: 'shadows-shipped-ui', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.chat.node\', () => ctx.slots.register(\n { name: \'conversation.chat.node\', key: \'\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-chat/src/client/contract/slots.ts:186', + source: 'packages/client/ui-chat/src/client/contract/slots.ts:188', }, { key: 'conversation.chat.turnTail', @@ -341,7 +341,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ ], replaceRisk: 'none', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.chat.turnTail\', () => ctx.slots.register(\n { name: \'conversation.chat.turnTail\', select: owner => null },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-chat/src/client/contract/slots.ts:211', + source: 'packages/client/ui-chat/src/client/contract/slots.ts:213', }, { key: 'conversation.composer', @@ -1049,7 +1049,7 @@ export const CLIENT_SLOT_API: readonly ClientSlotEntry[] = [ ], replaceRisk: 'shadows-shipped-ui', example: 'return {\n inject: [\'slots\'],\n apply(ctx) {\n ctx.slots.inject(\'conversation.message.images\', () => ctx.slots.register(\n { name: \'conversation.message.images\' },\n () => React.createElement(\'div\', null, \'hello\'),\n ))\n },\n}', - source: 'packages/client/ui-chat/src/client/contract/slots.ts:199', + source: 'packages/client/ui-chat/src/client/contract/slots.ts:201', }, { key: 'conversation.session', diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 58149b06f6..bfa67441ec 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -2763,6 +2763,9 @@ importers: '@deepseek-ai/dsh-client-ui-settings': specifier: workspace:^ version: link:../ui-settings + '@deepseek-ai/dsh-client-ui-sidebar-browser': + specifier: workspace:^ + version: link:../ui-sidebar-browser '@deepseek-ai/dsh-client-ui-sidebar-documentpreview': specifier: workspace:^ version: link:../ui-sidebar-documentpreview