Repository navigation
feat(web): make an Event repeat from the create dialog and mark repeating Events in the list - #231
Open
mwg-bender[bot] wants to merge 1 commit into
Open
mwg-bender[bot] wants to merge 1 commit into
mwg-bender[bot] wants to merge 1 commit into
Conversation
…ting Events in the list
The create Event dialog gets a Repeat section (off with every opening, never
shown in Edit): Weekly, Every other week, Monthly on the nth weekday (First to
Fourth or Last, and the weekday), Monthly on the same date, Yearly on the same
date and Yearly on a holiday (the HolidayPreset list by readable name), plus
an optional end date. The week, weekday and holiday default from the picked
date until the admin picks one. An end that is not after the start shows the
API's own "End must be after the start." and disables Create.
Create with Repeat on sends one POST api/series (new SeriesService, same
Idempotency-Key handling as the Event create, the key kept across ambiguous
failures) and no Event: Name, Schedule { First exactly as BuildEventDate makes
it with the browser's offset kept, Rule, End at the start's time and offset },
the dialog's slot count, Unique games only and the Filters. The roll shown is
not saved; a hint under the switch says so. Success closes the dialog and
reloads the list; a refusal shows the API's message in the dialog's alert.
The Events list marks every Occurrence (SeriesId set) with a "Repeats" icon
beside its name, inside the Name column, so the grid template is unchanged.
The pure model is RepeatChoice; the section is RepeatSection.
Every Web reader of Selections was checked with an empty Occurrence; all
already coped, and new tests pin it.
Refs #100, #204
Contributor
Author
Worker notes (t_176130e2): disposition, audit, observationsDISPOSITION
Behaviour decision to flag: the Repeat choices count as unsaved changes (they are in the dialog's Audit: every Web file that reads an Event's
|
| File | Result |
|---|---|
Shared/Events/EventList.razor (Selections count, Winner column) |
copes already: shows 0 and None. Test EmptyOccurrenceTests.TheList_MarksTheOccurrenceOnly_AndShowsZeroSelectionsAndNoWinner; live F2 |
Shared/Events/EventDetailsDialog.razor (single-Selection line, cards, Select Winner) |
copes already: no cards, no Select Winner, no error. Test Details_OfAnEmptyOccurrence_OpensWithoutError_AndOffersNoWinner; live F5 |
Shared/Events/AnnouncementText.cs (Copy announcement) |
copes already (#227): "The picks are still to come." Tests AnnouncementCopyTests.AnEventWithNoSelections_CopiesThatThePicksAreStillToCome, AnnouncementTextTests.NoSelections_SaysThePicksAreStillToCome; live F5 read the clipboard back |
Shared/Events/EventEditDialog.razor (opening an Occurrence for Edit) |
copes already: opens with no slots, no error, no Repeat section. Test Edit_OfAnEmptyOccurrence_OpensWithoutError; live F6 |
| Select Winner | copes already: there is no Selection, so no button (same test as the details dialog) |
Services/PlayStats.cs (Stats page, Activity performance panel, Play stats) |
copes already: an empty Occurrence offers nothing; no Offered, wins or Likes counted, and the win rate stays null (no division by zero). Tests PlayStats_CountsNothingForAnEmptyOccurrence, TheStatsPage_RendersWithAnEmptyOccurrence (no "NaN"); live F7a, F7b |
Services/RecentActivities.cs (avoid recent) |
copes already: Selections is { Count: > 0 } filter from #221. Not re-tested here |
Shared/Activities/CommentsPanel.razor, ActivityPerformancePanel.razor |
read the Events list only for names, or through PlayStats; covered above |
Shared/Events/SlotPanel.razor, Services/SlotPlanner.cs, EventMetricsForm.razor, PerformanceFormat.cs |
the word only (slot counts, messages, comments); they do not read an Event's Selections |
Observations for Nerd (not fixed)
- API/Shared gap (STOP item, not fixed):
SeriesFiltershas no avoid recent, players tonight or longest duration, but the spec and ADR 0002 put them in the Series' slot template. The dialog does not send them. A Series made with those Filters on loses them silently. - A repeating create still rolls the dialog's slots, which are thrown away. The hint says so. Hiding or greying the slots while Repeat is on is a layout opinion.
- The failure prefix is still "The event was not saved." for a Series. "The repeating event was not saved." might read better; I kept the shared helper as the card asked.
- Editing an empty Occurrence and pressing Update Event shows "Select 1–5 activities before saving…": rolling it belongs to the next card.
- When the picked date is not a holiday, the Holiday select defaults to New Year's Day (the first row of the table).
- Test harness: bUnit leaves
current-checkedoff a switch that is off, but a real<fluent-switch>writescurrent-checked="false". My first F1 script misread that as on; the corrected flow reads the element'schecked.
For the docs card
- GLOSSARY: Series and Occurrence are no longer "planned": an admin makes a Series from the create Event dialog's Repeat section. Name the rules in the dialog's words and the holiday presets by readable name. An Occurrence carries the "Repeats" marker in the Events list, and with no Selections it shows 0 and None.
- GLOSSARY, Filters: a Series keeps Game, Theme and Holiday Filters, Themed only and Unique games only, but not avoid recent, players tonight or longest duration (see observation 1, unless the API grows them first).
- ADR 0002, Consequences: the Web readers of Selections were checked with an empty Occurrence (the list above).
docs/api-validation.md: no change; the Web usesPOST /api/seriesas documented.
Summary
🎉 No failed tests in this run. Github Test Reporter by CTRF 💚 |
This was referenced Nov 25, 2026
This branch has not been deployed
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
Web part 1 of the recurring Events spec (#204, covers #100). The create Event dialog gets a Repeat section. Creating with Repeat on sends one
POST api/seriesand no Event; the Series makes its Occurrences itself. The Events list marks every Occurrence with a "Repeats" icon. Every Web reader of an Event's Selections was checked with an Occurrence that has none; all already coped, and new tests pin it.Change
Services/SeriesService.cs(new, scoped, registered inAppServices):CreateAsync(SeriesEntity, Guid idempotencyKey), i.e.POST api/serieswith theIdempotency-Keyheader, sent the wayEventService.SaveAsyncsends it.Shared/Events/RepeatChoice.cs(new, pure: no clock, no JS, no services): the admin's choices in, theRecurrenceSeries(First, Rule, End) out.EndProblemgives the API's ownEnd must be after the start.Shared/Events/RepeatSection.razor(new):Repeatswitch and the hint line;Repeatsselect;Week of the monthandWeekday, shown only for Monthly on the nth weekday;Holiday, shown only for Yearly on a holiday;Ends on (optional).Shared/Events/EventEditDialog.razor(315 → 353 lines):BuildEventDate()makes it (offset kept), the dialog's slot count, Unique games only, and Filters { ThemedOnly, GameIds, ThemeIds, HolidayIds };_createKey;SendAsync) between the Event save and the Series save, so a success closes the dialog and reloads the list, and a failure shows the API's message in the dialog'srole="alert".Shared/Events/EventList.razor: the Name column became a TemplateColumn with the marker. Its sort is still by name, and the grid template is unchanged.RepeatChoiceTests,RepeatSectionDialogTestsandEmptyOccurrenceTestsare new.ServiceRouteContractTestsgets the SeriesService row and a key-header test.PageHarnessregisters SeriesService, andStubApiHandlerrecordsIdempotency-Key.No API, Shared, Api.Tests, docs or
.githubfile is touched.Validation
All numbers are from the worker's own cold builds (
clean-build.sh, then build--no-incremental, then test--no-build).b4d825ef3700f3Web +57: RepeatChoiceTests 29, RepeatSectionDialogTests 22, EmptyOccurrenceTests 5, ServiceRouteContractTests +1. No test was removed or renamed.
Mutations: 17 run, all killed, each by the test it names (wrong rule kind; nth week and nth weekday off by one; Last sent as Fourth; End dropped; offset lost to UTC; SlotCount fixed; Filters not sent; both an Event and a Series sent; key regenerated on retry; section shown in Edit; Repeat not reset; marker inverted and marker on every Event; the empty guard removed in the details dialog, in PlayStats and in the announcement; Create not disabled). The list is in the evidence file on the card.
Live flows were run by the worker under
with-slot.sh(debug API, published Release web behind SWA, headless Chromium, browser zone America/Chicago). Dates were typed and Enter pressed, because the calendar popup does not open headless.origin/dev2026-12-11T01:00:00Z,2027-01-15T01:00:00Z; list 12/10/2026 and 1/14/2027 7:00 PM2026-11-27T00:00:00Z; list 11/26/2026 6:00 PMF2 to F9 on the branch ran on the same content as
f3700f3, uncommitted at the time. (*) In that run F1 reported FAILcurrent-checked=false, a script bug: a real<fluent-switch>writescurrent-checked="false"while off. With the check corrected to read the element'schecked, F1 was re-run on a detached checkout off3700f3: PASScurrent-checked=false checked=false selects=0. Every run also passed the 10 baselineapi_flows.pychecks.Not run: the screen-reader and keyboard pass in a real browser. The accessible names and Tab order are checked in bUnit only (
EveryRepeatControl_HasItsAccessibleName_AndIsInTheTabOrder).Notes
Refs #100, #204: Nerd closes the issues by hand. Out-of-scope findings and the audit table are in the PR comment.