feat(app): add entity assignment for documents from Docs tab#445
Merged
feat(app): add entity assignment for documents from Docs tab#445
Conversation
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]>
7a8a9d8 to
a46225c
Compare
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
closes #424
Test plan
ato add a new document -- verify the Entity selector appears with all entity types🤖 Generated with Claude Code