Skip to content

Conversation

@yujonglee
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Oct 8, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds a calendars tab type and calendar UI to the main area, replaces id-based tab equality with a new isSameTab helper across hooks and routing, updates tab schema and helpers, removes an old calendar component and the eventsByMonth index in persisted store, and tightens sidebar session active checks.

Changes

Cohort / File(s) Summary
Tab schema & helpers
apps/desktop2/src/types/index.ts
Replaces generic tab schema with an explicit union including calendars; adds rowIdfromTab, uniqueIdfromTab, and isSameTab helpers.
Tabs state & routing equality
apps/desktop2/src/hooks/useTabs.ts, apps/desktop2/src/routes/app/main/_layout.index.tsx
Replaces id-based comparisons with isSameTab across openNew/openCurrent/select/close and route active resolution; adapts mapping/filtering to handle nulls when collapsing duplicates.
Main area: calendar integration
apps/desktop2/src/components/main/main-area.tsx
Introduces calendar tab items and content renderers (TabItemCalendar, TabContentCalendar, day/event subcomponents), switches tab keys to uniqueIdfromTab, and adds header action to open new calendar tabs.
Sidebar session active logic
apps/desktop2/src/components/main/left-sidebar.tsx
Restricts SessionItem activation to tabs where currentTab.type === "sessions" and ids match.
Calendar component removal
apps/desktop2/src/components/calendar.tsx
Deletes the previous standalone Calendar component and its export.
Persisted store index removal & formatting
apps/desktop2/src/tinybase/store/persisted.ts
Replaces ISO-based date slicing with format(d, "yyyy-MM-dd") and removes eventsByMonth index and its export from INDEXES.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant MainHeader as MainHeader
  participant useTabs as useTabs.openNew
  participant TabsState as Tabs State

  User->>MainHeader: Click "New Calendar"
  MainHeader->>useTabs: openNew({ type: "calendars", month, active: true })
  useTabs->>useTabs: Filter existing with !isSameTab(t, tab)
  useTabs->>TabsState: Append new active calendar tab
  TabsState-->>MainHeader: Updated tabs
  MainHeader-->>User: Calendar tab appears active
Loading
sequenceDiagram
  autonumber
  participant UI as TabsHeader/Item
  participant useTabs as useTabs.select / useTabs.close
  participant TabsState as Tabs State

  UI->>useTabs: select(tab)
  useTabs->>TabsState: Map tabs: active = isSameTab(t, tab)

  UI->>useTabs: close(tab)
  useTabs->>useTabs: Remove with !isSameTab(t, tab)
  useTabs->>useTabs: Compute next active index
  useTabs->>TabsState: Update tabs with single active
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request description is missing and provides no information about the changes made, leaving the description unrelated to the content of the changeset. Please provide a descriptive summary of the changes made in this pull request, outlining the key modifications and objectives to help reviewers understand and evaluate the update.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly and concisely summarizes the main change of porting the calendar UI without extraneous detail or noise, matching the primary objective of the changeset.

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c93e9f9 and cd70617.

📒 Files selected for processing (2)
  • apps/desktop2/src/components/main/main-area.tsx (8 hunks)
  • apps/desktop2/src/tinybase/store/persisted.ts (2 hunks)

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/desktop2/src/components/main/main-area.tsx (1)

4-158: Import ReactNode to satisfy the type annotation.
Line 156 references React.ReactNode, but React is never imported, causing a TypeScript compile-time failure. Pulling in ReactNode explicitly avoids the namespace lookup and keeps tree-shaking intact.

+import type { ReactNode } from "react";
-import { eachDayOfInterval, endOfMonth, startOfMonth } from "date-fns";
+import { eachDayOfInterval, endOfMonth, format, startOfMonth } from "date-fns";

-function TabItemBase(
-  { icon, title, active, handleClose, handleSelect }: {
-    icon: React.ReactNode;
+function TabItemBase(
+  { icon, title, active, handleClose, handleSelect }: {
+    icon: ReactNode;
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between be64ea7 and c93e9f9.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (7)
  • apps/desktop2/src/components/calendar.tsx (0 hunks)
  • apps/desktop2/src/components/main/left-sidebar.tsx (1 hunks)
  • apps/desktop2/src/components/main/main-area.tsx (9 hunks)
  • apps/desktop2/src/hooks/useTabs.ts (4 hunks)
  • apps/desktop2/src/routes/app/main/_layout.index.tsx (2 hunks)
  • apps/desktop2/src/tinybase/store/persisted.ts (0 hunks)
  • apps/desktop2/src/types/index.ts (1 hunks)
💤 Files with no reviewable changes (2)
  • apps/desktop2/src/components/calendar.tsx
  • apps/desktop2/src/tinybase/store/persisted.ts
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{js,ts,tsx,rs}

⚙️ CodeRabbit configuration file

**/*.{js,ts,tsx,rs}: 1. Do not add any error handling. Keep the existing one.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".

Files:

  • apps/desktop2/src/components/main/left-sidebar.tsx
  • apps/desktop2/src/routes/app/main/_layout.index.tsx
  • apps/desktop2/src/types/index.ts
  • apps/desktop2/src/components/main/main-area.tsx
  • apps/desktop2/src/hooks/useTabs.ts
🧬 Code graph analysis (4)
apps/desktop2/src/routes/app/main/_layout.index.tsx (1)
apps/desktop2/src/types/index.ts (1)
  • isSameTab (67-69)
apps/desktop2/src/types/index.ts (1)
apps/desktop2/src/tinybase/store/persisted.ts (1)
  • TABLES (221-221)
apps/desktop2/src/components/main/main-area.tsx (2)
apps/desktop2/src/hooks/useTabs.ts (1)
  • useTabs (4-83)
apps/desktop2/src/types/index.ts (3)
  • uniqueIdfromTab (54-65)
  • Tab (39-39)
  • rowIdfromTab (41-52)
apps/desktop2/src/hooks/useTabs.ts (1)
apps/desktop2/src/types/index.ts (2)
  • isSameTab (67-69)
  • Tab (39-39)
⏰ 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)
  • GitHub Check: ci (windows, windows-latest)
  • GitHub Check: ci (macos, macos-14)

@yujonglee yujonglee merged commit b8cda04 into main Oct 8, 2025
5 of 6 checks passed
@yujonglee yujonglee deleted the calendar-ui-porting branch October 8, 2025 05:57
@coderabbitai coderabbitai bot mentioned this pull request Oct 23, 2025
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.

2 participants