Skip to content

feat(availability): warn when leave or "nie mogę" leaves a role without reserve - #403

Merged
lowicz merged 5 commits into
mainfrom
fm/oncall-leave-u-step4
Dec 3, 2026
Merged

lowicz merged 5 commits into
mainfrom
fm/oncall-leave-u-step4

Conversation

@lowicz

@lowicz lowicz commented Dec 3, 2026 •

Copy link
Copy Markdown
Owner

Intent

The oncall project gained a new preference kind "U" (urlop, leave). The captain approved a 5-step plan; steps 1-3 (PRs 399, 400, 401) are merged. This is STEP 4: the overlap warning (T3, rule D13-A): when leave (U) or N leaves too few qualified people to staff a role on a day, the member who saves the leave gets a neutral notice (never a refusal), and the coordinator sees chips above the matrix and on "Teraz". The approved design and decisions are in ~/firstmate/data/oncall-leave-u-scout/report.md (section 4.5 T3 paragraph, D13, 6.2 step 4, 9, 11), critique evidence in data/oncall-leave-u-scout/critique/. Leave is team-visible only as "urlop", never with a reason or note (D14).

What the referenced report sections say, so this text stands without the report:

Section 4.5, T3, overlap warning. The member who saves the leave gets a neutral notice, never a refusal: "Zapisano. 10–11 gru urlop ma też Marek Nowak. Do PRIMARY i SECONDARY zostają wtedy 2 osoby, bez rezerwy. Koordynatorzy widzą to w grafiku." The coordinator gets chips above the matrix and on "Teraz": "10–11 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)" (warning) and "24 gru: brakuje osoby do SECONDARY" (alarm). For days not generated yet the text says so: "Grafik na te dni nie jest jeszcze ułożony. Generator będzie miał 2 osoby na PRIMARY i SECONDARY." The rule (D13-A): per day and role, count the people qualified for the role who have neither N nor U that day; "bez rezerwy" when exactly as many remain as the day needs, alarm when fewer. N counts like U. People eligible for no duty are not counted.

Decision D13, the rule behind the overlap warning, chosen option A: count who can still take each role. Per day and role: people qualified for the role without N or U that day. Warning "bez rezerwy" when exactly as many remain as the day needs; alarm when fewer. N counts like U. The member only gets a notice; saving is never blocked. Not chosen: warning whenever two or more people have leave on the same day, and an admin-set limit of people on leave at once.

Section 6.2, step 4, overlap warning (T3). One read that returns, per day and role in a range, how many qualified people have no blocking entry, against how many the day needs; the availability save response gains the notice for the member. Chips reuse .risk and .chip-*. Rule per D13.

Section 9, the captain's decisions that bear on this step. D8: the team views chosen are the "Urlopy" panel on "Teraz" (T1, step 2, merged), the overlap warning (T3, this step) and the morning e-mail (T5, step 5, a separate later step that is not part of this change). D13: A, count who can still take each role; "bez rezerwy" or alarm. D14: A, "urlop" is any whole day away from work, and the reason is never shown: the team sees only "urlop". D5: A, leave is entered like N, everyone for themselves and a coordinator or admin on behalf, with no approval. D4: A, the whole team sees U like N, the note stays private; viewers and share links see no availability. The order of the plan stands: step 4 is the overlap warning alone.

Section 11, what the UX assessment changed for this view. Before: a warning box shown to the member, "na urlopie będą 2 z 4 osób". After: a neutral notice to the member with the saved fact first, and chips with the role and the reserve for the coordinator, because the member cannot act on it and the coordinator can. From the critique evidence behind it: the rule must be one a person can check by hand (count the people eligible for PRIMARY or SECONDARY with no N or U that day, warn when the count equals what the day needs, alarm when it is lower); in a team of ten, two people on leave on the same day is routine and must not warn; days with no schedule yet get the same rule and the same marker, because that is when the warning is most useful; N entries are counted too, since the day is just as unstaffed whether the person has N or U; when a collision frame and the overlap notice both apply, the collision comes first.

