Skip to content

Rename styling vocabulary to Styles and reshape style types#1886

Merged
kmcginnes merged 1 commit into
mainfrom
rename-styles-vocabulary
Jul 7, 2026
Merged

Rename styling vocabulary to Styles and reshape style types#1886
kmcginnes merged 1 commit into
mainfrom
rename-styles-vocabulary

Conversation

@kmcginnes

@kmcginnes kmcginnes commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Description

Renames the *Preferences* styling vocabulary to the Styles convention and reshapes the style types around a visual base + type-only extension — a pure refactor with no behavior change. This is slice 1 of the User Default Styles epic (#1881): it establishes the vocabulary and type partition the later slices build on.

The style types now compose from two pieces:

  • VertexVisualStyle / EdgeVisualStyle — all-required visual fields (the resolved baseline a rendered entity always has, and the future type-less default).
  • VertexTypeStyle / EdgeTypeStyle — type-only fields (display label + attribute selectors).

The stored and resolved per-type models recompose from these: VertexStyleStorage / EdgeStyleStorage (Partial<Visual & Type> & { type }) and VertexStyle / EdgeStyle (Readonly<Visual & Type & { type }>). These are type-equivalent to the old *PreferencesStorageModel / *Preferences shapes — verified by pnpm check:types and the unchanged test suite.

Renamed throughout: *Preferences**Style* (types, atoms, hooks); defaultVertex/EdgePreferencesappDefaultVertex/EdgeStyle; createVertex/EdgePreferenceresolveVertex/EdgeStyle; the storage-model suffix standardizes on Storage; userPreferences.tsgraphStyles.ts. The Cytoscape intermediate render types NodeStyle / EdgeStyle become RenderedNodeStyle / RenderedEdgeStyle to free the clean domain names. Module names (NodesStyling/EdgesStyling), the "customize" verb, and all storage keys are unchanged.

Agent docs kept in sync: the CONTEXT.md styles glossary, docs/agents/testing.md, and dated addendums on two ADRs mapping old→new identifiers (decision bodies left immutable).

Stacked on #1879 (base styles-import-export). Review/merge that first; this PR's diff is only the rename.

How to read

  1. packages/graph-explorer/src/core/StateProvider/graphStyles.ts — the heart of the change: the reshaped types (visual base + type extension), the renamed appDefault*Style / resolve*Style / *StyleAtom symbols, and the cascade doc.
  2. packages/graph-explorer/src/components/Graph/Graph.model.ts — the Cytoscape NodeStyle/EdgeStyleRendered*Style rename that frees the domain names.
  3. packages/graph-explorer/src/core/ConfigurationProvider/types.ts — how VertexTypeConfig/EdgeTypeConfig compose the renamed storage models.
  4. packages/graph-explorer/src/core/StateProvider/configuration.ts — the merge that consumes them (order unchanged, just renamed types).
  5. CONTEXT.md — glossary now speaks the new code names. The rest of the diff is mechanical consumer + test renames.

Validation

  • pnpm checks passes (types + lint + format, 0 errors).
  • pnpm test passes (2037 tests / 176 files). Existing styling tests pass unchanged aside from renamed symbols.
  • Pure rename: no user-facing string, storage key, or file-format field altered; cascade resolution order preserved.

Related Issues

Check List

  • I confirm that my contribution is made under the terms of the Apache 2.0 license.
  • I have verified pnpm checks passes with no errors.
  • I have verified pnpm test passes with no failures.
  • I have covered new added functionality with unit tests if necessary.
  • I have updated documentation if necessary.

Base automatically changed from styles-import-export to main July 7, 2026 22:34
@kmcginnes kmcginnes force-pushed the rename-styles-vocabulary branch 3 times, most recently from 7bb4648 to a32fbad Compare July 7, 2026 23:05
Renames the `*Preferences*` styling vocabulary to the Styles convention and
factors the style types around the Source/Scope model, a pure refactor with no
behavior change.

Style types now compose from a visual base and a type-only extension:
`VertexVisualStyle` / `EdgeVisualStyle` (all-required, the resolved baseline)
plus `VertexTypeStyle` / `EdgeTypeStyle` (display label and attributes). The
stored and resolved per-type models recompose from these — `VertexStyleStorage`
/ `EdgeStyleStorage` (partial) and `VertexStyle` / `EdgeStyle` (resolved).

Renames throughout: `*Preferences*` -> `*Style*` types, atoms, and hooks;
`defaultVertex/EdgePreferences` -> `appDefaultVertex/EdgeStyle`;
`createVertex/EdgePreference` -> `resolveVertex/EdgeStyle`; the storage-model
suffix standardizes on `Storage`; `userPreferences.ts` -> `graphStyles.ts`.

Renames the Cytoscape intermediate render types `NodeStyle` / `EdgeStyle` to
`RenderedNodeStyle` / `RenderedEdgeStyle` to free the clean domain names.

Keeps the `NodesStyling` / `EdgesStyling` module names, the "customize" verb,
and all storage keys unchanged. Updates the CONTEXT.md styles glossary.
@kmcginnes kmcginnes force-pushed the rename-styles-vocabulary branch from a32fbad to bc21bec Compare July 7, 2026 23:17
@kmcginnes kmcginnes marked this pull request as ready for review July 7, 2026 23:18
@kmcginnes kmcginnes merged commit 24d091c into main Jul 7, 2026
6 checks passed
@kmcginnes kmcginnes deleted the rename-styles-vocabulary branch July 7, 2026 23:30
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.

Rename styling vocabulary to the Styles convention and reshape style types

1 participant