# 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. ### UI tweaks - **Identifier column ordering:** Now **Delete** (left) → **Edit** → Identifier → Embed icon (for image-like services). - **Thumbnails:** `img.preview-image` max height reduced **320px → 100px** to prevent tall rows. ## Implementation Notes - **State** - `bulkDeleteMode: boolean` - `selectedForDeletion: Set` where key is `${service}||${identifier||'default'}` - **Key functions** - `setBulkMode(on: boolean)` — toggles `bulkDeleteMode` **and** `body.bulk-mode` class. - `updateBulkControlsUI()` — updates button label (**Delete N Files**), maintains **Select All** checked/indeterminate states. - `bulkDeleteSelected()` — builds the `resources` array and calls `qortalRequest({ 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 in `body.bulk-mode`. - `body.bulk-mode .clickable-delete { display: none; }` hides row Delete during bulk mode. - Header includes a `` for usability. ## Fixes & Hardening - Ensured the body class **`bulk-mode`** is always in sync with `bulkDeleteMode` (prevents stale visibility). - Replaced any stray `bulkDeleteMode = false;` with `setBulkMode(false);`. - Corrected a typo that had produced `let setBulkMode(false);` causing a syntax error. ## Upgrade Steps 1. Replace **`script.js`** and **`style.css`** with the v0.7.2 versions. 2. No HTML changes required (header/summary DOM is generated by JS). 3. (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.