Skip to content

feat: redesign toolbar and add row context menu [PR1]#3714

Draft
BRaimbault wants to merge 8 commits into
masterfrom
feat/datatable-pr1-toolbar
Draft

feat: redesign toolbar and add row context menu [PR1]#3714
BRaimbault wants to merge 8 commits into
masterfrom
feat/datatable-pr1-toolbar

Conversation

@BRaimbault

@BRaimbault BRaimbault commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Part of DHIS2-21456

Description

Replaces the 20px data table control strip with a full 36px toolbar and adds a right-click context menu to table rows. First of a series of PRs improving the data table experience.

Toolbar (BottomPanel)

  • Shows the active layer name and live row count (X of Y rows when filters are active, X rows otherwise)
  • "Clear filters" button appears when any column filter is active
  • Sort arrows in column headers now correctly reflect ascending/descending direction

Row context menu (TableContextMenu)

  • Right-click a row: drill up/down, view profile, zoom to feature
  • Drill items are hidden for boundary, facility, event, and GeoJSON URL layers
  • "View profile" opens the feature profile for GeoJSON URL layers and the org unit profile for all others

GeoJSON URL layer

  • Right-click on map features now opens the context menu (was wired only for click)
  • Map context menu: "View profile" opens the feature profile; drill up/down items are hidden
  • Shared getGeojsonFeatureProfile utility keeps the profile format consistent across map click, map context menu, and table context menu

Bug fixes

  • Feature highlight no longer lost after async layer rebuilds (thematic timeline / split-by-period, EarthEngine full rebuild path)
  • Fixed null crash in highlightFeature when the map layer has no highlight method
  • O(1) feature lookup by id in the data table (was an O(n) scan per interaction)

Quality checklist

Add N/A to items that are not applicable.

  • Dashboard tested N/A
  • Cypress and/or Jest tests added/updated
  • Docs added N/A
  • d2-ci dependencies replaced N/A
  • Tester approved (name)

Screenshots

supporting images

BRaimbault and others added 6 commits June 23, 2026 17:42
Adds clearDataFilters(layerId) action creator and the corresponding
DATA_FILTERS_CLEAR_ALL reducer case that resets dataFilters to {} for
the target layer. Used by the new "Clear filters" button in the toolbar.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Returns the total number of rows before filtering (totalCount) and
after filtering (filteredCount) so the toolbar can show "X of Y rows".

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces the 20px grey strip with a 36px toolbar that shows:
- Active layer name (truncated with ellipsis)
- Row count ("X of Y rows" when filtered, "Y rows" otherwise)
- "Clear filters" button (only visible when filters are active)
- Close button

Adds onCountChange callback prop to DataTable so BottomPanel can
display the post-filter row count without reading useTableData directly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Extends highlightFeature with an optional zoom:true flag. When a table
row is clicked (plain click, not Ctrl+click), dispatches highlightFeature
with zoom:true. Layer.js watches for this in componentDidUpdate and calls
panToFeature(), which uses getFeaturesById() to compute the feature's
bounding box and calls map.fitBounds() to pan and zoom to the feature.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@dhis2-bot

Copy link
Copy Markdown
Contributor

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

@dhis2-bot dhis2-bot temporarily deployed to netlify July 6, 2026 17:25 Inactive
@BRaimbault BRaimbault force-pushed the feat/datatable-pr1-toolbar branch from fdf69f4 to 3de8004 Compare July 6, 2026 17:31
@sonarqubecloud

sonarqubecloud Bot commented Jul 6, 2026

Copy link
Copy Markdown

@dhis2-bot dhis2-bot temporarily deployed to netlify July 6, 2026 17:39 Inactive
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