Session: nested-cuddling-pizza-subagent-a07fdc81 — 2026-02-25

doctolib-doctolib · Claude · branch master · claude-haiku-4-5-20251001 · 2026-02-25 13:17 · 1 msgs · 35 tools · 14 min read · updated 2 months ago

I need to understand two things for integrating a DMP entry point into PatientCard:

tools: Grep, Glob, Read, Bash
← doctolib-doctolib Download .md .txt .json
Tool calls
Read Read: 17 calls (48.6%) 17 Bash Bash: 11 calls (31.4%) 11 Grep Grep: 4 calls (11.4%) 4 Glob Glob: 3 calls (8.6%) 3
Token usage6.0M total
Input300
Cache creation146.6K
Cache read5.8M
Output190
Cache hit ratio98%· healthy

Project: doctolib-doctolib · Branch: master · Mode: ` · **Model:**claude-haiku-4-5-20251001`

Stats: 1 user messages, 35 tool calls, tools used: Grep, Glob, Read, Bash.

Conversation

Turn 1 — User

I need to understand two things for integrating a DMP entry point into PatientCard:

1. Feature switch pattern on the frontend The implementation plan uses feature switch nhr_document_list with send_to_front: true, accessed via window.dl_constants.NHR_DOCUMENT_LIST_ENABLED. - Find how other dl_constants feature switches are consumed in React components. Look for dl_constants usage patterns in packages/@doctolib/ — specifically how components check window?.dl_constants?.SOME_FLAG or use a hook for it. - Does a useFeatureSwitch or useNhrDocumentListEnabled hook exist anywhere?

2. DmpEntryPoint / NhrDocumentList in treatment-plan - Check if DmpEntryPoint already exists anywhere in ~/workspace/doctolib/treatment-plan/ or ~/workspace/doctolib/doctolib/packages/ - Check treatment-plan/packages/tpf-national-health-records-ui/src/ for any existing components - Check packages/@doctolib/dmp/ for any entry point or document list component

3. How @doctolib/dmp package exports its public API - Read packages/@doctolib/dmp/package.json to see its version and main/exports fields - Check packages/@doctolib/dmp/src/ structure — does a helpers/ folder exist? What's already there?

Search in: ~/workspace/doctolib/doctolib/packages/@doctolib/dmp/ and ~/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/

Turn 1 — Assistant

I'll help you understand these three areas. Let me search systematically through the codebase.

Tools used:

  • Grep: window\.dl_constants in /Users/USER/workspace/doctolib/doctolib/packages/@doctolib

