feat(tui): replace O(N) scanning with progressive loading and VisualHeightIndex

Replace synchronous file loading with AppLoadingState state machine (Empty/Loading/Ready/Error) for instant interactivity. Add ViewportCache for on-demand viewport computation, replacing global wrap/level caches. Integrate background indexer polling and file watcher events into the TUI event loop. Add loading UI with progress percentage, estimated line numbers with ~ prefix, and error state display. Eliminate all O(N) linear scans using VisualHeightIndex binary search.

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
dailz
2026-04-14 09:07:18 +08:00
parent f9f451e0d6
commit bab3d9078a
4 changed files with 1161 additions and 251 deletions

View File

@@ -10,6 +10,7 @@ clap.workspace = true
anyhow.workspace = true
log-viewer-core.workspace = true
serde_json.workspace = true
crossbeam-channel.workspace = true
[dev-dependencies]
tempfile = { workspace = true }