Skip to content

feat(files): show a linked file inline again in its reference widget - #65753

Merged
susnux merged 2 commits into
masterfrom
feat/files-reference-widget-viewer
Oct 22, 2026
Merged

susnux merged 2 commits into
masterfrom
feat/files-reference-widget-viewer

Conversation

@skjnldsv

Copy link
Copy Markdown
Member

Summary

File links in Talk, Text or Collectives used to show the file inline, but the widget looked for the viewer app's handlers, which are gone since the viewer moved into @nextcloud/viewer. Every link fell back to its static card. The widget now puts a <nc-viewer-file> there: the file shows read-only, with a menu to open it in the viewer or download it, and the card comes back if it can't be shown. Also bumps @nextcloud/viewer to 2.0.0-beta.19.

Checklist

AI (if applicable)

  • The content of this PR was partly or fully generated using AI

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv skjnldsv added this to the Nextcloud 36 milestone Oct 21, 2026
@skjnldsv skjnldsv self-assigned this Oct 21, 2026
@skjnldsv
skjnldsv force-pushed the feat/files-reference-widget-viewer branch from 3c1699e to a259d66 Compare October 21, 2026 11:56
@skjnldsv
skjnldsv marked this pull request as ready for review October 21, 2026 12:24
@skjnldsv
skjnldsv requested review from a team as code owners October 21, 2026 12:24
@skjnldsv
skjnldsv requested review from kristian-zendato, pringelmann and susnux and removed request for a team October 21, 2026 12:24
@skjnldsv skjnldsv added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Oct 21, 2026
mime: this.richObject.mimetype,
size: this.richObject.size,
mtime: new Date(this.richObject.mtime * 1000),
owner: uid,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it always the case that the current user is the owner?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a good question to ask. In reality no, this is a workaround. The first iteration fo the widget did not even have the right data for it. Since we're scoping the file and it's always relative to the current user's home directory, using the current logged uid is fine. But it's only because we actually don't really use that info anywhere else on the reference widget viewer

@pringelmann

Copy link
Copy Markdown
Contributor

Looks good! Just a question on owner prop

The widget looked for the handlers of the viewer app, which are gone
since the viewer moved into @nextcloud/viewer: every file link fell
back to its static card. Put a <nc-viewer-file> there instead, which
shows the file read-only with a menu to open it in the viewer or
download it, and falls back to the card when it cannot. A click on the
card opens the viewer through the library.

The file is handed the permissions the reference carries, and what its
share allows: no download offered where a share forbids it.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: John Molakvoæ <14975046+skjnldsv@users.noreply.github.com>
@skjnldsv
skjnldsv force-pushed the feat/files-reference-widget-viewer branch from 99ab547 to aa6adad Compare October 21, 2026 14:34
@susnux
susnux merged commit fecc0bd into master Oct 22, 2026
86 checks passed
@susnux
susnux deleted the feat/files-reference-widget-viewer branch October 22, 2026 10:21
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.

3 participants