Skip to content

Feat/menu schedule strings - #195

Open
yerloveraaa wants to merge 5 commits into
feature/bank-account-validationfrom
feat/menu-schedule-strings
Open

Feat/menu schedule strings#195
yerloveraaa wants to merge 5 commits into
feature/bank-account-validationfrom
feat/menu-schedule-strings

Conversation

@yerloveraaa

Copy link
Copy Markdown
Collaborator

No description provided.

Replace the SectionList + getItemLayout approach with an Animated.ScrollView
that measures each section's real position via onLayout. Row heights were
estimates, so tab presses landed in the wrong section and the render window
left blank areas on screen.

Index updates are blocked while a tab press travels to its target and released
on arrival, so the tab strip animates once per press instead of once per
section crossed. Also corrects the no-description/no-photo row height estimate
in getItemLayout to match what ProductListItem renders.
A menu now says when it can be ordered, so the storefront needs to name a day
and an hour: nineteen keys covering the days of the week, the start/end labels
of the vendor's hour editor, and the sentences the customer reads under the
menu tabs.

These are the first keys to interpolate. i18n-js resolves %{name} against the
options object, which is what lets "opens Saturday at 4:00 AM" and "opens at
5:00 PM" be the same sentence with and without a day — the caller decides,
because the day is only worth naming when the next opening is not today. The
day names double as the section headers of the hour editor, which is why they
are capitalised and read a little formal inside a Spanish sentence.

- ListItem gives its description rows a key. The array branch has always
  mapped without one; nothing hit it until a caller passed an array on a
  screen that renders a list, and React warned. It is a rendering bug of the
  component, not of the caller.
The Vendor app kept this editor to itself, but it is design-system work: Paper
primitives, MD3 tokens, and the nineteen strings the previous commit already put
in en.json and es.json. It arrives here as a component folder and leaves the app
with an import.

utils.js is the editor's logic and comes with it. The form uses all of it —
rangesOf, timeSlotsFor, isRangeInvalid and the withRange* builders — so it is
not a helper the consumer could own. Only what a screen actually calls is
public: MenuScheduleForm plus hasInvalidRanges, invalidRanges, isValidTime and
DAYS_OF_WEEK. The builders stay internal, since a caller that rewrote a range by
hand would be writing a shape the backend parses.

The map is the same one functions/inventory/schedule.js persists: a missing day
is closed, an empty map is always open, and an end at or before the start
crosses midnight. Nothing here converts it, which is why utils.js has no
react-native import and can be checked in node.

The story covers the three states worth looking at, including a range imported
from Uber with an inclusive end (18:00–02:59) — timeSlotsFor splices such a
value into the 15-minute list so opening the picker neither hides nor rewrites
it. Its glob is in .storybook/main.ts; that list is hand-maintained and the web
docs would not show the story otherwise.
@yerloveraaa
yerloveraaa requested a review from joelmsanto August 2, 2026 23:10
@yerloveraaa yerloveraaa self-assigned this Aug 2, 2026
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.

2 participants