feat(command-bar): show residents under each building + search NPC names#65
Merged
Conversation
…names
The Cmd+K palette used to render every row as
HOME
home · home
That "home · home" line is just `category · plotKey` — useful for a
debugger, opaque for a player. Replaces it with the actual residents
of that building, and folds their names into the cmdk `value` string
so typing an NPC's name jumps you to the building they live in.
- Groups the flat `getNpcs()` list by `buildingId` at open-time (also
re-runs when `onNpcsChange` fires, since the roster loads async and
might not be there when Cmd+K is first hit).
- Row now reads:
Gilded Fox
Cosma, Linnea
When a building has no residents yet, the secondary line falls
back to a muted "no residents yet".
- Fallback label switched from `HOME` (id-uppercased) to `Home`
(title-cased) — reads as a place name, not a shouted key.
- `value={label + id + residentNames.toLowerCase()}` — search matches
building labels, ids, or any NPC name typed as-is.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
The Cmd+K palette used to render every row as
That secondary line was
category · plotKey— useful for a debugger, opaque for a player. Replaces it with the actual residents of that building, and folds their names into the cmdkvaluestring so typing an NPC's name jumps you to the building they live in.Before → after
Before
After
What changed
getNpcs()list bybuildingIdat open-time (also re-runs whenonNpcsChangefires, since the roster loads async and might not be there when Cmd+K is first hit).,. When a building has no residents yet, it falls back to a muted "no residents yet".HOME(id-uppercased) toHome(title-cased) — reads as a place name, not a shouted key.value={label + id + residentNames.toLowerCase()}— search now matches building labels, ids, or any NPC name typed as-is.Overflow handling
Residents line has
truncate(CSS ellipsis). Up to ~3 names fit; the rest get…. Search still finds them because cmdk filters against the full value string. Follow-up: if that gets ugly on packed buildings, switch toCosma, Linnea +3 more.🤖 Generated with Claude Code