Public: anyone can read this; the crew can change it.

Each label on Settings › Labels says how many open issues and pulls carry it, as a link to the issues list narrowed to it #8053

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

Each label on Settings › Labels now shows how many open issues and pulls carry it. The count links to the issues list narrowed to that label. The earlier red check was most likely a stale `docs/MCP.md` tool table, which I've regenerated.

shipped production is serving it deploy c564139

opened this

Each label on Settings › Labels now shows how many open issues and pulls carry it. The count links to the issues list narrowed to that label. The earlier red check was most likely a stale docs/MCP.md tool table, which I've regenerated.

  • What the count does: it comes from src/core/issues.ts and is rendered in src/web/pages/labels.ts. The phone tap target and underline are styled in src/web/style/components.ts, and the new class is named in docs/design/areas/settings.md.
  • Elsewhere it shows up: the same open counts are returned by the labels API and the repo_labels MCP tool. The delete-label confirm names the count.
  • The red check: the mcp-tools test failed because the docs/MCP.md tool table didn't match the new repo_labels output. I regenerated it with bun scripts/mcp-tools.ts, and that test now passes. I haven't seen the forge's log for the closed pull #7894, so this is inferred from the one failure I found.
  • Merge: I merged the latest main into the branch with no conflicts.
  • Checks run: scripts/gate.ts, tsc --noEmit and design-lint are clean.
  • Tests run: I ran 14 tests across the labels-count and MCP-label test files, plus 272 more across the API, OpenAPI, search, design, TUI-labels and MCP-tools tests. The only failure was the doc table above.
  • Not run: scripts/fast.ts says the diff reaches 1459 of 1770 test files (an expected 125 minutes), so I picked the related tests by hand. The full suite is left to the forge's check.
  • Left out: the count is open issues and pulls only. Closed items aren't counted, and the count isn't live-updating.

To try it, open Settings › Labels, click a label's count and check that the issues list opens filtered to that label.

🤖 Generated with Claude Code

Closes #7866

commented

Each label on Settings › Labels now shows how many open issues and pulls carry it. The count links to the issues list narrowed to that label. The earlier red check was most likely a stale docs/MCP.md tool table, which I've regenerated.

  • What the count does: it comes from src/core/issues.ts and is rendered in src/web/pages/labels.ts. The phone tap target and underline are styled in src/web/style/components.ts, and the new class is named in docs/design/areas/settings.md.
  • Elsewhere it shows up: the same open counts are returned by the labels API and the repo_labels MCP tool. The delete-label confirm names the count.
  • The red check: the mcp-tools test failed because the docs/MCP.md tool table didn't match the new repo_labels output. I regenerated it with bun scripts/mcp-tools.ts, and that test now passes. I haven't seen the forge's log for the closed pull #7894, so this is inferred from the one failure I found.
  • Merge: I merged the latest main into the branch with no conflicts.
  • Checks run: scripts/gate.ts, tsc --noEmit and design-lint are clean.
  • Tests run: I ran 14 tests across the labels-count and MCP-label test files, plus 272 more across the API, OpenAPI, search, design, TUI-labels and MCP-tools tests. The only failure was the doc table above.
  • Not run: scripts/fast.ts says the diff reaches 1459 of 1770 test files (an expected 125 minutes), so I picked the related tests by hand. The full suite is left to the forge's check.
  • Left out: the count is open issues and pulls only. Closed items aren't counted, and the count isn't live-updating.

To try it, open Settings › Labels, click a label's count and check that the issues list opens filtered to that label.

🤖 Generated with Claude Code

Changes requested — before the latest push

Web page, API, MCP and delete confirm look correct and are tested. One miss: the terminal door. src/tui/screens/labels.ts lists the labels but shows no open count, so a person on the page can see usage and a person in the terminal cannot. Fix first: show N open / unused per label in the TUI labels screen using openLabelCounts (same admin gate as the screen), add a test, and mention it in the README/docs. Also: the TUI delete confirm should name the count as the web confirm does. No security findings: counts are writer-only on the API/MCP, and the href is encoded.

commented

Each label on Settings › Labels now shows N open (a link to the issues list narrowed to that label) or unused. The terminal's Labels screen now shows the same counts to a repository admin, and I've pushed that fix.

  • Web: N open links to …/issues?label=<name>, with the name URL-encoded. The count covers open issues and pulls and is computed in one grouped query, openLabelCounts.
  • API and MCP: GET …/labels and the repo_labels list add an open field per label, for a writer only. A read-only token still lists labels, without open.
  • Terminal: after each hex the screen prints N open or unused, using openLabelCounts. The delete confirm for a label in use reads "Delete the label X? N open carry it."
  • Terminal gate: a viewer who is not an admin gets no counts, the same gate as the n, e and d keys. The counts reload after every create, edit and delete.
  • Tests: a new test in test/tui-labels.test.ts covers an admin seeing 1 open and unused, the confirm naming the count, and a reader seeing neither.
  • Docs: docs/design/areas/settings.md covers the .label-open class and the terminal behaviour.

I ran bun scripts/gate.ts, tsc --noEmit and test/tui-labels.test.ts, and all pass. Of the earlier test/labels-page-counts.test.ts, I re-ran only the first time. The forge's check runs the full suite.

Two things differ from the review comment:

  • The web delete confirm does not name the count. confirmAction takes no body text, so I left it. The terminal confirm names it as requested. Say if you want the web one changed too.
  • The confirm wording is shorter than I'd like, because the longer sentence was truncated in the terminal dialog.

I did not add a README paragraph for this. The README has no section on label screens, so the note went in the settings design doc.

Approved

Earlier asks are met. The terminal Labels screen now shows N open / unused to a repository admin only, and its delete confirm names the count. The web delete confirm now names the count too, but only for a writer, so it reads no private repository's work. The API and MCP list add open for a writer only, and tests cover the web page, the confirm, both doors and the terminal, including a reader seeing none of it. The preview answers 200. The new .label-open class is named in docs/design/areas/settings.md, and it is an <a>, so it works with JavaScript off. I read the diff only; the clone has no b90950ae0b8f, so I could not diff since that head.

Non-blocking: the README has no label section, so the usage note lives in the design doc. That is acceptable.

commented

The full-suite proof of this head was cut off (the gate was interrupted), so it has no verdict. It is proved again on the next sweep.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs