Skip to content

Commit e29904a

Browse files
committed
Revert "Add unified search panel, context menus, highlight color picker, and bug fixes"
This reverts commit 0220a7d.
1 parent 0220a7d commit e29904a

6 files changed

Lines changed: 68 additions & 959 deletions

File tree

src/main/index.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,11 +1611,6 @@ 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-
16191614
// === Save Selected Lines ===
16201615

16211616
ipcMain.handle('save-selected-lines', async (_, startLine: number, endLine: number, columnConfig?: ColumnConfig) => {
@@ -1822,9 +1817,19 @@ ipcMain.handle('save-to-notes', async (
18221817
content += newEntry;
18231818
fs.writeFileSync(notesFilePath, content, 'utf-8');
18241819
} else {
1825-
// Append new entry at end of file
1820+
// Insert entry in line-number order among existing entries
18261821
const existing = fs.readFileSync(notesFilePath, 'utf-8');
1827-
const result = existing.endsWith('\n') ? existing + newEntry : existing + '\n' + newEntry;
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);
18281833
fs.writeFileSync(notesFilePath, result, 'utf-8');
18291834
}
18301835

@@ -1964,9 +1969,9 @@ function compileAdvancedFilter(config: AdvancedFilterConfig): CompiledMatcher {
19641969
return (text: string, _level: string) =>
19651970
!(rule.caseSensitive ? text : text.toLowerCase()).includes(pattern);
19661971
case 'level':
1967-
return (_text: string, level: string) => level.toLowerCase() === rule.value.toLowerCase();
1972+
return (_text: string, level: string) => level === rule.value;
19681973
case 'not_level':
1969-
return (_text: string, level: string) => level.toLowerCase() !== rule.value.toLowerCase();
1974+
return (_text: string, level: string) => level !== rule.value;
19701975
default:
19711976
return (_text: string, _level: string) => true;
19721977
}

src/preload/index.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,6 @@ 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-
227223
// JSON formatting
228224
formatJsonFile: (filePath: string): Promise<{ success: boolean; formattedPath?: string; error?: string }> =>
229225
ipcRenderer.invoke('format-json-file', filePath),

src/renderer/index.html

Lines changed: 34 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,40 @@
3131
<span class="icon">&#128194;</span> Open File
3232
</button>
3333
<div class="separator"></div>
34-
<button id="btn-search-toggle" class="toolbar-btn" title="Search (Ctrl+F)">
35-
<span class="icon">&#128269;</span> Search
36-
</button>
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>
3768
<div class="separator"></div>
3869
<button id="btn-filter" class="toolbar-btn" title="Filter settings">Filter</button>
3970
<button id="btn-split" class="toolbar-btn" title="Split file into parts" disabled>Split</button>
@@ -316,80 +347,6 @@ <h2>LOGAN</h2>
316347
</div>
317348
</div>
318349

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-
393350
<!-- Status Bar -->
394351
<footer class="status-bar">
395352
<div class="status-left">
@@ -633,7 +590,6 @@ <h4>Terminal & Notes</h4>
633590
<div class="shortcut-list">
634591
<div class="shortcut-item"><kbd>Ctrl</kbd>+<kbd>`</kbd><span>Toggle terminal panel</span></div>
635592
<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>
637593
<div class="shortcut-item"><kbd>Esc</kbd><span>Close terminal/notes (when focused)</span></div>
638594
</div>
639595
</div>

0 commit comments

Comments
 (0)