Skip to content

Commit 917bcb7

Browse files
author
DavidQ
committed
Remove original sort option from source palette and default to hue sorting - PR_26124_032-remove-original-sort-option
1 parent 442f06a commit 917bcb7

6 files changed

Lines changed: 95 additions & 104 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# PR_26124_032 Remove Original Sort Option Report
2+
3+
## Scope
4+
- Removed the `Original` source palette sort option.
5+
- Kept Palette Manager controls class-based.
6+
- Did not modify stored palette swatch order, schemas, sample JSON, games, or tools/shared.
7+
8+
## Changes
9+
- Removed `original` from `PaletteSortService` sort modes and sort bypass checks.
10+
- Source palette sort buttons now render directly from the remaining sort mode labels.
11+
- Palette Manager initial sort state now uses `hue` so Hue is the default active source sort.
12+
13+
## Validation
14+
- `node --check tools/common/PaletteSortService.js`
15+
- `node --check tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js`
16+
- `node --check tools/palette-manager-v2/modules/PaletteManagerApp.js`
17+
- `rg "original|Original" tools/common/PaletteSortService.js tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js tools/palette-manager-v2/controls/UserPaletteControl.js tools/palette-manager-v2/modules/PaletteManagerApp.js`
18+
19+
## Packaging
20+
- Delta ZIP: `tmp/PR_26124_032-remove-original-sort-option_delta.zip`
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
docs/dev/reports/PR_26124_031_report.md
2-
tools/palette-manager-v2/modules/SwatchRow.js
3-
tools/palette-manager-v2/paletteManagerV2.css
1+
docs/dev/reports/PR_26124_032_report.md
2+
tools/common/PaletteSortService.js
3+
tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js
4+
tools/palette-manager-v2/modules/PaletteManagerApp.js

docs/dev/reports/codex_review.diff

