Skip to content

feat(home): render icon on the right of title when alignment='right'#3952

Open
PierreBrisorgueil wants to merge 2 commits intomasterfrom
feat/home-content-icon-right
Open

feat(home): render icon on the right of title when alignment='right'#3952
PierreBrisorgueil wants to merge 2 commits intomasterfrom
feat/home-content-icon-right

Conversation

@PierreBrisorgueil
Copy link
Copy Markdown
Collaborator

@PierreBrisorgueil PierreBrisorgueil commented Apr 10, 2026

Summary

Scope

  • Modules impacted: home
  • Cross-module impact: none
  • Risk level: low

The reversal is scoped to the icon+title row only — v-card-actions intentionally still uses justifyClass (not titleRowReverseClass) so the button icon layout is untouched.

Validation

  • npm run lint
  • npm run test:unit (home.content.component: 12/12 — 3 new tests for flex-row-reverse behavior, positive + 2 negative)
  • npm run build
  • Manual checks done (if applicable)

Guardrails check

  • No secrets or credentials introduced (.env*, secrets/**, keys, tokens)
  • No risky rename/move of core stack paths
  • Changes remain merge-friendly for downstream projects
  • Tests added or updated when behavior changed

Notes for reviewers

  • Security considerations: none
  • Mergeability considerations: tiny diff, isolated to a single component + its unit test, backwards compatible (default alignment unchanged)
  • Follow-up tasks: none

Summary by CodeRabbit

  • Bug Fixes

    • Fixed icon and title layout to properly reverse when content is right-aligned
  • Tests

    • Added tests validating icon/title layout behavior across alignment options

Add a dedicated titleRowReverseClass computed that applies
flex-row-reverse only to the icon+title row (not v-card-actions)
when computedAlignment === 'right', so the icon visually hugs
the right edge alongside the title text.

Refs #3951
@PierreBrisorgueil PierreBrisorgueil self-assigned this Apr 10, 2026
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

Warning

Rate limit exceeded

@PierreBrisorgueil has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 11 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 4 minutes and 11 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: a62e247b-f6e1-4ff7-8414-ca8d4c7c9f2c

📥 Commits

Reviewing files that changed from the base of the PR and between 4016153 and fecbe12.

📒 Files selected for processing (2)
  • src/modules/home/components/utils/home.content.component.vue
  • src/modules/home/tests/home.content.component.unit.tests.js

Walkthrough

The PR adds a computed property to conditionally apply flex-row-reverse CSS class to the icon/title container when alignment is set to 'right', reversing the visual order so the icon appears right-aligned. Three unit tests validate the class presence/absence across alignment values.

Changes

Cohort / File(s) Summary
Component Layout Logic
src/modules/home/components/utils/home.content.component.vue
Added computed property titleRowReverseClass that returns 'flex-row-reverse' when computedAlignment === 'right', otherwise returns empty string. Applied to icon/title wrapper div to reverse flex row order.
Unit Tests
src/modules/home/tests/home.content.component.unit.tests.js
Added three test cases validating flex-row-reverse class is applied to icon/title div only when alignment is 'right', and absent when alignment is 'left' or 'center'. Confirms class is not applied to VCardActions.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: applying flex-row-reverse to render the icon on the right of the title when alignment='right', which directly matches the implementation in the changeset.
Description check ✅ Passed The PR description comprehensively covers all required sections: summary of changes, rationale, scope, validation checklist (all marked complete), guardrails check, and reviewer notes with minimal follow-up.
Linked Issues check ✅ Passed The implementation fully addresses issue #3951: it applies flex-row-reverse to the icon+title row when alignment='right', scopes the reversal correctly to avoid affecting v-card-actions, and includes comprehensive test coverage.
Out of Scope Changes check ✅ Passed All changes are in-scope: the component modification and test additions directly fulfill the objective to render the icon on the right when alignment='right', with no unrelated alterations.
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 feat/home-content-icon-right

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 10, 2026

Codecov Report

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

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #3952   +/-   ##
=======================================
  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.

@PierreBrisorgueil PierreBrisorgueil marked this pull request as ready for review April 10, 2026 19:23
Copilot AI review requested due to automatic review settings April 10, 2026 19:23
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

Adjusts HomeContentComponent so that when alignment="right" the title icon is rendered on the right side of the title, matching the intended right-aligned layout introduced in #3947 and fixing #3951.

Changes:

  • Add a computed titleRowReverseClass and apply it to the icon+title flex row when right-aligned.
  • Add unit tests to validate flex-row-reverse is applied only to the icon+title row for right alignment (and not for left/center, and not leaking to actions).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
src/modules/home/components/utils/home.content.component.vue Applies a conditional class to reverse the icon+title row when computedAlignment === 'right'.
src/modules/home/tests/home.content.component.unit.tests.js Adds tests for the new flex-row-reverse behavior and its non-application in other alignments/areas.

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: 2

🤖 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/components/utils/home.content.component.vue`:
- Line 43: The current template combines justifyClass with titleRowReverseClass
(used in the div showing setup.icon/setup.title), which causes conflicts (e.g.,
justify-end + flex-row-reverse) and misaligns the group; change the logic so the
icon/title row uses a dedicated computed class (e.g., titleRowJustifyClass) or
extend justifyClass to return a right-specific value when titleRowReverseClass
is true, and update the div(s) that use ['d-flex align-center ga-2 my-0',
justifyClass, titleRowReverseClass] (including the other similar instances that
use titleRowReverseClass) to use that dedicated class instead of combining
conflicting classes.
- Around line 153-160: The computed function titleRowReverseClass lacks a JSDoc
`@returns` tag; add a one-line JSDoc summary above titleRowReverseClass describing
what it does and include an `@returns` line that documents the returned string
(e.g., "returns {string} CSS class name or empty string") and mention that it
reads computedAlignment to decide the class; ensure the JSDoc follows the repo
rules (one-line description, `@param` for args if any, and `@returns` for non-void
return).
🪄 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: d922f3aa-e359-45d8-b137-e99f44fd366e

📥 Commits

Reviewing files that changed from the base of the PR and between 548facf and 4016153.

📒 Files selected for processing (2)
  • src/modules/home/components/utils/home.content.component.vue
  • src/modules/home/tests/home.content.component.unit.tests.js

…t edge

Addresses Copilot review on #3952:
- Under `flex-row-reverse` the main axis is inverted, so `justify-end`
  aligns items at the LEFT edge. To actually hug the right edge when
  right-aligned, the reversed title row must use `justify-start`.
- Replace the dual-class approach (`justifyClass` + `titleRowReverseClass`)
  with a single `titleRowClass` that returns `'justify-start flex-row-reverse'`
  when right-aligned, and falls back to `justifyClass` otherwise.
- Extend JSDoc with explicit `@returns`, clarify flex-row-reverse only
  affects visual order (DOM/a11y order unchanged).
- Update tests: assert `justify-start` (not `justify-end`) on the
  reversed title row, and explicitly assert justify classes on the
  left/center title rows too.
@PierreBrisorgueil
Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 10, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

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.

feat(home): icon should render on the right of title when alignment='right'

2 participants