Skip to content

fix(home): use homeImgComponent for about section SVGs#3930

Merged
PierreBrisorgueil merged 4 commits intomasterfrom
fix/home-about-use-img-component
Apr 10, 2026
Merged

fix(home): use homeImgComponent for about section SVGs#3930
PierreBrisorgueil merged 4 commits intomasterfrom
fix/home-about-use-img-component

Conversation

@PierreBrisorgueil
Copy link
Copy Markdown
Collaborator

@PierreBrisorgueil PierreBrisorgueil commented Apr 9, 2026

Summary

  • Replace raw <v-img> with homeImgComponent in home.about.component.vue so SVGs are inlined via v-html and can access Vuetify CSS custom properties
  • Fixes dark/light theme mismatch (SVGs now follow Vuetify toggle instead of OS prefers-color-scheme)
  • Respects imgMode config from content items (previously hardcoded to cover)

Closes #3929

Test plan

  • Verify about section renders SVG images inline (inspect DOM for v-html content)
  • Toggle dark/light theme — SVG colors should follow Vuetify theme
  • Verify raster images (webp/png) still render correctly via v-img fallback
  • Verify imgBackground wrapper still applies correctly with homeImgComponent

Summary by CodeRabbit

  • Refactor
    • Home section now uses a shared image component for consistent fit, SVG inlining, and theme-aware rendering across layouts.
  • Documentation
    • Migration note added explaining the image-rendering change, SVG behavior, img-mode defaults, and guidance for overridden home sections.
  • Tests
    • New unit tests for layout, image/video handling, SVG inlining, theme/resolution logic, and responsive column behavior.

Copilot AI review requested due to automatic review settings April 9, 2026 17:51
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 9, 2026

Warning

Rate limit exceeded

@PierreBrisorgueil has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 8 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 13 minutes and 8 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: f250098e-3a80-4dcd-942e-7a9f2f8c2634

📥 Commits

Reviewing files that changed from the base of the PR and between 4f4675d and 9d7f4bc.

📒 Files selected for processing (1)
  • src/modules/home/tests/home.about.component.unit.tests.js

Walkthrough

Replaces direct v-img usage in the About component with the shared homeImgComponent, forwards imgMode (defaults to 'contain' where applicable), updates MIGRATIONS.md, and adds Vitest unit tests covering image/background/video/layout behaviors.

Changes

Cohort / File(s) Summary
About component
src/modules/home/components/home.about.component.vue
Replaced v-img with homeImgComponent in both background-wrapped and plain image branches; forwarded :img and :img-mode (uses 'contain' default for background branch); added import and registration; removed previous class/cover/contain wiring.
Tests
src/modules/home/tests/home.about.component.unit.tests.js
New Vitest suite mounting the component with Vuetify test plugins and mocked globals; covers section rendering, grid sizing, raster vs inline-SVG behavior (including fetch stubbing), imgBackground resolution, resolveImgBackground unit tests, conditional VideoPlayer, and layout/variant/container styling assertions.
Migrations / Docs
MIGRATIONS.md
Updated migration entry date and text to document switch to homeImgComponent, note SVG inlining via v-html (theme-aware), imgMode behavior, and guidance for downstream overrides or manual updates.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

Fix

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: replacing v-img with homeImgComponent in the about section specifically for SVG handling.
Description check ✅ Passed The description covers the key aspects (what changed, why, related issue, test plan) and follows the template structure with Summary and Test plan sections provided.
Linked Issues check ✅ Passed The PR fully addresses issue #3929: replaces v-img with homeImgComponent in home.about.component.vue, enables SVG inlining via v-html for theme support, respects imgMode config, and fixes dark/light theme mismatch.
Out of Scope Changes check ✅ Passed All changes are directly related to the linked issue: component replacement in home.about.component.vue, migration documentation update, and unit tests for the modified component.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/home-about-use-img-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.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.46%. Comparing base (26af7df) to head (9d7f4bc).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3930   +/-   ##
=======================================
  Coverage   99.46%   99.46%           
=======================================
  Files          29       29           
  Lines         940      940           
  Branches      252      252           
=======================================
  Hits          935      935           
  Misses          5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the Home “About” content section to use the shared homeImgComponent so SVGs can be inlined (theme-aware via CSS vars) and image fit behavior can follow per-item imgMode.

Changes:

  • Replaced direct <v-img> usage in the About section with <homeImgComponent> for both background-wrapped and normal images.
  • Passed through imgMode (defaulting to 'contain' for the background-wrapped variant) while keeping the existing responsive height/alt logic.
  • Registered homeImgComponent in home.about.component.vue.

