fix(client): People and Organizations detail screens open in edit mode (should be read-mode by default) #371

Closed
opened 2026-06-29 14:36:48 +00:00 by james · 0 comments
Owner

The Person (network/[id].tsx) and Organization (network/orgs/[id].tsx) detail screens render every child section's add-form inline and always-visible — contacts, organizations, relatives, met-through, notes (person) and links, key-people (org). So the screen opens as one long edit form, unlike every other entity, which opens in a clean read view and reveals an add/edit form only on demand.

The "basics" card on both screens already does the right thing (editingBasics defaults to false → read view + Edit button). The child sections don't follow suit.

Expected (matches profile.tsx)

profile.tsx gates its contacts add-form behind an editing toggle ({editing && (…)}): read view by default, form revealed on demand. The network detail screens should match — open in read mode.

Fix

For each child section in both screens, gate the add-form behind an "Add …" affordance:

  • Read state (default): the list (or empty text) + a single "Add <thing>" button.
  • Tapping it reveals that section's existing add-form (inputs + submit + a Cancel); submitting or cancelling collapses it back to read.
  • A per-section adding<Section> boolean is the simplest gate. Reuse existing i18n for the open-button label (the section's addButton string) and common.{add,cancel} for the form's submit/cancel — no new strings needed beyond an icon.

Out of scope

  • Per-row delete buttons can stay as they are (the complaint is the always-open input forms, not the inline deletes).

Verify

  • pnpm -F @carol/client typecheck / lint / test; semgrep on the two screens. Visual read-vs-add behavior is maintainer-verified (client tests are node-env).
The Person (`network/[id].tsx`) and Organization (`network/orgs/[id].tsx`) detail screens render **every child section's add-form inline and always-visible** — contacts, organizations, relatives, met-through, notes (person) and links, key-people (org). So the screen opens as one long edit form, unlike every other entity, which opens in a clean **read** view and reveals an add/edit form only on demand. The "basics" card on both screens already does the right thing (`editingBasics` defaults to false → read view + Edit button). The child sections don't follow suit. ## Expected (matches `profile.tsx`) `profile.tsx` gates its contacts add-form behind an `editing` toggle (`{editing && (…)}`): read view by default, form revealed on demand. The network detail screens should match — open in read mode. ## Fix For each child section in both screens, gate the add-form behind an "Add …" affordance: - Read state (default): the list (or empty text) + a single "Add &lt;thing&gt;" button. - Tapping it reveals that section's existing add-form (inputs + submit + a Cancel); submitting or cancelling collapses it back to read. - A per-section `adding<Section>` boolean is the simplest gate. Reuse existing i18n for the open-button label (the section's `addButton` string) and `common.{add,cancel}` for the form's submit/cancel — no new strings needed beyond an icon. ## Out of scope - Per-row delete buttons can stay as they are (the complaint is the always-open input forms, not the inline deletes). ## Verify - `pnpm -F @carol/client typecheck` / `lint` / `test`; semgrep on the two screens. Visual read-vs-add behavior is maintainer-verified (client tests are node-env).
james closed this issue 2026-06-29 14:59:54 +00:00
Sign in to join this conversation.
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
james/carol#371
No description provided.