You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Skipped (out of scope): pnpm-lock.yaml, tsconfig.tsbuildinfo
Findings
⚠️ Low — computed().get() called inline in render — creates a new computed each render
File:packages/pluggableWidgets/custom-chart-web/src/hooks/useCustomChart.ts line 54–62 Note:computed(() => ({ ... })).get() is called directly in the render path on every render, which creates a throwaway ComputedAtom each time and defeats MobX memoization. Since Container is already an observer, reading store properties directly (or via a useComputed/stable ref) is sufficient. The pattern also carries no reactivity benefit since the atom is discarded immediately. Fix:
// Option A: read store props directly (observer tracks them automatically)constplaygroundData: PlaygroundData={type: "editor.data.v2",
store,plotData: store.data,layoutOptions: {},configOptions: {}};// Option B: use useMemo if reference-stability of the object mattersconstplaygroundData=useMemo<PlaygroundData>(()=>({type: "editor.data.v2", store,plotData: store.data,layoutOptions: {},configOptions: {}}),[store]);
⚠️ Low — MobX observable.box created with stale initial value
File:packages/pluggableWidgets/chart-playground-web/src/helpers/useV2EditorController.ts line 42 Note:useState(() => observable.box<ConfigKey>(key))[0] initialises the box with the value of key at first render (always "layout"). This is intentional (the box and the React state are kept in sync via onViewSelectChange), but the relationship is subtle: forgetting runInAction(() => keyBox.set(newKey)) in onViewSelectChange would silently desync the reaction. Consider deriving keyBox from a ref or a single source of truth to make the coupling explicit.
⚠️ Low — Inline style on <textarea> contradicts styling guidelines
File:packages/pluggableWidgets/chart-playground-web/src/components/CodeEditor.tsx line 15 Note: The SCSS/Atlas UI guidelines say to avoid inline styles for static design properties. The CHANGELOG notes this is a deliberate compatibility downgrade, so it is understandable in context, but the static fontFamily: "monospace" and width: "100%" should move to the existing Playground.scss or a scoped class (e.g. .widget-chart-playground-code-editor) to stay consistent with the repo conventions.
⚠️ Low — Missing CHANGELOG entries for custom-chart-web and chart-playground-web
File:packages/pluggableWidgets/custom-chart-web/CHANGELOG.md, packages/pluggableWidgets/chart-playground-web/CHANGELOG.md Note: Both packages have empty [Unreleased] sections. custom-chart-web received a meaningful behaviour change (playground now mutates layout/config/data through a central store instead of a local merge step), and chart-playground-web switched from CodeMirror to a plain textarea. Run pnpm -w changelog or add entries manually.
Positives
EditableChartStore correctly uses makeAutoObservable with explicit per-member overrides, matching the MobX patterns used elsewhere in the repo.
The V1/V2 dispatch in Playground.tsx uses Object.hasOwn rather than in or property access, which is the right way to narrow before casting.
autorun in EditableChartStore.setup() is properly returned via disposeBatch, preventing memory leaks on unmount.
Deleting mergeChartProps together with its test file keeps the test suite honest — no orphaned tests.
The reaction-based sync in useV2EditorController correctly returns the disposer from useEffect, so the reaction is cleaned up when the component unmounts.
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
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.
Pull request type
Bug fix (non-breaking change which fixes an issue)
Description
Switch to central store.