Protective equipment for guides (#95) #111

Merged
miko merged 2 commits from feature/95-protective-equipment into development 2026-11-05 12:49:26 +01:00
Owner

Closes #95

Summary

A guide can call for any of eight kinds of Personal Protective Equipment, ticked in its properties and shown as self-drawn pictograms in the style of ISO 7010 mandatory signs (blue disc, white symbol), each with its name.

 schema
+  enum ProtectiveEquipment      eyeProtection … hairAndJewellery (fixed list, issue order)
+  model GuideProtectiveEquipment (guideId, equipment) PK, cascade on guide delete

 <GuidePropertiesForm>            saveGuideProperties → guidePropertiesFrom
+  <ProtectiveEquipmentChoice>    checkbox per kind with its pictogram; replaced on every save
 src/guides/protectiveEquipment.ts
+  protectiveEquipmentFrom(formData)     → kinds in list order | {error}
+  protectiveEquipmentFromRows(rows)     → kinds in list order
+  protectiveEquipmentLabels(kinds,i18n) → [{equipment, text}]
 src/guides/pictograms.ts
+  PICTOGRAMS: shapes on a 100×100 canvas, shared by SVG and react-pdf
+  INK_COLOURS hard-coded (ISO 7010 fixes them; outside the theme on purpose)

 shown in
+  read view, below the header (and so print)   <ProtectiveEquipmentList>
+  PDF, after the effort badges                 <Equipment> with <PdfPictogram>

Without any ticked nothing is shown. Per guide only, no per-step data, no inheritance from the category. GLOSSARY: new entry Personal Protective Equipment.

Evidence

  • New protectiveEquipment.test.ts, ProtectiveEquipmentList.test.tsx, extended properties.test.ts and PDF render test with all eight kinds.
  • vitest run → 52 files, 414 tests passed; tsc --noEmit and eslint clean; migration applied to the dev DB.

Merge Danger

Door: two-way

Additive migration: one new table and enum, no backfill.

Blast Radius: small

Only the guide page, properties form and PDF touch the new data. Not yet done, by dependency: the Step-by-Step View start screen (#98, not built yet; ProtectiveEquipmentList is reusable there) and versioning (#106): like difficulty/duration, the equipment saves with the properties (immediately, no version bump) and must move into the versioned content, flattened into the snapshot, when the working copy lands.

🤖 Generated with Claude Code

Closes #95 ## Summary A guide can call for any of eight kinds of **Personal Protective Equipment**, ticked in its properties and shown as self-drawn pictograms in the style of ISO 7010 mandatory signs (blue disc, white symbol), each with its name. ```diff schema + enum ProtectiveEquipment eyeProtection … hairAndJewellery (fixed list, issue order) + model GuideProtectiveEquipment (guideId, equipment) PK, cascade on guide delete <GuidePropertiesForm> saveGuideProperties → guidePropertiesFrom + <ProtectiveEquipmentChoice> checkbox per kind with its pictogram; replaced on every save src/guides/protectiveEquipment.ts + protectiveEquipmentFrom(formData) → kinds in list order | {error} + protectiveEquipmentFromRows(rows) → kinds in list order + protectiveEquipmentLabels(kinds,i18n) → [{equipment, text}] src/guides/pictograms.ts + PICTOGRAMS: shapes on a 100×100 canvas, shared by SVG and react-pdf + INK_COLOURS hard-coded (ISO 7010 fixes them; outside the theme on purpose) shown in + read view, below the header (and so print) <ProtectiveEquipmentList> + PDF, after the effort badges <Equipment> with <PdfPictogram> ``` Without any ticked nothing is shown. Per guide only, no per-step data, no inheritance from the category. GLOSSARY: new entry Personal Protective Equipment. ## Evidence - New `protectiveEquipment.test.ts`, `ProtectiveEquipmentList.test.tsx`, extended `properties.test.ts` and PDF render test with all eight kinds. - `vitest run` → 52 files, 414 tests passed; `tsc --noEmit` and `eslint` clean; migration applied to the dev DB. ## Merge Danger **Door:** two-way Additive migration: one new table and enum, no backfill. **Blast Radius:** small Only the guide page, properties form and PDF touch the new data. Not yet done, by dependency: the Step-by-Step View start screen (#98, not built yet; `ProtectiveEquipmentList` is reusable there) and versioning (#106): like difficulty/duration, the equipment saves with the properties (immediately, no version bump) and must move into the versioned content, flattened into the snapshot, when the working copy lands. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A guide can call for any of eight kinds of personal protective equipment,
ticked in its properties. Each shows as a self-drawn pictogram in the style
of an ISO 7010 mandatory sign with its name, at the top of the guide and in
print and PDF.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ISO 7010 fixes a mandatory sign's colours, so they stay outside the theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
miko merged commit 3d69496a15 into development 2026-11-05 12:49:26 +01:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
MassiveDynamic/kataba!111
No description provided.