Skip to content

New column chooser - #861

Open
haynesjm42 wants to merge 34 commits into
developfrom
new-column-chooser
Open

New column chooser#861
haynesjm42 wants to merge 34 commits into
developfrom
new-column-chooser

Conversation

@haynesjm42

@haynesjm42 haynesjm42 commented Jun 4, 2026

Copy link
Copy Markdown
Member

Toolbox demos for the redesigned Column Chooser. Pairs with xh/hoist-react#4409.

What's here

Grids › Column Chooser (desktop/tabs/grids/ColumnChooserPanel.ts) - the primary example. A sales-rep grid with nested column groups, a hideable: false locked column, chooserDescription tooltips, and chooserGroups for the Column Library. Wrapper options drive every chooser config live - lockColumnGroups, enableColumnPinning, per-presentation commitOnChange / width / height, dock side, Library enable / collapseGroups / libraryWidth - each rebuilding the GridModel so the effect is visible immediately. Both presentations are wired: a popover button and a docked-panel button, plus a colChooserPanel context-menu item. The docked chooser starts open.

Tests › Column Chooser (admin/tests/columnChooser/) - a stress harness. generateColumns.ts builds a hedge-fund blotter catalog sized small / medium / large (large ≈ 145 leaves) from cross-products (P&L type × period, risk measure × tenor), with chooserGroups sliced along a deliberately different axis than the visual column groups. Live column state renders beside the grid as JSON, and an Add Column dialog injects columns with arbitrary hideable / movable / pinned / excludeFromChooser settings to probe edge cases.

Supporting changes

  • Bootstrap.ts - registered ag-Grid's RowDragModule, which the new chooser requires. Also registered ValidationModule in a new development-only block, since without it AG Grid reports a missing module as a bare numeric error code. AG Grid recommends keeping it out of production builds, so the block is gated on the build-time xhIsDevelopmentMode constant (declared in types.d.ts) rather than the runtime XH.isDevelopmentMode, letting Webpack drop it from prod bundles.
  • SalesService.groovy - derived email, region, tenure, commissionRate, and commission fields, hashed off the rep's name so values stay stable across reloads. Gives the demo enough columns to organize and hide.
  • New shared column specs (tenureCol, commissionRateCol, commissionCol) and a wrapperOptionGroup() helper for labeled subsections in a Wrapper's options list.

Note for reviewers

CI will fail until xh/hoist-react#4409 merges and an @xh/hoist 87 snapshot publishes with the new chooser APIs - yarn lint:types resolves ^87.0.0-SNAPSHOT from npm, which does not yet have them. Verified locally against a hoist-react working copy: yarn lint:code and yarn lint:types both clean.

haynesjm42 and others added 30 commits April 13, 2026 12:04
Add ColumnChooserPanel with a grouped-column GridModel and side-by-side layout showing both the grid and the new columnChooser component. Wire up route and tab entry in AppModel.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add RowDragModule to AG Grid community module registration (required for row drag features)
- Add minWidth to ColumnChooser in test panel to prevent flex shrinking

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reworks the "Grids > Column Chooser" example into a fuller showcase of the new component and moves it above Column Filtering in the tab list.

* Enriched the sales dataset with derived `email`, `region`, `tenure`, `commissionRate`, and `commission` fields (in `SalesService`), plus new `tenure`/`commission` column defs, so the demo has enough columns to make groups and the Column Library feel natural.
* Reworked the columns to demonstrate both grouping mechanisms: real nested `ColumnGroup`s (Rep, Location, Sales, Compensation) drive the buckets and `lockColumnGroups`, while `chooserGroup` groups the optional Column Library. `Full Name` is locked via `hideable: false`, and every column carries a `chooserDescription`.
* Fixed the embedded chooser to enable `showColumnLibrary` directly (it was only set on `colChooserModel`) and sized it to fit the full bucket + library layout.
* Added a "Show chooser beside grid" demo toggle (with an info line clarifying the embed is a demo aid) alongside the `lockColumnGroups` toggle, both in the Wrapper options rail.
- Add a `libraryWidth` control (ColLibraryConfig); `width` now sizes the bucket column alone.
- Drive the docked panel's dock size from `width` (+ library width when shown) rather than `panelConfig.defaultSize`.
- Restore the default grid context menu, inserting the docked-panel chooser item after the standard one.
Gate ag-Grid ValidationModule to development builds, distinguish P&L columns by type in the Column Library, and fix comment typos.
@haynesjm42
haynesjm42 marked this pull request as ready for review July 27, 2026 19:48
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