Skip to content

fix(mobile): prevent excessive updates while dragging font-size sliders - #7130

Closed
bbernag wants to merge 1 commit into
pingdotgg:mainfrom
bbernag:fix/mobile-font-size-slider-preview
Closed

fix(mobile): prevent excessive updates while dragging font-size sliders#7130
bbernag wants to merge 1 commit into
pingdotgg:mainfrom
bbernag:fix/mobile-font-size-slider-preview

Conversation

@bbernag

@bbernag bbernag commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Preview snapped font-size values locally inside the Appearance screen while a slider is dragged.
  • Persist the selected value and apply global typography only once when the gesture completes.
  • Restore the committed preview when a gesture is cancelled.
  • Keep taps, accessibility actions, and previews for text, terminal, and code font sizes consistent.

Why

The slider previously wrote every intermediate drag value to mobile preferences. For the base text size, each write also reapplied the app-wide Uniwind typography variables. Rapid back-and-forth scrubbing could queue enough global updates that the thumb kept replaying old values after release and React eventually reported Maximum update depth exceeded.

Keeping the in-progress value local preserves real-time feedback in the Appearance preview and value label without repeatedly persisting preferences or relaying out the rest of the app. The final snapped value is committed once on release.

UI Changes

There is no visual redesign. The interaction changes from app-wide live resizing during a drag to a responsive local preview followed by one global update on release.

Before

Heavy scrubbing could lag, continue after release, and trigger the maximum update depth error.

Screen.Recording.2026-08-15.at.3.01.30.p.m.mp4

After

Only the local Appearance preview and value label update during the drag; the global value updates once on release.

Screen.Recording.2026-08-15.at.3.00.12.p.m.mp4

Validation

  • vp fmt --check on the four changed files
  • vp lint --report-unused-disable-directives on the four changed files
  • Mobile tsc --noEmit
  • git diff --check
  • Reproduced the original maximum update depth failure on an iPhone development build before the fix
  • Captured before/after physical-device recordings of rapid slider scrubbing

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Built with GPT-5 using the Codex desktop harness.

Note

Keep font size preview labels and previews responsive during slider interaction

  • Adds an onPreviewChange prop to FontSizeSliderRow that emits live (uncommitted) font size values while dragging or tapping, and emits null on commit or gesture cancellation.
  • Each appearance section (CodeAppearanceSection, TerminalAppearanceSection, TextAppearanceSection) now holds a transient previewFontSize state, falling back to the persisted value when the preview is cleared.
  • The preview panel and value label update in real time during slider interaction and revert to the committed value on release or cancel.

Macroscope summarized 0aeda45.


Note

Low Risk
Scoped to mobile Appearance settings slider gesture handling and local preview state; no auth, data, or API changes.

Overview
Font size sliders no longer persist preferences on every pan frame. FontSizeSliderRow adds optional onPreviewChange so drags only update a local preview; onChange runs once when the gesture completes (or on tap), with preview cleared on cancel or unchanged commit.

Text, Terminal, and Code appearance sections hold previewFontSize state and drive previews and value labels from preview ?? saved while scrubbing, so feedback stays on the Appearance screen without repeated global typography updates until release.

Reviewed by Cursor Bugbot for commit 0aeda45. Bugbot is set up for automated code reviews on this repo. Configure here.

Preview snapped values locally while dragging and persist the final value only when the gesture completes. This avoids queuing app-wide typography updates and prevents maximum update depth failures during heavy scrubbing.
@coderabbitai

coderabbitai Bot commented Aug 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 00b07001-eee5-40fa-825d-f4595f1c8d0e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Aug 15, 2026
@bbernag
bbernag marked this pull request as ready for review August 15, 2026 22:20
@bbernag bbernag changed the title fix(mobile): keep font size sliders responsive fix(mobile): prevent excessive updates while dragging font-size sliders Aug 15, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 0aeda45

This is a straightforward UI optimization that adds local preview state during slider dragging to avoid excessive global state updates. The changes are self-contained to the mobile appearance settings and follow a clear pattern.

You can customize Macroscope's approvability policy. Learn more.

@bbernag

bbernag commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of a clean replacement PR that updates font size only after slider release.

@bbernag bbernag closed this Aug 15, 2026
@bbernag

bbernag commented Aug 15, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #7138.

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

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant