Repository navigation
feat(frontend): show team leave on the Teraz screen - #400
Merged
Merged
Conversation
Under the schedule on "Teraz" the team sees who is on leave today and in the next 30 days. The first row answers today; then every leave has one row with its whole dates, its working days, the tag "trwa" while it runs and, when the person holds duties inside it, how many have no cover and a button to the first such day. - the panel reads the calendar for today plus 30 days on its own, so the rest of the screen never waits for it; it has its own loading rows, error state with retry, one-line empty state and a cut after five rows - entries that touch are one leave, entries a weekend apart are two; running leaves come first, and a leave with open duties leads its group - leave only, never a note or a reason, and nothing for a viewer account or a share link - the calendar's availability entries gain `entry_working_days`: the holiday calendar lives in the API, so only it can count the working days of a leave that reaches past the days read - docs in both languages and DESIGN.md describe the panel
SonarCloud asked for the element that carries the status role by itself instead of a div with `role="status"` (S6819); the other status lines of the app already use it. Also let a display name that is one long word break in the line that answers today: at phone width it ran past the panel's edge, as the pipeline's browser check of the previous run found.
|
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.



Intent
The oncall project gained a new preference kind "U" (urlop, leave) in step 1 (PR 399, merged). The captain approved a 5-step plan; this is STEP 2: the panel "Urlopy" on the "Teraz" screen (T1), so the whole team sees who is on leave today and in the next 30 days. The approved design and decisions are in ~/firstmate/data/oncall-leave-u-scout/report.md (sections 4-9, 11 and 6.2 step 2, plan table in section 7), with 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 and critique say about this step, quoted so this text stands on its own:
Plan table (section 7): step 1 is U as the fourth kind end to end (merged). Step 2 is the panel "Urlopy" on "Teraz" (T1), size S. Step 3 is U in the past by coordinator or admin with the "dopisany po fakcie" tag, step 4 the overlap warning (T3), step 5 the morning e-mail (T5). Each step is dispatched separately; steps 3-5 are not part of this one.
T1, the panel (section 4.5): "Panel "Urlopy" on "Teraz", below the matrix. Header "Urlopy · najbliższe 30 dni". The first row answers today: "Dziś nikt nie jest na urlopie" or "Dziś na urlopie: Marek Nowak (do pt 11 gru)". Then one row per leave: U mark, name, range, working days; tags "trwa" and "4 dyżury bez zastępstwa"; one button "Pokaż pierwszą kolizję". Empty: one line, "Nikt nie ma urlopu w najbliższych 30 dniach." More than five leaves: five rows and "Pokaż wszystkie (8)". Loading: two skeleton rows; failure: the existing error state with retry; the rest of the screen never waits for the panel. The panel is named for what the app knows (leave) and never says that everyone is present."
The approved mock of the panel draws each row as the U mark and the name, under it "pon 7 – pt 11 gru · 5 dni roboczych", and on the right the tags and the button; on the live day, when the person on leave holds a duty today that nobody took over, the first row reads "Dziś na urlopie: Marek Nowak (do pt 11 gru) · ma SECONDARY i 11–19 bez zastępstwa". The option the captain chose (D8, T1) says: who is on leave today and in the next 30 days, with working days and the duties still to hand over; everyone who sees availability sees it (D4).
Section 11.3 on the panel: it is titled "Urlopy", not "Nieobecności"; the first row answers today; a one-line empty state; the tag says "bez zastępstwa"; one button to the first collision; loading, error and a cap on the rows. Reason: the app knows only leave.
Visibility (D4-A, section 4.3): the existing rule. Members, coordinators and admins see the kind; the note only its author, coordinators and admins; viewers and share links see no availability.
What U means (D14-A): any whole day away from work. The word stays "urlop"; the team sees only "urlop", never a reason; the app does not ask for one.
Default 7 (section 5): leave days are counted in Polish working days (the holiday calendar is already in the app), with the date range shown beside the count.
Impact of step 2 (section 6.2): "Frontend only if the panel reads the existing calendar query for today plus 30 days (it carries availability with the visibility rule already applied). That payload also carries 30 days of assignments the panel does not need; a dedicated read is the upgrade if it proves heavy. New: one component on screens/Duty.tsx, catalog strings, tests."
States of the panel from the critique (impeccable-harden.md, part B):
Accessibility (section 4.7): leave is never colour alone; U goes through the existing availability mark, which carries a title and a visually hidden label. No motion is added.
The interface is Polish by default with English as the second language, and the user documentation exists in both.
What Changed
leaveslist. Leave entries on back-to-back days are joined into one leave. Each leave keeps its full dates even when it goes past the requested range. It carries the working-day count and the duties the person still holds, counted from the start of the range, and no note. It follows the existing availability visibility rule.DESIGN.md, the OpenAPI snapshot, and new backend and frontend tests with Polish screen snapshots.🤖 Generated with Claude Code
Risk Assessment
✅ Low: The change adds a read-only panel and a calendar field that uses the existing visibility rule, so viewers and share links get no team leave and no note is added; both earlier review decisions (whole leaves, and never hiding open duties) are implemented at the API and panel level.
Testing
I ran the real app with a throwaway database and drove the panel in a browser. All 12 scenarios passed: who sees it, its content, order, limit, page states, phone layout, English and help text. Test leaves that began in the past, and some other test data, went straight into the database because the app cannot enter past days. Handovers went through the real API, not the dialog. No automated tests were run. Two early attempts failed only because of my scripts (a reason text that was too short and a wrong page selector), and both passed when redone. The one note is an older phone-width problem outside the panel. Everything I started is stopped and cleaned up.
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
frontend/src/styles.css- This is a separate problem, and the leave panel does not cause it. On a 390 px phone, "Teraz" scrolls sideways (667 px wide) when someone on duty has a name of 76 characters with no spaces, such as an e-mail address. Hiding the new panel leaves the width at 667 px. The wide parts are the duty cards (.dcard-next) and the day list (.dayrow-role, .dayrow-rs). The panel alone fits at 390 and 320 px with that name. A long name with spaces (Bartłomiej Aleksander Wiśniewski-Kowalczykowski) causes no sideways scroll. A possible later fix is to let those two lists break long words.Real app: Postgres 18.7 in a throwaway container,alembic upgrade head,uvicorn oncall.main:app,npm run build(exit 0) andvite preview, driven in Chromium with PlaywrightSigned in as member, coordinator, admin and viewer, and opened a real share link; compared the screen with the calendar API answerRead every panel row for a test team with 11 leaves: dates, working days, tags, order, the limit and "Pokaż wszystkie"Clicked "Pokaż pierwszą kolizję" and checked which day openedAdded leave in two strokes throughPUT /api/v1/availability/me/rangeHanded over duties throughPOST /api/v1/calendar/overrideand reloaded the panelDelayed, then blocked, only the panel's request, and pressed the retry buttonChecked empty, nobody today, English, light and dark themes, and widths 1280, 820, 390 and 320 pxOpened the Polish and English help pages✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.