Tools used:

  • Glob: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/**

Tools used:

  • Glob: /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/**

Tool results:

→ result (ok): No files found

Tools used:

  • Grep: useFeatureSwitch|dl_constants in /Users/USER/workspace/doctolib/doctolib/packages/@doctolib

Tool results:

→ result (ok): /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/CODEOWNERS.local /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/babel.config.cjs /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/catalog-info.yaml /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/jest.config.cjs /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/sonar-project.properties /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/tsconfig.json /Users/USER/wor …(truncated, 10074 more chars)

Tool results:

→ result (ok): /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/.npmignore /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/.storybook/main.ts /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/.storybook/preview.css /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/.storybook/preview.tsx /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-recor …(truncated, 2022 more chars)

Tool results:

→ result (ok): No files found

Let me search for how feature switches are actually used in React components:

Tools used:

  • Grep: dl_constants|window\?\.dl_constants in /Users/USER/workspace/doctolib/doctolib/packages/@doctolib

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/package.json

Tool results:

→ result (ok): No files found

Tool results:

→ result (ok): 1→{ 2→ "name": "@doctolib/dmp", 3→ "version": "1.0.0", 4→ "repository": { 5→ "type": "git", 6→ "url": "git+https://github.com/doctolib/doctolib" 7→ }, 8→ "keywords": [ 9→ "upfront", 10→ "modular frontend", 11→ "in-monolith-package" 12→ ], 13→ "author": "@doctolib/moose", 14→ "license": "Doctolib", 15→ "doctolib": { 16→ "upfront-type": "in-monolith-package" 17→ }, 18→ "type": "module", 19→ …(truncated, 3591 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/src/index.ts

Tool results:

→ result (ok): 1→export { 2→ type DmpDocumentItem, 3→ type DmpDocumentToAdd, 4→ type DmpDocumentToDelete, 5→ type FrDmpDocument, 6→ ItemType, 7→ type UploadedDmpDocumentItem, 8→} from './business/FrDmpConfig' 9→export { getErrorMessage } from './business/DmpI18nMessage' 10→export { DmpApi, type DmpSetUpProps, type ShareProps, type UnshareProps } from './business/DmpApi' 11→export { useDmpSetUp, type DmpSetUpResult } from './hooks/useDmpSetUp' 12→export …(truncated, 4105 more chars)

Tools used:

  • Glob: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/src/helpers/*

Tool results:

→ result (ok): /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/src/helpers/frDmpDocumentFixtureBuilder.ts /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/src/helpers/FrDmpHelpers.ts

Now let me search for how feature switches are accessed elsewhere in the codebase and look for treatment-plan package content:

Tools used:

  • Grep: NHR_|feature.*switch|ENABLED in /Users/USER/workspace/doctolib/doctolib/packages/@doctolib

Tools used:

  • Read: /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/index.ts

Tool results:

→ result (ok): No files found

Tool results:

→ result (ok): 1→export { NationalHealthRecordsUi } from './components/NationalHealthRecordsUi' 2→

<system-reminder> Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior. </system-reminder>

Tools used:

  • Read: /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NationalHealthRecordsUi.tsx

Tool results:

→ result (ok): 1→export const NationalHealthRecordsUi = () => <h1>National Health Records UI Placeholder</h1> 2→

<system-reminder> Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior. </system-reminder>

Tools used:

  • Read: /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/package.json

Tool results:

→ result (ok): 1→{ 2→ "name": "@doctolib/tpf-national-health-records-ui", 3→ "version": "2.0.0", 4→ "repository": { 5→ "type": "git", 6→ "url": "git+https://github.com/doctolib/treatment-plan.git" 7→ }, 8→ "keywords": [ 9→ "upfront", 10→ "modular frontend", 11→ "smaller-scope" 12→ ], 13→ "author": "@doctolib/fire", 14→ "license": "Doctolib", 15→ "doctolib": { 16→ "upfront-type": "smaller-scope" 17→ }, 18→ " …(truncated, 3711 more chars)

Let me search for actual usage patterns of feature switches and constants in the codebase:

Tools used:

  • Bash: find packages/@doctolib -name "*.tsx" -o -name "*.ts" | head -5 | xargs grep -l "ENABLED\|enabled\|constants" | head -5

Tool results:

→ result (ok): packages/@doctolib/partner-integration/src/queries/useOrganizationHistory.test.tsx packages/@doctolib/partner-integration/src/queries/useOrganizationPartners.ts

Tools used:

  • Bash: grep -r "window\." packages/@doctolib/*/src --include="*.tsx" --include="*.ts" | grep -i "feature\|enabled\|switch" | head -10

Tools used:

  • Bash: grep -r "dl_constants" . --include="*.tsx" --include="*.ts" --include="*.js" | head -20

Tool results:

