-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[debt] Graph: consolidate state management and improve computed state #4482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- moves graph theme from GraphAppState to graph wrapper - reduces JS-based color computing - removes computing colors of CSS custom properties - renames components for clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR centralizes graph-related state into a single provider, extends the app host to accept custom providers, and offloads color computations into a lightweight wrapper using CSS color-mix()
.
- Migrate
GraphAppState
into a unifiedGraphStateProvider
with debounced context updates. - Update
GlAppHost
to support specializedStateProvider
types. - Refactor graph theming into
gl-graph-wrapper
, replacing JS color math with CSS-based mixing.
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
src/webviews/plus/graph/protocol.ts | Dropped theming from the shared protocol and simplified callback. |
src/webviews/apps/shared/components/signal-utils.ts | Extended signalState /signalObjectState with afterChange hooks. |
src/webviews/apps/shared/appHost.ts | Generalized GlAppHost to accept a Provider generic. |
src/webviews/apps/plus/graph/stateProvider.ts | Consolidated state in GraphStateProvider and added debounce logic. |
src/webviews/apps/plus/graph/graph.ts | Adapted GraphAppHost to the new provider pattern, removed legacy theming. |
src/webviews/apps/plus/graph/graph-wrapper/graph-wrapper.ts | Introduced theming wrapper with CSS mixing, removed legacy theming. |
src/webviews/apps/plus/graph/graph-wrapper/gl-graph.ts | Renamed React wrapper imports to match new naming. |
src/webviews/apps/plus/graph/graph-wrapper/gl-graph.react.tsx | Renamed GraphWrapperReact to GlGraphReact , updated props typing. |
src/webviews/apps/plus/graph/graph-header.ts | Updated header to consume the unified state provider. |
src/webviews/apps/plus/graph/graph-app.ts | Switched rendering and handlers to use graphState . |
src/system/color.ts | Added getCssMixedColorValue and getCssOpacityColorValue . |
Comments suppressed due to low confidence (1)
src/webviews/apps/plus/graph/graph-wrapper/graph-wrapper.ts:346
- Consider adding unit tests for
getCssVariableValue
andgetGraphTheming
to validate CSS variable fallbacks and dynamic theme updates, preventing regressions in theming behavior.
function getCssVariableValue(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
GraphAppState
intoGraphStateProvider
, reducing re-rendering due to duplicated state changesGlAppHost
to support more complex state providerscolor-mix()