Skip to content

feat: enhance clear history to optionally keep pinned, bookmarked, and tagged items#40

Open
samirpatil2000 wants to merge 1 commit into
mainfrom
feature/keep-pinned-bookmarks
Open

feat: enhance clear history to optionally keep pinned, bookmarked, and tagged items#40
samirpatil2000 wants to merge 1 commit into
mainfrom
feature/keep-pinned-bookmarks

Conversation

@samirpatil2000

Copy link
Copy Markdown
Owner

Summary

Enhances the "Clear History" action to give users the option to preserve pinned, bookmarked, and tagged items instead of wiping everything. Also includes several UX improvements around focus management when entering/exiting edit and tag-input modes.

Changes

🗑️ Selective Clear History

  • ClipboardStore.clear(keepProtected:) — New optional parameter. When true, only deletes items that are not pinned, bookmarked, or tagged, while keeping protected items intact.
  • StatusBarController — The clear history confirmation dialog now includes a checkbox: "Keep pinned, bookmarked, and tagged items" (on by default). The informative text updates dynamically based on the checkbox state.

🧹 Equatable cleanup

  • ClipboardItem.swift — Removed the custom == operator that compared only by id. The struct now uses default memberwise equality, which is safer for change detection.

🎯 Focus Management Improvements

  • HistoryWindow.swift — Several fixes to ensure proper focus transitions:
    • Search field focus is properly released when entering tag input or inline edit mode, and restored when exiting those modes.
    • Tag input and edit mode are dismissed when the selected index changes.
    • Prevents conflicts between tag input, text editing, and search.

Testing

  1. Open Buffer and pin/bookmark/tag some items
  2. Click the menu bar icon → "Clear History…"
  3. ✅ A confirmation dialog appears with "Keep pinned, bookmarked, and tagged items" checked by default
  4. ✅ Informative text reflects the current mode
  5. Click "Clear" — only unpinned, unbookmarked, untagged items are removed
  6. Repeat with the checkbox unchecked — all items are cleared

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant