From 22e86fc8071efc744068fbb03edeb6eaad5abfe2 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 21 Nov 2026 19:38:57 +0400 Subject: [PATCH] refac --- .../chat/FileNav/FileCodeEditor.svelte | 8 ++-- .../chat/FileNav/FilePreview.svelte | 16 ++++---- .../chat/FileNav/JsonTreeView.svelte | 14 +++---- .../chat/FileNav/NotebookView.svelte | 38 +++++++++---------- .../components/chat/FileNav/SqliteView.svelte | 24 ++++++------ .../chat/Messages/CodeExecutionModal.svelte | 4 +- src/lib/components/chat/Settings/Usage.svelte | 8 ++-- src/lib/components/chat/TerminalDock.svelte | 4 +- .../components/common/DiffEditorModal.svelte | 4 +- .../components/common/PdfPagesPreview.svelte | 4 +- src/lib/components/common/PptxPreview.svelte | 4 +- src/tailwind.css | 2 +- 12 files changed, 66 insertions(+), 64 deletions(-) diff --git a/src/lib/components/chat/FileNav/FileCodeEditor.svelte b/src/lib/components/chat/FileNav/FileCodeEditor.svelte index 97a7a42054..83139ff7e9 100644 --- a/src/lib/components/chat/FileNav/FileCodeEditor.svelte +++ b/src/lib/components/chat/FileNav/FileCodeEditor.svelte @@ -318,14 +318,14 @@ diff --git a/src/lib/components/chat/FileNav/NotebookView.svelte b/src/lib/components/chat/FileNav/NotebookView.svelte index 708c67e0f4..cce5c455ef 100644 --- a/src/lib/components/chat/FileNav/NotebookView.svelte +++ b/src/lib/components/chat/FileNav/NotebookView.svelte @@ -424,25 +424,25 @@ position: sticky; top: 0; z-index: 5; - background: rgba(255, 255, 255, 0.95); + background: color-mix(in oklab, var(--color-base-0) 95%, transparent); backdrop-filter: blur(4px); } :global(.dark) .nb-toolbar { - background: rgba(17, 24, 39, 0.95); + background: color-mix(in oklab, var(--color-base-900) 95%, transparent); } .nb-btn { font-size: 0.6rem; padding: 0.15rem 0.35rem; border-radius: 0.25rem; - color: #6b7280; + color: var(--color-base-600); transition: all 0.15s; } .nb-btn:hover:not(:disabled) { background: rgba(128, 128, 128, 0.1); - color: #374151; + color: var(--color-base-700); } :global(.dark) .nb-btn:hover:not(:disabled) { - color: #d1d5db; + color: var(--color-base-300); } .nb-btn:disabled { opacity: 0.4; @@ -487,14 +487,14 @@ gap: 0.15rem; } .nb-cell-label { - color: #9ca3af; + color: var(--color-base-500); font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.6rem; user-select: none; text-align: center; } :global(.dark) .nb-cell-label { - color: #4b5563; + color: var(--color-base-700); } .nb-run-btn { display: flex; @@ -503,7 +503,7 @@ width: 1.25rem; height: 1.25rem; border-radius: 0.25rem; - color: #9ca3af; + color: var(--color-base-500); transition: all 0.15s; } .nb-run-btn:hover:not(:disabled) { @@ -511,7 +511,7 @@ background: rgba(5, 150, 105, 0.1); } :global(.dark) .nb-run-btn { - color: #6b7280; + color: var(--color-base-600); } :global(.dark) .nb-run-btn:hover:not(:disabled) { color: #34d399; @@ -550,12 +550,12 @@ font-size: 0.75rem; line-height: 1.5; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; - background: #f8f8f8; - color: #1f2937; + background: var(--color-base-50); + color: var(--color-base-850); } :global(.dark) .nb-code-source-raw { - background: #161b22; - color: #e6edf3; + background: var(--color-base-900); + color: var(--color-base-100); } .nb-code-textarea, .nb-edit-textarea { @@ -565,7 +565,7 @@ line-height: 1.5; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; background: #fffef5; - color: #1f2937; + color: var(--color-base-850); border: none; outline: none; resize: none; @@ -574,8 +574,8 @@ } :global(.dark) .nb-code-textarea, :global(.dark) .nb-edit-textarea { - background: #1a1d23; - color: #e6edf3; + background: var(--color-base-900); + color: var(--color-base-100); } .nb-edit-textarea { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; @@ -597,12 +597,12 @@ font-size: 0.7rem; line-height: 1.5; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; - color: #374151; + color: var(--color-base-700); white-space: pre-wrap; word-break: break-all; } :global(.dark) .nb-output-text { - color: #d1d5db; + color: var(--color-base-300); } .nb-output-img { max-width: 100%; @@ -649,7 +649,7 @@ font-size: 0.75rem; line-height: 1.5; font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace; - color: #6b7280; + color: var(--color-base-600); white-space: pre-wrap; } :global(.dark) .nb-code-source :global(.shiki), diff --git a/src/lib/components/chat/FileNav/SqliteView.svelte b/src/lib/components/chat/FileNav/SqliteView.svelte index 90a73ba99b..1f7ed0d4db 100644 --- a/src/lib/components/chat/FileNav/SqliteView.svelte +++ b/src/lib/components/chat/FileNav/SqliteView.svelte @@ -334,16 +334,16 @@ .sqlite-table thead th { position: sticky; top: 0; - background: rgba(243, 244, 246, 0.95); + background: color-mix(in oklab, var(--color-base-100) 95%, transparent); backdrop-filter: blur(4px); font-weight: 600; - color: #374151; + color: var(--color-base-700); border-bottom: 2px solid rgba(128, 128, 128, 0.25); z-index: 1; } :global(.dark) .sqlite-table thead th { - background: rgba(31, 41, 55, 0.95); - color: #d1d5db; + background: color-mix(in oklab, var(--color-base-800) 95%, transparent); + color: var(--color-base-300); } .sqlite-table tbody tr:nth-child(even) { background: rgba(128, 128, 128, 0.04); @@ -355,16 +355,16 @@ background: rgba(59, 130, 246, 0.1); } .sqlite-table td { - color: #374151; + color: var(--color-base-700); max-width: 18.75rem; overflow: hidden; text-overflow: ellipsis; } :global(.dark) .sqlite-table td { - color: #d1d5db; + color: var(--color-base-300); } .sqlite-row-num { - color: #9ca3af; + color: var(--color-base-500); font-size: 0.6rem; text-align: right !important; user-select: none; @@ -372,19 +372,19 @@ padding-right: 0.375rem !important; } :global(.dark) .sqlite-row-num { - color: #6b7280; + color: var(--color-base-600); } .sqlite-null { - color: #9ca3af !important; + color: var(--color-base-500) !important; font-style: italic; } :global(.dark) .sqlite-null { - color: #6b7280 !important; + color: var(--color-base-600) !important; } .query-editor::placeholder { - color: #9ca3af; + color: var(--color-base-500); } :global(.dark) .query-editor::placeholder { - color: #6b7280; + color: var(--color-base-600); } diff --git a/src/lib/components/chat/Messages/CodeExecutionModal.svelte b/src/lib/components/chat/Messages/CodeExecutionModal.svelte index 6d7d40b403..15e0496299 100644 --- a/src/lib/components/chat/Messages/CodeExecutionModal.svelte +++ b/src/lib/components/chat/Messages/CodeExecutionModal.svelte @@ -75,7 +75,9 @@ {#if codeExecution?.result && (codeExecution?.result?.error || codeExecution?.result?.output)} -
+
{#if codeExecution?.result?.error}
{$i18n.t('ERROR')}
diff --git a/src/lib/components/chat/Settings/Usage.svelte b/src/lib/components/chat/Settings/Usage.svelte index ba5fd8484f..c941d6ca1f 100644 --- a/src/lib/components/chat/Settings/Usage.svelte +++ b/src/lib/components/chat/Settings/Usage.svelte @@ -115,10 +115,10 @@ ], [ 'bg-base-100 dark:bg-base-800', - 'bg-neutral-200 dark:bg-neutral-800', - 'bg-neutral-400 dark:bg-neutral-600', - 'bg-neutral-600 dark:bg-neutral-400', - 'bg-neutral-800 dark:bg-neutral-200' + 'bg-base-200 dark:bg-base-850', + 'bg-base-500 dark:bg-base-700', + 'bg-base-700 dark:bg-base-500', + 'bg-base-850 dark:bg-base-200' ] ]; diff --git a/src/lib/components/chat/TerminalDock.svelte b/src/lib/components/chat/TerminalDock.svelte index a2041d3cc6..bd3d577543 100644 --- a/src/lib/components/chat/TerminalDock.svelte +++ b/src/lib/components/chat/TerminalDock.svelte @@ -329,7 +329,7 @@ color: var(--color-base-900, #171717); } :global(.dark) .terminal-tab.selected { - color: #e5e5e5; + color: var(--color-base-200); } .tab-button, .tab-close { @@ -346,7 +346,7 @@ } :global(.dark) .tab-button:hover, :global(.dark) .tab-close:hover { - color: #f5f5f5; + color: var(--color-base-100); } .tab-close { opacity: 0; diff --git a/src/lib/components/common/DiffEditorModal.svelte b/src/lib/components/common/DiffEditorModal.svelte index 6bb2f05f2f..be4d65c558 100644 --- a/src/lib/components/common/DiffEditorModal.svelte +++ b/src/lib/components/common/DiffEditorModal.svelte @@ -1033,10 +1033,10 @@ background: #3e9c89; } :global(.dark) .merge-container :global(.cm-editor) { - background: #101413; + background: var(--color-base-950); } :global(.dark) .merge-container :global(.cm-gutters) { - background: #101413 !important; + background: var(--color-base-950) !important; } .merge-container :global(.cm-mergeViewEditors) { height: 100%; diff --git a/src/lib/components/common/PdfPagesPreview.svelte b/src/lib/components/common/PdfPagesPreview.svelte index 2377ffafeb..dabf750485 100644 --- a/src/lib/components/common/PdfPagesPreview.svelte +++ b/src/lib/components/common/PdfPagesPreview.svelte @@ -229,14 +229,14 @@ :global(:where(html:not(.native-scrollbars))) .thumbnail-sidebar:focus, :global(:where(html:not(.native-scrollbars))) .thumbnail-sidebar:focus-within, :global(:where(html:not(.native-scrollbars))) .thumbnail-sidebar:active { - scrollbar-color: rgba(215, 215, 215, 0.6) transparent; + scrollbar-color: color-mix(in oklab, var(--color-base-300) 60%, transparent) transparent; } :global(:where(html:not(.native-scrollbars)).dark) .thumbnail-sidebar:hover, :global(:where(html:not(.native-scrollbars)).dark) .thumbnail-sidebar:focus, :global(:where(html:not(.native-scrollbars)).dark) .thumbnail-sidebar:focus-within, :global(:where(html:not(.native-scrollbars)).dark) .thumbnail-sidebar:active { - scrollbar-color: rgba(67, 67, 67, 0.6) transparent; + scrollbar-color: color-mix(in oklab, var(--color-base-700) 60%, transparent) transparent; } :global(:where(html:not(.native-scrollbars))) .thumbnail-sidebar::-webkit-scrollbar-thumb { diff --git a/src/lib/components/common/PptxPreview.svelte b/src/lib/components/common/PptxPreview.svelte index 303087d6e9..0478856f77 100644 --- a/src/lib/components/common/PptxPreview.svelte +++ b/src/lib/components/common/PptxPreview.svelte @@ -444,14 +444,14 @@ :global(:where(html:not(.native-scrollbars))) .thumbnail-sidebar:focus, :global(:where(html:not(.native-scrollbars))) .thumbnail-sidebar:focus-within, :global(:where(html:not(.native-scrollbars))) .thumbnail-sidebar:active { - scrollbar-color: rgba(215, 215, 215, 0.6) transparent; + scrollbar-color: color-mix(in oklab, var(--color-base-300) 60%, transparent) transparent; } :global(:where(html:not(.native-scrollbars)).dark) .thumbnail-sidebar:hover, :global(:where(html:not(.native-scrollbars)).dark) .thumbnail-sidebar:focus, :global(:where(html:not(.native-scrollbars)).dark) .thumbnail-sidebar:focus-within, :global(:where(html:not(.native-scrollbars)).dark) .thumbnail-sidebar:active { - scrollbar-color: rgba(67, 67, 67, 0.6) transparent; + scrollbar-color: color-mix(in oklab, var(--color-base-700) 60%, transparent) transparent; } :global(:where(html:not(.native-scrollbars))) .thumbnail-sidebar::-webkit-scrollbar-thumb { diff --git a/src/tailwind.css b/src/tailwind.css index be5333b835..55f04a4dcd 100644 --- a/src/tailwind.css +++ b/src/tailwind.css @@ -192,7 +192,7 @@ } input[type='checkbox'] { - @apply appearance-none size-3.5 align-middle bg-white border border-base-300 rounded transition cursor-pointer focus:ring-2 focus:ring-blue-500 focus:outline-none dark:bg-base-800 dark:border-base-600 self-center; + @apply appearance-none size-3.5 align-middle bg-base-0 border border-base-300 rounded transition cursor-pointer focus:ring-2 focus:ring-blue-500 focus:outline-none dark:bg-base-800 dark:border-base-600 self-center; /* Center the custom mark */ display: inline-block; position: relative;