3.9 KiB
3.9 KiB
Q-Edit v0.7.2 — Bulk Delete & Preview Polish
Date: 2025-08-24
Summary
This release adds a fast, multi-select Delete Files workflow, tightens the image preview size to keep rows compact, and clarifies controls in the Identifier column.
Changes
New: Multi-select “Delete Files” mode
- Entry point: A Delete Files button appears to the right of the “X–Y of Z results” summary.
- Mode toggle: Clicking it turns on deleting mode (button reads Deleting Files). In this mode:
- Row Delete icons are replaced by checkboxes.
- The Identifier header shows a Select All (this page) checkbox with a label.
- A Clear Selected button appears when you’ve selected any rows.
- Selection model:
- Scope: Header Select All applies only to the current page.
- Persistence: Selections persist across pagination and service-chip filter changes.
- Batch delete:
- Pressing Delete N Files publishes a tiny non-empty placeholder file over each selected resource via
PUBLISH_MULTIPLE_QDN_RESOURCES(same “deleted” semantics used elsewhere). - After success, the UI removes those rows and recomputes totals and service counts.
- Pressing Delete N Files publishes a tiny non-empty placeholder file over each selected resource via
UI tweaks
- Identifier column ordering: Now Delete (left) → Edit → Identifier → Embed icon (for image-like services).
- Thumbnails:
img.preview-imagemax height reduced 320px → 100px to prevent tall rows.
Implementation Notes
- State
bulkDeleteMode: booleanselectedForDeletion: Set<string>where key is${service}||${identifier||'default'}
- Key functions
setBulkMode(on: boolean)— togglesbulkDeleteModeandbody.bulk-modeclass.updateBulkControlsUI()— updates button label (Delete N Files), maintains Select All checked/indeterminate states.bulkDeleteSelected()— builds theresourcesarray and callsqortalRequest({ action: 'PUBLISH_MULTIPLE_QDN_RESOURCES', resources }).buildIdentifierCellHTML(result, identifier)— single source of truth for Identifier cell content/order (renders checkbox + delete + edit + text + embed).
- Rendering
buildContentTable(...)uses${buildIdentifierCellHTML(result, identifier)}for the Identifier cell.- Summary bar injects Delete Files / Delete N Files and Clear Selected controls.
- Styling
.bulk-select { display: none; }by default; visible inbody.bulk-mode.body.bulk-mode .clickable-delete { display: none; }hides row Delete during bulk mode.- Header includes a
<label for="select-all-checkbox">Select All</label>for usability.
Fixes & Hardening
- Ensured the body class
bulk-modeis always in sync withbulkDeleteMode(prevents stale visibility). - Replaced any stray
bulkDeleteMode = false;withsetBulkMode(false);. - Corrected a typo that had produced
let setBulkMode(false);causing a syntax error.
Upgrade Steps
- Replace
script.jsandstyle.csswith the v0.7.2 versions. - No HTML changes required (header/summary DOM is generated by JS).
- (Optional) You can add the auto-auth snippet to call
accountLogin()once on load, but it isn’t required for this release.
QA Checklist
- Toggle Delete Files: checkboxes appear; row Delete icons hide; Select All shows with label.
- Select All checks only visible rows; button updates to Delete N Files.
- Navigate pages and switch service chips—selections persist.
- Click Delete N Files: selected items are removed; counts/summary refresh; no console errors.
- Non-bulk mode: Identifier column shows Delete → Edit → Identifier → Embed; thumbnails are small (~100px tall).
Known Limitations
- Select All is page-scoped by design (won’t select items on other pages).
- Batch publish must succeed for all selected resources; network errors produce a user-visible alert and leave selections intact for retry.