Skip to content

Commit 0220a7d

Browse files
ozgesolidkeyclaude
andcommitted
Add unified search panel, context menus, highlight color picker, and bug fixes
- Replace toolbar search with bottom slide-up search panel (Ctrl+F toggle) - Add File and Folder search tabs in unified panel with result navigation - Add terminal copy/paste/select-all (Ctrl+C/V/A) - Add right-click context menu on tabs and folder files (copy name/path, show in folder) - Add "Copy All Content" option with size warnings for large files - Add highlight color picker (click swatch to change color) - Fix advanced filter: strip empty rules from groups, case-insensitive level match - Fix filtered content save showing wrong line counts in UI - Fix save-to-notes append corruption by replacing regex insertion with simple append - Fix search input text visibility in paper theme Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent c908011 commit 0220a7d

6 files changed

Lines changed: 959 additions & 68 deletions

File tree

src/main/index.ts

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,6 +1611,11 @@ ipcMain.handle('open-external-url', async (_, url: string) => {
16111611
}
16121612
});
16131613

1614+
// Show item in system file manager (Finder/Explorer)
1615+
ipcMain.handle('show-item-in-folder', async (_, filePath: string) => {
1616+
shell.showItemInFolder(filePath);
1617+
});
1618+
16141619
// === Save Selected Lines ===
16151620

