Skip to content

Add video block show metadata option - #1696

Merged
owi92 merged 8 commits into
elan-ev:mainfrom
geichelberger:video-block-show-metadata
Oct 22, 2026
Merged

owi92 merged 8 commits into
elan-ev:mainfrom
geichelberger:video-block-show-metadata

Conversation

@geichelberger

@geichelberger geichelberger commented Mar 19, 2026 •

Copy link
Copy Markdown
Contributor

This PR introduces the option to display supplemental metadata for embedded videos within the video block.

grafik

Without description:
grafik

@owi92 owi92 added the changelog:user User facing changes label Mar 19, 2026

@owi92 owi92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you for the PR, and sorry for the delay in reviewing.
I think this is a reasonable and useful feature to add. I have a few comments on the frontend code, but otherwise this looks good to me.

Comment thread frontend/src/ui/Blocks/Video.tsx Resolved
Comment thread frontend/src/ui/Blocks/Video.tsx Resolved

@owi92 owi92 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks again. I think Lukas wanted to take a look at this before we merge it, but he's on vacation right now. We'll probably get it in next week.

Comment thread frontend/src/ui/Blocks/Video.tsx Resolved
@owi92

This comment was marked as resolved.

This adds the show metadata option for the video block to show
supplemental metadata for embedded videos.
@geichelberger
geichelberger force-pushed the video-block-show-metadata branch from 5377270 to 743f249 Compare April 2, 2026 17:47

@LukasKalbertodt LukasKalbertodt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why copy & pasting that much code from routes/Video.tsx? I haven't checked everything but the snippets I did check matched that other code 1:1 basically. I would extract the relevant parts of the code of Video.tsx into a component and use it in both places. I saw your comment saying extracting that component isn't easy and sth sth coupling, but I don't quite follow there. Should certainly be possible to deduplicate that. If you need help with that, just let us know.

Also:

  • I think we should maintain the same behavior as on the video page: show the description block even if the description is empty. I think the consistent layout outweighs the "useless block in some cases".
  • In your current solution, the description does not use automatic link and timestamp detection. That will also be fixed by just deduplicating the code.
  • The metadata table here also doesn't show the series or the duration. Again, I don't see why that would be advantageous, and I'd argue for keeping it consistent with the video page.

Otherwise: yeah, seems like a useful feature!

event: row.video::<Option<Key>>().map(Id::event),
show_title: unwrap_type_dep(row.show_title(), "event", "show_title"),
show_link: unwrap_type_dep(row.show_link(), "event", "show_link"),
show_metadata: unwrap_type_dep(row.show_metadata(), "event", "show_metadata"),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This made me wonder about existing video blocks. The show_metadata column is not NOT NULL, i.e. it can be null, but it has a default of false. So all added blocks have false in that column, which is also true for our test DB dumps. So I guess the only way a null could sneak in there if we set it explicitly right? And from grepping the code base it does not seem like there is any way Tobira sets it to null.

So I guess it's fine! For series and playlist we have a DB constraint to make sure its not null and I guess it would be nice for events as well, but no need to introduce a new migration in this PR. So yeah, just wanted to write down my reasoning here, no need for action.

@LukasKalbertodt LukasKalbertodt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There is still lots of code duplication in this PR and the latest commit confuses me a bit in terms of how it approaches deduplicating code. It seems to pull out rather small parts of routes/Video components instead of lots at once. If you'd like some guidance on how I would approach it, let me know.

@geichelberger

Copy link
Copy Markdown
Contributor Author

I was, or I am still :D, confused about the structure. For me, routes should have dependencies on the ui package, but not vice versa. But maybe that's a misconception on my part.

@LukasKalbertodt

Copy link
Copy Markdown
Member

For me, routes should have dependencies on the ui package, but not vice versa.

I agree, the current code structure and import graph is... suboptimal to say the least. This is one of the things we want to tackle over the coming weeks.

I decided to take this PR and add some commits on top of it as #1810. That's because in the next few weeks we want to move quickly and I didn't want to make you go through another review round after all that time. I will keep this PR open, as I think github will mark it as "merged" once the other one is merged (since all commits will be on main).

owi92 added a commit that referenced this pull request Oct 22, 2026
This is based on #1696, merges `main` (instead of rebase to not touch
the original commits) and refactors it a bit.

This adds a migration file but does not enable it yet, to keep the next
release migration-free. It is not needed for the functionality, just
adds some checks.

Do not review commit by commit, but as a whole. Frontend changes can now
easily be reviewed with `git diff upstream/main
--color-moved=dimmed-zebra --color-moved-ws=allow-indentation-change --
frontend`. Most code is just moved from `routes/Video.tsx` to
`ui/metadata.tsx` unchanged.
@owi92
owi92 merged commit aab9738 into elan-ev:main Oct 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog:user User facing changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants