Skip to content

Add defaultStyling.json support for persistent per-type vertex and edge styling#1589

Open
jkemmererupgrade wants to merge 1 commit intoaws:mainfrom
jkemmererupgrade:feature/default-styling-1265
Open

Add defaultStyling.json support for persistent per-type vertex and edge styling#1589
jkemmererupgrade wants to merge 1 commit intoaws:mainfrom
jkemmererupgrade:feature/default-styling-1265

Conversation

@jkemmererupgrade
Copy link

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:

  • Docker mount: Place a defaultStyling.json at the configuration folder path to auto-apply styling on load
  • Lucide icon support: Reference icons by name (e.g., "icon": "user") — resolved to SVG data URIs at runtime
  • Import / Export / Reset UI: New controls in Settings to import a styling file, export current styling, and reset all styling to defaults
  • Per-type Reset to Default: Each node/edge type's style dialog has a "Reset to Default" button that restores the mounted file's values
  • Zod validation: Strict schema validation with clear error logging for malformed files

Validation

  • All 1365 tests pass (pnpm test)
  • pnpm checks passes (lint, format, types)
  • Docker tested with mounted defaultStyling.json — styling applied on startup, import/export/reset all functional
  • Incognito window testing confirmed clean-state behavior
  • New unit tests cover: Zod parsing, icon resolution, import/export hooks, merge logic, configuration integration
Screenshot 2026-03-10 at 2 09 40 PM Screenshot 2026-03-10 at 2 04 31 PM

Related Issues

Addresses #1265, #112, #173, #573, #689

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have run pnpm checks to ensure code compiles and meets standards.
  • I have run pnpm test to check if all tests are passing.
  • I have covered new added functionality with unit tests if necessary.
  • I have added an entry in the Changelog.md.

…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 <noreply@anthropic.com>
@jkemmererupgrade jkemmererupgrade force-pushed the feature/default-styling-1265 branch from 44da021 to 89910a2 Compare March 12, 2026 14:33
@jkemmererupgrade
Copy link
Author

I also have a follow-on PR that will add a picker to the vertex/edge to filter and select one of the lucide icons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant