File Link: mark references whose target no longer resolves as "unavailable"
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 25
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
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 itsfileIdis absent from the resolved map. FileLinkFieldInput.vuealready declares aresolvedprop shaped[{ fileId, name, path, exists }], butexistsis 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 onlyfileid => namefor resolved ids. Expose enough for the frontend to distinguish "resolved" from "unresolved" (e.g. include the resolved-id set, or pass throughexists). - 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with FileLinkFieldInput.vue and trace how its resolved prop is populated. Then inspect FileReferenceService::resolveMany(), Application::resolveFilelinkNames(), and the sidebar/grid resolution paths to preserve the distinction between resolved and unresolved IDs. Done means unavailable rows are greyed out and non-clickable with a hint, remain removable, and live references are unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, php
- Domain
- backend, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100