feat(ui/colors): improve multi-color hex editing and spool/filament previews#863
Open
akira69 wants to merge 5 commits intoDonkie:masterfrom
Open
feat(ui/colors): improve multi-color hex editing and spool/filament previews#863akira69 wants to merge 5 commits intoDonkie:masterfrom
akira69 wants to merge 5 commits intoDonkie:masterfrom
Conversation
…ormatting - Created src/utils/colorFormatting.ts with normalizeHex() function - Moved design comment to utility JSDoc explaining canonical color format reasoning - Updated colorHexPreview.tsx to import and use shared normalizeHex - Updated multiColorPicker.tsx to import shared normalizeHex - Extracted swatchStyle constant for reuse in color swatches - All code quality checks pass: ESLint ✓, Prettier ✓
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Improve filament and spool color previews, make multi-color hex values easier to read while editing, and carry forward the shared malformed-saved-state recovery that was dropped during restacking.
What Changed
ColorHexPreviewso filament and spool show pages render color chips and canonical uppercase hex values the same way.useSavedStateguard inclient/src/utils/saveload.tsso malformedsavedStates-*entries fall back cleanly instead of crashing the page.Screenshots
Filament edit: single-color + multi-color modes
Filament show: color/hex preview
Spool show: color/hex preview
Testing Performed
cd client && ./node_modules/.bin/eslint src/components/colorHexPreview.tsx src/components/multiColorPicker.tsx src/pages/filaments/edit.tsx src/pages/filaments/show.tsx src/pages/spools/show.tsx src/utils/colorFormatting.ts src/utils/saveload.tsclient/node_modules/.bin/prettier --check client/src/components/colorHexPreview.tsx client/src/components/multiColorPicker.tsx client/src/pages/filaments/edit.tsx client/src/pages/filaments/show.tsx client/src/pages/spools/show.tsx client/src/utils/colorFormatting.ts client/src/utils/saveload.tscd client && VITE_APIURL=/api/v1 npm run buildPATH=.venv/bin:$PATH SPOOLMAN_DIR_DATA=/tmp/spoolman_pr_863_data uv run uvicorn spoolman.main:app --host 0.0.0.0 --port 9863http://localhost:9863with local seeded vendor/filament/spool data:localStorage["savedStates-spoolList-showArchived"] = "{bad json"and reloaded/spool; the page still rendered and the saved value recovered tofalse.Test Checklist
/spoolno longer white-screens the page