Back to Feed
article 3m read

Some open shifts go missing now that the break planner has tickable cards

Ticking who gets planned works for named staff, but open shifts are grouped by their typed name, so a repeated name or a blank one never reaches the request, and the count on screen can't show it.

Article DepthPractice

Flow

Open shifts at Generate

  1. 1Open shift with its own name

    Gets a card and is sent.

  2. 2Open shift sharing a name

    Shares the first one's card and is left out.

  3. 3Open shift with no name

    Gets no card and is left out.

Once, the break planner planned every shift on the day. Now it plans whoever is ticked. When I read back through the change, I found shifts that can't be ticked at all.

Ticking people in

The setup has a screen with a grid of people. Before, the grid did nothing, and Generate sent every shift on the day. Now each card can be ticked on or off. Everyone starts ticked. A line under the grid counts who is in, and Next won't work if nobody is. The choice is kept on the page, so going Back doesn't lose it. When you come back to the screen, anyone who is gone gets dropped. If nobody is left, everyone gets ticked again. That one bugs me a bit. If you narrowed the list and the next visit's list has none of those people in it, my reading is that you come back to everyone ticked, with no note saying so.

At Generate, the page keeps only the ticked shifts and sends those to be planned and saved. If none are left, it stops and shows an error.

Shifts with no card

The match itself is fine. A shift with a person matches that person's card. An open shift, one with nobody on it yet, matches a card that holds that shift's own ID.

The problem is how the cards get made. Open shifts are grouped by the name someone typed on them, and each group gets one card. That card only holds the first shift in the group. And an open shift with no name gets no card at all. So:

  • Two open shifts both called "cover" make one card, and only the first one is sent.
  • An open shift with a blank name has no card, so it is never sent.
  • If every shift on a day is a blank open shift, the screen shows the store's staff list instead, nobody on it can match, and the error asks for a choice that can't help.

Before this change, all of those shifts were sent. The count under the grid counts cards, so it looks right and hides the gap.

Off-screen ticks and a lost warning

The grid only shows the first couple dozen cards, but everyone in the list starts ticked. With a big list, some ticked people are off screen where you can't untick them. And the bottom bar now shows the ticked count in the spot where unsaved edits used to show. Since everyone starts ticked, that warning mostly vanished.

How I'd close it

Give every open shift its own card, keyed by its own ID, and use one function for both the cards and the match. Then show how many shifts will be skipped right next to the ticked count.

This change came with no tests, so I would start with tests for two open shifts sharing a name, an open shift with a blank name, and a day made only of blank open shifts.

Keep reading

Pick up a connected idea or branch into a nearby one.

5 paths forward