Deadline form Rule field: drop the full catalog dropdown — only Auto (from Type) or Custom (free-text) #89
Reference in New Issue
Block a user
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?
m's report (2026-05-25 14:29)
Context — what shipped
t-paliad-251 / m/paliad#82 shipped a Rule dropdown that lists every
paliad.deadline_rulesrow matching the selected event_type (with sort options including "by proceeding type"). For event_types that match multiple proceedings (e.g. an "Oral hearing" exists for UPC CFI, UPC CoA, DPMA, EPO, …), the dropdown shows 4+ near-identical options. That's catalog-noise, not signal.What m wants instead — binary model
The Rule field has just two states:
deadline_rulesFK constraint required.That's it. No "sort by proceeding type" anymore (there's nothing to sort). No long dropdown.
DB / model implications
paliad.deadlines.deadline_rule_idstays nullable; it's only set when Mode == Auto (resolved at save time from the Type's default rule).paliad.deadlines.custom_rule_text text nullholds the free-text when Mode == Custom. Migration 122 (verify slot vials internal/db/migrations/ | tail).custom_rule_text+ non-nulldeadline_rule_id= Auto. Ifdeadline_rule_id IS NULL AND custom_rule_text IS NULLafter migration → display as "keine Regel" (consistent with today's no-rule state).UI / behaviour
deadline_rule_id = <resolved>andcustom_rule_text = NULLdeadline_rule_id = NULLandcustom_rule_text = <user input>deadline_rule_idis set → show the canonical rule name + legal_sourcecustom_rule_textis set → show the literal text + a small "Custom" badgeWhat to remove from t-paliad-251's surface
Files most likely touched
frontend/src/client/deadlines-new.ts(the create-form artemis just expanded)frontend/src/client/deadlines-detail.ts(edit + display)frontend/src/deadlines-new.tsx/frontend/src/deadlines-detail.tsxfrontend/src/client/i18n.ts+frontend/src/i18n-keys.ts— addrule.auto,rule.custom,rule.custom_badge; remove the sort-option keysinternal/handlers/deadlines.go— acceptcustom_rule_texton POST/PATCHinternal/models/models.go—Deadline.CustomRuleText *string122_deadlines_custom_rule_text.up.sql(+ down)custom_rule_textHard rules
deadline_rule_id— they keep displaying as before (Auto-equivalent).go build ./... && go test ./internal/... && cd frontend && bun run buildclean.mai/<worker>/deadline-rule-auto-or-custom.Out of scope
Reporting
mai report completedwith branch + SHAs + migration slot + UX path: open deadline create form → see Auto + derived rule name → toggle to Custom → type free text → save → confirm display on detail page shows the text + Custom badge.Addendum from m (2026-05-25 14:31)
The rule/name display in the event-type selection (and possibly the rule resolution) is inconsistent — for some entries the canonical Rule text shows (e.g. "UPC RoP R.220(1)"), for others the Name shows (e.g. "Notice of Appeal"). m flags the first submissions in a proceedings sequence as where this is most visible.
In-scope for this issue: while reworking the Rule field, audit the display contract for what we show as the rule label across all selection surfaces and the deadline list/detail rows. Make it consistent. Suggested canonical: show the Name ("Notice of Appeal") as primary, with the Rule citation ("UPC RoP R.220(1)") as a small secondary chip / muted suffix.
Apply consistently in: deadline form, event-type modal, deadline list rows, deadline detail header, project Schriftsätze tab, browse-a-proceeding column rows.
Done — Auto/Custom rule + canonical display
Commit: https://mgit.msbls.de/m/paliad/commit/045accc
Branch:
mai/artemis/gitster-deadline-formMigration slot: 122 (
122_deadlines_custom_rule_text)What changed
Binary Rule field on the deadline form
rule_idderived from the chosen Type. Renders read-only asAuto · <Name · Citation>next to the field. Catalog dropdown + sort selector gone.paliad.deadlines.custom_rule_text(new nullable column). Mutually exclusive withrule_idat the persistence boundary.Schema
paliad.deadlines.custom_rule_text text NULL. Additive, no backfill needed: existing rows withrule_idset keep displaying as before; both NULL =keine Regel.models.Deadline,CreateDeadlineInput,UpdateDeadlineInput,EventListItemall carry the new field.UpdateDeadlineInputgrowsRuleSet/RuleID/CustomRuleText—RuleSet=trueis the PATCH discriminator so absent fields don't overwrite;RuleIDandCustomRuleTextare mutually exclusive in one request (service rejects "both set").Rule-label addendum (your 14:31 follow-up)
"Notice of Appeal · UPC.RoP.220.1". Custom rules render the text + aCustompill.frontend/src/client/rule-label.ts(formatRuleLabel/formatRuleLabelHTML/formatCustomRuleLabelHTML)./deadlines/newAuto display/deadlines/{id}read view + Standardtitel/eventsREGEL column (events.ts ruleDisplay)projects-detail.ts)shape-list.tsrule columnRemoved (carried over from t-paliad-251)
<select id="deadline-rule">catalog dropdown..event-type-collapsed*CSS + the override link).auto_no_match,auto_pick_type,custom_badge,custom_placeholder,mode.toggle_to_auto,mode.toggle_to_custom).Kept (per issue)
Hard rules satisfied
rule_idkeep displaying as before (Auto-equivalent).go build ./... && go test ./internal/... && cd frontend && bun run buildclean.mai/<worker>/gitster-deadline-form(matches the worktree's actual branch name).UX walkthrough
/deadlines/new→ pick a Type → Auto badge showsAuto · Name · Citation(orKeine Regel zur gewählten Verfahrenshandlungif no rule maps).Custompill./deadlines/{id}→ Bearbeiten → same toggle, mode pre-selected from the persisted state.Ready for review.