Add styling import / export / reset UI#3
Open
jkemmererupgrade wants to merge 3 commits into
Open
Conversation
This was referenced May 27, 2026
Add three buttons to the General Settings page: - Export: downloads current vertex and edge styling as graph-explorer-styling.json - Import: loads a JSON file, applies it as the live styling baseline, and stores it in defaultStylingAtom so per-type Reset on the node style dialog restores to imported values rather than application defaults - Reset All: reverts every vertex and edge to the imported baseline (or application defaults if no file has been imported this session) Introduce defaultStyling.ts with a Zod schema (DefaultStylingSchema), parseDefaultStyling, resolveDefaultStyling (converts lucide:<name> shorthand to iconUrl references established by the Lucide icon picker in PR aws#1777), and userStylingToExportFormat. The file format round-trips cleanly via lucide:<name> refs. Add mergeDefaultsIntoUserStyling to userPreferences.ts so imported baselines fill gaps for unstyled types without overwriting user customisations. Update toJsonFileData with an optional indent param (defaults unchanged) so the exported file is human-readable. Add unit tests for the schema, parse/resolve pipeline, hooks, and reset behaviour. Update docs/features/settings.md and docs/features/graph-view.md accordingly. Slice 2 of the 3-slice split of aws#1589. Stacks on aws#1777 (Lucide icon picker).
…rkers useResolvedIconUrl is no longer used after VertexIcon switched to DynamicIcon per maintainer feedback on aws#1777.
c9fa43c to
9ed29c2
Compare
|
@jkemmererupgrade It looks like I'm not allowed to change the target of this PR now that the original target is merged. Could you update it for me? |
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.
Description
Slice 2 of the 3-slice split of aws#1589 per @kmcginnes's review on that PR. This is the Styling Import / Export / Reset UI. Stacks on slice 1 (aws#1777) because it relies on the
lucide:<name>storage convention slice 1 introduces.Adds three buttons to Settings → General:
graph-explorer-styling.json, 2-space indent). Icons are written as symbolic references ("iconUrl": "lucide:plane") so the file is human-readable and version-controllable."icon": "<name>"field that gets converted to"iconUrl": "lucide:<name>"on import.The per-type Reset to Default button on
NodeStyleDialognow also restores to the imported baseline (when one exists), via a newdefaultStylingAtomreference copy and a sharedmergeDefaultsIntoUserStylinghelper.The shared
toJsonFileDatautility gets an optionalindentparameter (default: compact, to preserve existing callers' behavior). Slice 2's exporter passesindent: 2.File format notes (slice 2 ↔ aws#1660)
Slice 2's exported format is intentionally a subset of what
#1660'sstyles:section will look like — same{ vertices, edges }record-of-types shape, samelucide:<name>icon refs. When the unified config lands, a slice-2 export can drop straight into#1660understyles:.Deliberately NOT in this PR
/defaultStylingstatic route inapp.ts— that's slice 3, folded into the unified config (Unified server configuration file aws/graph-explorer#1660) per kmcginnes's direction.AppStatusLoader.tsx— slice 3.example/defaultStyling.jsonor Docker-mount docs — slice 3.Validation
pnpm run check:types— cleanpnpm run check:lint— 0 errors / 0 warnings (oxlint)pnpm run check:format— clean (oxfmt)pnpm test— 1787 / 1787 passpnpm coverage— all four thresholds met (statements 65.19%, branches 45.47%, functions 58.81%, lines 72.59%); branches floor auto-bumped from 45 → 45 (genuine improvement from new tests).lucide:<name>icon refs.Related Issues
Check List
pnpm checkspasses with no errors.pnpm testpasses with no failures.docs/features/settings.md,docs/features/graph-view.md).