Skip to content

feat: multi-layer data table, shared rendering architecture, and cross-cutting fixes [PR7] - #3763

Draft
BRaimbault wants to merge 8 commits into
feat/datatable-pr6-new-filtersfrom
feat/datatable-pr7-refinements
Draft

BRaimbault wants to merge 8 commits into
feat/datatable-pr6-new-filtersfrom
feat/datatable-pr7-refinements

Conversation

@BRaimbault

Copy link
Copy Markdown
Collaborator

Split out from the original feat/datatable-pr7-multilayer, which bundled this together with the Combined data table. This half is everything not strictly Combined-specific, including groundwork built in preparation for it:

  • Multi-layer support: openIds replaces the old single active-layer id, with isPanelVisible and activeLayerId now persisted in Redux so closing and reopening the panel (or the menu-bar Data Table shortcut) restores exactly what was open and which tab was active, instead of resetting.
  • LayerSelectorControl replaces the old single-name display with a dropdown covering every eligible layer.
  • Shared rendering/interaction architecture extracted for reuse by the upcoming Combined table: CellValue/SelectionCheckboxColumn/ SortableColumnHeader components, useSortState/useRowClickSelection/ useRowContextMenuHighlight hooks, and a shared cell-text formatter (util/cellValue.js) with a unified "-" placeholder for empty values.
  • getNextSorting gained a defaultSortField/defaultSortDirection option so a column's third click resets to the table's actual default sort instead of an unsorted state.
  • Selection now survives closing the data table or switching layer tabs, instead of clearing.
  • Per-layer "clear filters" action added directly to each layer's map toolbar (FilterActiveIcon, LayerToolbar).
  • Event layer: incremental "top-up" loading of newly-visible columns instead of a full reload when more columns need to display.
  • Tracked entity layer: resolve option-set-coded values to display names for the data table's categorical columns.
  • Various smaller fixes carried over from the original branch: row sorting/selection cleanup, column picker onChange now takes the caller (not an internal layerId+dispatch), row-count digit grouping, org unit id casing.

Implements DHIS2-XXXX

@dhis2-bot

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://pr-3763.maps.netlify.dhis2.org

@dhis2-bot
dhis2-bot temporarily deployed to netlify September 7, 2026 15:32 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 7, 2026 19:33 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 7, 2026 19:44 Inactive
@BRaimbault BRaimbault changed the title feat: multi-layer data table, shared rendering architecture, and cross-cutting fixes feat: multi-layer data table, shared rendering architecture, and cross-cutting fixes [PR7] Sep 8, 2026
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 8, 2026 14:42 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 8, 2026 16:02 Inactive
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 8, 2026 16:08 Inactive
@BRaimbault
BRaimbault added this pull request to stack #3765 September 9, 2026 08:35
@BRaimbault
BRaimbault force-pushed the feat/datatable-pr7-refinements branch from 41bc652 to 9534ce2 Compare September 9, 2026 08:36
@dhis2-bot
dhis2-bot temporarily deployed to netlify September 9, 2026 08:38 Inactive
BRaimbault and others added 8 commits September 10, 2026 14:49
…s-cutting fixes

Split out from the original feat/datatable-pr7-multilayer, which bundled
this together with the Combined data table. This half is everything not
strictly Combined-specific, including groundwork built in preparation for
it:

- Multi-layer support: openIds replaces the old single active-layer id,
  with isPanelVisible and activeLayerId now persisted in Redux so closing
  and reopening the panel (or the menu-bar Data Table shortcut) restores
  exactly what was open and which tab was active, instead of resetting.
- LayerSelectorControl replaces the old single-name display with a
  dropdown covering every eligible layer.
- Shared rendering/interaction architecture extracted for reuse by the
  upcoming Combined table: CellValue/SelectionCheckboxColumn/
  SortableColumnHeader components, useSortState/useRowClickSelection/
  useRowContextMenuHighlight hooks, and a shared cell-text formatter
  (util/cellValue.js) with a unified "-" placeholder for empty values.
- getNextSorting gained a defaultSortField/defaultSortDirection option so
  a column's third click resets to the table's actual default sort
  instead of an unsorted state.
- Selection now survives closing the data table or switching layer tabs,
  instead of clearing.
- Per-layer "clear filters" action added directly to each layer's map
  toolbar (FilterActiveIcon, LayerToolbar).
- Event layer: incremental "top-up" loading of newly-visible columns
  instead of a full reload when more columns need to display.
- Tracked entity layer: resolve option-set-coded values to display names
  for the data table's categorical columns.
- Various smaller fixes carried over from the original branch: row
  sorting/selection cleanup, column picker onChange now takes the caller
  (not an internal layerId+dispatch), row-count digit grouping, org unit
  id casing.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
buildKnownOrgUnitNames(rows = []) only falls back to [] for
undefined - useTableData passes it dataWithAggregations, which is
null whenever a layer has no valid rows (e.g. an org-unit-based
layer whose selected units have no coordinates), so rows.forEach
crashed instead of showing the "no valid data" message. Found by
smoke-testing the data table with a facility layer that had 0
matching rows.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ActiveLayerControl and RowCells were superseded by LayerSelectorControl
and the inline CellValue-based row rendering respectively, but the
files themselves were never deleted since this branch started fresh
from PR6 rather than from the already-cleaned-up squash.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Adds coverage for setMapBounds, toggleShowOnlyFeaturesInView,
setSelectionFilter, setHighlightColor, and setDataTableColumnConfig,
plus the trackedEntityLoader default export's orchestration and
applyParsedConfig's dataTableColumnConfig branch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The rows memo's own !headers.length guard could never run: getting
past the earlier errorCode.current check already guarantees headers
is non-empty, since the headers memo sets that same error code and
returns null whenever it isn't.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@BRaimbault
BRaimbault force-pushed the feat/datatable-pr7-refinements branch from 9534ce2 to 7e387fd Compare September 10, 2026 12:49
@sonarqubecloud

Copy link
Copy Markdown

@dhis2-bot
dhis2-bot temporarily deployed to netlify September 10, 2026 12:51 Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants