Repository navigation
feat(studio): L13 label normalisation everywhere and the label filter - #1077
Merged
Merged
Conversation
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>
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
shared/labels.tsis now the single label rule:normalizeLabels(input)trims, collapses inner whitespace, lowercases, dedupes and enforces the 20-label/32-char caps by throwingLabelError;labelFacetOptionsandmatchesLabelsserve the Agents-list facet.PATCH /agents/:id/metamapsLabelErrorto400 LOUSHO_LABELS_INVALID; draft approve normalises patch labels before writing; template create drops invalid tags instead of failing the create.labels.ts+ its test) is deleted;LabelsEditornow uses the shared rules with a liveLabelErrorhint, add/dedupe/long-label rejection.?labels=a,b(comma-separated, selection order preserved), OR matching viamatchesLabels, 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.src/__tests__/labels.test.ts,server/__tests__/metaLabels.test.ts,agentList/__tests__/labelFilter.test.tsx; existing label/list tests updated.Test plan
vitestfocused: labels.test.ts (10), metaLabels.test.ts (6), agentRoutes.meta.test.ts (7), agentListUrl (9), labelFilter (4), AgentCard (18), AgentListScreen (9), LabelsEditor (5)steerGate.ts:80Generated with Devin