Skip to content

feat: join a room from the contact list#350

Open
iparaskev wants to merge 2 commits into
mainfrom
join_room_from_contact_list
Open

feat: join a room from the contact list#350
iparaskev wants to merge 2 commits into
mainfrom
join_room_from_contact_list

Conversation

@iparaskev

@iparaskev iparaskev commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Modifies the call button to say join and allow a user to join a room another participant is in without going to the room view.

This doesn't handle if two rooms have the same name.

Screen.Recording.2026-07-01.at.09.22.23.mov

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enabled joining an existing room directly from a participant entry when room information is available.
    • Added room data loading in the participant list and wired it into each participant row.
  • Bug Fixes

    • Refined “Call/End” button disabling logic to better match actual call state.
    • Improved join failure handling, including clearer behavior when a trial has expired.

Closes #338

Modifies the call button to say join and allow a user to join a room
another participant is in without going to the room view.

This doesn't handle if two rooms have the same name.
@iparaskev iparaskev requested a review from konsalex as a code owner July 1, 2026 08:27
@netlify

netlify Bot commented Jul 1, 2026

Copy link
Copy Markdown

Deploy Preview for hoppdocs ready!

Name Link
🔨 Latest commit 6cd1abb
🔍 Latest deploy log https://app.netlify.com/projects/hoppdocs/deploys/6a454bd7173088000869db40
😎 Deploy Preview https://deploy-preview-350--hoppdocs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7779b5ac-0739-4aaf-acac-4f9de6897e26

📥 Commits

Reviewing files that changed from the base of the PR and between 6b045ae and 6cd1abb.

📒 Files selected for processing (1)
  • tauri/src/components/ui/participant-row-wo-livekit.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • tauri/src/components/ui/participant-row-wo-livekit.tsx

📝 Walkthrough

Walkthrough

ParticipantRow now accepts room data and can join an existing room by fetching tokens, ending any active call, applying local mic/camera settings, and starting the room call. Participants now loads rooms and passes them into each row.

Changes

Room join feature

Layer / File(s) Summary
ParticipantRow props and room-join implementation
tauri/src/components/ui/participant-row-wo-livekit.tsx
ParticipantRow accepts rooms, adds useEndCall, resolves a target room from presence data, and implements joinRoom with token fetching, state setup, and start-call handling.
Join/Call button rendering updates
tauri/src/components/ui/participant-row-wo-livekit.tsx
The room-based Join button now triggers joinRoom, and the Call/End button disable condition no longer depends on presence state.
Participants room data fetching and wiring
tauri/src/components/ui/participants.tsx
Participants queries /api/auth/rooms and passes the fetched rooms, or an empty array fallback, into both row variants.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: enabling room joins from the contacts list.
Linked Issues check ✅ Passed The PR implements the requested join action in contacts and reuses room-tab join flow.
Out of Scope Changes check ✅ Passed The changes stay focused on contact-list room joining and related data fetching.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch join_room_from_contact_list

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