What Changed

  • Counting rule: for each day from today on, the backend counts the people eligible for a role who have neither leave nor "nie mogę" ("unavailable"), and compares that with how many the day needs. Exactly enough means "no reserve"; fewer means "short". PRIMARY and SECONDARY are counted together as two different people, unless exactly one of them is short, in which case each is judged alone. 11–19 counts on working days only. Days with no such entries never warn, and days without a schedule follow the same rule.
  • Notice for the person saving: after saving leave or "nie mogę", a neutral box on "Moje dyżury" ("My duties") says the entry is saved, who else is on leave, and how many people remain for the role. For days without a schedule, it says how many people the generator will have. The notice never blocks saving. The save response carries this in a new staffing field.
  • Chips for coordinators and admins: "Teraz" and the Schedule show a warning chip for "bez rezerwy" ("no reserve") and an alarm chip when people are missing. Days in a row with the same result share one chip, and clicking it opens the first day. The calendar response fills its new staffing list for these roles only. The OpenAPI contract, the Polish and English texts and the user docs are updated.

🤖 Generated with Claude Code

Risk Assessment

✅ Low: The change only adds read-only counts and notices: saving is never refused, the chip counts go only to coordinators and admins, and the round 1 wording fix is small and matches the decision.

Testing

No baseline commands had run before this step. I ran the real API, database and built frontend locally with made-up people and drove 13 scenarios in a browser: member notices, coordinator chips, privacy, role counting and edge cases. All passed, and the Polish wording matches the approved examples apart from minor formatting; screenshots and run logs are saved. My first undo check clicked the wrong toast, so I repeated it on the right one and it passed. I stopped the servers and database and removed the temporary files.

  • Live validation: ✅ go - 13 of 13 scenarios driven live against the product
Scenario Result Live Evidence
Member saves leave on published days while a colleague is on leave, and reads that 2 people are left for PRIMARY and SECONDARY with no reserve ✅ pass live 02-member-notice-published-days.png; drive1-member-notices.log (S-notice Anna)
Member saves leave on days with no schedule yet, and reads how many people the generator will have ✅ pass live 03-member-notice-not-generated-days.png; drive1-member-notices.log (S-unscheduled)
"Nie mogę" counts like leave, "wolę nie" does not count, and "też" appears only when the saved entry is leave ✅ pass live 04-nie-moge-saved-colleague-on-leave.png; drive1-member-notices.log
Everyone is away on a published day: every save succeeds and the notice says how many people are missing ✅ pass live 06-nobody-left-saved-not-refused.png; drive1-member-notices.log (S-all-away)
Leave on a day with own duty: the collision box comes before the overlap notice ✅ pass live 05-collision-first-then-notice.png
Coordinator sees warning and alarm chips on Teraz and above the matrix on Grafik, and a click opens that day ✅ pass live 10-teraz-coordinator-chips.png; 11-grafik-coordinator-chips.png; 12-grafik-after-chip-click.png; drive2-coordinator-chips.log
When only one role is short, the chip and the notice name that role, not the pair ✅ pass live 21-grafik-exact-single-role-chips.png; drive3-rules-and-boundaries.log (ROLE)
Routine absences stay silent: one of four away, or two of ten away, gives no notice (and no chip for two of ten) ✅ pass live 01-one-of-four-away-no-notice.png; 22-team-of-ten-two-away-no-chip.png; drive3-rules-and-boundaries.log (TEN)
A person with no duty role is not counted and gets no overlap notice ✅ pass live drive3-rules-and-boundaries.log (NOROLE)
Coordinator saves leave for someone else and gets the notice; erasing that leave returns the chips to their earlier state ✅ pass live 23-on-behalf-notice-three-away.png; drive3-rules-and-boundaries.log (BEHALF, ERASE)
Undoing a saved leave removes its notice ✅ pass live drive2-coordinator-chips.log (undo before / undo after)
Members, viewers and share links see no reserve chips or counts, and the leave note does not appear in their data ✅ pass live 13-teraz-anna-no-reserve-chips.png; 13-teraz-viewer-no-reserve-chips.png; 14-share-link-no-chips.png; drive2-coordinator-chips.log; drive4-share-link.log
Leave entered for a past day gives no notice and no chip, and the English interface shows the notice in English ✅ pass live drive3-rules-and-boundaries.log (PAST, chips from 1 Dec); 07-member-notice-english.png

Member notice for published days

Member notice for days not generated yet

One of four away: no notice

"Nie mogę" saved while a colleague is on leave (no "też")

Collision box first, then the overlap notice

Nobody left, leave still saved

Member notice in English

Coordinator chips on Teraz

Coordinator chips on Grafik

Chip click opens the day panel for 24 Dec

Member sees no reserve chips

Viewer sees no reserve chips

