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:
@@ -31,6 +31,8 @@ fn main() -> anyhow::Result<()> {
|
||||
}
|
||||
|
||||
while !app.should_quit {
|
||||
app.poll_background_indexer();
|
||||
app.poll_file_watcher();
|
||||
terminal.draw(|frame| ui::render(frame, &mut app))?;
|
||||
if crossterm::event::poll(std::time::Duration::from_millis(100))? {
|
||||
match crossterm::event::read()? {
|
||||
|
||||
Reference in New Issue
Block a user