fabrica

hanna/fabrica

feat(web): auto-apply labels from the issue/PR dropdown

aa69dc9 · hanna committed on 2026-07-26

Toggling a label in the editor submits immediately again (data-autosubmit)
instead of requiring an explicit Apply; the button is kept only as a
noscript fallback.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed by hannaSSH key fingerprint: SHA256:4g9cWhkAAw8gwqhJUcVbSnGEvdGwklW+1Aa/fMUu59k
1 files changed · +5 −4UnifiedSplit
crates/web/src/issues.rs +5 −4
@@ -482,8 +482,8 @@ pub(crate) async fn assignee_form(
482482
483/// The label editor for an existing issue/PR: a `<details>` dropdown whose toggle483/// The label editor for an existing issue/PR: a `<details>` dropdown whose toggle
484/// shows the applied labels as chips (JS replaces the "Select labels" text), the484/// shows the applied labels as chips (JS replaces the "Select labels" text), the
485/// same control as the new-issue picker. Checking labels and pressing Apply POSTs485/// same control as the new-issue picker. Toggling a label auto-submits the whole
486/// the whole set; the button also works without JS.486/// set; a noscript Apply button keeps it working without JS.
487pub(crate) fn label_form(487pub(crate) fn label_form(
488 issue: &Issue,488 issue: &Issue,
489 repo_labels: &[Label],489 repo_labels: &[Label],
@@ -504,12 +504,13 @@ pub(crate) fn label_form(
504 label class="checkbox" {504 label class="checkbox" {
505 input type="checkbox" name="label" value=(l.id) checked[is_on(&l.id)]505 input type="checkbox" name="label" value=(l.id) checked[is_on(&l.id)]
506 data-label-name=(l.name)506 data-label-name=(l.name)
507 data-label-color=(css_color(&l.color));507 data-label-color=(css_color(&l.color))
508 data-autosubmit;
508 " " span class="label-swatch" style=(format!("--label-color: {}", css_color(&l.color))) {}509 " " span class="label-swatch" style=(format!("--label-color: {}", css_color(&l.color))) {}
509 " " (l.name)510 " " (l.name)
510 }511 }
511 }512 }
512 button class="btn btn-primary inline-btn label-apply" type="submit" { "Apply" }513 noscript { button class="btn inline-btn label-apply" type="submit" { "Apply" } }
513 }514 }
514 }515 }
515 }516 }