Skip to content

feat(components): support contain image variant for child pages#1889

Merged
seaerchin merged 7 commits intomainfrom
chin/isom-2179-support-contain-image-variant-for-profile-pages-use-case
Mar 19, 2026
Merged

feat(components): support contain image variant for child pages#1889
seaerchin merged 7 commits intomainfrom
chin/isom-2179-support-contain-image-variant-for-profile-pages-use-case

Conversation

@seaerchin
Copy link
Copy Markdown
Contributor

@seaerchin seaerchin commented Mar 17, 2026

Problem

Closes ISOM-2179

Child pages block previously did not support the "contain" image fit variant, which is needed for profile pages use case where images may have white backgrounds and need to fit within their container rather than being cropped.

Solution

Breaking Changes

  • Yes - this PR contains breaking changes
  • No - this PR is backwards compatible

Features:

  • Added imageFit property to ChildrenPages schema with options: "cover" (default) and "contain"
  • Created reusable ImageFitSchema in ~/schemas/internal for consistent image fit options across components
  • Added IMAGE_FIT constant in ~/interfaces/constants for type-safe image fit values

Improvements:

  • Added isFallback prop to InfoCards to style fallback images differently (centered and contained)

Before & After Screenshots

boxes variant w contain
image
boxes variant w cover
image

rows variant w contain
image
rows variant w cover
image

Tests

  • Added Storybook stories for RowsWithContainAndThumbnail and BoxesWithContainAndThumbnail in ChildrenPages
  • Added IndexPage stories for RowsWithContainAndImageAndDescription and BoxesWithContainAndImageAndDescription

@seaerchin seaerchin requested a review from a team as a code owner March 17, 2026 04:35
@linear
Copy link
Copy Markdown

linear bot commented Mar 17, 2026

@seaerchin seaerchin changed the base branch from main to chin/isom-2183-update-child-pages-block-to-look-like-cards March 17, 2026 04:36
@seaerchin seaerchin requested a review from sehyunidaaa March 17, 2026 04:39
@@ -121,7 +133,6 @@ const createRowStyles = tv({
},
hasFallbackImage: {
true: { image: "h-auto w-2/3 object-contain" },
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.

question: would this object-contain conflict with the imageFit if cover was selected?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

oddly enough, no. attaching a vid so you can see what it looks like

Screen.Recording.2026-03-18.at.11.13.51.mov

Copy link
Copy Markdown
Contributor

@sehyunidaaa sehyunidaaa left a comment

Choose a reason for hiding this comment

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

@seaerchin thanks!

  • This story is crashing, can't review child page editing for selecting contain/fit and column number
  • Are we changing the default columns to 2? (we discussed yesterday that all sites are either using the rows or 2-column boxes. if we shift default to 3, it will be jarring to all these sites)
  • Didn't review template here - reviewing template side changes in the other Chromatic, hope that's okay

@seaerchin
Copy link
Copy Markdown
Contributor Author

@seaerchin thanks!

  • This story is crashing, can't review child page editing for selecting contain/fit and column number
  • Are we changing the default columns to 2? (we discussed yesterday that all sites are either using the rows or 2-column boxes. if we shift default to 3, it will be jarring to all these sites)
  • Didn't review template here - reviewing template side changes in the other Chromatic, hope that's okay
  • fixed the story, it had a missing handler oddly
  • updated default cols to 2 (i missed a change sorry)

@seaerchin seaerchin requested review from a team, dcshzj and sehyunidaaa March 18, 2026 03:16
@seaerchin seaerchin force-pushed the chin/isom-2179-support-contain-image-variant-for-profile-pages-use-case branch from 994ef39 to baf9b0c Compare March 18, 2026 11:01
Copy link
Copy Markdown
Contributor Author

seaerchin commented Mar 19, 2026

@seaerchin seaerchin force-pushed the chin/isom-2179-support-contain-image-variant-for-profile-pages-use-case branch 2 times, most recently from 2191573 to ba7bb7d Compare March 19, 2026 05:47
@seaerchin seaerchin changed the base branch from chin/isom-2183-update-child-pages-block-to-look-like-cards to graphite-base/1889 March 19, 2026 05:56
@seaerchin seaerchin force-pushed the graphite-base/1889 branch from 5377e8c to 56229e2 Compare March 19, 2026 05:56
@seaerchin seaerchin force-pushed the chin/isom-2179-support-contain-image-variant-for-profile-pages-use-case branch from ba7bb7d to f8e8825 Compare March 19, 2026 05:56
@graphite-app graphite-app bot changed the base branch from graphite-base/1889 to main March 19, 2026 05:57
@seaerchin seaerchin force-pushed the chin/isom-2179-support-contain-image-variant-for-profile-pages-use-case branch from f8e8825 to b1aaa9f Compare March 19, 2026 05:57
@seaerchin seaerchin merged commit 3e003a3 into main Mar 19, 2026
18 of 22 checks passed
Copy link
Copy Markdown
Contributor Author

Merge activity

@seaerchin seaerchin deleted the chin/isom-2179-support-contain-image-variant-for-profile-pages-use-case branch March 19, 2026 06:12
seaerchin added a commit that referenced this pull request Mar 19, 2026
## Problem

Closes ISOM-2179

Child pages block previously did not support the "contain" image fit variant, which is needed for profile pages use case where images may have white backgrounds and need to fit within their container rather than being cropped.

## Solution

**Breaking Changes**

- [ ] Yes - this PR contains breaking changes
- [x] No - this PR is backwards compatible

**Features**:

- Added `imageFit` property to ChildrenPages schema with options: "cover" (default) and "contain"
- Created reusable `ImageFitSchema` in `~/schemas/internal` for consistent image fit options across components
- Added `IMAGE_FIT` constant in `~/interfaces/constants` for type-safe image fit values

**Improvements**:
- Added `isFallback` prop to InfoCards to style fallback images differently (centered and contained)

## Before & After Screenshots
**boxes variant w contain**
<img width="1162" height="523" alt="image" src="https://github.com/user-attachments/assets/3c473857-6dc1-45af-83be-49bc26bc9aac" />
**boxes variant w cover**
<img width="1161" height="524" alt="image" src="https://github.com/user-attachments/assets/a4075707-4aaf-4934-a141-cb0d8cef3e68" />

**rows variant w contain**
<img width="1165" height="203" alt="image" src="https://github.com/user-attachments/assets/752953c7-73d6-4489-83b1-3701ec440bbd" />
**rows variant w cover**
<img width="1163" height="225" alt="image" src="https://github.com/user-attachments/assets/700568df-b461-45ce-855a-567dd6a02102" />



## Tests

- Added Storybook stories for `RowsWithContainAndThumbnail` and `BoxesWithContainAndThumbnail` in ChildrenPages
- Added IndexPage stories for `RowsWithContainAndImageAndDescription` and `BoxesWithContainAndImageAndDescription`
seaerchin added a commit that referenced this pull request Mar 19, 2026
## Problem

Closes ISOM-2179

Child pages block previously did not support the "contain" image fit variant, which is needed for profile pages use case where images may have white backgrounds and need to fit within their container rather than being cropped.

## Solution

**Breaking Changes**

- [ ] Yes - this PR contains breaking changes
- [x] No - this PR is backwards compatible

**Features**:

- Added `imageFit` property to ChildrenPages schema with options: "cover" (default) and "contain"
- Created reusable `ImageFitSchema` in `~/schemas/internal` for consistent image fit options across components
- Added `IMAGE_FIT` constant in `~/interfaces/constants` for type-safe image fit values

**Improvements**:
- Added `isFallback` prop to InfoCards to style fallback images differently (centered and contained)

## Before & After Screenshots
**boxes variant w contain**
<img width="1162" height="523" alt="image" src="https://github.com/user-attachments/assets/3c473857-6dc1-45af-83be-49bc26bc9aac" />
**boxes variant w cover**
<img width="1161" height="524" alt="image" src="https://github.com/user-attachments/assets/a4075707-4aaf-4934-a141-cb0d8cef3e68" />

**rows variant w contain**
<img width="1165" height="203" alt="image" src="https://github.com/user-attachments/assets/752953c7-73d6-4489-83b1-3701ec440bbd" />
**rows variant w cover**
<img width="1163" height="225" alt="image" src="https://github.com/user-attachments/assets/700568df-b461-45ce-855a-567dd6a02102" />



## Tests

- Added Storybook stories for `RowsWithContainAndThumbnail` and `BoxesWithContainAndThumbnail` in ChildrenPages
- Added IndexPage stories for `RowsWithContainAndImageAndDescription` and `BoxesWithContainAndImageAndDescription`
seaerchin added a commit that referenced this pull request Mar 19, 2026
seaerchin added a commit that referenced this pull request Mar 19, 2026
* Revert "refactor: update RowLayout styling to match InfoCards design (#1891)"

This reverts commit 30209a1.

* Revert "feat(components): support contain image variant for child pages (#1889)"

This reverts commit 3e003a3.

* Revert "refactor: centralize isExternalUrl check into ImageClient (#1865)"

This reverts commit 56229e2.
seaerchin added a commit that referenced this pull request Mar 19, 2026
## Problem

Closes ISOM-2179

Child pages block previously did not support the "contain" image fit variant, which is needed for profile pages use case where images may have white backgrounds and need to fit within their container rather than being cropped.

## Solution

**Breaking Changes**

- [ ] Yes - this PR contains breaking changes
- [x] No - this PR is backwards compatible

**Features**:

- Added `imageFit` property to ChildrenPages schema with options: "cover" (default) and "contain"
- Created reusable `ImageFitSchema` in `~/schemas/internal` for consistent image fit options across components
- Added `IMAGE_FIT` constant in `~/interfaces/constants` for type-safe image fit values

**Improvements**:
- Added `isFallback` prop to InfoCards to style fallback images differently (centered and contained)

## Before & After Screenshots
**boxes variant w contain**
<img width="1162" height="523" alt="image" src="https://github.com/user-attachments/assets/3c473857-6dc1-45af-83be-49bc26bc9aac" />
**boxes variant w cover**
<img width="1161" height="524" alt="image" src="https://github.com/user-attachments/assets/a4075707-4aaf-4934-a141-cb0d8cef3e68" />

**rows variant w contain**
<img width="1165" height="203" alt="image" src="https://github.com/user-attachments/assets/752953c7-73d6-4489-83b1-3701ec440bbd" />
**rows variant w cover**
<img width="1163" height="225" alt="image" src="https://github.com/user-attachments/assets/700568df-b461-45ce-855a-567dd6a02102" />



## Tests

- Added Storybook stories for `RowsWithContainAndThumbnail` and `BoxesWithContainAndThumbnail` in ChildrenPages
- Added IndexPage stories for `RowsWithContainAndImageAndDescription` and `BoxesWithContainAndImageAndDescription`
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.

3 participants