Repository navigation
fix(social): face-room past rooms, preview unwrap, short + menu, approval labels, faster poll (#129-#133) - #134
Conversation
Unwrap stored untrusted-message wraps in room previews and bubbles, resolve User to the signed-in display name, and show a short friendly line instead of raw model/API-key errors. The sidebar + menu keeps plugin actions and toasts a returned string, without listing every Bot (Chief clutter). Co-authored-by: Danyang Chen <birfychen@gmail.com>
Expired matching and a peer leaving move rooms to Past rooms without a stale Leave. Titles include people or the code/time. The + menu holds Add friend, Accept invite, one-click Copy invite link, and Face-to-face group. Auto-send is the one hold label; the header shows either the Bot count or N to approve. Inbox and face poll drop to about 4s while a room is live. Co-authored-by: Danyang Chen <birfychen@gmail.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af5af0d181
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const locals = new Set(bringable().map(bot => bot.handle).filter(Boolean)) | ||
| const previousRemotes = (hosted?.participants ?? []).filter(p => p.leftSeq === undefined && p.remote === true) | ||
| const currentRemotes = (snapshot?.members ?? []).filter(member => member.handle && !locals.has(norm(member.handle))) | ||
| if (status === 'open' && previousRemotes.length > 0 && currentRemotes.length === 0) return { status: 'left' } |
There was a problem hiding this comment.
Preserve the left state across later face-room polls
When the server keeps an open room listed after its last remote member departs, the first poll returns left, and upsertFace marks the old remote participant left. On the next poll previousRemotes is therefore empty, this branch no longer fires, and applyFaceSnapshot writes the server's open status back, moving the room out of Past rooms and restoring Leave. Make the derived terminal state sticky until the server room disappears.
Useful? React with 👍 / 👎.
| if (local) continue | ||
| flybot.rooms.applyFaceLine?.(room.id, { ...line, remote: true, authorKind: 'human' }) | ||
| void flybot.rooms.postNotice?.(room.id, `${line.who}: ${line.text}`) | ||
| const who = humanFaceWho(line, ownerDisplayName(snapshot, hosted)) |
There was a problem hiding this comment.
Attribute placeholder human lines to the remote sender
For an incoming human envelope produced by an older or partially upgraded client with who: 'User', renderFaceEvent already carries the sender's sanitized ownerName, but this fallback calls ownerDisplayName, which selects one of this installation's local handles. The peer's line is therefore stored and shown under the recipient's own name; prefer line.ownerName before any local fallback.
Useful? React with 👍 / 👎.
| label: 'Copy invite link', | ||
| hint: 'Copy a link a friend can paste in Add friend.', | ||
| run: async ({ close } = {}) => { | ||
| close?.() |
There was a problem hiding this comment.
Surface errors from the one-click invite action
If either social/status or social/create-invite rejects, such as while the social server is offline, this closes the NewChat overlay before the first await; the wrapper in new-chat.js catches the rejection only with setError on that now-unmounted pane, so the click fails with no visible error or link. Close only after a result, or route failures through the global notification.
Useful? React with 👍 / 👎.
|
|
||
| export function faceRoomTitle(snapshot = {}, { code, room } = {}) { | ||
| const named = String(snapshot.name || room?.name || '').trim() | ||
| if (named && named !== 'Face-to-face room') return named |
There was a problem hiding this comment.
Recompute generated room titles after members join
When a user creates a room, the first snapshot normally contains only the local member, so this helper sets a derived name such as Face-to-face · Danyang. Every later poll then returns that generated room.name here before inspecting the snapshot's owners, so when Bob joins the creator never sees Bob in the title and multiple rooms created by the same owner remain indistinguishable. Preserve only genuinely explicit names, or recompute derived titles as membership changes.
Useful? React with 👍 / 👎.
Fixes #129, #130, #131, #132, #133 (UI retest of main e884312 on two instances).
<untrusted-message>; human lines show the real name, notUser. Missing API key / model failures show a short friendly line; raw errors stay in diagnostics. The room log stays fenced for the model (Security: a granted friend's Bot's lines land unfenced in non-face shared rooms (#9 family) #98).+menu is: Face-to-face group, Add friend, Accept invite, one-click Copy invite link. "Friend requests" is gone (it duplicated Add friend). Individual Bots stay under New chat. Done through the pin/patch layer;ds-bot/untouched.Chief → the room); face-to-face titles include people or code/time; one "Auto-send" label; header shows the Bot count or "N to approve", not both.Deferred: Friends' Bots roster timer stays 15s; Bot-to-Bot failure text still uses the detailed
failureLine(diagnostics path); smoke test not run (no deepseek-harness checkout). Accept invite opens the same panel as Add friend by design to keep the click path short.Verified:
ARCH_DOCS_BASE=upstream/main npm run verifypasses.