16161621
ipcMain.handle('save-selected-lines', async (_, startLine: number, endLine: number, columnConfig?: ColumnConfig) => {
@@ -1817,19 +1822,9 @@ ipcMain.handle('save-to-notes', async (
18171822
content += newEntry;
18181823
fs.writeFileSync(notesFilePath, content, 'utf-8');
18191824
} else {
1820-
// Insert entry in line-number order among existing entries
1825+
// Append new entry at end of file
18211826
const existing = fs.readFileSync(notesFilePath, 'utf-8');
1822-
const entryRegex = /\n--- \[.*?\] Lines (\d+)-/g;
1823-
let insertPos = existing.length; // default: append at end
1824-
let match;
1825-
while ((match = entryRegex.exec(existing)) !== null) {
1826-
const entryStartLine = parseInt(match[1], 10);
1827-
if (entryStartLine > startLine + 1) {
1828-
insertPos = match.index;
1829-
break;
1830-
}
1831-
}
1832-
const result = existing.substring(0, insertPos) + newEntry + existing.substring(insertPos);
1827+
const result = existing.endsWith('\n') ? existing + newEntry : existing + '\n' + newEntry;
18331828
fs.writeFileSync(notesFilePath, result, 'utf-8');
18341829
}
18351830

@@ -1969,9 +1964,9 @@ function compileAdvancedFilter(config: AdvancedFilterConfig): CompiledMatcher {
19691964
return (text: string, _level: string) =>
19701965
!(rule.caseSensitive ? text : text.toLowerCase()).includes(pattern);
19711966
case 'level':
1972-
return (_text: string, level: string) => level === rule.value;
1967+
return (_text: string, level: string) => level.toLowerCase() === rule.value.toLowerCase();
19731968
case 'not_level':
1974-
return (_text: string, level: string) => level !== rule.value;
1969+
return (_text: string, level: string) => level.toLowerCase() !== rule.value.toLowerCase();
19751970
default:
19761971
return (_text: string, _level: string) => true;
19771972
}

src/preload/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,10 @@ const api = {
220220
openExternalUrl: (url: string): Promise<void> =>
221221
ipcRenderer.invoke('open-external-url', url),
222222

223+
// Show item in system file manager (Finder/Explorer)
224+
showItemInFolder: (filePath: string): Promise<void> =>
225+
ipcRenderer.invoke('show-item-in-folder', filePath),
226+
223227
// JSON formatting
224228
formatJsonFile: (filePath: string): Promise<{ success: boolean; formattedPath?: string; error?: string }> =>
225229
ipcRenderer.invoke('format-json-file', filePath),

src/renderer/index.html

Lines changed: 78 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -31,40 +31,9 @@
3131
<span class="icon">&#128194;</span> Open File
3232
</button>
3333
<div class="separator"></div>
34-
<div class="search-container">
35-
<input type="text" id="search-input" placeholder="Search..." class="toolbar-input">
36-
<label class="checkbox-label">
37-
<input type="checkbox" id="search-regex"> Regex
38-
</label>
39-
<label class="checkbox-label">
40-
<input type="checkbox" id="search-wildcard"> Wildcard
41-
</label>
42-
<label class="checkbox-label">
43-
<input type="checkbox" id="search-case"> Match Case
44-
</label>
45-
<label class="checkbox-label">
46-
<input type="checkbox" id="search-whole-word"> Whole Word
47-
</label>
48-
<button id="btn-search" class="toolbar-btn" title="Search">Search</button>
49-
<div class="search-options-wrapper">
50-
<button id="btn-search-options" class="toolbar-btn small" title="Search options">&#9881;</button>
51-
<div id="search-options-popup" class="search-options-popup hidden">
52-
<div class="search-option-row">
53-
<label class="search-option-label">Direction</label>
54-
<button id="search-direction" class="toolbar-btn small search-direction-btn" title="Toggle search direction">&#8595; Top to Bottom</button>
55-
</div>
56-
<div class="search-option-row">
57-
<label class="search-option-label" for="search-start-line">Start from line</label>
58-
<input type="number" id="search-start-line" class="search-start-line-input" placeholder="1" min="1">
59-
</div>
60-
</div>
61-
</div>
62-
<button id="btn-prev-result" class="toolbar-btn small" title="Previous result" disabled>&lt;</button>
63-
<span id="search-result-count" class="result-count"></span>
64-
<span id="search-engine-badge" class="search-engine-badge" title="Search engine"></span>
65-
<span id="hidden-matches-badge" class="hidden-matches-badge hidden" title="Click to see matches in filtered-out lines"></span>
66-
<button id="btn-next-result" class="toolbar-btn small" title="Next result" disabled>&gt;</button>
67-
</div>
34+
<button id="btn-search-toggle" class="toolbar-btn" title="Search (Ctrl+F)">
35+
<span class="icon">&#128269;</span> Search
36+
</button>
6837
<div class="separator"></div>
6938
<button id="btn-filter" class="toolbar-btn" title="Filter settings">Filter</button>
7039
<button id="btn-split" class="toolbar-btn" title="Split file into parts" disabled>Split</button>
@@ -347,6 +316,80 @@ <h2>LOGAN</h2>
347316
</div>
348317
</div>
349318

319+
<!-- Search Results Panel (slide-up from bottom) -->
320+
<div id="search-results-overlay" class="search-results-overlay hidden">
321+
<div id="search-results-panel" class="search-results-panel">
322+
<div id="search-results-resize-handle" class="search-results-resize-handle"></div>
323+
<div class="search-panel-tabs">
324+
<button class="search-panel-tab active" data-search-tab="file">File</button>
325+
<button class="search-panel-tab" data-search-tab="folder">Folder</button>
326+
<div class="search-panel-tabs-spacer"></div>
327+
<button id="btn-search-results-close" class="search-results-close-btn" title="Close (Esc)">&times;</button>
328+
</div>
329+
<!-- File Search Tab -->
330+
<div id="search-tab-file" class="search-tab-content active">
331+
<div class="search-results-header">
332+
<div class="search-results-input-row">
333+
<input type="text" id="search-input" placeholder="Search in file..." class="search-panel-input">
334+
<button id="btn-search" class="toolbar-btn small" title="Search">Search</button>
335+
<button id="btn-prev-result" class="toolbar-btn small" title="Previous result (Shift+F3)" disabled>&lt;</button>
336+
<span id="search-result-count" class="result-count"></span>
337+
<button id="btn-next-result" class="toolbar-btn small" title="Next result (F3)" disabled>&gt;</button>
338+
<span id="search-engine-badge" class="search-engine-badge" title="Search engine"></span>
339+
<span id="hidden-matches-badge" class="hidden-matches-badge hidden" title="Click to see matches in filtered-out lines"></span>
340+
</div>
341+
<div class="search-results-options-row">
342+
<label class="checkbox-label">
343+
<input type="checkbox" id="search-regex"> Regex
344+
</label>
345+
<label class="checkbox-label">
346+
<input type="checkbox" id="search-wildcard"> Wildcard
347+
</label>
348+
<label class="checkbox-label">
349+
<input type="checkbox" id="search-case"> Match Case
350+
</label>
351+
<label class="checkbox-label">
352+
<input type="checkbox" id="search-whole-word"> Whole Word
353+
</label>
354+
<div class="search-options-wrapper">
355+
<button id="btn-search-options" class="toolbar-btn small" title="Search options">&#9881;</button>
356+
<div id="search-options-popup" class="search-options-popup hidden">
357+
<div class="search-option-row">
358+
<label class="search-option-label">Direction</label>
359+
<button id="search-direction" class="toolbar-btn small search-direction-btn" title="Toggle search direction">&#8595; Top to Bottom</button>
360+
</div>
361+
<div class="search-option-row">
362+
<label class="search-option-label" for="search-start-line">Start from line</label>
363+
<input type="number" id="search-start-line" class="search-start-line-input" placeholder="1" min="1">
364+
</div>
365+
</div>
366+
</div>
367+
<span id="search-results-badge" class="search-results-badge"></span>
368+
</div>
369+
</div>
370+
<div id="search-results-list" class="search-results-list"></div>
371+
</div>
372+
<!-- Folder Search Tab -->
373+
<div id="search-tab-folder" class="search-tab-content">
374+
<div class="search-results-header">
375+
<div class="search-results-input-row">
376+
<input type="text" id="folder-search-panel-input" placeholder="Search in folders..." class="search-panel-input">
377+
<label class="checkbox-label">
378+
<input type="checkbox" id="folder-search-regex"> Regex
379+
</label>
380+
<label class="checkbox-label">
381+
<input type="checkbox" id="folder-search-case"> Match Case
382+
</label>
383+
<button id="btn-folder-search-panel" class="toolbar-btn small" title="Search">Search</button>
384+
<button id="btn-folder-search-panel-cancel" class="toolbar-btn small hidden" title="Cancel search">Cancel</button>
385+
<span id="folder-search-status" class="result-count"></span>
386+
</div>
387+
</div>
388+
<div id="folder-search-panel-results" class="search-results-list"></div>
389+
</div>
390+
</div>
391+
</div>
392+
350393
<!-- Status Bar -->
351394
<footer class="status-bar">
352395
<div class="status-left">
@@ -590,6 +633,7 @@ <h4>Terminal & Notes</h4>
590633
<div class="shortcut-list">
591634
<div class="shortcut-item"><kbd>Ctrl</kbd>+<kbd>`</kbd><span>Toggle terminal panel</span></div>
592635
<div class="shortcut-item"><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>N</kbd><span>Toggle notes drawer</span></div>
636+
<div class="shortcut-item"><kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>R</kbd><span>Toggle search results panel</span></div>
593637
<div class="shortcut-item"><kbd>Esc</kbd><span>Close terminal/notes (when focused)</span></div>
594638
</div>
595639
</div>

0 commit comments

Comments
 (0)