browser: document lazy loading implementation plan

- Add detailed §15 lazy loading plan with 7 implementation steps
- Update Phase 2 checklist with specific tasks
- Add E2E test harness for browser files
- Refactor browser layout and handler structure
- Add .gitignore for common patterns

WIP: Actual lazy loading not yet implemented.
This commit is contained in:
gmp
2026-05-31 18:43:46 +00:00
parent 6a43e3c0db
commit 3f1c881a06
8 changed files with 516 additions and 5 deletions
+2
View File
@@ -97,6 +97,8 @@ func (l *Logic) FrameChan() <-chan []ui.Element {
return l.frameChan
}
// InputChan returns the input channel for the logic goroutine.
func (l *Logic) InputChan() chan<- []ui.InputEvent {
return l.inputChan
+3
View File
@@ -15,6 +15,9 @@ import (
func populateMockFileSystem(fs *mock.FileSystem) {
baseTime := time.Date(2026, 5, 15, 10, 0, 0, 0, time.UTC)
// Create root directory - required for ReadDir("/") to succeed
fs.AddDir("/", baseTime)
// --- Root directories ---
dirs := []string{
"/Documents",
+12
View File
@@ -99,6 +99,18 @@ func (s *State) Scale() float32 {
func (s *State) layout() []ui.Element {
dpW := ui.ToDp(ui.Px(s.PixelWidth), s.scale)
dpH := ui.ToDp(ui.Px(s.PixelHeight), s.scale)
// Calculate VisibleCount before laying out the browser page.
// This ensures the browser shows entries based on the current viewport.
if s.PixelHeight > 0 && s.scale > 0 {
listAreaHeight := dpH - ui.Dp(10+24+5+36+5+10)
rowHeight := ui.Dp(48)
newVisibleCount := int(listAreaHeight / rowHeight)
if newVisibleCount > 0 && newVisibleCount != s.Browser.VisibleCount {
s.Browser.VisibleCount = newVisibleCount
}
}
switch s.page {
case BrowserPage:
browser.SetBrowserState(&s.Browser)