Skip to content

Commit a3f781b

Browse files
committed
fix(ui): restore tree and toolbar icon recognition cues
1 parent 2f5f2dc commit a3f781b

8 files changed

Lines changed: 87 additions & 47 deletions

File tree

‎AGENTS.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Tauri-based cross-platform SQL database GUI client with Vue 3 + TypeScript front
99
**Before adding or changing client UI, read [DESIGN.md](DESIGN.md).** It is the canonical client design specification; feature design documents describe behavior within that system.
1010

1111
- Preserve SQLKit's existing **blue primary**, light/dark/system themes, compact desktop workspace, and shared shadcn-vue/Radix Vue components. Keep semantic color ownership consistent and retain SQLKit's blue brand and primary actions.
12-
- Use neutral surfaces, typography, spacing, and borders for hierarchy. Keep accent areas scarce (roughly 10% of application chrome); use at most one solid primary action per operation context. Secondary toolbar actions stay neutral.
13-
- Colors have fixed roles: `primary` = primary actions/interaction; `success` = actual success/connected/completed; `destructive` = errors/destructive actions. Ordinary information, counts, boolean values, database properties, and file formats are neutral. Do not assign a color to each feature or add a separate AI palette.
12+
- Use neutral surfaces, typography, spacing, and borders for hierarchy. Keep accent areas scarce (roughly 10% of application chrome); use at most one solid primary action per operation context. Toolbar button surfaces stay neutral; small query-action and object-type icons may use the bounded recognition palette in DESIGN.md.
13+
- Colors have fixed roles: `primary` = primary actions/interaction; `success` = actual success/connected/completed; `destructive` = errors/destructive actions. Ordinary information, counts, boolean values, database properties, and file formats are neutral. Do not tint whole features or add a separate AI palette. Object-type and query-action icon colors are recognition cues, separate from operational status.
1414
- Reuse semantic CSS tokens from `src/assets/index.css` and their `uno.config.ts` mappings. Do not add palette classes or literal colors for existing UI semantics. `accent` is a neutral interaction surface, not a second brand color.
1515
- `warning` is registered with light/dark foreground, muted-background, and border pairs; `info` is **not registered**. Use `primary-text` and `destructive-text` for readable colored text, reserving the corresponding base tokens for solid actions. Any new semantic token must include light/dark definitions, necessary foreground pairs, UnoCSS mappings, shared variants where needed, contrast verification, and a DESIGN.md update in the same change.
1616
- Non-interactive badges explicitly use `outline`/`secondary` by default; status colors require real state and accompanying text or icons. Syntax highlighting, data charts, diffs, and small vendor logos have the bounded exceptions documented in DESIGN.md.

‎DESIGN.md‎

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ The table records CSS HSL components, used as `hsl(var(--token))`. The frontmatt
7878
| `--warning-foreground` | `0.00 0.00% 100.00%` | `220.00 12.00% 9.80%` | Text on warning fills |
7979
| `--warning-muted` | `39.00 100.00% 96.08%` | `36.67 20.45% 17.25%` | Warning feedback surface |
8080
| `--warning-border` | `39.10 67.94% 74.31%` | `37.36 32.12% 32.35%` | Warning feedback boundary |
81+
| `--icon-table` | `142.43 71.81% 29.22%` | `143.02 47.25% 64.31%` | Table objects / Execute recognition |
82+
| `--icon-view` | `262.12 83.26% 57.84%` | `265.41 80.95% 79.41%` | Views / EXPLAIN recognition |
83+
| `--icon-procedure` | `224.28 76.33% 48.04%` | `218.46 100.00% 77.06%` | Procedures / collection groups / Save recognition |
84+
| `--icon-function` | `35.65 100.00% 27.06%` | `36.61 79.73% 70.98%` | Functions / Format recognition |
85+
| `--icon-database` | `43.91 100.00% 27.06%` | `45.00 55.17% 65.88%` | Database recognition |
8186

8287
Dark mode uses the approved softly cool graphite palette. Preserve blue primary actions. Use `primary-text` for blue text and icons, and `destructive-text` for error text and icons; solid fill tokens are not readable-text tokens. `success` and `warning` are paired with dark foregrounds in dark mode and white foregrounds in light mode.
8388

@@ -87,7 +92,7 @@ Dark mode uses the approved softly cool graphite palette. Preserve blue primary
8792
| --- | --- | --- |
8893
| Blue `primary / primary-text` | Primary actions, links, selected controls, small active indicators | Success, ordinary badges, large panel backgrounds |
8994
| Neutrals `foreground / muted / secondary / accent` | Body text, supporting information, toolbars, navigation backgrounds, counts, ordinary attributes, disconnected states | Important errors or risks hidden through low contrast |
90-
| Green `success` | Successful connection tests, connected states, successful execution, completed transfers | Execute buttons, boolean true, auto-increment attributes, decorative selling points |
95+
| Green `success` | Successful connection tests, connected states, successful execution, completed transfers | Filled Execute buttons, boolean true, auto-increment attributes, decorative selling points |
9196
| Red `destructive / destructive-text` | Execution failures, connection failures, deletion confirmations | Ordinary task counts, disconnected states, boolean false, decoration |
9297
| Amber `warning` | Actual warnings, risks, exceptional states requiring attention | JSON format, primary keys, ordinary unsaved indicators, arbitrary toolbar buttons |
9398

@@ -97,15 +102,15 @@ Use neutral icons and text for ordinary information; do not introduce a separate
97102

98103
1. **Start with neutrals, then add emphasis.** Most backgrounds, borders, body text, and icons in a resting workspace use existing neutral tokens. Establish hierarchy through typography, spacing, and position first.
99104
2. **Aim for accents to occupy no more than roughly 10% of the UI.** This is a review heuristic for the app shell, toolbars, panels, and forms, not a pixel-counting requirement. Evaluate SQL syntax highlighting, actual data charts, and local error feedback separately for readability; these exceptions must not expand decorative color use.
100-
3. **Use at most one solid primary action per operation context.** This is usually Execute in a query workspace or Save in a form dialog. Other actions use outline / secondary / ghost. An independent dialog may have its own primary action. Focus rings and status dots do not count as a second solid primary action.
105+
3. **Use at most one solid primary action per operation context.** Use a solid action only when the context benefits from it, such as Save in a form dialog. Query toolbar actions, including Execute, use compact ghost buttons with colored icons and neutral hover surfaces. An independent dialog may have its own primary action. Focus rings and status dots do not count as a second solid primary action.
101106
4. **Success, warning, and failure may coexist when backed by actual state.** Default to an icon / status dot with text, adding a local, subdued background when needed. Do not tint an entire row, card, or panel.
102-
5. **Features do not own colors.** Do not give copy / export / format / EXPLAIN or individual filter operators a separate color. The result copy/export icons have the bounded exception below.
107+
5. **Features do not own colors.** Do not tint feature surfaces or filter operators by category. The object-type, query-action, and result copy/export icons have bounded recognition exceptions below.
103108

104109
### Allowed and avoided treatments
105110

106111
| Context | Default treatment | Avoid |
107112
| --- | --- | --- |
108-
| Toolbars | Neutral icons and text; `accent` on hover | Blue / purple / orange / green buttons side by side |
113+
| Query toolbar | Small colored action icons, ghost buttons, neutral `accent` on hover | Solid blue Execute tiles or colored button backgrounds |
109114
| Navigation / tabs | Neutral backgrounds and font weight; small blue indicators when needed | Solid saturated blue blocks or multicolor navigation entries |
110115
| Attribute badges | Explicitly select `outline` or `secondary` on `Badge` | Solid blue badges chosen merely because that variant is the default |
111116
| Connection cards | Name, engine icon, status text / dot | A different colored background for each database engine |
@@ -114,6 +119,10 @@ Use neutral icons and text for ordinary information; do not introduce a separate
114119

115120
### Color exceptions
116121

122+
- The object browser uses small recognition icons: green table objects, violet views, blue procedures, amber functions, and gold database icons. Tables category nodes use a blue `table-properties` icon while individual tables use a green `table` icon. Labels, counts, chevrons, row backgrounds, and other chrome remain neutral. Materialized views retain a distinct layers glyph. These icon colors identify object types and do not indicate connection or execution state.
123+
- The query toolbar uses green Execute, violet EXPLAIN / ANALYZE, amber Format, and blue Save icons. All use compact ghost buttons with neutral hover and pressed surfaces; Execute has no persistent solid primary background. Enabled ANALYZE also retains its pressed state and an outline. Accessible labels and distinct glyphs remain required.
124+
- Recognition colors live in `--icon-table / view / procedure / function / database`, with light/dark definitions and `icon-*` UnoCSS mappings. Query-action mappings reuse this palette without borrowing the status token names. These are foreground-only icon roles; do not use them for button fills, panels, badges, text labels, or status feedback.
125+
117126
- Result copy/export icons retain their established format colors: sky blue for CSV, amber for JSON, and emerald for INSERT, including the overflow menu and light/dark variants. This is an icon-only recognition cue; buttons and menu surfaces remain neutral, and labels still identify each action. These colors do not indicate status or extend to other format controls.
118127
- Monaco SQL syntax highlighting, code diffs, and actual data charts may use multiple colors when those colors explain content. Do not extend their palettes into application controls.
119128
- Existing database vendor logos may retain identifying colors inside small icons. Do not extend those colors to cards, buttons, or navigation backgrounds.
@@ -298,7 +307,7 @@ Interactive components must cover default, hover, focus-visible, active / select
298307
### Don't
299308

