Skip to content

fix(shell): swiping back draws the screen underneath - #550

Open
vaakx-dev wants to merge 1 commit into
mainfrom
sand/fix-settings-swipe-black-screen
Open

vaakx-dev wants to merge 1 commit into
mainfrom
sand/fix-settings-swipe-black-screen

Conversation

@vaakx-dev

Copy link
Copy Markdown
Owner

Swiping back on a phone now slides the page away over the screen it returns to, instead of over black.

What

  • The phone shell draws the screen a back swipe goes to under the current one. It is kept built and hidden until the drag starts, so it shows from the first move.
  • Each history entry records the route below it, so the shell knows what a history back reveals (Settings page → Settings list → chat).
  • Screen.back now names the route it returns to instead of returning a function, so a child page shows its parent underneath even when it was opened from search.
  • After the slide settles, the old page stays off-screen until the navigation lands, so it no longer snaps back for a moment while the browser's back is pending.
  • The Models page's in-page sub-views (Favourites, each account) are Settings child pages now, like Logins and Add-ons, so they swipe back the same way. SettingsPage.back is gone; nothing else used it.
Page → Settings list Settings list → chat Account page → Models
Mid-swipe from a Settings page Mid-swipe from the Settings list Mid-swipe from a Models account page

Why

  • The phone view rendered only the current screen and slid it right, so the area it uncovered was empty until navigation finished.

Verification

  • New phone test: on both phone sizes, mid-swipe the only visible screen at the left edge is the one back leads to, for a child page opened directly (→ its parent), a page (→ Settings list) and the list (→ chat).
  • window.ts, drawers.ts, keyboard.ts and web/parts.ts pass locally. tsc, vrui-check, the deps and comments checks pass.
  • Sampled the visible screen at the left edge every few ms through the settle: always the destination screen, never empty.
  • In a sandbox at 390×844 with touch: Models › Favourites and Models › an account swipe back over Models.

The phone shell rendered only the current screen, so a back swipe slid it off over nothing. The screen a back swipe goes to is now kept built and drawn under the current one. Each history entry records the route below it, and a screen's back names the route it returns to, so the shell knows what to draw from the first move. Models' sub-views are Settings child pages so they slide back the same way.
@github-actions

Copy link
Copy Markdown

Performance: ✅ every row is within its limit

Main 932d802 against this PR 4f5c9bf, both measured in the same job, medians of 5 runs. Times, memory and CPU fail when the PR is more than 15% worse, bytes when they grow more than 5%; changes under 20 ms or 2 KB never fail. Logs

main PR change
Phone (4× slower CPU, 150 ms, 9 Mbit/s link)
open a chat: shows 325 ms 314 ms -3.4% ✅
open a chat: usable 344 ms 341 ms -0.8% ✅
first visit with an empty cache: usable 2.01 s 2.11 s +4.8% ✅
open a long chat: usable 320 ms 321 ms +0.6% ✅
send: your message shows 59 ms 61 ms +3.0% ✅
send: first reply text shows 312 ms 329 ms +5.6% ✅
main thread blocked over these steps 822 ms 956 ms +16.3% ✅
data on first visit 931.3 KB 932.3 KB +0.1% ✅
data per chat opened 49.5 KB 49.5 KB +0.0% ✅
data while idle for 20 s 220 B 220 B 0% ✅
app code a phone downloads 1.6 MB 1.6 MB +0.1% ✅
Main pages (same phone and link)
Settings: time to open 47 ms 68 ms +44.8% ✅
Settings: data to open 100 B 0 B -100.0% ✅
Settings: data per minute left open 600 B 600 B 0% ✅
Add-ons: time to open 63 ms 75 ms +19.7% ✅
Add-ons: data to open 0 B 100 B new ✅
Add-ons: data per minute left open 600 B 600 B 0% ✅
Usage: time to open 49 ms 52 ms +5.1% ✅
Usage: data to open 15.2 KB 15.2 KB 0% ✅
Usage: data per minute left open 600 B 600 B 0% ✅
Search: time to open 63 ms 65 ms +2.2% ✅
Search: data to open 0 B 0 B 0% ✅
Search: data per minute left open 600 B 600 B 0% ✅
Performance: time to open 439 ms 436 ms -0.6% ✅
Performance: data to open 850 B 851 B +0.1% ✅
Performance: data per minute left open 1.9 KB 1.9 KB -2.6% ✅
PC side
start-up until ready 3.95 s 3.93 s -0.6% ✅
memory while idle 237.4 MB 236.9 MB -0.2% ✅
CPU used over 60 s idle 380 ms 380 ms 0% ✅
memory after 100 scripted chat turns 274.3 MB 273.0 MB -0.5% ✅
CPU for one reply 49 ms 49 ms 0% ✅
search time on 100k messages 105 ms 106 ms +0.7% ✅
database size per 10k messages 19.8 MB 19.8 MB -0.0% ✅
worktree list with sizes on 40 worktrees 606 ms 605 ms -0.2% ✅
slowest other reply during a worktree list 46 ms 39 ms -15.0% ✅

This branch has not been deployed

No deployments
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