Skip to content

Full report/panorama rendering in link previews - #582

Open
LexioJ wants to merge 2 commits into
Rello:masterfrom
LexioJ:feat/reference-provider-full-view
Open

Full report/panorama rendering in link previews#582
LexioJ wants to merge 2 commits into
Rello:masterfrom
LexioJ:feat/reference-provider-full-view

Conversation

@LexioJ

@LexioJ LexioJ commented Aug 12, 2026

Copy link
Copy Markdown

As announced in #581, this makes Analytics links actually useful when pasted into Text, Talk or Tables: instead of the static card with just icon and title, the link preview now renders the real content.

Tables

grafik

Text

grafik

Talk

grafik

Reports show up as their actual chart / data table / KPI (whatever is configured in the report options), loaded live from the existing data endpoints. Panoramas render their first page as a widget grid with a link to the remaining pages. If loading fails for whatever reason (report deleted, no permission anymore, scripts blocked), it just falls back to the old static card, so nothing breaks.

I made sure the chart bundle is only lazy-loaded when a page actually contains an analytics reference — pages without such links don't pay for this.

While working on this I ran into two bugs that this PR also fixes:

  • reports/panoramas shared with me resolved as "Report not found" in previews, because resolveReference() only checked own reports. It now falls back to ShareService (same for PanoramaService::read(), limited to the fields the panorama view needs)
  • the admin setting link_preview_enabled was ignored, that works again

Added PHPUnit tests for the reference provider and the share fallbacks, plus a few OCP stubs that were needed to test the reference interfaces.

Happy to adjust if you'd prefer a different approach for anything here.

LexioJ added 2 commits August 12, 2026 16:53
The reference provider (Smart Picker / link preview) previously showed a
static card with icon, title and subtitle. Analytics links pasted into
rich text (Text documents, Talk, Tables descriptions) now render the
actual content:

- Reports render as full chart, data table, KPI or combined view using
  the stored report options, fetched live from the existing data
  endpoints with ETag/localStorage caching.
- Panoramas render their first page as a grid with all report, text and
  picture widgets, plus a link to the remaining pages.
- The chart stack is lazy-loaded on the first rendered analytics
  reference, so pages without analytics links load no extra scripts.
- Failed loads (deleted report, revoked permission, blocked scripts)
  fall back to the previous static card.

Fixes along the way:
- resolveReference() now falls back to ShareService, so reports and
  panoramas shared with the current user no longer resolve as
  "Report not found". PanoramaService::read() gained the same fallback,
  restricted to the fields the panorama view needs.
- The admin toggle link_preview_enabled is functional again.

Signed-off-by: Alexander Askin <lexioj@gmail.com>
@Rello

Rello commented Aug 13, 2026

Copy link
Copy Markdown
Owner

nice one! thanks!

I always had this on my todo list.
to reduce the (js) overhead I thought about a downsized server-side-chart-rendering so only simple svgs could be shown everywhere.
i will check your suggestion.

thank you again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants