Skip to content

Conversation

@nodu
Copy link
Contributor

@nodu nodu commented Nov 18, 2025

Previously browsers (tested on Chrome, Firefox) wouldn't allow saving profiles with -1 as the flow.

This was due to the min validation rule being set to 0.1.

I've also added label text for this magic value.

Checks Passed.
Formatters and Linters ran (found one formatting fix).

Before:
image

After:
image

Summary by CodeRabbit

  • New Features

    • Added hint to Flow/Pressure label indicating -1 preserves current flow settings.
    • Flow input now accepts negative values to enable enhanced flow control options.
  • Refactor

    • Improved organization of weight-related dataset configurations in chart visualizations.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

Walkthrough

Two separate UI refinements across the shot profiling interface: a user-facing hint for flow input allowing sentinel value (-1) to preserve current flow, and a refactored conditional dataset structure in the shot history chart for explicit clarity in weight-related data inclusion.

Changes

Cohort / File(s) Summary
Flow Input Enhancement
web/src/pages/ProfileEdit/ExtendedPhase.jsx
Added hint text "( -1 = Keep current flow )" to Flow/Pressure label; adjusted Flow input minimum constraint from 0 to -1 to support sentinel value.
History Chart Dataset Restructuring
web/src/pages/ShotHistory/HistoryChart.jsx
Refactored conditional dataset injection by replacing spread operators with explicit single-item array conditionals; consolidated y2 scale configuration into hasWeight branch with added grid styling (drawOnChartArea: false) and offset configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • ProfileEdit change: Straightforward label text addition and input constraint modification; verify label displays correctly and -1 value is properly handled downstream.
  • HistoryChart refactoring: Ensure conditional dataset arrays produce identical rendering output to previous spread operator approach; confirm y2 axis configuration applies only when weight data exists and displays as expected.

Possibly related PRs

  • Weight / Weight Flow on Shot History Chart #485: Modifies web/src/pages/ShotHistory/HistoryChart.jsx with weight-related dataset and y2 axis configuration changes; likely addresses similar chart rendering concerns or may have overlapping scope.

Poem

🐰 A sentinel flows where -1 leads the way,
Preserving the pressure from yesterday's play,
Charts now explicit with datasets so clear,
The history whispers what weight brings near! ✨

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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main changes: updating flow validation to allow -1 and adding a label explaining this value.
✨ 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: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between dfbad2c and 86355cb.

📒 Files selected for processing (2)
  • web/src/pages/ProfileEdit/ExtendedPhase.jsx (2 hunks)
  • web/src/pages/ShotHistory/HistoryChart.jsx (3 hunks)
🔇 Additional comments (4)
web/src/pages/ProfileEdit/ExtendedPhase.jsx (2)

274-274: LGTM! Clear user-facing hint for the -1 sentinel value.

The hint text clearly explains that -1 preserves the current flow setting, addressing the user experience goal stated in the PR. The conditional rendering ensures it only appears when relevant (flow mode).


288-288: LGTM! Validation fix correctly allows the -1 sentinel value.

The minimum value change from '0.1' to '-1' for flow mode correctly resolves the browser validation issue described in the PR. This allows users to save profiles with the -1 sentinel value while maintaining appropriate validation for other modes.

web/src/pages/ShotHistory/HistoryChart.jsx (2)

96-117: LGTM! Formatting improvement enhances readability.

The refactoring from inline conditional spreads to explicit multi-line array structures makes the conditional dataset inclusion clearer without any functional changes. This aligns with the "formatting fix" mentioned in the PR description.


190-206: Verify intentional enhancements to y2 axis configuration.

The refactoring includes two functional additions beyond formatting:

  • offset: true (line 196): Adds spacing for the y2 axis positioning
  • grid: { drawOnChartArea: false } (line 203): Prevents y2 grid lines from overlapping the chart

While these are sensible chart improvements (the grid setting matches y1's configuration on line 188), they represent functional changes beyond the "formatting fix" mentioned in the PR description. Please confirm these enhancements were intentional and have been visually tested with weight data present.


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

@nodu nodu changed the title Update validation min value for -1; Add label explaining the -1 magic… Flow UI/UX: Update validation min value for -1; Add label explaining the -1 magic… Nov 18, 2025
@nodu nodu marked this pull request as ready for review November 18, 2025 23:17
@nodu
Copy link
Contributor Author

nodu commented Nov 18, 2025

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 18, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@jniebuhr
Copy link
Owner

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Nov 22, 2025
@cla-bot
Copy link

cla-bot bot commented Nov 22, 2025

The cla-bot has been summoned, and re-checked this pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants