Skip to content

Conversation

@YarosMallorca
Copy link
Contributor

@YarosMallorca YarosMallorca commented Oct 20, 2025

Made the rows of sliders in Adjustments tab responsive and adaptive to mobile.

image

Summary by CodeRabbit

  • Style
    • Optimized mobile layout for the Adjustments section into card-like, stacked rows with improved spacing, borders and typography.
    • Improved overflow behavior and responsive rules across breakpoints for smoother mobile scrolling.
    • Added visible per-field labels and reorganized controls for clearer, more readable mobile forms.
  • New Features
    • Mobile view now includes localized/explicit labels for adjustment fields.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 20, 2025

Walkthrough

Converted the adjustments UI for small screens into a card-like, stacked layout and added mobile-specific labels via CSS and data-label attributes; desktop styles remain unchanged.

Changes

Cohort / File(s) Summary
Mobile adjustments CSS
src/css/tabs/adjustments.less
Changed .tab-adjustments .overflow from auto to visible; removed .range min-width for small screens; added a 575px media query that hides thead, displays tbody/tr as blocks, and restyles each .adjustment into full-width card blocks with subsections (.info, .channelInfo, .range, .functionSelection, .functionSwitchChannel), per-cell ::before labels via data-label, nested flex layouts, padding, borders, and typographic/control adjustments. Desktop styling left intact.
Adjustment element creation (JS)
src/js/tabs/adjustments.js
When creating a new adjustment, set data-label attributes on elements (.info, .channelInfo, .range, .functionSelection, .functionSwitchChannel) to provide localized labels for the collapsed/mobile card view. No other logic changes.

Sequence Diagram(s)

sequenceDiagram
  participant User as User/UI
  participant JS as adjustments.js
  participant DOM as Browser DOM
  Note right of JS: Creating a new adjustment entry
  User->>JS: trigger add adjustment
  JS->>DOM: create row elements (info, channelInfo, range, ...)
  JS->>DOM: setAttribute(data-label) on each element
  DOM-->>User: rendered card-like adjustment with CSS ::before labels
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • haslinghuis
  • nerdCopter

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
Title Check ✅ Passed The pull request title "Responsive layout in Adjustments tab" is concise, clear, and directly aligned with the main changes in the changeset. The CSS and JavaScript modifications collectively implement responsive and mobile-adaptive layouts for the Adjustments tab, which is precisely what the title conveys. The title is specific enough that a teammate scanning the project history would immediately understand the primary change without ambiguity.
Description Check ✅ Passed The pull request description provides a concise explanation of the change ("Made the rows of sliders in Adjustments tab responsive and adaptive to mobile") and includes a visual screenshot demonstrating the result. While the description is minimal and does not explicitly reference issue numbers or mention testing procedures outlined in the template guidelines, the template appears to function primarily as a set of best practices and checklist items rather than a strict structural template with required sections. The essential information about what was changed and why (mobile responsiveness) is clearly communicated with supporting visual evidence.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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
Contributor

@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

🧹 Nitpick comments (2)
src/css/tabs/adjustments.less (2)

107-109: Remove redundant background-color rule.

The &:nth-child(odd) selector at lines 107-109 applies the same background-color: var(--surface-200) as the parent .adjustment rule at line 100, making it redundant.

         &:nth-child(odd) {
-            background-color: var(--surface-200);
         }

84-245: Consider accessibility implications of pseudo-element labels.

The mobile layout uses CSS ::before pseudo-elements to display labels via attr(data-label). While this improves visual readability, screen readers typically cannot access pseudo-element content, so users with assistive technologies may not see the label associations with form controls. Consider complementing this approach with semantic HTML (e.g., <label> elements) or ARIA attributes to ensure equal accessibility across all users.

Would you like me to suggest an accessible labeling pattern that works alongside or replaces the pseudo-element approach?

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b7805d7 and 8102655.

📒 Files selected for processing (1)
  • src/css/tabs/adjustments.less (1 hunks)

@YarosMallorca YarosMallorca marked this pull request as draft October 20, 2025 20:35
@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

@YarosMallorca YarosMallorca marked this pull request as ready for review October 24, 2025 11:42
Copy link
Contributor

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

🧹 Nitpick comments (2)
src/js/tabs/adjustments.js (1)

42-51: LGTM! Data-label attributes properly set for mobile responsive layout.

The implementation correctly sets localized data-label attributes on the cloned adjustment elements, which the CSS will use via attr(data-label) in ::before pseudo-elements for mobile labels. The placement after ID/index assignment is appropriate.

For minor optimization, you could cache the newAdjustment jQuery object or chain multiple .find().attr() calls, though the current implementation prioritizes readability:

// Optional: slightly more efficient
const $adjustment = $(newAdjustment);
$adjustment.find(".info").attr("data-label", i18n.getMessage("adjustmentsColumnEnable"));
$adjustment.find(".channelInfo").attr("data-label", i18n.getMessage("adjustmentsColumnWhenChannel"));
// ... etc
src/css/tabs/adjustments.less (1)

206-224: LGTM! Function sections properly styled for mobile.

Both .functionSelection and .functionSwitchChannel sections are appropriately styled with full-width selects and touch-friendly padding.

For minor DRY improvement, you could combine the duplicate select styling:

.functionSelection,
.functionSwitchChannel {
    select {
        width: 100%;
        padding: 0.5rem;
        border: 1px solid var(--surface-500);
        border-radius: 3px;
        box-sizing: border-box;
    }
}
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8102655 and c130f36.

📒 Files selected for processing (2)
  • src/css/tabs/adjustments.less (1 hunks)
  • src/js/tabs/adjustments.js (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/js/tabs/adjustments.js (1)
src/js/localization.js (1)
  • i18n (7-7)
🔇 Additional comments (5)
src/css/tabs/adjustments.less (5)

84-88: LGTM! Overflow change appropriate for mobile card layout.

Changing overflow to visible is correct for the stacked card-based mobile layout, allowing cards to flow naturally without horizontal scrollbars.


90-96: LGTM! Standard responsive table transformation.

Hiding the thead and making tbody block-level is the correct approach for converting the table to a stacked card layout on mobile, where each cell will display its own label via data-label attributes.


98-127: LGTM! Card layout and label display properly implemented.

The card-based layout transformation is well-executed:

  • Each .adjustment becomes a standalone card with appropriate spacing and styling
  • Generic td::before pseudo-elements correctly display data-label attributes as block-level labels above content
  • The structure supports the responsive mobile experience

128-154: LGTM! Appropriate special treatment for the enable section.

The .info section correctly receives different styling from other cells:

  • Inline label display (lines 139-146) instead of block, allowing horizontal layout
  • Flex row layout groups the "Enable" label with the checkbox for better UX
  • Background color differentiation provides visual separation

This intentional override of the generic td::before styling is appropriate for the enable toggle's different interaction pattern.


156-204: LGTM! Channel info and range sections properly adapted for mobile.

The styling effectively handles the more complex elements:

  • .channelInfo section properly stacks the select dropdown and positions limit labels with flexbox (lines 169-188)
  • .range section adjusts slider margins and marker positioning (line 202) to accommodate the mobile card layout
  • Form controls are sized appropriately with full width and proper touch targets

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.

2 participants