cheogram-www
created pr with
cheogram-www/member-chat.1
cmds
checkout latest patchset:
ssh pr.pico.sh pull cheogram-www:member-chat | git am -3checkout specific patchset revision:
ssh pr.pico.sh pull cheogram-www:member-chat [rev] | git am -3add changes to patch request:
git format-patch main --stdout | ssh pr.pico.sh cheogram-www:member-chatadd comment to patch request:
ssh pr.pico.sh comment cheogram-www:member-chat "lgtm!"
Patchset
cheogram-www/member-chat.1
Add Chat button to member details dialog
Stephen Paul Weber
2026-10-26T01:44:45ZTo start a new chat with the member if we know their address (and if they are not ourselves).
Semantic diff summary
0 added,
4 modified,
0 signature changed,
0 removed
across 1 analyzed file
+38
-12
src/components/Chats.tsx
#
| ... | ... | @@ -42,9 +42,11 @@ import QrCodeScannerIcon from "@mui/icons-material/QrCodeScanner"; | |
| 42 | 42 | import ArrowForward from "@mui/icons-material/ArrowForward"; | |
| 43 | 43 | import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | |
| 44 | 44 | import { | |
| 45 | + | faAt, | |
| 45 | 46 | faPencil, | |
| 46 | 47 | faPlus, | |
| 47 | 48 | faXmark, | |
| 49 | + | faComment, | |
| 48 | 50 | faMagnifyingGlassArrowRight, | |
| 49 | 51 | faThumbtack, | |
| 50 | 52 | } from "@fortawesome/free-solid-svg-icons"; |
| ... | ... | @@ -405,12 +407,15 @@ export const Chats = () => { | |
| 405 | 407 | isMobile, | |
| 406 | 408 | ]); | |
| 407 | 409 | ||
| 408 | - | const navigateToChat = async (c: borogove.Chat) => { | |
| 410 | + | const navigateToChat = async ( | |
| 411 | + | c: borogove.Chat, | |
| 412 | + | linkParams: URLSearchParams = searchParams, | |
| 413 | + | ) => { | |
| 409 | 414 | const scrollTo = getChatExtras(c.chatId)?.scrollTo; | |
| 410 | 415 | const readUpTo = await c.readUpTo(); | |
| 411 | 416 | const readUpToId = readUpTo?.serverId; | |
| 412 | 417 | navigate( | |
| 413 | - | href("./chats/:chatId", { chatId: c.chatId }, searchParams) + | |
| 418 | + | href("./chats/:chatId", { chatId: c.chatId }, linkParams) + | |
| 414 | 419 | (scrollTo || readUpToId ? `#message:${scrollTo || readUpToId}` : ""), | |
| 415 | 420 | ); | |
| 416 | 421 | }; |
| ... | ... | @@ -1137,6 +1142,37 @@ export const Chats = () => { | |
| 1137 | 1142 | )} | |
| 1138 | 1143 | </div> | |
| 1139 | 1144 | ||
| 1145 | + | <div> | |
| 1146 | + | {popupMember.chat && !popupMember.isSelf && ( | |
| 1147 | + | <Button | |
| 1148 | + | icon={<FontAwesomeIcon icon={faComment} />} | |
| 1149 | + | onClick={() => { | |
| 1150 | + | const memberChat = popupMember.chat; | |
| 1151 | + | if (!memberChat) return; | |
| 1152 | + | const params = new URLSearchParams(searchParams); | |
| 1153 | + | params.delete("memberQ"); | |
| 1154 | + | const chat = client.startChat(memberChat); | |
| 1155 | + | setPopupMember(undefined); | |
| 1156 | + | setAddRoleAnchorEl(null); | |
| 1157 | + | void navigateToChat(chat, params); | |
| 1158 | + | }} | |
| 1159 | + | > | |
| 1160 | + | Chat | |
| 1161 | + | </Button> | |
| 1162 | + | )} | |
| 1163 | + | ||
| 1164 | + | <Button | |
| 1165 | + | icon={<FontAwesomeIcon icon={faAt} />} | |
| 1166 | + | onClick={() => { | |
| 1167 | + | innerChatRef.current.addMention(popupMember); | |
| 1168 | + | setPopupMember(undefined); | |
| 1169 | + | setAddRoleAnchorEl(null); | |
| 1170 | + | }} | |
| 1171 | + | > | |
| 1172 | + | Mention | |
| 1173 | + | </Button> | |
| 1174 | + | </div> | |
| 1175 | + | ||
| 1140 | 1176 | <AwaitOnce | |
| 1141 | 1177 | resolve={() => popupMember.status(client)} | |
| 1142 | 1178 | fallback={<div />} |
| ... | ... | @@ -1157,16 +1193,6 @@ export const Chats = () => { | |
| 1157 | 1193 | > | |
| 1158 | 1194 | {(profile) => <Profile profile={profile} />} | |
| 1159 | 1195 | </AwaitOnce> | |
| 1160 | - | ||
| 1161 | - | <Button | |
| 1162 | - | onClick={() => { | |
| 1163 | - | innerChatRef.current.addMention(popupMember); | |
| 1164 | - | setPopupMember(undefined); | |
| 1165 | - | setAddRoleAnchorEl(null); | |
| 1166 | - | }} | |
| 1167 | - | > | |
| 1168 | - | Mention | |
| 1169 | - | </Button> | |
| 1170 | 1196 | </Dialog> | |
| 1171 | 1197 | )} | |
| 1172 | 1198 |