Skip to content

Commit 0014967

Browse files
authored
chore(webapp): scope intentional draft synchronization (#4725)
## Summary Scopes state synchronization that intentionally resets editable drafts from authoritative server values, deployment state, or programmatic filter changes. These values cannot be derived during render without removing user control between resets.
1 parent f723e5a commit 0014967

7 files changed

Lines changed: 7 additions & 0 deletions

File tree

apps/webapp/app/components/billing/BillingLimitRecoveryPanel.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export function BillingLimitRecoveryPanel({
6363
const formRef = useRef<HTMLFormElement>(null);
6464

6565
useEffect(() => {
66+
// oxlint-disable-next-line react/react-compiler -- A refreshed server recommendation intentionally resets this editable amount draft.
6667
setNewAmount(String(suggestedNewLimitDollars));
6768
}, [suggestedNewLimitDollars]);
6869

apps/webapp/app/components/code/TSQLResultsTable.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ const DebouncedInput = forwardRef<
224224
const [value, setValue] = useState(initialValue);
225225

226226
useEffect(() => {
227+
// oxlint-disable-next-line react/react-compiler -- Programmatic filter changes intentionally reset the debounced input draft.
227228
setValue(initialValue);
228229
}, [initialValue]);
229230

apps/webapp/app/components/primitives/DateTime.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ export const RelativeDateTime = ({ date, timeZone, capitalize = true }: Relative
372372

373373
// On first render
374374
useEffect(() => {
375+
// oxlint-disable-next-line react/react-compiler -- A changed date intentionally resets the timer-backed relative text.
375376
setRelativeText(getRelativeText(realDate, capitalize));
376377
}, [realDate, capitalize]);
377378

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.branches/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,7 @@ function PurchaseBranchesModal({
652652

653653
const [amountValue, setAmountValue] = useState(extraBranches);
654654
useEffect(() => {
655+
// oxlint-disable-next-line react/react-compiler -- The authoritative branch count intentionally resets this modal draft.
655656
setAmountValue(extraBranches);
656657
}, [extraBranches]);
657658
const isLoading = fetcher.state !== "idle";

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.dashboards.custom.$dashboardId/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ function RenameDashboardDialog({ title }: { title: string }) {
683683

684684
// Sync newTitle state when title changes (after successful rename)
685685
useEffect(() => {
686+
// oxlint-disable-next-line react/react-compiler -- A completed rename intentionally resets this editable title draft.
686687
setNewTitle(title);
687688
}, [title]);
688689

apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.deployments.$deploymentParam/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ function LogsDisplay({
631631
const logsContainerRef = useRef<HTMLDivElement>(null);
632632

633633
useEffect(() => {
634+
// oxlint-disable-next-line react/react-compiler -- Deployment status changes intentionally reset the user-controlled collapse state.
634635
setCollapsed(initialCollapsed);
635636
}, [initialCollapsed]);
636637

apps/webapp/app/routes/_app.orgs.$organizationSlug.settings.team/route.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -970,6 +970,7 @@ export function PurchaseSeatsModal({
970970

971971
const [amountValue, setAmountValue] = useState(extraSeats);
972972
useEffect(() => {
973+
// oxlint-disable-next-line react/react-compiler -- The authoritative seat count intentionally resets this modal draft.
973974
setAmountValue(extraSeats);
974975
}, [extraSeats]);
975976
const isLoading = fetcher.state !== "idle";

0 commit comments

Comments
 (0)