-
Notifications
You must be signed in to change notification settings - Fork 416
Refactor timeline sidebar #1571
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
📝 WalkthroughWalkthroughRemoves Windows from two CI matrices. Refactors FolderChain to accept sessionId and always render, deriving folder/title from store. Replaces the old sidebar timeline module with a new bucketed TimelineView and supporting hooks/components (anchor handling, item rendering, and realtime indicator). Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Header as Outer Header
participant Store as Sessions Store
participant FC as FolderChain
User->>Header: Open session view
Header->>FC: Render FolderChain(sessionId)
FC->>Store: Lookup session by sessionId
alt folderId exists
FC->>FC: Build reversed folder list
FC-->>Header: Render folder trail + title
else no folderId
FC-->>Header: Render root placeholder + title
end
sequenceDiagram
autonumber
actor User
participant TL as TimelineView
participant Data as useTimelineData
participant Anchor as useAnchor (Today)
participant Item as TimelineItemComponent
participant Tabs as Tabs Store
participant UI as Persisted UI Store
participant RT as useCurrentTime/CurrentTimeIndicator
User->>TL: Open sidebar
TL->>Data: Build buckets (events/sessions)
TL->>Anchor: Init (isAnchorActive/autoScroll)
Anchor-->>TL: {containerRef, visibility, scrollToAnchor}
TL->>RT: Start time updates
RT-->>TL: Current time ticks
TL->>TL: Render buckets (incl. TodayBucket)
User->>TL: Click "Scroll to Today"
TL->>Anchor: scrollToAnchor()
User->>Item: Click timeline item
Item->>Tabs: Open existing/new session tab
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (9)
.github/workflows/desktop2_ci.yaml(0 hunks).github/workflows/desktop_ci.yaml(0 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/folder.tsx(2 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/index.tsx(1 hunks)apps/desktop2/src/components/main/sidebar/timeline.tsx(0 hunks)apps/desktop2/src/components/main/sidebar/timeline/anchor.ts(1 hunks)apps/desktop2/src/components/main/sidebar/timeline/index.tsx(1 hunks)apps/desktop2/src/components/main/sidebar/timeline/item.tsx(1 hunks)apps/desktop2/src/components/main/sidebar/timeline/realtime.tsx(1 hunks)
💤 Files with no reviewable changes (3)
- .github/workflows/desktop2_ci.yaml
- .github/workflows/desktop_ci.yaml
- apps/desktop2/src/components/main/sidebar/timeline.tsx
🧰 Additional context used
📓 Path-based instructions (2)
apps/desktop2/**/*.{tsx,jsx}
📄 CodeRabbit inference engine (apps/desktop2/.cursor/rules/style.mdc)
apps/desktop2/**/*.{tsx,jsx}: When there are many Tailwind classNames with conditional logic, use the cn utility imported asimport { cn } from "@hypr/ui/lib/utils"
Always pass an array to cn when composing Tailwind classNames
Split cn array entries by logical grouping when composing Tailwind classNames
Files:
apps/desktop2/src/components/main/sidebar/timeline/realtime.tsxapps/desktop2/src/components/main/sidebar/timeline/item.tsxapps/desktop2/src/components/main/body/sessions/outer-header/index.tsxapps/desktop2/src/components/main/body/sessions/outer-header/folder.tsxapps/desktop2/src/components/main/sidebar/timeline/index.tsx
**/*.{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/timeline/realtime.tsxapps/desktop2/src/components/main/sidebar/timeline/item.tsxapps/desktop2/src/components/main/body/sessions/outer-header/index.tsxapps/desktop2/src/components/main/body/sessions/outer-header/folder.tsxapps/desktop2/src/components/main/sidebar/timeline/index.tsxapps/desktop2/src/components/main/sidebar/timeline/anchor.ts
🧬 Code graph analysis (3)
apps/desktop2/src/components/main/sidebar/timeline/item.tsx (4)
apps/desktop2/src/utils/timeline.ts (2)
TimelineItem(24-26)TimelinePrecision(28-28)apps/desktop2/src/store/zustand/tabs.ts (1)
useTabs(99-271)apps/desktop2/src/components/interactive-button.tsx (1)
InteractiveButton(13-55)packages/ui/src/lib/utils.ts (1)
cn(4-6)
apps/desktop2/src/components/main/body/sessions/outer-header/index.tsx (1)
apps/desktop2/src/components/main/body/sessions/outer-header/folder.tsx (1)
FolderChain(6-17)
apps/desktop2/src/components/main/sidebar/timeline/index.tsx (6)
apps/desktop2/src/components/main/sidebar/timeline/anchor.ts (1)
useAnchor(3-75)packages/ui/src/lib/utils.ts (1)
cn(4-6)apps/desktop2/src/components/main/sidebar/timeline/item.tsx (1)
TimelineItemComponent(12-139)packages/ui/src/components/ui/button.tsx (1)
Button(37-89)apps/desktop2/src/utils/timeline.ts (4)
TimelineItem(24-26)TimelinePrecision(28-28)TimelineBucket(30-34)buildTimelineBuckets(112-198)apps/desktop2/src/components/main/sidebar/timeline/realtime.tsx (2)
useCurrentTime(9-21)CurrentTimeIndicator(3-7)
⏰ 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). (1)
- GitHub Check: ci (macos, macos-14)
No description provided.