Skip to content

fix(desktop): render inline images as <img> in the main block row - #331

Merged
avelino merged 3 commits into
mainfrom
pr-326-local
Sep 28, 2026
Merged

avelino merged 3 commits into
mainfrom
pr-326-local

Conversation

@avelino

@avelino avelino commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

MarkdownInline's variant answered two questions with one value: whether refs and tags draw TUI-style (desktop) or as pill chips (mobile), and whether an asset may take a block of its own. The desktop's main outline row wants the first and not the second, so every inline image collapsed to a chip. Mobile passes no variant at all, which is the only reason it rendered the picture.

blockAssets carries the second question now. It defaults to what the variant used to imply, so backlinks, embedded subtrees and breadcrumbs keep their chip without passing anything.

The four suggestion popups move out of BlockRow.tsx into SuggestPopups.tsx behind one shared shell. The file sat one line under the size ratchet and the four were near-identical copies with no test between them, so a fix to one (the onMouseDown + preventDefault note) had to be re-applied by hand three times. 1609 lines down to 1411, baseline tightened to match.

Resolves #322
Thanks to @DYNOSuprovo


View with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is enabled.

`MarkdownInline`'s `variant` answered two questions with one value: whether
refs and tags draw TUI-style (desktop) or as pill chips (mobile), and whether
an asset may take a block of its own. The desktop's main outline row wants the
first and not the second, so every inline image collapsed to a chip. Mobile
passes no variant at all, which is the only reason it rendered the picture.

`blockAssets` carries the second question now. It defaults to what the variant
used to imply, so backlinks, embedded subtrees and breadcrumbs keep their chip
without passing anything.

The four suggestion popups move out of `BlockRow.tsx` into `SuggestPopups.tsx`
behind one shared shell. The file sat one line under the size ratchet and the
four were near-identical copies with no test between them, so a fix to one
(the `onMouseDown` + `preventDefault` note) had to be re-applied by hand three
times. 1609 lines down to 1411, baseline tightened to match.

Resolves #322
Thanks to @DYNOSuprovo
Copilot AI lite review requested due to automatic review settings September 28, 2026 12:11

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No blocking issues remain; the documentation request is a minor nit.

Review effort: Lite
Findings: 1 Low severity

Open (1)
What changed in this PR

Fixes desktop inline image rendering and consolidates duplicated suggestion popups.

Changes:

  • Adds blockAssets to control asset rendering independently.
  • Enables desktop block-row images.
  • Extracts and tests shared suggestion popups.
  • Updates tests, changelog, and file-size baseline.
File Summary
crates/​outl-frontend-shared/​src/​markdown/​MarkdownInline.tsx Adds independent block-asset rendering.
crates/​outl-frontend-shared/​src/​markdown/​MarkdownInline.test.tsx Tests image and styling behavior.
crates/​outl-desktop/​src/​components/​SuggestPopups.tsx Provides shared popup components.
crates/​outl-desktop/​src/​components/​SuggestPopups.test.tsx Tests popup behavior and rendering.
crates/​outl-desktop/​src/​components/​BlockRow.tsx Enables desktop images and uses shared popups.
crates/​outl-desktop/​src/​components/​BlockRow.test.tsx Adds desktop image regression tests.
CHANGELOG.md Documents the fix.
.github/​file-size-baseline.txt Updates the reduced size baseline.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +131 to +137
/** Whether the context permits assets (e.g. images) to render as block
* elements (`<img>`). Defaults to `false` when `variant === "inline"`
* (compact inline contexts like breadcrumbs, previews, backlinks, embedded subtrees)
* and `true` when `variant === "pill"`. Desktop's main `BlockRow` passes
* `blockAssets={true}` (with `variant="inline"`) so images render as `<img>`
* without altering the desktop text affordances on refs, tags, and links. */
blockAssets?: boolean;
avelino and others added 2 commits September 28, 2026 12:16
Co-authored-by: Codesmith <codesmith-bot@users.noreply.github.com>
`MarkdownInline`'s `variant` answered two questions with one value: whether
refs and tags draw TUI-style (desktop) or as pill chips (mobile), and whether
an asset may take a block of its own. The desktop's main outline row wants the
first and not the second, so every inline image collapsed to a chip. Mobile
passes no variant at all, which is the only reason it rendered the picture.

`blockAssets` carries the second question now. It defaults to what the variant
used to imply, so backlinks, embedded subtrees and breadcrumbs keep their chip
without passing anything.

The four suggestion popups move out of `BlockRow.tsx` into `SuggestPopups.tsx`
behind one shared shell. `BlockRow.tsx` sat exactly on its recorded ceiling, so
the one line this fix adds turned the ratchet red, and the four popups were
near-identical copies with no test between them: a fix to one (the
`onMouseDown` + `preventDefault` note) had to be re-applied by hand three
times. 1609 lines down to 1411, baseline tightened to match.

Fixes #322
Reported by @jes-carr

Co-authored-by: DYNOSuprovo <DYNOSuprovo@users.noreply.github.com>
Signed-off-by: Avelino <31996+avelino@users.noreply.github.com>
@avelino
avelino merged commit 093d763 into main Sep 28, 2026
17 checks passed
@avelino
avelino deleted the pr-326-local branch September 28, 2026 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop: inline images always render as file chips, never as <img>

2 participants