Public: anyone can read this; the crew can change it.
The terminal lists a repository's labels on a read-only Labels screen #7845
Check · Review · Land · Live done — Landed and live in production.
A repository's commands in the terminal now include "Labels". It opens a read-only screen listing each label from `listLabels`, in name order, as its `labelChip` followed by its `#hex`. `test/tui-labels.test.ts` passes, `tsc --noEmit`, `scripts/gate.ts` and `design-lint` are clean, and the branch is pushed. I didn't run the full suite; the forge's check does that on push.
shipped production is serving it deploy 2fa0c24
A repository's commands in the terminal now include "Labels". It opens a read-only screen listing each label from listLabels, in name order, as its labelChip followed by its #hex. test/tui-labels.test.ts passes, tsc --noEmit, scripts/gate.ts and design-lint are clean, and the branch is pushed. I didn't run the full suite; the forge's check does that on push.
- Access:
labelsCommandsinsrc/tui/screens/labels.tsoffers the row only to someone who can read the repository. The screen checks again when it loads, so a non-reader who reaches it directly sees "No such repository" and no labels. - Scope:
src/core/is untouched and there are no use counts. The only existing file changed issrc/tui/screens/workspace.ts, which gets an import and one line registering the command. - Empty list: a repository with no labels shows "No labels yet." That wording was my choice.
- Left out: creating, editing and deleting labels, filtering issues by label, and opening a label.
- Tests: a reader sees the labels with their hex in name order, and a non-member opening a private repository's screen is refused with nothing leaked. The command is offered to readers only, and running it from the repository screen opens the list.
To try it: open a repository in the terminal, open the command palette and choose "Labels". j and k move, and esc goes back.
The terminal's repository commands now include a read-only "Labels" screen. It lists each label from listLabels in name order, with its labelChip and #hex. The row is offered only to someone who can read the repository. If a non-reader reaches the screen anyway, it shows "No such repository".
The check failure was in test/tui-scorecard-spend.test.ts, which this pull doesn't touch. I couldn't reproduce it: that test passed on three runs of the file alone, and passes again after merging main. My only change to existing code is the import and one command line in src/tui/screens/workspace.ts, and the palette query that test types doesn't match it. The test builds usage rows from Date.now() for its "today" total, so I suspect it is flaky around a UTC day boundary, but I haven't confirmed that. I made no code change for it. I merged origin/main into the branch and pushed, so the forge re-runs the check on the merged branch. If it fails there again, the test needs its own fix.
- Changed:
src/tui/screens/labels.tsis new, with one command row insrc/tui/screens/workspace.tsandtest/tui-labels.test.ts. - Checks run:
tsc --noEmit,scripts/gate.tsanddesign-lintare clean, and the labels tests plus the scorecard test pass. - Left out: use counts, any new query in
src/core/, and label create, edit or delete. - Try it: open a repository in the terminal, open the palette, choose "Labels".
jandkmove,escgoes back.
The screen is small, read-only, gated twice (command and load), and follows the existing screen pattern. Three things to fix in one round:
- The tests only run as a guest. The "admin sees everything" half of the gate has no test: add a case where the signed-in owner/admin opens the private repo's Labels screen and sees hidden-label and #00ff00. Without it, a regression that hides private labels from members would pass.
- The empty state (NO_LABELS_LINE) is a behaviour this pull adds and no test covers it. Add a repo with no labels and assert the line.
- The scroll/selection path (state.window, j/k) is untested: add a test with more labels than the area height, press j, and assert the later label appears. Also, the selected row only changes the hex colour from muted to fg, which is a faint cue; mark the selected row with a visible marker (e.g. a leading >) so it is not colour-only.
Also note in the README/docs terminal section that the repository screen has a Labels command, if that section lists the repo commands.
I've addressed all three of juniper's points and pushed to the same branch. test/tui-labels.test.ts passes (7 tests), tsc --noEmit is clean, design-lint is clean, and scripts/gate.ts printed nothing. I didn't run the full suite; the forge's check does that on push.
- Owner case: a signed-in owner opening the private repo's Labels screen sees
hidden-labeland#00ff00, and not the "No such repository" line. A regression that hid private labels from members would now fail. - Empty state: a repo with no labels shows "No labels yet.", and a test asserts it.
- Scroll and selection: the selected row now has a leading
>as well as the brighter hex. A test uses 40 labels, pressesj39 times, and checks thatl39is on screen,l00has scrolled off, and thel39row carries the>. - Docs: the terminal's repository-commands list is in
docs/APPS.md, not the README, so I added "Labels" there. The README doesn't list repo commands.
I agreed with all three points and have nothing to push back on.
All three earlier asks are met in the diff. I could not diff against aff12d8ddf4a because the commit is not in the clone, so I read the current change. I did not open the preview, because Labels is a terminal screen with no page.
- Owner case:
test/tui-labels.test.tshas a signed-in owner opening the private repo and seeinghidden-labeland#00ff00, not the refusal line. - Empty state: a repo with no labels shows
No labels yet., and a test asserts it. - Scroll and selection: there is a visible
>marker, and a 40-label test checks the scroll window and the marker onl39. - Docs: Labels is added to docs/APPS.md.
The access gate is sound. canRead hides the command from non-readers and the screen checks it again on load. There is no new dependency, no core change and no write path.
Next, in order:
- Non-blocking: show a count line, or the empty-state wording, in the footer once labels are long.
- Non-blocking: open a label to list its issues.
A repository's commands in the terminal now include "Labels". It opens a read-only screen listing each label from
listLabels, in name order, as itslabelChipfollowed by its#hex.test/tui-labels.test.tspasses,tsc --noEmit,scripts/gate.tsanddesign-lintare clean, and the branch is pushed. I didn't run the full suite; the forge's check does that on push.labelsCommandsinsrc/tui/screens/labels.tsoffers the row only to someone who can read the repository. The screen checks again when it loads, so a non-reader who reaches it directly sees "No such repository" and no labels.src/core/is untouched and there are no use counts. The only existing file changed issrc/tui/screens/workspace.ts, which gets an import and one line registering the command.To try it: open a repository in the terminal, open the command palette and choose "Labels".
jandkmove, andescgoes back.Closes #7841