Add defaultStyling.json support for persistent per-type vertex and edge styling#1589
Add defaultStyling.json support for persistent per-type vertex and edge styling#1589jkemmererupgrade wants to merge 7 commits into
Conversation
…ge styling Adds an optional defaultStyling.json file that can be mounted into the Docker container to provide per-type vertex and edge styling defaults. This addresses the need for persistent styling in environments where browser storage is cleared between sessions (e.g., AWS WorkSpaces Web). On startup, file values are merged into the user's per-type styling preferences (IndexedDB). Default values fill in properties the user hasn't explicitly set; existing user overrides are preserved. The file also serves as a reference for per-type "Reset to Default" in the Node/Edge Style dialogs. The Settings page adds Export/Import/Reset All styling controls: - Export: saves current styling as defaultStyling.json for sharing or Docker-mounting as team defaults - Import: merges a defaultStyling.json into user styling and updates the reset reference so reset-after-import restores imported values - Reset All: reverts all styling to defaults (from file or hardcoded) Supports lucide icon names (resolved to SVG data URIs at runtime via dynamic imports), custom icon URLs, colors, shapes, border styles, edge line styles, and arrow styles. Includes Zod validation with strict type checking for shapes and arrow styles. Includes 58 new tests with 100% line coverage on new modules, example file, and documentation. Co-Authored-By: Claude Opus 4.6 <[email protected]>
44da021 to
89910a2
Compare
Adds a searchable icon browser popover alongside the existing Upload button in the node style dialog. Users can browse ~1,900 Lucide icons with search filtering, capped at 50 visible results for performance. Icons are lazy-loaded using the existing lucideIconToDataUri helper. Co-Authored-By: Claude Opus 4.6 <[email protected]>
|
|
Add Lucide icon picker to node styling dialog
|
A note on the Lucide Licensing: |
|
@jkemmererupgrade thanks for the submission, and I apologize for the slow response. This looks like a great set of features, and they are ones I've been really wanting for myself as a user. I won't have a chance to dive in to the details until next week at the earliest. Let me know if that works for you. |
Thank you @kmcginnes! Next week is great. Please let me know what else I can do to assist. |
|
@kmcginnes checking in on the review, how's the testing going? anything I can do to help? Thank you! |
|
Hi, @jkemmererupgrade. Sorry for the slow progress on this. Bandwidth for PR reviews has been non-existent the last few weeks. I now have a backlog of PRs to go through once my availability improves. Please hang in there and thanks for checking in. |
- Resolved Changelog.md conflict: kept Unreleased defaultStyling entry above Release 3.0.1 section - Resolved node-server.ts conflict: adopted createApp() refactor from main; moved /defaultStyling and /custom-icons endpoints into app.ts - All 1680 tests pass, TypeScript checks clean Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
… feature/default-styling-1265
- Resolved Changelog.md conflict: kept Unreleased section above new Release 3.0.2 - Resolved docs/references/README.md conflict: kept Default Connection and Default Styling links - Resolved SettingsGeneral.tsx conflict: kept both defaultStylingAtom and diagnosticLoggingAtom imports - Added @vitest-environment happy-dom to PR test files that use browser globals - Added eslint-disable comments for react-hooks/set-state-in-effect in useInitCytoscape.tsx and Tabular.tsx (pre-existing intentional patterns, flagged by react-hooks v7) - All 1709 tests pass, TypeScript checks clean Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…n conventions Merge from aws/graph-explorer main (includes PR 1738 and other recent changes). Conflict resolutions: - Changelog.md: kept Unreleased feature section alongside new Release 3.0.3 section - useTabular.ts: took mains oxlint disable comments for react-table v7 patterns - configuration.ts: kept HEAD comments about defaultStyling.json; removed defensive spreads - userPreferences.ts: kept mergeDefaultsIntoUserStyling; dropped obsolete useStoredGraphPreferences Post-merge adaptations (adapt feature branch to new main conventions): - defaultStyling.test.ts, configuration.test.ts: replace if(result) guards with assert() to satisfy new oxlint no-conditional-expect rule - vite.config.ts: add custom-icons and defaultStyling to Vite dev proxy whitelist regex (PR 1738 introduced explicit whitelist; without these paths the features Express static routes 404 in dev mode) - packages/graph-explorer/package.json: remove redundant nested lint-staged config block (oxlint was not installed; root package.json lint-staged already covers all TS/JS files; the nested block caused lint-staged v16 to invoke oxlint from the package subdirectory where it treats the root .oxlintrc.json as a non-root config, triggering a typeAware error)
|
Thanks for this, there's a lot of solid work here. The icon picker, the Zod-validated styling schema, the merge logic, and the import/export UI are all capabilities we want in the project. I'd like to see this ship as a series of smaller, independently mergeable PRs so I can share some context on direction for each piece: Slice 1: Lucide icon resolver + icon picker UI Slice 2: Styling import/export/reset UI Slice 3: Server-provided default styles Each slice can go in independently and builds on the previous one. Feel free to tackle these however works best for you, whether that's narrowing this PR to slice 1, closing and reopening as separate PRs, or whatever you prefer. Architecture change:
|

Description
Add support for a defaultStyling.json file that provides persistent per-type vertex and edge styling defaults. When mounted into the Docker container, the file's values are merged into the user styling
store on startup, giving teams a consistent visual baseline across non-persistent browser sessions (e.g., AWS WorkSpaces Web).
Key capabilities:
Validation
Related Issues
Addresses #1265, #112, #173, #573, #689
Check List
pnpm checksto ensure code compiles and meets standards.pnpm testto check if all tests are passing.Changelog.md.