Skip to content

Conversation

@horacioh
Copy link
Collaborator

Summary

This PR adds breadcrumb navigation to the draft document editor, allowing users to see and navigate through the parent hierarchy of the document being edited.

Key Changes

  • Breadcrumb computation: Added logic to compute parent paths from the document's editId (for existing docs) or id (for new docs), excluding the document itself when editing
  • Resource fetching: Integrated useResources hook to fetch metadata for all parent documents in the breadcrumb chain
  • UI components:
    • Created DraftBreadcrumbs component to render the breadcrumb trail with a home icon and slash separators
    • Created DraftBreadcrumbLink component to render individual breadcrumb links with document names and hover effects
  • Integration: Passed breadcrumbs data to DraftMetadataEditor and rendered them in the document header above the title
  • Imports: Added necessary imports for useResources, getParentPaths, useRouteLink, and Home icon

Implementation Details

  • Breadcrumbs are computed using getParentPaths utility to extract the path hierarchy
  • For existing documents being edited, the document itself is excluded from the breadcrumb trail
  • For new documents, all parent paths are included as they represent the location context
  • Breadcrumb links use the routing system to navigate to parent documents
  • Fallback to path segment if document metadata/name is unavailable
  • Breadcrumbs only render when data is available (conditional rendering)

https://claude.ai/code/session_015QPUw6KHe9Gvvod6SeCQtA

Compute parent paths from editId (existing doc) or locationId (new doc),
fetch parent metadata via useResources, render breadcrumbs matching
DocumentHeader style. Falls back to path segment name for unpublished parents.

https://claude.ai/code/session_015QPUw6KHe9Gvvod6SeCQtA
@horacioh horacioh marked this pull request as ready for review February 10, 2026 12:12
@horacioh horacioh merged commit 349a341 into main Feb 10, 2026
5 checks passed
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.

2 participants