Skip to content

Commit 7219084

Browse files
author
DavidQ
committed
Remove swatch hover detail overlay and rely on native tooltip for swatch info - PR_26124_041-remove-swatch-hover-box
1 parent e57dbdf commit 7219084

5 files changed

Lines changed: 222 additions & 76 deletions

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# PR_26124_041 Report
2+
3+
## Purpose
4+
Remove Palette Manager swatch hover overlay boxes while preserving native tooltip information.
5+
6+
## Changes
7+
- Removed creation of `.palette-manager-v2__swatch-details` hover detail panels from swatch tiles.
8+
- Removed CSS rules for `.palette-manager-v2__swatch-details` and its hover/focus display behavior.
9+
- Added centralized native tooltip text with name, symbol, hex, and source.
10+
- Applied tooltip text to swatch rows, row chips, and swatch tiles.
11+
12+
## Scope Checks
13+
- Tile size behavior unchanged.
14+
- Sort behavior unchanged.
15+
- Pin/thumbtack behavior unchanged.
16+
- Scroll behavior unchanged.
17+
- JSON structure and palette logic unchanged.
18+
- `tools/shared` unchanged.
19+
20+
## Validation
21+
- `node --check tools/palette-manager-v2/modules/SwatchRow.js`
22+
- Targeted search confirmed no remaining `swatch-details` references in Palette Manager JS/CSS.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
docs/dev/reports/PR_26124_040_report.md
1+
docs/dev/reports/PR_26124_041_report.md
2+
tools/palette-manager-v2/modules/SwatchRow.js
23
tools/palette-manager-v2/paletteManagerV2.css

docs/dev/reports/codex_review.diff

