Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughPropagates Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor U as User
participant T as TabContentNote
participant OH as OuterHeader
participant EV as SessionEvent (EventChip)
participant PC as SessionParticipants (ParticipantsChip)
participant Q as useQuery
participant S as TinyBase Store
U->>T: open session tab
T->>OH: render(sessionRow, sessionId)
OH->>S: read session cells (event_id, created_at, mapping_session_participant)
OH->>EV: render with derived event + callbacks
OH->>PC: render with participant groups + callbacks
alt search events
U->>EV: set search query
EV->>Q: fetch/filter events (enabled)
Q-->>EV: results
end
alt select event
U->>EV: select event
EV->>S: setCell(sessionId, "event_id", event.id)
EV->>S: setCell(sessionId, "created_at", event.start_date)
EV-->>U: close popover
end
alt add participant
U->>PC: select/add participant
PC->>S: create mapping_session_participant linking sessionId & humanId
PC-->>U: update UI
end
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)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
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: 2
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/desktop2/src/components/main/body/sessions/index.tsx(1 hunks)apps/desktop2/src/components/main/body/sessions/outer-header.tsx(2 hunks)packages/ui/src/components/block/event-chip.tsx(1 hunks)packages/ui/src/components/block/participants-chip.tsx(1 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:
packages/ui/src/components/block/event-chip.tsxapps/desktop2/src/components/main/body/sessions/index.tsxpackages/ui/src/components/block/participants-chip.tsxapps/desktop2/src/components/main/body/sessions/outer-header.tsx
🧬 Code graph analysis (4)
packages/ui/src/components/block/event-chip.tsx (2)
packages/ui/src/lib/utils.ts (1)
cn(4-6)packages/ui/src/components/ui/button.tsx (1)
Button(37-89)
apps/desktop2/src/components/main/body/sessions/index.tsx (1)
apps/desktop2/src/components/main/body/sessions/outer-header.tsx (1)
OuterHeader(8-180)
packages/ui/src/components/block/participants-chip.tsx (4)
packages/ui/src/components/ui/popover.tsx (3)
Popover(85-85)PopoverTrigger(85-85)PopoverContent(85-85)packages/utils/src/string.ts (1)
getInitials(1-12)packages/ui/src/lib/utils.ts (1)
cn(4-6)packages/ui/src/components/ui/avatar.tsx (2)
Avatar(58-58)AvatarFallback(58-58)
apps/desktop2/src/components/main/body/sessions/outer-header.tsx (2)
packages/ui/src/components/block/event-chip.tsx (2)
Event(42-50)EventChip(69-180)packages/ui/src/components/block/participants-chip.tsx (2)
Participant(6-16)ParticipantsChip(38-123)
⏰ 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 (windows, windows-latest)
🔇 Additional comments (1)
apps/desktop2/src/components/main/body/sessions/index.tsx (1)
54-54: Looks good.Passing
sessionIdkeeps the header in sync with the new API.
apps/desktop2/src/components/main/body/sessions/outer-header.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
apps/desktop2/src/components/main/body/sessions/index.tsx(1 hunks)apps/desktop2/src/components/main/body/sessions/outer-header.tsx(2 hunks)packages/ui/src/components/block/event-chip.tsx(1 hunks)packages/ui/src/components/block/participants-chip.tsx(1 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/body/sessions/index.tsxapps/desktop2/src/components/main/body/sessions/outer-header.tsxpackages/ui/src/components/block/participants-chip.tsxpackages/ui/src/components/block/event-chip.tsx
🧬 Code graph analysis (4)
apps/desktop2/src/components/main/body/sessions/index.tsx (1)
apps/desktop2/src/components/main/body/sessions/outer-header.tsx (1)
OuterHeader(8-180)
apps/desktop2/src/components/main/body/sessions/outer-header.tsx (2)
packages/ui/src/components/block/event-chip.tsx (2)
Event(42-50)EventChip(69-180)packages/ui/src/components/block/participants-chip.tsx (2)
Participant(6-16)ParticipantsChip(38-123)
packages/ui/src/components/block/participants-chip.tsx (4)
packages/ui/src/components/ui/popover.tsx (3)
Popover(85-85)PopoverTrigger(85-85)PopoverContent(85-85)packages/utils/src/string.ts (1)
getInitials(1-12)packages/ui/src/lib/utils.ts (1)
cn(4-6)packages/ui/src/components/ui/avatar.tsx (2)
Avatar(58-58)AvatarFallback(58-58)
packages/ui/src/components/block/event-chip.tsx (2)
packages/ui/src/lib/utils.ts (1)
cn(4-6)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). (1)
- GitHub Check: ci (windows, windows-latest)
apps/desktop2/src/components/main/body/sessions/outer-header.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
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/body/sessions/outer-header.tsx (1)
15-158: Make ParticipantsChip search controllable (and clear unused state).
ParticipantsChipis rendered withsearchQuery="", so the input can never change. Users can’t type, and the unusedparticipantSearchQuery/participantSearchResultsstate breaks our lint gate. Wire the chip to the local query state (and drop the unused results state for now).-import { Participant, ParticipantsChip } from "@hypr/ui/components/block/participants-chip"; +import { ParticipantsChip } from "@hypr/ui/components/block/participants-chip"; @@ - const [participantSearchQuery, setParticipantSearchQuery] = useState(""); - const [participantSearchResults, setParticipantSearchResults] = useState<Participant[]>([]); + const [participantSearchQuery, setParticipantSearchQuery] = useState(""); @@ - searchQuery="" - onSearchChange={(query) => { - console.log("Search query:", query); - }} - searchResults={[]} + searchQuery={participantSearchQuery} + onSearchChange={setParticipantSearchQuery} + searchResults={[]}
♻️ Duplicate comments (1)
packages/ui/src/components/block/event-chip.tsx (1)
15-33: Fix formatDate token replacement to prevent malformed dates.Sequential
replacecalls let shorter tokens (e.g.,"d") fire inside longer ones ("dd","EEE"), producing invalid strings like"2025-10-1515"for"yyyy-MM-dd". That breaks the<input type="date">binding and any tooltip using the formatter. Swap to a single regex that matches the known tokens once, longest-first.- let result = format; - Object.entries(replacements).forEach(([key, value]) => { - result = result.replace(new RegExp(key, "g"), value); - }); - - return result; + const tokenPattern = new RegExp( + Object.keys(replacements) + .sort((a, b) => b.length - a.length) + .join("|"), + "g", + ); + + return format.replace(tokenPattern, (token) => replacements[token]);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
apps/desktop2/src/components/main/body/sessions/outer-header.tsx(2 hunks)apps/desktop2/src/hooks/useQuery.ts(1 hunks)apps/desktop2/src/store/seed.ts(7 hunks)apps/desktop2/src/store/tinybase/persisted.ts(5 hunks)packages/db/src/schema.ts(2 hunks)packages/ui/src/components/block/event-chip.tsx(1 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:
packages/ui/src/components/block/event-chip.tsxapps/desktop2/src/store/seed.tspackages/db/src/schema.tsapps/desktop2/src/store/tinybase/persisted.tsapps/desktop2/src/hooks/useQuery.tsapps/desktop2/src/components/main/body/sessions/outer-header.tsx
🧬 Code graph analysis (5)
packages/ui/src/components/block/event-chip.tsx (2)
packages/ui/src/lib/utils.ts (1)
cn(4-6)packages/ui/src/components/ui/button.tsx (1)
Button(37-89)
apps/desktop2/src/store/seed.ts (2)
apps/desktop2/src/store/tinybase/persisted.ts (1)
mappingSessionParticipant(117-117)packages/db/src/schema.ts (1)
mappingSessionParticipant(63-67)
packages/db/src/schema.ts (1)
apps/desktop2/src/store/tinybase/persisted.ts (2)
mappingSessionParticipant(117-117)mappingSessionParticipantSchema(70-72)
apps/desktop2/src/store/tinybase/persisted.ts (2)
packages/db/src/schema.ts (2)
mappingSessionParticipantSchema(142-142)mappingSessionParticipant(63-67)apps/desktop2/src/store/tinybase/shared.ts (1)
InferTinyBaseSchema(30-33)
apps/desktop2/src/components/main/body/sessions/outer-header.tsx (3)
packages/ui/src/components/block/participants-chip.tsx (2)
Participant(6-16)ParticipantsChip(38-123)packages/ui/src/components/block/event-chip.tsx (2)
Event(42-50)EventChip(68-177)apps/desktop2/src/hooks/useQuery.ts (1)
useQuery(3-40)
⏰ 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 (windows, windows-latest)
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
apps/desktop2/src/store/tinybase/persisted.ts (1)
117-117: Restore PascalCase type alias for public API stability.The exported alias dropped to lowerCamelCase, breaking consumers expecting
MappingSessionParticipant. Please revert to PascalCase.-export type mappingSessionParticipant = z.infer<typeof mappingSessionParticipantSchema>; +export type MappingSessionParticipant = z.infer<typeof mappingSessionParticipantSchema>;
🧹 Nitpick comments (5)
apps/desktop2/src/components/main/body/sessions/outer-header/listen.tsx (1)
3-9: Unused sessionRow parameter and missing functionality.The
sessionRowparameter is unused (indicated by the_prefix). The button is currently static with no click handler or functionality.Consider either:
- Removing the
sessionRowparameter if it won't be needed, or- Adding a TODO comment explaining the planned functionality, or
- Implementing the intended "Start listening" behavior
apps/desktop2/src/components/main/body/sessions/outer-header/share.tsx (1)
3-9: Unused sessionRow parameter and missing functionality.The
sessionRowparameter is unused (indicated by the_prefix). The button lacks a click handler and has no sharing functionality implemented.Consider implementing the sharing behavior or adding a TODO comment to document the planned functionality.
apps/desktop2/src/components/main/body/sessions/outer-header/recording.tsx (1)
3-9: Hardcoded recording time and unused sessionRow parameter.The recording duration "02:27" is hardcoded and the
sessionRowparameter is unused. This likely should display actual recording data from the session.Consider:
- Implementing logic to derive recording duration from
sessionRow- Adding a click handler for playback/recording control
- Or adding a TODO comment documenting the planned implementation
apps/desktop2/src/components/main/body/sessions/outer-header/other.tsx (1)
3-9: Missing menu functionality.The
sessionRowparameter is unused, and there's no click handler or dropdown menu implementation for the ellipsis button.Consider implementing the context menu or documenting the planned actions for this button.
apps/desktop2/src/components/main/body/sessions/outer-header/participant.tsx (1)
148-158: Inefficient "No organization" lookup.The code iterates through all organizations on every add operation to find "No organization". This is O(n) for each participant addition.
Consider caching the "No organization" ID or using an index lookup:
+ const noOrgId = useMemo(() => { + if (!store) return undefined; + let foundId: string | undefined; + store.forEachRow("organizations", (rowId, forEachCell) => { + let name: string | undefined; + forEachCell((cellId, cell) => { + if (cellId === "name") name = cell as string; + }); + if (name === "No organization") foundId = rowId; + }); + return foundId; + }, [store]); + const handleAdd = useCallback((query: string) => { if (!store) return; const humanId = crypto.randomUUID(); const userId = store.getCell("configs", "singleton", "user_id") as string; - let orgId: string | undefined; - store.forEachRow("organizations", (rowId, forEachCell) => { - let name: string | undefined; - forEachCell((cellId, cell) => { - if (cellId === "name") name = cell as string; - }); - if (name === "No organization") orgId = rowId; - }); + let orgId = noOrgId; if (!orgId) { orgId = crypto.randomUUID(); store.setRow("organizations", orgId, { user_id: userId, name: "No organization", created_at: new Date().toISOString(), }); } // ... rest of the function - }, [store, sessionId]); + }, [store, sessionId, noOrgId]);
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (11)
apps/desktop2/src/components/main/body/sessions/outer-header.tsx(0 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/event.tsx(1 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/folder.tsx(1 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/index.tsx(1 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/listen.tsx(1 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/other.tsx(1 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/participant.tsx(1 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/recording.tsx(1 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/share.tsx(1 hunks)apps/desktop2/src/components/main/body/sessions/outer-header/types.ts(1 hunks)apps/desktop2/src/store/tinybase/persisted.ts(7 hunks)
💤 Files with no reviewable changes (1)
- apps/desktop2/src/components/main/body/sessions/outer-header.tsx
🧰 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/body/sessions/outer-header/share.tsxapps/desktop2/src/components/main/body/sessions/outer-header/other.tsxapps/desktop2/src/components/main/body/sessions/outer-header/participant.tsxapps/desktop2/src/components/main/body/sessions/outer-header/index.tsxapps/desktop2/src/components/main/body/sessions/outer-header/types.tsapps/desktop2/src/components/main/body/sessions/outer-header/event.tsxapps/desktop2/src/store/tinybase/persisted.tsapps/desktop2/src/components/main/body/sessions/outer-header/recording.tsxapps/desktop2/src/components/main/body/sessions/outer-header/listen.tsxapps/desktop2/src/components/main/body/sessions/outer-header/folder.tsx
🧬 Code graph analysis (9)
apps/desktop2/src/components/main/body/sessions/outer-header/share.tsx (2)
apps/desktop2/src/components/main/body/sessions/outer-header/types.ts (1)
SessionRowProp(3-5)apps/desktop2/src/components/main/body/sessions/outer-header.tsx (1)
ShareButton(122-128)
apps/desktop2/src/components/main/body/sessions/outer-header/other.tsx (1)
apps/desktop2/src/components/main/body/sessions/outer-header/types.ts (1)
SessionRowProp(3-5)
apps/desktop2/src/components/main/body/sessions/outer-header/participant.tsx (2)
apps/desktop2/src/hooks/useQuery.ts (1)
useQuery(3-40)packages/ui/src/components/block/participants-chip.tsx (2)
Participant(6-16)ParticipantGroup(18-21)
apps/desktop2/src/components/main/body/sessions/outer-header/index.tsx (8)
apps/desktop2/src/components/main/body/sessions/outer-header/folder.tsx (1)
FolderChain(6-33)apps/desktop2/src/components/main/body/sessions/outer-header/event.tsx (1)
SessionEvent(7-131)apps/desktop2/src/components/main/body/sessions/outer-header/participant.tsx (1)
SessionParticipants(7-206)apps/desktop2/src/components/main/body/sessions/outer-header/recording.tsx (1)
RecordingButton(3-9)apps/desktop2/src/components/main/body/sessions/outer-header/listen.tsx (1)
ListenButton(3-9)apps/desktop2/src/components/main/body/sessions/outer-header/share.tsx (1)
ShareButton(3-9)apps/desktop2/src/components/main/body/sessions/outer-header/other.tsx (1)
OthersButton(3-9)apps/desktop2/src/components/main/body/sessions/outer-header.tsx (1)
OuterHeader(6-30)
apps/desktop2/src/components/main/body/sessions/outer-header/event.tsx (2)
apps/desktop2/src/store/tinybase/persisted.ts (1)
Event(112-112)apps/desktop2/src/hooks/useQuery.ts (1)
useQuery(3-40)
apps/desktop2/src/store/tinybase/persisted.ts (2)
packages/db/src/schema.ts (2)
mappingSessionParticipantSchema(142-142)mappingSessionParticipant(63-67)apps/desktop2/src/store/tinybase/shared.ts (1)
InferTinyBaseSchema(30-33)
apps/desktop2/src/components/main/body/sessions/outer-header/recording.tsx (1)
apps/desktop2/src/components/main/body/sessions/outer-header/types.ts (1)
SessionRowProp(3-5)
apps/desktop2/src/components/main/body/sessions/outer-header/listen.tsx (2)
apps/desktop2/src/components/main/body/sessions/outer-header/types.ts (1)
SessionRowProp(3-5)apps/desktop2/src/components/main/body/sessions/outer-header.tsx (1)
ListenButton(114-120)
apps/desktop2/src/components/main/body/sessions/outer-header/folder.tsx (1)
apps/desktop2/src/store/zustand/tabs.ts (1)
useTabs(31-121)
⏰ 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 (7)
apps/desktop2/src/components/main/body/sessions/outer-header/types.ts (1)
1-5: LGTM!Clean type definition that properly derives the session row type from the persisted store hook.
apps/desktop2/src/components/main/body/sessions/outer-header/index.tsx (2)
17-19: Type assertion without verification.The
currentUserIdis type-asserted asstring | undefinedwithout runtime validation. If the store returns a different type, this could cause issues downstream.Verify that
persisted.UI.useCellfor "user_id" always returns a string or undefined. The type assertion assumes this invariant holds.
11-48: LGTM! Well-structured component composition.The OuterHeader properly composes subcomponents and handles conditional rendering for the folder chain. The layout clearly separates the folder navigation from the action controls.
apps/desktop2/src/components/main/body/sessions/outer-header/folder.tsx (2)
17-17: Unnecessary array copy for reverse operation.The spread operator
[...folderIds]creates a copy before reversing. Sincereverse()mutates the array, this copy is necessary to avoid mutating the originalfolderIdsfrom the hook.This is correct defensive programming to avoid unintended side effects.
39-41: LGTM! Proper memoization of click handler.The
useCallbackcorrectly includes bothopenNewandfolderIdin the dependency array, preventing unnecessary re-renders.apps/desktop2/src/components/main/body/sessions/outer-header/participant.tsx (2)
77-82: Verify search logic handles empty name correctly.Line 77 checks
name && !name.toLowerCase().includes(normalizedQuery), which will exclude participants with empty names from search results entirely. This might be intentional, but consider whether participants with only email should be searchable.Confirm whether participants without names but with valid emails should appear in search results when the query matches their email.
208-261: LGTM! Well-memoized participant grouping logic.The
useSessionParticipantGroupshook properly memoizes the participant grouping logic and includes all necessary dependencies.
No description provided.