Harden Content workspace navigation and Trash lifecycle#2262
Conversation
…workspace-model # Conflicts: # packages/core/src/client/index.ts # packages/core/src/server/action-routes.spec.ts
…workspace-model # Conflicts: # templates/content/actions/_content-space-access.ts # templates/content/actions/blocks-seeding.db.test.ts # templates/content/actions/create-content-database.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.
This comment has been minimized.
This comment has been minimized.
# Conflicts: # templates/content/actions/_database-utils.ts # templates/content/actions/list-documents.ts # templates/content/app/components/sidebar/DocumentSidebar.layout.test.ts # templates/content/app/components/sidebar/DocumentSidebar.tsx # templates/content/app/hooks/use-documents.ts # templates/content/parity/matrix.md # templates/content/server/plugins/db.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.
|
Here's a visual recap of what changed: Open the full interactive recap |
There was a problem hiding this comment.
Builder reviewed your changes and found 5 potential issues 🔴
Review Details
Code Review Summary
This incremental review covers PR #2262's latest Content changes: organization picker restoration, sidebar Trash for pages and databases, soft-delete/restore lifecycle actions, and filtering of trashed documents from normal discovery paths. The overall architecture is sound: the migration is additive, destructive operations are transaction-wrapped, and the new Trash list and mutations use scoped access checks. The test additions also cover subtree round-trips, independent trash state, permanent deletion, and foreign-owner visibility.
Risk assessment: High, because this changes deletion semantics, durable data lifecycle, and access-controlled read surfaces.
Key Findings
- 🔴 HIGH — Permanent deletion is not constrained to the selected Trash root and can irreversibly remove descendants belonging to another Trash item.
- 🟡 MEDIUM — Trashed pages remain readable through direct pull/export actions.
- 🟡 MEDIUM — Restoring a deleted database row can reintroduce duplicate positions.
- 🟡 MEDIUM — Trashed documents can still be updated through the mutation path.
- 🟡 MEDIUM — Known trashed database item IDs can be duplicated into active documents.
Please address these lifecycle and visibility gaps before relying on Trash as the sole reversible deletion boundary. Browser testing will run after this review because the PR changes user-facing Content sidebar flows.
There was a problem hiding this comment.
Builder reviewed your changes and found 3 potential issues 🔴
Review Details
Code Review Summary
This update moves page deletion from recursive hard-delete to a reversible, subtree-scoped Trash lifecycle, adds restore/permanent-delete actions, filters trashed content from normal reads, and restores the organization picker plus sidebar Trash/Favorites/workspace affordances. The overall model is directionally sound: the schema migration is additive, normal listing/search/public-context paths consistently exclude trashed documents, and the UI invalidates the new lifecycle queries.
Risk assessment: High, because this change introduces data deletion, restoration, and authorization-sensitive state transitions.
Key Findings
- 🔴 HIGH — Permanent deletion checks Trash state outside the destructive transaction, allowing a concurrent restore to be followed by deletion of the restored subtree.
- 🔴 HIGH — Restoring an inline database descendant can clear its database
deletedAtflag without restoring its still-trashed backing document, making the database disappear from both active and Trash views. - 🟡 MEDIUM — An editor-authorized inline database deletion now recursively trashes backing pages and row subtrees without requiring document-admin access.
The focused lifecycle tests cover important round trips and ownership filtering, but do not cover these concurrency and inline-database authorization paths.
🧪 Browser testing: Skipped — dev server is available, but browser automation tools were unavailable; all planned UI cases were reported as environment-blocked.
There was a problem hiding this comment.
Builder reviewed your changes and found 3 potential issues 🔴
Review Details
Code Review Summary
This update broadens the PR from sidebar-only changes to a shared WorkspaceSourceMenu used by the Content sidebar and Workspace catalog database creation surfaces. The extraction removes duplicated workspace creation dialogs and adds blank/local-folder choices, while preserving the Trash lifecycle and sidebar filtering work. The shared menu is a good direction, and the new workspace-source tests cover the common menu contract.
Risk assessment: High, because the PR still changes destructive lifecycle behavior and also affects creation flows across multiple database view types.
Key Findings
- 🔴 HIGH — The new trashed-page guard covers
get-document, but the public-agentpull-documentread path still returns trashed document content to callers with existing access. - 🟡 MEDIUM — Workspace catalog creation controls in non-table views remain visible but call a callback that now returns early, so they silently do nothing.
- 🟡 MEDIUM — New workspace creation no longer receives active filter/group property values, so a workspace created in a constrained view can immediately disappear from that view.
The existing unresolved comments were not reposted. The shared menu and query invalidation patterns are otherwise well-factored.
🧪 Browser testing: Skipped — dev server is running, but browser automation remained unavailable after the allowed retry; all 20 planned cases were environment-blocked.

Summary
This follow-up to #2206 closes the remaining production and deploy-preview regressions in Content's database-backed global workspace model.
Safety and data integrity
Validation
bc41d4e94fc95d9bd40e7c49628ceffe4899c82dQA focus
Governing brief:
Agent-Native Content global workspace data model 2026-07-16.md.