Skip to content

feat(notifications): warn the manager and HR about a short-notice req… - #37

Merged
karlitschek merged 1 commit into
mainfrom
feat/noid/short-notice-warning
Aug 10, 2026
Merged

feat(notifications): warn the manager and HR about a short-notice req…#37
karlitschek merged 1 commit into
mainfrom
feat/noid/short-notice-warning

Conversation

@karlitschek

Copy link
Copy Markdown
Member

…uest

A request filed for next Monday and one filed for next quarter arrived looking identical. Nothing in the notification, the email or the review panel said which was which, so the fact that mattered most for planning — how much warning the team was given — was the one thing a decider had to work out for themselves from two dates.

A request whose leave starts sooner than the notice period the company expects is now flagged as short notice, to the line manager and to HR, everywhere the decision is actually made:

  • on the request's Details tab, as a warning card above the approve/decline buttons rather than behind the Coverage tab;
  • in the notification, which says so in its subject line — the one line guaranteed to be read — and gives the day count in the message;
  • in the email, whose heading doubles as the mail's subject, so it is legible in an inbox listing while there is still time to act.

The escalation to HR and the pending-decision reminder carry it too. By the time either fires the notice has only grown shorter, which is exactly when saying so is worth most.

The threshold is a new admin setting, "Expected notice period", defaulting to 14 calendar days; 0 switches the warning off. Calendar days rather than working days because "two weeks' notice" is a fortnight on the wall calendar — unlike the escalation window, which counts the days a manager actually had to answer in. Measured against the server's today, not the viewer's, so one request gets one answer for the manager, for HR and for the job that mails them, instead of a sidebar and an email that disagree by a day at a timezone boundary.

Two limits on when a warning appears, both in NoticeService:

  • Only while a decision is outstanding (PENDING / ESCALATED). Afterwards short notice is no longer an input to anything, just a standing reproach on the record.
  • Which also means never for leave that has no approval workflow. Sick leave is recorded by HR after the fact and auto-approved types are booked straight through (§4.1); both reach APPROVED without ever being pending. Nobody is weighing the notice there, and nobody gives notice of falling ill.

The warning's wording lives in one place, NoticeService::sentence(), because the same sentence is shown in the notification, in the email and (mirrored in the Vue component) in the sidebar — one string to translate rather than three that drift apart. It also avoids claiming leave "starts in 0 days": today and already-started get their own phrasings, the latter reachable through an edit or a late correction.

Notifications written before this change carry neither new subject parameter, so the notifier reads both defensively rather than failing to parse an existing row.

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

…uest

A request filed for next Monday and one filed for next quarter arrived looking
identical. Nothing in the notification, the email or the review panel said which
was which, so the fact that mattered most for planning — how much warning the
team was given — was the one thing a decider had to work out for themselves from
two dates.

A request whose leave starts sooner than the notice period the company expects is
now flagged as short notice, to the line manager and to HR, everywhere the
decision is actually made:

  - on the request's Details tab, as a warning card above the approve/decline
    buttons rather than behind the Coverage tab;
  - in the notification, which says so in its subject line — the one line
    guaranteed to be read — and gives the day count in the message;
  - in the email, whose heading doubles as the mail's subject, so it is legible
    in an inbox listing while there is still time to act.

The escalation to HR and the pending-decision reminder carry it too. By the time
either fires the notice has only grown shorter, which is exactly when saying so
is worth most.

The threshold is a new admin setting, "Expected notice period", defaulting to 14
calendar days; 0 switches the warning off. Calendar days rather than working days
because "two weeks' notice" is a fortnight on the wall calendar — unlike the
escalation window, which counts the days a manager actually had to answer in.
Measured against the server's today, not the viewer's, so one request gets one
answer for the manager, for HR and for the job that mails them, instead of a
sidebar and an email that disagree by a day at a timezone boundary.

Two limits on when a warning appears, both in NoticeService:

  - Only while a decision is outstanding (PENDING / ESCALATED). Afterwards short
    notice is no longer an input to anything, just a standing reproach on the
    record.
  - Which also means never for leave that has no approval workflow. Sick leave is
    recorded by HR after the fact and auto-approved types are booked straight
    through (§4.1); both reach APPROVED without ever being pending. Nobody is
    weighing the notice there, and nobody gives notice of falling ill.

The warning's wording lives in one place, NoticeService::sentence(), because the
same sentence is shown in the notification, in the email and (mirrored in the Vue
component) in the sidebar — one string to translate rather than three that drift
apart. It also avoids claiming leave "starts in 0 days": today and already-started
get their own phrasings, the latter reachable through an edit or a late correction.

Notifications written before this change carry neither new subject parameter, so
the notifier reads both defensively rather than failing to parse an existing row.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Aug 10, 2026
@karlitschek
karlitschek merged commit 2b46355 into main Aug 10, 2026
14 of 17 checks passed
@karlitschek
karlitschek deleted the feat/noid/short-notice-warning branch August 10, 2026 20:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI assisted This PR contains AI-assisted commits

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants