Repository navigation
Night duty: analysis and mockups (#66) - #70
Merged
Merged
Conversation
…schedule Design analysis for issue #66: a per-child NightSchedule aggregate with versioned 1-4 week fixed schedules (EffectiveFrom, past nights frozen), per-night overrides and switches, free-text notes, a NightDuty print row and a child "Tonight" card. Includes mockups of the guardian page, the edit/switch dialogs, the child card and the printed week plan. Refs #66 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
kimipsen
marked this pull request as draft
November 8, 2026 20:50
Seed a second demo guardian ("Dad"), let the Tonight card follow the
child's date, store but don't show "changed by", and keep group
visibility out of v1. The doc now has no open questions for v1.
Refs #66
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds Features/NightDuty: a per-child NightSchedule aggregate (id == the child's UserId) with fixed-schedule versions (1-4 week cycle from an anchor Monday, EffectiveFrom never in the past, a save replaces every version from its date on), sparse per-night overrides (planned or cleared) and short notes. Five slices: ReplaceNightPattern, SetNightOverrides (a switch is two nights in one append), ClearNightOverrides, GetNightSchedule and ListNights, with the Pickups authorization tiers (guardians manage, the child views nights). Also: PrintRowKind.NightDuty, a nightDuty feature flag, GDPR eraser and exporter, inline snapshot, golden files, the nightduty Marten schema, and two small extractions the analysis called for (WeekCycle shared with WorkPattern, BabysitterNames moved to Babysitters and keyed by owner) plus UserLocalDate (the child's today) shared with Medicines. Refs #66 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… planned [skip-docs] From the branch review: - SetNightOverrides rejects nights more than 31 days apart (the response resolves every night in between, so two far-apart dates could expand millions of nights). - A babysitter archived (or a guardian removed) since a night was planned no longer blocks re-saving that version or switching that night; only people new to the replaced version or the nights being set are checked. - Re-saving the version in effect with the same content from a later date is a no-op instead of appending a duplicate version. Refs #66 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Frontend for the nighttime responsible schedule (issue #66): - NightDutyService and /guardian/night-duty: the seven nights from tonight with changed nights marked ("Schedule: Dad"), an edit dialog (guardian, babysitter, sleepover, note only, nothing planned; the scheduled note is kept), an inline two-night switch that keeps each night's note, undo, and the fixed-schedule editor (1-4 week cycle, "this week is", applies-from date, versions list) - the child's "Tonight" card on the day dashboard - PrintRowKind NightDuty in the template editor, loader and sheet (who in their template colour, "Overnight: host", the note on a second line, empty nights blank) - nav entry, help topic, a link from the pickup page, nightDuty flag - en/da strings, specs, a Playwright journey, and the demo family's second guardian (Jonas, "Dad") with a night schedule for screenshots - docs: analysis status and implementation notes, flow, glossary, aggregate map, frontend README Refs #66 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Frontend coverage
Full report: the coverage artifact of this run. |
kimipsen
marked this pull request as ready for review
November 9, 2026 09:31
…he feature Adds guardian-night-duty (desktop, mobile, tablet) and refreshes every page for the demo family's second guardian and night schedule: the child home shows the Tonight card, the print sheet a Night row. Refs #66 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ath.Combine' may silently drop its earlier arguments' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Backend coverage
Full report: the coverage artifact of this run. |
- Split the relationship check (cognitive complexity, nested ternary), the pattern status and the night-week switch/label logic into plain statements; Where before OrderBy; constants for the persisted NightResponsible property names; drop the redundant ResponsibleChoice alias. - Remove the duplicated code Sonar counted: a shared keepTabInside focus trap (rule editor and night edit dialog) and weekdayName in work-pattern.ts (both pattern editors). - .sonarcloud.properties excludes the generated API types and the en/da translation dictionaries from duplication detection only. The union-syntax findings (S3903, S1186, S3060, S2094), S8970 and S107 on handlers are known false positives (sonar-known-issues.md) and are left for marking in SonarCloud. Refs #66 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.



Analysis, mockups and implementation of #66 (nighttime responsible schedule).
Implementation status
Features/NightDuty): a per-childNightSchedulewith versioned fixed schedules, per-night overrides and notes. Five routes, aNightDutyprint row kind, anightDutyfeature flag, GDPR export/erasure, inline snapshot and golden files./guardian/night-duty(nights from tonight; change, switch and undo; fixed-schedule editor), the child's "Tonight" card, the Night print row, en/da strings, help, and a demo co-guardian ("Dad") for the screenshots.e2e/night-duty.spec.tspasses, and so dopickup-assignmentandprint-week-plan(A4 and A3 still print as one landscape page).docs/backend/analysis/night-duty.md.Doc:
docs/backend/analysis/night-duty.mdMockups
These are static HTML mockups with demo data, not built code.
Where the doc differs from the issue sketch
NightOverridden/NightOverrideCleared, the work-locations precedent) instead of batchNightOverridesSet/NightOverridesCleared. Atomicity comes from one append. ANightScheduleStartedevent is added for lazy stream creation, and events carryModifiedBybecause any guardian can write.SetNightOverrides.SetNightOverridestakes a list of(date, override)pairs (max 31) rather than one value over a range, so a switch is a single request.ListNightsalso returns the scheduled entry for overridden nights, so the week view can show "Changed · Schedule: Dad".WeekCyclehelper (taken out ofWorkPattern), andBabysitterNamesgeneralised and moved toFeatures/Babysitters(4 call sites)./guardian/night-duty, behind anightDutyfeature flag, with links to and from the pickup page.Open questions (settled)
ModifiedByis still stored on every event.Estimate: High complexity, 8–12 developer-days, or 5–8 h of agent time plus about 2 h of review.
Refs #66
🤖 Generated with Claude Code