Skip to content

Conversation

danicaleroo
Copy link
Contributor

What / Why

Some clients have told me this before and I also think it's something useful that improves document navigation overall.

It makes it easier to check related documents from list view, otherwise, you'd need to either:

  • Navigate to that related collection and find that particular document
  • Open the document and then click on the edit button inside of the relationship field (kind of unnecesary most of the time).

Changes introduced

  • Added Link component import to the Relationship field component
  • Added formatAdminURL utility import for proper admin route construction
  • Modified the render logic to wrap document labels with <Link> components that navigate to the related document's edit page.
  • Added href generation using formatAdminURL() (after all, needed information was already there, no need for extra API calls or anything).
  • Maintained existing behavior for upload fields (FileCell) and edge cases (loading/untitled states)

Behavior after the fix

  • Related documents in table cells now appear as clickable links instead of plain text
  • Links navigate directly to the related document's edit page in the admin panel
  • Multiple related documents each have their own individual clickable link, separated by commas
  • Upload field relationships continue to show file previews with existing functionality
  • Loading and untitled states remain as plain text (non-clickable)

Concern

I'm not sure if it would be better to make this "configurable" in some way so that developers can enable/disable this or even choose if they want to navigate to that document or open a drawer instead.

How to test manually

  1. Run pnpm dev fields or similar
  2. Navigate to any collection list view where a relationship field is used (test both single relationships or hasMany relationships)

Video

relationship-cell-link.mp4

@danicaleroo danicaleroo force-pushed the relationship-cell-links branch from c742518 to 4bc0607 Compare October 10, 2025 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant