Skip to content

File Link: mark references whose target no longer resolves as "unavailable" #85

Description

@Rikdekker

Follow-up to #73 (observation 2 from @CedricWagner).

Problem

When a linked target is deleted (or otherwise no longer resolvable for the current user), its reference stays in the File Link field list — which is intentional (we do not prune on delete; see the reasoning in #73). But a dead entry currently looks identical to a live one, which is confusing.

Proposed fix (UI only, no event listening)

When a token's fileid does not resolve, render it in an explicit unavailable state instead of a normal clickable row:

  • greyed out, non-clickable name (fall back to the basename of the cached path so there is still a label),
  • a small "no longer available" hint/badge,
  • keep the remove (×) button so the user can clear it deliberately.

Implementation notes

  • The resolution already happens server-side via FileReferenceService::resolveMany(); a token is "unavailable" when its fileId is absent from the resolved map.
  • FileLinkFieldInput.vue already declares a resolved prop shaped [{ fileId, name, path, exists }], but exists is currently never populated/used. Wire that through: mark a token unavailable when there is no resolved entry for its id.
  • Backend (Application::resolveFilelinkNames() and the sidebar/grid resolve paths) currently returns only fileid => name for resolved ids. Expose enough for the frontend to distinguish "resolved" from "unresolved" (e.g. include the resolved-id set, or pass through exists).
  • Pure frontend + a small payload tweak — no CacheEntryRemovedEvent/move listeners.

Acceptance

  • A File Link row pointing at a deleted/inaccessible file shows as unavailable (greyed, "no longer available") and is not clickable.
  • The user can still remove it.
  • A live reference is unchanged.

Metadata

Metadata

Assignees

No one assigned

    Labels

    designRelated to design, interface, interaction design, UX, etc.enhancementNew feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions