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

Fixup image caption overlap on mobile #765

Merged
merged 3 commits into from
Oct 18, 2023
Merged

Conversation

nixterrimus
Copy link
Contributor

@nixterrimus nixterrimus commented Oct 16, 2023

Summary:

Fixes image caption overlapping on mobile and re-centers text and image so that it matches previous behavior.

After the fix:
Screenshot 2023-10-15 at 7 28 13 PM

Issue: https://khanacademy.atlassian.net/browse/LC-1351

Test plan:

This can be test a little bit in storybook:

  • Go to the image caption
  • Try it with both the user agent set to desktop and a mobile browser
  • Things should look ok

However to really test this, it needs a ZND. After deploying a ZND check out

  • /science/ms-biology/x0c5bb03129646fd6:organism-growth-and-reproduction/x0c5bb03129646fd6:sexual-and-asexual-reproduction/a/sexual-and-asexual-reproduction

@nixterrimus nixterrimus self-assigned this Oct 16, 2023
@khan-actions-bot khan-actions-bot requested a review from a team October 16, 2023 01:31
@khan-actions-bot
Copy link
Contributor

khan-actions-bot commented Oct 16, 2023

Gerald

Required Reviewers
  • @Khan/perseus for changes to .changeset/new-ants-decide.md, packages/perseus/src/widgets/image.tsx, packages/perseus/src/styles/widgets/image.less, packages/perseus/src/widgets/__stories__/image.stories.tsx, packages/perseus/src/widgets/__tests__/__snapshots__/group.test.tsx.snap, packages/perseus/src/widgets/__tests__/__snapshots__/image.test.ts.snap

Don't want to be involved in this pull request? Comment #removeme and we won't notify you of further changes.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

Size Change: +10 B (0%)

Total Size: 852 kB

Filename Size Change
packages/perseus/dist/es/index.js 398 kB +10 B (0%)
ℹ️ View Unchanged
Filename Size
packages/kas/dist/es/index.js 38.1 kB
packages/kmath/dist/es/index.js 4.25 kB
packages/math-input/dist/es/index.js 105 kB
packages/perseus-core/dist/es/index.js 905 B
packages/perseus-editor/dist/es/index.js 268 kB
packages/perseus-error/dist/es/index.js 847 B
packages/perseus-linter/dist/es/index.js 21.4 kB
packages/pure-markdown/dist/es/index.js 3.77 kB
packages/simple-markdown/dist/es/index.js 12.3 kB

compressed-size-action

@github-actions
Copy link
Contributor

github-actions bot commented Oct 16, 2023

npm Snapshot: Published

🎉 Good news!! We've packaged up the latest commit from this PR (4ad5bd9) and published it to npm. You
can install it using the tag PR765.

Example:

yarn add @khanacademy/perseus@PR765

Copy link
Collaborator

@jeremywiebe jeremywiebe left a comment

Choose a reason for hiding this comment

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

One question about image width, but otherwise, this looks good! Thanks for fixing.

<figure
className="perseus-image-widget"
style={{
maxWidth: backgroundImage.width,
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: Are we guaranteed to always have a width?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes background image will always have a width, as far as I know

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #765 (4ad5bd9) into main (a18ef7e) will decrease coverage by 4.28%.
Report is 417 commits behind head on main.
The diff coverage is 60.13%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #765      +/-   ##
==========================================
- Coverage   65.50%   61.22%   -4.28%     
==========================================
  Files         481      499      +18     
  Lines      103961   109231    +5270     
  Branches     5620     8853    +3233     
==========================================
- Hits        68095    66875    -1220     
- Misses      35866    42356    +6490     
Files Coverage Δ
packages/kas/src/compare.js 94.28% <100.00%> (+1.42%) ⬆️
packages/kas/src/index.js 100.00% <100.00%> (ø)
packages/kas/src/nodes.js 94.67% <ø> (-0.99%) ⬇️
packages/kmath/src/index.ts 100.00% <100.00%> (ø)
packages/kmath/src/line.ts 100.00% <100.00%> (ø)
packages/kmath/src/number.ts 100.00% <100.00%> (ø)
packages/math-input/src/components/common-style.ts 100.00% <100.00%> (ø)
...math-input/src/components/input/cursor-contexts.ts 100.00% <100.00%> (ø)
...ges/math-input/src/components/input/math-input.tsx 54.75% <ø> (ø)
...es/math-input/src/components/input/math-wrapper.ts 77.55% <ø> (ø)
... and 111 more

... and 759 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6751a68...4ad5bd9. Read the comment docs.

@nixterrimus nixterrimus merged commit 6dbc58c into main Oct 18, 2023
10 of 11 checks passed
@nixterrimus nixterrimus deleted the new/image-fixup-iii branch October 18, 2023 18:37
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