Skip to content

improvement(lint): fix react-doctor errors and warnings#3232

Merged
waleedlatif1 merged 2 commits intostagingfrom
performance
Feb 17, 2026
Merged

improvement(lint): fix react-doctor errors and warnings#3232
waleedlatif1 merged 2 commits intostagingfrom
performance

Conversation

@waleedlatif1
Copy link
Collaborator

@waleedlatif1 waleedlatif1 commented Feb 17, 2026

Summary

  • Fix combobox missing aria-controls aria prop using useId() to link trigger to listbox
  • Remove 'use server' from getOAuthProviderStatus — it's only called from server components
  • Add @media (prefers-reduced-motion: reduce) to global CSS (WCAG 2.3.3)
  • Extract <style jsx> / <style jsx global> blocks from 3 components into globals.css
  • Replace import { isEqual } from 'lodash' with import isEqual from 'lodash/isEqual' in 6 files
  • Move redirects outside try-catch in file viewer page, add unstable_rethrow
  • Replace sequential invalidateQueries awaits with Promise.all in cancel-subscription
  • Add sizes prop to <Image fill> in help-modal
  • Make willChange conditional on animation state in landing-node; remove from SVG edge
  • Wrap toString() and new Array(200).fill(0) in lazy state initializers
  • Explicitly render {children} in AlertTitle and MDX h2/h3/h4 components
  • Remove redundant export default ensureUploadsDirectory duplicate export

Type of Change

  • Bug fix

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Feb 17, 2026 7:34pm

Request Review

@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@greptile

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 17, 2026

Greptile Summary

This PR addresses a broad set of lint and react-doctor warnings across 22 files. The majority of changes are straightforward correctness improvements: replacing named lodash imports with subpath imports (lodash/isEqual) in 6 files for better tree-shaking, wrapping expensive initial state computations in lazy initializers, adding the missing aria-controls / id link in the Combobox for accessibility, fixing the unstable_rethrow pattern in the file viewer page, and adding sizes to a fill Image.

The one area that conflicts with project conventions is the extraction of component-specific styles into globals.css:

  • The project has an explicit rule in both CLAUDE.md and global.mdc: "Never update global styles. Keep all styling local to components." A dedicated custom rule (c3b5e4b0) reinforces this for globals.css specifically.
  • The .status-indicator, .loading-dot, and subflow drag-over styles are component-owned concerns being made truly global, which risks unintended style bleed and makes future maintenance harder.
  • The /* ============= ... ============= */ separator comment also violates the "No ==== separators" convention from global.mdc.

All other changes in the PR are clean and well-scoped.

Confidence Score: 3/5

  • Most changes are safe and correct, but the globals.css additions violate the project's explicit "never update global styles" rule and should be addressed before merging.
  • The lodash subpath imports, lazy state initializers, aria-controls fix, unstable_rethrow usage, and duplicate export removal are all correct and well-targeted. The score is reduced because ~100 lines of component-specific styles were added to globals.css in direct conflict with two separate project rules (CLAUDE.md and the custom instruction c3b5e4b0). This is a convention violation rather than a runtime bug, but it sets a precedent that undermines the project's style isolation strategy.
  • apps/sim/app/_styles/globals.css — component-scoped styles should be moved back to their respective component files or CSS modules.

Important Files Changed

Filename Overview
apps/sim/app/_styles/globals.css Adds ~100 lines of styles to globals.css - violates both the custom rule (c3b5e4b0: "Avoid editing globals.css unless absolutely necessary") and the global coding standard ("Never update global styles. Keep all styling local to components"). Styles extracted from components (status-indicator, loading-dot, subflow node rules) belong in local component files or CSS modules.
apps/sim/app/workspace/[workspaceId]/files/[fileId]/view/page.tsx Refactored to move redirects outside try-catch and add unstable_rethrow. Correctly prevents Next.js redirect errors from being swallowed. TypeScript flow analysis is safe since redirect() returns never.
apps/sim/components/emcn/components/combobox/combobox.tsx Adds useId() to generate a stable listboxId, then links the combobox trigger's aria-controls to the listbox's id. Correctly fixes the missing aria-controls accessibility attribute.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/subflows/subflow-node.tsx Removes the SubflowNodeStyles inline JSX component (styled-jsx global block), simplifies the render to remove the extra wrapper fragment. The removed global CSS styles are now in globals.css.
apps/sim/app/workspace/[workspaceId]/w/components/sidebar/components/settings-modal/components/subscription/components/cancel-subscription/cancel-subscription.tsx Replaces sequential awaited invalidateQueries calls with a single Promise.all in handleKeep, improving performance by parallelizing cache invalidation.
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/wand-prompt-bar/wand-prompt-bar.tsx Removes the styled-jsx global block containing status-indicator animation styles. The styles are moved to globals.css, which conflicts with the project's rule to keep all styling local to components.

Flowchart

flowchart TD
    A[FileViewerPage Request] --> B[Await params]
    B --> C[getSession]
    C --> D{session?.user?.id?}
    D -- No --> E[redirect '/']
    D -- Yes --> F[verifyWorkspaceMembership]
    F --> G{hasPermission?}
    G -- No --> H[redirect to workspace]
    G -- Yes --> I[try: getWorkspaceFile]
    I --> J{Error thrown?}
    J -- Yes --> K[catch block]
    K --> L[unstable_rethrow\nre-throws NEXT_REDIRECT / NEXT_NOT_FOUND]
    L --> M[redirect to workspace\nfor real errors]
    J -- No --> N{fileRecord exists?}
    N -- No --> O[redirect to workspace]
    N -- Yes --> P[render FileViewer]

    style E fill:#f66,color:#fff
    style H fill:#f66,color:#fff
    style M fill:#f66,color:#fff
    style O fill:#f66,color:#fff
    style P fill:#6a6,color:#fff
    style L fill:#fa0,color:#000
Loading

Last reviewed commit: 28046e8

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

22 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@waleedlatif1
Copy link
Collaborator Author

@cursor review

@waleedlatif1
Copy link
Collaborator Author

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

@waleedlatif1 waleedlatif1 merged commit 299cc26 into staging Feb 17, 2026
7 checks passed
@waleedlatif1 waleedlatif1 deleted the performance branch February 17, 2026 19:40
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.

1 participant