Skip to content

Conversation

@YarosMallorca
Copy link
Contributor

@YarosMallorca YarosMallorca commented Oct 23, 2025

PresetTitlePanel call from presets.js was missing the onLoadedCallback parameter, causing favoritePresets to be undefined and the star icon to not work.

Additionally, I added cursor: pointer to the star element so the cursor is a pointer even in the details menu.

Summary by CodeRabbit

  • Style
    • Star element now displays a pointer cursor on hover.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 23, 2025

Walkthrough

A CSS style addition to display a pointer cursor on star elements and a PresetTitlePanel constructor call update to include an additional null parameter in the presets module.

Changes

Cohort / File(s) Change Summary
PresetTitlePanel styling and constructor
src/tabs/presets/TitlePanel/PresetTitlePanel.css, src/tabs/presets/presets.js
Added cursor: pointer CSS rule to .preset_title_panel_star. Updated PresetTitlePanel constructor invocation to pass an additional null parameter before the existing favoritePresets argument.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

The changes are straightforward: a single CSS property addition and a constructor parameter insertion. However, verification is needed to confirm the new parameter is properly handled by the PresetTitlePanel constructor definition and that its purpose aligns with the null value being passed.

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 "Fix star (favorite) button not working in preset card" is clear, specific, and directly related to the main change in the PR. The title accurately captures the primary fix—addressing the non-functional star button in preset cards caused by the missing onLoadedCallback parameter. The title is concise at 9 words, avoids vague terminology, and would be meaningful to teammates reviewing the repository history. While the PR also includes a secondary CSS addition (cursor: pointer), the title appropriately focuses on the primary functional fix.
Description Check ✅ Passed The pull request description clearly explains the bug (missing onLoadedCallback parameter causing favoritePresets to be undefined) and the resulting impact (star icon not working), as well as the secondary improvement (adding cursor: pointer CSS). The description is concise and directly addresses both changes in the PR. However, the description does not include a reference to the related issue (e.g., "Fixes #4678"), which the repository template recommends for PRs that fix open issues. Despite this minor omission, the core content—explaining what was changed and why—is present and adequate.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent 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 2df01e5.

📒 Files selected for processing (2)
  • src/tabs/presets/TitlePanel/PresetTitlePanel.css (1 hunks)
  • src/tabs/presets/presets.js (1 hunks)
🔇 Additional comments (2)
src/tabs/presets/TitlePanel/PresetTitlePanel.css (1)

36-36: Good UX improvement.

Adding cursor: pointer appropriately indicates that the star element is interactive, improving user experience and aligning with the clickability fix in the JavaScript code.

src/tabs/presets/presets.js (1)

582-594: Correct parameter alignment fix.

The addition of the null parameter properly aligns the constructor arguments, ensuring that favoritePresets is passed to the correct parameter position. This fixes the bug where the star/favorite functionality was broken due to favoritePresets being undefined.


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.

@sonarqubecloud
Copy link

@github-actions
Copy link
Contributor

@haslinghuis haslinghuis merged commit 0cd3c4d into betaflight:master Oct 24, 2025
7 checks passed
@github-project-automation github-project-automation bot moved this from Bugfix to Done in 2025.12.0 Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants