Show the uploader outside the main grid - #730
Merged
Merged
Conversation
The Helmet block grouped the three og:video tags behind a Fragment, and react-helmet reads each child's `type` as a tag name. A Fragment's type is Symbol(react.fragment), so it threw "Cannot convert a Symbol value to a string" and, with no error boundary above it, unmounted the whole view: a blank screen for every video that is not password protected. Repeat the condition per tag instead of grouping them. The tags also carried their values in `value` rather than `content`. react-helmet only copies over the attributes a meta tag actually has, so every one of these rendered empty. Unfurls were unaffected either way — crawlers get the server-rendered /w/ page from templates/metadata.html — but the tags should still say what they claim to. Broken since dc99d48, which introduced the password gate.
Attribution was only visible on the feed cards, so checking or changing who owns a clip meant going back to the grid and searching for it by name. The File Manager could set an uploader but never showed one. File Manager - /api/admin/files and /api/admin/image-files now include the uploader, in the same shape the feeds use. Video.uploader is lazy="joined", so it costs no extra query. - Sortable Uploader column on both tabs. Unattributed media sorts as greater than every name, so it gathers at the end ascending and at the top descending — finding it is the point, so one click has to reach it. - Uploader filter, a chip showing how much of the library is still unattributed that jumps straight to it, and search over uploader name and username. Both are derived from the loaded rows rather than a second request, so the count cannot disagree with the table. Clip views - The byline now appears on the watch page, the video modal and the image view. The details payload already carried it. Editing - Uploader field on the video and image edit modals, for administrators only. It writes through the existing bulk-set-uploader route rather than the details PUT, whose whitelist was deliberately narrowed and which a non-admin owner can reach: reassigning ownership is an administrator's call, not part of editing a caption. The field hides itself on the 403 from /api/admin/uploaders, so nothing offers a control whose save would fail. - Shared UploaderPicker replaces the picker that had been copied into both File Manager dialogs. Share cards - /w/ and /i/ lead their og:description with the uploader and set author and profile:username. An unfurl in chat is often the only place the recipient looks, and descriptions get truncated there, so the byline goes first. Media with no uploader is unchanged throughout: no byline, no author tag, no separator left dangling.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #727.
Attribution was only visible on the feed cards. Checking who owned a clip meant going back to the grid and searching for it by name, and the File Manager could set an uploader but never showed one — which made reattributing an existing library tedious in exactly the way the issue describes.
File Manager
/api/admin/filesand/api/admin/image-filesnow includeuploader, in the same shape the feeds already use.Video.uploaderislazy="joined", so this costs no extra query.The migration flow the issue asks for is now: click the unattributed chip → select all → Uploader.
Clip views
The byline appears on the watch page, the video modal and the image view. The details payload already carried it, so these needed no API change.
Editing
An Uploader field on the video and image edit modals, for administrators only.
It writes through the existing
bulk-set-uploaderroute rather than the detailsPUT. That whitelist was deliberately narrowed, and the route is reachable by non-admin owners viacan_modify— reassigning ownership is an administrator's call, not part of editing a caption. The field hides itself on the 403 from/api/admin/uploaders, so nothing offers a control whose save would be rejected.A shared
UploaderPickerreplaces the picker that had been copied into both File Manager dialogs.Share cards
/w/and/i/lead theirog:descriptionwith the uploader and setauthorandprofile:username. An unfurl in chat is often the only place the recipient looks, and descriptions get truncated there, so the byline goes first.Also: the watch page's meta tags (abf24e9)
Verifying the byline turned up two problems in the
Helmetblock, fixed in their own commit.The three
og:videotags were grouped behind a Fragment. react-helmet reads each child'stypeas a tag name and matches it against a list, which a Fragment never matches, so those three tags were silently dropped from the rendered head.The remaining tags carried their values in
valuerather thancontent. react-helmet only copies over the attributes a meta tag actually has, so every one of them rendered empty.Neither affected link unfurls — crawlers get the server-rendered
/w/page fromtemplates/metadata.html, which was always correct.The Fragment also crashes react-helmet outright (
Cannot convert a Symbol value to a string) and, with no error boundary above it, blanks the whole view — but only in development: that code path sits inside react-helmet'swarnOnInvalidChildren, which is guarded byprocess.env.NODE_ENV !== "production"and is dead-code-eliminated from the production bundle. Verified by serving a production build of the unfixed file, which renders normally. So this was a local-development annoyance, never a user-facing outage.Testing
Verified against a running instance with a seeded library:
miraandZoe Quinnnullpath) workededit_own: the Uploader field is absent from the edit modal, and/api/admin/uploadersandbulk-set-uploaderboth return 403/watchrenders again — byline present and linking to the profile, absent with no dangling separator when unattributed, console cleanMedia with no uploader is unchanged throughout: no byline, no author tag, no separator left dangling.