Labels page: one-click label packs (GitHub / GitLab defaults) offered when the repo has no labels #324
Labels
No labels
actions
bug
cli
duplicate
enhancement
fork
forum
git storage
help wanted
insights
invalid
issues
moderation
oidc
ownership transfer
packages
pr/merge protection rules
projects
pull requests
question
releases
sponsorships
tags
webhooks
wiki
wontfix
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
crueber/walhub#324
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's requested
On the labels page (
/:owner/:name/labels), when the repo has no labels yet, offer one-click label packs — the default label sets from GitHub and GitLab. Clicking a pack creates its labels in the repo in one action.Current state (code evidence)
web/src/pages/Labels.jsxrenders the empty state as a bare<li class="muted">no labels yet</li>(:49) — no affordance beyond the manual create form (name + 6-hex color, one label per submit).{name, color, description}(internal/issues/model.go:150-154); creation is one-per-requestPOST …/labels(triage-gated,createLabelatinternal/issues/http.go:678). No bulk endpoint exists.Proposed design
Two built-in packs, defined as a pure constant (headless-testable,
web/src/lib/convention):GitHub set (names + the familiar colors + GitHub's descriptions):
bug(#d73a4a, "Something isn't working"),documentation(#0075ca, "Improvements or additions to documentation"),duplicate(#cfd3d7, "This issue or pull request already exists"),enhancement(#a2eeef, "New feature or request"),good first issue(#7057ff, "Good for newcomers"),help wanted(#008672, "Extra attention is needed"),invalid(#e4e669, "This doesn't seem right"),question(#d876e3, "Further information is requested"),wontfix(#ffffff, "This will not be worked on").GitLab set (scoped-name style, GitLab colors + descriptions):
bug(#d9534f),confirmed(#5cb85c, "The bug report is confirmed"),critical(#ffc107, "The issue is of high priority"),documentation(#1aaa55),improvement(#1f75cb, "An improvement to an existing feature"),support(#6cd3ea, "Further information is requested"),devops::pipelineetc. are scope-laden — keep the GitLab pack to its general set (~9 labels, GitLab's starter taxonomy) and spell the final list in the PR from GitLab's documented starter labels.(The exact hex values above are from memory of the public palettes — the implementer must verify against the live GitHub/GitLab docs and put the final table in the PR.)
Empty-state UI: when
s().labelsis empty, render a pack chooser card instead of (or above) the bare "no labels yet" line: two pack cards (name, label preview chips with their colors, count) each with an "Add pack" button. One click → creates all labels in the pack → invalidatelabels:{full}→ the chooser disappears (labels exist) and the normal list renders.Creation mechanics. No bulk endpoint exists; options:
labels.create(9 requests, human-rate, matchesuploadFilesSequentialprecedent) — no backend change, triage gate enforced per request. Partial failure (e.g. a name collision mid-pack) surfaces via the error tray; reload shows what landed.POST …/labels/pack— cleaner semantics (atomic-ish, one 403 for non-triage), more wire surface.Recommendation: (a) — human-rate, trivially correct, zero backend change; note (b) as a follow-up if atomicity ever matters. Skip existing names rather than failing the whole pack (idempotent-ish add).
Pack offer visibility: the chooser shows only in the empty state (
labels.length === 0). A repo that deleted all its labels sees the chooser again — that's fine and arguably useful; note it.Gating: the "Add pack" buttons are triage-gated client-side like the create form (the server enforces per-label anyway); non-triage viewers see the chooser read-only or not at all — match how the create form behaves for them (form renders but 403s; mirror that, don't invent new gating).
Acceptance criteria
Fix PR: #333 — empty-state GitHub/GitLab label packs (live-verified palettes in the PR table), one-click sequential create, no backend change. node --test 620/620 green, vite build green.
Review of PR #333 (fix/issue-324, one-click label packs) — verified in scratch worktree at
58f1826+ docs fixf0de0e7(pushed to origin/fix/issue-324).PALETTES — both live-verified, no issues:
CREATION PATH (Labels.jsx:52-74) — as designed, option (a):
VISIBILITY/THEMES: chooser only when labels.length===0 (Labels.jsx:82); 'no labels yet' fallback retained below. Preview chips use color dots + default text on card/border-zinc classes — legible dark+light by construction; sm:grid-cols-2 collapses to one column at 390px. No new deps (package.json untouched; imports are solid-js + local lib only) — law 1 clean. Law 7: no locks/channels touched.
ONE FIX APPLIED DIRECTLY (law 12): the commit message claimed '(02 §11 UI decision)' but added no docs entry — precedent #323 updated 02_issues.md in the same change. Added a Decisions bullet (docs/features/02_issues.md, +19/-0, pushed as
f0de0e7): pack sources, sequential-create mechanics, empty-state visibility, no-new-gating stance.TESTS (scratch worktree, node_modules symlinked from main):
RECOMMENDATION: ready to merge (pending CI).
Fixed by PR #333 (review clean — live-verified packs, sequential-create path, +law-12 doc entry by reviewer; 620/620), merged. Closing.