Project: workspace-doctolib · Branch: HEAD · Mode: ` · **Model:**claude-sonnet-4-6`
Stats: 1 user messages, 33 tool calls, tools used: Bash, Read.
Conversation
Turn 1 — User
Review PR #3086 in doctolib/treatment-plan for UpFront architecture compliance. Branch: fhir-2223_fix-column-widths-truncation.
Changed files in packages/tpf-national-health-records-ui:
- src/types.ts — added width?: string to ColumnConfig
- src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.tsx — added fixedLayout={true}
- src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableHead/NhrDocumentListTableHead.tsx — added initialWidth={col.width}
- src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.tsx — added truncation wrapper
- src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.helpers.ts — NEW file with getTextContent helper
Review for: component directory structure, separation of concerns, naming conventions, helper file placement, anti-patterns, and Oxygen Design System usage patterns. Report any violations.
Turn 1 — Assistant
I'll start by examining the git diff and the relevant files to conduct a thorough architecture review.
Tools used:
Bash:cd /Users/USER/workspace/doctolib/worktrees/doctolib/fhir-2223_fix-column-widths-dmp 2>/dev/null || echo "WORKTREE_NOT_FOUND"
Tool results:
→ result (ok): (Bash completed with no output)
Tools used:
Bash:ls /Users/USER/workspace/doctolib/worktrees/ 2>/dev/null || echo "DIR_NOT_FOUND"
Tool results:
→ result (ok): cleanup-merged-worktrees.sh doctolib treatment-plan
Tools used:
Bash:ls /Users/USER/workspace/doctolib/worktrees/treatment-plan/ 2>/dev/null || echo "DIR_NOT_FOUND"
Tool results:
→ result (ok): fhir-2079 fhir-2081 fhir-2083 FHIR-2091-nhr-document-list-pagination fhir-2168_add-result-count-to-nhr-header fhir-2171 fhir-2214 fhir-2221_display-last-dmp-access-date fhir-2222_add-visible-to-all-filter fhir-2223_fix-column-widths-truncation
Tools used:
Bash:git -C /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation diff HEAD~1 HEAD --name-only 2>/dev/null || git -C /Users/USER/workspace/doctolib/worktr …(truncated, 105 more chars)
Tool results:
→ result (ok): packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.test.tsx packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.tsx packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.helpers.test.ts packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentL …(truncated, 736 more chars)
Tools used:
Bash:git -C /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation log --oneline -10
Tool results:
→ result (ok): aad974b49 fix(FHIR-2223): fix proportional column widths with text truncation in NhrDocumentListTable 9d5ba5ce0 feat(FHIR-2139): add uuids to NhrGetDocumentsContentParams (#3068) 3084c747d feat(FHIR-2219): implement multi-select for Document Category filter (#3051) 66f7f2f20 feat(ACAI-4144): add bulk template migration endpoint (#3066) 3e28f6305 chore(TREAT-413): Packages are not defined in github workspace anymore (#3076) 093132ad6 chore(ACAI-4195): Update codeowners for tpf-document-template-l …(truncated, 283 more chars)
Tools used:
Bash:git -C /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation diff origin/main...HEAD -- packages/tpf-national-health-records-ui/
Tool results:
→ result (ok): diff --git a/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.test.tsx b/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.test.tsx index 4e7eb52c1..8cfd9e422 100644 --- a/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.test.tsx +++ b/packages/tpf-national-health-records-ui/src/components/Nhr …(truncated, 10863 more chars)
Now let me read the existing files to understand the full context and established patterns.
Tools used:
Read:/Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/types.ts
Tool results:
→ result (ok): 1 import type { DesignSystemIconComponent } from '@doctolib/design-system-icons'
2 import type { NhrDocument, NhrResultStatus } from '@doctolib/tpf-national-health-records'
3 import type { ReactNode } from 'react'
4
5 export type NhrPatientInfo = {
6 fullName: string
7 gender: 'male' | 'female' | 'other'
8 birthDate: string
9 age: number
10 }
11
12 export type ColumnConfig = {
13 key: string
14 header: string
15 sortable: boolean
16 /** Only required when sortable: true. Return
…(truncated, 3831 more chars)
Tools used:
Read:/Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.helpers.ts
Tool results:
→ result (ok): 1 import { isValidElement } from 'react'
2 import type { ReactNode } from 'react'
3
4 export function getTextContent(node: ReactNode): string {
5 if (typeof node === 'string' || typeof node === 'number') return String(node)
6 if (Array.isArray(node)) return node.map(getTextContent).join('')
7 if (isValidElement(node)) return getTextContent((node.props as { children?: ReactNode }).children)
8 return ''
9 }
10
Now let me read the existing component files to understand the full context.
Tools used:
Read:/Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.tsx
Tool results:
→ result (ok): 1 import { TableBody } from '@doctolib/design-system/TableBody'
2 import { TableCell } from '@doctolib/design-system/TableCell'
3 import { TableRow } from '@doctolib/design-system/TableRow'
4 import { TableSelectCell } from '@doctolib/design-system/TableSelectCell'
5 import type { NhrDocument } from '@doctolib/tpf-national-health-records'
6
7 import type { ActionConfig, ColumnConfig } from '../../../../types'
8 import { ActionButton } from './ActionButton'
9 import { getTextContent } from './Nh
…(truncated, 1320 more chars)
Tools used:
Read:/Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableHead/NhrDocumentListTableHead.tsx
Tool results:
→ result (ok): 1 import { TableHead } from '@doctolib/design-system/TableHead'
2 import { TableHeadCell } from '@doctolib/design-system/TableHeadCell'
3 import { TableHeadSelectAllCell } from '@doctolib/design-system/TableHeadSelectAllCell'
4 import { TableRow } from '@doctolib/design-system/TableRow'
5
6 import type { ColumnConfig } from '../../../../types'
7
8 export type NhrDocumentListTableHeadProps = {
9 columns: ColumnConfig[]
10 }
11
12 export const NhrDocumentListTableHead = ({ columns }: NhrDocum
…(truncated, 372 more chars)
Tools used:
Read:/Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.tsx
Tool results:
→ result (ok): 1 import { PAGE_SIZE } from '#utils/nhrPaginationHelpers'
2 import { Pagination } from '@doctolib/design-system/Pagination'
3 import { Table } from '@doctolib/design-system/Table'
4 import type { NhrDocument } from '@doctolib/tpf-national-health-records'
5
6 import type { ActionConfig, ColumnConfig } from '../../../types'
7 import { NhrDocumentListTableBody } from './NhrDocumentListTableBody/NhrDocumentListTableBody'
8 import { NhrDocumentListTableHead } from './NhrDocumentListTableHead/NhrDocu
…(truncated, 993 more chars)
Tools used:
Bash:ls /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/ …(truncated, 25 more chars)
Tool results:
→ result (ok): ActionButton.test.tsx ActionButton.tsx MoreActions.stories.tsx MoreActions.test.tsx MoreActions.tsx NhrDocumentListTableBody.helpers.test.ts NhrDocumentListTableBody.helpers.ts NhrDocumentListTableBody.stories.tsx NhrDocumentListTableBody.test.tsx NhrDocumentListTableBody.tsx SimpleAction.test.tsx SimpleAction.tsx
Tools used:
Bash:ls /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/
Tool results:
→ result (ok): NhrDocumentListTable.stories.tsx NhrDocumentListTable.test.tsx NhrDocumentListTable.tsx NhrDocumentListTableBody NhrDocumentListTableHead
Tools used:
Bash:ls /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/
Tool results:
→ result (ok): tests business components entry.ts i18n.test.ts i18n.ts index.ts locales test-helpers types.ts utils
Tools used:
Bash:ls /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/ …(truncated, 25 more chars)
Tool results:
→ result (ok): NhrDocumentListTableHead.stories.tsx NhrDocumentListTableHead.test.tsx NhrDocumentListTableHead.tsx
Tools used:
Bash:ls /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/__tests__/ 2>/dev/null && echo "---" && ls /Users/cle …(truncated, 159 more chars)
Tool results:
→ result (ok): index.test.ts
fixtures index.ts
Tools used:
Bash:cat /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/package.json
Tool results:
→ result (ok): { "name": "@doctolib/tpf-national-health-records-ui", "version": "16.0.2", "repository": { "type": "git", "url": "git+https://github.com/doctolib/treatment-plan.git" }, "keywords": [ "upfront", "modular frontend", "smaller-scope" ], "author": "@doctolib/fire", "license": "Doctolib", "doctolib": { "upfront-type": "smaller-scope" }, "type": "module", "sideEffects": [ "./src/i18n.ts" ], "scripts": { "dev": "vite --host -d", "dev:mfr": …(truncated, 3452 more chars)
Tools used:
Bash:# Check if NhrDocumentListTableHead has an index.ts re-exporter …
Tool results:
→ result (ok): NhrDocumentListTableHead.stories.tsx NhrDocumentListTableHead.test.tsx NhrDocumentListTableHead.tsx
ActionButton.test.tsx ActionButton.tsx MoreActions.stories.tsx MoreActions.test.tsx MoreActions.tsx NhrDocumentListTableBody.helpers.test.ts NhrDocumentListTableBody.helpers.ts NhrDocumentListTableBody.stories.tsx NhrDocumentListTableBody.test.tsx NhrDocumentListTableBody.tsx SimpleAction.test.tsx SimpleAction.tsx
NhrDocumentListTable.stories.tsx NhrDocumentListTable.test.tsx NhrDocumentLi …(truncated, 61 more chars)
Tools used:
Bash:# Check the package's path aliases definition to understand what's available …
Tool results:
→ result (ok): { "extends": "../../tsconfig-base", "include": [ "../../vitest-shared.config.ts", "../../vitest-setup", "/*", "src/locales//.json", "package.json", "../../.storybook/.ts" ], "compilerOptions": { "types": ["vitest/globals", "@testing-library/jest-dom"] } }
Tools used:
Bash:cat /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/tsconfig-base.json 2>/dev/null || find /Users/USER/workspace/doctolib/worktrees/treatment-p …(truncated, 103 more chars)
Tool results:
→ result (ok): { "extends": ["@doctolib/upfront-dev/tsconfig.json"], "compilerOptions": { // Configuration for TS project references "rootDir": ".", "outDir": "build", "composite": true, "noEmit": false, "declaration": true, // need to set this back to false to allow noEmit: false "allowImportingTsExtensions": false, // was needed for webpack build "jsx": "react-jsx",
// ignore errors due to design system
"exactOptionalPropertyTypes": false,
"types": ["
…(truncated, 653 more chars)
Tools used:
Bash:# Check the NhrDocumentListTable test to understand testing patterns …
Tool results:
→ result (ok): import { setup } from '@doctolib/test-helpers' import { screen } from '@testing-library/react' import { describe, expect, it } from 'vitest'
import { mockColumns, mockRows } from '../../../test-helpers' import { NhrDocumentListTable } from './NhrDocumentListTable'
const defaultPaginationProps = { currentPage: 1, total: 0, onPageChange: () => {}, }
describe('NhrDocumentListTable', () => { it('should render a table', () => { setup(<NhrDocumentListTable columns={mockColumns} {...defa …(truncated, 2120 more chars)
Tools used:
Bash:# Check for the #utils alias and its definition in vite config …
Tool results:
→ result (ok): /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/vite.config.ts /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/node_modules/@module-federation/bridge-react-webpack-plugin/vite.config.ts /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/node_ …(truncated, 50 more chars)
Tools used:
Bash:cat /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/utils/nhrPaginationHelpers.ts 2>/dev/null | head -20
Tool results:
→ result (ok): export const PAGE_SIZE = 20
export const getPagedData = <T>(data: T[] | undefined, currentPage: number): T[] | undefined => data?.slice((currentPage - 1) * PAGE_SIZE, currentPage * PAGE_SIZE)
Tools used:
Bash:# Check what the package's imports field in package.json defines vs. what aliases UpFront prescribes …
Tool results:
→ result (ok): /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/package.json: "#data/": "./src/data/.ts",
Tools used:
Bash:# Check how deeply nested the relative imports are in the changed files to evaluate alias usage …
Tool results:
→ result (ok): 7:import type { ActionConfig, ColumnConfig } from '../../../../types' ---HEAD--- 6:import type { ColumnConfig } from '../../../../types'
Tools used:
Bash:# Count depth of relative imports: ../../../../types.ts = 4 levels …
Tool results:
→ result (ok): import { addToast } from '../../business/toast' import { createMoreActionsAction } from '../../../../business/factories/actions/createMoreActionsAction' import { createMoreActionsAction } from '../../business/factories/actions/createMoreActionsAction' import { createViewDocumentAction } from '../../../../business/factories/actions/createViewDocumentAction' import { formatAge, formatGender } from '../../../business/formatters/patientFormatter' import { mockColumns } from '../../../../test-helpers …(truncated, 1027 more chars)
Tools used:
Bash:# Check if col.render(row) is called twice (double render) in the body component …
Tool results:
→ result (ok): 33: <div className='truncate' title={getTextContent(col.render(row))}> 34: {col.render(row)}
Tools used:
Bash:# Check the TableHeadCell component to understand what initialWidth does …
Tool results:
→ result (ok): (Bash completed with no output)
Tools used:
Bash:find /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/node_modules/@doctolib/design-system/src -name "TableHe …(truncated, 32 more chars)
Tool results:
→ result (ok): (Bash completed with no output)
Tools used:
Bash:# Check existing components that use fixedLayout to understand the established convention …
Tool results:
→ result (ok): /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.test.tsx /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.tsx /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir- …(truncated, 758 more chars)
Tools used:
Bash:cat /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-pharmacy-prescription-forms/node_modules/@doctolib/design-system/src/dataDisplay/Ta …(truncated, 36 more chars)
Tool results:
→ result (ok): import './Table.scss'
import classNames from 'classnames' import type { ComponentPropsWithoutRef, ReactNode } from 'react'
import type { SkeletonLoaderProps } from './TableSkeletonLoader' import { TableSkeletonLoader } from './TableSkeletonLoader'
type Props = { fixedLayout?: boolean | undefined className?: string | undefined children?: ReactNode loading?: boolean | undefined skeletonLoaderProps?: SkeletonLoaderProps | undefined size?: 'xsmall' | 'small' | 'medium' | undefined } & …(truncated, 839 more chars)
Tools used:
Bash:# Find TableHeadCell source to understand initialWidth prop …
Tool results:
→ result (ok): /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-pharmacy-prescription-forms/node_modules/@doctolib/design-system/src/dataDisplay/Table/TableHeadCell.tsx
Tools used:
Bash:cat /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-pharmacy-prescription-forms/node_modules/@doctolib/design-system/src/dataDisplay/Ta …(truncated, 21 more chars)
Tool results:
→ result (ok): import './Table.scss'
import { CaretDownSolidIcon } from '@doctolib/design-system-icons/CaretDownSolidIcon' import { CaretUpSolidIcon } from '@doctolib/design-system-icons/CaretUpSolidIcon' import classNames from 'classnames' import type { ComponentPropsWithoutRef, MouseEvent as ReactMouseEvent, ReactNode } from 'react' import { forwardRef } from 'react'
let currentResizedColumn: HTMLTableCellElement | undefined let currentResizedColumnElements: NodeListOf<HTMLElement> let currentResizedColumn …(truncated, 5304 more chars)
I now have all the information needed to conduct a thorough review. Let me compile the findings.
Architecture Review: PR #3086 — fhir-2223_fix-column-widths-truncation
Package: packages/tpf-national-health-records-ui
Critical Issues (must fix)
1. col.render(row) is invoked twice per cell per row
File: /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.tsx, lines 33–34
The change introduces this pattern:
<div className='truncate' title={getTextContent(col.render(row))}>
{col.render(row)}
</div>
col.render(row) is called twice on every cell for every row. render is a caller-supplied function. There is no contract that prevents it from being stateful, having side effects, or being expensive. Even in purely functional cases, React will instantiate two separate ReactNode trees per cell, which wastes memory and processing time.
The fix is to capture the result once:
{columns.map((col) => {
const content = col.render(row)
return (
<TableCell key={col.key}>
<div className='truncate' title={getTextContent(content)}>
{content}
</div>
</TableCell>
)
})}
Warnings (should fix)
2. Helper file is not in the right scope — it is generic, not specific to NhrDocumentListTableBody
File: /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTableBody/NhrDocumentListTableBody.helpers.ts
getTextContent(node: ReactNode): string is a general-purpose React utility. It has no dependency on NhrDocumentListTableBody, ColumnConfig, or any domain concept from this package. Per UpFront architecture rules, general-purpose helpers that are not tightly coupled to a single component belong in src/helpers/. Colocated ComponentName.helpers.ts files are for helpers that are genuinely local to that one component.
If this helper is only used by NhrDocumentListTableBody today, it should at minimum be placed in src/helpers/ with a generic name (e.g., reactNodeHelpers.ts or getTextContent.ts) so it is discoverable and reusable. Nesting a reusable utility inside a deeply-nested component directory makes it invisible to the rest of the package and will lead to duplication when a second component needs the same logic.
Recommended placement: /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/helpers/
3. Component directories are missing index.ts re-exporters
Directories:
- .../NhrDocumentListTable/NhrDocumentListTableBody/ — no index.ts
- .../NhrDocumentListTable/NhrDocumentListTableHead/ — no index.ts
- .../NhrDocumentListTable/ — no index.ts
Per the Josh Comeau directory structure rule enforced by UpFront, every public component directory must have an index.ts that re-exports the component. This is a pre-existing violation that this PR does not introduce, but it adds a new file to a non-conforming directory without addressing the missing re-exporter. The convention requires:
// NhrDocumentListTableBody/index.ts
export * from './NhrDocumentListTableBody'
The test file at .../NhrDocumentListTableBody.helpers.test.ts also imports directly from ./NhrDocumentListTableBody.helpers, which is consistent with a colocated helper — but if the helper moves to src/helpers/, the import in the test must follow.
4. width field type in ColumnConfig is too permissive
File: /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/types.ts, line 20
The JSDoc comment says 'e.g. '20%' — implying only percentage values are valid — but the type is string. The initialWidth prop on TableHeadCell accepts string | number. Since table-layout: fixed distributes widths based on <th> widths, passing an arbitrary CSS value (e.g., '200px', 'auto', '2rem') is valid and intentional, but a caller passing 'red' or an empty string will silently produce a broken layout with no type error.
If percentage is the only intended format, tighten the type or add a runtime guard. If arbitrary CSS widths are intentional, remove the e.g. '20%' restriction from the JSDoc so the contract is accurate.
Suggestions (consider improving)
5. Inline boolean prop fixedLayout={true} should use JSX shorthand
File: /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.tsx, line 31
// Current
<Table fixedLayout={true}>
// Preferred — consistent with React JSX conventions
<Table fixedLayout>
This is a stylistic convention enforced by many ESLint configurations (react/jsx-boolean-value). It is minor but worth aligning.
6. Test for fixedLayout queries the DOM via CSS class selector
File: /Users/USER/workspace/doctolib/worktrees/treatment-plan/fhir-2223_fix-column-widths-truncation/packages/tpf-national-health-records-ui/src/components/NhrDocumentListModal/NhrDocumentListTable/NhrDocumentListTable.test.tsx, lines 63–67
expect(document.querySelector('.dl-table-layout-fixed')).toBeInTheDocument()
The project's own testing rules explicitly prohibit CSS class selectors (.class, #id) in tests in favour of semantic queries. The inline comment // Justification: Testing that Oxygen's fixedLayout prop applies the CSS class acknowledges this deviation but does not constitute sufficient justification. The correct assertion is to verify that the Table receives fixedLayout as a prop, or to snapshot the rendered element's style attribute, rather than asserting on a design system internal CSS class that could change without a semver bump. That said, there is no accessible semantic query that directly maps to a CSS layout property — the comment is partially valid. The accepted pattern in this codebase for design system internal classes is documented in NhrDocumentListTable.test.tsx line 46 (skeleton loader test) which uses the same technique. Given that precedent already exists in the same test file, this specific case is borderline. The note stands as a suggestion rather than a mandatory fix.
Summary
The one issue that must be resolved before merge is the double invocation of col.render(row) (Critical Issue 1). The helper placement (Warning 2) is the most impactful structural concern: getTextContent is a general-purpose React utility that does not belong buried inside NhrDocumentListTableBody/. It should live in src/helpers/ to be discoverable and reusable. The missing index.ts re-exporters (Warning 3) are pre-existing debt but should not be compounded further.