Lines changed: 66 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,82 @@
1-
diff --git a/tools/palette-manager-v2/modules/SwatchRow.js b/tools/palette-manager-v2/modules/SwatchRow.js
2-
index 2670eb99..6e66e66e 100644
3-
--- a/tools/palette-manager-v2/modules/SwatchRow.js
4-
+++ b/tools/palette-manager-v2/modules/SwatchRow.js
5-
@@ -31,9 +31,6 @@ export class SwatchRow {
1+
diff --git a/tools/common/PaletteSortService.js b/tools/common/PaletteSortService.js
2+
index 338b7ad2..f9db35d4 100644
3+
--- a/tools/common/PaletteSortService.js
4+
+++ b/tools/common/PaletteSortService.js
5+
@@ -1,5 +1,4 @@
6+
const PALETTE_SORT_MODES = Object.freeze([
7+
- Object.freeze({ value: "original", label: "Original / source order" }),
8+
Object.freeze({ value: "hue", label: "Hue" }),
9+
Object.freeze({ value: "saturation", label: "Saturation" }),
10+
Object.freeze({ value: "brightness", label: "Brightness" }),
11+
@@ -92,7 +91,7 @@ export class PaletteSortService {
612
}
713

8-
static createSourceTile(documentRef, swatch, options = {}) {
9-
- const entry = documentRef.createElement("div");
10-
- entry.className = "palette-manager-v2__source-entry";
11-
-
12-
const tile = documentRef.createElement("div");
13-
tile.className = "palette-manager-v2__source-tile";
14-
tile.tabIndex = 0;
15-
@@ -68,9 +65,8 @@ export class SwatchRow {
14+
sortSwatches(swatches, mode) {
15+
- if (!this.isValidSortMode(mode) || mode === "original") {
16+
+ if (!this.isValidSortMode(mode)) {
17+
return Array.isArray(swatches) ? swatches.slice() : [];
18+
}
1619

17-
const details = SwatchRow.createDetailsBlock(documentRef, swatch, "palette-manager-v2__source-details");
18-
19-
- tile.append(chip, tack);
20-
- entry.append(tile, details);
21-
- return entry;
22-
+ tile.append(chip, tack, details);
23-
+ return tile;
20+
@@ -106,7 +105,7 @@ export class PaletteSortService {
2421
}
2522

26-
static createDetailsBlock(documentRef, swatch, className) {
27-
diff --git a/tools/palette-manager-v2/paletteManagerV2.css b/tools/palette-manager-v2/paletteManagerV2.css
28-
index b2eae3b0..11f536b2 100644
29-
--- a/tools/palette-manager-v2/paletteManagerV2.css
30-
+++ b/tools/palette-manager-v2/paletteManagerV2.css
31-
@@ -161,18 +161,6 @@
32-
padding-bottom: 150px;
33-
}
34-
35-
-.palette-manager-v2__source-entry {
36-
- position: relative;
37-
- min-width: 0;
38-
- display: grid;
39-
- z-index: 1;
40-
-}
41-
-
42-
-.palette-manager-v2__source-entry:hover,
43-
-.palette-manager-v2__source-entry:focus-within {
44-
- z-index: 20;
45-
-}
46-
-
47-
.palette-manager-v2__swatch-row {
48-
display: grid;
49-
grid-template-columns: 36px minmax(0, 1fr) 42px;
50-
@@ -284,7 +272,15 @@
51-
background: var(--surface-inline, rgba(25, 12, 55, 0.74));
52-
cursor: pointer;
53-
padding: 8px;
54-
- overflow: hidden;
55-
+ overflow: visible;
56-
+ z-index: 1;
57-
+}
58-
+
59-
+.palette-manager-v2__source-tile:hover,
60-
+.palette-manager-v2__source-tile:focus,
61-
+.palette-manager-v2__source-tile:focus-within {
62-
+ z-index: 20;
63-
+ box-shadow: 0 0 0 2px rgba(221, 214, 254, 0.34), 0 12px 24px rgba(0, 0, 0, 0.28);
64-
}
65-
66-
.palette-manager-v2__source-tile:focus-visible {
67-
@@ -314,6 +310,8 @@
68-
left: 0;
69-
z-index: 30;
70-
width: 100%;
71-
+ box-sizing: border-box;
72-
+ margin: 0;
73-
border: 1px solid rgba(255, 255, 255, 0.24);
74-
border-radius: 6px;
75-
background: rgba(0, 0, 0, 0.88);
76-
@@ -325,8 +323,9 @@
77-
box-shadow: 0 14px 28px rgba(0, 0, 0, 0.36);
78-
}
79-
80-
-.palette-manager-v2__source-entry:hover .palette-manager-v2__source-details,
81-
-.palette-manager-v2__source-entry:focus-within .palette-manager-v2__source-details {
82-
+.palette-manager-v2__source-tile:hover .palette-manager-v2__source-details,
83-
+.palette-manager-v2__source-tile:focus .palette-manager-v2__source-details,
84-
+.palette-manager-v2__source-tile:focus-within .palette-manager-v2__source-details {
85-
display: grid;
86-
}
23+
sortRows(rows, mode) {
24+
- if (!this.isValidSortMode(mode) || mode === "original") {
25+
+ if (!this.isValidSortMode(mode)) {
26+
return Array.isArray(rows) ? rows.slice() : [];
27+
}
8728

88-
diff --git a/docs/dev/reports/PR_26124_031_report.md b/docs/dev/reports/PR_26124_031_report.md
29+
diff --git a/tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js b/tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js
30+
index c8761215..d377ca06 100644
31+
--- a/tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js
32+
+++ b/tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js
33+
@@ -66,7 +66,7 @@ export class SourcePaletteBrowserControl {
34+
button.type = "button";
35+
button.className = "palette-manager-v2__sort-button";
36+
button.dataset.sortMode = mode.value;
37+
- button.textContent = mode.value === "original" ? "Original" : mode.label;
38+
+ button.textContent = mode.label;
39+
button.addEventListener("click", () => {
40+
this.app.setSourceSortMode(mode.value);
41+
});
42+
diff --git a/tools/palette-manager-v2/modules/PaletteManagerApp.js b/tools/palette-manager-v2/modules/PaletteManagerApp.js
43+
index 86b164c4..59180d5c 100644
44+
--- a/tools/palette-manager-v2/modules/PaletteManagerApp.js
45+
+++ b/tools/palette-manager-v2/modules/PaletteManagerApp.js
46+
@@ -65,8 +65,8 @@ export class PaletteManagerApp {
47+
selectedUserIndex: -1,
48+
sourcePaletteId: this.sourcePaletteIds[0] || "",
49+
sourceSearch: "",
50+
- userSortMode: "original",
51+
- sourceSortMode: "original",
52+
+ userSortMode: "hue",
53+
+ sourceSortMode: "hue",
54+
errors: [],
55+
status: "Ready."
56+
};
57+
diff --git a/docs/dev/reports/PR_26124_032_report.md b/docs/dev/reports/PR_26124_032_report.md
8958
new file mode 100644
90-
index 00000000..5bd33718
59+
index 00000000..83801cde
9160
--- /dev/null
92-
+++ b/docs/dev/reports/PR_26124_031_report.md
93-
@@ -0,0 +1,18 @@
94-
+# PR_26124_031 Palette Hover Overlay No Layout Shift Report
61+
+++ b/docs/dev/reports/PR_26124_032_report.md
62+
@@ -0,0 +1,20 @@
63+
+# PR_26124_032 Remove Original Sort Option Report
9564
+
9665
+## Scope
97-
+- Updated Palette Manager V2 source swatch hover behavior only.
98-
+- No schema, sample JSON, games, workspace, toolState, session, or tools/shared changes.
66+
+- Removed the `Original` source palette sort option.
67+
+- Kept Palette Manager controls class-based.
68+
+- Did not modify stored palette swatch order, schemas, sample JSON, games, or tools/shared.
9969
+
10070
+## Changes
101-
+- Moved source hover details into the source tile DOM node so the tile is the fixed-size positioning anchor.
102-
+- Removed the source-entry wrapper and related CSS so hover no longer introduces an extra layout surface.
103-
+- Kept hover feedback to z-index and shadow on the existing tile box.
104-
+- Kept hover details as an absolutely positioned popover below the tile, hidden outside normal document flow.
71+
+- Removed `original` from `PaletteSortService` sort modes and sort bypass checks.
72+
+- Source palette sort buttons now render directly from the remaining sort mode labels.
73+
+- Palette Manager initial sort state now uses `hue` so Hue is the default active source sort.
10574
+
10675
+## Validation
107-
+- `node --check tools/palette-manager-v2/modules/SwatchRow.js`
108-
+- `git diff --check`
76+
+- `node --check tools/common/PaletteSortService.js`
77+
+- `node --check tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js`
78+
+- `node --check tools/palette-manager-v2/modules/PaletteManagerApp.js`
79+
+- `rg "original|Original" tools/common/PaletteSortService.js tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js tools/palette-manager-v2/controls/UserPaletteControl.js tools/palette-manager-v2/modules/PaletteManagerApp.js`
10980
+
11081
+## Packaging
111-
+- Delta ZIP: `tmp/PR_26124_031-palette-hover-overlay-no-layout-shift_delta.zip`
82+
+- Delta ZIP: `tmp/PR_26124_032-remove-original-sort-option_delta.zip`

tools/common/PaletteSortService.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const PALETTE_SORT_MODES = Object.freeze([
2-
Object.freeze({ value: "original", label: "Original / source order" }),
32
Object.freeze({ value: "hue", label: "Hue" }),
43
Object.freeze({ value: "saturation", label: "Saturation" }),
54
Object.freeze({ value: "brightness", label: "Brightness" }),
@@ -92,7 +91,7 @@ export class PaletteSortService {
9291
}
9392

9493
sortSwatches(swatches, mode) {
95-
if (!this.isValidSortMode(mode) || mode === "original") {
94+
if (!this.isValidSortMode(mode)) {
9695
return Array.isArray(swatches) ? swatches.slice() : [];
9796
}
9897

@@ -106,7 +105,7 @@ export class PaletteSortService {
106105
}
107106

108107
sortRows(rows, mode) {
109-
if (!this.isValidSortMode(mode) || mode === "original") {
108+
if (!this.isValidSortMode(mode)) {
110109
return Array.isArray(rows) ? rows.slice() : [];
111110
}
112111

tools/palette-manager-v2/controls/SourcePaletteBrowserControl.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export class SourcePaletteBrowserControl {
6666
button.type = "button";
6767
button.className = "palette-manager-v2__sort-button";
6868
button.dataset.sortMode = mode.value;
69-
button.textContent = mode.value === "original" ? "Original" : mode.label;
69+
button.textContent = mode.label;
7070
button.addEventListener("click", () => {
7171
this.app.setSourceSortMode(mode.value);
7272
});

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ export class PaletteManagerApp {
6565
selectedUserIndex: -1,
6666
sourcePaletteId: this.sourcePaletteIds[0] || "",
6767
sourceSearch: "",
68-
userSortMode: "original",
69-
sourceSortMode: "original",
68+
userSortMode: "hue",
69+
sourceSortMode: "hue",
7070
errors: [],
7171
status: "Ready."
7272
};

0 commit comments

Comments
 (0)