-
Notifications
You must be signed in to change notification settings - Fork 415
new note button + daily note structure #1558
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
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughAdds 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
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
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
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"
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
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.
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) andgetDate()without zero-padding, which could be confusing and produces inconsistent string lengths. Consider usingformat(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
📒 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.tsxapps/desktop2/src/components/main/sidebar/profile/index.tsxapps/desktop2/src/components/main/body/daily.tsxapps/desktop2/src/components/main/body/shared.tsxapps/desktop2/src/components/main/body/index.tsxapps/desktop2/src/store/zustand/tabs.tsapps/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.
No description provided.