Skip to content

fix(layout): stop screens jumping as data arrives and after taps - #149

Merged
ChiragAgg5k merged 2 commits into
mainfrom
fix/layout-shifts
Dec 4, 2026
Merged

ChiragAgg5k merged 2 commits into
mainfrom
fix/layout-shifts

Conversation

@ChiragAgg5k

@ChiragAgg5k ChiragAgg5k commented Dec 4, 2026 •

Copy link
Copy Markdown
Member

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?

  • Beep builds only for iOS and Android, so I tested on the iOS simulator: an iPhone 17 Pro for mobile width and a 13" iPad for the wide layout.
  • Slow connection, cache disabled. For the recordings only, every demo-mode request was delayed by 1.2–4 s. The data that decides the layout (alerts, settings, escalations, members) came last, which is the worst case. The persisted query cache was also discarded on every launch. Neither change is in this PR.
  • Every screen was loaded cold. The main flows were then driven with Maestro to catch shifts after interaction: filters, acknowledge and undo, the escalation step sheet, and history ranges.
  • Fonts are bundled, so there's no font swap. The two update cover images already have a fixed aspect ratio, and the logo and button icons have fixed sizes.
  • format:check, lint, typecheck and 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:

  • Activity card: the severity legend appeared after loading and pushed Projects and Updates down. The legend row is now always there and one line tall, and dates and counts use tabular numbers.
  • Alerts card: the detail line disappeared when there was nothing to add (for example "All clear"), so the card shrank. The line is now kept, blank when empty.
  • Project cards (iPad): the request count appearing made the top row taller. A blank line now holds its place while it loads.

src/app/(app)/(tabs)/(home)/index.tsx, src/alerts/activity-card.tsx, src/projects/project-row.tsx

home-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.tsx

projects-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].tsx

project-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.tsx

alert-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 (exports height)

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

escalations-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. useCanManageEscalations used to return false while loading. It now returns null for "not known yet", and the editor waits for it along with monitors and members. It still returns true on error, as before.

src/escalations/use-escalations.ts, src/app/(app)/escalations/[id].tsx

escalation-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.tsx

settings-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.tsx

setup-watch-phone.mp4

Snooze sheet and two-factor screen (no video)

  • Snooze sheet: the "Snoozed" section was inserted at the top once settings loaded. The sheet now waits for settings. If they fail to load, it still lists the durations, disabled, as before. There's no video because the demo account has no active snooze.
  • Two-factor screen: an error block of about 90 px was inserted above the code field, and the other sign-in methods pushed the footer down. The error now takes the hint's place, which already holds two lines. The Try again button sits with the other methods, and the methods and footer wait for the factor list. There's no video because demo mode skips sign-in.

src/app/(app)/snooze.tsx, src/app/mfa.tsx

Shifts 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.tsx

filters-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.tsx

acknowledge-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.tsx

step-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.tsx

segments-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.tsx

Threshold 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.tsx

Trade-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

  • Offline banner: appears above Alerts and Monitors when a refresh fails. That's a real status change, and moving the banner would be a design call.
  • Probe target text: swaps from the metric name to the URL on the same line, so nothing moves.
  • Escalation editor footer: pressing + on Repeat can add a line, and clearing the name adds a note above Delete. Content below the control grows, but the control itself stays put.
  • Project chart: on a failed load, it's replaced by a shorter error block.
  • Activity card: for an organization with no monitors, it switches to a different layout.
  • Changelog placeholders: they don't match the cover or title size exactly, but they're last in their column, so nothing below them moves.

Part of appwrite-labs/cloud#7206

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.
@appwrite

appwrite Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Code review

Commit Status Tier Verdict Details
85d620c Reviewed Reviewed 🟢 S · Ready to merge ✅ Approved View review

The newest changes address the outstanding snooze error-state concern, and I found no remaining defects in the incremental changes.

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)
File Change
src/alerts/acknowledgement.tsx Keeps the acknowledge and undo rows the same height.
src/alerts/activity-card.tsx Keeps the activity legend present and stabilizes date and count widths.
src/alerts/history.tsx Preserves the alert-history card height and displays an error message on failure.
src/alerts/threshold-chart.tsx Exports the chart height for use by its detail screen.
src/app/(app)/(tabs)/(home)/index.tsx Waits for alerts and prefs before showing lower Home content and preserves the alert detail line.
src/app/(app)/(tabs)/alerts/[id].tsx Waits for monitor, escalation, and member data before rendering alert details.
src/app/(app)/(tabs)/monitors/[id].tsx Reserves the usage-chart height and waits for recent alerts and escalation names.
src/app/(app)/(tabs)/projects/[id].tsx Fixes metric tile widths and waits for alerts before rendering lower content.
src/app/(app)/(tabs)/projects/index.tsx Waits for alerts before grouping projects by firing status.
src/app/(app)/escalations/[id].tsx Waits for role, monitor, and member data before showing the editor.
src/app/(app)/escalations/assign.tsx Places selection indicators in a fixed-width slot.
src/app/(app)/escalations/index.tsx Waits for monitor counts and member names before rendering escalation rows.
src/app/(app)/organizations.tsx Reserves space for organization selection indicators.
src/app/(app)/settings/index.tsx Waits for prefs, alerts, project names, and notification permission before showing sections.
src/app/(app)/snooze.tsx Waits for prefs and keeps duration choices visible but disabled after a load failure; reserves selection-indicator width.
src/app/(app)/threshold.tsx Shows permission errors in a dialog and gives Android save actions a minimum width.
src/app/mfa.tsx Uses the hint area for errors and waits for factor data before showing alternate methods and the footer.
src/components/filter-bar.tsx Uses a fixed icon/count slot and tabular digits for filter counts.
src/components/segments.tsx Uses an invisible bold label to keep segment widths stable when selection changes.
src/escalations/alert-escalation.tsx Keeps the next-notification subtitle line when no step is due.
src/escalations/step-sheet.tsx Reserves a line for validation messages in the step sheet.
src/escalations/use-escalations.ts Represents unknown escalation-management permission as null while scopes load.
src/projects/project-row.tsx Keeps a blank value line while project request counts load.
src/setup/watch.tsx Waits for project and alert queries before displaying the watch list.
tests/integration/alert-detail.test.tsx Provides membership responses for escalating alert detail integration scenarios.

Reviewed the commits since 7cceb9d

Tip

Comment @appwrite review to re-run, or mention @appwrite with a question.

@appwrite appwrite Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Tier A · See the inline comments. Summary

Comment thread src/app/(app)/(tabs)/monitors/[id].tsx Resolved
Comment thread src/app/(app)/(tabs)/alerts/[id].tsx Resolved
Comment thread src/app/(app)/settings/index.tsx Resolved
Comment thread src/app/(app)/snooze.tsx Resolved
…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.

@appwrite appwrite Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@ChiragAgg5k ChiragAgg5k self-assigned this Dec 4, 2026
@ChiragAgg5k
ChiragAgg5k merged commit 3e82a77 into main Dec 4, 2026
7 checks passed
@ChiragAgg5k
ChiragAgg5k deleted the fix/layout-shifts branch December 4, 2026 12:52
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.

1 participant