-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: replace more DatePickers with LemonCalendarSelect #22332
Conversation
Size Change: 0 B Total Size: 1.05 MB ℹ️ View Unchanged
|
WalkthroughThe recent updates involve several refinements to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Review Details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Files selected for processing (4)
- frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendar.tsx (1 hunks)
- frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendarSelect.tsx (5 hunks)
- frontend/src/scenes/annotations/AnnotationModal.tsx (2 hunks)
- frontend/src/scenes/plugins/edit/interface-jobs/PluginJobConfiguration.tsx (2 hunks)
Files skipped from review due to trivial changes (1)
- frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendarSelect.tsx
Additional comments not posted (1)
frontend/src/lib/lemon-ui/LemonCalendar/LemonCalendar.tsx (1)
69-71
: Adjustment in the calculation ofendOfMonth
to address the dayjs library issue looks good.Verification successful
The new
endOfMonth
calculation is used in three places withinLemonCalendar.tsx
:
- Line 69:
const endOfMonth = startOfMonth.add(1, 'day').endOf('month')
- Line 71:
const lastDay = endOfMonth.add((((weekStartDay + 6) % 7) - endOfMonth.day() + 7) % 7, 'days')
- Line 73:
'opacity-25': date.isBefore(startOfMonth) || date.isAfter(endOfMonth)
These usages are consistent with the intended workaround for the dayjs issue and should integrate well with the rest of the application.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the new `endOfMonth` calculation integrates well with the rest of the application. # Test: Search for any potential side effects in the usage of `endOfMonth`. rg --type typescript $'endOfMonth'Length of output: 68
Script:
#!/bin/bash # Description: Verify that the new `endOfMonth` calculation integrates well with the rest of the application. # Test: Search for any potential side effects in the usage of `endOfMonth`. rg --type ts 'endOfMonth'Length of output: 505
showSecond={false} | ||
format={ANNOTATION_DAYJS_FORMAT} | ||
/> | ||
<LemonCalendarSelectInput showTime /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
Instances of DatePicker
still exist in the codebase and need to be replaced with LemonCalendarSelectInput
:
frontend/src/scenes/insights/RetentionDatePicker.tsx
frontend/src/scenes/experiments/ExperimentView/ExperimentDates.tsx
frontend/src/queries/nodes/InsightViz/InsightDisplayConfig.tsx
frontend/src/lib/components/PropertyFilters/components/PropertyValue.tsx
frontend/src/lib/components/PropertyFilters/components/PropertyFilterDatePicker.tsx
frontend/src/lib/components/DatePicker.tsx
frontend/src/lib/components/DateFilter/DateFilter.tsx
Analysis chain
Replacement of DatePicker with LemonCalendarSelectInput looks good.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that LemonCalendarSelectInput integrates well with the rest of the application.
# Test: Search for any remaining instances of DatePicker that should have been replaced.
rg --type typescript $'DatePicker'
Length of output: 68
Script:
#!/bin/bash
# Description: Verify that LemonCalendarSelectInput integrates well with the rest of the application.
# Test: Search for any remaining instances of DatePicker that should have been replaced.
rg --type ts $'DatePicker'
rg --type tsx $'DatePicker'
Length of output: 4063
<LemonCalendarSelectInput | ||
clearable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tip
Codebase Verification
The search results indicate that there are still multiple instances of DatePicker
in the codebase that have not been replaced with LemonCalendarSelectInput
. These instances are found in various files, including PropertyFilterDatePicker.tsx
, PropertyValue.tsx
, DatePicker.tsx
, DateFilter.tsx
, RetentionDatePicker.tsx
, ExperimentDates.tsx
, and InsightDisplayConfig.tsx
.
To ensure consistency and complete the transition to LemonCalendarSelectInput
, these instances should be reviewed and updated accordingly.
- Files with remaining
DatePicker
instances:frontend/src/lib/components/PropertyFilters/components/PropertyFilterDatePicker.tsx
frontend/src/lib/components/PropertyFilters/components/PropertyValue.tsx
frontend/src/lib/components/DatePicker.tsx
frontend/src/lib/components/DateFilter/DateFilter.tsx
frontend/src/scenes/insights/RetentionDatePicker.tsx
frontend/src/scenes/experiments/ExperimentView/ExperimentDates.tsx
frontend/src/queries/nodes/InsightViz/InsightDisplayConfig.tsx
Analysis chain
Replacement of DatePicker with LemonCalendarSelectInput for date fields looks good.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify that LemonCalendarSelectInput integrates well with the rest of the application.
# Test: Search for any remaining instances of DatePicker that should have been replaced.
rg --type typescript $'DatePicker'
Length of output: 68
Script:
#!/bin/bash
# Description: Verify that LemonCalendarSelectInput integrates well with the rest of the application.
# Test: Search for any remaining instances of DatePicker that should have been replaced.
rg --type ts,tsx 'DatePicker'
Length of output: 60
Script:
#!/bin/bash
# Description: Verify that LemonCalendarSelectInput integrates well with the rest of the application.
# Test: Search for any remaining instances of DatePicker that should have been replaced.
rg --type ts 'DatePicker'
rg --type tsx 'DatePicker'
Length of output: 4063
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
Problem
towards #13624
Changes