The pop-up opens on the record's step, not the door's - #528
Merged
Conversation
Clicking "Create a free doc" as an account that has finished the loop showed the first screen for a beat, then jumped to the last one. The wizard mounted on the step its door asked for and only then fetched /api/onboarding; when the record came back it moved the step. The shell already reads that record at boot, so it hands it over: `openingFrom(record, initialStep)` — one function, applied both to a record in hand and to the first tick — decides the opening step, whether to ask before landing past the paste step, and whether there is nothing to show at all. With no record yet the card paints its frame and nothing inside; the geometry is fixed, so the step that follows lands in place. Measured on the local rig, landing CTA with a finished record: before, `welcome` then `done` one frame later; after, `done` on the first frame. Fresh and mid-journey records still open where they did. Refs #527 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
PreviewOpen this: https://pr-528-tdoc-preview.jyshi1107.workers.dev/ — the homepage, this PR's code This link is unique to this PR. New commits update the same URL. It is not tdoc.dev. Preview has no Durable Object — concurrent comments use the KV fallback. Data expires in 14 days. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #527.
What you saw
Clicking Create a free doc on the landing, as an account that has already finished the loop, showed the first screen for about half a second and then jumped to the congratulations screen.
Why
OnboardingWizardmounted on the step its door asked for —welcomefrom the landing CTA,pastefrom the hub card — and only then fetched/api/onboarding. The record saysrevised, sostepFromRecordreturnsdone, and the step changed after the first frame. The shell had already fetched that same record at boot and was not passing it down.What changed
openingFrom(record, initialStep)is the opening rule in one place: which step to open on, whether landing past the paste step should ask first, and whether there is nothing to show at all. The first poll tick now applies the same function it did inline before.document-shell.jsxhands itsonboardingRecordto the pop-up, so the opening step is computed synchronously, before the first paint.Verified
Local rig, landing CTA, sampling
data-stepevery 25 ms after the click:revised)welcome→doneat 25 msdoneon the first framewelcomewelcomecommented)Offline suite green (80 suites). Hub door (no record in hand) shows the blank frame for one sample, then the right step — never a wrong one.
🤖 Generated with Claude Code