Skip to content

Conversation

@Bekiboo
Copy link
Collaborator

@Bekiboo Bekiboo commented Jan 19, 2026

Description of change

Automatically detects leading 0 and removes it.

Issue Number

Closes #681

Type of change

  • Fix (a change which fixes an issue)

How the change has been tested

On chrome, devtools, mobile

Change checklist

  • I have ensured that the CI Checks pass locally
  • I have removed any unnecessary logic
  • My code is well documented
  • I have signed my commits
  • My code follows the pattern of the application
  • I have self reviewed my code

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced input validation and sanitization for point and ranking input fields with improved numeric parsing to ensure consistent and reliable data handling.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 19, 2026

📝 Walkthrough

Walkthrough

This change modifies the eVoting application's candidate scoring page to fix input field handling and code quality. It removes the unused VotingInterface import, updates parseInt calls with explicit radix parameters, and adds onInput handlers to sanitize numeric inputs, addressing a bug where leading zeros couldn't be deleted from candidate score fields.

Changes

Cohort / File(s) Summary
Input sanitization and import fixes
platforms/eVoting/src/app/(app)/[id]/page.tsx
Removed VotingInterface import, replaced with BlindVotingInterface. Updated parseInt calls with explicit radix parameter (10). Added onInput handlers to candidate point and ranking input fields to sanitize values by parsing to integer and updating the field state, preventing leading zero retention issues.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A zero caused quite the voting fright,
Users couldn't delete it left or right!
With onInput handlers, we've made it right—
Now digits dance freely, a radiant sight ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: (eVoting) handle leading zero in point voting' clearly and concisely summarizes the main change—fixing the leading zero handling issue in the eVoting point voting input field.
Linked Issues check ✅ Passed The PR addresses issue #681 by modifying input handling in the point voting input field to handle leading zeros through onInput handlers that parse and sanitize integer inputs.
Out of Scope Changes check ✅ Passed All changes are within scope: input handling improvements and removal of unnecessary VotingInterface import are directly related to fixing the leading zero bug in issue #681.
Description check ✅ Passed The PR description follows the required template with all key sections completed: change description, issue reference, type of change, testing approach, and checklist.

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

✨ Finishing touches
  • 📝 Generate docstrings

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.

@Bekiboo Bekiboo marked this pull request as ready for review January 19, 2026 12:06
@Bekiboo Bekiboo requested a review from coodos as a code owner January 19, 2026 12:06
@Bekiboo Bekiboo self-assigned this Jan 19, 2026
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.

[Bug] Cannot delete leading zero in candidate score field (points mode)

2 participants