Skip to content

Conversation

@duckduckhero
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Oct 11, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

Adds a "daily" tab variant: new TabItemDaily and TabContentDaily components, wiring in body render logic, sidebar controls to open daily and session notes, updates to TabItemBase prop signatures/styling, and store updates for the daily tab type and its unique ID handling.

Changes

Cohort / File(s) Summary of changes
Daily tab UI components
apps/desktop2/src/components/main/body/daily.tsx
Adds TabItemDaily and TabContentDaily for type: "daily"; renders date header and sample Task/Email/Event sections; uses date-fns and lucide-react; guards non-daily tabs.
Body wiring for daily
apps/desktop2/src/components/main/body/index.tsx
Imports and renders TabItemDaily and TabContentDaily when tab.type === "daily".
Shared TabItem API & styling
apps/desktop2/src/components/main/body/shared.tsx
Adds group class and opacity-based hover for close button; updates TabItemBase props to handleClose: () => void and handleSelect: () => void.
Sidebar: new note button
apps/desktop2/src/components/main/sidebar/new-note-button.tsx, apps/desktop2/src/components/main/sidebar/index.tsx
Adds NewNoteButton component and renders it in sidebar; button calls openNew to create a sessions tab with id: crypto.randomUUID() and state.editor = "raw".
Profile daily action
apps/desktop2/src/components/main/sidebar/profile/index.tsx
Replaces console logging with openNew({ type: "daily", date: new Date(), active: true }) and closes the menu after opening.
Tabs store: daily variant
apps/desktop2/src/store/zustand/tabs.ts
Extends tab schema with type: "daily", date: z.coerce.date(); rowIdfromTab treats daily as invalid (throws); uniqueIdfromTab returns daily-YYYY-MM-DD.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Sidebar as "Sidebar Profile Menu"
  participant TabsStore as "Tabs Store"
  participant Body as "Main Body"
  Note over User,Sidebar: Open Daily Note
  User->>Sidebar: Click "Daily note"
  Sidebar->>TabsStore: openNew({ type: "daily", date: today, active: true })
  TabsStore-->>Sidebar: Tab created
  Sidebar-->>Body: State update (active daily tab)
  Body->>Body: Render TabItemDaily / TabContentDaily
  Note over Body: Shows date header, Task/Email/Event sections
Loading
sequenceDiagram
  autonumber
  actor User
  participant NewNote as "NewNoteButton"
  participant TabsStore as "Tabs Store"
  Note over User,NewNote: Create Session Note
  User->>NewNote: Click "Create new note"
  NewNote->>TabsStore: openNew({ type: "sessions", id: UUID, active: true, state: { editor: "raw" } })
  TabsStore-->>NewNote: Tab created
Loading
sequenceDiagram
  autonumber
  participant Body as "Main Body"
  participant TabsStore as "Tabs Store"
  Note over Body,TabsStore: Tab identity helpers
  Body->>TabsStore: uniqueIdfromTab(daily)
  TabsStore-->>Body: "daily-YYYY-MM-DD"
  Body->>TabsStore: rowIdfromTab(daily)
  TabsStore-->>Body: throw "invalid_resource"
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
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.
Description Check ❓ Inconclusive The pull request description is empty and does not provide any information about the changeset, so its relevance to the modifications cannot be evaluated. Please add a descriptive summary of the changes, including the purpose and scope of the new note button and daily note components, to help reviewers understand the intended impact.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The title clearly summarizes the two primary features introduced—the new note button and the daily note structure—matching the main changes in the pull request and providing a concise, accurate overview of the update.

📜 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 a41ff32 and b22a214.

📒 Files selected for processing (1)
  • apps/desktop2/src/components/main/sidebar/new-note-button.tsx (1 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: 2

🧹 Nitpick comments (1)
apps/desktop2/src/store/zustand/tabs.ts (1)

218-219: Prefer date-fns format for consistent date strings.

The current implementation uses getMonth() (0-indexed, 0-11) and getDate() without zero-padding, which could be confusing and produces inconsistent string lengths. Consider using format(tab.date, 'yyyy-MM-dd') from date-fns for clarity and consistency.

Apply this diff:

+import { format } from "date-fns";
+
 // ... existing code ...

     case "daily":
-      return `daily-${tab.date.getFullYear()}-${tab.date.getMonth()}-${tab.date.getDate()}`;
+      return `daily-${format(tab.date, 'yyyy-MM-dd')}`;
📜 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 f64efc5 and 0af9644.

📒 Files selected for processing (7)
  • apps/desktop2/src/components/main/body/daily.tsx (1 hunks)
  • apps/desktop2/src/components/main/body/index.tsx (3 hunks)
  • apps/desktop2/src/components/main/body/shared.tsx (2 hunks)
  • apps/desktop2/src/components/main/sidebar/index.tsx (2 hunks)
  • apps/desktop2/src/components/main/sidebar/new-note-button.tsx (1 hunks)
  • apps/desktop2/src/components/main/sidebar/profile/index.tsx (1 hunks)
  • apps/desktop2/src/store/zustand/tabs.ts (3 hunks)
🧰 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/sidebar/index.tsx
  • apps/desktop2/src/components/main/sidebar/profile/index.tsx
  • apps/desktop2/src/components/main/body/daily.tsx
  • apps/desktop2/src/components/main/body/shared.tsx
  • apps/desktop2/src/components/main/body/index.tsx
  • apps/desktop2/src/store/zustand/tabs.ts
  • apps/desktop2/src/components/main/sidebar/new-note-button.tsx
🧬 Code graph analysis (4)
apps/desktop2/src/components/main/sidebar/index.tsx (1)
apps/desktop2/src/components/main/sidebar/new-note-button.tsx (1)
  • NewNoteButton (5-26)
apps/desktop2/src/components/main/body/daily.tsx (3)
apps/desktop2/src/components/main/body/shared.tsx (2)
  • TabItem (5-9)
  • TabItemBase (11-53)
packages/utils/src/datetime.ts (1)
  • format (4-11)
apps/desktop2/src/store/zustand/tabs.ts (1)
  • Tab (180-180)
apps/desktop2/src/components/main/body/index.tsx (1)
apps/desktop2/src/components/main/body/daily.tsx (2)
  • TabItemDaily (7-17)
  • TabContentDaily (19-67)
apps/desktop2/src/components/main/sidebar/new-note-button.tsx (2)
apps/desktop2/src/store/zustand/tabs.ts (1)
  • useTabs (31-121)
packages/ui/src/components/ui/button.tsx (1)
  • Button (37-89)
⏰ 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)
🔇 Additional comments (6)
apps/desktop2/src/components/main/sidebar/index.tsx (1)

5-5: LGTM!

The NewNoteButton is correctly imported and positioned in the sidebar layout.

Also applies to: 31-31

apps/desktop2/src/components/main/body/index.tsx (1)

10-10: LGTM!

The daily tab components are correctly integrated into the tab rendering logic, following the same pattern as other tab types.

Also applies to: 97-99, 124-126

apps/desktop2/src/components/main/body/shared.tsx (1)

11-19: LGTM!

The refactor simplifies TabItemBase by removing tab parameters from handlers. The group-hover styling improvement makes the close button behavior more intuitive. All call sites correctly adapt by wrapping handlers with arrow functions.

Also applies to: 24-24, 43-46

apps/desktop2/src/components/main/sidebar/new-note-button.tsx (1)

5-26: LGTM!

The button correctly creates a new session tab using the tabs store. The implementation follows the established pattern for tab creation.

apps/desktop2/src/store/zustand/tabs.ts (1)

174-177: LGTM!

The daily tab variant is correctly added to the schema with a date field.

apps/desktop2/src/components/main/body/daily.tsx (1)

19-67: LGTM!

The TabContentDaily component correctly guards against non-daily tabs and provides a clear daily note structure. The hardcoded sample data serves as a useful placeholder for the initial implementation.

@yujonglee yujonglee merged commit 85f7c4e into main Oct 11, 2025
4 of 5 checks passed
@yujonglee yujonglee deleted the ui-fix-1011 branch October 11, 2025 12:03
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.

3 participants