ESLint install failed. For unrecoverable errors, disable the tool in CodeRabbit configuration.


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tauri/src/components/ui/participant-row-wo-livekit.tsx`:
- Around line 93-94: The room-join flow in joinRoom is currently unreachable
when inACall because the join button is hidden, even though joinRoom already
handles callTokens by ending the active call. Update the gating so the
participant-row UI and joinRoom follow the same switch-call rules: allow the
join path when it needs to replace an active call, but block it when
hasIncomingCall is true to prevent overlapping call state. Check the joinRoom
callback and the related button visibility/disabled logic in
participant-row-wo-livekit.tsx so they stay consistent with the other call-entry
paths.
- Around line 86-88: The room lookup in participant-row-wo-livekit.tsx uses
userPresence?.roomName with props.rooms.find in targetRoom, which can pick the
wrong room when names are duplicated. Update the presence-driven lookup to use a
unique room identifier such as roomId wherever possible, and in the current
ParticipantRow / targetRoom selection path detect ambiguous name matches instead
of silently choosing the first room. If roomId is not yet available in presence,
add a safe fallback that refuses to auto-join when multiple rooms share the same
name.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 782eb864-93d3-4448-b914-c96e933611b4

📥 Commits

Reviewing files that changed from the base of the PR and between 0735a99 and 6b045ae.

📒 Files selected for processing (2)
  • tauri/src/components/ui/participant-row-wo-livekit.tsx
  • tauri/src/components/ui/participants.tsx

Comment on lines +86 to +88
const targetRoom = useMemo(
() => props.rooms.find((r) => r.name === userPresence?.roomName),
[props.rooms, userPresence?.roomName],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Avoid joining rooms by non-unique display name.

find((r) => r.name === userPresence?.roomName) can select the wrong room when two rooms share a name, while the token endpoint joins by room id. Prefer carrying roomId in presence; at minimum, block ambiguous matches instead of picking the first one.

Possible local mitigation until presence includes room IDs
-  const targetRoom = useMemo(
-    () => props.rooms.find((r) => r.name === userPresence?.roomName),
-    [props.rooms, userPresence?.roomName],
-  );
+  const matchingRooms = useMemo(
+    () => props.rooms.filter((r) => r.name === userPresence?.roomName),
+    [props.rooms, userPresence?.roomName],
+  );
+  const targetRoom = matchingRooms.length === 1 ? matchingRooms[0] : undefined;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const targetRoom = useMemo(
() => props.rooms.find((r) => r.name === userPresence?.roomName),
[props.rooms, userPresence?.roomName],
const matchingRooms = useMemo(
() => props.rooms.filter((r) => r.name === userPresence?.roomName),
[props.rooms, userPresence?.roomName],
);
const targetRoom = matchingRooms.length === 1 ? matchingRooms[0] : undefined;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tauri/src/components/ui/participant-row-wo-livekit.tsx` around lines 86 - 88,
The room lookup in participant-row-wo-livekit.tsx uses userPresence?.roomName
with props.rooms.find in targetRoom, which can pick the wrong room when names
are duplicated. Update the presence-driven lookup to use a unique room
identifier such as roomId wherever possible, and in the current ParticipantRow /
targetRoom selection path detect ambiguous name matches instead of silently
choosing the first room. If roomId is not yet available in presence, add a safe
fallback that refuses to auto-join when multiple rooms share the same name.

Comment on lines +93 to +94
const joinRoom = useCallback(async () => {
if (!targetRoom || isJoiningRoom.current) return;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Align room Join gating with the switch-call flow.

joinRoom handles callTokens by ending the active call, but the button is hidden while inACall, making that path unreachable. Also block hasIncomingCall like the other call-entry paths to avoid overlapping call state.

Proposed gating adjustment
   const joinRoom = useCallback(async () => {
-    if (!targetRoom || isJoiningRoom.current) return;
+    if (!targetRoom || hasIncomingCall || isJoiningRoom.current) return;
@@
-  }, [targetRoom, callTokens, props.user, setCallTokens, endCall, getRoomTokens, posthog]);
+  }, [targetRoom, callTokens, hasIncomingCall, props.user, setCallTokens, endCall, getRoomTokens, posthog]);
@@
-        {userPresence?.roomName && !inACall ?
+        {userPresence?.roomName ?
           <Button
             variant="gradient-white"
             onClick={joinRoom}
-            disabled={!targetRoom || isJoiningRoom.current}
+            disabled={!targetRoom || hasIncomingCall || isJoiningRoom.current}

Also applies to: 105-108, 160-160, 407-411

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tauri/src/components/ui/participant-row-wo-livekit.tsx` around lines 93 - 94,
The room-join flow in joinRoom is currently unreachable when inACall because the
join button is hidden, even though joinRoom already handles callTokens by ending
the active call. Update the gating so the participant-row UI and joinRoom follow
the same switch-call rules: allow the join path when it needs to replace an
active call, but block it when hasIncomingCall is true to prevent overlapping
call state. Check the joinRoom callback and the related button
visibility/disabled logic in participant-row-wo-livekit.tsx so they stay
consistent with the other call-entry paths.

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.

improvement: join a room from the contacts tab

1 participant