Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow height and width configuration in image panels #427

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

gordlin
Copy link
Member

@gordlin gordlin commented Nov 20, 2024

Related Item(s)

#392

Changes

  • [FEATURE] Add height and width fields to images in the image editor, to allow for user modification
  • Add warning about maximum allowed widths

Notes

  • New fields:
image
  • Images try to keep their original aspect ratio, so you may not get the exact height and width you input.

Testing

Steps:

  1. Go to any product (e.g. 00000000-0000-0000-0000-000000000000)
  2. Go to any image panel. If necessary, add an image.
  3. See the new height and width fields.
    • Blank fields will make the image take up the max width according to screen size (2/3 of screen on desktop, 100% on mobile).
    • Entering a value larger than the max width will have no effect.
    • Valid values will correctly resize the image in the preview.
    • Try entering various values to test.

This change is Reviewable

@gordlin gordlin added the PR: Frontend PR that primarily involves frontend changes. UI experts and CSS Wizards are asked to review. label Nov 20, 2024
Copy link

Your demo site is ready! 🚀 Visit it here: https://ramp4-pcar4.github.io/storylines-editor/image-size

Copy link
Member

@RyanCoulsonCA RyanCoulsonCA left a comment

Choose a reason for hiding this comment

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

Works well functionally, but I think we should look in to a different way of displaying the maximum width warning as it can get a bit messy when there's more than one image:

image copy 1.png

Maybe a small information icon that displays the message when clicked like the map config editor?
image.png

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gordlin)

Copy link
Member Author

@gordlin gordlin left a comment

Choose a reason for hiding this comment

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

Donethanks!

image.png

Reviewable status: 0 of 2 files reviewed, all discussions resolved (waiting on @RyanCoulsonCA)

Copy link
Member

@RyanCoulsonCA RyanCoulsonCA left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gordlin)

Copy link
Member

@IshavSohal IshavSohal left a comment

Choose a reason for hiding this comment

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

Looks great, just make sure to rebase with main

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gordlin)

Copy link
Member Author

@gordlin gordlin left a comment

Choose a reason for hiding this comment

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

Donethanks!

Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @IshavSohal and @RyanCoulsonCA)

Copy link
Member

@szczz szczz left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @gordlin)

@yileifeng yileifeng merged commit 151ed37 into ramp4-pcar4:main Dec 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Frontend PR that primarily involves frontend changes. UI experts and CSS Wizards are asked to review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants