detached f4d678e

Trigger full redraw on overlay close and new turn submit

commit
f4d678e61e4b0a52a4b97485e12e9a9717863a59
author
patriceckhart · · 2026-05-10 08:59 UTC
parent
c01e026
signature
unsigned
refs
tag: v0.1.72
1 file · +21 -2
M internal/agent/modes/interactive.go +21 -2
@@ -240,8 +240,9 @@ type Interactive struct {
240240 // window down through the buffer (because scrollOffset is measured
241241 // from the bottom) and the user's reading position drifts upward
242242 // and off the top.
243- prevChatLen int
244- prevChatCols int
243+ prevChatLen int
244+ prevChatCols int
245+ prevOverlayOpen bool
245246
246247 // chatCache stores the built transcript/status-note rows for idle
247248 // frames. Editor typing changes only the bottom input region, so
@@ -938,6 +939,17 @@ func (i *Interactive) redraw() {
938939 } else if len(dialog) == 0 && i.fileSuggest.Active(currentInput) {
939940 suggest = i.fileSuggest.Render(currentInput, i.cfg.Theme, cols)
940941 }
942+
943+ // Detect overlay close (any dialog or slash/file suggestion popup
944+ // just transitioned from open to closed). Force a full redraw so
945+ // the rows the overlay occupied are guaranteed to be repainted
946+ // from the chat below, instead of the diff path leaving stale
947+ // dialog content behind. Equivalent to the user pressing ctrl+l.
948+ overlayOpen := len(dialog) > 0 || len(suggest) > 0
949+ if i.prevOverlayOpen && !overlayOpen && i.rend != nil {
950+ i.rend.Clear()
951+ }
952+ i.prevOverlayOpen = overlayOpen
941953 if len(suggest) > 0 {
942954 // One blank row above the popup so it doesn't sit flush
943955 // against the chat / welcome content above.
@@ -3115,6 +3127,13 @@ func (i *Interactive) startTurnWithImages(parent context.Context, prompt string,
31153127 if i.agent == nil {
31163128 return
31173129 }
3130+ // Force a full repaint when a new turn begins so any stray dialog,
3131+ // popup, or stale tool-progress rows don't leak into the visible
3132+ // chat area before the assistant starts streaming. Equivalent to
3133+ // the user pressing ctrl+l right before submit.
3134+ if i.rend != nil {
3135+ i.rend.Clear()
3136+ }
31183137 // Pre-turn safety: if the most recent context measurement is
31193138 // already past the auto-compact threshold, condense before
31203139 // sending so the next outbound request stays under the limit.
@@ -240,8 +240,9 @@ type Interactive struct {
240 // window down through the buffer (because scrollOffset is measured240 // window down through the buffer (because scrollOffset is measured
241 // from the bottom) and the user's reading position drifts upward241 // from the bottom) and the user's reading position drifts upward
242 // and off the top.242 // and off the top.
243- prevChatLen int243+ prevChatLen int
244- prevChatCols int244+ prevChatCols int
245+ prevOverlayOpen bool
245 246
246 // chatCache stores the built transcript/status-note rows for idle247 // chatCache stores the built transcript/status-note rows for idle
247 // frames. Editor typing changes only the bottom input region, so248 // frames. Editor typing changes only the bottom input region, so
@@ -938,6 +939,17 @@ func (i *Interactive) redraw() {
938 } else if len(dialog) == 0 && i.fileSuggest.Active(currentInput) {939 } else if len(dialog) == 0 && i.fileSuggest.Active(currentInput) {
939 suggest = i.fileSuggest.Render(currentInput, i.cfg.Theme, cols)940 suggest = i.fileSuggest.Render(currentInput, i.cfg.Theme, cols)
940 }941 }
942+
943+ // Detect overlay close (any dialog or slash/file suggestion popup
944+ // just transitioned from open to closed). Force a full redraw so
945+ // the rows the overlay occupied are guaranteed to be repainted
946+ // from the chat below, instead of the diff path leaving stale
947+ // dialog content behind. Equivalent to the user pressing ctrl+l.
948+ overlayOpen := len(dialog) > 0 || len(suggest) > 0
949+ if i.prevOverlayOpen && !overlayOpen && i.rend != nil {
950+ i.rend.Clear()
951+ }
952+ i.prevOverlayOpen = overlayOpen
941 if len(suggest) > 0 {953 if len(suggest) > 0 {
942 // One blank row above the popup so it doesn't sit flush954 // One blank row above the popup so it doesn't sit flush
943 // against the chat / welcome content above.955 // against the chat / welcome content above.
@@ -3115,6 +3127,13 @@ func (i *Interactive) startTurnWithImages(parent context.Context, prompt string,
3115 if i.agent == nil {3127 if i.agent == nil {
3116 return3128 return
3117 }3129 }
3130+ // Force a full repaint when a new turn begins so any stray dialog,
3131+ // popup, or stale tool-progress rows don't leak into the visible
3132+ // chat area before the assistant starts streaming. Equivalent to
3133+ // the user pressing ctrl+l right before submit.
3134+ if i.rend != nil {
3135+ i.rend.Clear()
3136+ }
3118 // Pre-turn safety: if the most recent context measurement is3137 // Pre-turn safety: if the most recent context measurement is
3119 // already past the auto-compact threshold, condense before3138 // already past the auto-compact threshold, condense before
3120 // sending so the next outbound request stays under the limit.3139 // sending so the next outbound request stays under the limit.

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 476

↑↓ moveenter openesc close