Skip to content

Opening a session: show what the tab has at once, on a reload and on a first visit - #280

Open
vitalNohj wants to merge 1 commit into
TannerMidd:release/0.28.0from
vitalNohj:upstream/open-session-at-once
Open

vitalNohj wants to merge 1 commit into
TannerMidd:release/0.28.0from
vitalNohj:upstream/open-session-at-once

Conversation

@vitalNohj

Copy link
Copy Markdown
Contributor

Closes #279

Shows a session the device kept as soon as the page can check it, on a reload and on a first visit, instead of waiting for the sign-in check and then jumping to it.

What it does

  • A signed-in page carries who is signed in and which build, so a session the device kept can be checked and shown before /api/me answers. A signed-out page, and a server that does not keep sessions on the device, carry neither.
  • The page stays hidden until that check finishes. With a checked copy, the session replaces the starting screen. With none, the starting screen stays until the server answers.
  • The copy is checked again once /api/me answers. A changed person, rights, or build removes it, on the device too, and a later switch cannot bring it back. A startup retry checks the same copy again.
  • Opening a session the device kept, but this tab has not shown, reads it before the server answers. One kept nowhere shows its own header and a quiet loader in the same pane, then fills that pane.
  • Rows that arrive after a session is on screen glide to the bottom instead of jumping, including a late catch-up, a reconnect, and a reload.

Tests

  • A cached reload paints its rows before /api/me, and never shows the starting screen. The session menu stays disabled until the check answers.
  • A reload with nothing kept shows the starting screen until /api/me, then the rows.
  • A switch reads rows kept only on the device before the server answers. One kept nowhere keeps its header and a loader, then fills the same pane.
  • Wait for updates still holds a changed tab-memory view until the server answers.
  • Another person's device copy is refused before /api/me. The page's identity is escaped, and absent when signed out or when the device cache is off.
  • /api/me changing the person removes the early view and cannot keep it for a switch.
  • A startup retry keeps a still-usable early snapshot, and drops one after the person changes.
  • A blocked module still reveals the startup error on a signed-in page.
  • A catch-up that arrives after the old window glides and does not jump, including one taller than the screen, one after a reconnect, and one after a reload. A reader scrolled up keeps the same row.

npm run check passes. eslint and prettier pass on the touched files. node --test --test-concurrency=2 on test/session-open-ui.test.ts, test/session-glide-ui.test.ts, test/design-transcript.test.ts, test/file-reopen-ui.test.ts, and test/session-cache-signout-ui.test.ts: 23 tests, 23 pass.

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