fix(client): open People & Organizations detail screens in read mode (#371) #372

Merged
james merged 1 commit from 371-network-read-mode into main 2026-06-29 14:59:54 +00:00
Owner

The Person (network/[id].tsx) and Organization (network/orgs/[id].tsx) detail screens rendered every child section's add-form inline and always-visible, so they opened as one long edit form — unlike every other entity, which opens in a clean read view and reveals a form on demand. The basics card already did the right thing; the child sections didn't.

Fix

Gate each child section's add-form behind a per-section adding… toggle (matching profile.tsx's {editing && …} read-by-default pattern):

  • Person: contacts, organizations, relatives, met-through, notes.
  • Org: links, key people.
  • Read (default): the list (or empty text) + a single "Add <thing>" button (Lucide Plus, matching the existing Pencil icon idiom). Tapping it reveals the existing add-form (inputs + submit + Cancel); a successful add — or Cancel — collapses it back. On the org screen, Cancel also clears that section's error banner so a reopen starts clean.
  • Reuses existing section i18n for the open-button labels + common.{add,cancel} for submit/cancel — no new strings. Lists, empty states, per-row deletes, and the basics card are unchanged.

Verification (local, re-run in the worktree)

  • typecheck ✓ · lint ✓ · test ✓ 172 · semgrep ✓ 0 findings on both screens
  • Only the two intended files changed.

⚠️ Needs maintainer verification

Client tests are node-env — the read-vs-add collapse/expand and the Plus-icon affordance need an eye in the running app.

Closes #371

🤖 Generated with Claude Code

The Person (`network/[id].tsx`) and Organization (`network/orgs/[id].tsx`) detail screens rendered **every child section's add-form inline and always-visible**, so they opened as one long edit form — unlike every other entity, which opens in a clean read view and reveals a form on demand. The basics card already did the right thing; the child sections didn't. ## Fix Gate each child section's add-form behind a per-section `adding…` toggle (matching `profile.tsx`'s `{editing && …}` read-by-default pattern): - **Person**: contacts, organizations, relatives, met-through, notes. - **Org**: links, key people. - **Read (default)**: the list (or empty text) + a single "Add &lt;thing&gt;" button (Lucide `Plus`, matching the existing `Pencil` icon idiom). Tapping it reveals the **existing** add-form (inputs + submit + Cancel); a successful add — or Cancel — collapses it back. On the org screen, Cancel also clears that section's error banner so a reopen starts clean. - Reuses existing section i18n for the open-button labels + `common.{add,cancel}` for submit/cancel — **no new strings**. Lists, empty states, per-row deletes, and the basics card are unchanged. ## Verification (local, re-run in the worktree) - `typecheck` ✓ · `lint` ✓ · `test` ✓ 172 · semgrep ✓ 0 findings on both screens - Only the two intended files changed. ## ⚠️ Needs maintainer verification Client tests are `node`-env — the read-vs-add collapse/expand and the Plus-icon affordance need an eye in the running app. Closes #371 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(client): open People & Organizations detail screens in read mode (#371)
Some checks failed
Commits / Conventional Commits (pull_request) Successful in 4s
PR / Static analysis (pull_request) Successful in 2m17s
PR / Client (web export smoke) (pull_request) Successful in 2m32s
PR / OpenAPI (pull_request) Successful in 2m39s
PR / pnpm audit (pull_request) Successful in 2m57s
PR / OSV-Scanner (pull_request) Successful in 48s
PR / Lint (pull_request) Successful in 3m22s
PR / Test (sqlite) (pull_request) Successful in 3m55s
PR / Typecheck (pull_request) Successful in 4m3s
PR / Package age policy (soft) (pull_request) Successful in 1m1s
PR / Build (pull_request) Successful in 4m15s
Secrets / gitleaks (pull_request) Successful in 1m6s
PR / Test (postgres) (pull_request) Successful in 5m18s
PR / Coverage (soft) (pull_request) Successful in 2m47s
PR / Trivy (image) (pull_request) Failing after 3m12s
PR / E2E (Playwright) (pull_request) Successful in 7m31s
9580e80ba3
Both network detail screens rendered every child section's add-form
inline and always-visible, so they opened as one long edit form — unlike
every other entity. Gate each section's add-form behind a per-section
"adding" toggle (matching profile.tsx's read-by-default pattern).

- Person: contacts, organizations, relatives, met-through, notes.
- Org: links, key people.
- Read (default): the list + a single "Add <thing>" button (Plus icon).
  Tapping it reveals the existing form (inputs + submit + Cancel); a
  successful add — or Cancel — collapses it back. Org Cancel also clears
  the section's error banner so a reopen starts clean.
- Reuses existing section i18n + common.{add,cancel}; no new strings.
  Lists, empty states, per-row deletes, and the basics card unchanged.

Closes #371

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

📊 Test coverage

Patch coverage: no testable lines changed.

Overall (app/, lib/, db/, excluding UI per ADR-0019):

Metric Value Soft target
Lines 79.4% ≥ 50%
Branches 71.2% ⚠️ ≥ 75%
Functions 80.5% informational

Soft thresholds per ADR-0019. Coverage is informational and does not block merge.

<!-- coverage-comment --> ## 📊 Test coverage **Patch coverage:** no testable lines changed. **Overall** (`app/`, `lib/`, `db/`, excluding UI per ADR-0019): | Metric | Value | Soft target | |---|---|---| | Lines | 79.4% ✅ | ≥ 50% | | Branches | 71.2% ⚠️ | ≥ 75% | | Functions | 80.5% | informational | Soft thresholds per [ADR-0019](docs/adr/0019-coverage-soft-targets.md). Coverage is informational and does not block merge.
james merged commit bf5fb41bff into main 2026-06-29 14:59:54 +00:00
james deleted branch 371-network-read-mode 2026-06-29 14:59:54 +00:00
Sign in to join this conversation.
No description provided.