Restore the last open Content page - #2804
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Visual recap — screenshot failedA recap was published, but the PR-comment screenshot could not be captured or uploaded. Open the interactive recap directly: Open the full interactive recap Diagnostic: light: page.goto: Timeout 45000ms exceeded. Call log: - navigating to "https://plan.agent-native.com/recaps/recap-e1a8e326005d479c?recapScreenshot=1&recapScreenshotTheme=light", waiting until "domcontentloaded" |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
…e-page # Conflicts: # templates/content/actions/resolve-content-landing.db.test.ts # templates/content/actions/resolve-content-landing.ts # templates/content/shared/content-landing.ts
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Builder reviewed your changes — looks good ✅
Review Details
Incremental Code Review Summary
This update addresses the remaining predictable-ID denial-of-service concern. The resolver now uses the legacy deterministic ID only as a compatibility lookup; when it needs to create or replace a welcome page, it generates a UUID-derived ID and persists that claim with CAS. Subsequent root arrivals reuse the persisted ID, while concurrent callers converge on the winner. The existing ownership, Personal-space, private, top-level, authorization, and soft-delete checks remain in place.
The previous review comment was verified fixed and resolved. Two independent incremental reviewers found no new actionable issues, and the focused landing database suite passes 10/10, covering legacy collision migration, renamed and trashed welcome pages, malformed state, and concurrency.
Risk assessment: Standard risk, due to stateful Content landing and authorization behavior without schema or authentication changes.
🧪 Browser testing: Will run after this review (PR touches UI code)
Problem
Opening Content at its root currently selects the first favorite page, or simply the first page returned by the document list. That makes arrival arbitrary for returning people and can drop a new person into an organization-visible page they did not choose.
Content should instead reopen the last page that person successfully loaded. When there is no usable saved page, it should provide a private place to begin rather than borrowing someone else's context.
Approach
Resolve root arrival through one typed action. The action reauthorizes any saved document before returning it; otherwise it creates or reuses a claimed
Welcome to Agent-Native Contentpage in the caller's Personal space. Explicit/page/:idlinks continue to bypass root restoration.The last-location key is intentionally separate from agent-facing
navigationstate. It is written only after the editor has loaded the target, and writes are serialized so a slower earlier navigation cannot overwrite a later one.What changed
resolve-content-landing, including authorization, deleted-page handling, canonical per-user welcome identity, and concurrent creation convergence.Safety and operations
The saved target is treated only as an opaque ID and is reauthorized on every root arrival. Missing, trashed, soft-deleted, or inaccessible targets fall back without returning their title, preview, owner, or prior context. The active welcome page is private, top-level, editable, and constrained to the caller's Personal space. A per-user application-state claim with an unpredictable replacement ID makes concurrent creation, post-trash replacement, and inaccessible-ID collision recovery converge without resurrecting or revealing unrelated work. Forward-compatible state fields remain part of exact compare-and-set checks, while malformed stored state fails visibly instead of looping.
There is no schema migration or backfill. Rolling back stops new restoration and returns root arrival to the previous first-document behavior; already created private welcome pages remain ordinary user-owned pages.
Verification
aa98ee239; this includes unpredictable replacement welcome IDs and fresh prospective merge-tree CI is running against currentmain.fe1a5bf76. The full 51-guard suite passed at ancestor61dc0d061; focused landing and parity tests (13/13) plus Content typecheck pass ataa98ee239; all required prospective merge-tree CI checks pass ataa98ee239, including Content DB tests, lint/format, build, scaffold E2E, and generated standalone Chat smoke, including Content DB tests, lint/format, build, scaffold E2E, and generated standalone Chat smoke.20ec20aa3; both are repaired in49bd90dc9and covered by focused database tests.61dc0d061in the T3 preview against a fresh auth-disabled disposable SQLite runtime: a fresh user landed on an editable private Personal welcome page; renaming it toRenamed Welcome QApersisted; revisiting/returned to the same document ID with the renamed title. The later changes are server-only collision and malformed-state handling covered by database regressions; the interactive story was not repeated. The earlier acceptance at20ec20aa3also confirmed last-page restoration and explicit-link bypass. T3 screenshot capture remained unavailable, so retained evidence is URL/DOM plus runtime and database read-back.Review focus