Skip to content

feat(studio): L13 label normalisation everywhere and the label filter - #1077

Merged
LinuxDevil merged 1 commit into
mainfrom
fb-l13
Nov 12, 2026
Merged

LinuxDevil merged 1 commit into
mainfrom
fb-l13

Conversation

@LinuxDevil

Copy link
Copy Markdown
Owner

Summary

  • shared/labels.ts is now the single label rule: normalizeLabels(input) trims, collapses inner whitespace, lowercases, dedupes and enforces the 20-label/32-char caps by throwing LabelError; labelFacetOptions and matchesLabels serve the Agents-list facet.
  • PATCH /agents/:id/meta maps LabelError to 400 LOUSHO_LABELS_INVALID; draft approve normalises patch labels before writing; template create drops invalid tags instead of failing the create.
  • The agent-detail labels module (labels.ts + its test) is deleted; LabelsEditor now uses the shared rules with a live LabelError hint, add/dedupe/long-label rejection.
  • Agents list: facet moves to ?labels=a,b (comma-separated, selection order preserved), OR matching via matchesLabels, sorted counted options, URL round-trip, cards show 3 labels then +N, and the empty filtered state uses the ticket copy with a clear-filters action.
  • New tests: src/__tests__/labels.test.ts, server/__tests__/metaLabels.test.ts, agentList/__tests__/labelFilter.test.tsx; existing label/list tests updated.

Test plan

  • vitest focused: labels.test.ts (10), metaLabels.test.ts (6), agentRoutes.meta.test.ts (7), agentListUrl (9), labelFilter (4), AgentCard (18), AgentListScreen (9), LabelsEditor (5)
  • Full server suite: 1495/1498 — the 3 initial failures were one real bug (template tag slice-before-filter, fixed) and two timing flakes that pass on re-run
  • Full client suite: 3977 passed
  • Typechecks clean; fallow dead-code clean; lint clean except pre-existing steerGate.ts:80

Generated with Devin

shared/labels.ts is now the single label rule: normalizeLabels(input)
trims, collapses inner whitespace, lowercases, dedupes and enforces the
20-label/32-char caps by throwing LabelError; labelFacetOptions and
matchesLabels serve the facet. PATCH /agents/:id/meta maps LabelError to
400 LOUSHO_LABELS_INVALID, draft approve normalises patch labels before
anything is written, and template create drops bad tags instead of
failing. The labels editor's duplicate addLabels/normalizeLabel module is
deleted in favour of the shared rules with a live LabelError hint; the
Agents list facet moves to ?labels= (comma-separated, selection order),
OR matching via matchesLabels, sorted counted options, 3-card label
chips and the ticket's no-match empty state.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@LinuxDevil
LinuxDevil merged commit f96e641 into main Nov 12, 2026
6 checks passed
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.

1 participant