300309
- Do not assign a color to every feature, database type, filter operator, or file format.
301-
- Do not use success green for Execute, error red for ordinary counts, or warning colors for ordinary attributes.
310+
- Do not use success-status tokens for Execute, error red for ordinary counts, or warning colors for ordinary attributes. Execute uses its bounded recognition icon role.
302311
- Do not replace SQLKit's blue theme, force pure-gray neutral surfaces, or switch to monochrome primary buttons to match the reference project.
303312
- Do not add rainbow badges, gradient AI panels, large colored icon containers, or light effects without functional value.
304313
- Do not use historical hardcoding, default Badge styling, or unimplemented tokens as the design basis for new UI.
@@ -320,7 +329,7 @@ Check each affected surface. Documentation-only changes need source, link, and i
320329
### Theme maintenance
321330

322331
- Keep the CSS token source, UnoCSS mappings, Monaco adapter, and this specification synchronized.
323-
- Shared badges default to neutral secondary. Connection and transfer status signals use semantic tokens; database attributes, booleans, filter operators, task counts, feature icons, and vendor icon containers remain neutral.
332+
- Shared badges default to neutral secondary. Connection and transfer status signals use semantic tokens; database attributes, booleans, filter operators, task counts, and vendor icon containers remain neutral. Object-type and query-action icons retain the bounded recognition palette above.
324333
- Theme preview tiles scope the same light/dark tokens instead of maintaining a second miniature palette.
325334
- Automated contrast checks cover text on workspace, chrome, raised, selection, and semantic feedback surfaces, plus foregrounds on solid actions. Editor theme tests cover light/dark switching and token inheritance.
326335
- Continue to verify real content, narrow windows, keyboard focus, system appearance changes, and native window controls on the target operating systems. Theme tests do not replace native-platform interaction checks.

‎src/__tests__/theme.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,15 @@ describe.each(['light', 'dark'] as const)('%s theme', (name) => {
6464
},
6565
)
6666

67+
it.each(['table', 'view', 'procedure', 'function', 'database'])(
68+
'keeps %s recognition icons readable on neutral surfaces',
69+
(role) => {
70+
;['background', 'chrome', 'card', 'accent'].forEach((surface) => {
71+
expect(contrast(tokens[`icon-${role}`], tokens[surface])).toBeGreaterThanOrEqual(4.5)
72+
})
73+
},
74+
)
75+
6776
it.each(['keyword', 'string', 'number', 'comment'])(
6877
'keeps SQL %s tokens readable',
6978
(token) => {

‎src/assets/index.css‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
--syntax-string: 23.16 60.64% 36.86%;
4545
--syntax-number: 270.65 39.66% 45.49%;
4646
--syntax-comment: 98.18 12.09% 35.69%;
47+
--icon-table: 142.43 71.81% 29.22%;
48+
--icon-view: 262.12 83.26% 57.84%;
49+
--icon-procedure: 224.28 76.33% 48.04%;
50+
--icon-function: 35.65 100.00% 27.06%;
51+
--icon-database: 43.91 100.00% 27.06%;
4752
}
4853

4954
.dark {
@@ -90,6 +95,11 @@
9095
--syntax-string: 26.40 47.77% 69.22%;
9196
--syntax-number: 264.49 51.58% 81.37%;
9297
--syntax-comment: 112.50 7.55% 58.43%;
98+
--icon-table: 143.02 47.25% 64.31%;
99+
--icon-view: 265.41 80.95% 79.41%;
100+
--icon-procedure: 218.46 100.00% 77.06%;
101+
--icon-function: 36.61 79.73% 70.98%;
102+
--icon-database: 45.00 55.17% 65.88%;
93103
}
94104

95105
* {

‎src/components/sidebar/DatabaseSelectorRow.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,11 @@ watch(() => props.connectionId, async (connId) => {
142142
@update:model-value="handleSelect"
143143
>
144144
<template #selected-prepend>
145-
<span class="i-lucide-database text-muted-foreground mr-1.5 shrink-0 h-3.5 w-3.5" />
145+
<span class="i-lucide-database text-icon-database mr-1.5 shrink-0 h-3.5 w-3.5" />
146146
</template>
147147
<template #option="{ option }">
148148
<div class="flex gap-1.5 w-full items-center">
149-
<span class="i-lucide-database text-muted-foreground shrink-0 h-3.5 w-3.5" />
149+
<span class="i-lucide-database text-icon-database shrink-0 h-3.5 w-3.5" />
150150
<span class="text-left flex-1 truncate">{{ option.label }}</span>
151151
</div>
152152
</template>

0 commit comments

Comments
 (0)