Skip to content

Edge-Drop is a clipboard shelf on the edge of your screen. Hover to open it. Drag files and images into any app, click to copy text and links. Free and open-source for Windows.

feat(clipboard): scope clear history actions to current category filter and search view

Deepender251100f9676866
diff --git a/src/components/Panel.tsx b/src/components/Panel.tsx
index e3b7d9c..a439f30 100644
--- a/src/components/Panel.tsx
+++ b/src/components/Panel.tsx
@@ -30,7 +30,8 @@ export function Panel() {
const filteredItems = useMemo(() => [...pinned, ...recent], [pinned, recent])
const filteredCount = filteredItems.length
const clear = useStore((s) => s.clear)
- const items = useStore((s) => s.items)
+ const typeFilter = useStore((s) => s.typeFilter)
+ const query = useStore((s) => s.query)
const settings = useStore((s) => s.settings)
const settingsOpen = useStore((s) => s.settingsOpen)
@@ -376,11 +377,17 @@ export function Panel() {
</span>
<div className="spacer" />
<ClearMenu
- items={items}
+ items={filteredItems}
disabled={recent.length === 0}
panelOpen={open}
onClear={(ids) => clear(ids)}
- onClearAll={() => clear()}
+ onClearAll={() => {
+ if (typeFilter === 'all' && !query.trim()) {
+ clear()
+ } else {
+ clear(recent.map((it) => it.id))
+ }
+ }}
/>
</div>
</motion.div>