Repository navigation
fix(layout): stop screens jumping as data arrives and after taps - #149
Conversation
Content that depends on late data now waits for it instead of drawing early and being pushed, and changing states keep their size (reserved lines, fixed slots, tabular numbers), so nothing moves under the reader or their finger.
Code review
This pull request stabilizes data-dependent layouts across Home, project, monitor, alert, settings, setup, and escalation screens by reserving space or waiting for the data that determines what is shown. It also keeps interaction states at consistent sizes with fixed-width slots, tabular figures, and reserved text lines. Latest changes: The newest commits also wait for member names before showing escalating alert details, wait for escalation names on monitor details and project names in Settings, and let the snooze sheet show disabled duration choices after prefs fail; the alert-detail integration fixtures now answer the membership request. Walkthrough (25)
Reviewed the commits since Tip Comment |
…ep the snooze sheet after a failed load Review found names that still swapped in after the screen showed (monitor escalation, alert escalation members, Settings project names) and a snooze sheet left empty when prefs failed to load.

What does this change?
Fixes 20 layout shifts: places where content jumped as data arrived, or where a tap changed something's size and moved what was around it. Each one is fixed at its cause, not hidden.
Almost every fix follows one rule. If a piece of data decides what goes above other content, that content waits for the data instead of drawing early and then being pushed down. The other fixes keep changing states the same size: reserved lines, fixed-size slots, tabular numbers, and an invisible bold copy that sets a label's width.
Each section below has a side-by-side video, Before on the left and After on the right. Both were recorded under the same slow connection.
How did you test it?
format:check,lint,typecheckand all 125 jest tests pass.Shifts on load
Home: snooze card pushed everything down
The "7 notifications in 30 minutes" snooze card is about 230 px tall. It appeared only once alerts and notification settings had loaded, which pushed Setup, Activity and Projects down. Now everything below the top cards waits for both queries, so the screen appears once in its final order.
There were three smaller shifts on the same screen:
src/app/(app)/(tabs)/(home)/index.tsx,src/alerts/activity-card.tsx,src/projects/project-row.tsxhome-phone.mp4
home-ipad.mp4
Projects: a "Firing" group appeared above the list
The list drew first. When alerts arrived, a "Firing" group was inserted above it and every row was reordered. The list now waits for alerts, so it's sorted correctly the first time.
src/app/(app)/(tabs)/projects/index.tsxprojects-phone.mp4
projects-ipad.mp4
Project detail: metric tiles changed width, footer pushed down
The tiles widened as their values arrived, and again on every 24h/7d/30d switch, sliding the tiles beside them. The Alerts block also pushed the footer down. Tiles now have a fixed width, long values shrink to fit, and values use tabular numbers. The Alerts block, the note and the button wait for alerts.
src/app/(app)/(tabs)/projects/[id].tsxproject-detail-phone.mp4
project-detail-ipad.mp4
Alert detail: sections inserted above Acknowledge
The probe check section, the threshold note and the escalation steps were each inserted above Acknowledge as their data arrived, moving the button. Everything under the title now waits for the monitor data. When the alert has an escalation, it also waits for the escalation and for the members its steps name.
The history chart card used to disappear on error, which pulled everything up. It now keeps its chart height and shows "Couldn't load the readings around this alert."
src/app/(app)/(tabs)/alerts/[id].tsx,src/alerts/history.tsxalert-probe-phone.mp4
alert-usage-phone.mp4
Monitor detail: chart and recent alerts arrived late
The 186 px usage chart appeared late, and the one-row "Loading…" turned into up to five alerts. The chart's height is now reserved from the start, with the empty or error text inside it, and the body waits for recent alerts. When the monitor has an escalation, it also waits for the escalation's name, which used to replace "Escalation" in the Settings row.
src/app/(app)/(tabs)/monitors/[id].tsx,src/alerts/threshold-chart.tsx(exportsheight)monitor-phone.mp4
Escalations list: rows rewrapped as data filled in
The section title, monitor counts and member names filled in one at a time, so rows rewrapped. The list now waits for all three, and the loading state uses the same section title.
src/app/(app)/escalations/index.tsxescalations-phone.mp4
Escalation editor: controls appeared after the role check
The editor drew read-only first. Then, once the role check came back, Add step, the stepper, Delete and Save appeared.
useCanManageEscalationsused to returnfalsewhile loading. It now returnsnullfor "not known yet", and the editor waits for it along with monitors and members. It still returnstrueon error, as before.src/escalations/use-escalations.ts,src/app/(app)/escalations/[id].tsxescalation-phone.mp4
Settings: sections appeared after load
The Projects section and the "Snoozed until" lines appeared after load and pushed the rest down. Sections below "This iPhone" now wait for settings, alerts, project names and the notification permission.
src/app/(app)/settings/index.tsxsettings-phone.mp4
Setup › Choose what you watch: card filled row by row
An empty card filled in one row at a time, and the intro text gained a line. The spinner now stays until all projects and alerts have loaded, and the intro holds its line in the meantime.
src/setup/watch.tsxsetup-watch-phone.mp4
Snooze sheet and two-factor screen (no video)
src/app/(app)/snooze.tsx,src/app/mfa.tsxShifts after interaction
Filters button: badge widened the button
Applying a filter added a count badge, which widened the button and narrowed the search field. The count now takes the filter icon's place in an 18 px slot and uses tabular numbers.
src/components/filter-bar.tsxfilters-phone.mp4
Acknowledge and Undo: row changed height
The 50 px Acknowledge button became a 44 px row, and the "Next" escalation subtitle disappeared, so everything below moved. Both states are now 50 px, and the subtitle line is kept blank.
src/alerts/acknowledgement.tsx,src/escalations/alert-escalation.tsxacknowledge-phone.mp4
Escalation step sheet: error line inserted under your finger
Unticking the last role inserted an error line above Roles, which moved the row you were tapping. That line is now always reserved.
src/escalations/step-sheet.tsxstep-sheet-phone.mp4
History range segments: bold label nudged its neighbours
The selected label turns bold and gets wider, which nudged the segments next to it. An invisible bold copy of each label now sets the segment's width, and the visible label sits on top of it.
The flow couldn't tap "30 days", so the video covers the History toggle and "7 days".
src/components/segments.tsxsegments-phone.mp4
Check marks in Assign, Snooze and Organizations (no video)
The spinner or check mark took width from the row's text and rewrapped long subtitles. Both now sit in a fixed 22 px slot.
src/app/(app)/escalations/assign.tsx,src/app/(app)/snooze.tsx,src/app/(app)/organizations.tsxThreshold sheet (no video)
A "You can't edit monitors" box grew the sheet and moved Save. That message is now a dialog, matching the monitor screen. On Android, "Saving…" widened the button, so the button now has a minimum width of 112.
src/app/(app)/threshold.tsxTrade-off
Screens now wait for the data that decides their layout instead of showing early placeholders. On a slow first launch, Home shows only its top cards for a few seconds rather than skeletons that would then be pushed down. With persisted data, which is every launch after the first, there's no visible difference.
Not changed, on purpose
Part of appwrite-labs/cloud#7206