Skip to content

Comments

[#727] feat: implement manual range authority and refined segmentation UI#728

Merged
wayangalihpratama merged 8 commits intostagingfrom
feature/727-feedback-automatic-segmentation-ui
Feb 20, 2026
Merged

[#727] feat: implement manual range authority and refined segmentation UI#728
wayangalihpratama merged 8 commits intostagingfrom
feature/727-feedback-automatic-segmentation-ui

Conversation

@wayangalihpratama
Copy link
Contributor

@wayangalihpratama wayangalihpratama commented Feb 20, 2026

Logical Model (Manual Range Authority)

  • Implemented "Manual Range Authority": User-defined Min and Max values are strictly respected during recalculation and final segment generation.
  • Bi-directional Cascading: Implemented helpers for numerical range editing (Segment N Max updates Segment N+1 Min and vice-versa) using a robust 0.01 precision offset.
  • Adjust Logic: Refined the "Adjust" button to send both boundaries simultaneously, preventing range reversion bugs.

UI/UX Improvements

  • Layout Simplification: Adjusted grid spans to 12/12 in Step 2 and added "Min/Max" input prefixes for better clarity.
  • Naming Enforcement: Enforced manual, unique naming for numerical segments with real-time frontend validation and empty-by-default inputs.
  • Dynamic Display: Decoupled "Segment range" display from live form fields and made it optional via a new toggle.
  • Prioritization: Swapped button order to prioritize manual segment addition.
  • Enhanced Labels: Updated variable selection labels to be more descriptive.

Backend Fixes & Stability

  • UnboundLocalError: Resolved a scoping bug in backend processing during numerical segment value generation.
  • Missing Data Fix: Implemented inclusive lower bounds (>=) for starting segments to ensure all farmers are captured in the analysis.
  • React Crash Fix: Implemented robust error stringification for Pydantic/FastAPI validation errors and sanitized payloads to prevent frontend crashes.

Close #727


…manual flow

- Implement centered min/max input boxes with 'Adjust' button for numerical ranges
- Swap add segment button order to prioritize the manual segmentation flow
- Update relevant task and implementation documentation
- Update GEMINI.md with recent changes
…y for numerical segments

- Updated backend models and utilities to respect user-defined Min and Max values during recalculation and segment generation.
- Implemented static 'Segment range' display in DataUploadSegmentForm by decoupling the label from live form fields.
- Refined cascading logic to ensure bi-directional range updates without data loss.
- Prioritized manual segment addition UI flow.
- Resolved associated lint warnings for better code quality.
@wayangalihpratama wayangalihpratama linked an issue Feb 20, 2026 that may be closed by this pull request
@wayangalihpratama wayangalihpratama merged commit febfef8 into staging Feb 20, 2026
1 check passed
@wayangalihpratama wayangalihpratama self-assigned this Feb 20, 2026
@wayangalihpratama wayangalihpratama deleted the feature/727-feedback-automatic-segmentation-ui branch February 20, 2026 11:18
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.

[Feedback] Automatic Segmentation UI

1 participant