Fix stale QuickClip suggestion after clipboard item deletion#1877
Open
liketheduck wants to merge 2 commits intofuto-org:masterfrom
Open
Fix stale QuickClip suggestion after clipboard item deletion#1877liketheduck wants to merge 2 commits intofuto-org:masterfrom
liketheduck wants to merge 2 commits intofuto-org:masterfrom
Conversation
When users delete clipboard items from clipboard history, the QuickClip cache could still hold references to the deleted items, causing them to appear as suggestions in the action bar. This fix invalidates the cached state in QuickClip when items are explicitly removed via onRemove() and when items are pruned by pruneOldItems(), ensuring deleted clipboard content no longer surfaces as QuickClip suggestions. Fixes futo-org#1766 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The previous commit cleared the QuickClip singleton cache but not the Compose MutableState in UixManager that drives the actual UI. This caused the stale suggestion pill to reappear when closing the clipboard panel back to the main keyboard view within the same input session. Exposes dismissQuickClips() through KeyboardManagerForAction and calls it from both the single-item delete and bulk clear-unpinned paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a bug where deleted clipboard items continued to appear as QuickClip suggestions in the action bar. The QuickClip cache was not invalidated when items were removed from clipboard history, causing stale entries to persist until the 60-second cache TTL expired.
Closes #1766.
Changes
QuickClip.kt: AddedinvalidateCache()method that clears the cached previous item and state.ClipboardHistoryAction.kt: CallsinvalidateCache()after manual item removal (onRemove) and after background pruning (pruneOldItems). Also callsmarkQuickClipDismissed()on manual removal to prevent immediate re-suggestion.Test plan
Co-authored with Claude Code.