fix(mobile): prevent excessive updates while dragging font-size sliders - #7130
fix(mobile): prevent excessive updates while dragging font-size sliders#7130bbernag wants to merge 1 commit into
Conversation
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.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
ApprovabilityVerdict: 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. |
|
Closing in favor of a clean replacement PR that updates font size only after slider release. |
|
Superseded by #7138. |
What Changed
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 --checkon the four changed filesvp lint --report-unused-disable-directiveson the four changed filestsc --noEmitgit diff --checkChecklist
Built with GPT-5 using the Codex desktop harness.
Note
Keep font size preview labels and previews responsive during slider interaction
onPreviewChangeprop toFontSizeSliderRowthat emits live (uncommitted) font size values while dragging or tapping, and emitsnullon commit or gesture cancellation.CodeAppearanceSection,TerminalAppearanceSection,TextAppearanceSection) now holds a transientpreviewFontSizestate, falling back to the persisted value when the preview is cleared.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.
FontSizeSliderRowadds optionalonPreviewChangeso drags only update a local preview;onChangeruns once when the gesture completes (or on tap), with preview cleared on cancel or unchanged commit.Text, Terminal, and Code appearance sections hold
previewFontSizestate and drive previews and value labels frompreview ?? savedwhile 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.