Skip to content

[DT-3313] [1/6] Extract duplicated grid columns and derive the filter-panel dispatch - #3935

Merged
kevinmarete merged 3 commits into
developfrom
km-dt-3313-shared-columns
Sep 17, 2026
Merged

kevinmarete merged 3 commits into
developfrom
km-dt-3313-shared-columns

Conversation

@kevinmarete

@kevinmarete kevinmarete commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Addresses

DT-3313 — 1 of 6, splitting #3926 per review. Security risk: no.

Summary

Groundwork, no behaviour change. Two lots of duplicated knowledge removed.

Grid columns. Models and Workspaces each hand-rolled the same two column shapes: a chip list capped at three with the remainder behind a +N tooltip, and an ellipsised single-line cell with the full text in a tooltip. Both move to sharedColumns.tsx. Presentations and Publications keep their own tag columns — theirs use flexWrap: 'nowrap' with no overflow tooltip and no valueGetter, so folding them in would change what renders and make the column sortable.

Filter-panel dispatch. LibraryFilters kept its own CHECKBOX_FILTER_KEYS and BOOLEAN_FILTER_KEYS lists plus a hardcoded chain of date keys, all duplicating what FILTER_CONTROL_BY_KEY already records. A key registered in the registry but missing from the matching list fell through to null, so the filter existed everywhere except the panel — which is exactly what happened three times while building 3/4/5 before this landed. Every section already carries the registry's control, so dispatch reads that, and the two key types derive from FilterState rather than a hand list so the narrowing cannot drift either. participantCount and biospecimenPostMortemInterval stay explicit: both are range with their own renderers.

DATE_SECTION_CONFIG stays as it is — it carries per-filter field labels and the inverted-range message, which genuinely must be added per date filter. A date filter registered without an entry is skipped rather than throwing, and the per-tab render tests are what catch a missing one.

Also seeds parseFiltersFromUrl with EMPTY_FILTERS: the spreads it merges are Records the as FilterState cast cannot check, so a key absent from every param config arrives undefined and throws on filters[key].length.

Net −104 lines. No test changes for the column extraction — the existing specs already cover chip counts, the +N overflow, empty arrays and sortability, and pass untouched. Mutation-checked: the extracted chip cap 3→2 fails 9 tests, and forcing each of the three dispatch predicates false fails 8, 9 and 2 respectively.

@github-actions

github-actions Bot commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

Coverage Report for DUOS Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 90.31% 12009 / 13298
🔵 Statements 89.79% 12814 / 14271
🔵 Functions 87.31% 3537 / 4051
🔵 Branches 82.66% 7459 / 9024
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/components/data_library/LibraryFilters.tsx 93.68% 92.3% 85.29% 93.47% 209, 230-237, 342, 370-385
src/components/data_library/columns/modelColumns.tsx 91.66% 78.57% 85.71% 90.9% 53
src/components/data_library/columns/sharedColumns.tsx 92.85% 100% 83.33% 92.85% 22
src/components/data_library/columns/workspaceColumns.tsx 100% 80% 100% 100%
src/hooks/useLibraryUrlState.ts 95.1% 92.55% 100% 94.81% 176, 187-189, 202, 209, 319
Generated in workflow #7210 for commit 79478ae by the Vitest Coverage Report Action

@kevinmarete kevinmarete changed the title [DT-3313] Extract the duplicated chip-list and truncated-text grid columns [DT-3313] [1/6] Extract the duplicated chip-list and truncated-text grid columns Sep 15, 2026
@kevinmarete
kevinmarete requested a lite review from Copilot September 15, 2026 23:47

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.

🟡 Changes recommended

The extracted tab-count query options remain module-private and cannot be reused as described.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

This PR extracts duplicated Data Library grid columns and prepares reusable filter and tab-count query infrastructure.

