Skip to content

List: ForeignKey cells should be styled (and navigable) as links #184

@MartinCastroAlvarez

Description

@MartinCastroAlvarez

Repo-owner report, 2026-05-26: "the cells that are links should be styled as links."

In the list table, ForeignKey cells (e.g. a "loan package" column rendering Test Loan Package 7 (...)) render as plain black text. They represent a link to another object and should be styled as links (and, ideally, navigate to that object's detail).

Current behaviour

FieldValueViewrenderValue renders the FK wire value { id, label } as plain text. No visual link affordance.

What's needed

  1. Styling: FK cells render with link styling (e.g. text-blue-600 hover:underline) so it's visually obvious they're navigable — matching Django admin's list_display FK links.
  2. Navigation (depends on metadata): to make the FK cell a real <Link> to /<app>/<model>/<id>, the column descriptor must carry the FK target (to: {app_label, model_name}). Today the FK value is only {id, label} (no target model). So:
    • Backend: include the FK target on the list column descriptor (the list_filter FK descriptor already has to: — mirror it on columns[] for FK fields).
    • Frontend: when a column is an FK and the row value is {id, label}, render <Link to={/${to.app_label}/${to.model_name}/${value.id}}> styled as a link.
  3. The first list_display column (or list_display_links) should link to the row's own detail (Django's behaviour) — also styled as a link, not just a click target.

Acceptance

FK cells in the list render as styled links; clicking one navigates to the related object's detail (when the column metadata carries the FK target).

Priority

P1 / v0.1 / Frontend (styling) + a small Backend add (FK target on column descriptor). Part of the list-UX parity set with #177 / #181 / #182.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestparityDjango admin parity gap (tracked in #147)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions