1.4 KiB
1.4 KiB
Architecture Blueprint
Layers
- File Access Layer
LargeFileBackendwraps buffered random reads.ChunkCacheadds LRU chunk caching for streaming document access.
- Text Model Layer
PieceTablereferences original file ranges plus append-only add buffer.- Original bytes are fetched on-demand via callback; no full-file load.
- Index Layer
LineIndexerincrementally scans bytes and lazily materializes line starts.
- Search Layer
SearchEngineprovides basic plain/regex matches.SearchThreadPoolexecutes chunked background searches.
- Session Layer
DocumentSessioncoordinates backend/model/index lifecycle.- Exposes UI-friendly APIs (
lines,lineAt,saveAs,undo/redo,startSearch).
- UI Layer
MainWindowwires menus and status.LargeFileViewimplements viewport-based rendering for visible lines only.
Milestones
M1 - Real Large File Open
- Done: replaced preview mode with chunked streaming reads + file-backed piece table.
- Done: added LRU cache for original file chunks.
M2 - Editing Correctness
- Done: transactional edit commands and undo/redo stacks.
- Next: persistent durable operation log across restarts.
M3 - Search/Replace at Scale
- Done: worker thread pool and chunked background search.
- Next: match navigation/highlighting and replace workflows.
M4 - Platform Hardening
- CRLF/LF normalization policy.
- File lock conflict handling.
- Recovery and crash-safe temp files.