[WEB-4874]fix: calendar picker build errors and styles override#7762
[WEB-4874]fix: calendar picker build errors and styles override#7762
Conversation
WalkthroughTypes were tightened for Calendar onSelect handlers (Date | undefined or DateRange | undefined). In analytics/total-insights, the i18n function parameter type was refined and an unused destructured field (selectedDurationLabel) was removed. No runtime behavior or public API changes. Changes
Sequence Diagram(s)Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
Pre-merge checks (2 passed, 1 warning)❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
apps/web/core/components/inbox/modals/snooze-issue-modal.tsx (1)
68-72: Runtime bug:close()is undefined — callhandleClose()instead.
Clicking the button will throw at runtime.Apply this diff:
- <Button + <Button variant="primary" onClick={() => { - close(); - onConfirm(date); + handleClose(); + onConfirm(date); }} >apps/web/core/components/core/filters/date-filter-modal.tsx (1)
47-50: Bug:date2watchesdate1, breaking validation and disabling logic.
This makesisInvalidanddisabledchecks unreliable.-const date1 = getDate(watch("date1")); -const date2 = getDate(watch("date1")); +const date1 = getDate(watch("date1")); +const date2 = getDate(watch("date2"));
🧹 Nitpick comments (3)
apps/web/core/components/inbox/modals/snooze-issue-modal.tsx (1)
54-56: Avoid redundantnew Datewrapping on every render.
dateis already aDate; cloning each render is unnecessary.- selected={date ? new Date(date) : undefined} - defaultMonth={date ? new Date(date) : undefined} + selected={date || undefined} + defaultMonth={date || undefined}apps/web/core/components/dropdowns/date-range.tsx (1)
277-279: onSelect typing matches new Calendar signature — consider updating local state too.
Current code relies on the parent to reflect selection; updating local state improves UX in controlled+local scenarios.- onSelect={(val: DateRange | undefined) => { - onSelect?.(val); - }} + onSelect={(val: DateRange | undefined) => { + setDateRange(val ?? { from: undefined, to: undefined }); + onSelect?.(val); + }}apps/web/core/components/analytics/total-insights.tsx (1)
55-69: SWR key includesselectedDurationbut fetcher ignores it.
Either include it in the request or drop it from the key to avoid unnecessary cache busts.- `total-insights-${analyticsType}-${selectedDuration}-${selectedProjects}-${selectedCycle}-${selectedModule}-${isEpic}`, + `total-insights-${analyticsType}-${selectedProjects}-${selectedCycle}-${selectedModule}-${isEpic}`,Or uncomment and pass
date_filter: selectedDurationin the payload.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
apps/web/core/components/analytics/total-insights.tsx(2 hunks)apps/web/core/components/core/filters/date-filter-modal.tsx(2 hunks)apps/web/core/components/dropdowns/date-range.tsx(1 hunks)apps/web/core/components/dropdowns/date.tsx(1 hunks)apps/web/core/components/inbox/modals/snooze-issue-modal.tsx(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
apps/web/core/components/dropdowns/date-range.tsx (1)
packages/propel/src/calendar/index.ts (1)
DateRange(2-2)
apps/web/core/components/analytics/total-insights.tsx (1)
packages/i18n/src/store/index.ts (1)
t(224-245)
🔇 Additional comments (6)
apps/web/core/components/inbox/modals/snooze-issue-modal.tsx (1)
56-59: onSelect typing aligns with Calendar update — looks good.
The explicitDate | undefinedparam matches the updated calendar API. No behavior change.apps/web/core/components/core/filters/date-filter-modal.tsx (2)
104-107: onSelect typing: OK.
ExplicitDate | undefinedimproves type safety without behavior change.
129-132: Second calendar onSelect typing: OK.
Consistent with the first calendar and the updated API.apps/web/core/components/dropdowns/date.tsx (1)
185-187: onSelect typing: looks good.
date ?? nullkeeps the publiconChange(Date | null)contract intact.apps/web/core/components/analytics/total-insights.tsx (2)
22-22: t() parameter typing aligned with i18n store — good.
Matchest(key: string, params?: Record<string, unknown>): string.
53-53: RemovedselectedDurationLabelfrom destructuring — fine.
No downstream usage here; safe cleanup.
|
Pull Request Linked with Plane Work Items
Comment Automatically Generated by Plane |
…plane#7762) * fix: calender picker build errors * fix: styles override in the picker implementation
Description
This update fixes the build errors caused by calendar picker's version update and also the styles override in the calendar picker implementation.
Type of Change
Screenshots and Media (if applicable)
Test Scenarios
References
Summary by CodeRabbit