# A restaurant rota planned against the takings

The rota is a week of people by day: the kitchen and the floor in two groups, each shift a quiet chip with its hours and role, approved time off hatched, and the week's hours at the end of each row. Above the grid the empty places and the short rests are listed in words, and under it each day's labour sits against the expected takings, so a manager plans the week and its cost on one screen.

Checked 2 December 2026. By Bohuslav Poláček. https://meadowstack.com/screens/staff-rota/

*The Islington branch's week from the demo, rendered from the kit's components when the site was built. Narrower than 48rem it becomes the phone's list by day.*

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

Open it in the live demo: https://meadowstack.com/demo/?lang=en#/juniper/smeny/rozpis

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

## What the screen shows

- **The week**: people as rows in two groups, Kitchen and Floor and bar, days as columns with today in bold. A shift is a grey chip with its name, its hours and the role, and in the shift templates a 2px bar shows where in the day each one falls.
- **What needs doing, in words**: each day's header says "1 missing" or "covered". A shift with less than 11 hours of rest before it carries an amber ring and the hours it has ("8 h"), and a person over 48 hours in the week gets the same ring on their total. A notice above the grid gathers it all, "4 empty places, 2 short rests", with Fill or Show beside each line.
- **Time off and the other branches**: leave approved on [the time-off request](https://meadowstack.com/screens/time-off-approval/) fills the person's cells as a hatched "Off" block, the look the kit uses for blocked time. A shift at another branch shows that branch's dot and name, so the head chef's day in Camden does not look like a free day.
- **Labour against takings**: under the rows, the day's labour cost, the expected takings and the share. Inside 25 to 35% the share says nothing more, under it a quiet "under 25%", over it the amber ring and the words. Only the people who plan the branch see these rows; the chef and the staff see their shifts without a cost.

## An editor, not a calendar

A rota is a planning view, and the framework's rules make every planning view an editor ([the planning editor pattern](https://meadowstack.com/patterns/planning-editor/)): drag a shift to another day or person, hold Alt to drag a copy, drag a template from the strip into a cell, or add one in an empty cell. From the keyboard, Space picks a shift up, the arrows choose a cell and Space drops it, which is how the kit's [ScheduleGrid](https://meadowstack.com/components/schedule-grid/) works everywhere it is used.

A cell that cannot take a shift says why before the shift is let go: "is off that day", "has a shift that day", "Only 8 h between shifts, the law wants 11 h". The grid asks the app through `refuseDrop`, the dialog asks the same functions, and the server asks them again, so the reason is the same wherever the change starts. Changes stay a draft until the manager publishes the week, and the line beside the toolbar says what the staff last saw.

## The rules behind the numbers

Daily rest is 11 hours between the end of one shift and the start of the next, counted across every branch. Weekly rest is 24 hours without a break, and a rest that crosses into the next week counts in full for both. The week's limit is 48 hours, kept week by week, which is stricter than the regulations' average over 17 weeks.

The share of labour in takings is each shift's hours times the person's hourly cost with the employer's levies, over the day's expected takings. All of it is derived from the week held on screen, so a figure changes in the same frame as the shift that moved it.

## What generated rotas usually get wrong

Asked for a rota, coding tools tend to draw a calendar of coloured pills, one colour per role, with the rules left for later. Then a manager drags a closing waiter into the next morning and nothing objects, or the check lives only in the form, so a drag goes around it.

In Meadowstack the rule is one pure function the grid, the form and the server share, and the grid's `refuseDrop` puts its reason on the cell. Colour carries information only: shifts are neutral chips, amber marks what needs doing next to its words, and people get their identity hue from `Avatar`, never red, orange or yellow. On a phone the week becomes a list by day instead of a table that scrolls sideways. The same screen type, the workspace, is one of the kit's 9 described in [the guide to screen types](https://meadowstack.com/guides/screen-archetypes-for-business-apps/).

## The rest rule, written once

*The daily rest check from the demo's rota: a pure function, so the grid refuses a drop, the shift dialog greys a person out and the server refuses the request with the same words.*

From `apps/demo/src/modules/shifts/domain/rest.ts` in the Meadowstack repository:

```ts
/** Pairs of neighbouring shifts of one person with less than 11 hours between them. */
export function dailyBreaks(shifts: Shift[], personId: string): RestBreak[] {
  const spans = spansOf(shifts, personId);
  const found: RestBreak[] = [];
  for (let index = 1; index < spans.length; index += 1) {
    const before = spans[index - 1]!;
    const after = spans[index]!;
    const hours = after.start - before.end;
    if (hours < DAILY_REST_HOURS)
      found.push({ kind: "daily", personId, shift: after.shift, other: before.shift, hours });
  }
  return found;
```

## ScheduleGrid in the kit's manifest

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

| Manifest field | ScheduleGrid |
| --- | --- |
| What it is | A planner's table: people or machines by day, with things dragged between cells, templates and copies. |
| Use it for | A rota, a machine plan or visits by day: an editor, from the keyboard too. |
| Not for | For hours within a day (TimeGrid, ResourceTimeline) |
| It replaces | A hand-built rota table with drag and drop |
| Screen types | Workspace |
| Import | `import { ScheduleGrid } 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

### Does the rota warn when a shift breaks the rest rules?

Yes. A shift with less than 11 hours of rest before it shows an amber ring and the hours it has, and a week without 24 hours of unbroken rest marks the person's total. Dragging a shift into a cell that would make a new break is refused with the reason, and the server refuses the same change.

### Can staff swap shifts themselves?

They offer their own shift, one that is still ahead, to a colleague. The swap shows on the rota as a dashed card until the branch manager or the operations director decides, and nobody decides on a swap they are part of, so a manager's own swap goes to the director.

### Who sees the labour cost under the rota?

The people who plan the branch: the operations director for every branch and a branch manager for their own. The chef and the staff see the same rota without the cost rows.

### Can it be planned from the keyboard?

Yes. Every shift and template is a button: Space picks it up, the arrow keys choose a cell, Space drops it and Alt with Space drops a copy. Each step and each refusal is announced, so the grid works with a screen reader too.

### What does the rota look like on a phone?

Seven days of people do not fit a phone, so the week turns into a list by day: who works in the order of the day, who is off, who is at another branch, with the day's labour share beside its date.

## Sources

- [The Working Time Regulations 1998, regulation 10: daily rest](https://www.legislation.gov.uk/uksi/1998/1833/regulation/10), checked 2 December 2026
- [The Working Time Regulations 1998, regulation 11: weekly rest period](https://www.legislation.gov.uk/uksi/1998/1833/regulation/11), checked 2 December 2026
- [The Working Time Regulations 1998, regulation 4: maximum weekly working time](https://www.legislation.gov.uk/uksi/1998/1833/regulation/4), checked 2 December 2026

## Related

- [An app for restaurants and venues](https://meadowstack.com/examples/restaurant-staff-rota/) (Example app)
- [A dispatch plan that checks driving hours on every drag](https://meadowstack.com/screens/dispatch-plan/) (Screens)
- [Court bookings on a timeline you drag](https://meadowstack.com/screens/court-bookings/) (Screens)
- [GanttChart: a project schedule with its links and key dates](https://meadowstack.com/components/gantt-chart/) (Components)
- [ScheduleGrid: a rota you edit by drag or from the keyboard](https://meadowstack.com/components/schedule-grid/) (Components)
- [The planning editor](https://meadowstack.com/patterns/planning-editor/) (Patterns)
