feat(frontend): improve manual knowledge editor and chat citation rendering

- Replace manual knowledge editor dialog with SettingDrawer and refine toolbar/footer layout
- Add draft status resolution for manual knowledge items in the knowledge base
- Fix citation placement near fenced code blocks and add regression tests
- Update ChatRequestInfoButton icon and chat message/citation styles
- Add i18n strings for manual knowledge editor features
This commit is contained in:
wizardchen
2026-06-17 20:50:42 +08:00
committed by lyingbug
parent 4c5379df9c
commit e0d3c1dafd
15 changed files with 396 additions and 269 deletions
@@ -49,7 +49,7 @@
:deep(.citation-kb) {
background: color-mix(in srgb, var(--td-text-color-primary) 4%, transparent);
color: color-mix(in srgb, var(--td-text-color-secondary) 86%, var(--td-text-color-primary));
color: color-mix(in srgb, var(--td-text-color-primary) 86%, var(--td-text-color-primary));
border: 0;
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--td-text-color-primary) 10%, transparent);
cursor: pointer;
@@ -1,21 +1,26 @@
.answer-toolbar {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 6px;
margin-top: 8px;
min-height: 32px;
gap: 4px;
margin-top: 6px;
margin-left: -7px;
min-height: 30px;
color: var(--td-text-color-primary);
:deep(.t-button) {
display: inline-flex;
align-items: center;
justify-content: center;
min-width: auto;
width: auto;
border: 1px solid var(--td-component-stroke);
border-radius: 6px;
background: var(--td-bg-color-container);
width: 30px;
height: 30px;
padding: 0;
border: none;
border-radius: 8px;
background: transparent;
color: var(--td-text-color-secondary);
transition: all 0.2s ease;
transition: background-color 0.15s ease, color 0.15s ease;
.t-button__content {
display: inline-flex !important;
@@ -34,20 +39,28 @@
.t-icon {
display: inline-flex !important;
visibility: visible !important;
opacity: 1 !important;
opacity: 1;
align-items: center;
justify-content: center;
font-size: 16px;
width: 16px;
height: 16px;
flex-shrink: 0;
color: var(--td-text-color-secondary);
color: inherit;
}
.t-icon svg {
display: block !important;
width: 16px;
height: 16px;
stroke-linecap: round;
stroke-linejoin: round;
}
.t-icon svg [stroke]:not([stroke='none']) {
stroke-width: 1.2;
stroke-linecap: round;
stroke-linejoin: round;
}
.t-button__text > :not(.t-icon) {
@@ -55,19 +68,21 @@
}
&:hover:not(:disabled) {
background: rgba(7, 192, 95, 0.08);
border-color: rgba(7, 192, 95, 0.3);
color: var(--td-brand-color);
background: var(--td-bg-color-container-hover);
color: var(--td-text-color-primary);
.t-icon {
color: var(--td-brand-color);
opacity: 1;
color: inherit;
}
}
&:active:not(:disabled) {
background: rgba(7, 192, 95, 0.12);
border-color: rgba(7, 192, 95, 0.4);
transform: translateY(0.5px);
background: var(--td-bg-color-container-active);
.t-icon {
opacity: 1;
}
}
}
}