Project: treatment-plan · Branch: main · Mode: ` · **Model:**claude-haiku-4-5-20251001`
Stats: 1 user messages, 2 tool calls, tools used: Bash.
Conversation
Turn 1 — User
Fetch the details of GitHub PR #3019 in the doctolib/treatment-plan repository. I need:
1. PR title, description, and list of changed files
2. The full git diff or a summary of what changed (use gh pr view 3019 --repo doctolib/treatment-plan and gh pr diff 3019 --repo doctolib/treatment-plan)
3. Whether it's frontend, backend, or both
4. What kind of change it is (feature, bug fix, refactor, etc.)
Report back with the PR metadata and a concise summary of all changed files and their nature.
Turn 1 — Assistant
I'll fetch the details of GitHub PR #3019 for you using the gh CLI.
Tools used:
Bash:gh pr view 3019 --repo doctolib/treatment-plan
Tools used:
Bash:gh pr diff 3019 --repo doctolib/treatment-plan
Tool results:
→ result (ok): title: feat(FHIR-2194): pass document to dropdown action callbacks and add isAvailable filter
state: DRAFT
author: sushangag (Sushan Gagneja)
labels: ai-augmented, review:size-m
assignees:
reviewers:
projects:
milestone:
number: 3019
url: https://github.com/doctolib/treatment-plan/pull/3019
additions: 237
deletions: 66
auto-merge: disabled
--
Why
https://doctolib.atlassian.net/browse/FHIR-2194
Consumers of the NHR document list's dropdown actions had no way to know which document was ac …(truncated, 2725 more chars)
Tool results:
→ result (ok): diff --git a/packages/tpf-national-health-records-ui/src/components/NhrDocumentList/NhrDocumentList.stories.tsx b/packages/tpf-national-health-records-ui/src/components/NhrDocumentList/NhrDocumentList.stories.tsx index ee5f3198b1..d4e7919d7d 100644 --- a/packages/tpf-national-health-records-ui/src/components/NhrDocumentList/NhrDocumentList.stories.tsx +++ b/packages/tpf-national-health-records-ui/src/components/NhrDocumentList/NhrDocumentList.stories.tsx @@ -157,7 +157,9 @@ const sharedBySampleR …(truncated, 26519 more chars)
Perfect! I've fetched all the details for PR #3019. Here's a comprehensive summary:
PR #3019 Summary
Metadata
- Title: feat(FHIR-2194): pass document to dropdown action callbacks and add isAvailable filter
- State: DRAFT
- Author: sushangag (Sushan Gagneja)
- Labels: ai-augmented, review:size-m
- Statistics: +237 additions, -66 deletions
- URL: https://github.com/doctolib/treatment-plan/pull/3019
Change Type
Feature — Enhances the dropdown action API to pass document context to callbacks and enable conditional visibility filtering.
Classification
Frontend — Changes are exclusively in the @doctolib/tpf-national-health-records-ui package (TypeScript React components).
What Changed
Core API Changes (types.ts)
- Changed DropdownActionOption.onClick signature from () => void to (doc: NhrDocument) => void | Promise<void> (backward-compatible)
- Added optional isAvailable?: (doc: NhrDocument) => boolean predicate to conditionally show/hide options per row
- Added 'link-primary' to the uiStyle union (alongside existing 'link-danger')
Component Changes
- ActionButton.tsx: Filters options by isAvailable before rendering; now passes document to MoreActions
- MoreActions.tsx: Receives and propagates document; injects it into onClick handlers at click time
- NhrDocumentListModal.tsx: Threads document through the loading-state wrapper
Test Updates
- ActionButton.test.tsx: Added 3 new tests for isAvailable predicate behavior
- MoreActions.test.tsx: All 7 cases updated; added link-primary style test
- NhrDocumentListModal.test.tsx: New integration test verifying document is passed to onClick
- NhrDocumentListTableBody.test.tsx: Updated assertions to verify document parameter
Story/Example Updates
- NhrDocumentList.stories.tsx: Updated 12 onClick handlers to demonstrate receiving and using doc parameter
- NhrDocumentListTableBody.stories.tsx: Formatting fixes and 3 onClick handler updates
- Fixed _doc parameter naming (was prefixed with unused underscore)
Files Changed (by category)
Type Definitions - packages/tpf-national-health-records-ui/src/types.ts
Component Implementation - ActionButton.tsx - MoreActions.tsx - NhrDocumentListModal.tsx
Tests - ActionButton.test.tsx - MoreActions.test.tsx - NhrDocumentListModal.test.tsx - NhrDocumentListTableBody.test.tsx
Stories/Examples - NhrDocumentList.stories.tsx - NhrDocumentListTableBody.stories.tsx
Testing Evidence
All 47 test files and 330 tests in the package pass locally, including the new test cases for isAvailable predicate behavior and document passing.