Skip to content

Persist 'Load images' state per message #35

@xsmyile

Description

@xsmyile

Problem

The "Load images" banner state is component-local and resets every time the message is reopened or the page is refreshed. Same message → click again → click again. Annoying.

Current behavior

ui/src/components/MessageDetail.tsx:345-353:

  • loaded is a createSignal(false) local to HtmlPreview
  • createEffect(on(() => props.messageId, () => setLoaded(false))) resets it on every message switch
  • No localStorage, no server state

So:

  • Switch to another message and back → banner returns
  • Refresh page → banner returns

Expected

Once user clicks "Load images" for a given message, remote images stay enabled for that message across navigation and page reloads. Matches Gmail / Thunderbird / Apple Mail.

Options

  1. localStorage, keyed on messageId — UI-only change, smallest diff
  2. Server-side: add remote_images_allowed boolean to message record, PATCH /messages/{id} — survives across browsers/devices, but extra schema + API work for marginal benefit (single-user dev tool)

Recommend option 1.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions