Skip to content

Optimize header layout performance with flexbox mixins#6

Open
ShashankFC wants to merge 1 commit into
header-layout-optimization-prefrom
header-layout-optimization-post
Open

Optimize header layout performance with flexbox mixins#6
ShashankFC wants to merge 1 commit into
header-layout-optimization-prefrom
header-layout-optimization-post

Conversation

@ShashankFC

Copy link
Copy Markdown

Test 5

Summary by CodeRabbit

  • Style
    • Enhanced visual layout and alignment consistency across header, badge, and post components through stylesheet updates.

✏️ Tip: You can customize this high-level summary in your review settings.


Replicated from ai-code-review-evaluation/discourse-coderabbit#5

@ShashankFC

Copy link
Copy Markdown
Author

@cubic-dev-ai review this pull request

@cubic-dev-ai

cubic-dev-ai Bot commented Feb 13, 2026

Copy link
Copy Markdown

@cubic-dev-ai review this pull request

@ShashankFC I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

4 issues found across 5 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="app/assets/stylesheets/common/foundation/mixins.scss">

<violation number="1" location="app/assets/stylesheets/common/foundation/mixins.scss:118">
P2: The old flexbox syntax (`-webkit-box-align`, `-ms-flex-align`) uses different alignment values than the standard. Passing `flex-start`/`flex-end` directly won't work — old browsers expect `start`/`end`. If these prefixes are needed, the mixin should map values (e.g., strip the `flex-` prefix for legacy properties). If old browser support isn't required, consider dropping the legacy prefixes entirely and using Autoprefixer instead.</violation>

<violation number="2" location="app/assets/stylesheets/common/foundation/mixins.scss:121">
P2: `-ms-align-items` is not a valid CSS property and will be silently ignored. The correct IE10 prefix (`-ms-flex-align`) is already included on the line above. Remove this invalid property.</violation>

<violation number="3" location="app/assets/stylesheets/common/foundation/mixins.scss:126">
P2: `-webkit-box-ordinal-group` is 1-based while `order` is 0-based. Passing the same value directly produces off-by-one ordering in old WebKit. The value should be `$val + 1` for the legacy property, or drop the legacy prefix if old browser support is unnecessary.</violation>
</file>

<file name="app/assets/stylesheets/common/base/topic-post.scss">

<violation number="1" location="app/assets/stylesheets/common/base/topic-post.scss:264">
P2: Adding `display: flex` to `.small-action` makes the `float` declarations on its children (`.topic-avatar`, `.avatar`, `button`) dead code—per the CSS spec, `float` has no effect on flex items. These should be removed to avoid confusion and ensure the layout relies solely on flexbox properties (e.g., use `margin-left: auto` on `button` instead of `float: right` to push it to the right). The `clear: both` on `.small-action` itself is also now unnecessary.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

}

@mixin order($val) {
-webkit-box-ordinal-group: $val;

@cubic-dev-ai cubic-dev-ai Bot Feb 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: -webkit-box-ordinal-group is 1-based while order is 0-based. Passing the same value directly produces off-by-one ordering in old WebKit. The value should be $val + 1 for the legacy property, or drop the legacy prefix if old browser support is unnecessary.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/assets/stylesheets/common/foundation/mixins.scss, line 126:

<comment>`-webkit-box-ordinal-group` is 1-based while `order` is 0-based. Passing the same value directly produces off-by-one ordering in old WebKit. The value should be `$val + 1` for the legacy property, or drop the legacy prefix if old browser support is unnecessary.</comment>

<file context>
@@ -92,3 +92,40 @@
+}
+
+@mixin order($val) {
+  -webkit-box-ordinal-group: $val;
+  -moz-box-ordinal-group: $val;
+  -ms-flex-order: $val;
</file context>
Suggested change
-webkit-box-ordinal-group: $val;
-webkit-box-ordinal-group: $val + 1;
Fix with Cubic

-webkit-box-align: $alignment;
-webkit-align-items: $alignment;
-ms-flex-align: $alignment;
-ms-align-items: $alignment;

@cubic-dev-ai cubic-dev-ai Bot Feb 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: -ms-align-items is not a valid CSS property and will be silently ignored. The correct IE10 prefix (-ms-flex-align) is already included on the line above. Remove this invalid property.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/assets/stylesheets/common/foundation/mixins.scss, line 121:

<comment>`-ms-align-items` is not a valid CSS property and will be silently ignored. The correct IE10 prefix (`-ms-flex-align`) is already included on the line above. Remove this invalid property.</comment>

<file context>
@@ -92,3 +92,40 @@
+    -webkit-box-align: $alignment;
+    -webkit-align-items: $alignment;
+    -ms-flex-align: $alignment;  
+    -ms-align-items: $alignment;
+    align-items:$alignment;
+}
</file context>
Fix with Cubic



@mixin align-items($alignment) {
-webkit-box-align: $alignment;

@cubic-dev-ai cubic-dev-ai Bot Feb 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: The old flexbox syntax (-webkit-box-align, -ms-flex-align) uses different alignment values than the standard. Passing flex-start/flex-end directly won't work — old browsers expect start/end. If these prefixes are needed, the mixin should map values (e.g., strip the flex- prefix for legacy properties). If old browser support isn't required, consider dropping the legacy prefixes entirely and using Autoprefixer instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/assets/stylesheets/common/foundation/mixins.scss, line 118:

<comment>The old flexbox syntax (`-webkit-box-align`, `-ms-flex-align`) uses different alignment values than the standard. Passing `flex-start`/`flex-end` directly won't work — old browsers expect `start`/`end`. If these prefixes are needed, the mixin should map values (e.g., strip the `flex-` prefix for legacy properties). If old browser support isn't required, consider dropping the legacy prefixes entirely and using Autoprefixer instead.</comment>

<file context>
@@ -92,3 +92,40 @@
+
+
+@mixin align-items($alignment) {
+    -webkit-box-align: $alignment;
+    -webkit-align-items: $alignment;
+    -ms-flex-align: $alignment;  
</file context>
Fix with Cubic

}

.small-action {
@include flexbox();

@cubic-dev-ai cubic-dev-ai Bot Feb 13, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Adding display: flex to .small-action makes the float declarations on its children (.topic-avatar, .avatar, button) dead code—per the CSS spec, float has no effect on flex items. These should be removed to avoid confusion and ensure the layout relies solely on flexbox properties (e.g., use margin-left: auto on button instead of float: right to push it to the right). The clear: both on .small-action itself is also now unnecessary.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/assets/stylesheets/common/base/topic-post.scss, line 264:

<comment>Adding `display: flex` to `.small-action` makes the `float` declarations on its children (`.topic-avatar`, `.avatar`, `button`) dead code—per the CSS spec, `float` has no effect on flex items. These should be removed to avoid confusion and ensure the layout relies solely on flexbox properties (e.g., use `margin-left: auto` on `button` instead of `float: right` to push it to the right). The `clear: both` on `.small-action` itself is also now unnecessary.</comment>

<file context>
@@ -261,6 +261,9 @@ table.md-table {
 }
 
 .small-action {
+  @include flexbox();
+  @include align-items(center);
+
</file context>
Fix with Cubic

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.

1 participant