TUI: load inline images lazily, after the text renders

Open
#262 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
go
Domain
cli, performance

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.

Description

enhancement

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.

Dominant language
Go
Stars
376
Forks
44
Avg merge
1d 5h
Merged PRs (30d)
130

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from basecamp/hey-cli

All issues in basecamp/hey-cli

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.