Share link sees no reserve chips

Exact single-role chips

Team of ten, two away: no chip

Coordinator saves for someone else: notice

Phone width, light theme

Evidence: Member notices run log
S-boundary Marek alone of four 200 [] [
  'Weekend 12 – 13 gru nie jest objęty urlopem / Generator może Ci wtedy przydzielić dyżur. / Dodaj weekend do urlopu'
]
S-notice Anna 200 [{"service_date":"2026-12-10","roles":["primary","secondary"],"available":2,"needed":2,"scheduled":true,"also_on_leave":["Marek Nowak"]},{"service_date":"2026-12-11","roles":["primary","secondary"],"available":2,"needed":2,"scheduled":true,"also_on_leave":["Marek Nowak"]}] [
  'Weekend 12 – 13 gru nie jest objęty urlopem / Generator może Ci wtedy przydzielić dyżur. / Dodaj weekend do urlopu',
  'Zapisano: 10 – 11 gru „urlop” / 10 – 11 gru urlop ma też Marek Nowak. Do PRIMARY i SECONDARY zostają wtedy 2 osoby, bez rezerwy. / Koordynatorzy widzą to w grafiku.'
]
 reason leaked: false
S-unscheduled 200 [{"service_date":"2026-12-17","roles":["primary","secondary"],"available":2,"needed":2,"scheduled":false,"also_on_leave":["Marek Nowak"]},{"service_date":"2026-12-18","roles":["primary","secondary"],"available":2,"needed":2,"scheduled":false,"also_on_leave":["Marek Nowak"]}] [
  'Weekend 19 – 20 gru nie jest objęty urlopem / Generator może Ci wtedy przydzielić dyżur. / Dodaj weekend do urlopu',
  'Zapisano: 17 – 18 gru „urlop” / 17 – 18 gru urlop ma też Marek Nowak. Grafik na te dni nie jest jeszcze ułożony. Generator będzie miał 2 osoby na PRIMARY i SECONDARY. / Koordynatorzy widzą to w grafiku.'
]
S-N saved, colleague U 200 [
  'Zapisano: pon 21 gru „nie mogę” / pon 21 gru urlop ma Marek Nowak. Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 2 osoby na PRIMARY i SECONDARY. / Koordynatorzy widzą to w grafiku.'
]
S-U saved, colleague N 200 [{"service_date":"2026-12-22","roles":["primary","secondary"],"available":2,"needed":2,"scheduled":false,"also_on_leave":[]}] [
  'Zapisano: wt 22 gru „urlop” / wt 22 gru: Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 2 osoby na PRIMARY i SECONDARY. / Koordynatorzy widzą to w grafiku.'
]
S-prefer_not no notice 200 [] []
S-undo before [
  'Zapisano: wt 29 gru „urlop” / wt 29 gru urlop ma też Marek Nowak. Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 2 osoby na PRIMARY i SECONDARY. / Koordynatorzy widzą to w grafiku.'
]
S-undo after [
  'Zapisano: wt 29 gru „urlop” / wt 29 gru urlop ma też Marek Nowak. Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 2 osoby na PRIMARY i SECONDARY. / Koordynatorzy widzą to w grafiku.'
] entry: wt 29-12-2026, Urlop
ola 15 200 []
S-collision order 200 [
  'W czasie urlopu masz dyżur: 15 gru / Urlop nie zdejmuje dyżuru: jest Twój, dopóki ktoś go nie przejmie. Koordynatorzy dostają o tym e-mail. / wt 15 gru / P / Poproś o zamianę…',
  'Zapisano: wt 15 gru „urlop” / wt 15 gru urlop ma też Ola Wiśniewska. Do PRIMARY i SECONDARY zostają wtedy 2 osoby, bez rezerwy. / Koordynatorzy widzą to w grafiku.'
]
S-all-away anna 200 [] [
  'W czasie urlopu masz dyżur: 15 gru / Urlop nie zdejmuje dyżuru: jest Twój, dopóki ktoś go nie przejmie. Koordynatorzy dostają o tym e-mail. / wt 15 gru / P / Poproś o zamianę…'
]
S-all-away marek 200 [{"service_date":"2026-12-09","roles":["primary","secondary"],"available":2,"needed":2,"scheduled":true,"also_on_leave":["Anna Kowalska"]}] [
  'Zapisano: śr 9 gru „urlop” / śr 9 gru urlop ma też Anna Kowalska. Do PRIMARY i SECONDARY zostają wtedy 2 osoby, bez rezerwy. / Koordynatorzy widzą to w grafiku.'
]
S-all-away ola 200 [{"service_date":"2026-12-09","roles":["primary","secondary"],"available":1,"needed":2,"scheduled":true,"also_on_leave":["Anna Kowalska","Marek Nowak"]},{"service_date":"2026-12-09","roles":["late_shift"],"available":1,"needed":1,"scheduled":true,"also_on_leave":["Anna Kowalska","Marek Nowak"]}] [
  'W dniu „nie mogę” masz dyżur: 9 gru / Wpis nie zdejmuje dyżuru: jest Twój, dopóki ktoś go nie przejmie. Koordynatorzy dostają o tym e-mail. / śr 9 gru / P / Poproś o zamianę…',
  'Zapisano: śr 9 gru „nie mogę” / śr 9 gru urlop mają Anna Kowalska, Marek Nowak. Do PRIMARY i SECONDARY brakuje wtedy osoby. / śr 9 gru urlop mają Anna Kowalska, Marek Nowak. Do 11–19 zostaje wtedy 1 osoba, bez rezerwy. / Koordynatorzy widzą to w grafiku.'
]
S-all-away piotr 200 [{"service_date":"2026-12-09","roles":["primary","secondary"],"available":0,"needed":2,"scheduled":true,"also_on_leave":["Anna Kowalska","Marek Nowak"]},{"service_date":"2026-12-09","roles":["late_shift"],"available":0,"needed":1,"scheduled":true,"also_on_leave":["Anna Kowalska","Marek Nowak"]}] [
  'W czasie urlopu masz dyżury: 9 gru / Urlop nie zdejmuje dyżurów: są Twoje, dopóki ktoś ich nie przejmie. Koordynatorzy dostają o tym e-mail. / śr 9 gru / S / 11–19 / Poproś o zamianę…',
  'Zapisano: śr 9 gru „urlop” / śr 9 gru urlop mają też Anna Kowalska, Marek Nowak. Do PRIMARY i SECONDARY brakuje wtedy 2 osób. / śr 9 gru urlop mają też Anna Kowalska, Marek Nowak. Do 11–19 brakuje wtedy osoby. / Koordynatorzy widzą to w grafiku.'
]
S-24Dec anna 200 [] [
  'W czasie urlopu masz dyżur: 15 gru / Urlop nie zdejmuje dyżuru: jest Twój, dopóki ktoś go nie przejmie. Koordynatorzy dostają o tym e-mail. / wt 15 gru / P / Poproś o zamianę…'
]
S-24Dec marek 200 [] []
S-24Dec ola 200 [{"service_date":"2026-12-24","roles":["secondary"],"available":1,"needed":1,"scheduled":false,"also_on_leave":["Anna Kowalska","Marek Nowak"]}] [
  'W dniu „nie mogę” masz dyżur: 9 gru / Wpis nie zdejmuje dyżuru: jest Twój, dopóki ktoś go nie przejmie. Koordynatorzy dostają o tym e-mail. / śr 9 gru / P / Poproś o zamianę…',
  'Zapisano: czw 24 gru „urlop” / czw 24 gru urlop mają też Anna Kowalska, Marek Nowak. Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 1 osobę na SECONDARY. / Koordynatorzy widzą to w grafiku.'
]
S-24Dec piotr 200 [{"service_date":"2026-12-24","roles":["secondary"],"available":0,"needed":1,"scheduled":false,"also_on_leave":["Anna Kowalska","Marek Nowak","Ola Wiśniewska"]}] [
  'W czasie urlopu masz dyżury: 9 gru / Urlop nie zdejmuje dyżurów: są Twoje, dopóki ktoś ich nie przejmie. Koordynatorzy dostają o tym e-mail. / śr 9 gru / S / 11–19 / Poproś o zamianę…',
  'Zapisano: czw 24 gru „urlop” / czw 24 gru urlop mają też Anna Kowalska, Marek Nowak, Ola Wiśniewska. Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 0 osób na SECONDARY. / Koordynatorzy widzą to w grafiku.'
]
S-english 200 [
  'You have a duty during your leave: 15 Dec / Leave does not lift the duty: it stays yours until someone takes it over. The coordinators get an e-mail about it. / Tue 15 Dec / P / Request a swap…',
  'Saved: Wed 30 Dec “leave” / Wed 30 Dec: Marek Nowak is on leave too. The schedule for this day is not laid out yet. The generator will have 2 people for PRIMARY and SECONDARY. / Coordinators see this in the schedule.'
]
Evidence: Coordinator chips run log
undo: Anna alone 31 []
undo before [
  'W czasie urlopu masz dyżur: 15 gru / Urlop nie zdejmuje dyżuru: jest Twój, dopóki ktoś go nie przejmie. Koordynatorzy dostają o tym e-mail. / wt 15 gru / P / Poproś o zamianę…',
  'Zapisano: wt 29 gru „urlop” / wt 29 gru urlop ma też Marek Nowak. Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 2 osoby na PRIMARY i SECONDARY. / Koordynatorzy widzą to w grafiku.'
]
cofnij buttons 1
undo after [
  'W czasie urlopu masz dyżur: 15 gru / Urlop nie zdejmuje dyżuru: jest Twój, dopóki ktoś go nie przejmie. Koordynatorzy dostają o tym e-mail. / wt 15 gru / P / Poproś o zamianę…'
]
TERAZ koord http://localhost:5199/ [
  'chip chip-warn :: 14 dni poza opublikowanym grafikiem Obsadzenie wymaga wygenerowania i opublikowania nowego grafiku',
  'chip chip-bad chip-btn :: 4 dyżury mimo „nie mogę” lub urlopu',
  'chip chip-bad chip-btn :: 9 gru: brakuje 2 osób do PRIMARY i SECONDARY',
  'chip chip-bad chip-btn :: 9 gru: brakuje osoby do 11–19',
  'chip chip-warn chip-btn :: 10 – 11 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 15 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 17 – 18 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 21 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-bad chip-btn :: 24 gru: brakuje osoby do SECONDARY',
  'chip chip-warn chip-btn :: 29 – 30 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)'
]
GRAFIK koord [
  'chip chip-bad chip-btn :: 9 gru: brakuje 2 osób do PRIMARY i SECONDARY',
  'chip chip-bad chip-btn :: 9 gru: brakuje osoby do 11–19',
  'chip chip-warn chip-btn :: 10 – 11 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 15 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 17 – 18 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 21 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-bad chip-btn :: 24 gru: brakuje osoby do SECONDARY',
  'chip chip-warn chip-btn :: 29 – 30 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)'
]
24Dec chip count 1
after click url http://localhost:5199/grafik?od=2026-12-03&zoom=4
calendar api anna 200 staffing rows 0 leak false
TERAZ anna 0 reserve chips
GRAFIK anna 0 reserve chips
calendar api viewer 200 staffing rows 0 leak false
TERAZ viewer 0 reserve chips
GRAFIK viewer 0 reserve chips
calendar api admin 200 staffing rows 11 leak false
TERAZ admin 8 reserve chips
GRAFIK admin 8 reserve chips
koord staffing [{"service_date":"2026-12-09","roles":["primary","secondary"],"available":0,"needed":2},{"service_date":"2026-12-09","roles":["late_shift"],"available":0,"needed":1},{"service_date":"2026-12-10","roles":["primary","secondary"],"available":2,"needed":2},{"service_date":"2026-12-11","roles":["primary","secondary"],"available":2,"needed":2},{"service_date":"2026-12-15","roles":["primary","secondary"],"available":2,"needed":2},{"service_date":"2026-12-17","roles":["primary","secondary"],"available":2,"needed":2},{"service_date":"2026-12-18","roles":["primary","secondary"],"available":2,"needed":2},{"service_date":"2026-12-21","roles":["primary","secondary"],"available":2,"needed":2},{"service_date":"2026-12-24","roles":["secondary"],"available":0,"needed":1},{"service_date":"2026-12-29","roles":["primary","secondary"],"available":2,"needed":2},{"service_date":"2026-12-30","roles":["primary","secondary"],"available":2,"needed":2}]
koord staffing keys [ 'service_date', 'roles', 'available', 'needed' ]
share 422 {"detail":[{"loc":["body","starts_on"],"msg":"To pole jest wymagane.","type":"missing"},{"loc":["body","ends_on"],"msg":"To pole jest wymagane.","type":"missing"},{"loc":["body","name"],"msg":"Extra inputs are not permitted","type":"extra_forbidden"},{"loc":["
Evidence: Rules and boundaries run log
ROLE case1 Adam urlop 2027-02-06 200 [{"service_date":"2027-02-06","roles":["primary"],"available":0,"needed":1,"scheduled":false,"also_on_leave":[]}] [
  'Zapisano: sob 6 lut „urlop” / sob 6 lut: Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 0 osób na PRIMARY. / Koordynatorzy widzą to w grafiku.'
]
ROLE case2 Adam urlop 2027-02-13 200 [{"service_date":"2027-02-13","roles":["primary"],"available":1,"needed":1,"scheduled":false,"also_on_leave":[]}] [
  'Zapisano: sob 13 lut „urlop” / sob 13 lut: Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 1 osobę na PRIMARY. / Koordynatorzy widzą to w grafiku.'
]
ROLE case2 Celina nie mogę 2027-02-13 200 [{"service_date":"2027-02-13","roles":["primary"],"available":0,"needed":1,"scheduled":false,"also_on_leave":["Adam Jeden"]}] [
  'Zapisano: sob 13 lut „nie mogę” / sob 13 lut urlop ma Adam Jeden. Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 0 osób na PRIMARY. / Koordynatorzy widzą to w grafiku.'
]
ROLE case2 Beata urlop 2027-02-13 200 [{"service_date":"2027-02-13","roles":["secondary"],"available":1,"needed":1,"scheduled":false,"also_on_leave":[]}] [
  'Zapisano: sob 13 lut „urlop” / sob 13 lut: Grafik na ten dzień nie jest jeszcze ułożony. Generator będzie miał 1 osobę na SECONDARY. / Koordynatorzy widzą to w grafiku.'
]
chips Feb [
  'chip chip-bad chip-btn :: 6 lut: brakuje osoby do PRIMARY',
  'chip chip-bad chip-btn :: 13 lut: brakuje osoby do PRIMARY',
  'chip chip-warn chip-btn :: 13 lut: SECONDARY bez rezerwy (1 osoba)'
]
TEN Adam urlop 2027-03-10 200 [] []
TEN Beata urlop 2027-03-10 200 [] []
chips Mar, 2 of 10 away []
NOROLE Zofia urlop 2026-12-10 200 [] [
  'Weekend 12 – 13 gru nie jest objęty urlopem / Generator może wtedy przydzielić dyżur: Zofia Bezroli. / Dodaj weekend do urlopu'
]
BEHALF Ola urlop 2026-12-10 200 [{"service_date":"2026-12-10","roles":["primary","secondary"],"available":1,"needed":2,"scheduled":true,"also_on_leave":["Anna Kowalska","Marek Nowak"]},{"service_date":"2026-12-10","roles":["late_shift"],"available":1,"needed":1,"scheduled":true,"also_on_leave":["Anna Kowalska","Marek Nowak"]},{"service_date":"2026-12-11","roles":["primary","secondary"],"available":1,"needed":2,"scheduled":true,"also_on_leave":["Anna Kowalska","Marek Nowak"]},{"service_date":"2026-12-11","roles":["late_shift"],"available":1,"needed":1,"scheduled":true,"also_on_leave":["Anna Kowalska","Marek Nowak"]}] [
  'Weekend 12 – 13 gru nie jest objęty urlopem / Generator może wtedy przydzielić dyżur: Ola Wiśniewska. / Dodaj weekend do urlopu',
  'Ola Wiśniewska ma dyżury w dni z wpisem „nie mogę” albo „urlop”: 9, 10 i 11 gru / Wpis nie zdejmuje dyżurów. Zmień obsadę tych dni w grafiku. / śr 9 gru / P / Pokaż dzień / czw 10 gru / P / 11–19 / Pokaż dzień / pt 11 gru / P / 11–19 / Pokaż dzień',
  'Zapisano: 10 – 11 gru „urlop” / 10 – 11 gru urlop mają też Anna Kowalska, Marek Nowak. Do PRIMARY i SECONDARY brakuje wtedy osoby. / 10 – 11 gru urlop mają też Anna Kowalska, Marek Nowak. Do 11–19 zostaje wtedy 1 osoba, bez rezerwy. / Koordynatorzy widzą to w grafiku.'
]
chips after Ola [
  'chip chip-bad chip-btn :: 9 gru: brakuje 2 osób do PRIMARY i SECONDARY',
  'chip chip-bad chip-btn :: 9 gru: brakuje osoby do 11–19',
  'chip chip-bad chip-btn :: 10 – 11 gru: brakuje osoby do PRIMARY i SECONDARY',
  'chip chip-warn chip-btn :: 10 – 11 gru: 11–19 bez rezerwy (1 osoba)',
  'chip chip-warn chip-btn :: 15 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 17 – 18 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 21 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-bad chip-btn :: 24 gru: brakuje osoby do SECONDARY',
  'chip chip-warn chip-btn :: 29 – 30 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)'
]
ERASE Ola Gumka 2026-12-10 200 undefined [
  'Ola Wiśniewska ma w dniu „nie mogę” dyżur: 9 gru / Wpis nie zdejmuje dyżuru. Zmień obsadę tego dnia w grafiku. / śr 9 gru / P / Pokaż dzień'
]
chips after erase [
  'chip chip-bad chip-btn :: 9 gru: brakuje 2 osób do PRIMARY i SECONDARY',
  'chip chip-bad chip-btn :: 9 gru: brakuje osoby do 11–19',
  'chip chip-warn chip-btn :: 10 – 11 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 15 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 17 – 18 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 21 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-bad chip-btn :: 24 gru: brakuje osoby do SECONDARY',
  'chip chip-warn chip-btn :: 29 – 30 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)'
]
PAST Anna urlop 2026-12-02 200 [] [
  'Zapisano: śr 2 gru „urlop” / Zmieni to oczekiwany udział tej osoby w oknie 12 miesięcy.',
  'Anna Kowalska ma w czasie urlopu dyżur: 15 gru / Wpis nie zdejmuje dyżuru. Zmień obsadę tego dnia w grafiku. / wt 15 gru / P / Pokaż dzień'
]
PAST Marek urlop 2026-12-02 200 [] [
  'Zapisano: śr 2 gru „urlop” / Zmieni to oczekiwany udział tej osoby w oknie 12 miesięcy.'
]
chips from 1 Dec [
  'chip chip-bad chip-btn :: 9 gru: brakuje 2 osób do PRIMARY i SECONDARY',
  'chip chip-bad chip-btn :: 9 gru: brakuje osoby do 11–19',
  'chip chip-warn chip-btn :: 10 – 11 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 15 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 17 – 18 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-warn chip-btn :: 21 gru: PRIMARY i SECONDARY bez rezerwy (2 osoby)',
  'chip chip-bad chip-btn :: 24 gru: brakuje osoby do SECONDARY'
]
share 422 {"detail":[{"loc":["body","expires_at"],"msg":"Extra inputs are not permitted","type":"extra_forbidden"}]}
phone overflow 390/390
Evidence: Share link run log
share 201 [ 'id', 'url', 'expires_at' ]
share calendar http://localhost:5199/ 200 days 28 staffing [] availability 0 leaves 0 reserve chips 0 leak false

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

🔧 **Review** - 1 issue found → auto-fixed ✅
  • ℹ️ frontend/src/i18n/pl/mine.ts:138 - The notice says a colleague is on leave "too" even when the saved entry is not leave.

Example: Marek has leave on 10 Dec. Anna saves "nie mogę" for that day, and two people are left for the pair. Anna reads: "Zapisano: czw 10 gru „nie mogę”. czw 10 gru urlop ma też Marek Nowak." The word "też" implies that Anna also has leave, but Anna does not.

Cause: the server sends also_on_leave for both blocking kinds, and when does not know which kind was saved.

The approved sentence was written for saving leave. The wording for saving "nie mogę" is a copy decision. Suggested fix: pass whether the saved entry is leave (staffing.command.brush === 'leave') and drop "też" / "too" when it is not.

Same issue at:

  • frontend/src/i18n/en/mine.ts:122 ("on leave too")
  • frontend/src/screens/Mine.tsx:896 (the call that does not pass the saved kind)

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 13 of 13 scenarios driven live against the product
Scenario Result Live Evidence
Member saves leave on published days while a colleague is on leave, and reads that 2 people are left for PRIMARY and SECONDARY with no reserve ✅ pass live 02-member-notice-published-days.png; drive1-member-notices.log (S-notice Anna)
Member saves leave on days with no schedule yet, and reads how many people the generator will have ✅ pass live 03-member-notice-not-generated-days.png; drive1-member-notices.log (S-unscheduled)
"Nie mogę" counts like leave, "wolę nie" does not count, and "też" appears only when the saved entry is leave ✅ pass live 04-nie-moge-saved-colleague-on-leave.png; drive1-member-notices.log
Everyone is away on a published day: every save succeeds and the notice says how many people are missing ✅ pass live 06-nobody-left-saved-not-refused.png; drive1-member-notices.log (S-all-away)
Leave on a day with own duty: the collision box comes before the overlap notice ✅ pass live 05-collision-first-then-notice.png
Coordinator sees warning and alarm chips on Teraz and above the matrix on Grafik, and a click opens that day ✅ pass live 10-teraz-coordinator-chips.png; 11-grafik-coordinator-chips.png; 12-grafik-after-chip-click.png; drive2-coordinator-chips.log
When only one role is short, the chip and the notice name that role, not the pair ✅ pass live 21-grafik-exact-single-role-chips.png; drive3-rules-and-boundaries.log (ROLE)
Routine absences stay silent: one of four away, or two of ten away, gives no notice (and no chip for two of ten) ✅ pass live 01-one-of-four-away-no-notice.png; 22-team-of-ten-two-away-no-chip.png; drive3-rules-and-boundaries.log (TEN)
A person with no duty role is not counted and gets no overlap notice ✅ pass live drive3-rules-and-boundaries.log (NOROLE)
Coordinator saves leave for someone else and gets the notice; erasing that leave returns the chips to their earlier state ✅ pass live 23-on-behalf-notice-three-away.png; drive3-rules-and-boundaries.log (BEHALF, ERASE)
Undoing a saved leave removes its notice ✅ pass live drive2-coordinator-chips.log (undo before / undo after)
Members, viewers and share links see no reserve chips or counts, and the leave note does not appear in their data ✅ pass live 13-teraz-anna-no-reserve-chips.png; 13-teraz-viewer-no-reserve-chips.png; 14-share-link-no-chips.png; drive2-coordinator-chips.log; drive4-share-link.log
Leave entered for a past day gives no notice and no chip, and the English interface shows the notice in English ✅ pass live drive3-rules-and-boundaries.log (PAST, chips from 1 Dec); 07-member-notice-english.png
  • Started the real product locally: throwaway PostgreSQL 18.7, alembic upgrade head, python -m oncall.seed_demo plus scripts/seed_fixture.py, uvicorn on port 8000, and the production frontend build served by vite preview on port 5199
  • node scripts/drive1.mjs: real browser, member notices (published days, days not generated yet, N and U mixed, collision order, everyone away, 24 Dec, English)
  • node scripts/drive2.mjs: real browser, undo, coordinator and admin chips on Teraz and Grafik, chip click, no chips for member and viewer, calendar API responses
  • node scripts/drive3.mjs: real browser, single-role shortages, team of ten, person with no role, saving on someone's behalf, erasing, past days, phone width
  • node scripts/drive4.mjs: real browser, share link shows no reserve data
  • Looked at the screenshots of the notice, collision order, nobody-left notice, Teraz and Grafik chips, member view and phone layout
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…ut reserve

One read counts, per day and role, the people qualified for the role who
have neither "nie mogę" nor leave that day, against how many the day needs:
one for PRIMARY, one for SECONDARY, two different people for the pair and,
on a working day, one for the 11-19 shift. As many left as needed is "bez
rezerwy", fewer cannot be staffed. A day speaks only when an entry brought
it there, and people eligible for no role are not counted.

- Saving an entry that blocks duty is never refused. Its answer gains the
  days it leaves a role the person can take without reserve, with who else
  is on leave then and whether a schedule covers the day; the calendar
  shows it as a neutral notice under the month, until the next stroke or
  its Undo.
- Coordinators and admins get the same count in the calendar payload, from
  today on, as chips above the matrix on "Teraz" and on "Grafik": a warning
  for no reserve, an alarm for a missing person, days in a row as one chip
  that opens the first of them. Members are not sent the count, like
  eligibility.

Docs in both languages.
SonarCloud reads the ternary inside the ternary of the notice's lead as a
nested one (typescript:S3358), in both catalogs. The verb now agrees with
the number of people through pluralFormPl and pluralFormEn, like the
sentence after it.
@sonarqubecloud

sonarqubecloud Bot commented Dec 3, 2026

Copy link
Copy Markdown

@lowicz
lowicz merged commit 81a93d5 into main Dec 3, 2026
18 checks passed
@lowicz
lowicz deleted the fm/oncall-leave-u-step4 branch December 3, 2026 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant