Skip to content

fix(preview): respect preview_archives_by_default and add bulk enable/disable in preview management - #314

Open
okatu-loli wants to merge 2 commits into
AlistGo:mainfrom
okatu-loli:fix/preview-bulk-toggle
Open

okatu-loli wants to merge 2 commits into
AlistGo:mainfrom
okatu-loli:fix/preview-bulk-toggle

Conversation

@okatu-loli

Copy link
Copy Markdown
Collaborator

Problem

Since the per-extension preview management refactor, turning off Preview archives by default no longer works: archives still open in the archive previewer. The renderer appends Download after every candidate, so a non-default preview is only demoted below the other previews and still ends up ahead of Download. Admins had to disable the archive previewer per extension by hand.

The preview management page also never listed the built-in Video / Audio / Image / Text previewers, because video_types / audio_types / image_types / text_types are PRIVATE settings and are absent from /public/settings.

Changes

  • Download now takes a fixed rank between iframe previews and non-default built-ins, restoring the old behaviour. Explicit ordering from preview management still wins.
  • Preview management gains bulk actions:
    • Disable all / Enable all for every listed extension, confirmed in a modal and saved in one request. Existing manual ordering is kept.
    • Disable all / Enable all for this extension.
  • Extensions that already carry overrides are included in the extension picker so they stay reachable after a bulk disable.
  • The page loads the preview settings group through the admin API so type-classified built-ins are matched and listed.

Verification

Manually tested against a local v3 backend:

  • Disable all β†’ every listed extension written to preview_settings, archive files show only Download.
  • Enable all β†’ preview_settings back to {}.
  • With no overrides and the setting off, archives default to Download with Archive Preview still selectable; with the setting on, Archive Preview is the default.
  • mp4 now lists Video and Video 360 and bulk disable covers them.

prettier --check and vite build pass.

…enable/disable

The per-extension preview management refactor appended Download after
every candidate, so turning off preview_archives_by_default only
demoted Archive Preview below the other previews and it still opened by
default. Download now takes a fixed rank between iframe previews and
non-prior built-ins, restoring the previous behaviour while explicit
ordering from preview management still wins.

Preview management gains bulk actions: disable/enable every preview for
all listed extensions (confirmed in a modal, one save request) and
disable/enable all previews for the current extension. Extensions that
already carry overrides are included in the picker so they stay
reachable after a bulk disable.
video_types/audio_types/image_types/text_types are PRIVATE settings and
never reach /public/settings, so the preview management page could not
match the built-in Video/Audio/Image/Text previewers to any extension
and silently omitted them. The page now loads the preview group through
the admin settings API and uses those values for type matching, so
those rows appear and bulk disable/enable covers them.
@netlify

netlify Bot commented Sep 11, 2026

Copy link
Copy Markdown

βœ… Deploy Preview for alist-web ready!

Name Link
πŸ”¨ Latest commit b4f5429
πŸ” Latest deploy log https://app.netlify.com/projects/alist-web/deploys/6aa38bb25778f40008e1b04a
😎 Deploy Preview https://deploy-preview-314--alist-web.netlify.app
πŸ“± Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
πŸ€– Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

1 participant