Skip to content

Clicking a detail image opens it at modal default width, so large images can't be seen at full size #13252

Closed

Description

@jbc-af

Version: 1.5.8 (also present on current master)

Steps to reproduce (demo data):

  1. Open any part that has a large image (for example, upload a 1200×900 px image to a demo part).
  2. On the part's detail page, click the part image.

Expected: the image opens large enough to read detail, up to the window size.

Actual: the image opens in a modal at Mantine's default md width (about 440 px), so a high-resolution image is shown no larger than the small preview area.

Cause: DetailsImage.expandImage (src/frontend/src/components/details/DetailsImage.tsx) calls

modals.open({
  children: <ApiImage src={img} thumbnail={props.thumbnail} />,
  withCloseButton: false
});

with no size, so the modal takes Mantine's default width.

Suggestion: give the modal a size, e.g. size: 'auto' or size: '90vw', and fit the image inside the viewport (for example maw="100%" mah="85vh" fit="contain" on the image). This matters most for parts whose image is a drawing.

Happy to open a PR if that's useful.

Activity

  1. SchrodingersGat commented on Nov 12, 2026

    @SchrodingersGat
    Member

    @jbc-af can you please post a screenshot example?

  2. added
    question
    User Interface
    on Nov 12, 2026
  3. jbc-af commented on Nov 12, 2026

    @jbc-af
    ContributorAuthor

    InvenTree 1.5.8, browser window 1440×900. The part image is 1600×1200 px. Clicking it opens the modal at about 440 px wide, so the image is shown at about 25% of its size, no bigger than the preview on the page.
    b-image-modal-1440
    test-chart-1600x1200

  4. SchrodingersGat commented on Nov 12, 2026

    @SchrodingersGat
    Member

    @jbc-af thanks for the additional context. Would you like to submit a patch for this?

  5. jbc-af commented on Nov 12, 2026

    @jbc-af
    ContributorAuthor

    Yes, happy to submit a PR.

  6. added a commit that references this issue on Nov 14, 2026
    ed0bbc3
  7. added a commit that references this issue on Nov 14, 2026
    5079f96
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    User Interfacequestion

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions