Optimize publish repository dialog state#2991
Draft
cursor[bot] wants to merge 1 commit into
Draft
Conversation
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Contributor
|
🚀 Expo continuous deployment is ready!
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
PublishRepositoryDialog.Why
React Doctor flagged
GitActionsControl.tsxforset-state-in-effectandrerender-state-only-in-handlersin the publish repository dialog. Those effects caused stale renders followed by immediate corrective renders when opening the dialog or when provider readiness changed. Calculating these values during render matches React guidance from "You Might Not Need an Effect" and avoids the extra commits while preserving behavior.React Doctor final scan for
src/components/GitActionsControl.tsx:set-state-in-effect: 2 -> 0rerender-state-only-in-handlers: 1 -> 0React Scan controlled publish-dialog flow:
PublishRepositoryDialogrendered 7 timesPublishRepositoryDialogrendered 5 timesUI Changes
Before/after React Scan recordings were captured with the React Scan toolbar and rerender overlays enabled:
react_scan_publish_dialog_before.mp4react_scan_publish_dialog_after.mp4Checklist
Validation:
pnpm --filter @t3tools/web test:browser -- src/components/GitActionsControl.browser.tsx(passes, 152 browser tests)npx -y react-doctor@latest apps/web --verbose --offline --json(targeted findings removed; command still exits nonzero due pre-existing unrelated findings)pnpm exec vp check(passes)pnpm exec vp run typecheck(passes)Note
Derive publish provider and repository state in
PublishRepositoryDialoginstead of using effectspublishProviderstate withrequestedPublishProviderplus a derivedpublishProviderthat falls back to the first ready provider, eliminating the effect that previously forced provider selection.publishRepositorystring state andhasUserEditedPublishRepositoryflag with a nullablepublishRepositoryOverrideplus a derivedpublishRepositorythat coalesces the override with a per-provider account prefill.publishRepositoryOverride, resetting the input to the new provider's account prefill; user edits persist across wizard steps within the same provider.Macroscope summarized 387afe4.