TUI: load inline images lazily, after the text renders
- Dominant language
- Go
- Stars
- 368
- Forks
- 44
- Avg merge
- 15h 15m
- Merged PRs (30d)
- 189
Description
Split out of #246, which #259 closes for the bounded, full-thread read and the image budget.
`mailView.fetchTopic` and `journalView.fetchJournalEntry` still fetch every image within the budget (`internal/tui/image_budget.go`) before the message that renders the text is delivered, so a thread whose images are slow holds the text back for up to `imageFetchDeadline`. Two steps remain from #246's scope:
- Render the text first and deliver images through follow-up messages, with the placeholders reserving their cells so the layout does not jump.
- Fetch an image only as the viewport reaches it, and cancel what the reader has scrolled past or navigated away from.
The budget stays the bound either way; what moves is when inside it each image is requested.
Contributor guide
Research direction
Start with mailView.fetchTopic and journalView.fetchJournalEntry, then read internal/tui/image_budget.go and trace how rendered messages and follow-up messages reach the TUI. Done means text renders without waiting for slow images, placeholders reserve their cells, images load as the viewport reaches them, and off-screen or abandoned requests can be canceled while the budget remains the bound.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100