Skip to content

Add shared chat invite UI#23

Merged
TraderSamwise merged 2 commits into
masterfrom
feat/multi-user-chat-share-ui
May 24, 2026
Merged

Add shared chat invite UI#23
TraderSamwise merged 2 commits into
masterfrom
feat/multi-user-chat-share-ui

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented May 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • add relay HTTP client types and createShareInvite API wrapper
  • add chat-header invite panel for owner-side email invites
  • disable invite creation outside relay/auth context and surface delivery status

Verification

  • yarn --cwd app vitest run lib/api.test.ts components/MessageBlock.test.ts
  • yarn --cwd app typecheck
  • yarn --cwd app lint
  • yarn --cwd app test
  • browser smoke check: invite panel opens on local web and disables with remote-mode hint

Summary by CodeRabbit

  • New Features

    • Email-based collaboration: a share toggle in the chat header opens a share panel with an email input and Invite button to invite others to a shared chat session. Invite status and errors are shown in the UI.
  • Tests

    • Added test coverage validating the share invite flow and relay-based invite request behavior.

Review Change Stack

@coderabbitai

coderabbitai Bot commented May 24, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a2268e46-2301-4025-b6bf-020b01848ac9

📥 Commits

Reviewing files that changed from the base of the PR and between 890bd2b and 8110847.

📒 Files selected for processing (1)
  • app/app/(main)/(tabs)/(dashboard)/agent/[sessionId]/chat.tsx

📝 Walkthrough

Walkthrough

This PR adds relay-based share-invite support: a new createShareInvite API POSTs {projectRoot, sessionId, email} to the relay /shares/invite endpoint; the chat screen shows a share panel with email input and Invite button that calls the API; tests verify the relay HTTP request and headers.

Changes

Share-Invite Feature

Layer / File(s) Summary
Share API contract and relay implementation
app/lib/api.ts
Adds ShareParticipant, ShareInvite, SharedSessionSummary, and ShareInviteResponse interfaces and exports createShareInvite(projectRoot, sessionId, email, opts?) which validates env.AIMUX_RELAY_URL, converts ws:http:, and POSTs to /shares/invite with optional bearer token.
Chat screen share-invite UI and handler
app/app/(main)/(tabs)/(dashboard)/agent/[sessionId]/chat.tsx
Adds local state (sharePanelOpen, inviteEmail, inviteBusy, inviteStatus), a UserPlus header button to toggle the share panel, handleSendInvite to validate input/token and call createShareInvite, and conditional UI (email input, Invite button, status messaging) shown when the panel is open.
API testing for createShareInvite
app/lib/api.test.ts
Imports createShareInvite, snapshots/restores EXPO_PUBLIC_AIMUX_RELAY_URL, and adds a test ensuring createShareInvite POSTs once to ${relayUrl}/shares/invite with the correct JSON body and Authorization: Bearer <token> header when relay mode is configured.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • TraderSamwise/aimux#19: Adds the relay-side /shares/invite endpoint that this PR's createShareInvite client calls.
  • TraderSamwise/aimux#18: Implements relay-side share-invite logic and delivery behavior complementary to this client change.

Poem

🐇 I hopped to the chat with a plus on my sleeve,
I poke at the panel, an email to weave.
I send a small POST across relayed light,
Invite hops away through the network tonight.
Tests cheer the hop — collaborative delight!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add shared chat invite UI' directly and clearly describes the main change: adding a UI feature for shared chat invites. It matches the PR objectives and the primary file changes (chat.tsx with invite panel UI).
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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 feat/multi-user-chat-share-ui

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.

app/app/(main)/(tabs)/(dashboard)/agent/[sessionId]/chat.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


Comment @coderabbitai help to get the list of available commands and usage tips.

@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: 1

🤖 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 `@app/app/`(main)/(tabs)/(dashboard)/agent/[sessionId]/chat.tsx:
- Around line 374-375: The invite button can be clickable even when session or
project context is missing; update its disabled prop to include the same guards
used in handleSendInvite by adding checks for sessionId and project?.path (in
addition to inviteBusy, relayConfigured, token, and inviteEmail.trim()) so the
button is truly disabled when context is absent; locate the JSX where disabled
is set for the button and mirror the sessionId and project?.path conditions used
in handleSendInvite to prevent dead-click no-ops.
🪄 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 Plus

Run ID: 5e4a1b79-93a4-4530-bf2c-125b4a5b8430

📥 Commits

Reviewing files that changed from the base of the PR and between f5a42f9 and 890bd2b.

📒 Files selected for processing (3)
  • app/app/(main)/(tabs)/(dashboard)/agent/[sessionId]/chat.tsx
  • app/lib/api.test.ts
  • app/lib/api.ts

Comment thread app/app/(main)/(tabs)/(dashboard)/agent/[sessionId]/chat.tsx Outdated
@TraderSamwise
TraderSamwise merged commit 75a6efc into master May 24, 2026
1 check passed
@TraderSamwise
TraderSamwise deleted the feat/multi-user-chat-share-ui branch May 24, 2026 10:02
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.

1 participant