Skip to content

Comments

feat(app): add entity assignment for documents from Docs tab#445

Merged
cpcloud merged 7 commits intomainfrom
feat/424-docs-entity-assignment
Feb 21, 2026
Merged

feat(app): add entity assignment for documents from Docs tab#445
cpcloud merged 7 commits intomainfrom
feat/424-docs-entity-assignment

Conversation

@cpcloud
Copy link
Owner

@cpcloud cpcloud commented Feb 21, 2026

Summary

  • Add an Entity selector to the document add/edit forms when working from the top-level Docs tab, allowing users to link documents to any appliance, incident, maintenance item, project, quote, or vendor
  • Resolve entity names in the Entity column ("Kitchen Reno [project]" instead of "project no. 3")
  • Support inline entity editing via a select picker on the Entity column

closes #424

Test plan

  • Open the Docs tab and press a to add a new document -- verify the Entity selector appears with all entity types
  • Select an entity (e.g. a project), fill in title/file, submit -- verify the document is created with the correct entity link
  • Edit an existing document from the Docs tab -- verify the Entity selector shows the current assignment and allows changing it
  • Inline-edit the Entity column by pressing enter on it -- verify the select picker opens
  • Navigate to a scoped drilldown (e.g. Project > Docs) and add a document -- verify the Entity selector is hidden (entity fixed by context)
  • Verify the Entity column displays resolved names with kind suffixes

🤖 Generated with Claude Code

cpcloud and others added 7 commits February 21, 2026 15:44
When adding or editing a document from the top-level Docs tab, a new
Entity selector lets users link the document to any appliance, incident,
maintenance item, project, quote, or vendor. The selector is hidden in
scoped drilldowns where the entity is already fixed by context.

The Entity column now shows resolved names ("Kitchen Reno [project]")
instead of raw IDs ("project #3"), and supports inline editing via a
select picker.

closes #424

Co-Authored-By: Claude Opus 4.6 <[email protected]>
The Entity column in the Documents tab now displays a single bold
colored letter (A/I/M/P/Q/V) followed by the entity name. Each
entity kind maps to a distinct Wong palette color:

  A appliance (rose), I incident (vermillion), M maintenance (orange),
  P project (sky blue), Q quote (green), V vendor (yellow)

The letter is rendered independently from the name so highlight,
deleted, and dimmed states are handled correctly per-span.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Pressing enter on the Entity column in the Documents tab now navigates
to the linked entity's tab (e.g. P -> Projects, V -> Vendors). The
target tab is resolved dynamically from the kind-letter prefix since
the entity column is polymorphic. Unlinked documents show "Nothing to
follow."

The edit key (i) still opens the inline entity selector for
reassignment.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace the visible letter prefix with whole-name coloring: entity
names in the Docs tab are now colored by kind (project=accent,
vendor=warning, etc.) without a leading letter. The internal cell
value still carries the kind-letter prefix for linking and pinning.

Pinning on the Entity column now groups by entity kind (e.g., all
projects) rather than individual entity text, making it easy to
filter by category.

closes #424

Co-Authored-By: Claude Opus 4.6 <[email protected]>
The Entity column spec was missing Kind: cellEntity, so Enter fell
through to the "Press o to open" fallback instead of navigating to
the linked entity. Set the kind on the spec so handleNormalEnter
matches the entity branch, and add the link arrow (→) to the column
header and status bar hints.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…ptions

UpdateDocument was omitting EntityKind and EntityID from the SQL
update, silently dropping any entity assignment changes. Remove
those columns from the omit list so reassigning or clearing an
entity link persists to the database.

Also color entity selector option labels by kind (matching the
table column palette) and drop the redundant [category] suffix.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Set Height(10) on all entity select fields so the option list scrolls
within a fixed window instead of overflowing the terminal.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@cpcloud cpcloud force-pushed the feat/424-docs-entity-assignment branch from 7a8a9d8 to a46225c Compare February 21, 2026 20:45
@cpcloud cpcloud merged commit b5c1e17 into main Feb 21, 2026
12 checks passed
@cpcloud cpcloud deleted the feat/424-docs-entity-assignment branch February 21, 2026 20:55
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.

feat: Ability to assign Docs to Appliances from Docs tab

1 participant