Tree view: center a person between multiple spouses

family-chart 0.9.0 stacks all of a person's spouses on one gender-determined
side, so someone with two spouses (e.g. a woman with two husbands) renders
with both spouses piled above/below her and ambiguous child lines.

Patch the library (via patch-package) so the person stays centered and their
spouses split to alternating sides — spouse 1 above, spouse 2 below, further
spouses farther out — and order each couple's children to match, so children
descend from between the correct pair without crossed lines:

- setupSpouses: keep the person centered; place spouses at alternating
  offsets and recenter the cluster on the person's slot.
- sortChildrenWithSpouses: order children by spouse order (gender-independent)
  to match the new spouse positions.

Adds patch-package + a postinstall hook, and COPY patches into the Dockerfile
deps stage so the patch applies during `npm ci` in CI. Verified the patch
re-applies on a clean install and the production build passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Justin Paul <justin@jpaul.me>
This commit is contained in:
2026-06-08 19:56:17 -04:00
parent 77b78410ff
commit 182a5dab16
4 changed files with 789 additions and 1 deletions
+2
View File
@@ -7,6 +7,7 @@
"build": "next build",
"start": "next start",
"lint": "next lint",
"postinstall": "patch-package",
"gen:api": "openapi-typescript ./openapi.json -o ./lib/api/schema.d.ts --default-non-nullable false"
},
"dependencies": {
@@ -26,6 +27,7 @@
"@types/react": "^19.0.0",
"@types/react-dom": "^19.0.0",
"openapi-typescript": "^7.5.0",
"patch-package": "^8.0.1",
"postcss": "^8.4.49",
"tailwindcss": "^4.0.0",
"typescript": "^5.7.0"