Skip to content

Added high precise mode for the curves min-max values change step#921

Merged
haslinghuis merged 2 commits into
betaflight:masterfrom
demvlad:minmax_step_change
May 31, 2026
Merged

Added high precise mode for the curves min-max values change step#921
haslinghuis merged 2 commits into
betaflight:masterfrom
demvlad:minmax_step_change

Conversation

@demvlad

@demvlad demvlad commented May 30, 2026

Copy link
Copy Markdown
Contributor

The current version has fixed step (10) to change min-max values at the graphs setup page. But the 10 value is not comfortable for some fields, because the all values rounding up to 10.
This PR adds high precise mode for the curves min-max values change step.
Press the Ctrl key on selected Min-Max field input, to switch On/Off this mode
The min-max values change step is 0.1 in the high precise mode. It is possible to input any value.
The high precise input shows italic font.
StepForMinMax

Summary by CodeRabbit

  • New Features
    • Added high-precision mode for curve min/max bounds in the graph configuration dialog.
    • Numeric step switches between coarse and fine increments when high-precision is enabled.
    • High-precision values are detected automatically when non-standard bounds are present.
    • Hold Ctrl while editing min/max to toggle between precision modes; active mode is indicated visually (italic).

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 30, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6c27a7ee-a1a3-4a32-a2ca-f64bf11df5ed

📥 Commits

Reviewing files that changed from the base of the PR and between 0dfef43 and e88da8c.

📒 Files selected for processing (1)
  • src/components/GraphConfigDialog.vue
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/GraphConfigDialog.vue

Walkthrough

GraphConfigDialog.vue adds high-precision mode for curve min/max bounds. On dialog open, precision is auto-detected by checking if bounds align with the coarse step (10). Users toggle precision via Ctrl+keydown, which dynamically switches step sizes (10 vs. 0.1) and applies italic styling to the inputs.

Changes

Curve Bounds Precision Control

Layer / File(s) Summary
Precision mode constants and initialization
src/components/GraphConfigDialog.vue
defineFieldsResolution() initializes field.curve.highPrecise for each curve on dialog open by inspecting whether min/max values align with the normal step size (10). Introduces normalMinMaxStep (10) and smallMinMaxStep (0.1) constants that distinguish coarse from precise stepping.
Min/max input step and styling binding
src/components/GraphConfigDialog.vue
Min and max numeric inputs bind their step attribute to either the coarse or precise step value based on field.curve.highPrecise, and apply italic font styling when high precision is enabled.
Precision toggle key handlers
src/components/GraphConfigDialog.vue
Both min and max inputs add @keydown handlers that toggle field.curve.highPrecise when Ctrl is pressed, allowing users to switch precision modes via keyboard without needing a context menu.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

RN: IMPROVEMENT

Suggested reviewers

  • haslinghuis
  • nerdCopter
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The PR description explains the problem, the solution, and how to use the feature, but it does not follow the required template structure with proper sections. Restructure the description to follow the repository's template format, including clear sections for motivation, changes, and testing information.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a high precision mode for adjusting min-max values with a different step size (0.1 instead of 10).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/GraphConfigDialog.vue`:
- Around line 181-186: The keydown handler in GraphConfigDialog.vue is toggling
field.curve.highPrecise for any Ctrl+key combo and preventing default, which
breaks standard shortcuts; update the keydown handlers for both the min and max
inputs (the inline handler that references field.curve.highPrecise) to only
toggle when the actual Control key is pressed (e.g., check e.key === 'Control'
or equivalent) and remove the e.preventDefault() so Ctrl+A/C/V/Z continue to
work.
- Around line 637-641: The truthy check `if (min && max)` incorrectly skips
cases where min or max is 0; update the conditional around where `min` and `max`
are read (the block setting `field.curve.highPrecise`) to test for explicit
null/undefined (e.g., `min != null && max != null`) so zero values are accepted,
then keep the existing logic using `normalMinMaxStep` to compute
`field.curve.highPrecise`.
🪄 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: CHILL

Plan: Pro

Run ID: df90cecb-6108-4b11-96d8-615b5cf0bfc2

📥 Commits

Reviewing files that changed from the base of the PR and between b3307e5 and 0dfef43.

📒 Files selected for processing (1)
  • src/components/GraphConfigDialog.vue

Comment thread src/components/GraphConfigDialog.vue
Comment thread src/components/GraphConfigDialog.vue
coderabbitai[bot]
coderabbitai Bot previously approved these changes May 30, 2026
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

Preview URL: https://pr921.betaflight-blackbox.pages.dev

@haslinghuis haslinghuis merged commit d350ef4 into betaflight:master May 31, 2026
8 checks passed
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.

2 participants