Skip to content

feat(dashboard): add legacy Table to TableNG upgrade flow - #2215

Merged
jsers merged 7 commits into
mainfrom
feat-dashboard-upgrade-table-to-NG
Aug 3, 2026
Merged

feat(dashboard): add legacy Table to TableNG upgrade flow#2215
jsers merged 7 commits into
mainfrom
feat-dashboard-upgrade-table-to-NG

Conversation

@jsers

@jsers jsers commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator
  • Add upgradeTableToNG utility to migrate panel configs
  • Show confirmation dialog when switching from table to tableNG
  • Add SeriesToRows and LabelsToFields to transformation exports
  • Add i18n keys for upgrade flow in all supported locales

Summary by CodeRabbit

  • New Features

    • Added row-detail views for TableNG tables, including navigable records, table/JSON tabs, and copy actions.
    • Added configurable column widths with drag resizing and saved settings.
    • Added optional row-detail controls and tooltips.
    • Added automatic migration options when switching legacy tables to TableNG.
    • Added support for synchronizing table overrides from previews and editable panels.
  • Bug Fixes

    • Improved handling of filtered, sorted, nested, and unserializable row data.
    • Added validation and safe recovery for invalid column-width settings.

jsers added 4 commits July 23, 2026 12:45
Replace the pure localStorage column-width cache with an overrides-based
persistence model. Drag-resizing a column now writes a byName override (via
onOverridesChange) that persists with the panel config, while localStorage
serves as a fallback for unmigrated widths.

- Extract column width utilities (getColumnWidthColDef, upsertColumnWidthOverride, etc.)
- Add 'custom.width' override option with InputNumber editor (min=100)
- Extend IOverride type with optional width and matcher.id fields
- Wire onOverridesChange through the renderer stack to parent state
- Add upgradeTableToNG utility to migrate panel configs
- Show confirmation dialog when switching from table to tableNG
- Add SeriesToRows and LabelsToFields to transformation exports
- Add i18n keys for upgrade flow in all supported locales
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 0e791984-0c35-4edf-a343-f582d64f4903

📥 Commits

Reviewing files that changed from the base of the PR and between 107b229 and 7138640.

📒 Files selected for processing (26)
  • src/pages/dashboard/Editor/Fields/Overrides/index.tsx
  • src/pages/dashboard/Editor/Form.tsx
  • src/pages/dashboard/Editor/Options/TableNG/CellOptions.tsx
  • src/pages/dashboard/Editor/Options/TableNG/GraphStyles.tsx
  • src/pages/dashboard/Editor/Options/TableNG/index.tsx
  • src/pages/dashboard/Editor/index.tsx
  • src/pages/dashboard/Panels/index.tsx
  • src/pages/dashboard/Renderer/Renderer/Main.tsx
  • src/pages/dashboard/Renderer/Renderer/Table/index.tsx
  • src/pages/dashboard/Renderer/Renderer/TableNG/RowDetailDrawer.tsx
  • src/pages/dashboard/Renderer/Renderer/TableNG/TextSearchIcon.tsx
  • src/pages/dashboard/Renderer/Renderer/TableNG/index.tsx
  • src/pages/dashboard/Renderer/Renderer/TableNG/rowDetailUtils.test.ts
  • src/pages/dashboard/Renderer/Renderer/TableNG/rowDetailUtils.ts
  • src/pages/dashboard/Renderer/Renderer/TableNG/style.less
  • src/pages/dashboard/Renderer/Renderer/TableNG/utils/columnWidth.test.ts
  • src/pages/dashboard/Renderer/Renderer/TableNG/utils/columnWidth.ts
  • src/pages/dashboard/Renderer/Renderer/index.tsx
  • src/pages/dashboard/locale/en_US.ts
  • src/pages/dashboard/locale/ja_JP.ts
  • src/pages/dashboard/locale/ru_RU.ts
  • src/pages/dashboard/locale/zh_CN.ts
  • src/pages/dashboard/locale/zh_HK.ts
  • src/pages/dashboard/types.ts
  • src/pages/dashboard/utils/upgradeTableToNG.test.ts
  • src/pages/dashboard/utils/upgradeTableToNG.ts

📝 Walkthrough

Walkthrough

