fix(occupancy): handle multi-exception date collisions, unescape modal newlines, and show pending deletes #231

Open
opened 2026-10-03 07:23:27 +00:00 by gabogg · 0 comments
Owner

Follow-up for PR #177 (next-day settings activation, #114) addressing pass-3 review findings P3-K, P3-N, P3-O, and P3-P:

Scope

  1. Multiple Exceptions for Same Date (P3-K): Two pending exceptions for the same date both list and both activate at boundary, where the last upsert silently wins. Enforce validation or clear superseding behavior for same-date pending exceptions.
  2. Escaped Newlines in Confirm Dialog (P3-N): The confirmation dialog displays a literal \n because app/static/js/i18n.js has escaped \\n.
  3. Ambiguous Notice Timing Copy (P3-O): "próximo día comercial" and "tomorrow's business cycle reset" can read as today's reset when saving before today's reset time. Explicitly name the target calendar date (YYYY-MM-DD) in the notice copy.
  4. Visibility of Pending Deletes (P3-P): An active exception with a pending delete disappears from the list immediately (occupancy_service.py:520-527), preventing users from seeing its pending deletion status or cancelling it. Keep it visible with a [PENDING DELETE] badge and cancellation action.

Acceptance Criteria

  • Staging a second exception for an already-pending exception date either explicitly supersedes the prior pending exception or rejects with an informative validation error.
  • Confirmation dialogs in i18n.js render natural line breaks without literal \n characters.
  • Pre-save confirmation dialogs and notices display the explicit ISO date (YYYY-MM-DD) of the effective cycle.
  • Active holidays with staged deletions remain displayed in the schedule exceptions list with a [PENDING DELETE] badge and an option to cancel the pending deletion.

Refs #177, #114.

Follow-up for PR #177 (next-day settings activation, #114) addressing pass-3 review findings P3-K, P3-N, P3-O, and P3-P: ### Scope 1. **Multiple Exceptions for Same Date (P3-K)**: Two pending exceptions for the same date both list and both activate at boundary, where the last upsert silently wins. Enforce validation or clear superseding behavior for same-date pending exceptions. 2. **Escaped Newlines in Confirm Dialog (P3-N)**: The confirmation dialog displays a literal `\n` because `app/static/js/i18n.js` has escaped `\\n`. 3. **Ambiguous Notice Timing Copy (P3-O)**: "próximo día comercial" and "tomorrow's business cycle reset" can read as today's reset when saving before today's reset time. Explicitly name the target calendar date (YYYY-MM-DD) in the notice copy. 4. **Visibility of Pending Deletes (P3-P)**: An active exception with a pending delete disappears from the list immediately (`occupancy_service.py:520-527`), preventing users from seeing its pending deletion status or cancelling it. Keep it visible with a `[PENDING DELETE]` badge and cancellation action. ### Acceptance Criteria - Staging a second exception for an already-pending exception date either explicitly supersedes the prior pending exception or rejects with an informative validation error. - Confirmation dialogs in `i18n.js` render natural line breaks without literal `\n` characters. - Pre-save confirmation dialogs and notices display the explicit ISO date (YYYY-MM-DD) of the effective cycle. - Active holidays with staged deletions remain displayed in the schedule exceptions list with a `[PENDING DELETE]` badge and an option to cancel the pending deletion. Refs #177, #114.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gabogg/hikcentral#231
No description provided.