From f360816a5e240f2dc6339df53b56a4423b9b47d9 Mon Sep 17 00:00:00 2001 From: Max <112043822+Maxaubert@users.noreply.github.com> Date: Wed, 7 Oct 2026 03:40:13 +0200 Subject: [PATCH] feat(style): a preview button that shows its state, a quiet search, and an icon on every tab (#308) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01FHHaWKR4M5QtW7Wecyuk4t --- CLAUDE.md | 10 + package-lock.json | 4 +- package.json | 2 +- src/renderer/src/components/TabKindIcon.tsx | 89 +++++++ src/renderer/src/components/TabStrip.tsx | 13 +- .../src/components/browse/BrowseIcon.tsx | 29 ++- .../src/components/browse/FolderBrowser.tsx | 11 +- src/renderer/src/components/browse/browse.css | 13 +- tools/e2e/run.mjs | 221 +++++++++++++++++- 9 files changed, 374 insertions(+), 18 deletions(-) create mode 100644 src/renderer/src/components/TabKindIcon.tsx diff --git a/CLAUDE.md b/CLAUDE.md index da012e53..d1347d04 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -99,6 +99,16 @@ native ``, no Acrylic or Accent opacity slider. Spec and plan: browser paints no ground; its address row, list, preview slot and status paint `--p-bg`, the places panel (and `.browse-viewer-places`) `--p-side`, the Settings rail's and project tree's colour, one coat each. Every catalogue theme's panel differs from its ground. The `sidebarGround` e2e holds both. +- **THE TOOLBAR'S BUTTONS ARE NEVER COLOURED; EVERY TAB WEARS AN ICON BY WHAT IT HOLDS** (#308; + owner, 2026-10-06: "i dont like the look of the buttons being colored ... search is more minor ... + the preview panel is almost always opened ... an icon that changes based on whether the panel is + opened or hidden ... default icons per type of page explorer, project and settings"; 2026-10-07, of + `research/prism/2026-10-06-new-themes/toolbar-options.html`: "A3 and C2"). The preview toggle + (`PreviewGlyph`) and the search button wear Back's grey and no fill in every state; the preview's + right column is SOLID while open, empty while hidden; `data-active` on search is a mark, not a + look. Every tab carries `TabKindIcon` (Explorer a folder, project code brackets, Settings a gear) + in the tab's own ink, SOLID on the tab you are on and lines on the rest; it replaced the + folder-coloured glyph only Explorer tabs had. The `toolbarIcons` e2e holds both. ## Scope diff --git a/package-lock.json b/package-lock.json index 4f6150d3..c5797b71 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "prism", - "version": "0.92.1", + "version": "0.93.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "prism", - "version": "0.92.1", + "version": "0.93.0", "license": "MIT", "dependencies": { "@codemirror/commands": "^6.11.0", diff --git a/package.json b/package.json index be068b68..af0b71d2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prism", - "version": "0.92.1", + "version": "0.93.0", "description": "A fast, universal media viewer for Windows.", "author": "Max", "license": "MIT", diff --git a/src/renderer/src/components/TabKindIcon.tsx b/src/renderer/src/components/TabKindIcon.tsx new file mode 100644 index 00000000..20851ac5 --- /dev/null +++ b/src/renderer/src/components/TabKindIcon.tsx @@ -0,0 +1,89 @@ +import { useId, type JSX } from 'react' + +/** What a tab holds, as its icon says it (#308). */ +export type TabKind = 'explorer' | 'project' | 'settings' + +/* The C2 drawings from the approved mockup (owner, 2026-10-07: "A3 and C2"; + research/prism/2026-10-06-new-themes/toolbar-options.html). Lines on the + tabs you are not on, solid on the one you are: a second cue next to the + accent rule along the top. */ +const FOLDER = 'M3 6.5A1.5 1.5 0 0 1 4.5 5H9l2 2h8.5A1.5 1.5 0 0 1 21 8.5v9a1.5 1.5 0 0 1-1.5 1.5h-15A1.5 1.5 0 0 1 3 17.5z' +const FOLDER_SOLID = + 'M2.5 6.5A1.5 1.5 0 0 1 4 5h5.2l2 2H20a1.5 1.5 0 0 1 1.5 1.5v9A1.5 1.5 0 0 1 20 19H4a1.5 1.5 0 0 1-1.5-1.5z' +const CODE = 'M8.5 7L3.5 12l5 5M15.5 7l5 5-5 5M13.5 4.5l-3 15' +const CODE_CUT = 'M9 9l-3 3 3 3M15 9l3 3-3 3M13 7.5l-2 9' +const GEAR = + 'M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6ZM19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z' + +const SIZE = 14 + +/** + * The tab's own icon, in the tab's ink (currentColor): the label's dim grey + * on a tab at rest, its brighter text on the one you are on and under a + * hover, the agent's onTint ink on a Full fill. Never a colour of its own + * (owner, 2026-10-06: "i dont like the look of the buttons being colored"). + */ +export function TabKindIcon({ kind, solid }: { kind: TabKind; solid: boolean }): JSX.Element { + // The solid code tile's brackets are CUT OUT of it by a mask rather than + // drawn over it in the strip's colour: the strip may be see-through (two + // coats of a glass ground are an opaque slab, #294) or under an agent's + // fill, and a hole shows whatever is really behind. + const mask = `tab-kind-${useId().replace(/:/g, '')}` + const common = { + viewBox: '0 0 24 24', + width: SIZE, + height: SIZE, + className: 'shrink-0', + 'data-tab-icon': kind, + 'data-tab-icon-fill': solid ? 'solid' : 'outline', + 'aria-hidden': true + } as const + if (!solid) + return ( + + + + ) + if (kind === 'explorer') + return ( + + + + ) + if (kind === 'settings') + return ( + + + + ) + return ( + + + + + + + + ) +} diff --git a/src/renderer/src/components/TabStrip.tsx b/src/renderer/src/components/TabStrip.tsx index fc502c11..22653f84 100644 --- a/src/renderer/src/components/TabStrip.tsx +++ b/src/renderer/src/components/TabStrip.tsx @@ -8,6 +8,7 @@ import { tabsOf, useStyle } from '../lib/theme' import { pinnedRoots, plusMenuList, recentLabels, recentRoots, togglePin } from 'prism-term-core/renderer/lib/recentRoots' import { DRAG_MIME, dragPayload, droppedPaths, setDrag, type DragPayload } from '../lib/dragDrop' import { ContextMenu } from './ContextMenu' +import { TabKindIcon } from './TabKindIcon' import { useTabWidth } from '../lib/tabWidthPrefs' /** @@ -454,7 +455,17 @@ export function TabStrip({ either, which is why the slot itself goes with the icon; the widths only settle differently, and only when the setting is deliberately changed. */} - {isExplorerTab(t) ? : indicator === 'full' && ( + {/* EVERY TAB SAYS WHAT IT HOLDS (#308; owner, 2026-10-06: "we + should have some default icons per type of page explorer, + project and settings"; 2026-10-07, of the mockup: "A3 and C2"). + A folder, code brackets or a gear in the tab's own ink, solid + on the tab you are on and lines on the rest. It replaced the + small folder in the folder colour that only Explorer tabs had. */} + + {!isExplorerTab(t) && t.kind !== 'settings' && indicator === 'full' && ( {tint && ( ) } + +/** + * THE PREVIEW BUTTON SAYS ITS STATE IN ITS DRAWING (#308; owner, 2026-10-07, + * of the mockup: "A3"; before it, "the preview panel is almost always opened + * and that button then is colored ... an icon that changes based on whether + * the panel is opened or hidden"). A window whose right column is SOLID while + * the pane is open and EMPTY while it is hidden, in the row's own grey: no + * accent and no fill in any state. A3's paths and stroke, at the row's size. + */ +export function PreviewGlyph({ open }: { open: boolean }): JSX.Element { + return ( + + ) +} diff --git a/src/renderer/src/components/browse/FolderBrowser.tsx b/src/renderer/src/components/browse/FolderBrowser.tsx index 3081fa60..e81812e5 100644 --- a/src/renderer/src/components/browse/FolderBrowser.tsx +++ b/src/renderer/src/components/browse/FolderBrowser.tsx @@ -1,6 +1,6 @@ import { useCallback, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type JSX } from 'react' import { formatBytes } from '../../lib/format' -import { BrowseIcon } from './BrowseIcon' +import { BrowseIcon, PreviewGlyph } from './BrowseIcon' import { BrowseList } from './BrowseList' import { BrowseSearchStatus } from './BrowseSearchStatus' import { BrowseSearchPopup } from './BrowseSearchPopup' @@ -401,7 +401,7 @@ export function FolderBrowser(props: FolderBrowserProps): JSX.Element { aria-pressed={props.previewEnabled} onClick={props.onPreviewToggle} > - +