→ result (ok): packages/@doctolib/ehr_clinical_document/src/helper/PrintPatientMasterData/getPatientFields.test.ts: window.dl_constants = { PRIVATE_PRACTICE_IN_GERMANY_ENABLED: false } packages/@doctolib/ehr_clinical_document/src/helper/PrintPatientMasterData/getPatientFields.test.ts: window.dl_constants = { PRIVATE_PRACTICE_IN_GERMANY_ENABLED: true } packages/@doctolib/financial_os_fr_billing/src/components/doctor/mobile/utils.ts:export const isOfflineToasterEnabled = new URLSearchParams(window.loca …(truncated, 1158 more chars)

Tool results:

→ result (ok): ./app/assets/javascripts/types/commons/window.ts: dl_constants: any ./app/assets/javascripts/hooks/doctor/useFetchConstants.ts: window.dl_constants = constants ./app/assets/javascripts/services/constants/index.ts: ...(window as unknown as Window & { dl_constants: Constants }).dl_constants, ./app/assets/javascripts/services/http-client/date-interceptors.ts: * Load date_interceptor_removal FS state from window.dl_constants ./app/assets/javascripts/services/http-client/date-interceptors.ts …(truncated, 2094 more chars)

Perfect! Let me read the key files for the feature switch pattern:

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/maps/src/MapContainer.tsx (1–50)

Tool results:

→ result (ok): 1→import { useMemo, useState, useContext } from 'react' 2→import classNames from 'classnames' 3→import MapConsentContext, { 4→ type MapConsentContextType, 5→ type PatientFeatureWithMap, 6→} from '@doctolib/maps/MapConsentContext' 7→import MapConsent from './MapConsent' 8→import './MapContainer.scss' 9→ 10→export interface MapContainerLabels { 11→ consent: string 12→ consentLearnMore: string 13→ consentLearnMoreA11ySuffix: string 14 …(truncated, 1750 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/types/commons/window.ts

Tool results:

→ result (ok): 1→import type { Screeb } from 'services/screeb/types' 2→import type { Account } from 'types/api/Account' 3→import type { ReactNativeEventResponse } from '@doctolib/native-bridge-web/react-native-events' 4→import type { ReactNativeProEventResponse } from 'types/doctor/reactNativeEvents' 5→import type { CountryLowerCaseTwoLetterCode } from 'types/shared/CountryCodes' 6→import type { Language } from '@doctolib/upfront-core/i18n' 7→// captureException should not be used …(truncated, 8183 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/hooks/doctor/useFetchConstants.ts

Tool results:

→ result (ok): 1→import { useFetchConstantsIndex } from 'queries/doctor_app/constants' 2→import { refreshConstants } from 'services/constants' 3→ 4→const useFetchConstants = () => { 5→ const fetchConstantsIndex = useFetchConstantsIndex() 6→ 7→ const fetchConstants = async () => { 8→ const constants = await fetchConstantsIndex() 9→ 10→ if (constants !== null) { 11→ window.dl_constants = constants 12→ refreshConstants() 13→ } 14→ } …(truncated, 443 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/services/constants/index.ts

Tool results:

→ result (ok): 1→import type { Constants } from './Constants' 2→ 3→const TEAMS = { 4→ BYP: 'BYP', 5→ FYP: 'FYP', 6→ PANDA: 'PANDA', 7→ PAX: 'PAX', 8→ P3C: 'P3C', 9→} 10→ 11→const getConstants = (): Constants & Record<string, unknown> => ({ 12→ ...(window as unknown as Window & { dl_constants: Constants }).dl_constants, 13→ CLIENT_TIME_DELTA: window.client_time_delta, 14→ TEAMS, 15→}) 16→ 17→export const CONSTANTS: Constants & Recor …(truncated, 788 more chars)

Let me look for more patterns of feature switch usage in React components:

Tools used:

  • Bash: grep -r "ALLOW_GOOGLE_MAPS_LOAD_IN_TESTS_ENABLED\|PRIVATE_PRACTICE_IN_GERMANY_ENABLED" packages/@doctolib --include="*.tsx" --include="*.ts" -B 2 -A 2 | head -40

Tools used:

  • Bash: find packages/@doctolib -name "*.tsx" -exec grep -l "window.dl_constants" {} \; | head -5

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/ehr_clinical_document/src/helper/PrintPatientMasterData/getPatientFields.test.ts (1–50)

Tool results:

→ result (ok): packages/@doctolib/maps/src/MapContainer.tsx-const shouldPreventLoadingInTest = () => { packages/@doctolib/maps/src/MapContainer.tsx- const envIsTest = document.head.dataset.env === 'test' packages/@doctolib/maps/src/MapContainer.tsx: const allowGoogleMapsLoadInTests = window.dl_constants.ALLOW_GOOGLE_MAPS_LOAD_IN_TESTS_ENABLED packages/@doctolib/maps/src/MapContainer.tsx- packages/@doctolib/maps/src/MapContainer.tsx- return envIsTest && !allowGoogleMapsLoadInTests -- packages/@doctolib/ehr_c …(truncated, 1322 more chars)

Tool results:

→ result (ok): packages/@doctolib/maps/src/MapContainer.tsx packages/@doctolib/maps/src/MapConsent.tsx packages/@doctolib/maps/src/MapComponent.tsx

Tool results:

→ result (ok): 1→import type { PrivateInsuranceData, PublicInsuranceData } from '@doctolib/tpf-document-print/types' 2→import { InsuranceSector } from 'monolith_DEPRECATED/types/api/InsuranceSector' 3→import { isInsuranceCardKVK } from '@doctolib/tpf-document-print/helpers' 4→import { shouldUsePatientData } from './getPatientFields' 5→ 6→jest.mock('@doctolib/tpf-document-print/helpers', () => ({ 7→ ...jest.requireActual('@doctolib/tpf-document-print/helpers'), 8→ isInsuranc …(truncated, 1892 more chars)

Now let me check the actual implementation in the component that uses the feature switch:

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/ehr_clinical_document/src/helper/PrintPatientMasterData/getPatientFields.ts (1–60)

Tool results:

→ result (ok): 1→import dayjs from 'dayjs' 2→import type { PrivateInsuranceData, PublicInsuranceData } from '@doctolib/tpf-document-print/types' 3→import type { ISODateStr } from 'monolith_DEPRECATED/types/commons/ISODateStr' 4→import { 5→ mapPatientData, 6→ isPrivatePatientOrPrivatePractice, 7→ isInsuranceCardKVK, 8→} from '@doctolib/tpf-document-print/helpers' 9→import type { PatientFieldsData } from './getPatientFieldsPrintConfiguration' 10→import { getPractice …(truncated, 2407 more chars)

Tools used:

  • Bash: grep -A 10 "shouldUsePatientData" packages/@doctolib/ehr_clinical_document/src/helper/PrintPatientMasterData/getPatientFields.ts | head -20

Tool results:

→ result (ok): export const shouldUsePatientData = (insuranceData: PublicInsuranceData | PrivateInsuranceData, documentKind: string) => isPrivatePatientOrPrivatePractice(insuranceData.patient.insurance_sector) || (isInsuranceCardKVK(insuranceData) && !DOCUMENT_KINDS_WITHOUT_KVK_PRINT_DATA_PREFERENCE.includes(documentKind))

const MAX_FIRST_NAME_LENGTH = 28 const MAX_LAST_NAME_LENGTH = 30 const MAX_ADDRESS_STREET_LENGTH = 28 const MAX_ADDRESS_COUNTRY_LENGTH = 27 const MAX_INSTITUTION_ID_LENGTH = 9 const INS …(truncated, 448 more chars)

Tools used:

  • Bash: find packages/@doctolib/dmp -type f \( -name "*.tsx" -o -name "*.ts" \) | head -20

Tool results:

→ result (ok): packages/@doctolib/dmp/src/types/FrDmpTypes.ts packages/@doctolib/dmp/src/business/DmpSharingSettings.ts packages/@doctolib/dmp/src/business/FrDmpCommunication.ts packages/@doctolib/dmp/src/business/FrDmpConstants.ts packages/@doctolib/dmp/src/business/DmpApi.test.ts packages/@doctolib/dmp/src/business/DmpApi.ts packages/@doctolib/dmp/src/business/FrDmpConfig.ts packages/@doctolib/dmp/src/business/DmpI18nMessage.ts packages/@doctolib/dmp/src/business/DmpSharingSettings.test.ts packages/@doctolib …(truncated, 666 more chars)

Let me check some DMP components:

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/src/components/DmpPill.tsx

Tool results:

→ result (ok): 1→import i18n from 'monolith_DEPRECATED/services/i18n' 2→import { Pill } from '@doctolib/design-system/Pill' 3→import { capturePro } from '@doctolib/product-event-wrapper' 4→import type { SharingServiceInformation } from '@doctolib/sharing-hub-interface' 5→import { DmpPillWithPopover } from './DmpPillWithPopover' 6→import type { DmpSharingOptionsInput } from '../hooks/DmpSharingService' 7→ 8→export const DmpPill = ({ 9→ dmpSharingOptions, 10→ onChang …(truncated, 2597 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/src/hooks/useDmpEnabledForAccount.ts

Tool results:

→ result (ok): 1→import type { Account } from 'monolith_DEPRECATED/types/api/Account' 2→import useProductLineVariation from '@doctolib/variation_management/public/useProductLineVariation' 3→import { ProductLineKey } from '@doctolib/variation_management/public/productLineFields' 4→ 5→export function useDmpEnabledForAccount(account: Account): boolean { 6→ return useProductLineVariation({ 7→ variants: { 8→ [ProductLineKey.EhrFranceDefault]: Boolean(account), 9→
…(truncated, 725 more chars)

Tools used:

  • Bash: grep -r "DmpEntryPoint\|NhrDocumentList" ~/workspace/doctolib --include="*.tsx" --include="*.ts" 2>/dev/null | head -20

Tool results:

→ result (ok): Command running in background with ID: bf3ad7b. Output is being written to: /private/tmp/claude-501/-Users-clertonra-workspace-doctolib-doctolib/tasks/bf3ad7b.output

Tools used:

  • Bash: cat /private/tmp/claude-501/-Users-clertonra-workspace-doctolib-doctolib/tasks/bf3ad7b.output

Tool results:

→ result (ok)

Tools used:

  • Bash: grep -r "isFeatureEnabled" packages/@doctolib --include="*.tsx" --include="*.ts" | head -10

Tool results:

→ result (ok): packages/@doctolib/partner-integration/src/components/OrganizationPartners.tsx:import { isFeatureEnabled } from '@doctolib/variation_management' packages/@doctolib/partner-integration/src/components/OrganizationPartners.tsx: const isEnabled = isFeatureEnabled('orga_partner_flagging') packages/@doctolib/partner-integration/src/components/admin/OrganizationPartnersManagementPage.tsx:import { isFeatureEnabled } from '@doctolib/variation_management' packages/@doctolib/partner-integration/src/compon …(truncated, 1137 more chars)

Perfect! Now let me look at the variation_management package to understand feature switches better:

Tools used:

  • Bash: find packages/@doctolib/variation_management -type f \( -name "*.tsx" -o -name "*.ts" \) -path "*/src/*" | head -10

Tool results:

→ result (ok): packages/@doctolib/variation_management/src/feature-switch/isFeatureEnabled/isFeatureEnabledForEveryOrganizationOfAccount.ts packages/@doctolib/variation_management/src/feature-switch/isFeatureEnabled/isSpecialityFeatureEnabled.ts packages/@doctolib/variation_management/src/feature-switch/isFeatureEnabled/isCountryFeatureEnabled.ts packages/@doctolib/variation_management/src/feature-switch/isFeatureEnabled/isConnectorFeatureEnabled.ts packages/@doctolib/variation_management/src/feature-switch/is …(truncated, 581 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/variation_management/src

Tool results:

→ result (ERROR): EISDIR: illegal operation on a directory, read '/Users/USER/workspace/doctolib/doctolib/packages/@doctolib/variation_management/src'

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/variation_management/src/feature-switch/isFeatureEnabled/isFeatureEnabled.ts

Tool results:

→ result (ok): 1→import type { Account } from 'monolith_DEPRECATED/types/api/Account' 2→import type { Patient } from 'monolith_DEPRECATED/types/doctor/api/Patient' 3→import isConnectorFeatureEnabled from './isConnectorFeatureEnabled' 4→import isFeatureEnabledForEveryOrganizationOfAccount from './isFeatureEnabledForEveryOrganizationOfAccount' 5→import isGlobalFeatureEnabled from './isGlobalFeatureEnabled' 6→import isCountryFeatureEnabled from './isCountryFeatureEnabled' 7→import is …(truncated, 2148 more chars)

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/variation_management/src/feature-switch/isFeatureEnabled/isGlobalFeatureEnabled.ts

Tool results:

→ result (ok): 1→import CONSTANTS from 'monolith_DEPRECATED/services/constants' 2→import { envIsProduction, getEnvironment } from 'monolith_DEPRECATED/packages/device/environment' 3→ 4→const isGlobalFeatureEnabled = (featureSwitchName: string): boolean => { 5→ const key = ${featureSwitchName.toUpperCase()}_ENABLED 6→ 7→ if (typeof CONSTANTS[key] !== 'boolean') { 8→ if (!getEnvironment()) return false 9→ if (!envIsProduction()) throw new Error(`Feature switch ${ …(truncated, 498 more chars)

Perfect! Now let me verify one more real usage example:

Tools used:

  • Read: /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/partner-integration/src/components/OrganizationPartners.tsx (1–40)

Tool results:

→ result (ok): 1→import React from 'react' 2→import { Pill } from '@doctolib/design-system-b2b/Pill' 3→import { isFeatureEnabled } from '@doctolib/variation_management' 4→import Link from 'components/base/Link' 5→import { useOrganizationPartnersIndex } from '../queries/useOrganizationPartners' 6→ 7→interface OrganizationPartnersProps { 8→ organizationId: number | string 9→} 10→ 11→const MAX_LABEL_LENGTH = 40 12→ 13→const truncateLabel = (text: string, ma …(truncated, 1335 more chars)

Perfect! Now I have all the information. Let me compile my findings:

Summary of Findings

I've completed a thorough search of the codebase. Here are the answers to your three questions:


1. Feature Switch Pattern on Frontend (dl_constants)

How feature switches work with dl_constants:

The codebase uses two main patterns for feature switches:

Pattern A: Direct window.dl_constants Access (Test/Legacy)

// From packages/@doctolib/maps/src/MapContainer.tsx
const shouldPreventLoadingInTest = () => {
  const envIsTest = document.head.dataset.env === 'test'
  const allowGoogleMapsLoadInTests = window.dl_constants.ALLOW_GOOGLE_MAPS_LOAD_IN_TESTS_ENABLED

  return envIsTest && !allowGoogleMapsLoadInTests
}

This is used in tests and simpler cases. The pattern is: - Feature switch name (e.g., NHR_DOCUMENT_LIST) gets _ENABLED suffix → NHR_DOCUMENT_LIST_ENABLED - Access via window.dl_constants.<FLAG_NAME> - Constants are set at /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/hooks/doctor/useFetchConstants.ts: ```typescript window.dl_constants = constants // fetched from backend


### Pattern B: Proper Frontend Pattern (Recommended)
Use **`isFeatureEnabled()`** from `@doctolib/variation_management`:

```typescript
// From packages/@doctolib/partner-integration/src/components/OrganizationPartners.tsx
import { isFeatureEnabled } from '@doctolib/variation_management'

const OrganizationPartners: React.FC<Props> = ({ organizationId }) => {
const isEnabled = isFeatureEnabled('orga_partner_flagging')  // name without _ENABLED suffix

if (!isEnabled) return null
// ... rest of component
}

The isFeatureEnabled() function (from /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/variation_management/src/feature-switch/isFeatureEnabled/isFeatureEnabled.ts): - Converts feature name to uppercase: orga_partner_flaggingORGA_PARTNER_FLAGGING_ENABLED - Retrieves from CONSTANTS (which comes from window.dl_constants) - Supports multiple feature switch types: 'global', 'country', 'account', 'any-organization-of-account', 'every-organization-of-account', 'patient-organization', 'speciality', 'connector'

Type definitions: - Window type at /Users/USER/workspace/doctolib/doctolib/app/assets/javascripts/types/commons/window.ts: ```typescript declare global { interface Window { dl_constants: any // because mix of feature switches and constants } }


**NO `useFeatureSwitch` hook exists** — components directly call `isFeatureEnabled()` as a function, not a hook.

---

## **2. DmpEntryPoint / NhrDocumentList Status**

**Current state:**
- **No `DmpEntryPoint` component exists** anywhere in the codebase
- **No `NhrDocumentList` component exists** anywhere in the codebase
- Treatment plan package **only contains a placeholder** at `/Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/src/components/NationalHealthRecordsUi.tsx`:
```typescript
export const NationalHealthRecordsUi = () => <h1>National Health Records UI Placeholder</h1>

Available DMP components in @doctolib/dmp: - DmpPill — A pill/button component for DMP sharing (at /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/src/components/DmpPill.tsx) - DmpPillWithPopover — DMP pill with popover UI - Various hooks: useDmpAvailability, useDmpEnabledForAccount, useDmpSetUp, etc.

These are document sharing components, not entry points for document lists.


3. @doctolib/dmp Package Structure & Exports

Package.json (at /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/package.json):

{
  "name": "@doctolib/dmp",
  "version": "1.0.0",
  "exports": {
    ".": "./src/index.ts",
    "./test": "./src/test-index.ts"
  }
}

Public API exports (from /Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/src/index.ts): - Components: DmpPill, DmpPillWithPopover - Hooks: useDmpSetUp, useDmpAvailability, useDmpSharingServiceFactory, useDmpEnabledForAccount - Services: DmpApi, DmpSharingService - Types & Functions: Multiple DMP-related exports (60+ items including types for documents, sessions, configurations, etc.) - FrDmp APIs: connectToDmp, getCachedDmpSession, findDocuments, deleteDocument, sendDocument, etc.

Helpers folder (/Users/USER/workspace/doctolib/doctolib/packages/@doctolib/dmp/src/helpers/): - ✅ Exists with 2 files: - frDmpDocumentFixtureBuilder.ts — Test fixture builder - FrDmpHelpers.ts — Utility functions: getDocumentFormat(), getDmpDocumentItemId(), getFrDmpDocument(), getSharingSettingsForDocument(), isDdvVersionCompatibleWithDmp(), needSecretConnexion(), upsertFrDmpDocument()

Treatment-plan package (at /Users/USER/workspace/doctolib/treatment-plan/packages/tpf-national-health-records-ui/): - Version: 2.0.0 - Only exports: NationalHealthRecordsUi (placeholder component) - No helpers folder, no document list implementation


Recommendations for Your Implementation

  1. For feature switch: Use isFeatureEnabled('nhr_document_list') (without _ENABLED suffix) from @doctolib/variation_management

  2. For DmpEntryPoint: You'll need to create this new component — likely in treatment-plan or @doctolib/dmp

  3. For NhrDocumentList: You'll need to build this component in treatment-plan's UI package (currently just a placeholder)

  4. Existing building blocks available: - @doctolib/dmp has all the FrDMP document APIs and utilities - DmpPill can be used as reference for component structure - Helper functions in FrDmpHelpers are available for document manipulation

Keyboard shortcuts

⌘K / Ctrl+KOpen command palette
/Focus search
g hGo to home
g pGo to projects
g sGo to sessions
j / kNext / prev row (tables)
?Show this help
EscClose dialogs

Structured queries

Mix key:value filters with free text in the palette:

type:sessionOnly session pages
project:llm-wikiFilter by project name (substring)
model:claudeFilter by model name (substring)
date:>2026-03-01Sessions after a date
date:<2026-04-01Sessions before a date
tags:rustPages mentioning a tag/topic
sort:dateSort results by date (newest first)

Example: type:session project:llm-wiki date:>2026-04 sort:date