Lines changed: 181 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,126 @@
1+
diff --git a/tools/palette-manager-v2/modules/SwatchRow.js b/tools/palette-manager-v2/modules/SwatchRow.js
2+
index 83bc8fd5..092ff1ee 100644
3+
--- a/tools/palette-manager-v2/modules/SwatchRow.js
4+
+++ b/tools/palette-manager-v2/modules/SwatchRow.js
5+
@@ -9,6 +9,7 @@ export class SwatchRow {
6+
const chip = documentRef.createElement("span");
7+
chip.className = "palette-manager-v2__swatch-chip";
8+
chip.style.background = swatch.hex;
9+
+ chip.title = SwatchRow.createTooltipText(swatch);
10+
11+
const copy = documentRef.createElement("div");
12+
copy.className = "palette-manager-v2__swatch-copy";
13+
@@ -23,6 +24,7 @@ export class SwatchRow {
14+
15+
const tack = SwatchRow.createTackButton(documentRef, options);
16+
17+
+ row.title = SwatchRow.createTooltipText(swatch);
18+
row.append(chip, copy, tack);
19+
if (typeof options.onSelect === "function") {
20+
row.addEventListener("click", options.onSelect);
21+
@@ -56,7 +58,7 @@ export class SwatchRow {
22+
tile.setAttribute("role", "button");
23+
tile.setAttribute("aria-label", options.ariaLabel || `Select ${swatch.name}`);
24+
tile.style.setProperty("--swatch-color", swatch.hex);
25+
- tile.title = `${swatch.name}\n${swatch.symbol}\n${swatch.hex}\n${swatch.source}`;
26+
+ tile.title = SwatchRow.createTooltipText(swatch);
27+
tile.addEventListener("click", () => {
28+
if (typeof options.onSelect === "function") {
29+
options.onSelect();
30+
@@ -82,12 +84,19 @@ export class SwatchRow {
31+
const tack = SwatchRow.createTackButton(documentRef, options);
32+
tack.classList.add("palette-manager-v2__pin-button--tile");
33+
34+
- const details = SwatchRow.createDetailsBlock(documentRef, swatch, "palette-manager-v2__swatch-details");
35+
-
36+
- tile.append(chip, tack, details);
37+
+ tile.append(chip, tack);
38+
return tile;
39+
}
40+
41+
+ static createTooltipText(swatch) {
42+
+ return [
43+
+ `Name: ${swatch.name}`,
44+
+ `Symbol: ${swatch.symbol}`,
45+
+ `Hex: ${swatch.hex}`,
46+
+ `Source: ${swatch.source}`
47+
+ ].join("\n");
48+
+ }
49+
+
50+
static createDetailsBlock(documentRef, swatch, className) {
51+
const details = documentRef.createElement("dl");
52+
details.className = className;
153
diff --git a/tools/palette-manager-v2/paletteManagerV2.css b/tools/palette-manager-v2/paletteManagerV2.css
2-
index 2e18c3e1..50dd4dce 100644
54+
index 2e18c3e1..33195c49 100644
355
--- a/tools/palette-manager-v2/paletteManagerV2.css
456
+++ b/tools/palette-manager-v2/paletteManagerV2.css
5-
@@ -32,6 +32,8 @@
57+
@@ -32,35 +32,14 @@
658
}
759

860
.palette-manager-v2__panel--center {
9-
+ height: 100%;
10-
+ min-height: 0;
11-
display: flex;
12-
flex-direction: column;
13-
gap: 14px;
14-
@@ -39,26 +41,7 @@
15-
}
16-
17-
.palette-manager-v2__panel--center .palette-manager-v2__accordion {
1861
- display: flex;
1962
- flex-direction: column;
20-
- min-height: 0;
21-
-}
22-
-
23-
-.palette-manager-v2__panel--center .palette-manager-v2__accordion[open] {
24-
- flex: 1 1 0;
63+
- gap: 14px;
2564
- overflow: hidden;
2665
-}
2766
-
28-
-.palette-manager-v2__panel--center .palette-manager-v2__accordion-content {
67+
-.palette-manager-v2__panel--center .palette-manager-v2__accordion {
2968
- display: flex;
30-
- flex: 1 1 0;
3169
- flex-direction: column;
70+
+ height: 100%;
3271
min-height: 0;
72+
-}
73+
-
74+
-.palette-manager-v2__panel--center .palette-manager-v2__accordion[open] {
75+
- flex: 1 1 0;
3376
- overflow: hidden;
3477
-}
3578
-
79+
-.palette-manager-v2__panel--center .palette-manager-v2__accordion-content {
80+
display: flex;
81+
- flex: 1 1 0;
82+
flex-direction: column;
83+
- min-height: 0;
84+
+ gap: 14px;
85+
overflow: hidden;
86+
}
87+
3688
-.palette-manager-v2__panel--center .palette-manager-v2__accordion-content > :not(.palette-manager-v2__tile-grid) {
3789
- flex: 0 0 auto;
90+
-}
91+
-
92+
.palette-manager-v2__accordion {
93+
border: 1px solid var(--line, rgba(221, 214, 254, 0.26));
94+
border-radius: 8px;
95+
@@ -129,13 +108,9 @@
96+
grid-template-columns: 1fr;
3897
}
3998

40-
.palette-manager-v2__accordion {
41-
@@ -189,15 +172,6 @@
99+
-.palette-manager-v2__controls {
100+
- display: flex;
101+
- flex-wrap: wrap;
102+
- gap: 8px;
103+
-}
104+
-
105+
-.palette-manager-v2__sort-buttons {
106+
+.palette-manager-v2__controls,
107+
+.palette-manager-v2__sort-buttons,
108+
+.palette-manager-v2__size-buttons {
109+
display: flex;
110+
flex-wrap: wrap;
111+
gap: 8px;
112+
@@ -158,10 +133,7 @@
113+
}
114+
115+
.palette-manager-v2__size-buttons {
116+
- display: flex;
117+
justify-content: flex-end;
118+
- gap: 8px;
119+
- flex-wrap: wrap;
120+
}
121+
122+
.palette-manager-v2__size-button {
123+
@@ -189,32 +161,22 @@
42124
outline-offset: 2px;
43125
}
44126

@@ -54,7 +136,9 @@ index 2e18c3e1..50dd4dce 100644
54136
.palette-manager-v2__tile-grid {
55137
--swatch-tile-width: 112px;
56138
--swatch-tile-height: 108px;
57-
@@ -206,15 +180,13 @@
139+
--swatch-chip-height: 90px;
140+
--swatch-tile-padding: 8px;
141+
+
58142
display: grid;
59143
grid-template-columns: repeat(auto-fill, minmax(var(--swatch-tile-width), 1fr));
60144
gap: 10px;
@@ -71,12 +155,12 @@ index 2e18c3e1..50dd4dce 100644
71155
}
72156

73157
.palette-manager-v2__tile-grid[data-swatch-size="small"] {
74-
@@ -239,12 +211,13 @@
158+
@@ -239,12 +201,13 @@
75159
}
76160

77161
.palette-manager-v2__tile-grid--user {
78162
- max-height: none;
79-
+ max-height: clamp(220px, 28vh, 360px);
163+
+ max-height: clamp(180px, 24vh, 320px);
80164
overflow-y: auto;
81165
}
82166

@@ -87,29 +171,88 @@ index 2e18c3e1..50dd4dce 100644
87171
}
88172

89173
.palette-manager-v2__swatch-row {
90-
diff --git a/docs/dev/reports/PR_26124_040_report.md b/docs/dev/reports/PR_26124_040_report.md
174+
@@ -302,20 +265,17 @@
175+
overflow-wrap: anywhere;
176+
}
177+
178+
-.palette-manager-v2__swatch-meta,
179+
-.palette-manager-v2__swatch-details {
180+
+.palette-manager-v2__swatch-meta {
181+
display: grid;
182+
grid-template-columns: auto minmax(0, 1fr);
183+
gap: 2px 8px;
184+
}
185+
186+
-.palette-manager-v2__swatch-meta dt,
187+
-.palette-manager-v2__swatch-details dt {
188+
+.palette-manager-v2__swatch-meta dt {
189+
font-weight: 700;
190+
}
191+
192+
-.palette-manager-v2__swatch-meta dd,
193+
-.palette-manager-v2__swatch-details dd {
194+
+.palette-manager-v2__swatch-meta dd {
195+
min-width: 0;
196+
margin: 0;
197+
overflow-wrap: anywhere;
198+
@@ -393,32 +353,6 @@
199+
right: 6px;
200+
}
201+
202+
-.palette-manager-v2__swatch-details {
203+
- display: none;
204+
- position: absolute;
205+
- top: calc(100% + 8px);
206+
- left: 0;
207+
- z-index: 30;
208+
- width: max(100%, 150px);
209+
- box-sizing: border-box;
210+
- margin: 0;
211+
- border: 1px solid rgba(255, 255, 255, 0.24);
212+
- border-radius: 6px;
213+
- background: rgba(0, 0, 0, 0.88);
214+
- color: #ffffff;
215+
- font-size: 0.88rem;
216+
- line-height: 1.35;
217+
- padding: 8px;
218+
- overflow-wrap: anywhere;
219+
- box-shadow: 0 14px 28px rgba(0, 0, 0, 0.36);
220+
-}
221+
-
222+
-.palette-manager-v2__swatch-tile:hover .palette-manager-v2__swatch-details,
223+
-.palette-manager-v2__swatch-tile:focus .palette-manager-v2__swatch-details,
224+
-.palette-manager-v2__swatch-tile:focus-within .palette-manager-v2__swatch-details {
225+
- display: grid;
226+
-}
227+
-
228+
.palette-manager-v2__json-preview {
229+
min-height: 220px;
230+
max-height: 420px;
231+
diff --git a/docs/dev/reports/PR_26124_041_report.md b/docs/dev/reports/PR_26124_041_report.md
91232
new file mode 100644
92-
index 00000000..f0ac4eaa
233+
index 00000000..5e8c7a0e
93234
--- /dev/null
94-
+++ b/docs/dev/reports/PR_26124_040_report.md
95-
@@ -0,0 +1,20 @@
96-
+# PR_26124_040 Report
235+
+++ b/docs/dev/reports/PR_26124_041_report.md
236+
@@ -0,0 +1,22 @@
237+
+# PR_26124_041 Report
97238
+
98239
+## Purpose
99-
+Increase the Palette Manager source palette grid usable height while preserving stable internal scrolling.
240+
+Remove Palette Manager swatch hover overlay boxes while preserving native tooltip information.
100241
+
101242
+## Changes
102-
+- Updated `tools/palette-manager-v2/paletteManagerV2.css` so `.palette-manager-v2__tile-grid--source` uses `max-height: clamp(360px, 48vh, 620px);`.
103-
+- Kept the User Palette grid stable at `max-height: clamp(220px, 28vh, 360px);`.
104-
+- Left the center panel accordion flow unchanged; no flex-fill accordion behavior was added.
243+
+- Removed creation of `.palette-manager-v2__swatch-details` hover detail panels from swatch tiles.
244+
+- Removed CSS rules for `.palette-manager-v2__swatch-details` and its hover/focus display behavior.
245+
+- Added centralized native tooltip text with name, symbol, hex, and source.
246+
+- Applied tooltip text to swatch rows, row chips, and swatch tiles.
105247
+
106248
+## Scope Checks
107-
+- Runtime/data logic unchanged.
108-
+- JSON behavior unchanged.
249+
+- Tile size behavior unchanged.
250+
+- Sort behavior unchanged.
251+
+- Pin/thumbtack behavior unchanged.
252+
+- Scroll behavior unchanged.
253+
+- JSON structure and palette logic unchanged.
109254
+- `tools/shared` unchanged.
110-
+- No workspace, toolState, or session logic added.
111255
+
112256
+## Validation
113-
+- CSS/manual validation: confirmed the source grid keeps `overflow-y: auto`, the base tile grid keeps `overflow-x: visible`, and the user grid retains its previous stable viewport behavior.
114-
+- CSS/manual validation: confirmed center accordion content remains in normal grid flow and no center-panel open-accordion flex-fill rule was introduced.
115-
+- `git diff --check -- tools/palette-manager-v2/paletteManagerV2.css` passed with only the existing Git LF/CRLF warning.
257+
+- `node --check tools/palette-manager-v2/modules/SwatchRow.js`
258+
+- Targeted search confirmed no remaining `swatch-details` references in Palette Manager JS/CSS.

tools/palette-manager-v2/modules/SwatchRow.js

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export class SwatchRow {
99
const chip = documentRef.createElement("span");
1010
chip.className = "palette-manager-v2__swatch-chip";
1111
chip.style.background = swatch.hex;
12+
chip.title = SwatchRow.createTooltipText(swatch);
1213

1314
const copy = documentRef.createElement("div");
1415
copy.className = "palette-manager-v2__swatch-copy";
@@ -23,6 +24,7 @@ export class SwatchRow {
2324

2425
const tack = SwatchRow.createTackButton(documentRef, options);
2526

27+
row.title = SwatchRow.createTooltipText(swatch);
2628
row.append(chip, copy, tack);
2729
if (typeof options.onSelect === "function") {
2830
row.addEventListener("click", options.onSelect);
@@ -56,7 +58,7 @@ export class SwatchRow {
5658
tile.setAttribute("role", "button");
5759
tile.setAttribute("aria-label", options.ariaLabel || `Select ${swatch.name}`);
5860
tile.style.setProperty("--swatch-color", swatch.hex);
59-
tile.title = `${swatch.name}\n${swatch.symbol}\n${swatch.hex}\n${swatch.source}`;
61+
tile.title = SwatchRow.createTooltipText(swatch);
6062
tile.addEventListener("click", () => {
6163
if (typeof options.onSelect === "function") {
6264
options.onSelect();
@@ -82,12 +84,19 @@ export class SwatchRow {
8284
const tack = SwatchRow.createTackButton(documentRef, options);
8385
tack.classList.add("palette-manager-v2__pin-button--tile");
8486

85-
const details = SwatchRow.createDetailsBlock(documentRef, swatch, "palette-manager-v2__swatch-details");
86-
87-
tile.append(chip, tack, details);
87+
tile.append(chip, tack);
8888
return tile;
8989
}
9090

91+
static createTooltipText(swatch) {
92+
return [
93+
`Name: ${swatch.name}`,
94+
`Symbol: ${swatch.symbol}`,
95+
`Hex: ${swatch.hex}`,
96+
`Source: ${swatch.source}`
97+
].join("\n");
98+
}
99+
91100
static createDetailsBlock(documentRef, swatch, className) {
92101
const details = documentRef.createElement("dl");
93102
details.className = className;

0 commit comments

Comments
 (0)