Skip to content

Commit 6716aae

Browse files
ozgesolidkeyclaude
andcommitted
Add clear buttons to bookmarks and highlights panels
- Bookmarks panel: trash icon button clears all bookmarks (updates UI + minimap) - Highlights panel: 'Clear' button clears active highlight rules without touching saved highlight groups — groups are preserved and reloadable Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent ed09ee7 commit 6716aae

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

src/renderer/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
<button id="btn-save-bookmark-set" class="icon-btn" title="Save as Bookmark Set">&#128230;</button>
151151
<button id="btn-load-bookmark-set" class="icon-btn" title="Load Bookmark Set">&#128229;</button>
152152
<button id="btn-export-bookmarks" class="icon-btn" title="Export Bookmarks">&#128190;</button>
153+
<button id="btn-clear-bookmarks" class="section-btn" title="Clear all bookmarks">&#128465;</button>
153154
</div>
154155
<div id="bookmark-sets-bar" class="bookmark-sets-bar hidden">
155156
<div id="bookmark-sets-list" class="bookmark-sets-list"></div>
@@ -168,6 +169,9 @@
168169
<button id="btn-delete-highlight-group" class="highlight-group-btn danger" title="Delete active group" style="display:none">Del</button>
169170
</div>
170171
</div>
172+
<div class="section-header-inline" style="padding:4px 8px 0;">
173+
<button id="btn-clear-highlights" class="section-btn" title="Clear active highlights (saved groups are kept)">&#128465; Clear</button>
174+
</div>
171175
<div id="highlights-list" class="highlights-content">
172176
<p class="placeholder">No highlight rules</p>
173177
</div>

src/renderer/renderer.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13731,6 +13731,16 @@ function init(): void {
1373113731

1373213732
// Highlights
1373313733
elements.btnAddHighlight.addEventListener('click', showHighlightModal);
13734+
document.getElementById('btn-clear-highlights')?.addEventListener('click', async () => {
13735+
if (state.highlights.length === 0) return;
13736+
await window.api.clearAllHighlights();
13737+
state.highlights = [];
13738+
activeHighlightGroupId = null;
13739+
updateHighlightGroupsUI();
13740+
updateHighlightsUI();
13741+
renderVisibleLines();
13742+
renderMinimapMarkers();
13743+
});
1373413744
elements.btnSaveHighlight.addEventListener('click', saveHighlight);
1373513745
elements.btnCancelHighlight.addEventListener('click', hideHighlightModal);
1373613746

@@ -13851,6 +13861,14 @@ function init(): void {
1385113861
// Bookmark Sets
1385213862
elements.btnSaveBookmarkSet.addEventListener('click', saveBookmarkSet);
1385313863
elements.btnLoadBookmarkSet.addEventListener('click', refreshBookmarkSets);
13864+
document.getElementById('btn-clear-bookmarks')?.addEventListener('click', async () => {
13865+
if (state.bookmarks.length === 0) return;
13866+
await window.api.clearBookmarks();
13867+
state.bookmarks = [];
13868+
updateBookmarksUI();
13869+
renderVisibleLines();
13870+
renderMinimapMarkers();
13871+
});
1385413872

1385513873
// Notes modal
1385613874
elements.btnSaveNotes.addEventListener('click', () => hideNotesModal(true));

0 commit comments

Comments
 (0)