Skip to content

Commit 87c49a1

Browse files
authored
fix(preview): update preview window after squash operation (#518)
Root cause: startSquash() called SetCursor() to move to the parent revision but never emitted a SelectionChangedMsg. The preview panel only refreshes when it receives that message, so it stayed stale until the user pressed j/k which does emit the message via updateSelection(). Fix: batch updateSelection() alongside the operation init command in startSquash(), matching the pattern used by all other cursor-moving operations. Closes #516
1 parent a1a51dc commit 87c49a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

internal/ui/revisions/revisions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ func (m *Model) startSquash(intent intents.StartSquash) tea.Cmd {
577577
m.SetCursor(m.cursor + 1)
578578
}
579579
m.op = squash.NewOperation(m.context, selected, squash.WithFiles(intent.Files))
580-
return m.op.Init()
580+
return tea.Batch(m.op.Init(), m.updateSelection())
581581
}
582582

583583
func (m *Model) startRebase(intent intents.StartRebase) tea.Cmd {

0 commit comments

Comments
 (0)