feat(bulk-edit): add No cache & Skip asset check to mass edit; restore nocache in viewer - #3150
Conversation
…viewer Adds the No cache and Skip asset check flags to the mass-edit modal so operators can set/clear them across a selection instead of one asset at a time (#3137). Each is opt-in via the existing per-group toggle and picks its target state with an On/Off segmented control. While wiring this up, fixed nocache being a no-op in the current viewer stack (silently dropped in the Uzbl->webview migration): - view_webpage now cache-busts the URL for nocache assets, so the page is refetched fresh instead of served from QtWebEngine's HTTP cache or skipped by the unchanged-URL short-circuit (restores refs #11) - asset_loop passes the asset's nocache flag through - assets_bulk_update writes both boolean flags as opt-in shared fields Verified nocache end-to-end against a real QtWebEngine webview: an identical URL is served from cache (1 fetch for 2 loads) while cache-busted URLs refetch every display (2 for 2). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
There was a problem hiding this comment.
Pull request overview
Adds bulk-edit support for No cache and Skip asset check flags, and restores the viewer’s nocache behavior for webpage assets by cache-busting the URL on each display rotation.
Changes:
- Extend the bulk-edit modal UI to opt-in/apply
nocacheandskip_asset_checkwith an On/Off segmented control per flag. - Update
assets_bulk_updateto conditionally write the two boolean flags across the selected asset set. - Restore viewer
nocachesupport by passing the flag throughasset_loopand cache-busting webpage URLs; add unit tests for both viewer and bulk-edit behavior.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_viewer.py | Adds unit coverage for webpage nocache cache-busting and flag propagation from asset_loop. |
| tests/test_template_views.py | Adds Django tests for bulk-updating nocache / skip_asset_check (set, clear, untouched, toast count). |
| src/anthias_viewer/init.py | Implements cache-busted URL generation and threads nocache into view_webpage / asset_loop. |
| src/anthias_server/app/views.py | Extends assets_bulk_update to include opt-in updates for nocache and skip_asset_check. |
| src/anthias_server/app/templates/_bulk_edit_modal.html | Adds bulk-edit groups and controls for the two boolean flags; updates submit enablement logic. |
| src/anthias_server/app/static/sass/_styles.scss | Adds pill styling for the new On/Off segmented controls. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- _cache_busted_url appends to the raw query string instead of parse_qsl/urlencode round-tripping it, so signed / pre-encoded URLs reach the origin byte-for-byte (add regression test) - correct the assets_bulk_update comment to describe the On/Off radio, not the old hidden-checkbox flow Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Copilot re-review: the bulk-edit flag value is an On/Off segmented radio, not a switch — align the new test docstrings. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
End-to-end tested on a real x86 device ✅Overlaid the changed source onto a running Bulk edit (real browser → device server): selected 2 assets, opened the modal, set No cache = On, Apply → toast Viewer nocache (single looping webpage asset, 8s duration, 45s window):
Checked the x86 device box. I did not run on a Raspberry Pi, so that box is left unchecked — the viewer change is pure Python and board-agnostic (same Qt cache behaviour across boards), but I only exercised the full stack on x86. |



Issues Fixed
Fixes #3137
Description
Adds the No cache and Skip asset check flags to the mass-edit ("Edit N assets") modal, so operators can set or clear them across a whole selection instead of one asset at a time. Each flag is opt-in via the existing per-group toggle (unticked groups are left untouched) and picks its target state with an On/Off segmented control — visually distinct from the group's opt-in switch and consistent with the modal's existing pill styling.
While wiring this up I found
nocachewas a no-op in the current viewer stack — it was silently dropped in the Uzbl→webview migration. Since there is no point exposing a dead flag, this PR also restores it:view_webpagenow cache-busts the URL fornocacheassets (namespaced_anthias_nctoken appended to the raw query string, so signed / pre-encoded URLs are preserved byte-for-byte), so the page is refetched fresh instead of being served from QtWebEngine's in-memory HTTP cache or skipped by the unchanged-URL short-circuit.asset_looppasses the asset'snocacheflag through toview_webpage.assets_bulk_updatewrites both boolean flags as opt-in shared fields.skip_asset_checkwas already honoured by the viewer, so it needed only the UI/endpoint wiring.Validation
Unit: 279 tests pass (10 new: bulk-edit endpoint + viewer cache-busting/dispatch/byte-preservation);
ruff checkandruff format --checkclean.End-to-end on a real x86 device (overlaid the changed source onto the running
latest-x86stack, real Qt6 QtWebEngine viewer, pointed webpage assets at a logging HTTP server that returnsCache-Control: max-age=3600):Bulk edit — drove the real web UI in a browser: selected assets → opened the modal → No cache = On → Apply → toast "2 assets updated", and the device DB flipped both rows to
nocache=1.Viewer, single looping asset (8s), watched 45s:
_anthias_nctoken each timeChecklist