dsh-delete-session 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/client.js +17 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-delete-session",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Delete sessions from the DSH Web sidebar: adds a Delete action to the session row menu with a risk-consent dialog, then removes the session log, workspace accounting and live session state.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/client.js CHANGED
@@ -419,16 +419,26 @@ window.__ModuleLoader__.load({
419
419
  rows.forEach((row) => {
420
420
  const id = sessionIdFromRow(row)
421
421
  if (!id) return
422
- let check = row.querySelector(':scope > .dsdel-check')
423
- if (!check) {
424
- check = document.createElement('span')
425
- check.className = 'dsdel-check'
426
- check.setAttribute('data-dsh-delete-session', 'check')
427
- row.insertBefore(check, row.firstChild)
422
+ // Checkboxes belong to multi-select only: a single delete (or any other
423
+ // decorate pass outside the mode) must not plant them on every row.
424
+ if (!selecting) {
425
+ const stray = row.querySelector(':scope > .dsdel-check')
426
+ if (stray) stray.remove()
427
+ } else {
428
+ let check = row.querySelector(':scope > .dsdel-check')
429
+ if (!check) {
430
+ check = document.createElement('span')
431
+ check.className = 'dsdel-check'
432
+ check.setAttribute('data-dsh-delete-session', 'check')
433
+ row.insertBefore(check, row.firstChild)
434
+ }
435
+ check.classList.toggle('dsdel-check-on', selected.has(id))
428
436
  }
429
- check.classList.toggle('dsdel-check-on', selected.has(id))
430
437
  row.classList.toggle('dsdel-row-pending', pendingRemoval.has(id))
431
438
  })
439
+ if (!selecting) {
440
+ document.querySelectorAll('.dsdel-check').forEach((el) => el.remove())
441
+ }
432
442
  }
433
443
 
434
444
  function scheduleDecorate() {