diff options
| author | David Hill <[email protected]> | 2026-02-27 00:15:11 +0000 |
|---|---|---|
| committer | David Hill <[email protected]> | 2026-02-27 00:18:14 +0000 |
| commit | bf442a50c0b7007b9c4089b8c18e739f94a6c7cf (patch) | |
| tree | 61429d4ec46f70bf8c3179f9ea81213d4b5755f8 | |
| parent | 09e1b98bc6fcd13a3481dd0b54fdc9805a1b8c6c (diff) | |
| download | opencode-bf442a50c0b7007b9c4089b8c18e739f94a6c7cf.tar.gz opencode-bf442a50c0b7007b9c4089b8c18e739f94a6c7cf.zip | |
fix(ui): mute inactive file tab icons
| -rw-r--r-- | packages/app/src/components/session/session-sortable-tab.tsx | 16 | ||||
| -rw-r--r-- | packages/ui/src/components/tabs.css | 40 |
2 files changed, 39 insertions, 17 deletions
diff --git a/packages/app/src/components/session/session-sortable-tab.tsx b/packages/app/src/components/session/session-sortable-tab.tsx index a304df2ed..dfda91c16 100644 --- a/packages/app/src/components/session/session-sortable-tab.tsx +++ b/packages/app/src/components/session/session-sortable-tab.tsx @@ -13,13 +13,15 @@ import { useCommand } from "@/context/command" export function FileVisual(props: { path: string; active?: boolean }): JSX.Element { return ( <div class="flex items-center gap-x-1.5 min-w-0"> - <FileIcon - node={{ path: props.path, type: "file" }} - classList={{ - "grayscale-100 group-data-[selected]/tab:grayscale-0": !props.active, - "grayscale-0": props.active, - }} - /> + <Show + when={!props.active} + fallback={<FileIcon node={{ path: props.path, type: "file" }} class="size-4 shrink-0" />} + > + <span class="relative inline-flex size-4 shrink-0"> + <FileIcon node={{ path: props.path, type: "file" }} class="absolute inset-0 size-4 tab-fileicon-color" /> + <FileIcon node={{ path: props.path, type: "file" }} mono class="absolute inset-0 size-4 tab-fileicon-mono" /> + </span> + </Show> <span class="text-14-medium truncate">{getFilename(props.path)}</span> </div> ) diff --git a/packages/ui/src/components/tabs.css b/packages/ui/src/components/tabs.css index 8b54824e7..f8045702f 100644 --- a/packages/ui/src/components/tabs.css +++ b/packages/ui/src/components/tabs.css @@ -229,20 +229,40 @@ } } - [data-component="file-icon"] { - filter: grayscale(1) !important; - transition: filter 120ms ease; + &:hover:not(:disabled):not(:has([data-selected])) { + color: var(--text-base); + background-color: var(--surface-base-hover); } - &:has([data-selected]) { - [data-component="file-icon"] { - filter: grayscale(0) !important; + /* + File tabs: use monochrome icon by default. + Full-color icon is shown on hover/selected. + */ + [data-slot="tabs-trigger"] { + .tab-fileicon-color, + .tab-fileicon-mono { + transition: opacity 120ms ease; } - } - &:hover:not(:disabled):not(:has([data-selected])) { - color: var(--text-base); - background-color: var(--surface-base-hover); + .tab-fileicon-color { + opacity: 0; + } + + .tab-fileicon-mono { + opacity: 1; + color: currentColor; + } + + &[data-selected], + &:hover { + .tab-fileicon-color { + opacity: 1; + } + + .tab-fileicon-mono { + opacity: 0; + } + } } } } |
