Skip to content

TUI: load inline images lazily, after the text renders #262

Description

@jeremy

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions