Fix scroll-to-top on note toggle during playback

pattern_updated SSE was calling render_content() which rebuilds the entire
panel DOM, resetting the scroll position. Since toggle_note already calls
render_step_grid() directly after the PUT, replace the SSE full-render with
a grid-only refresh to preserve scroll.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-25 03:37:26 +00:00
parent 515cc87382
commit a452477825

View File

@@ -502,7 +502,8 @@ es.addEventListener('pattern_updated', (e) => {
const p = JSON.parse(e.data);
state.patterns.set(p.id, p);
if (state.selected_id === p.id) {
render_content();
/* Only refresh the grid — full render_content() resets scroll position */
render_step_grid(p, p.notes);
}
render_pattern_list();
});