WeKnora/frontend/src/views/knowledge/settings/KBModelConfig.vue

228 lines
5.9 KiB
Vue
Raw Normal View History

<template>
<div class="kb-model-config">
<div class="section-header">
<h2>{{ $t('knowledgeEditor.models.title') }}</h2>
<p class="section-description">{{ $t('knowledgeEditor.models.description') }}</p>
</div>
<div class="settings-group">
<!-- LLM 大语言模型 -->
<div class="setting-row" data-guide="kb-create-llm">
<div class="setting-info">
<label>{{ $t('knowledgeEditor.models.llmLabel') }} <span class="required">*</span></label>
<p class="desc">{{ $t('knowledgeEditor.models.llmDesc') }}</p>
</div>
<div class="setting-control">
<ModelSelector
ref="llmSelectorRef"
model-type="KnowledgeQA"
:selected-model-id="config.llmModelId"
:all-models="allModels"
@update:selected-model-id="handleLLMChange"
@add-model="handleAddModel('chat')"
:placeholder="$t('knowledgeEditor.models.llmPlaceholder')"
/>
</div>
</div>
<!-- Embedding 嵌入模型: RAG 检索启用时必填; 纯 Wiki 时可选(用于目录归类相似度) -->
<div v-if="ragEnabled !== false || wikiEnabled" class="setting-row" data-guide="kb-create-embedding">
<div class="setting-info">
<label>
{{ $t('knowledgeEditor.models.embeddingLabel') }}
<span v-if="ragEnabled" class="required">*</span>
<span v-else-if="wikiEnabled" class="optional">{{ $t('knowledgeEditor.models.embeddingOptional') }}</span>
</label>
<p class="desc">
{{ (wikiEnabled && ragEnabled === false)
? $t('knowledgeEditor.models.embeddingWikiOptionalDesc')
: $t('knowledgeEditor.models.embeddingDesc') }}
</p>
<t-alert
v-if="ragEnabled && hasFiles"
theme="warning"
:message="$t('knowledgeEditor.models.embeddingLocked')"
style="margin-top: 8px;"
/>
</div>
<div class="setting-control">
<ModelSelector
ref="embeddingSelectorRef"
model-type="Embedding"
:selected-model-id="config.embeddingModelId"
:all-models="allModels"
:disabled="ragEnabled && hasFiles"
:clearable="ragEnabled === false && wikiEnabled"
@update:selected-model-id="handleEmbeddingChange"
@add-model="handleAddModel('embedding')"
:placeholder="$t('knowledgeEditor.models.embeddingPlaceholder')"
/>
</div>
</div>
<!-- Wiki 合成模型 (仅当 Wiki 启用时显示) -->
<div v-if="wikiEnabled" class="setting-row">
<div class="setting-info">
<label>{{ $t('knowledgeEditor.wiki.synthesisModelLabel') }}</label>
<p class="desc">{{ $t('knowledgeEditor.wiki.synthesisModelTip') }}</p>
</div>
<div class="setting-control">
<ModelSelector
model-type="KnowledgeQA"
:selected-model-id="config.wikiSynthesisModelId"
:all-models="allModels"
clearable
@update:selected-model-id="handleWikiModelChange"
@add-model="handleAddModel('knowledgeqa')"
:placeholder="$t('knowledgeEditor.wiki.synthesisModelPlaceholder')"
/>
</div>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { useUIStore } from '@/stores/ui'
import ModelSelector from '@/components/ModelSelector.vue'
import { useI18n } from 'vue-i18n'
interface ModelConfig {
llmModelId?: string
embeddingModelId?: string
vllmModelId?: string
wikiSynthesisModelId?: string
}
interface Props {
config: ModelConfig
hasFiles: boolean
wikiEnabled?: boolean
ragEnabled?: boolean
allModels?: any[]
}
const props = defineProps<Props>()
const emit = defineEmits<{
'update:config': [value: ModelConfig]
}>()
const uiStore = useUIStore()
const { t } = useI18n()
const llmSelectorRef = ref<InstanceType<typeof ModelSelector>>()
const embeddingSelectorRef = ref<InstanceType<typeof ModelSelector>>()
const handleLLMChange = (modelId: string) => {
emit('update:config', {
...props.config,
llmModelId: modelId
})
}
const handleEmbeddingChange = (modelId: string) => {
emit('update:config', {
...props.config,
embeddingModelId: modelId
})
}
const handleWikiModelChange = (modelId: string) => {
emit('update:config', {
...props.config,
wikiSynthesisModelId: modelId
})
}
const handleAddModel = (subSection: string) => {
uiStore.openSettings('models', subSection)
}
</script>
<style lang="less" scoped>
.kb-model-config {
width: 100%;
}
.section-header {
margin-bottom: 20px;
h2 {
refactor(frontend): style consistency pass — shared shells, tokens, unified confirmations (#3376) * refactor(frontend): batch 1 of style consistency cleanup - theme.css: alias --td-font-family-mono to --app-font-family-mono so the 29 monospace call sites follow the user's code-font setting - replace 115 hardcoded rgba(7,192,95,x) brand tints with color-mix(in srgb, var(--td-brand-color) N%, transparent) so they track the dark-mode brand color - strip 358 dead var(--td-*, fallback) fallbacks (tokens are guaranteed by theme.css); keep the 3 undefined tokens untouched - menu.vue: drop 9 unreferenced style blocks; remove TencentSans font file and its global import - AgentStreamDisplay: drop 6 unused keyframes; move the teleported wiki drawer styles into components/css/wiki-graph-drawer.less imported by both chat and WikiBrowser so styling no longer depends on load order - creatChat: remove four !important fixed-width media queries; chat root no longer forces font-size: 20px - list pages: create buttons use native theme="primary" (drops the purple gradient on AgentList); header-action-btn no longer needs !important - add styleGuard.test.mjs ratchet test (brand rgba, legacy blue, token fallbacks, z-index !important, raster icons) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): unify destructive confirmations on useConfirmDelete - useConfirmDelete now uses the danger dialog theme with a red confirm button; it is the single entry point for delete/leave confirmations - AgentList, KnowledgeBaseList and OrganizationList drop their hand-rolled del-*-dialog (span-as-button, circle.png) in favour of useConfirmDelete; circle.png asset removed - FAQ single-entry delete gains a confirmation (it deleted immediately); new knowledgeEditor.faq.confirmDelete key in all five locales - VectorStore/StorageBackend delete dialogs and the generated-question popconfirm use the danger theme like the rest of the app - style guard raster-icon baseline lowered to 10 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * feat(frontend): shared modal shell with Esc, overlay close and unsaved guard Add composables/useModalShell and wire it into the four full-screen settings-style modals (Settings, AgentEditorModal, OrganizationSettingsModal, KnowledgeBaseEditorModal): - Esc closes the modal everywhere (previously only Settings); it defers to any open TDesign dialog/drawer/popup and to the agent editor's own placeholder popups - overlay click closes everywhere (Settings gains it) - editors snapshot their form after load/save; closing with unsaved changes now asks "有未保存的更改 / 放弃更改 / 继续编辑" instead of silently discarding - new common.unsavedChanges.* keys in all five locales Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(frontend): mark instant-effect sections in the knowledge base editor Share, data source and activity sections apply changes immediately, but the editor footer still showed Cancel / Save, so users either re-saved or assumed Cancel would undo. Those sections now show an "applies immediately" note with a single Close button; other sections keep the Cancel / Save footer. New knowledgeEditor.footer.instantEffect key in all five locales. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): consistent success wording and confirm labels (zh-CN) - toasts use the "已X" form everywhere: 25 zh-CN values such as 保存成功 / 删除成功 / 智能体创建成功 become 已保存 / 已删除 / 已创建智能体; common.copySuccess now reads the same as common.copied - confirm buttons in dialogs and popconfirms use the bare verb (删除 / 重置 / 移除 / 应用 ...) instead of 确认X; dialog titles keep 确认删除 - GeneralSettings no longer pops a bare "成功" toast after theme / font / font-size changes, which are self-evident and applied instantly Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): extract SettingsModalShell for the four settings-style modals Settings, AgentEditorModal, OrganizationSettingsModal and KnowledgeBaseEditorModal each carried a copy of the same overlay / panel / sidebar-nav / footer markup and ~20 CSS blocks, already drifting (1000/1080/1100px widths, three shadows, different nav paddings). components/SettingsModalShell.vue now owns that chrome: one 1080x780 panel, grouped nav with badges, optional loading overlay, footer with a note slot and an actions slot. Consumers keep only their content and wire `@close` to their useModalShell.requestClose. Settings keeps its sub-menu nav through the `nav` slot; OrganizationSettingsModal keeps its image icon through the `nav-icon` slot. Net: -1025 lines across the four modals. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): shared resource-card mixins and EmptyState for list pages KnowledgeBaseList, AgentList and OrganizationList each re-declared the same 136px card (border, radius, shadow, hover, header/title/description/ bottom, more-button reveal, feature badges) with small drifts, plus a copy of the empty-state block using the upload illustration for every kind of emptiness. - components/css/resource-card.less: .resource-card(), .resource-card-grid() and .resource-feature-badge() mixins; the pages keep only their own variants (type gradients, favourite star, decoration). More-buttons stay visible on touch devices. - components/EmptyState.vue: icon / title / description / actions; the 11 empty states now use a matching TDesign icon instead of upload.svg - badge accent colours move from hard-coded old-blue / material orange / pink / slate rgba to color-mix over theme tokens (new --app-accent-purple in theme.css); style guard legacy-blue baseline drops from 40 to 18 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): shared settings-section mixins for header, row, info, control 25 settings/system/integration pages each re-declared .section-header, .setting-row, .setting-info and .setting-control with five different header margins (18-32px), three description sizes and assorted paddings. components/css/settings-section.less now provides .settings-section-header() / .setting-row() / .setting-info() / .setting-control() / .setting-save-state(); pages keep only their deliberate deviations (e.g. Ollama's column control, TenantInfo's fixed label column). PlatformAPIKeys' style block switches to less so it can use the mixins. Net -570 lines. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): provider-card mixins, dark-safe vendor badges, one spin keyframe - components/css/provider-card.less: .provider-card() / -interactive() / -add() / -badge() / -badge-color() / -body() / -header() / -title() / -subtitle() / -more() shared by the model, vector store, web search, storage, parser and sandbox settings cards; MCP and skill cards reuse the 26px badge variant - vendor badge colours are now `.provider-card-badge-color(#hex)`: the foreground is mixed 75/25 with the text colour so it stays readable in dark mode, the background is the same colour at 12% alpha - 18 copies of a rotate-360 keyframe (steer-spin, chat-header-spin, sandbox-terminal-spin, ...) collapse into a global `wk-spin` in theme.css; 23 files updated, one source test adjusted Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): use TDesign password toggle for API keys; align chat toolbar buttons - ModelEditorDialog: the API key field is a plain t-input type="password" and relies on TDesign's built-in show/hide eye instead of a hand-rolled suffix toggle, matching every other secret field in the app - chat answer toolbar buttons are 28px with 6px radius, the same size as the user-message actions and the input control bar Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): app design tokens, tokenized literals, global TDesign overrides theme.css gains an app-level token set derived from the de-facto scale already used in the codebase, so values do not change: --app-radius-{xs,sm,md,lg,xl,pill} (4/6/8/10/12/999px) --app-text-{2xs..4xl} (10..24px) --app-space-{1..10} (4px grid) --app-motion-{instant,fast,base,slow} (120/150/200/300ms) --z-{sticky,dropdown,modal,drawer,popover,toast} A codemod mapped 675 border-radius, 1904 font-size and 551 transition duration literals in 191 files onto those tokens (value-preserving; five source-text tests now accept either form). assets/theme/tdesign-overrides.less holds global-intent TDesign overrides; its `.wk-popover` skin replaces six per-file copies of the blurred popover panel (TenantMembers x2, UserProfile, OrganizationSettingsModal, systemAdminDialog.less, share-to-space-panel.overlay.less) without !important. styleGuard ratchets now also cover radius / font-size / motion literals, `transition: all`, total `!important` and z-index !important. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(frontend): keep symmetric side insets for the chat column on narrow viewports .chat had padding 0 0 20px 20px so the scrollbar could sit on the content edge, but that also left the message list and input box flush against the right edge whenever the viewport was narrower than 960px + sidebar. The inset now lives on .msg_list and .input-container (--chat-content-inset, 20px each side, max-width 960px + insets); the scroll container still spans the full column so the scrollbar stays on the edge. Wide layouts are unchanged (960px content, centered). * chore(frontend): strip trailing whitespace flagged by pre-push * test(frontend): accept tokenized font-size and shell-rendered loading overlay Two source-text assertions only ran in CI (Node 24 discovers .test.ts, local Node 20 does not): - ChatQuestionMinimap: the 13px preview font is now var(--app-text-md) - modelUsageDetails: the editors' loading overlay is rendered by SettingsModalShell via :loading instead of an inline v-if Both regexes now accept either form. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 15:11:08 +00:00
font-size: var(--app-text-3xl);
font-weight: 600;
color: var(--td-text-color-primary);
margin: 0 0 6px 0;
}
.section-description {
refactor(frontend): style consistency pass — shared shells, tokens, unified confirmations (#3376) * refactor(frontend): batch 1 of style consistency cleanup - theme.css: alias --td-font-family-mono to --app-font-family-mono so the 29 monospace call sites follow the user's code-font setting - replace 115 hardcoded rgba(7,192,95,x) brand tints with color-mix(in srgb, var(--td-brand-color) N%, transparent) so they track the dark-mode brand color - strip 358 dead var(--td-*, fallback) fallbacks (tokens are guaranteed by theme.css); keep the 3 undefined tokens untouched - menu.vue: drop 9 unreferenced style blocks; remove TencentSans font file and its global import - AgentStreamDisplay: drop 6 unused keyframes; move the teleported wiki drawer styles into components/css/wiki-graph-drawer.less imported by both chat and WikiBrowser so styling no longer depends on load order - creatChat: remove four !important fixed-width media queries; chat root no longer forces font-size: 20px - list pages: create buttons use native theme="primary" (drops the purple gradient on AgentList); header-action-btn no longer needs !important - add styleGuard.test.mjs ratchet test (brand rgba, legacy blue, token fallbacks, z-index !important, raster icons) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): unify destructive confirmations on useConfirmDelete - useConfirmDelete now uses the danger dialog theme with a red confirm button; it is the single entry point for delete/leave confirmations - AgentList, KnowledgeBaseList and OrganizationList drop their hand-rolled del-*-dialog (span-as-button, circle.png) in favour of useConfirmDelete; circle.png asset removed - FAQ single-entry delete gains a confirmation (it deleted immediately); new knowledgeEditor.faq.confirmDelete key in all five locales - VectorStore/StorageBackend delete dialogs and the generated-question popconfirm use the danger theme like the rest of the app - style guard raster-icon baseline lowered to 10 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * feat(frontend): shared modal shell with Esc, overlay close and unsaved guard Add composables/useModalShell and wire it into the four full-screen settings-style modals (Settings, AgentEditorModal, OrganizationSettingsModal, KnowledgeBaseEditorModal): - Esc closes the modal everywhere (previously only Settings); it defers to any open TDesign dialog/drawer/popup and to the agent editor's own placeholder popups - overlay click closes everywhere (Settings gains it) - editors snapshot their form after load/save; closing with unsaved changes now asks "有未保存的更改 / 放弃更改 / 继续编辑" instead of silently discarding - new common.unsavedChanges.* keys in all five locales Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(frontend): mark instant-effect sections in the knowledge base editor Share, data source and activity sections apply changes immediately, but the editor footer still showed Cancel / Save, so users either re-saved or assumed Cancel would undo. Those sections now show an "applies immediately" note with a single Close button; other sections keep the Cancel / Save footer. New knowledgeEditor.footer.instantEffect key in all five locales. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): consistent success wording and confirm labels (zh-CN) - toasts use the "已X" form everywhere: 25 zh-CN values such as 保存成功 / 删除成功 / 智能体创建成功 become 已保存 / 已删除 / 已创建智能体; common.copySuccess now reads the same as common.copied - confirm buttons in dialogs and popconfirms use the bare verb (删除 / 重置 / 移除 / 应用 ...) instead of 确认X; dialog titles keep 确认删除 - GeneralSettings no longer pops a bare "成功" toast after theme / font / font-size changes, which are self-evident and applied instantly Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): extract SettingsModalShell for the four settings-style modals Settings, AgentEditorModal, OrganizationSettingsModal and KnowledgeBaseEditorModal each carried a copy of the same overlay / panel / sidebar-nav / footer markup and ~20 CSS blocks, already drifting (1000/1080/1100px widths, three shadows, different nav paddings). components/SettingsModalShell.vue now owns that chrome: one 1080x780 panel, grouped nav with badges, optional loading overlay, footer with a note slot and an actions slot. Consumers keep only their content and wire `@close` to their useModalShell.requestClose. Settings keeps its sub-menu nav through the `nav` slot; OrganizationSettingsModal keeps its image icon through the `nav-icon` slot. Net: -1025 lines across the four modals. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): shared resource-card mixins and EmptyState for list pages KnowledgeBaseList, AgentList and OrganizationList each re-declared the same 136px card (border, radius, shadow, hover, header/title/description/ bottom, more-button reveal, feature badges) with small drifts, plus a copy of the empty-state block using the upload illustration for every kind of emptiness. - components/css/resource-card.less: .resource-card(), .resource-card-grid() and .resource-feature-badge() mixins; the pages keep only their own variants (type gradients, favourite star, decoration). More-buttons stay visible on touch devices. - components/EmptyState.vue: icon / title / description / actions; the 11 empty states now use a matching TDesign icon instead of upload.svg - badge accent colours move from hard-coded old-blue / material orange / pink / slate rgba to color-mix over theme tokens (new --app-accent-purple in theme.css); style guard legacy-blue baseline drops from 40 to 18 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): shared settings-section mixins for header, row, info, control 25 settings/system/integration pages each re-declared .section-header, .setting-row, .setting-info and .setting-control with five different header margins (18-32px), three description sizes and assorted paddings. components/css/settings-section.less now provides .settings-section-header() / .setting-row() / .setting-info() / .setting-control() / .setting-save-state(); pages keep only their deliberate deviations (e.g. Ollama's column control, TenantInfo's fixed label column). PlatformAPIKeys' style block switches to less so it can use the mixins. Net -570 lines. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): provider-card mixins, dark-safe vendor badges, one spin keyframe - components/css/provider-card.less: .provider-card() / -interactive() / -add() / -badge() / -badge-color() / -body() / -header() / -title() / -subtitle() / -more() shared by the model, vector store, web search, storage, parser and sandbox settings cards; MCP and skill cards reuse the 26px badge variant - vendor badge colours are now `.provider-card-badge-color(#hex)`: the foreground is mixed 75/25 with the text colour so it stays readable in dark mode, the background is the same colour at 12% alpha - 18 copies of a rotate-360 keyframe (steer-spin, chat-header-spin, sandbox-terminal-spin, ...) collapse into a global `wk-spin` in theme.css; 23 files updated, one source test adjusted Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): use TDesign password toggle for API keys; align chat toolbar buttons - ModelEditorDialog: the API key field is a plain t-input type="password" and relies on TDesign's built-in show/hide eye instead of a hand-rolled suffix toggle, matching every other secret field in the app - chat answer toolbar buttons are 28px with 6px radius, the same size as the user-message actions and the input control bar Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): app design tokens, tokenized literals, global TDesign overrides theme.css gains an app-level token set derived from the de-facto scale already used in the codebase, so values do not change: --app-radius-{xs,sm,md,lg,xl,pill} (4/6/8/10/12/999px) --app-text-{2xs..4xl} (10..24px) --app-space-{1..10} (4px grid) --app-motion-{instant,fast,base,slow} (120/150/200/300ms) --z-{sticky,dropdown,modal,drawer,popover,toast} A codemod mapped 675 border-radius, 1904 font-size and 551 transition duration literals in 191 files onto those tokens (value-preserving; five source-text tests now accept either form). assets/theme/tdesign-overrides.less holds global-intent TDesign overrides; its `.wk-popover` skin replaces six per-file copies of the blurred popover panel (TenantMembers x2, UserProfile, OrganizationSettingsModal, systemAdminDialog.less, share-to-space-panel.overlay.less) without !important. styleGuard ratchets now also cover radius / font-size / motion literals, `transition: all`, total `!important` and z-index !important. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(frontend): keep symmetric side insets for the chat column on narrow viewports .chat had padding 0 0 20px 20px so the scrollbar could sit on the content edge, but that also left the message list and input box flush against the right edge whenever the viewport was narrower than 960px + sidebar. The inset now lives on .msg_list and .input-container (--chat-content-inset, 20px each side, max-width 960px + insets); the scroll container still spans the full column so the scrollbar stays on the edge. Wide layouts are unchanged (960px content, centered). * chore(frontend): strip trailing whitespace flagged by pre-push * test(frontend): accept tokenized font-size and shell-rendered loading overlay Two source-text assertions only ran in CI (Node 24 discovers .test.ts, local Node 20 does not): - ChatQuestionMinimap: the 13px preview font is now var(--app-text-md) - modelUsageDetails: the editors' loading overlay is rendered by SettingsModalShell via :loading instead of an inline v-if Both regexes now accept either form. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 15:11:08 +00:00
font-size: var(--app-text-base);
color: var(--td-text-color-secondary);
margin: 0;
line-height: 1.5;
}
}
.settings-group {
display: flex;
flex-direction: column;
gap: 0;
}
.setting-row {
display: flex;
align-items: flex-start;
justify-content: space-between;
padding: 16px 0;
border-bottom: 1px solid var(--td-component-stroke);
&:last-child {
border-bottom: none;
}
}
.setting-info {
flex: 0 0 40%;
max-width: 40%;
padding-right: 24px;
label {
refactor(frontend): style consistency pass — shared shells, tokens, unified confirmations (#3376) * refactor(frontend): batch 1 of style consistency cleanup - theme.css: alias --td-font-family-mono to --app-font-family-mono so the 29 monospace call sites follow the user's code-font setting - replace 115 hardcoded rgba(7,192,95,x) brand tints with color-mix(in srgb, var(--td-brand-color) N%, transparent) so they track the dark-mode brand color - strip 358 dead var(--td-*, fallback) fallbacks (tokens are guaranteed by theme.css); keep the 3 undefined tokens untouched - menu.vue: drop 9 unreferenced style blocks; remove TencentSans font file and its global import - AgentStreamDisplay: drop 6 unused keyframes; move the teleported wiki drawer styles into components/css/wiki-graph-drawer.less imported by both chat and WikiBrowser so styling no longer depends on load order - creatChat: remove four !important fixed-width media queries; chat root no longer forces font-size: 20px - list pages: create buttons use native theme="primary" (drops the purple gradient on AgentList); header-action-btn no longer needs !important - add styleGuard.test.mjs ratchet test (brand rgba, legacy blue, token fallbacks, z-index !important, raster icons) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): unify destructive confirmations on useConfirmDelete - useConfirmDelete now uses the danger dialog theme with a red confirm button; it is the single entry point for delete/leave confirmations - AgentList, KnowledgeBaseList and OrganizationList drop their hand-rolled del-*-dialog (span-as-button, circle.png) in favour of useConfirmDelete; circle.png asset removed - FAQ single-entry delete gains a confirmation (it deleted immediately); new knowledgeEditor.faq.confirmDelete key in all five locales - VectorStore/StorageBackend delete dialogs and the generated-question popconfirm use the danger theme like the rest of the app - style guard raster-icon baseline lowered to 10 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * feat(frontend): shared modal shell with Esc, overlay close and unsaved guard Add composables/useModalShell and wire it into the four full-screen settings-style modals (Settings, AgentEditorModal, OrganizationSettingsModal, KnowledgeBaseEditorModal): - Esc closes the modal everywhere (previously only Settings); it defers to any open TDesign dialog/drawer/popup and to the agent editor's own placeholder popups - overlay click closes everywhere (Settings gains it) - editors snapshot their form after load/save; closing with unsaved changes now asks "有未保存的更改 / 放弃更改 / 继续编辑" instead of silently discarding - new common.unsavedChanges.* keys in all five locales Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(frontend): mark instant-effect sections in the knowledge base editor Share, data source and activity sections apply changes immediately, but the editor footer still showed Cancel / Save, so users either re-saved or assumed Cancel would undo. Those sections now show an "applies immediately" note with a single Close button; other sections keep the Cancel / Save footer. New knowledgeEditor.footer.instantEffect key in all five locales. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): consistent success wording and confirm labels (zh-CN) - toasts use the "已X" form everywhere: 25 zh-CN values such as 保存成功 / 删除成功 / 智能体创建成功 become 已保存 / 已删除 / 已创建智能体; common.copySuccess now reads the same as common.copied - confirm buttons in dialogs and popconfirms use the bare verb (删除 / 重置 / 移除 / 应用 ...) instead of 确认X; dialog titles keep 确认删除 - GeneralSettings no longer pops a bare "成功" toast after theme / font / font-size changes, which are self-evident and applied instantly Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): extract SettingsModalShell for the four settings-style modals Settings, AgentEditorModal, OrganizationSettingsModal and KnowledgeBaseEditorModal each carried a copy of the same overlay / panel / sidebar-nav / footer markup and ~20 CSS blocks, already drifting (1000/1080/1100px widths, three shadows, different nav paddings). components/SettingsModalShell.vue now owns that chrome: one 1080x780 panel, grouped nav with badges, optional loading overlay, footer with a note slot and an actions slot. Consumers keep only their content and wire `@close` to their useModalShell.requestClose. Settings keeps its sub-menu nav through the `nav` slot; OrganizationSettingsModal keeps its image icon through the `nav-icon` slot. Net: -1025 lines across the four modals. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): shared resource-card mixins and EmptyState for list pages KnowledgeBaseList, AgentList and OrganizationList each re-declared the same 136px card (border, radius, shadow, hover, header/title/description/ bottom, more-button reveal, feature badges) with small drifts, plus a copy of the empty-state block using the upload illustration for every kind of emptiness. - components/css/resource-card.less: .resource-card(), .resource-card-grid() and .resource-feature-badge() mixins; the pages keep only their own variants (type gradients, favourite star, decoration). More-buttons stay visible on touch devices. - components/EmptyState.vue: icon / title / description / actions; the 11 empty states now use a matching TDesign icon instead of upload.svg - badge accent colours move from hard-coded old-blue / material orange / pink / slate rgba to color-mix over theme tokens (new --app-accent-purple in theme.css); style guard legacy-blue baseline drops from 40 to 18 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): shared settings-section mixins for header, row, info, control 25 settings/system/integration pages each re-declared .section-header, .setting-row, .setting-info and .setting-control with five different header margins (18-32px), three description sizes and assorted paddings. components/css/settings-section.less now provides .settings-section-header() / .setting-row() / .setting-info() / .setting-control() / .setting-save-state(); pages keep only their deliberate deviations (e.g. Ollama's column control, TenantInfo's fixed label column). PlatformAPIKeys' style block switches to less so it can use the mixins. Net -570 lines. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): provider-card mixins, dark-safe vendor badges, one spin keyframe - components/css/provider-card.less: .provider-card() / -interactive() / -add() / -badge() / -badge-color() / -body() / -header() / -title() / -subtitle() / -more() shared by the model, vector store, web search, storage, parser and sandbox settings cards; MCP and skill cards reuse the 26px badge variant - vendor badge colours are now `.provider-card-badge-color(#hex)`: the foreground is mixed 75/25 with the text colour so it stays readable in dark mode, the background is the same colour at 12% alpha - 18 copies of a rotate-360 keyframe (steer-spin, chat-header-spin, sandbox-terminal-spin, ...) collapse into a global `wk-spin` in theme.css; 23 files updated, one source test adjusted Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): use TDesign password toggle for API keys; align chat toolbar buttons - ModelEditorDialog: the API key field is a plain t-input type="password" and relies on TDesign's built-in show/hide eye instead of a hand-rolled suffix toggle, matching every other secret field in the app - chat answer toolbar buttons are 28px with 6px radius, the same size as the user-message actions and the input control bar Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): app design tokens, tokenized literals, global TDesign overrides theme.css gains an app-level token set derived from the de-facto scale already used in the codebase, so values do not change: --app-radius-{xs,sm,md,lg,xl,pill} (4/6/8/10/12/999px) --app-text-{2xs..4xl} (10..24px) --app-space-{1..10} (4px grid) --app-motion-{instant,fast,base,slow} (120/150/200/300ms) --z-{sticky,dropdown,modal,drawer,popover,toast} A codemod mapped 675 border-radius, 1904 font-size and 551 transition duration literals in 191 files onto those tokens (value-preserving; five source-text tests now accept either form). assets/theme/tdesign-overrides.less holds global-intent TDesign overrides; its `.wk-popover` skin replaces six per-file copies of the blurred popover panel (TenantMembers x2, UserProfile, OrganizationSettingsModal, systemAdminDialog.less, share-to-space-panel.overlay.less) without !important. styleGuard ratchets now also cover radius / font-size / motion literals, `transition: all`, total `!important` and z-index !important. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(frontend): keep symmetric side insets for the chat column on narrow viewports .chat had padding 0 0 20px 20px so the scrollbar could sit on the content edge, but that also left the message list and input box flush against the right edge whenever the viewport was narrower than 960px + sidebar. The inset now lives on .msg_list and .input-container (--chat-content-inset, 20px each side, max-width 960px + insets); the scroll container still spans the full column so the scrollbar stays on the edge. Wide layouts are unchanged (960px content, centered). * chore(frontend): strip trailing whitespace flagged by pre-push * test(frontend): accept tokenized font-size and shell-rendered loading overlay Two source-text assertions only ran in CI (Node 24 discovers .test.ts, local Node 20 does not): - ChatQuestionMinimap: the 13px preview font is now var(--app-text-md) - modelUsageDetails: the editors' loading overlay is rendered by SettingsModalShell via :loading instead of an inline v-if Both regexes now accept either form. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 15:11:08 +00:00
font-size: var(--app-text-lg);
font-weight: 500;
color: var(--td-text-color-primary);
display: block;
margin-bottom: 4px;
.required {
color: var(--td-error-color);
margin-left: 2px;
}
.optional {
color: var(--td-text-color-placeholder);
refactor(frontend): style consistency pass — shared shells, tokens, unified confirmations (#3376) * refactor(frontend): batch 1 of style consistency cleanup - theme.css: alias --td-font-family-mono to --app-font-family-mono so the 29 monospace call sites follow the user's code-font setting - replace 115 hardcoded rgba(7,192,95,x) brand tints with color-mix(in srgb, var(--td-brand-color) N%, transparent) so they track the dark-mode brand color - strip 358 dead var(--td-*, fallback) fallbacks (tokens are guaranteed by theme.css); keep the 3 undefined tokens untouched - menu.vue: drop 9 unreferenced style blocks; remove TencentSans font file and its global import - AgentStreamDisplay: drop 6 unused keyframes; move the teleported wiki drawer styles into components/css/wiki-graph-drawer.less imported by both chat and WikiBrowser so styling no longer depends on load order - creatChat: remove four !important fixed-width media queries; chat root no longer forces font-size: 20px - list pages: create buttons use native theme="primary" (drops the purple gradient on AgentList); header-action-btn no longer needs !important - add styleGuard.test.mjs ratchet test (brand rgba, legacy blue, token fallbacks, z-index !important, raster icons) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): unify destructive confirmations on useConfirmDelete - useConfirmDelete now uses the danger dialog theme with a red confirm button; it is the single entry point for delete/leave confirmations - AgentList, KnowledgeBaseList and OrganizationList drop their hand-rolled del-*-dialog (span-as-button, circle.png) in favour of useConfirmDelete; circle.png asset removed - FAQ single-entry delete gains a confirmation (it deleted immediately); new knowledgeEditor.faq.confirmDelete key in all five locales - VectorStore/StorageBackend delete dialogs and the generated-question popconfirm use the danger theme like the rest of the app - style guard raster-icon baseline lowered to 10 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * feat(frontend): shared modal shell with Esc, overlay close and unsaved guard Add composables/useModalShell and wire it into the four full-screen settings-style modals (Settings, AgentEditorModal, OrganizationSettingsModal, KnowledgeBaseEditorModal): - Esc closes the modal everywhere (previously only Settings); it defers to any open TDesign dialog/drawer/popup and to the agent editor's own placeholder popups - overlay click closes everywhere (Settings gains it) - editors snapshot their form after load/save; closing with unsaved changes now asks "有未保存的更改 / 放弃更改 / 继续编辑" instead of silently discarding - new common.unsavedChanges.* keys in all five locales Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(frontend): mark instant-effect sections in the knowledge base editor Share, data source and activity sections apply changes immediately, but the editor footer still showed Cancel / Save, so users either re-saved or assumed Cancel would undo. Those sections now show an "applies immediately" note with a single Close button; other sections keep the Cancel / Save footer. New knowledgeEditor.footer.instantEffect key in all five locales. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): consistent success wording and confirm labels (zh-CN) - toasts use the "已X" form everywhere: 25 zh-CN values such as 保存成功 / 删除成功 / 智能体创建成功 become 已保存 / 已删除 / 已创建智能体; common.copySuccess now reads the same as common.copied - confirm buttons in dialogs and popconfirms use the bare verb (删除 / 重置 / 移除 / 应用 ...) instead of 确认X; dialog titles keep 确认删除 - GeneralSettings no longer pops a bare "成功" toast after theme / font / font-size changes, which are self-evident and applied instantly Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): extract SettingsModalShell for the four settings-style modals Settings, AgentEditorModal, OrganizationSettingsModal and KnowledgeBaseEditorModal each carried a copy of the same overlay / panel / sidebar-nav / footer markup and ~20 CSS blocks, already drifting (1000/1080/1100px widths, three shadows, different nav paddings). components/SettingsModalShell.vue now owns that chrome: one 1080x780 panel, grouped nav with badges, optional loading overlay, footer with a note slot and an actions slot. Consumers keep only their content and wire `@close` to their useModalShell.requestClose. Settings keeps its sub-menu nav through the `nav` slot; OrganizationSettingsModal keeps its image icon through the `nav-icon` slot. Net: -1025 lines across the four modals. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): shared resource-card mixins and EmptyState for list pages KnowledgeBaseList, AgentList and OrganizationList each re-declared the same 136px card (border, radius, shadow, hover, header/title/description/ bottom, more-button reveal, feature badges) with small drifts, plus a copy of the empty-state block using the upload illustration for every kind of emptiness. - components/css/resource-card.less: .resource-card(), .resource-card-grid() and .resource-feature-badge() mixins; the pages keep only their own variants (type gradients, favourite star, decoration). More-buttons stay visible on touch devices. - components/EmptyState.vue: icon / title / description / actions; the 11 empty states now use a matching TDesign icon instead of upload.svg - badge accent colours move from hard-coded old-blue / material orange / pink / slate rgba to color-mix over theme tokens (new --app-accent-purple in theme.css); style guard legacy-blue baseline drops from 40 to 18 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): shared settings-section mixins for header, row, info, control 25 settings/system/integration pages each re-declared .section-header, .setting-row, .setting-info and .setting-control with five different header margins (18-32px), three description sizes and assorted paddings. components/css/settings-section.less now provides .settings-section-header() / .setting-row() / .setting-info() / .setting-control() / .setting-save-state(); pages keep only their deliberate deviations (e.g. Ollama's column control, TenantInfo's fixed label column). PlatformAPIKeys' style block switches to less so it can use the mixins. Net -570 lines. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): provider-card mixins, dark-safe vendor badges, one spin keyframe - components/css/provider-card.less: .provider-card() / -interactive() / -add() / -badge() / -badge-color() / -body() / -header() / -title() / -subtitle() / -more() shared by the model, vector store, web search, storage, parser and sandbox settings cards; MCP and skill cards reuse the 26px badge variant - vendor badge colours are now `.provider-card-badge-color(#hex)`: the foreground is mixed 75/25 with the text colour so it stays readable in dark mode, the background is the same colour at 12% alpha - 18 copies of a rotate-360 keyframe (steer-spin, chat-header-spin, sandbox-terminal-spin, ...) collapse into a global `wk-spin` in theme.css; 23 files updated, one source test adjusted Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): use TDesign password toggle for API keys; align chat toolbar buttons - ModelEditorDialog: the API key field is a plain t-input type="password" and relies on TDesign's built-in show/hide eye instead of a hand-rolled suffix toggle, matching every other secret field in the app - chat answer toolbar buttons are 28px with 6px radius, the same size as the user-message actions and the input control bar Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): app design tokens, tokenized literals, global TDesign overrides theme.css gains an app-level token set derived from the de-facto scale already used in the codebase, so values do not change: --app-radius-{xs,sm,md,lg,xl,pill} (4/6/8/10/12/999px) --app-text-{2xs..4xl} (10..24px) --app-space-{1..10} (4px grid) --app-motion-{instant,fast,base,slow} (120/150/200/300ms) --z-{sticky,dropdown,modal,drawer,popover,toast} A codemod mapped 675 border-radius, 1904 font-size and 551 transition duration literals in 191 files onto those tokens (value-preserving; five source-text tests now accept either form). assets/theme/tdesign-overrides.less holds global-intent TDesign overrides; its `.wk-popover` skin replaces six per-file copies of the blurred popover panel (TenantMembers x2, UserProfile, OrganizationSettingsModal, systemAdminDialog.less, share-to-space-panel.overlay.less) without !important. styleGuard ratchets now also cover radius / font-size / motion literals, `transition: all`, total `!important` and z-index !important. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(frontend): keep symmetric side insets for the chat column on narrow viewports .chat had padding 0 0 20px 20px so the scrollbar could sit on the content edge, but that also left the message list and input box flush against the right edge whenever the viewport was narrower than 960px + sidebar. The inset now lives on .msg_list and .input-container (--chat-content-inset, 20px each side, max-width 960px + insets); the scroll container still spans the full column so the scrollbar stays on the edge. Wide layouts are unchanged (960px content, centered). * chore(frontend): strip trailing whitespace flagged by pre-push * test(frontend): accept tokenized font-size and shell-rendered loading overlay Two source-text assertions only ran in CI (Node 24 discovers .test.ts, local Node 20 does not): - ChatQuestionMinimap: the 13px preview font is now var(--app-text-md) - modelUsageDetails: the editors' loading overlay is rendered by SettingsModalShell via :loading instead of an inline v-if Both regexes now accept either form. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 15:11:08 +00:00
font-size: var(--app-text-sm);
font-weight: 400;
margin-left: 4px;
}
}
.desc {
refactor(frontend): style consistency pass — shared shells, tokens, unified confirmations (#3376) * refactor(frontend): batch 1 of style consistency cleanup - theme.css: alias --td-font-family-mono to --app-font-family-mono so the 29 monospace call sites follow the user's code-font setting - replace 115 hardcoded rgba(7,192,95,x) brand tints with color-mix(in srgb, var(--td-brand-color) N%, transparent) so they track the dark-mode brand color - strip 358 dead var(--td-*, fallback) fallbacks (tokens are guaranteed by theme.css); keep the 3 undefined tokens untouched - menu.vue: drop 9 unreferenced style blocks; remove TencentSans font file and its global import - AgentStreamDisplay: drop 6 unused keyframes; move the teleported wiki drawer styles into components/css/wiki-graph-drawer.less imported by both chat and WikiBrowser so styling no longer depends on load order - creatChat: remove four !important fixed-width media queries; chat root no longer forces font-size: 20px - list pages: create buttons use native theme="primary" (drops the purple gradient on AgentList); header-action-btn no longer needs !important - add styleGuard.test.mjs ratchet test (brand rgba, legacy blue, token fallbacks, z-index !important, raster icons) Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): unify destructive confirmations on useConfirmDelete - useConfirmDelete now uses the danger dialog theme with a red confirm button; it is the single entry point for delete/leave confirmations - AgentList, KnowledgeBaseList and OrganizationList drop their hand-rolled del-*-dialog (span-as-button, circle.png) in favour of useConfirmDelete; circle.png asset removed - FAQ single-entry delete gains a confirmation (it deleted immediately); new knowledgeEditor.faq.confirmDelete key in all five locales - VectorStore/StorageBackend delete dialogs and the generated-question popconfirm use the danger theme like the rest of the app - style guard raster-icon baseline lowered to 10 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * feat(frontend): shared modal shell with Esc, overlay close and unsaved guard Add composables/useModalShell and wire it into the four full-screen settings-style modals (Settings, AgentEditorModal, OrganizationSettingsModal, KnowledgeBaseEditorModal): - Esc closes the modal everywhere (previously only Settings); it defers to any open TDesign dialog/drawer/popup and to the agent editor's own placeholder popups - overlay click closes everywhere (Settings gains it) - editors snapshot their form after load/save; closing with unsaved changes now asks "有未保存的更改 / 放弃更改 / 继续编辑" instead of silently discarding - new common.unsavedChanges.* keys in all five locales Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(frontend): mark instant-effect sections in the knowledge base editor Share, data source and activity sections apply changes immediately, but the editor footer still showed Cancel / Save, so users either re-saved or assumed Cancel would undo. Those sections now show an "applies immediately" note with a single Close button; other sections keep the Cancel / Save footer. New knowledgeEditor.footer.instantEffect key in all five locales. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): consistent success wording and confirm labels (zh-CN) - toasts use the "已X" form everywhere: 25 zh-CN values such as 保存成功 / 删除成功 / 智能体创建成功 become 已保存 / 已删除 / 已创建智能体; common.copySuccess now reads the same as common.copied - confirm buttons in dialogs and popconfirms use the bare verb (删除 / 重置 / 移除 / 应用 ...) instead of 确认X; dialog titles keep 确认删除 - GeneralSettings no longer pops a bare "成功" toast after theme / font / font-size changes, which are self-evident and applied instantly Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): extract SettingsModalShell for the four settings-style modals Settings, AgentEditorModal, OrganizationSettingsModal and KnowledgeBaseEditorModal each carried a copy of the same overlay / panel / sidebar-nav / footer markup and ~20 CSS blocks, already drifting (1000/1080/1100px widths, three shadows, different nav paddings). components/SettingsModalShell.vue now owns that chrome: one 1080x780 panel, grouped nav with badges, optional loading overlay, footer with a note slot and an actions slot. Consumers keep only their content and wire `@close` to their useModalShell.requestClose. Settings keeps its sub-menu nav through the `nav` slot; OrganizationSettingsModal keeps its image icon through the `nav-icon` slot. Net: -1025 lines across the four modals. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): shared resource-card mixins and EmptyState for list pages KnowledgeBaseList, AgentList and OrganizationList each re-declared the same 136px card (border, radius, shadow, hover, header/title/description/ bottom, more-button reveal, feature badges) with small drifts, plus a copy of the empty-state block using the upload illustration for every kind of emptiness. - components/css/resource-card.less: .resource-card(), .resource-card-grid() and .resource-feature-badge() mixins; the pages keep only their own variants (type gradients, favourite star, decoration). More-buttons stay visible on touch devices. - components/EmptyState.vue: icon / title / description / actions; the 11 empty states now use a matching TDesign icon instead of upload.svg - badge accent colours move from hard-coded old-blue / material orange / pink / slate rgba to color-mix over theme tokens (new --app-accent-purple in theme.css); style guard legacy-blue baseline drops from 40 to 18 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): shared settings-section mixins for header, row, info, control 25 settings/system/integration pages each re-declared .section-header, .setting-row, .setting-info and .setting-control with five different header margins (18-32px), three description sizes and assorted paddings. components/css/settings-section.less now provides .settings-section-header() / .setting-row() / .setting-info() / .setting-control() / .setting-save-state(); pages keep only their deliberate deviations (e.g. Ollama's column control, TenantInfo's fixed label column). PlatformAPIKeys' style block switches to less so it can use the mixins. Net -570 lines. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): provider-card mixins, dark-safe vendor badges, one spin keyframe - components/css/provider-card.less: .provider-card() / -interactive() / -add() / -badge() / -badge-color() / -body() / -header() / -title() / -subtitle() / -more() shared by the model, vector store, web search, storage, parser and sandbox settings cards; MCP and skill cards reuse the 26px badge variant - vendor badge colours are now `.provider-card-badge-color(#hex)`: the foreground is mixed 75/25 with the text colour so it stays readable in dark mode, the background is the same colour at 12% alpha - 18 copies of a rotate-360 keyframe (steer-spin, chat-header-spin, sandbox-terminal-spin, ...) collapse into a global `wk-spin` in theme.css; 23 files updated, one source test adjusted Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): use TDesign password toggle for API keys; align chat toolbar buttons - ModelEditorDialog: the API key field is a plain t-input type="password" and relies on TDesign's built-in show/hide eye instead of a hand-rolled suffix toggle, matching every other secret field in the app - chat answer toolbar buttons are 28px with 6px radius, the same size as the user-message actions and the input control bar Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(frontend): app design tokens, tokenized literals, global TDesign overrides theme.css gains an app-level token set derived from the de-facto scale already used in the codebase, so values do not change: --app-radius-{xs,sm,md,lg,xl,pill} (4/6/8/10/12/999px) --app-text-{2xs..4xl} (10..24px) --app-space-{1..10} (4px grid) --app-motion-{instant,fast,base,slow} (120/150/200/300ms) --z-{sticky,dropdown,modal,drawer,popover,toast} A codemod mapped 675 border-radius, 1904 font-size and 551 transition duration literals in 191 files onto those tokens (value-preserving; five source-text tests now accept either form). assets/theme/tdesign-overrides.less holds global-intent TDesign overrides; its `.wk-popover` skin replaces six per-file copies of the blurred popover panel (TenantMembers x2, UserProfile, OrganizationSettingsModal, systemAdminDialog.less, share-to-space-panel.overlay.less) without !important. styleGuard ratchets now also cover radius / font-size / motion literals, `transition: all`, total `!important` and z-index !important. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(frontend): keep symmetric side insets for the chat column on narrow viewports .chat had padding 0 0 20px 20px so the scrollbar could sit on the content edge, but that also left the message list and input box flush against the right edge whenever the viewport was narrower than 960px + sidebar. The inset now lives on .msg_list and .input-container (--chat-content-inset, 20px each side, max-width 960px + insets); the scroll container still spans the full column so the scrollbar stays on the edge. Wide layouts are unchanged (960px content, centered). * chore(frontend): strip trailing whitespace flagged by pre-push * test(frontend): accept tokenized font-size and shell-rendered loading overlay Two source-text assertions only ran in CI (Node 24 discovers .test.ts, local Node 20 does not): - ChatQuestionMinimap: the 13px preview font is now var(--app-text-md) - modelUsageDetails: the editors' loading overlay is rendered by SettingsModalShell via :loading instead of an inline v-if Both regexes now accept either form. --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-17 15:11:08 +00:00
font-size: var(--app-text-md);
color: var(--td-text-color-secondary);
margin: 0;
line-height: 1.5;
}
}
.setting-control {
flex: 0 0 55%;
max-width: 55%;
display: flex;
justify-content: flex-end;
align-items: flex-start;
}
</style>