feat(dashboard): CLI settings UI and Smart Context support

- Add CLI Settings section with Prompt Format selector
- Add Smart Context toggle and Max Files dropdown
- Update smart-search with output_mode (full/files_only/count)
- Add smart-context module for keyword extraction
- Improve Status page styling (remove card wrappers)
- Add i18n translations for new settings

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-12-13 17:28:39 +08:00
parent 675aff26ff
commit 32217f87fd
7 changed files with 500 additions and 57 deletions

View File

@@ -31,6 +31,27 @@
overflow: hidden;
}
/* CLI Section - No card wrapper */
.cli-section {
/* No background, border, or card styling */
}
.cli-section .section-header {
padding: 0 0 0.75rem 0;
border-bottom: none;
background: transparent;
}
.cli-section .section-header h3 {
font-size: 0.9375rem;
}
.cli-section .tools-list,
.cli-section .ccw-list,
.cli-section .endpoint-tools-grid {
padding: 0;
}
/* Section Header */
.section-header {
display: flex;
@@ -84,6 +105,8 @@
padding: 0.75rem;
border-radius: 0.5rem;
margin-bottom: 0.375rem;
background: hsl(var(--card));
border: 1px solid hsl(var(--border));
transition: all 0.15s ease;
}
@@ -93,19 +116,19 @@
.tool-item:hover {
background: hsl(var(--hover));
border-color: hsl(var(--primary) / 0.3);
}
.tool-item.available {
border-left: 3px solid hsl(var(--success));
/* No left border - use status dot instead */
}
.tool-item.unavailable {
border-left: 3px solid hsl(var(--muted-foreground) / 0.3);
opacity: 0.7;
}
.tool-item.endpoint {
border-left: 3px solid hsl(var(--indigo));
/* No left border */
}
.tool-item-left {
@@ -209,6 +232,7 @@
padding: 0.75rem;
border-radius: 0.5rem;
margin-bottom: 0.375rem;
background: hsl(var(--card));
border: 1px solid hsl(var(--border));
transition: all 0.15s ease;
}
@@ -1642,12 +1666,14 @@
justify-content: flex-end;
}
/* Danger Button */
/* Danger Button (icon style - subtle) */
.btn-icon.btn-danger {
color: hsl(var(--destructive));
color: hsl(var(--muted-foreground));
background: transparent;
}
.btn-icon.btn-danger:hover {
color: hsl(var(--destructive));
background: hsl(var(--destructive) / 0.1);
}
@@ -1754,7 +1780,7 @@
display: flex;
flex-direction: column;
padding: 0.875rem;
background: hsl(var(--background));
background: hsl(var(--card));
border: 1px solid hsl(var(--border));
border-radius: 0.5rem;
cursor: pointer;
@@ -2232,6 +2258,23 @@
cursor: not-allowed;
}
/* Override for icon-style danger buttons (subtle, not solid red) */
.btn-icon.btn-danger,
.history-item-actions .btn-danger,
.cli-history-actions .btn-danger {
background: transparent;
color: hsl(var(--muted-foreground));
border: none;
}
.btn-icon.btn-danger:hover,
.history-item-actions .btn-danger:hover,
.cli-history-actions .btn-danger:hover {
background: hsl(var(--destructive) / 0.1);
color: hsl(var(--destructive));
opacity: 1;
}
/* Multi-Select Checkbox */
.history-checkbox-wrapper {
display: flex;
@@ -2557,59 +2600,74 @@
* ======================================== */
.cli-settings-section {
margin-top: 1.5rem;
padding-top: 1.25rem;
border-top: 1px solid hsl(var(--border));
/* No card wrapper - just title and cards */
}
.cli-settings-header {
margin-bottom: 1rem;
.cli-settings-section .section-header {
padding: 0 0 0.75rem 0;
border-bottom: none;
background: transparent;
}
.cli-settings-header h4 {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.875rem;
font-weight: 600;
color: hsl(var(--foreground));
.cli-settings-section .section-header h3 {
font-size: 0.9375rem;
}
.cli-settings-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
gap: 1rem;
grid-template-columns: repeat(4, 1fr);
gap: 0.75rem;
}
@media (max-width: 1200px) {
.cli-settings-grid {
grid-template-columns: repeat(2, 1fr);
}
}
@media (max-width: 640px) {
.cli-settings-grid {
grid-template-columns: 1fr;
}
}
.cli-setting-item {
padding: 0.875rem;
background: hsl(var(--muted) / 0.3);
padding: 0.75rem;
background: hsl(var(--card));
border: 1px solid hsl(var(--border));
border-radius: 0.5rem;
display: flex;
flex-direction: column;
min-height: 90px;
}
.cli-setting-label {
display: flex;
align-items: center;
gap: 0.375rem;
font-size: 0.75rem;
font-size: 0.6875rem;
font-weight: 600;
color: hsl(var(--foreground));
color: hsl(var(--muted-foreground));
text-transform: uppercase;
letter-spacing: 0.025em;
margin-bottom: 0.5rem;
}
.cli-setting-label i {
color: hsl(var(--primary));
width: 12px;
height: 12px;
}
.cli-setting-control {
margin-bottom: 0.375rem;
margin-bottom: 0.5rem;
flex-shrink: 0;
}
.cli-setting-select {
width: 100%;
padding: 0.5rem 0.625rem;
font-size: 0.75rem;
padding: 0.4375rem 0.5rem;
font-size: 0.8125rem;
background: hsl(var(--background));
border: 1px solid hsl(var(--border));
border-radius: 0.375rem;
@@ -2631,5 +2689,68 @@
.cli-setting-desc {
font-size: 0.6875rem;
color: hsl(var(--muted-foreground));
line-height: 1.4;
line-height: 1.3;
margin-top: auto;
}
.cli-setting-value {
font-size: 0.875rem;
color: hsl(var(--foreground));
font-weight: 500;
}
/* Toggle Switch */
.cli-toggle {
position: relative;
display: inline-block;
width: 36px;
height: 20px;
}
.cli-toggle input {
opacity: 0;
width: 0;
height: 0;
}
.cli-toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: hsl(var(--muted));
transition: 0.3s;
border-radius: 20px;
}
.cli-toggle-slider:before {
position: absolute;
content: "";
height: 14px;
width: 14px;
left: 3px;
bottom: 3px;
background-color: white;
transition: 0.3s;
border-radius: 50%;
}
.cli-toggle input:checked + .cli-toggle-slider {
background-color: hsl(var(--primary));
}
.cli-toggle input:checked + .cli-toggle-slider:before {
transform: translateX(16px);
}
.cli-toggle input:focus + .cli-toggle-slider {
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.2);
}
/* Disabled state for settings */
.cli-setting-item.disabled {
opacity: 0.5;
pointer-events: none;
}