The dashboard editor now supports legacy table migration to TableNG. TableNG adds persisted column-width overrides and optional row-detail drawers. Renderer callbacks synchronize overrides with editable panels. Tests and localized labels cover the new behavior.

Changes

TableNG dashboard flow

Layer / File(s) Summary
Legacy table migration
src/pages/dashboard/Editor/index.tsx, src/pages/dashboard/utils/upgradeTableToNG.ts, src/pages/dashboard/utils/upgradeTableToNG.test.ts, src/pages/dashboard/types.ts, src/pages/dashboard/Renderer/Renderer/Table/index.tsx, src/pages/dashboard/locale/*
The editor can migrate legacy tables to tableNG. The converter normalizes transformations, overrides, links, targets, and display settings.
Column-width override persistence
src/pages/dashboard/Editor/Fields/Overrides/index.tsx, src/pages/dashboard/Editor/Options/TableNG/index.tsx, src/pages/dashboard/Editor/Form.tsx, src/pages/dashboard/Panels/index.tsx, src/pages/dashboard/Renderer/Renderer/index.tsx, src/pages/dashboard/Renderer/Renderer/Main.tsx, src/pages/dashboard/Renderer/Renderer/TableNG/index.tsx, src/pages/dashboard/Renderer/Renderer/TableNG/utils/*
TableNG resolves cached and override widths, applies them to grid columns, and persists completed resize changes through editable dashboard panels.
Row-detail inspection
src/pages/dashboard/Editor/Options/TableNG/*, src/pages/dashboard/Renderer/Renderer/TableNG/*, src/pages/dashboard/locale/*
TableNG can show a row-detail trigger and open a drawer with table and JSON views, row navigation, serialization, and copy actions. Supporting styles, utilities, tests, and translations were added.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Editor
  participant upgradeTableToNG
  participant TableNG
  participant Panels
  Editor->>upgradeTableToNG: convert legacy panel
  upgradeTableToNG->>TableNG: return normalized panel
  TableNG->>Panels: persist column-width overrides
  Panels->>TableNG: update dashboard configuration
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat-dashboard-upgrade-table-to-NG

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

jsers added 3 commits July 28, 2026 10:19
- Resolve organize field names when remapping legacy link variables to
  the final transformed column, supporting ${...}, [[...]] and $__field
  syntaxes for name/value/labels placeholders.
- Build organize fields from normalized series columns in the Editor so
  the upgrade matches the preview's available fields.
- Drop value rename to "Value" in favor of "value"; keep target legend
  for labelValuesToRows overrides and multi-target value field mapping.
- Only set options.links when legacy or existing links are present.
- Remove obsolete upgrade-confirm locale keys and unused seriesToRows/
  labelsToFields transformation registrations.
Add an optional "enable row detail" switch in TableNG graph styles.
When enabled, a fixed 30px icon column is pinned to the left of the
grid; clicking the icon opens a NavigableDrawer with Table/JSON tabs
showing all fields and values of the source row, plus row/field copy
actions. Click-away outside the drawer and its popups closes it.

- New RowDetailDrawer, TextSearchIcon, rowDetailUtils (+tests)
- CellOptions gains a wrapTextExtra slot for the toggle
- Index maps formatted rows back to source rows via WeakMap and uses
  forEachNodeAfterFilterAndSort to honor current filter/sort order
- i18n updates for en/ja/ru/zh_CN/zh_HK
…-upgrade-table-to-NG

# Conflicts:
#	src/pages/dashboard/Renderer/Renderer/TableNG/index.tsx
@jsers
jsers marked this pull request as ready for review August 3, 2026 02:36
Copilot AI review requested due to automatic review settings August 3, 2026 02:36
@jsers
jsers merged commit 1b844c0 into main Aug 3, 2026
1 check was pending

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adds a legacy Table → TableNG upgrade path in the dashboard editor, and expands TableNG with column-width persistence via overrides plus an optional per-row “details drawer” experience (including i18n for all supported locales).

Changes:

  • Introduce upgradeTableToNG (+ tests) to migrate legacy Table panel config (transformations, overrides, links).
  • Add TableNG column-width utilities (+ tests) and wire column-resize to overrides persistence via an onOverridesChange callback.
  • Add TableNG row details UI (icon column, drawer, serialization utils, styling) and corresponding i18n/editor toggles.

Reviewed changes

Copilot reviewed 26 out of 26 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/pages/dashboard/utils/upgradeTableToNG.ts New migration utility to convert legacy Table panel configs to TableNG-compatible configs.
src/pages/dashboard/utils/upgradeTableToNG.test.ts Unit tests covering migration behavior and malformed historical inputs.
src/pages/dashboard/types.ts Extend override matcher compatibility (id/type) and add width support in override properties.
src/pages/dashboard/Renderer/Renderer/TableNG/utils/columnWidth.ts Column-width cache/override helpers (validation, merge, upsert, cache cleanup).
src/pages/dashboard/Renderer/Renderer/TableNG/utils/columnWidth.test.ts Tests for cache parsing, override precedence, and override upsert behavior.
src/pages/dashboard/Renderer/Renderer/TableNG/TextSearchIcon.tsx Custom icon for row detail trigger column.
src/pages/dashboard/Renderer/Renderer/TableNG/style.less Styling for TableNG row detail drawer/content and minor icon mask quoting cleanup.
src/pages/dashboard/Renderer/Renderer/TableNG/rowDetailUtils.ts Utilities for row detail selection/navigation and safe serialization.
src/pages/dashboard/Renderer/Renderer/TableNG/rowDetailUtils.test.ts Tests for serialization, displayed row ordering, and click-away ignore logic.
src/pages/dashboard/Renderer/Renderer/TableNG/RowDetailDrawer.tsx Drawer UI to view/copy row details (table view + JSON view).
src/pages/dashboard/Renderer/Renderer/TableNG/index.tsx Wire up row details, persisted column widths, and onOverridesChange resize behavior.
src/pages/dashboard/Renderer/Renderer/Table/index.tsx Ensure legacy Table preview populates global series state (used during upgrade).
src/pages/dashboard/Renderer/Renderer/Main.tsx Plumb onOverridesChange through renderer to panel components.
src/pages/dashboard/Renderer/Renderer/index.tsx Extend renderer props to accept onOverridesChange.
src/pages/dashboard/Panels/index.tsx Persist updated overrides back into dashboard/panels when authorized + editable.
src/pages/dashboard/locale/zh_HK.ts Add i18n keys for upgrade flow, column width label, and row detail strings.
src/pages/dashboard/locale/zh_CN.ts Add i18n keys for upgrade flow, column width label, and row detail strings.
src/pages/dashboard/locale/ru_RU.ts Add i18n keys for upgrade flow, column width label, and row detail strings.
src/pages/dashboard/locale/ja_JP.ts Add i18n keys for upgrade flow, column width label, and row detail strings.
src/pages/dashboard/locale/en_US.ts Add i18n keys for upgrade flow, column width label, and row detail strings.
src/pages/dashboard/Editor/Options/TableNG/index.tsx Enable TableNG overrides option for column width.
src/pages/dashboard/Editor/Options/TableNG/GraphStyles.tsx Add editor toggle for enabling TableNG row details.
src/pages/dashboard/Editor/Options/TableNG/CellOptions.tsx Add wrapTextExtra slot to extend CellOptions UI (used by row detail toggle).
src/pages/dashboard/Editor/index.tsx Add “upgrade to TableNG” confirmation modal and invoke upgradeTableToNG when chosen.
src/pages/dashboard/Editor/Form.tsx Hook preview renderer’s onOverridesChange to update form overrides live.
src/pages/dashboard/Editor/Fields/Overrides/index.tsx Add width input control for overrides when custom.width option is enabled.

Comment on lines +26 to +29
const value = JSON.parse(storage.getItem(cacheKey) || '{}');
if (!_.isPlainObject(value)) return {};

return _.pickBy(value as ColumnWidths, isValidColumnWidth);
Comment on lines +79 to +81
result.overrides = asRecordArray(result.overrides).map((override) => {
if (override.matcher?.id !== 'byFrameRefID') return override;
const targetIndex = asRecordArray(result.targets).findIndex((target) => target.refId === override.matcher.value);
Comment on lines +326 to +328
if (_.isNumber(date1Number) && _.isNumber(date2Number)) {
return date1Number - date2Number;
}
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.

2 participants