Skip to content

Commit 42dbd6c

Browse files
committed
Merge branch 'feat/2.6.0-beta4' of github.com:dataelement/bisheng into feat/2.6.0-beta4
2 parents ff4d2d0 + aa85355 commit 42dbd6c

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

src/frontend/client/src/components/Chat/AiChatMessages.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ interface AiChatMessagesProps {
3939
flatMode?: boolean;
4040
/** Knowledge space AI panel: full-width column, 14px body, gray user / borderless assistant */
4141
knowledgeChatLayout?: boolean;
42+
/** Show the export-session entry under assistant messages. The full homepage/task
43+
chat opts in; the lightweight knowledge/file/article docks and share view leave
44+
it off. Independent of knowledgeChatLayout (which is a layout-width flag and is
45+
true for the homepage chat too). */
46+
allowExport?: boolean;
4247
/** Overrides empty-state line under the illustration (e.g. knowledge folder QA hint from parent) */
4348
emptyStateHint?: string;
4449
/** Overrides the empty-state illustration (defaults to the AI-home image).
@@ -77,6 +82,7 @@ function MessageTreeNode({
7782
currentIndex,
7883
onRegenerate,
7984
knowledgeChatLayout,
85+
allowExport,
8086
onOpenCitationPanel,
8187
activeCitationMessageId,
8288
onPreviewFile,
@@ -88,6 +94,7 @@ function MessageTreeNode({
8894
onRegenerate?: (parentMessageId: string) => void;
8995
onPreviewFile?: (file: ArtifactFile) => void;
9096
knowledgeChatLayout?: boolean;
97+
allowExport?: boolean;
9198
onOpenCitationPanel?: (payload: CitationReferencesDesktopPayload) => void;
9299
activeCitationMessageId?: string | null;
93100
}) {
@@ -132,6 +139,7 @@ function MessageTreeNode({
132139
siblingCount={siblings.length}
133140
setSiblingIdx={setSiblingIdx}
134141
knowledgeChatLayout={knowledgeChatLayout}
142+
allowExport={allowExport}
135143
onOpenCitationPanel={onOpenCitationPanel}
136144
activeCitationMessageId={activeCitationMessageId}
137145
onPreviewFile={onPreviewFile}
@@ -145,6 +153,7 @@ function MessageTreeNode({
145153
currentIndex={currentIndex + 1}
146154
onRegenerate={onRegenerate}
147155
knowledgeChatLayout={knowledgeChatLayout}
156+
allowExport={allowExport}
148157
onOpenCitationPanel={onOpenCitationPanel}
149158
activeCitationMessageId={activeCitationMessageId}
150159
onPreviewFile={onPreviewFile}
@@ -166,6 +175,7 @@ export default function AiChatMessages({
166175
hideHeaderTitle = false,
167176
flatMode = false,
168177
knowledgeChatLayout = false,
178+
allowExport = false,
169179
emptyStateHint,
170180
emptyStateIllustration,
171181
contentWidthClassName,
@@ -397,6 +407,7 @@ export default function AiChatMessages({
397407
: undefined
398408
}
399409
knowledgeChatLayout={knowledgeChatLayout}
410+
allowExport={allowExport}
400411
onOpenCitationPanel={onOpenCitationPanel}
401412
activeCitationMessageId={activeCitationMessageId}
402413
onPreviewFile={onPreviewFile}
@@ -413,6 +424,7 @@ export default function AiChatMessages({
413424
currentIndex={0}
414425
onRegenerate={onRegenerate}
415426
knowledgeChatLayout={knowledgeChatLayout}
427+
allowExport={allowExport}
416428
onOpenCitationPanel={onOpenCitationPanel}
417429
activeCitationMessageId={activeCitationMessageId}
418430
onPreviewFile={onPreviewFile}

src/frontend/client/src/components/Chat/AiMessageBubble.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ interface AiMessageBubbleProps {
130130
setSiblingIdx?: (idx: number) => void;
131131
/** Knowledge space AI: gray user bubble, borderless assistant, 14px body, full width */
132132
knowledgeChatLayout?: boolean;
133+
/** Show the export-session entry under assistant messages. Only the full
134+
homepage/task chat opts in; the lightweight knowledge/file/article docks
135+
and the share view leave it off. */
136+
allowExport?: boolean;
133137
onOpenCitationPanel?: (payload: CitationReferencesDesktopPayload) => void;
134138
activeCitationMessageId?: string | null;
135139
/** F035: preview a task-turn document in the inline workspace panel (ChatView
@@ -325,6 +329,7 @@ const AiMessageBubble = memo(
325329
siblingCount,
326330
setSiblingIdx,
327331
knowledgeChatLayout,
332+
allowExport,
328333
onOpenCitationPanel,
329334
activeCitationMessageId,
330335
onPreviewFile,
@@ -352,6 +357,7 @@ const AiMessageBubble = memo(
352357
siblingCount={siblingCount}
353358
setSiblingIdx={setSiblingIdx}
354359
knowledgeChatLayout={knowledgeChatLayout}
360+
allowExport={allowExport}
355361
onOpenCitationPanel={onOpenCitationPanel}
356362
activeCitationMessageId={activeCitationMessageId}
357363
onPreviewFile={onPreviewFile}
@@ -478,6 +484,7 @@ function AssistantBubble({
478484
siblingCount,
479485
setSiblingIdx,
480486
knowledgeChatLayout,
487+
allowExport,
481488
onOpenCitationPanel,
482489
activeCitationMessageId,
483490
onPreviewFile,
@@ -490,6 +497,7 @@ function AssistantBubble({
490497
siblingCount?: number;
491498
setSiblingIdx?: (idx: number) => void;
492499
knowledgeChatLayout?: boolean;
500+
allowExport?: boolean;
493501
onOpenCitationPanel?: (payload: CitationReferencesDesktopPayload) => void;
494502
activeCitationMessageId?: string | null;
495503
onPreviewFile?: (file: ArtifactFile) => void;
@@ -716,9 +724,10 @@ function AssistantBubble({
716724
actionButtons={
717725
<>
718726
<CopyButton text={regularContent} />
719-
{/* Export is only offered in the full homepage chat — the lightweight
720-
knowledge/file/article docks (knowledgeChatLayout) hide it. */}
721-
{!knowledgeChatLayout && message.conversationId && message.messageId && (
727+
{/* Export is only offered where the host opts in via allowExport
728+
(the full homepage/task chat). The lightweight knowledge/file/
729+
article docks and the share view leave it off. */}
730+
{allowExport && message.conversationId && message.messageId && (
722731
<ExportSelectionButton
723732
chatId={message.conversationId}
724733
messageId={message.messageId}

src/frontend/client/src/components/Chat/ChatView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,7 @@ const ChatView = ({ id = '', index = 0, shareToken = '' }: { id?: string, index?
610610
isStreaming={isStreaming}
611611
shareToken={shareToken}
612612
knowledgeChatLayout
613+
allowExport
613614
contentWidthClassName="w-full max-w-[800px] mx-auto px-4 touch-mobile:max-w-full"
614615
onRegenerate={regenerate}
615616
onOpenCitationPanel={onOpenCitationPanel}

0 commit comments

Comments
 (0)