Skip to content

Conversation

@adamdoe
Copy link
Collaborator

@adamdoe adamdoe commented Dec 20, 2025

This pull request refactors the EditorPanel component in the chart package to use the shared EditorPanel base component from @cdc/core, and cleans up chart-specific logic. It also improves code readability and consistency in the UI, particularly in tooltip and markup formatting.

Component refactor and architecture:

  • Replaces the custom EditorPanel implementation in packages/chart/src/components/EditorPanel/EditorPanel.tsx with the shared EditorPanel (BaseEditorPanel) from @cdc/core/components/EditorPanel/EditorPanel, removing the dependency on the Layout and ErrorBoundary components and updating the render logic accordingly. [1] [2]
  • Moves chart-specific logic (such as convertStateToConfig) into a custom function and passes it to the base panel as needed, ensuring chart requirements (like handling newViz field) are preserved.

Code cleanup and state management:

  • Removes unused state (displayPanel) and the associated onBackClick handler, simplifying the component’s state management. [1] [2]
  • Removes the previous convertStateToConfig and related useEffect, centralizing the config transformation logic.

UI and markup consistency:

These changes streamline the component, promote code reuse, and improve maintainability and user interface consistency.

- Creas BaseEditorPanel component to @cdc/core
- Update all EditorPanel implementations to extend from BaseEditorPanel
- Remove redundant styles and logic from individual EditorPanel components
- Simplify imports and exports for EditorPanel components across packages
- Create hooks for common data handling patterns
- Improved state management in Header component
@adamdoe adamdoe force-pushed the enhancement/standardize-editor-panel branch from 2058741 to 7684c84 Compare December 22, 2025 21:40
Copy link
Collaborator

@jayb jayb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks & works great. There's one rogue console.log for "[VisualSection] Rendering with config".

A couple questions about the new hooks in core, but these are just things to consider and you know best.

  • There are still some definitions/references for getColumns sprinkled around. Should those be changed to use useDataColumns, or are they different and need to be kept?
  • It looks like useListManagement is only being used in once place; are there more opportunities? If we're going to generalize it, it feels like it should be used more than once.

@adamdoe adamdoe merged commit 1f49b26 into dev Jan 2, 2026
3 checks passed
@adamdoe adamdoe deleted the enhancement/standardize-editor-panel branch January 2, 2026 18:56
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.

3 participants