Skip to content

Commit 2da964f

Browse files
committed
feat(social): offer to start a room when nobody is waiting (#1053)
Rebased onto 0a4445c (#1095 also moved client/i18n.js and 0001). patches/ds-bot/0001 and 0008 are that tree plus this change only: four i18n lines and the matching hunk counts.
1 parent 0a4445c commit 2da964f

9 files changed

Lines changed: 87 additions & 15 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A fresh 6-digit code no longer answers with an empty-result line. When nobody is waiting, the dialog's primary line is **Start a new room with …** and **Start a new room** is the first button; the note under it still says to ask for an invite link if that room already opened ([#1053](https://github.com/ThinkFlowLab/FlyBot/issues/1053)).

‎core/client.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ var ZH = {
5757
"Meet people nearby with a 6-digit number": "用同一组 6 位数字和身边的人见面",
5858
// #892: one entry for both ways in, a number entered together or a group's invite link, and its dialog.
5959
"Join or create by number or link": "面对面建群或用链接加入",
60+
// #1053: a fresh 6-digit code offers to start the room. The hint still covers a number whose room already opened (#999).
61+
"Start a new room with {code}": "用 {code} 开一个新房间",
62+
"No one is waiting under this number. If someone already opened the room, the number no longer works — ask them for an invite link.": "这个号码下还没有人在等。如果已经有人开过这个房间,号码就不再有效——向他们要一条邀请链接。",
63+
"Start a new room": "开一个新房间",
6064
"Enter a number, or paste a group invite link": "输入数字面对面建群,或粘贴邀请链接加入",
6165
"Pick your Bots. Enter the same 6-digit number as everyone nearby to build a room together, or paste a group invite link or scan its QR code to join that group.": "选好你的 Bot。和身边的人输入同一组 6 位数字一起建群,或粘贴群邀请链接、扫描二维码加入那个群。",
6266
"Or paste a group invite link (https://…/r/…)": "或粘贴群邀请链接(https://…/r/…)",

‎core/src/client/i18n.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ const ZH = {
2020
'Meet people nearby with a 6-digit number': '用同一组 6 位数字和身边的人见面',
2121
// #892: one entry for both ways in, a number entered together or a group's invite link, and its dialog.
2222
'Join or create by number or link': '面对面建群或用链接加入',
23+
// #1053: a fresh 6-digit code offers to start the room. The hint still covers a number whose room already opened (#999).
24+
'Start a new room with {code}': '用 {code} 开一个新房间',
25+
'No one is waiting under this number. If someone already opened the room, the number no longer works — ask them for an invite link.': '这个号码下还没有人在等。如果已经有人开过这个房间,号码就不再有效——向他们要一条邀请链接。',
26+
'Start a new room': '开一个新房间',
2327
'Enter a number, or paste a group invite link': '输入数字面对面建群,或粘贴邀请链接加入',
2428
'Pick your Bots. Enter the same 6-digit number as everyone nearby to build a room together, or paste a group invite link or scan its QR code to join that group.': '选好你的 Bot。和身边的人输入同一组 6 位数字一起建群,或粘贴群邀请链接、扫描二维码加入那个群。',
2529
'Or paste a group invite link (https://…/r/…)': '或粘贴群邀请链接(https://…/r/…)',

‎docs/subsystems/core-client.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Add a new invariant under the heading it belongs to (or a new heading), not at t
6969

7070
### Held-send approval card
7171

72-
A `flybot.session.dock` component also gets the host translator `t`, so a plugin's card can read in the interface language (the social hold card's *Held for your approval: contains …* line, #371; its words are in `i18n.js`).
72+
A `flybot.session.dock` component also gets the host translator `t`, so a plugin's card can read in the interface language (the social hold card's *Held for your approval: contains …* line, #371; its words are in `i18n.js`). The face-room create prompt (*Start a new room with {code}*, and the hint under it, #1053) is in that same map, so a zh UI reads it in Chinese.
7373

7474
The overlay (`flybot-slots.js` `FlyBotApprovals`) is the fallback, not a second copy (#260): an approval whose policy a `flybot.session.dock` entry declares (`policy`, e.g. social) is drawn by that dock in its chat, which reports the ids it shows through `claim(ids)`; the overlay skips claimed ids. A docked approval no open chat shows becomes a small pointer (`Sender → Recipient`, `Waiting for approval`, **Review** opens the chat via `actions.openSession`) after 1.2 s, so moving between chats never flashes it; the chat that is open never gets a pointer for its own approvals (each `FlyBotSessionDock` reports its chat through `chatOpened`, #271). An approval's chat is its room, else the chat whose turn a held reply answers (`meta.replyIn`, #418), else the friend's chat it is addressed to, else the Bot that wrote it; the pointer's Review opens that one (#278). The claims live in `approval-claims.js` so a chat cell can claim without the slot components. Any other policy's approval is a card in the overlay, with the same two lines as the dock's card (`Waiting for approval` / `Not sent`, then `Sender → Recipient`; the policy's long reason is the tooltip) and Approve / Reject (Retry for a failed send `canRetry()` allows, #968). Approve / Reject is drawn only for a status `isApprovalWaiting()` calls waiting (`pending`, `pending_approval`), the same rule the held-reply card asks (#734); a settled status gets no button the host would refuse, and a failed send keeps Retry only while `canRetry()` allows it (#968). The recipient is the person who gets it (#418, #498): the host's `recipientName`, else the owner of the friend's chat (`friendBotOwner`), else as the host named it, so a card reads `Chief → SelfB1233`, never two Bot names. `senderName` / `targetName` are resolved server-side and a delegated marker follows a relayed send (`hop > 0`). The decision itself is owner-bound in the host (#52); see [core-host](core-host.md).
7575

0 commit comments

Comments
 (0)