fix(ui): stop the reconcile tick on native close, index rows in the tick

Two follow-ups to the Phase 3 reconcile tick:

- LogVisualizer and WorktreesOverview only stopped their timer in the Close
  command, but ShowLogVisualizerAsync/ShowWorktreesOverviewAsync had no
  dlg.Closed fallback (unlike the MergeHelper picker). An Alt+F4 or owner
  close left a 4s timer polling the worker / re-running LoadAsync on an
  orphaned VM, accumulating one per open. Extracted StopReconcileTick on both
  VMs and wired it from Closed.
- The tick scanned Items linearly per id; at the 500-row cap that is ~250k
  string comparisons every few seconds. Index the rows once instead.
This commit is contained in:
mika kuns
2026-08-10 16:05:37 +02:00
parent 1b7b18fdfc
commit 82881acc70
4 changed files with 25 additions and 4 deletions
@@ -107,6 +107,7 @@ public sealed class WindowDialogService : IDialogService
{
var dlg = new WorktreesOverviewModalView { DataContext = vm };
vm.CloseAction = () => dlg.Close();
dlg.Closed += (_, _) => vm.StopReconcileTick(); // native close bypasses CloseCommand
vm.JumpToTaskAction = (listId, taskId) =>
{
if (Shell is { } s) _ = JumpToTaskHelper.SelectAsync(s, listId, taskId);
@@ -161,6 +162,7 @@ public sealed class WindowDialogService : IDialogService
{
var dlg = new LogVisualizerView { DataContext = vm };
vm.CloseAction = () => dlg.Close();
dlg.Closed += (_, _) => vm.StopReconcileTick(); // native close bypasses CloseCommand
await dlg.ShowDialog(_owner);
}