Web/profile: One-shot message form on user profile - #8452
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
As long as this is only accessible on the user profile (and not on the search page) this should be fine. The reason for this is we want to force users to visit the profile page of the person before they send a message or request. This is very important as one of the primary pain points for hosts is that people who request or message do not read the person's profile before doing so. |
| setIsMessaging(true); | ||
| } else { | ||
| //has thread | ||
| router.push(routeToGroupChat(data)); |
There was a problem hiding this comment.
Since this is a bit long could you export this to a separate function like we usually do if possible? Unless it's gonna be very messy passing the router and state updates.
| interface NewMessageProps { | ||
| setIsMessaging: (value: boolean) => void; | ||
| } | ||
|
|
||
| interface MessageFormData { | ||
| text: string; | ||
| } | ||
|
|
There was a problem hiding this comment.
Nit - move these types above the styling. But also since they are only one item each do we need to declare them separately like this vs inline? On first glance each one is only used once.
| setIsMessaging={() => { | ||
| /* TODO: not needed here*/ | ||
| }} |
There was a problem hiding this comment.
Remove this then if not needed? Or allow it being undefined in the types instead if it's conditional?
|
@claude address the review comments |
|
Claude finished @aapeliv's task in 5m 20s —— View job Addressed review commentsPushed as
Notes
|
Replaces the redirect to /messages/chats?to=username with an inline NewMessage form (mirrors the NewHostRequest pattern), letting users send a first message to someone in a single step. Wires the existing SendDirectMessage gRPC RPC into the web service layer.
ProfilePage renders Overview for the current user's own profile (no Message button shown), so the prop is unused there but required by the type — pass a no-op like the existing setIsRequesting stub.
- Extract MessageUserButton mutation logic into useMessageUser hook - Inline single-use types in NewMessage - Make Overview's setIsRequesting/setIsMessaging optional and drop the TODO no-op stubs from ProfilePage Co-authored-by: Aapeli <aapeliv@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
9385b3e to
513adbe
Compare
📝 Release NotesThis PR should be included in the release notes. Suggested release note: 🤖 Bot Debug InformationModel: |
Human note:
This has always been a bit of a complicated UX piece so hopefully this helps
Also if there already is a 1:1 chat, it will go to it instead of opening up this pane. Also if profile is incomplete, it'll show the modal as normal.
Replaces the click-through to the messages page with an inline form, letting users send a first message to another user from their profile in a single step — mirrors the existing host request form pattern.
Backend already supported this via the
SendDirectMessagegRPC RPC (creates-or-finds the DM and sends the message in one call), so this PR is web-only — it just wires that RPC into the service layer and builds the UI.The Message button still navigates to an existing chat if a DM already exists between the two users; only the no-existing-DM case is replaced.
Testing
MessageUserButton.test.tsxto cover the new "open inline form" path; existing tests pass (yarn test— 21 tests acrossMessageUserButton,UserPage,UserOverview).yarn lint:fix).To test locally:
Web frontend checklist
For maintainers
This PR was created with the Couchers PR skill.