Skip to content

Commit 39fd2a7

Browse files
ozgesolidkeyclaude
andcommitted
Fix highlight group carryover and serial save empty render
Highlight carryover: - Reset activeHighlightGroupId to null on every file open so the groups panel doesn't show the previous file's group as still active - Call updateHighlightGroupsUI() on file open to reflect the reset Serial save empty screen: - Two requestAnimationFrame waits instead of one — the first lets the browser begin layout after createLogViewer() inserts the new element; the second ensures clientHeight is fully computed before we read it - Explicit renderVisibleLines() after loadVisibleLines() so content is painted even if a ResizeObserver callback raced and cleared it Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f6b0621 commit 39fd2a7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/renderer/renderer.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9648,7 +9648,10 @@ async function loadFile(filePath: string, createNewTab: boolean = true): Promise
96489648
} else {
96499649
state.highlights = [];
96509650
}
9651+
// Reset active highlight group — groups are per-session, not per-file
9652+
activeHighlightGroupId = null;
96519653
updateHighlightsUI();
9654+
updateHighlightGroupsUI();
96529655

96539656
// Handle split file detection (from opening an existing split file or header metadata)
96549657
if (result.splitFiles && result.splitFiles.length > 0) {
@@ -9689,7 +9692,9 @@ async function loadFile(filePath: string, createNewTab: boolean = true): Promise
96899692
// Auto-cd terminal to file's directory
96909693
terminalCdToFile(filePath);
96919694

9692-
// Wait for DOM layout before loading lines
9695+
// Two RAFs: first lets the browser start layout after createLogViewer() inserts
9696+
// the new element; second ensures clientHeight is fully computed before we read it.
9697+
await new Promise(resolve => requestAnimationFrame(resolve));
96939698
await new Promise(resolve => requestAnimationFrame(resolve));
96949699

96959700
// Initialize visible range based on container size
@@ -9701,6 +9706,9 @@ async function loadFile(filePath: string, createNewTab: boolean = true): Promise
97019706
}
97029707

97039708
await loadVisibleLines();
9709+
// Explicit render after load to guarantee content is painted even if
9710+
// a ResizeObserver callback raced and cleared the content mid-flight.
9711+
renderVisibleLines();
97049712

97059713
elements.btnAnalyze.disabled = false;
97069714
elements.btnSplit.disabled = false;

0 commit comments

Comments
 (0)