Skip to content

fix(rn-scrollview-dynamic-padding): treat conditionals between static values as static - #1791

Open
aidenybai wants to merge 1 commit into
mainfrom
devin/1789027053-rn-scrollview-static-conditional-padding
Open

aidenybai wants to merge 1 commit into
mainfrom
devin/1789027053-rn-scrollview-static-conditional-padding

Conversation

@aidenybai

Copy link
Copy Markdown
Member

Summary

Closes #1785. contentContainerStyle={{ paddingTop: ListHeaderComponent ? 0 : 16 }} was reported as "changing padding" even though both outcomes are design-time constants; the rule exists for values that track a runtime measurement (keyboardHeight, insets.bottom) and reflow the list every time they move.

isStaticStyleValue now accepts a ConditionalExpression when both branches are themselves static (recursing with the existing depth budget, so nested ternaries and const-bound branches work):

if (isNodeOfType(value, "ConditionalExpression")) {
  return isStaticStyleValue(value.consequent, depth + 1) && isStaticStyleValue(value.alternate, depth + 1);
}

This is not a prop-based blanket exemption: isKeyboardOpen ? keyboardHeight : 0, hasTabBar ? 0 : insets.bottom, and two-dynamic-branch ternaries all still report (covered by new tests, alongside the exact FlashList repro, static-const branches, and a nested static ternary).

Also reworded the recommendation: the old text (contentInset={{ bottom: dynamicValue }}) implied a cross-platform drop-in that also covered the top edge. It now says to move the changing value to the matching contentInset edge, notes that contentInset is iOS-only, and to keep static spacing in contentContainerStyle. core-rule-registry-data.json is regenerated for that string. Changeset added for oxlint-plugin-react-doctor.

Supersedes the auto-triage draft #1789.

Link to Devin session: https://app.devin.ai/sessions/3401e96268dc4245bf9a058d631ccc36
Open in Devin Desktop: https://app.devin.ai/desktop/session/3401e96268dc4245bf9a058d631ccc36?variant=devin
Requested by: @aidenybai

… values as static

Closes #1785

Co-Authored-By: aiden@million.dev <aiden.bai05@gmail.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Original prompt from Aiden

fix latest rd issues and run ship skill on them

@pkg-pr-new

pkg-pr-new Bot commented Sep 10, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/eslint-plugin-react-doctor@1791
npm i https://pkg.pr.new/oxlint-plugin-react-doctor@1791
npm i https://pkg.pr.new/react-doctor@1791

commit: f9ebc28

@github-actions

Copy link
Copy Markdown
Contributor

Interactive terminal E2E

Terminal Control verified the built CLI at f9ebc28 in a real PTY:

  • selected a project interactively and observed Scanning... before the three-second Git delay completed
  • waited for the clean result and exercised the compact report
  • opened copy context and the GitHub Actions confirmation, then cancelled safely

Download the edited MP4 and PNG evidence

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rn-scrollview-dynamic-padding: stable header spacing reported as changing padding

1 participant