Changes:

  • Adds shared chip-list and truncated-text column builders.
  • Updates Model and Workspace columns to use shared builders.
  • Seeds URL filters with defaults.
  • Extracts tab-count query options.
File summaries
File Description
src/hooks/useLibraryUrlState.ts Seeds parsed filters with EMPTY_FILTERS.
src/hooks/useLibraryTabCounts.ts Extracts tab-count query configuration.
src/components/data_library/columns/workspaceColumns.tsx Uses shared column builders.
src/components/data_library/columns/sharedColumns.tsx Adds reusable column builders.
src/components/data_library/columns/modelColumns.tsx Uses shared column builders.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/hooks/useLibraryTabCounts.ts Outdated
The Models and Workspaces grids each hand-rolled the same two column shapes:
a chip list capped at three with the rest behind a "+N" tooltip, and an
ellipsised single-line cell with the full text in a tooltip.

Presentations and Publications keep their own tag columns; theirs use
`nowrap` and no overflow tooltip, so folding them in would change behaviour
rather than just deduplicate.

Also seeds `parseFiltersFromUrl` with `EMPTY_FILTERS`, so a key missing from
every param config reads as empty rather than arriving undefined and throwing
on `filters[key].length`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

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.

🟢 Approval recommended

No unresolved blocking issues were identified.

Review details
  • Files reviewed: 4/4 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

LibraryFilters kept its own key lists — CHECKBOX_FILTER_KEYS,
BOOLEAN_FILTER_KEYS and a hardcoded chain of date keys — duplicating what
FILTER_CONTROL_BY_KEY already records. A key registered in the registry but
absent from the matching list fell through to `null`, so the filter existed
everywhere except the panel.

Every section already carries the registry's own `control`, so dispatch reads
that. The two key types come from FilterState rather than a hand list, so the
narrowing cannot drift either. `participantCount` and
`biospecimenPostMortemInterval` stay explicit: both are `range` with their own
renderers.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kevinmarete kevinmarete changed the title [DT-3313] [1/6] Extract the duplicated chip-list and truncated-text grid columns [DT-3313] [1/6] Extract duplicated grid columns and derive the filter-panel dispatch Sep 16, 2026
@kevinmarete
kevinmarete requested a lite review from Copilot September 16, 2026 00:40

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.

🟢 Approval recommended

No unresolved blocking issues were identified.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

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.

🟢 Approval recommended

Only a non-blocking documentation nit remains.

Review details

Suppressed comments (1)

src/components/data_library/columns/sharedColumns.tsx:10

  • This helper sets sortable: false below, so the grid cannot sort these columns even though the docstring says valueGetter makes the text available to the grid's sorting. Please update the comment to mention only the behavior that is actually enabled (or make sortability configurable if sorting is part of the intended contract).
 * A list of values as chips, collapsing everything past the third into a `+N`
 * chip whose tooltip carries the rest. `valueGetter` joins them so the grid's
 * own sorting and quick filter see the text, not the array.
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@kevinmarete
kevinmarete force-pushed the km-dt-3313-shared-columns branch from 1bdb71d to 5d5345c Compare September 16, 2026 01:55
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kevinmarete
kevinmarete force-pushed the km-dt-3313-shared-columns branch from 5d5345c to 79478ae Compare September 16, 2026 02:46
@sonarqubecloud

Copy link
Copy Markdown

@kevinmarete
kevinmarete marked this pull request as ready for review September 16, 2026 03:07
@kevinmarete
kevinmarete requested a review from a team as a code owner September 16, 2026 03:07
@kevinmarete
kevinmarete requested review from fboulnois and removed request for a team September 16, 2026 03:07

@fboulnois fboulnois 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.

👍

@otchet-broad otchet-broad 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.

👍

@kevinmarete
kevinmarete merged commit f0a1e2f into develop Sep 17, 2026
16 checks passed
@kevinmarete
kevinmarete deleted the km-dt-3313-shared-columns branch September 17, 2026 17:40
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.

4 participants