Skip to content

Conversation

@Udit-takkar
Copy link
Contributor

@Udit-takkar Udit-takkar commented Jan 18, 2026

What does this PR do?

Screenshot 2026-01-18 at 3 52 39 PM

Saw this vs component in Profile which I think is react-select's internal components

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • N/A I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • N/A I confirm automated tests are in place that prove my fix is effective or that my feature works.

How should this be tested?


Summary by cubic

Optimized the timezone select to reduce re-renders and speed up search and typing. Also fixed stale options by correcting memoization dependencies.

  • Performance
    • Memoized city timezone data, combined dropdown data, and the timezone map; fixed deps to avoid stale options.
    • Memoized input, change, label/format, and getOptionLabel handlers; centralized onChange normalization.

Written for commit 7aac94d. Summary will update on new commits.

@graphite-app graphite-app bot added enterprise area: enterprise, audit log, organisation, SAML, SSO core area: core, team members only labels Jan 18, 2026
@graphite-app graphite-app bot requested a review from a team January 18, 2026 16:54
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/features/components/timezone-select/TimezoneSelect.tsx">

<violation number="1" location="packages/features/components/timezone-select/TimezoneSelect.tsx:157">
P2: Inline `styles` object is recreated on every render, which defeats memoization and can cause unnecessary re-renders in react-select. Keep the styles object memoized so its reference is stable across renders.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

Comment on lines -114 to -117
timezones={{
...(props.data ? addTimezonesToDropdown(data) : {}),
...(isWebTimezoneSelect ? addTimezonesToDropdown(additionalTimezones) : {}),
}}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This would have created new object on every render

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/features/components/timezone-select/TimezoneSelect.tsx">

<violation number="1" location="packages/features/components/timezone-select/TimezoneSelect.tsx:88">
P2: Memoizing `data` by `props.data?.length` can return stale timezone options when the array contents change but length doesn’t. Depend on the full `props.data` reference (or remove memoization) so updates propagate correctly.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

Devin AI is addressing Cubic AI's review feedback

A Devin session has been created to address the issues identified by Cubic AI.

View Devin Session

devin-ai-integration bot and others added 2 commits January 18, 2026 18:16
The useMemo dependency on props.data?.length could return stale timezone
options when the array contents change but the length stays the same.
Using the full props.data reference ensures updates propagate correctly.

Fix identified by Cubic AI (confidence 9/10)

Co-Authored-By: unknown <>
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="packages/features/components/timezone-select/TimezoneSelect.tsx">

<violation number="1" location="packages/features/components/timezone-select/TimezoneSelect.tsx:88">
P2: Memoizing `data` only on `props.data?.length` can leave stale timezone options when the array contents change but the length doesn’t. Depend on `props.data` itself (or a stable hash) so updates propagate correctly.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 18, 2026

Devin AI is addressing Cubic AI's review feedback

New feedback has been sent to the existing Devin session.

View Devin Session


✅ Pushed commit 7aac94d

The useMemo dependency on props.data?.length could return stale timezone
options when the array contents change but the length stays the same.
Using the full props.data reference ensures updates propagate correctly.

Fix identified by Cubic AI (confidence 9/10)

Co-Authored-By: unknown <>
@Udit-takkar Udit-takkar added this to the v6.2 milestone Jan 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core area: core, team members only enterprise area: enterprise, audit log, organisation, SAML, SSO size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants