Skip to content

WebUI: operator-friendly schedule editor (replaces raw cron) #444

@lonix

Description

@lonix

Problem

Three config keys today store raw cron strings:

  • voicetracking.announcements.schedule (default "0 16 * * 5")
  • voicetracking.cleanup.schedule (default "0 0 * * *")
  • leaderboard_roles.update_cron (default "0 0 * * 1")

Raw cron is power-user-only. The vast majority of real operator intents — "Friday at 4pm", "every night at midnight", "Mondays at midnight" — can be expressed as (frequency, time-of-day, day). Exposing cron syntax in the admin panel is a discoverability and accuracy hazard for the same audience #436 / #439 is targeting with human labels and dropdowns.

Proposed change

  • Add a cron type discriminator to SettingMetadata (lands naturally next to the type field proposed in WebUI: dropdown selectors for channel/category/role config keys (replace freetext) #439).
  • Renderer for cron type shows three controls:
    • Frequency dropdown: daily | weekly | monthly | custom.
    • Time of day picker: HH:MM.
    • Day picker: weekday for weekly, day-of-month for monthly, hidden for daily.
  • Saving converts the picker values to a cron string and stores the existing format unchanged — no schema migration, the backend still receives 0 16 * * 5.
  • Picking custom reveals a raw cron text input as an escape hatch for power users.
  • When loading an existing value, parse the stored cron and reverse-engineer the picker state; unknown patterns fall back to custom.

Acceptance

  • All three schedule keys render as the friendly picker by default.
  • A round-trip (save → reload page) reproduces the same picker state.
  • Picking custom and entering a raw cron string still works.
  • Existing cron values in the DB read correctly into the picker.

Notes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions