# 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.

Checked 2 December 2026. By Bohuslav Poláček. https://meadowstack.com/screens/time-off-approval/

*Request LV-2026-0114 from the demo as the operations director sees it, rendered from the kit's components when the site was built.*

A live screen, rendered from the kit's components on the page: https://meadowstack.com/screens/time-off-approval/

Open it in the live demo: https://meadowstack.com/demo/?lang=en#/juniper/lide/volno/lv-114

From the example app [An app for restaurants and venues](https://meadowstack.com/examples/restaurant-staff-rota/).

## 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](https://meadowstack.com/components/approval-panel/), 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](https://meadowstack.com/patterns/approval-flow/).

## 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](https://meadowstack.com/integrations/supabase/) 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

*Who may decide on a time-off request, from the demo's people module: the pages show or hide the decision by it, and the server asks it again before it changes anything.*

From `apps/demo/src/modules/people/domain/permissions.ts` in the Meadowstack repository:

```ts
/** 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

*The kit's decision card as its manifest describes it to people and to coding tools, read when the site was built.*

| 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";` |

Read from the kit's component manifest when the site was built (126 components, packages/kit/src/components.json); the same entry answers an AI coding tool through the kit's MCP server.

## 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](https://meadowstack.com/screens/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.

## Related

- [An app for restaurants and venues](https://meadowstack.com/examples/restaurant-staff-rota/) (Example app)
- [A kitchen's food safety day, kept by the clock](https://meadowstack.com/screens/food-safety-checks/) (Screens)
- [A recipe with its cost and its allergens](https://meadowstack.com/screens/recipe-with-allergens/) (Screens)
- [The approval flow](https://meadowstack.com/patterns/approval-flow/) (Patterns)
- [A driver record that says what expires next](https://meadowstack.com/screens/driver-record/) (Screens)
- [A lot record that traces one step back and one step forward](https://meadowstack.com/screens/lot-traceability/) (Screens)
