Skip to content

feat(hr): show attendance lateness to the owner only - #76

Merged
bladehell-ai merged 2 commits into
qa_fe_uifrom
feat/attendance-late-owner-hr-only
Aug 19, 2026
Merged

feat(hr): show attendance lateness to the owner only#76
bladehell-ai merged 2 commits into
qa_fe_uifrom
feat/attendance-late-owner-hr-only

Conversation

@bladehell-ai

@bladehell-ai bladehell-ai commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator

Builds on qa_fe_ui (1c0ae90f). Targets qa_fe_ui so the rest of that branch's work merges to develop together, on your schedule.

Why

b5092e30 removed the Late column and the Late Days tile outright — for everyone, including the roles that actually need the signal. This puts both back behind a role check instead, so the owner keeps them and nobody else sees lateness.

What changed

Surface on qa_fe_ui here
Late table column gone for everyone owner only
Late Days stat tile gone for everyone owner only
Late badge on the Status cell (Late 15m) ⚠️ still visible to everyone owner only

That third row is the gap worth flagging: the badge renders one cell to the left of the column that was removed, so employees could still read their lateness off the Status cell. All three surfaces now ride one flag — canSeeLate = user.role === 'owner' — because hiding any one alone leaks the same number from the others.

Layout follow-ups

  • The stat strip's column count follows the tile count (lg:grid-cols-5lg:grid-cols-4) so the grid doesn't leave a hole, and the skeleton count matches so it doesn't reflow on load.
  • 1c0ae90f's w-[40%] on Status exists only to absorb the space the Late column would occupy, so it now applies only when that column is absent. The owner gets the original balanced table back.
  • Restores the Clock and formatMinutes imports, and puts the Tooltip imports back to use — the removal left them imported but unused, raising three no-unused-vars warnings.

One decision worth a look

Deliberately a role check, not the attendance.view_all permission — that permission is held by org_manager, hr_manager and finance_manager alike, none of whom should see this. Trade-off: the gate is hardcoded to the owner role name. If it should be configurable per org, the clean version is a new attendance.view_late permission granted to owner only in PermissionSeeder.

Not touched

/hr/attendance/team, /hr/attendance/report, and the check-in CSV export (Late (min) column) all carry their own Late columns. Those are manager-facing, but org_manager and hr_manager can reach them — say the word if they're in scope.

Note: the branch name still says owner-hr-only from the first revision; e855befb narrowed the gate to the owner alone.

Verification

  • tsc --noEmit — no errors in the changed file (the only tree-wide errors are pre-existing @tiptap/* module-resolution failures in rich-text-editor.tsx, from a stale linked node_modules).
  • eslint on the changed file — 2 problems, down from 5 on the qa_fe_ui baseline (the 3 unused Tooltip warnings are cleared; the zodResolver as any cast and the react-hook-form watch() compiler warning are pre-existing).
  • Not exercised in a browser — confirming both role paths needs the Docker stack plus two logins.

Supersedes #75, which targeted develop and predated this branch.

🤖 Generated with Claude Code

b5092e3 removed the Late column and the Late Days tile outright, so the
owner and HR lost them too. Put both back behind a `canSeeLate` role check
(`owner` / `hr_manager`) instead, so the people who need the signal keep it
and employees do not see their own lateness.

Also closes a gap the removal left open: the Late badge on the Status cell
still rendered "Late 15m" to everyone, one cell over from the column that
had just been taken away. It now rides the same gate, as does the Late Days
stat tile. All three late surfaces are gated together — hiding one alone
leaks the same number from the others.

Details:
- The stat strip's column count follows the tile count (lg:grid-cols-5 ->
  lg:grid-cols-4) so the grid does not leave a hole; the skeleton count
  matches so the strip does not reflow on load.
- 1c0ae90's `w-[40%]` on Status exists only to absorb the space the Late
  column would occupy, so it now applies only when that column is absent.
- Restores the `Clock` and `formatMinutes` imports, and puts the `Tooltip`
  imports back to use — they were left unused by the removal and were
  raising three no-unused-vars warnings.

Deliberately a role check rather than the `attendance.view_all` permission:
that permission is also held by org_manager and finance_manager, who must
not see it. Trade-off — a custom org role will not match; a dedicated
`attendance.view_late` permission is the configurable version if wanted.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Drops hr_manager from `canSeeLate`, so the Late column, the Late badge on
the Status cell and the Late Days stat tile are now visible to the owner
and to no one else.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bladehell-ai bladehell-ai changed the title feat(hr): show attendance lateness to the owner and HR only feat(hr): show attendance lateness to the owner only Aug 19, 2026
@bladehell-ai
bladehell-ai merged commit 6af9f4e into qa_fe_ui Aug 19, 2026
5 checks passed
@bladehell-ai
bladehell-ai deleted the feat/attendance-late-owner-hr-only branch August 19, 2026 08:40
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