Skip to content

chore(markdown): add a private helper class to reset hardcoded height on img tags#3712

Merged
Kiarokh merged 1 commit intomainfrom
reset-img-height
Oct 28, 2025
Merged

chore(markdown): add a private helper class to reset hardcoded height on img tags#3712
Kiarokh merged 1 commit intomainfrom
reset-img-height

Conversation

@Kiarokh
Copy link
Contributor

@Kiarokh Kiarokh commented Oct 28, 2025

fix https://github.com/Lundalogik/crm-client/issues/409
fix https://github.com/Lundalogik/limepkg-email/issues/1745

Summary by CodeRabbit

  • Bug Fixes
    • Fixed an issue where images in markdown content retained fixed heights from source documents (such as Word documents or emails), preventing proper display scaling. Images now automatically adjust to appropriate heights based on the content width and layout requirements.

Review:

  • Commits are atomic
  • Commits have the correct type for the changes made
  • Commits with breaking changes are marked as such

Browsers tested:

(Check any that applies, it's ok to leave boxes unchecked if testing something didn't seem relevant.)

Windows:

  • Chrome
  • Edge
  • Firefox

Linux:

  • Chrome
  • Firefox

macOS:

  • Chrome
  • Firefox
  • Safari

Mobile:

  • Chrome on Android
  • iOS

@coderabbitai
Copy link

coderabbitai bot commented Oct 28, 2025

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

📝 Walkthrough

Walkthrough

A CSS host rule is added to the Markdown component stylesheet that resets image heights to auto within the internal markdown container, addressing cases where content may include fixed heights from external sources like Word documents or emails.

Changes

Cohort / File(s) Summary
Markdown stylesheet update
src/components/markdown/markdown.scss
Adds internal limel-markdown.reset-img-height CSS host rule that sets img height: auto for the #markdown container

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • jgroth
  • hannahu

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "chore(markdown): add a private helper class to reset hardcoded height on img tags" directly and accurately describes the main change in the changeset. The PR adds an internal CSS host rule that resets image heights to auto, which is exactly what the title conveys. The title is concise, specific, and uses appropriate terminology that aligns with the actual implementation (a private/internal CSS helper targeting the markdown component). A developer scanning the history would immediately understand that this change addresses hardcoded image height issues in the markdown component.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c5d8790 and aa7c84f.

📒 Files selected for processing (1)
  • src/components/markdown/markdown.scss (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
src/components/**/*.scss

📄 CodeRabbit inference engine (.cursor/rules/css-class-names-in-components-using-shadow-dom.mdc)

Do not use BEM-style class names in CSS for components, as components use shadow-DOM.

Files:

  • src/components/markdown/markdown.scss
**/*.{tsx,scss}

⚙️ CodeRabbit configuration file

**/*.{tsx,scss}: Almost all our components use shadow-DOM. Therefore, we have no need of BEM-style class names in our CSS.

Files:

  • src/components/markdown/markdown.scss
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: Docs / Publish Docs
  • GitHub Check: Test
  • GitHub Check: Build
🔇 Additional comments (1)
src/components/markdown/markdown.scss (1)

37-47: Well-implemented helper class using proper shadow-DOM selectors.

The implementation correctly uses the :host() functional pseudo-class to scope the rule to the component instance when the reset-img-height class is applied. This approach aligns with shadow-DOM best practices and the coding guideline to avoid BEM-style class names. The rule is appropriately documented as internal-only, and the targeted reset of image heights to auto is a minimal, non-invasive change that addresses the documented issue with fixed-height images from external sources (Word, emails).

@Kiarokh Kiarokh enabled auto-merge (rebase) October 28, 2025 14:00
@Kiarokh Kiarokh merged commit 0ab03df into main Oct 28, 2025
12 checks passed
@Kiarokh Kiarokh deleted the reset-img-height branch October 28, 2025 14:10
@lime-opensource
Copy link
Collaborator

🎉 This PR is included in version 38.29.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants