AvengeMedia / AvengeMedia/DankMaterialShell

Clipboard clear confirmation appears when history is empty

Open
#3,404 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
QML
Stars
8.1k
Forks
515
Avg merge
1d 8h
Merged PRs (30d)
102

Description

### Description

When the clipboard history is empty, the Clear All button (`delete_sweep`) in the Clipboard History header is still visible and enabled. Clicking it opens the "Clear History?" confirmation although there is nothing to delete.

`confirmClearAll()` in `quickshell/Modals/Clipboard/ClipboardHistoryContent.qml` returns early when a search or type filter matches nothing (#3235). The unfiltered branch has no such check and calls `clearConfirmDialog.show()` even when there are no unpinned entries, and the button in `ClipboardHeader.qml` has no `enabled` or `visible` condition. The bar widget's context-menu Clear All handler (`onClearAllRequested` in `DankBarContent.qml`) also opens the dialog without checking the count.

### Steps to reproduce

1. Start with an empty clipboard history (no pinned entries either).
2. Open Clipboard History. The header shows `Clipboard History (0)`. Leave the search field empty and the type filter on All.
3. Click the Clear All button in the header.

### Current behavior

The "Clear History?" dialog opens with "This will permanently delete all clipboard history." and asks for Cancel or Confirm. Shift+Del opens the same dialog. If the history holds only pinned entries, the header also shows `(0)` and the dialog still opens, saying the pinned entries will be kept.

### Expected behavior

Clear History should not ask to confirm a deletion when there are zero entries to delete. Preferably the button is disabled or hidden while the history is empty, following the UI pattern the shell already uses.

### Environment

- DMS 1.6.1, Quickshell 0.3.1
- Compositor: niri 26.04
- Distribution: Fedora 44
- Installation method: Distro Packaging (`avengemedia/dms` COPR)
- `ClipboardHistoryContent.qml` and `ClipboardHeader.qml` are identical on current `master`.

dms doctor -v (excerpt, paths omitted)

```
System
● Operating System ····· Fedora Linux 44 (Forty Four)
● Architecture ········· amd64
● Display Server ······· Wayland

Versions
● DMS CLI ·············· dms v1.6.1
● Quickshell ··········· Quickshell 0.3.1 (revision , distributed by Fedora COPR (avengemedia/quickshell))
● DMS Shell ············ v1.6.1

Compositor
● niri ················· 26.04
○ Active ··············· niri
```

### Screenshots
1. Before clicking: `Clipboard History (0)` with the clear button enabled.
2. Image
3. After clicking: the "Clear History?" confirmation.
4. Image

Contributor guide

Open the contributing guide

Research direction

Start by reading confirmClearAll() in quickshell/Modals/Clipboard/ClipboardHistoryContent.qml, then inspect the clear control in ClipboardHeader.qml and onClearAllRequested in DankBarContent.qml. Verify the behavior for empty history, pinned-only history, filters, and Shift+Del; done means no clear confirmation is opened when there are zero deletable entries.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.