PierreBrisorgueil added a commit that referenced this pull request Apr 9, 2026
Missing migration entries for #3926 (OrgAvatar reusable component)
and #3930 (about section using homeImgComponent for SVG support).
PierreBrisorgueil added a commit that referenced this pull request Apr 9, 2026
* docs(migrations): add OrgAvatar and homeImgComponent entries

Missing migration entries for #3926 (OrgAvatar reusable component)
and #3930 (about section using homeImgComponent for SVG support).

* fix(docs): correct OrgAvatarComponent path, prop name, and description in MIGRATIONS.md
Copy link
Copy Markdown

@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: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@MIGRATIONS.md`:
- Around line 9-14: The migration note incorrectly documents the
homeImgComponent API and item field names; update the text to state that the
About section now uses <homeImgComponent :img="item.img"
:img-mode="item.imgMode" /> (or equivalent) and that item.img and item.imgMode
are the preserved fields (referencing home.about.component.vue and
home.img.component.vue), replacing all mentions of :item, item.image and
item.imgFit so downstream consumers copy the correct prop names.

In `@src/modules/home/tests/home.about.component.unit.tests.js`:
- Around line 43-48: Add a JSDoc header to the makeItem helper function:
document the overrides parameter with `@param` {Object} overrides (describe
optional override fields like subtitle, text, img) and document the return value
with `@returns` {Object} describing the constructed item object; place the JSDoc
immediately above the makeItem declaration so linting picks up the `@param` and
`@returns` annotations.
- Around line 59-62: The global fetch stub created in beforeEach via
vi.stubGlobal('fetch', vi.fn()) is never cleaned up; add an afterEach cleanup to
restore the global to avoid cross-test leakage by calling vi.unstubAllGlobals()
(or vi.unstubGlobal('fetch') if you prefer to target only fetch) in an afterEach
block in this test file so the stub is removed between tests.
- Around line 94-117: Add unit tests to cover the SVG-inline path for
HomeAboutComponent: mount HomeAboutComponent (using baseSetup) and assert that
items meant to render SVGs use the v-html path (find element/component rendering
raw HTML and assert its HTML contains an <svg ...> tag or expected SVG markup),
and add a test to verify theme-driven behavior by toggling the relevant setup
flag (e.g., an item property like imgBackground or theme flag in baseSetup) and
asserting the rendered SVG has the expected theme-dependent attribute/class (for
example a specific fill, class name, or CSS variable) rather than rendering as a
VImg; reference HomeAboutComponent, v-html, VImg, and imgBackground to locate
code paths to test.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 45880533-f161-430f-aede-bc21acf46b26

📥 Commits

Reviewing files that changed from the base of the PR and between f8252d1 and c3c1ae3.

📒 Files selected for processing (2)
  • MIGRATIONS.md
  • src/modules/home/tests/home.about.component.unit.tests.js

Replace raw v-img with homeImgComponent in the about section so SVGs
are inlined via v-html and can access Vuetify CSS custom properties.
This fixes dark/light theme mismatches and respects imgMode config.

Closes #3929
Cover rendering, imgBackground resolution, video rendering, reversed layout,
computed properties, fullWidth columns, and resolveImgBackground edge cases.
@PierreBrisorgueil PierreBrisorgueil force-pushed the fix/home-about-use-img-component branch from c3c1ae3 to 4f4675d Compare April 10, 2026 17:01
Copy link
Copy Markdown

@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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/modules/home/tests/home.about.component.unit.tests.js`:
- Around line 106-126: Add a unit test in the HomeAboutComponent tests that
verifies item.imgMode is forwarded to the child homeImgComponent: create a test
case that mounts HomeAboutComponent with a setup that includes an item having
imgMode set to a specific value, then use wrapper.findComponent({ name:
'homeImgComponent' }) (or findAllComponents and target the correct index) and
assert that the child's props('imgMode') equals the configured value; reference
existing helpers baseSetup and HomeAboutComponent to build the mount and reuse
globalOpts(vuetify) for consistency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 13016fa1-2275-421a-aa51-94155f9bf412

📥 Commits

Reviewing files that changed from the base of the PR and between c3c1ae3 and 4f4675d.

📒 Files selected for processing (3)
  • MIGRATIONS.md
  • src/modules/home/components/home.about.component.vue
  • src/modules/home/tests/home.about.component.unit.tests.js

@PierreBrisorgueil PierreBrisorgueil merged commit b9246dd into master Apr 10, 2026
6 checks passed
@PierreBrisorgueil PierreBrisorgueil deleted the fix/home-about-use-img-component branch April 10, 2026 18:28
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.

fix(home): about component should use homeImgComponent for SVGs

2 participants