Skip to content

Implementation plan / Session plan / Handover FN-S06

Handover FN-S06 Foundation: Application shell skeleton and design system

Card: FN-S06. Issue: #6. Branch: session/FN-S06. Decision record: ADR-HIS-042.

What was built and where

  • web/design-system/ (@his/design-system):
  • The tokens of DESIGN 9, verbatim, in src/tokens.css.
  • A Tailwind CSS v4 theme (src/theme.css) that keeps only the tokens and removes the default palette (CUX-14), plus the type scale of DESIGN 3 for each density.
  • Base components on react-aria-components, written in the shadcn style: Button (shows isPending progress, CUX-34) and TextField (visible label, the word "Required", amber errors, CUX-15).
  • The shared safety components of CUX-57: StatusBadge and StatusSymbol, StateLabel (the glossary labels of Shell 5), FreshnessIndicator (CUX-53), SystemBanner (Shell 7 precedence, no dismiss control), ActionBar (Shell 2 region 5) and PatientContextZone (Shell 4, SAFE-002, with the counter variant of CUX-48).
  • The component labels in English and Bahasa Indonesia, taken from the glossary.
  • The dates, times, zones, ages and staleness units of DESIGN 7.
  • web/shell/ (@his/shell):
  • The frame with the system banner, global bar (environment label, workspace switcher, user), workspace navigation, patient context zone, content area and status line (freshness, connection, facility, zone, version).
  • Routing (react-router), and the standard screen states of Shell 13 (loading, empty, error with a service-desk reference, not found, and a patient-level view refused while no patient is open).
  • The window title rule of CUX-03.
  • The screen registry (src/registry/) and the SDK @his/shell-sdk (src/sdk/): defineScreen, useShell, useViewFreshness, and testing with renderScreen and expectNoAxeViolations.
  • workspace-kit/ and tsconfig.shared-deps.json, the settings each workspace reuses.
  • Scripts: ci.sh, check-screen-discovery.mjs and check-shared-versions.mjs.
  • web/domains/<domain>/ for all ten domains: package.json, pnpm-lock.yaml, tsconfig.json, vitest.config.ts, and a README that says how to add a screen. One example screen folder, web/domains/adm/UI-ADM-000/ (the W09 Front desk workspace, marked example and left out of production builds), with its view and tests.
  • Pipeline: .github/workflows/web.yml runs the twelve web packages as a matrix on any change under web/. Each job calls web/shell/scripts/ci.sh <folder>: install from the folder's own lockfile, pnpm build, pnpm test.
  • Docs: ADR-HIS-042 and its row in the decision record index (the index is identical to what build_adrs.py writes; checked on a scratch copy). CLAUDE.md sections 2 and 3 now describe the web packages and their commands.

How it fits together: - A screen is a folder web/domains/<domain>/<SCREEN-ID>/. Its screen.ts default-exports defineScreen({...}). - The shell finds every such file with one build-time glob. It derives the identifier, domain and route (/<domain>/<screen-id>) from the folder, and fails the build on any folder that breaks the layout. - The shared packages (React, React Aria, clsx) resolve from the node_modules of whichever folder is being built. The design system and SDK are consumed as source through aliases. So no lockfile points at another folder, and there is one React in each build and test.

Checks and their result

Run with Node.js 22.23.5 and pnpm 10.34.9. On this server they ran in the node:22-bookworm container, because Node.js is not installed on the host.

Check Command Result
Design system: type check, component, accessibility and token tests web/design-system: pnpm build && pnpm test 52 tests pass
Shell: type check, production bundle, tests, version check, screen discovery check web/shell: pnpm build && pnpm test Bundle built; 19 tests pass (1 skipped: the discovery test, which runs only from the discovery script); version check passes for 11 packages; discovery check passes
Each domain workspace web/domains/<d>: pnpm build && pnpm test ADM: 3 tests pass; the nine others type-check and have no tests yet
CI job from a clean copy web/shell/scripts/ci.sh <folder> on a copy of the tracked files with no node_modules, each folder installed on its own All 12 folders exit 0
Shell dev server pnpm dev in web/shell Serves the shell, the registry and the example view (HTTP 200)
Discovery check fails when it should discovery test with HIS_EXPECT_SCREEN=UI-ADM-998 and no such folder Fails: "UI-ADM-998 was not discovered"
Link check and documentation site python3 docs/implementation_plan/tools/check_links.py; mkdocs build 0 broken links; site builds. The 72 links in CLAUDE.md and the web READMEs were checked separately: 0 broken

The web workflow first runs on the pull request of this session.

"Ends when", line by line: - The example screen loads in the shell: web/shell/test/shell.test.tsx, "FN-S06 the example screen loads in the shell". - A second screen folder added to the same workspace appears in the shell without a change to any other file: web/shell/scripts/check-screen-discovery.mjs, part of pnpm test in the shell. It copies UI-ADM-000 to UI-ADM-999 and changes nothing else. test/discovery.test.tsx then requires the new screen in the navigation and opens it, and the copy is removed afterwards. - The component and accessibility checks run in the pipeline: .github/workflows/web.yml.

Requirements and test scenarios

The card names no functional requirement or test scenario. The tests name the design rules they cover in their describe titles:

Rule Test
DESIGN 9 tokens; CUX-14 (no other hue) web/design-system/test/tokens.test.ts
NFR-011, CUX-17 contrast of every token pair web/design-system/test/tokens.test.ts
CUX-19, CUX-62, DESIGN 7 dates, times, zones, ages; CUX-53 staleness web/design-system/test/time.test.ts
CUX-06, CUX-10, CUX-14, CUX-15, CUX-17, CUX-18, CUX-34, CUX-48, CUX-53, SAFE-002, Shell 2 and 7 components; NFR-011 axe-core web/design-system/test/components.test.tsx
Shell 2 regions, Shell 3 navigation and workspaces, Shell 7, Shell 13, SAFE-002, CUX-01, CUX-03; NFR-011 axe-core web/shell/test/shell.test.tsx, workspaces.test.ts
ADR-HIS-042 registry rules web/shell/test/registry.test.ts, discovery.test.tsx
Example screen web/domains/adm/UI-ADM-000/ExampleView.test.tsx

Differences from the card, specification or architecture

  • Workspaces are composed at build time. Architecture section 11 says workspaces "deploy independently inside the shell". Here each workspace is maintained and tested on its own, but it ships inside the one shell bundle. The screen.ts contract is designed so that a run-time loader can be added later without touching any screen folder. The reasons are in ADR-HIS-042; the Board confirmed this point when it approved the record on 2026-11-24.
  • Pipeline jobs in this card, not FN-S05. The card needs the checks to run in the pipeline, and FN-S05 has not run yet. The job logic lives in web/shell/scripts/ci.sh, as ADR-HIS-038 requires. FN-S05 may move it under platform/delivery-pipeline/.
  • Example screen identifier UI-ADM-000. It is not in the screen inventory and is reserved for the example, so that no screen session's folder is taken.
  • shadcn without its CLI. The components are written by hand in the shadcn open-code style over react-aria-components. Nothing was generated with the shadcn CLI, so there is no components.json. Later components can be generated with --base aria and restyled with the tokens.
  • Focus ring. DESIGN 5 asks for a 2 px outline with a 2 px offset "plus a 4 px white inner ring". The two can only both hold by filling the offset gap. The theme uses a 2 px white ring under the outline (src/theme.css), so the outline keeps its 2 px offset.

Questions for a person

The Enterprise Architecture Board approved ADR-HIS-042 on 2026-11-24, in the review of the FN-S06 pull request, including build-time composition of the workspaces. The record's Record line and its index row say so. Two notes for owners remain, neither blocking:

  • The glossary has no Bahasa Indonesia word for the field label "Required" (CUX-15). The design system uses "Wajib diisi" until the glossary owner sets one (web/design-system/src/labels.ts).
  • The ages in the patient context zone use the units "y, mo, d, h" and "th, bln, hr, jam", which the glossary does not define either. Shell 2 uses "(65 y)". The glossary owner may want to add these units.

Follow-ups outside the card

  • Shared components from their own cards:
  • sign-on and step-up, with user, role and location in the global bar (UI-ESS-001);
  • patient search and scan in the global bar, and the patient context taken from Domain 1;
  • tasks and notifications (UI-ESS-010);
  • Break-the-Glass (UI-ESS-004);
  • the screen lock and idle timeout (CUX-38);
  • authorization of navigation entries through the policy decision point.
  • Shell chrome:
  • the keyboard shortcuts of Shell 3 rule 8, including F6 between regions;
  • the translated label catalogue for the shell's own words, which are English only for now (the design-system components already speak both languages);
  • the density switch and device profiles (data-density is fixed at standard);
  • the help menu and "Give feedback".
  • Design system: self-hosting Inter and Noto Sans (DESIGN 3; until then the system font is used); further base components (dialog with the alert tiers, tables, select and combobox, the commit-state indicator, provenance and restricted rows, the file upload component); print styles (DESIGN 8).
  • Telemetry and correlation identifiers. The shell logs a screen error with its reference to the console. Sending it to the observability platform (MOD-ISE-008), and a fetch helper in the SDK that adds correlation identifiers, come with the first screen that calls a service.
  • Pipeline (FN-S05): add the web packages to the dependency scan, the SBOM and the licence check (DEP-004). Drop the example screen's chunk from production bundles. Consider caching the pnpm store across matrix jobs.
  • Patient portal application (W20): its location, which ADR-HIS-042 leaves to the first portal screen session (also an FN-S01 follow-up).
  • Independent deployment of workspaces: a run-time loader of screen.ts registrations, when release cadence across domains requires it (ADR-HIS-042).