-
-
Notifications
You must be signed in to change notification settings - Fork 156
Show spin buttons into number input fields of users settings dialog #848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThe CSS for the user settings dialog was updated to explicitly style the inner and outer spin buttons of number input fields. The changes enforce default browser appearance, full opacity, and automatic sizing to ensure the spin buttons are visible and rendered consistently across browsers. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
@coderabbitai |
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainI'll help you investigate why the spin buttons aren't showing on number input fields in the user settings dialog. Let me examine the codebase to identify the issue. 🏁 Script executed:
Length of output: 19631 Now let me examine the user settings dialog files more closely to understand the specific issue: Based on my investigation, I've found the root cause of the missing spin buttons in the user settings dialog. Here's what's happening: Problem AnalysisThe issue is caused by a global CSS rule in input[type="number"]::-webkit-inner-spin-button {
opacity: 0; /* 1 is required for chromium 33+ beta to show the arrows / spinners */
} This rule applies globally to all number inputs in the application, making the spin buttons invisible. Current Workarounds in Other DialogsI noticed that other parts of the application explicitly override this global rule to show spin buttons where needed. For example, in .analyser input#analyserMinPSD::-webkit-inner-spin-button,
.analyser input#analyserMinPSD::-webkit-outer-spin-button,
.analyser input#analyserMaxPSD::-webkit-inner-spin-button,
.analyser input#analyserMaxPSD::-webkit-outer-spin-button,
.analyser input#analyserLowLevelPSD::-webkit-inner-spin-button,
.analyser input#analyserLowLevelPSD::-webkit-outer-spin-button {
-webkit-appearance: auto !important;
-moz-appearance: auto !important;
appearance: auto !important;
} SolutionTo fix the spin buttons in the user settings dialog, you need to add similar CSS rules to .user-settings-dialog input[type="number"]::-webkit-inner-spin-button,
.user-settings-dialog input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: auto !important;
-moz-appearance: auto !important;
appearance: auto !important;
opacity: 1 !important;
} This will:
The current @demvlad Would you like me to create a plan to implement this fix? 🏁 Script executed:
Length of output: 9413 🏁 Script executed:
Length of output: 4585 Perfect! Now I have a complete understanding of the issue. Let me provide you with the exact solution: Root Cause ConfirmedThe issue is indeed caused by the global CSS rule in input[type="number"]::-webkit-inner-spin-button {
opacity: 0; /* 1 is required for chromium 33+ beta to show the arrows / spinners */
} This rule hides all spin buttons globally across the entire application. Current Solution PatternI can see that the application already uses a pattern to selectively show spin buttons where needed. For example, in .analyser input#analyserMinPSD::-webkit-inner-spin-button,
.analyser input#analyserMinPSD::-webkit-outer-spin-button,
.analyser input#analyserMaxPSD::-webkit-inner-spin-button,
.analyser input#analyserMaxPSD::-webkit-outer-spin-button,
.analyser input#analyserLowLevelPSD::-webkit-inner-spin-button,
.analyser input#analyserLowLevelPSD::-webkit-outer-spin-button {
-webkit-appearance: auto !important;
-moz-appearance: auto !important;
appearance: auto !important;
opacity: 1 !important;
height: auto !important;
width: auto !important;
} The Missing PieceThe .user-settings-dialog input[type="checkbox"]::-webkit-inner-spin-button,
.user-settings-dialog input[type="checkbox"]::-webkit-outer-spin-button SolutionAdd this CSS rule to .user-settings-dialog input[type="number"]::-webkit-inner-spin-button,
.user-settings-dialog input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: auto !important;
-moz-appearance: auto !important;
appearance: auto !important;
opacity: 1 !important;
height: auto !important;
width: auto !important;
} This follows the exact same pattern already established in the codebase and will restore the spin buttons for all number input fields in the user settings dialog. @demvlad The fix is straightforward - just add the CSS rule above to the 🧠 Learnings used
|
@coderabbitai |
Tip For best results, initiate chat on the files or code changes. @demvlad Great to hear that the spin buttons are working now! I'm glad the CSS fix resolved the issue for you. Thanks for confirming that everything is functioning properly in the user settings dialog.
🧠 Learnings used
|
There was a problem hiding this 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
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
src/css/user_settings_dialog.css
(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: nerdCopter
PR: betaflight/blackbox-log-viewer#822
File: .github/workflows/deploy-preview.yml:17-19
Timestamp: 2025-05-14T16:08:27.254Z
Learning: For betaflight/blackbox-log-viewer repository, the team is aware of the security implications of using `pull_request_target` without specifying `persist-credentials: false` in the checkout action, and has chosen to proceed with the current approach. This concern should not be flagged in future reviews.
Learnt from: demvlad
PR: betaflight/blackbox-log-viewer#0
File: :0-0
Timestamp: 2025-06-29T18:40:50.980Z
Learning: In betaflight/blackbox-log-viewer, when implementing PSD heatmap settings persistence in src/graph_spectrum.js, the initialization sequence is critical - user settings must be initialized and applied to GraphSpectrumPlot before attaching input event handlers to prevent spurious refresh() calls that can cause spectrum rendering errors when disabled.
Preview URL: https://8be24e5d.betaflight-blackbox.pages.dev |
|
@haslinghuis |
Show spin button into number input fields of users settings dialog

Summary by CodeRabbit
Summary by CodeRabbit