Skip to content

fix(catalog): whole card opens editor, New form captures primary content in one step#543

Merged
atomantic merged 4 commits into
mainfrom
fix/catalog-card-clickable-and-content-on-new
May 30, 2026
Merged

fix(catalog): whole card opens editor, New form captures primary content in one step#543
atomantic merged 4 commits into
mainfrom
fix/catalog-card-clickable-and-content-on-new

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

Two UX gaps surfaced immediately after PR #542 (Creative Ingredients Catalog) landed:

  1. Only the small name text in each catalog card was a <Link>. Clicking the card body — the badge, the tags, the snippet, the empty space — did nothing. Users would create an ingredient, see no obvious way to open the editor, and report it as "I can't edit it." The whole card is now the link; the delete button overlays the top-right corner and uses e.preventDefault(); e.stopPropagation() so it still acts independently.

  2. The inline "New" form only collected Type + Name. To capture a one-line idea, the user had to create the stub, navigate into the editor, fill the field, and save — four steps for content that could land in one. The form now includes an optional content textarea that maps to the per-type primary field on submit:

    • characterphysicalDescription (canon shape from sanitizeCharacter)
    • place / objectdescription
    • idea / scene / conceptsummary

    The label adapts to the selected type so the user always sees the right field name. Field choice mirrors PAYLOAD_FIELDS in CatalogIngredient.jsx.

Test plan

  • cd client && npm test — 634 / 634 pass
  • Manual: open /catalog, click "New", pick each type and verify the textarea label changes; create one with no content (stub, like before) and one with content (lands in the right payload field per type).
  • Manual: open /catalog, click anywhere on a card (badge, tag, snippet area, empty space) and verify the editor opens at /catalog/:type/:id.
  • Manual: click the trash icon on a card; verify the delete confirm row appears in place AND the card does not navigate.

atomantic added 4 commits May 29, 2026 21:06
…content in one step

Two related UX gaps in the freshly-landed Catalog page (PR #542):

1. Only the small name text in each card was a Link — clicking the card body, badge, tags, or empty space did nothing, leaving users without an obvious path to the editor. The whole card is now the link; the delete button overlays the top-right corner and stops propagation so it still works independently.

2. The inline 'New' form only had Type + Name, so users had to create, then click in, then fill, then save just to capture a one-line idea. The form now includes an optional content textarea that lands in the per-type primary field (physicalDescription for character, description for place/object, summary for idea/scene/concept) — matching the field labels in CatalogIngredient.jsx.
…n pr while armed, drop dead event guards

- Cancel button and toolbar 'New' toggle now route through a single closeForm() helper that clears name + content alongside hiding the form. Without this, dismissing the form left stale text that reappeared the next time it opened — newly noticeable because the form now contains a 4-row textarea.

- Label '{Physical Description|Description|Summary} (optional)' is now derived from PRIMARY_CONTENT_KEY via a sibling PRIMARY_CONTENT_LABEL map, so a future type→key remapping can't desync the label from where content actually lands.

- When armed, the Link's right padding bumps from pr-10 to pr-32 to keep the 'Delete? Yes No' pill from overlapping the title/snippet area on narrow cards. Added shadow-sm to the pill so its boundary is unambiguous.

- Dropped preventDefault/stopPropagation from the delete handlers — the delete control is a sibling of the Link, not a descendant, so clicks on it never traverse the anchor. Comment explains the layout invariant for future readers.
…aracter content created via the New form is searchable

ingredientEmbedSeed only included description/summary/notes/background — characters store their main narrative text in physicalDescription/personality (per sanitizeCharacter), so the embedding seed was effectively name-only for every character. Surfaced by codex review on PR #543's new inline content field: 'character' maps to physicalDescription, which then bypassed embedding entirely. Adding both fields restores parity with how the form treats the other types.

The DB-side search_tsv has the same gap (it indexes description/notes/background/summary but not physicalDescription/personality); that fix needs a schema migration + version bump and stays tracked in PLAN.md as [catalog-fts-character-fields].
… optimistic prepend on current filter

- ingredientEmbedSeed: include role, motivations, slugline, era, significance alongside the existing fields. Every canon narrative field across all six ingredient types now feeds the vector seed — characters' role/motivations, places' slugline/era, objects' significance were all dropping out before.

- payloadSnippet: extend the fallback chain to personality / significance / role so objects-with-only-significance and characters-with-only-personality stop rendering as blank-snippet rows in the catalog list.

- handleCreate: only prepend the freshly-created row when it would actually pass the current type filter + search text. Without this, creating a 'character' while filtered to 'idea' showed the new row in the wrong view until the next refetch.
@atomantic atomantic merged commit 8e500bf into main May 30, 2026
2 checks passed
@atomantic atomantic deleted the fix/catalog-card-clickable-and-content-on-new branch May 30, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant