fix: give row documents a real parent so nested pages keep breadcrumbs#8868
Open
hkarmoush wants to merge 2 commits into
Open
fix: give row documents a real parent so nested pages keep breadcrumbs#8868hkarmoush wants to merge 2 commits into
hkarmoush wants to merge 2 commits into
Conversation
Contributor
Reviewer's GuideAdds an optional explicit parent_view_id to orphan view creation and wires desktop/mobile row document flows to pass the database view id so orphan row documents report a real parent for ancestor/breadcrumb resolution while remaining hidden from sidebar children, with tests covering ancestor chains and visibility behavior. Sequence diagram for orphan row document creation with explicit parent viewsequenceDiagram
actor User
participant RowDocumentBloc
participant ViewBackendService
participant FolderEventCreateOrphanView
participant BackendCreateOrphanViewPayloadPB
User->>RowDocumentBloc: _createRowDocumentView(documentViewId)
RowDocumentBloc->>ViewBackendService: createOrphanView(viewId: documentViewId, parentViewId: viewId)
ViewBackendService->>FolderEventCreateOrphanView: FolderEventCreateOrphanView(payload)
FolderEventCreateOrphanView->>BackendCreateOrphanViewPayloadPB: send()
BackendCreateOrphanViewPayloadPB->>BackendCreateOrphanViewPayloadPB: try_into(CreateViewParams)
BackendCreateOrphanViewPayloadPB-->>FolderEventCreateOrphanView: CreateViewParams{parent_view_id: parentViewId}
FolderEventCreateOrphanView-->>ViewBackendService: ViewPB
ViewBackendService-->>RowDocumentBloc: ViewPB
RowDocumentBloc-->>User: row document view with correct ancestors
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
hkarmoush
marked this pull request as ready for review
July 17, 2026 23:58
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- In
folder_event.rs, the doc comment forcreate_orphan_view(“parent_view_id equal to the view_id”) is now only conditionally true; consider updating it to clarify the default vs explicit parent behavior and referencecreate_orphan_view_with_parentso future callers understand when to use each. - The
_createRowDocumentViewmethod inRowDocumentBlocnow takes adocumentViewIdwhile using the bloc’sviewIdas the parent; it may be clearer to rename parameters/fields or add a brief comment to distinguish “database view id” vs “row document view id” and avoid confusion about which id is passed where.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- In `folder_event.rs`, the doc comment for `create_orphan_view` (“parent_view_id equal to the view_id”) is now only conditionally true; consider updating it to clarify the default vs explicit parent behavior and reference `create_orphan_view_with_parent` so future callers understand when to use each.
- The `_createRowDocumentView` method in `RowDocumentBloc` now takes a `documentViewId` while using the bloc’s `viewId` as the parent; it may be clearer to rename parameters/fields or add a brief comment to distinguish “database view id” vs “row document view id” and avoid confusion about which id is passed where.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
A row's own inline document is created as an "orphan view" whose parent_view_id points at itself, so it's invisible in the sidebar. That's fine for the row document itself, but any page created inside it inherited that dead-end parent, so the ancestor lookup used for breadcrumbs stopped right there instead of continuing up to the database and workspace. Let the orphan view report the database's view as its parent for ancestor-chain purposes while still keeping it out of the database's visible children, so nested pages resolve their full breadcrumb path again. Fixes AppFlowy-IO#8432 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The create_orphan_view doc comment still claimed parent_view_id always equals view_id, which stopped being true once an explicit parent was supported — pointed it at create_orphan_view_with_parent instead. Also renamed a parameter in RowDocumentBloc so it's clear which id is the database view (used as the orphan's parent) and which is the row's own document view (used as the orphan's view_id) — they were both just called "viewId" in different places, which is what a reviewer flagged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
hkarmoush
force-pushed
the
fix/row-document-breadcrumb-8432
branch
from
July 18, 2026 09:18
b45f112 to
8ea3b69
Compare
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.
What & why
Reported in #8432: creating a page inside a database row's own note/document loses its breadcrumb, and its location shows up as "Untitled" wherever it's referenced — basically orphaned.
Root cause: a row's inline document is created as a special "orphan view" whose
parent_view_idis set to its own id, purely so it stays out of the sidebar. That's intentional for the row document itself — but any page you create inside it inherits that self-referencing parent. When the app walks up the ancestor chain to build breadcrumbs, it hits the row document, loops back on itself, and stops. It never reaches the actual database/grid view, the space, or the workspace, so the breadcrumb bar has nothing real to show.This PR lets the orphan view report the database's own view as its parent for ancestor-chain purposes, without adding it to that view's visible children (sidebar visibility is controlled separately — by whether a view was inserted into a parent's child list — so this doesn't change what shows up under the database). Pages created inside a row's document now resolve their full breadcrumb path again.
Changes
flowy-folder:CreateOrphanViewPayloadPBgains an optionalparent_view_id; defaults to the old self-referencing behavior when omitted, so nothing else that creates orphan views is affected.RowDocumentBloc) and mobile (OpenRowPageButton) now pass the database's view id when creating a row's document.create_orphan_view_with_explicit_parent_and_get_its_ancestors_test, covering: the orphan reports the real parent, a page nested inside it inherits the full ancestor chain, and the orphan still doesn't show up as a visible child of the database view.Note
I put this together without a Rust/protoc toolchain on hand, so I haven't been able to run
cargo make code_generationor the test suite myself. Opening as a draft so CI (or a reviewer) can catch anything I couldn't — will fix up based on results.fixes #8432
PR Checklist
Summary by Sourcery
Ensure orphan views can report a real parent for ancestor resolution so nested row documents retain correct breadcrumbs without becoming visible sidebar children.
New Features:
Enhancements:
Tests: