Skip to content

Aditya Dhayapulay - Hotfix: Prevent profile hours from changing while scrolling - #5654

Merged
one-community merged 1 commit into
developmentfrom
fix/profile-hours-scroll
Oct 24, 2026
Merged

one-community merged 1 commit into
developmentfrom
fix/profile-hours-scroll

Conversation

@adit24dhaya

Copy link
Copy Markdown
Contributor

Description

Fix Hotfix Profile Hours Change/Edit Causes Wrong Updates.

Scrolling while a profile's hours field is focused can change the number before Save is clicked. For example, entering 21 hours can become 20, and Save then sends 20. This PR prevents scrolling from changing hours while keeping normal page scrolling and keyboard editing.

Reported examples: Video 1, Video 2.

Related PRS (if any):

None. Frontend only; no backend or API changes required for this fix. Separate from the job-application terms checkbox PR #5651.

Main changes explained:

  • Remove focus from numeric hours fields when scrolling over them, so the browser scrolls instead of changing their values.
  • Cover weekly committed, make-up, intangible and category hours in the Volunteering Times tab.
  • Add 11 regression tests for scrolling, save payloads, decimal edits, valid boundaries and read-only access.

How to test:

Use an isolated local backend/database or mocked requests. Do not edit production or shared-development volunteer records for testing.

  1. Check out fix/profile-hours-scroll and start the existing local setup.
  2. As an Administrator, open a test volunteer's profile from the dashboard and select Volunteering Times.
  3. Enter 21 in Weekly Committed Hours. With the field focused and the pointer over it, scroll toward Save Changes. Confirm the page scrolls and the hours stay at 21. Repeat scrolling upward.
  4. Save against the isolated backend or mocked API. Confirm the request targets that volunteer and contains 21, then check the reloaded value.
  5. Repeat with intangible/category hours and, for a Core Team fixture, make-up hours. Check both themes.
  6. Re-focus a field and verify typing and Arrow Up/Down still work. Confirm read-only users cannot edit hours.
  7. Run the focused regression tests:
npx vitest run src/components/UserProfile/VolunteeringTimeTab/__tests__

Validation completed:

  • Source suite: 2,486 passed, 14 skipped, zero failures.
  • Focused tab/history tests: 25 passed, including the 11 new tests.
  • Chromium: 113 checks passed, including 104 wheel cases across both directions, themes, two desktop widths and Volunteer/Core Team fixtures.
  • Four additional isolated parent-profile save/retry scenarios passed, using the real profile state, Save Changes handler and Redux save action with mocked HTTP.
  • Build, changed-file ESLint and whitespace checks passed.

Screenshots or videos of changes:

Four code/UI/evidence screenshots and a short captioned walkthrough are prepared locally for the weekly submission. They are not attached to this PR yet.

Note:

The Chromium reproduction uses a no-op, non-cancelling wheel listener to activate native number-input stepping; without that condition, the isolated page does not reproduce the decrement. Before the fix, the browser changed 21 to 20 and the mocked save sent 20. After the fix, it keeps 21 and allows scrolling.

Authenticated full-dashboard browser testing, real database persistence, other browsers and physical-trackpad testing remain unverified. No shared data was changed. No CSS, dependencies or backend files were modified. An unfiltered test run includes old ignored PR-review fixtures and is not green; the source-suite results above exclude those unrelated fixtures.

Blur focused profile-hour inputs on wheel so scrolling toward Save does not accidentally change the entered value. Preserve normal page scrolling and intentional keyboard edits.

Add regression tests for weekly, make-up, intangible and category hours, read-only access, boundaries and mocked save payloads.

Task: Hotfix Profile Hours Change/Edit Causes Wrong Updates
@netlify

netlify Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit f795f71
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/6acefb3210fefd715926761b
😎 Deploy Preview https://deploy-preview-5654--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@sonarqubecloud

Copy link
Copy Markdown

@shubhamjakhete shubhamjakhete left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked out the PR at f795f71 and ran the frontend tests.

  • Branch merges cleanly with the latest development.
  • VolunteeringTimeTab.hours.test.jsx: 11/11 passing, and the existing

VolunteeringTimeTab tests still pass (25/25 in the folder).

  • All UserProfile tests pass (338 passed, 3 skipped).
  • The change is limited to adding onWheel={blurHoursOnWheel} to the four hours inputs.

Approving.

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

Reviewed by Aadit Trivedi.

Checked out the PR (no conflicts with development) and ran VolunteeringTimeTab.hours.test.jsx: 11/11 passing.

Verified

  • The hours number inputs on the Volunteering Time tab now blur on mouse wheel (onWheel={blurHoursOnWheel}), so scrolling while one is focused no longer steps its value. Blurring instead of cancelling the event lets the page keep scrolling toward Save.
  • The handler is applied to each hours input, and the tests cover scrolling over a focused field and saving.

Approving.

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

I have reviewed your PR locally (f795f71, backend on development) and it works as per requirement.

  1. Profile > Volunteering Times: typed 21 in Weekly Committed Hours and scrolled with the cursor over the field. The value stays 21, the field loses focus and the page scrolls.
  2. Same for a category hours field (Education stays 9 after scrolling).
  3. Readable in dark and light mode. npx vitest run src/components/UserProfile/VolunteeringTimeTab: 25/25 pass. No conflicts with development.
Image

@one-community one-community added the High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible label Oct 24, 2026
@one-community

Copy link
Copy Markdown
Member

Thank you all, merging!

@one-community
one-community merged commit 1441479 into development Oct 24, 2026
10 checks passed
@adit24dhaya adit24dhaya changed the title Aditya - Hotfix: Prevent profile hours from changing while scrolling Aditya Dhayapulay - Hotfix: Prevent profile hours from changing while scrolling Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

High Priority - Please Review First This is an important PR we'd like to get merged as soon as possible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants