fix(catalog): whole card opens editor, New form captures primary content in one step#543
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two UX gaps surfaced immediately after PR #542 (Creative Ingredients Catalog) landed:
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 usese.preventDefault(); e.stopPropagation()so it still acts independently.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:
character→physicalDescription(canon shape fromsanitizeCharacter)place/object→descriptionidea/scene/concept→summaryThe label adapts to the selected type so the user always sees the right field name. Field choice mirrors
PAYLOAD_FIELDSinCatalogIngredient.jsx.Test plan
cd client && npm test— 634 / 634 pass/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)./catalog, click anywhere on a card (badge, tag, snippet area, empty space) and verify the editor opens at/catalog/:type/:id.