feat(settings): add Administration Previews page - #63796
Open
rayvincent2 wants to merge 14 commits into
Open
Conversation
Add typed preview admin config, a MIME provider-priority resolver, HTTP cache policies for preview responses, and a preview_failures table used when generation cannot produce a preview. Authenticated responses stay private unless an admin configures otherwise. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Add an Administration → Previews section for general limits, Imaginary, provider order, MIME overrides, HTTP cache headers, and failed generations. Saving is admin-delegable and requires password confirmation. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Add concurrency, preview file expiry, failure retention, WebP quality, and ffmpeg/LibreOffice paths to Administration → Previews. Fields that depend on Imagick, ffmpeg, LibreOffice, or Imaginary are labelled from detected availability and hidden when they do not apply. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Keep WebP quality, external-tool paths, and s-maxage visible instead of hiding them. Label each as in use, not enabled yet, or not detected, and offer an action that enables the related provider or visibility. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Move the enable toggle next to Save and disable the remaining admin sections when previews are off, using a native fieldset and inert so those controls are visibly and programmatically uneditable. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Track form dirty state from a settings snapshot, disable Save until something changes, prompt on leave/reload, and add a second Save changes control at the bottom of the long admin page. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Remove preview_provider_mime_priority/deny and the resolver so provider order is only enabledPreviewProviders. Clarify that preview_format is Imaginary-only. Tighten HTTP cache fields (required s-maxage when public, hidden when private) and polish provider availability, Imaginary/Movie Office sections, and quality copy. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Drop the HTTP cache policy UI. Record a failed generation when a higher-priority provider misses even if a later one succeeds, and when a preview request 404s. Use recommended defaults (Imaginary first when configured, HEIC fallback, Movie available but not enabled). Mark discouraged providers as unsupported, restore default order on reset, and replace the status buttons with a dropdown plus source MIME filtering and drag-and-drop. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Address ESLint indent and NcButton variants, Psalm catalog typing, PHP CS import order, and run the e2e spec serially with NcSelect helpers. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Disable enabling a provider while Availability still says Requires. Typing an Imaginary URL, ffmpeg path, or LibreOffice path unlocks the switch but does not auto-enable. Save drops catalog providers that still do not meet their requirement. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
getProviders() still returns a MIME-regex map, but keys are inserted in enabledPreviewProviders order instead of regex length. Generator walks that map so overlapping providers (for example Imaginary then HEIC) run in the admin table order, and a later provider still runs if an earlier one fails. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Use longform watch handlers so Vue 2 object-shorthand and new-line-between-multi-line-property pass. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Use a settings-owned template SVG instead of the themed MIME filetypes/image.svg icon, which does not render in the left nav. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
Match the save toast exactly and query provider enable controls as switches, matching NcCheckboxRadioSwitch. Assisted-by: Grok:grok-4.6 Signed-off-by: Ray Vincent <rayhvincent@gmail.com>
rayvincent2
requested review from
a team,
hweihwang and
sorbaugh
as code owners
August 29, 2026 19:13
rayvincent2
requested review from
Altahrim,
CarlSchwan,
kristian-zendato,
leftybournes and
skjnldsv
and removed request for
a team
August 29, 2026 19:13
Member
|
I like the idea. I will have to careful review the code next week |
Author
|
Yeah, sorry it's a big one... I'm happy to split it up if needed. I learned a lot about how previews are generated by each provider which I'm excited to reveal through this admin page. I left my commit history so you could see my thought process as I went along too. Happy to squash that as needed. I look forward to your comments! |
Member
|
Wow, that is a great feature! |
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.
Summary
Adds a core Administration → Previews page (
/settings/admin/previews) so admins can inspect and edit the existing preview config without hand-editing PHP arrays or fumbling with settings viaocc.This is a UI over the current keys (
enable_previews,enabledPreviewProviders, size/memory/filesize limits, jpeg/webp quality, concurrency, Imaginary URL/key/preview_format, ffmpeg/LibreOffice paths,preview_expiration_days). No new public API for Memories or Preview Generator. An instance that never opens the page keeps today’s config.Backwards compatible: same config keys, types, defaults, and IPreview API. The only change is that enabledPreviewProviders order is now try-order, not just a whitelist.
What the page does:
enabledPreviewProvidersstays a class-name whitelist; array order is now generation priority (IPreview::getProviders()is rebuilt in that order). Membership is unchanged. Unset lists are not rewritten on load; the first Save is what persists the key.oc_preview_failures). Retry isgetPreview()again, not a force-delete of cached blobs.Not in this PR (keep elsewhere):
occ preview:generate/cleanup/repair.Reviewers: the attached previews-admin-product-spec.md is the product spec for this page (config mapping, master vs this try-order, HEIC/Imaginary, failure recording, docs notes for previews_configuration.html). It is not the published admin manual and is not committed in the tree.
Screenshots
TODO
admin-settings-previews.spec.tspreviews-admin-product-spec.mdChecklist
3. to review, feature component)stable32) (36.x / master)AI (if applicable)
Assisted by Grok (grok-4.6). I reviewed, tested on a live instance, and signed the commits. The product spec attached here was also drafted with that assistance and is for reviewers/docs, not shipped UI copy.