A time-off request waiting for a decision
A time-off request opens as a record titled by the person who asked, with its number as a small eyebrow and its state beside the name. The decision card at the top of the side column shows the days and the dates, names who else from the branch is away at the same time, and offers Reject and Approve; a rejection always asks for a reason the requester will read.
By Bohuslav PoláčekChecked
What the screen shows
- The request as a record: the person who asked is the title, the number LV-2026-0114 a small eyebrow, the state a half-filled amber glyph with the words "Waiting for approval".
- The decision card: the number of days large, the dates under it, and the line that makes the decision quick: "Also away at the same time: David Cooper." The demo works it out from the branch's approved absences over the same dates, and says so when nobody else is away. Reject and Approve sit side by side under it.
- The facts: the type of time off (annual leave, sick leave, time off in lieu or unpaid leave), the dates, the number of days, the branch with its dot, the requester's note and when it was submitted.
- The history: "Submitted" with the person and the time. A decision adds its own entry, with the reason when it is a rejection.
Who decides on whose request
Nobody decides on their own request. A branch manager decides on the waiters, the bar and kitchen staff and the new hires of their branch; the operations director decides on the managers and the chef and may step in for any branch; her own time off is written down without a decision, because nobody is above her.
That rule is one function, decidesOn below, which the page and the server both ask. It also lets the page name the deciders to anyone who cannot decide, "Decided by branch manager Tom Bennett or operations director Laura Marlow.", instead of showing a button that is greyed out with no reason.
What the decision card keeps for you
The card is the kit's ApprovalPanel, and its rules come with it: a rejection always needs a written reason, which goes into the history; an approval asks for a confirmation, so a stray click approves nothing; people who cannot decide see the state and who can. From 1024px the card heads the side column; on a phone it comes before everything else, because the decision is what a manager opened the request for. The whole flow, from submitting to the decision, is the approval flow pattern.
What generated approval screens usually get wrong
Coding tools tend to put Approve and Reject on every row of a table, the manager's own request included, mark the state with a coloured pill or a yellow banner, and let a rejection go out without a word. Nothing on the screen says who else is away that week, so the manager opens the rota in another tab.
In Meadowstack the permission is asked with the record (usePermission("leave.approve", leave)), never by comparing roles in a component, and a backend repeats the rule: the Supabase recipe shows four-eyes enforced by the database itself. The state is a glyph beside a word, the decision a card rather than a banner, and the overlap sits in the card where the decision is made.
The four-eyes rule in one function
/** Whether this person may decide on this request: the four-eyes rule lives here, not in the pages. */
export function decidesOn(person: Person, leave: Requester) {
if (person.id === leave.personId) return false;
if (person.role === "owner") return true;
return (
person.role === "manager" && approverKind(leave.personRole) === "branch" && sharesBranch(person, leave.branchIds)
);
}ApprovalPanel in the kit's manifest
| Manifest field | ApprovalPanel |
|---|---|
| What it is | The decision card at the top of a record's side column: approve, or reject with a reason; nobody approves their own record. |
| Use it for | A record that needs someone else's sign-off. |
| Not for | As a coloured banner across the page |
| It replaces | Hand-built approve and reject buttons with a reason dialog |
| Screen types | Record; Index; Worklist |
| Import | import { ApprovalPanel, approvalCopyCs } from "@meadowstack-studio/kit"; |
Questions
Can a manager approve their own time off?
No. Nobody decides on their own request: a branch manager's request goes to the operations director, and the director's own time off is written down without a decision.
Does the manager see who else is away on those days?
Yes. The decision card names everyone from the branch whose approved time off overlaps the dates, or says that nobody else is away.
What happens when a request is rejected?
The manager has to write a reason. The requester reads it and can suggest other dates, and the history keeps the rejection with the reason and the name of whoever decided.
Does approved time off show on the rota?
Yes. Approved leave fills the person's days on the staff rota as a hatched Off block, and the rota refuses a shift on those days with the words "is off that day".
Can someone cancel a request they made?
Yes, their own, while it is waiting or approved and its last day has not passed.
Two ways
Build it yourself, or have it built
Build it yourself
Build your app on the framework
Get the codebase these apps stand on and build yours with Claude Code, Cursor or Codex.
One payment, lifetime updates
Get the frameworkHave it built
Have us build your app
Tell us how your team works. We plan the app with you and build it on the same framework at a fixed price.
After launch, Care keeps it improving, from €99 a month.
from €1,990
Describe your app