Skip to content

v0.17.0

Choose a tag to compare

@tya5 tya5 released this 11 Aug 01:11
· 12 commits to main since this release

Fixed — text search no longer silently misses matches

Search read rows through the render path, so an entry that had never scrolled into view returned the placeholder ("Loading...") instead of its content — searching a long transcript quietly found nothing beyond what you had already looked at. It was also eager (it evaluated every row in the document before checking any) and presented every entry as a side effect: a match on the next row cost 441 ms over a 10 000-row document.

Added — search_text= makes the whole model searchable

FlowView only ever sees the Presentation a presenter produced, so it cannot read an un-presented entry. Give it a way to read the item:

FlowView(model=..., presenter=..., search_text=lambda msg: msg.text)

It finds the matching entry from that cheap text (no rendering) and presents only that one to resolve the exact row and column. Measured over 2 000 entries:

before after
never-visited match at the end not found, 579 ms found, 1.0 ms (1 present)
match on the next row 441 ms 0.3 ms
no match 465 ms, presents everything 0.3 ms, renders nothing

Return what the body renders — anything your presenter adds that isn't in the returned string won't be found. Without search_text the previous behaviour is kept (rendered rows only, now evaluated lazily) and documented as such.

Changed

  • search, search_next, search_previous, search_selection are now async (a match may need its entry presented first). The default key bindings are unaffected.

Full Changelog: v0.16.4...v0.17.0