Whole-Turn folding chose the final answer by position, so a Turn that continued after answering (a notice reply, record keeping, or a tool call) hid the real answer with the process. A folded Turn now hides only its process; every assistant-step reply row stays visible. Settings -> General -> Replies After Collapse (ui-chat.foldedReplies, default "all") switches back to the previous final-answer-only rule; the choice applies immediately and is hidden in Verbose.
46 lines
2.0 KiB
TypeScript
46 lines
2.0 KiB
TypeScript
/** Host registration for browser Chat preferences. */
|
|
import type {} from '@deepseek-ai/dsh-settings'
|
|
|
|
import type { Volatile, Context } from '@deepseek-ai/cordis'
|
|
import type { ChatSettings, CollapseTiming, FoldedReplies, LinkOpening, PerformanceUsageMode } from './chat-settings.ts'
|
|
import z from '@deepseek-ai/schemastery'
|
|
import { TRANSCRIPT_VIEW_FIELD } from './chat-settings.ts'
|
|
|
|
import { ChatSettingsFields } from './chat-settings.ts'
|
|
|
|
export {
|
|
CHAT_SETTINGS_NAMESPACE, DEFAULT_TRANSCRIPT_VIEW_MODE, LEGACY_TRANSCRIPT_VIEW_MODE,
|
|
LEGACY_EXPANDED_TRANSCRIPT_VIEW_MODE, TRANSCRIPT_VIEW_FIELD,
|
|
TRANSCRIPT_VIEW_MODES, type ChatSettings, type TranscriptViewMode,
|
|
} from './chat-settings.ts'
|
|
|
|
/** Runtime preferences projected to the browser. */
|
|
export interface Config {
|
|
/** Completed turn transcript presentation. */
|
|
transcriptView: Volatile<ChatSettings['transcriptView']>
|
|
/** When completed work details return to their historical presentation. */
|
|
collapseTiming: Volatile<CollapseTiming>
|
|
/** Assistant replies kept visible while a completed Turn folds its process. */
|
|
foldedReplies: Volatile<FoldedReplies>
|
|
/** Performance and usage detail level. */
|
|
performanceUsage: Volatile<PerformanceUsageMode>
|
|
/** Default destination for Chat HTTP(S) links. */
|
|
linkOpening: Volatile<LinkOpening>
|
|
}
|
|
|
|
/** Live preferences projected to the browser. */
|
|
export const Config = z.object({
|
|
[TRANSCRIPT_VIEW_FIELD]: ChatSettingsFields[TRANSCRIPT_VIEW_FIELD].volatile(),
|
|
collapseTiming: ChatSettingsFields.collapseTiming.volatile(),
|
|
foldedReplies: ChatSettingsFields.foldedReplies.volatile(),
|
|
performanceUsage: ChatSettingsFields['performanceUsage'].volatile(),
|
|
linkOpening: ChatSettingsFields.linkOpening.volatile(),
|
|
})
|
|
|
|
/** Host preferences are consumed through the configuration form projection.
|
|
* @param ctx Plugin context used for optional settings presentation.
|
|
*/
|
|
export function apply(ctx: Context): void {
|
|
ctx.inject(['settings'], (child) => { child.effect(() => child.settings.configure({ auto: false }, ctx.fiber)) })
|
|
}
|