feat: Implement theme management and UI enhancements across the application

- Added theme initialization and management in the UI store.
- Enhanced dark mode styles for various components, including tables, dialogs, and inputs.
- Updated multiple components to use CSS variables for consistent theming.
- Introduced a new simplified API for updating knowledge base configurations.
- Improved overall UI consistency and responsiveness with new styles.
This commit is contained in:
wizardchen
2025-11-06 02:45:44 +08:00
parent 4fa3adbf3b
commit 7a64371603
28 changed files with 2808 additions and 330 deletions
@@ -9,13 +9,13 @@
@relevance-low: #757575;
@relevance-weak: #bdbdbd;
// Card colors
@card-bg: #f8f9fa;
@card-border: #e7e7e7;
@card-hover-border: #07c05f;
// Card colors - use CSS variables for theme support
@card-bg: var(--td-bg-color-secondarycontainer);
@card-border: var(--td-component-border);
@card-hover-border: var(--td-brand-color);
@card-radius: 8px;
@card-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
@card-shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.1);
@card-shadow: var(--td-shadow-1);
@card-shadow-hover: var(--td-shadow-2);
// Animation timing
@transition-time: 0.3s;
@@ -52,7 +52,7 @@
&.weak {
background-color: @relevance-weak;
color: #333;
color: var(--td-text-color-primary);
}
}
@@ -63,8 +63,8 @@
padding: 2px 6px;
border-radius: 3px;
font-size: 11px;
background-color: #e7e7e7;
color: #666;
background-color: var(--td-bg-color-component);
color: var(--td-text-color-secondary);
gap: 2px;
}
@@ -111,13 +111,13 @@
align-items: center;
gap: 6px;
font-size: 12px;
color: #8b8b8b;
color: var(--td-text-color-placeholder);
}
.result-content {
padding: 0 12px 12px 12px;
border-top: 1px solid @card-border;
background: white;
background: var(--td-bg-color-container);
max-height: 0;
opacity: 0;
overflow: hidden;
@@ -132,7 +132,7 @@
.expand-icon {
font-size: 12px;
color: #8b8b8b;
color: var(--td-text-color-placeholder);
transition: transform 0.2s ease;
&.expanded {
@@ -152,7 +152,7 @@
.info-section-title {
font-size: 12px;
font-weight: 600;
color: #666;
color: var(--td-text-color-secondary);
text-transform: uppercase;
letter-spacing: 0.5px;
margin-bottom: 6px;
@@ -165,20 +165,20 @@
font-size: 13px;
.field-label {
color: #8b8b8b;
color: var(--td-text-color-placeholder);
min-width: 80px;
}
.field-value {
color: #333;
color: var(--td-text-color-primary);
flex: 1;
}
}
// Statistics card (for KB counts, etc.)
.stats-card {
background: #f0f7ff;
border: 1px solid #d6e4ff;
background: var(--td-brand-color-light);
border: 1px solid var(--td-brand-color-3);
border-radius: 6px;
padding: 10px 12px;
margin-bottom: 12px;
@@ -187,7 +187,7 @@
.stats-title {
font-size: 13px;
font-weight: 600;
color: #333;
color: var(--td-text-color-primary);
margin-bottom: 6px;
}
@@ -199,7 +199,7 @@
.stats-item {
font-size: 12px;
color: #666;
color: var(--td-text-color-secondary);
display: flex;
justify-content: space-between;
}
@@ -218,7 +218,7 @@
flex-direction: column;
gap: 4px;
padding: 8px 0;
border-bottom: 1px solid #f0f0f0;
border-bottom: 1px solid var(--td-component-border);
&:last-child {
border-bottom: none;
@@ -228,7 +228,7 @@
// Content preview (truncated)
.content-preview {
font-size: 13px;
color: #333;
color: var(--td-text-color-primary);
line-height: 1.5;
max-height: 60px;
overflow: hidden;
@@ -241,12 +241,12 @@
// Full content
.full-content {
font-size: 13px;
color: #333;
color: var(--td-text-color-primary);
line-height: 1.6;
white-space: pre-wrap;
word-break: break-word;
padding: 8px;
background: #f5f5f5;
background: var(--td-bg-color-component);
border-radius: 4px;
border: 1px solid @card-border;
}
@@ -257,8 +257,8 @@
font-size: 12px;
border-radius: 4px;
border: 1px solid @card-border;
background: white;
color: #666;
background: var(--td-bg-color-container);
color: var(--td-text-color-secondary);
cursor: pointer;
transition: all 0.2s ease;
@@ -272,7 +272,7 @@
.empty-state {
padding: 24px;
text-align: center;
color: #8b8b8b;
color: var(--td-text-color-placeholder);
font-size: 14px;
}
@@ -280,7 +280,7 @@
.code-block {
font-family: 'Monaco', 'Courier New', monospace;
font-size: 12px;
background: #f5f5f5;
background: var(--td-bg-color-component);
padding: 8px;
border-radius: 4px;
border: 1px solid @card-border;