Skip to content

Fix image_compare expand output bug - #10907

Merged
marthacryan merged 1 commit into
mainfrom
expand-image-compare
Sep 18, 2026
Merged

marthacryan merged 1 commit into
mainfrom
expand-image-compare

Conversation

@marthacryan

@marthacryan marthacryan commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10902. The "Expand Output" button wasn't doing anything for the output of the following code snippet:

import marimo as mo
import numpy as np

# image as numpy array (shown in example figures)
mo.image_compare(
    before_image= np.random.random((1000, 700)),
    after_image = np.random.random((1000, 700)),
    value=0,
    # direction="horizontal",
    direction="vertical",
)

It's unclear why the original line of code was written but I tested this change and it fixed the bug that was reported.

Copilot AI lite review requested due to automatic review settings September 18, 2026 20:40
@github-actions

Copy link
Copy Markdown
Contributor


Thank you for your submission, we really appreciate it. Like many open-source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution. You can sign the CLA by just posting a Pull Request Comment same as the below format.


I have read the CLA Document and I hereby sign the CLA


You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

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.

🟢 Approval recommended

The focused implementation directly addresses the reported bug and includes regression coverage.

Pull request overview

Fixes vertical image_compare outputs being fixed at 400px, allowing them to expand naturally.

Changes:

  • Uses auto height when no explicit height is provided.
  • Adds regression coverage for horizontal and vertical directions.
File summaries
File Description
ImageComparisonComponent.tsx Removes the vertical fixed-height default.
ImageComparisonComponent.test.tsx Tests automatic container sizing.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@cubic-dev-ai cubic-dev-ai Bot 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.

No issues found across 2 files

Re-trigger cubic

const containerStyle: React.CSSProperties = {
width: width || "100%",
height: height || (direction === "vertical" ? "400px" : "auto"),
height: height || "auto",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huh, yeah

@marthacryan
marthacryan merged commit 50e6860 into main Sep 18, 2026
28 of 31 checks passed
@marthacryan
marthacryan deleted the expand-image-compare branch September 18, 2026 20:45
@akshayka

Copy link
Copy Markdown
Contributor

@marthacryan , can you:

  1. Sign the CLA by responding in a comment with only the following text:

I have read the CLA Document and I hereby sign the CLA

  1. Add a PR label so the pull request labeling workflow passes?

@dmadisetti dmadisetti added the bug Something isn't working label Sep 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Report for ./frontend

Status Category Percentage Covered / Total
🔵 Lines 58.69% 22505 / 38343
🔵 Statements 58.62% 22901 / 39062
🔵 Functions 51.83% 5086 / 9812
🔵 Branches 52.42% 11924 / 22745
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
frontend/src/plugins/impl/image-comparison/ImageComparisonComponent.tsx 100% 94.44% 100% 100%
Generated in workflow #21608 for commit b03822e by the Vitest Coverage Report Action

@kelreeeeey

Copy link
Copy Markdown

Thankyou kings/queens!!! <3

This branch was successfully deployed

1 active deployment
Preview — b03822e0 Deployed Sep 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] marimo.image_compare direction='vertical'argument forces cell's output to be collapsed and can not be expanded

5 participants