Repository navigation
feat(plannings): the day dialog lists each shift's pause start and stop times (#1741) - #1749
Merged
Merged
Conversation
…op times (#1741) The web showed only pause totals, although the DTO already carries the recorded Pause{N}StartedAt/StoppedAt stamps. The day dialog now lists each shift's pauses as read-only clock ranges ("Pause 10:02–10:17"), built by buildPauseSegments, which applies the rules of the backend's BuildMergedPauseSegments per shift. A pause that is still running is shown open-ended. A shift with a pause override lists nothing, because its served stamps are synthesized. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Zone-less production timestamps display incorrectly outside UTC, and shared unit-test state causes a new test to fail.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Adds recorded pause ranges to each shift in the workday dialog.
Changes:
- Builds, sorts, and merges pause segments.
- Displays pause ranges per shift while respecting overrides.
- Adds unit and Playwright coverage.
| File | Description |
|---|---|
workday-entity-dialog.component.ts |
Builds pause segments per shift. |
workday-entity-dialog.component.spec.ts |
Tests grouping and overrides. |
workday-entity-dialog.component.html |
Renders pause ranges. |
pause-segments.util.ts |
Implements pause normalization and merging. |
pause-segments.util.spec.ts |
Tests segment-building rules. |
day-dialog-pause-times.spec.ts |
Adds end-to-end dialog coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ther cases leave behind (#1741) The dialog spec shares one data object across the suite, and the Approach C "prefers the served override" case leaves pause1OverrideMinutes set. The recorded-pause block now clears every override and stamp it reads before each case as well as after, so shift 1 is not seen as overridden. buildPauseSegments now also accepts the Date stamps the core DateInterceptor hands the dialog (date-fns parseJSON, zone-less strings read as UTC), with a case covering that shape. 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.


Summary
The customer asked to see pause start and stop times on the web. Until now the board and the day dialog showed only pause durations. The dialog now lists each shift's recorded pauses under its pause field, one line each, e.g. "Pause 10:02–10:17".
How
pause-segments.util.ts(buildPauseSegments) applies the rules of the backend'sBuildMergedPauseSegments/ResolveShiftSeconds:ProjectPauseOverridesOntoDtoreplaces the stamps with one synthesized pair carrying the override's length, so they are not times anyone recorded.Deliberate choices
HH:mm, UTC like the rest of the grid) under 5-minute intervals too, the same way the grid already shows shift stamps. They are not rounded to 5 minutes.BuildMergedPauseSegmentsis private. The TypeScript version is covered by its own Jest cases.Tests
pause-segments.util.spec.ts: an empty shift, out-of-order slots, overlapping and touching merges, an open pause, the past-midnight clamp, and invalid pairs.workday-entity-dialog.component.spec.ts: sub-slot and primary-slot pauses are grouped and ordered per shift, an open pause appears on shift 2, and an overridden shift lists nothing.s/day-dialog-pause-times.spec.ts: the test intercepts the grid's index response (nothing is written to the database).Not verified
The tests were not run locally (they run in CI only), and the Angular code was not compiled locally. The util passes
tsc --stricton its own, and the spec type-checks against the frontend's Playwright types.Refs #1741
🤖 Generated with Claude Code