Read a view that is being searched to the end when it renders again

Opening the search prompt reads the whole of the view's content, so that
the search counts every match in it. Rendering the content again reads
only as much as the scrollbar needs, so the matches below that point are
lost. The "x of y" drops to what the shortened content holds, and grows
again as the user scrolls far enough to load more.

Read to the end while a search is on, the way opening the prompt does.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stefan Haller
2026-09-05 15:09:52 +02:00
co-authored by Claude Opus 5
parent 0505e778b3
commit 04a7ae3ec8
2 changed files with 21 additions and 0 deletions
@@ -53,5 +53,14 @@ var SearchALongDiff = NewIntegrationTest(NewIntegrationTestArgs{
FilterOrSearch("NEEDLE")
t.Views().Search().Content(Contains("matches for 'NEEDLE' (1 of 3)"))
// Rendering the diff again reads it from the start, and it is read all the
// way down to the matches the search already knows about.
t.Views().Main().
Press(keys.Universal.IncreaseContextInDiffView).
Tap(func() {
t.ExpectToast(Equals("Changed diff context size to 4"))
}).
Content(Contains("+NEEDLE last"))
},
})