Repository navigation
Face-room @ chips: one name on both homes, with @, and no doubled space (part of #305) #367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| A face-to-face @mention now looks the same on both homes: the chip shows `@` and the room name for the Bot (`SelfA · Chief`, as in Members), a line typed on the other home turns into the same chip, and a space typed after a picked name no longer shows as two ([#305](https://github.com/ThinkFlowLab/FlyBot/issues/305)). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // Who sits in a face-to-face room, named one way everywhere: the Members panel, the waiting | ||
| // tiles and the @ chips in a bubble (#229, #305). Pure, so the bubble module can use it. | ||
| import { t } from './i18n.js' | ||
| import { cleanPeerName, ownerNameOf } from '../shared/remote-label.js' | ||
|
|
||
| // A face-to-face room lists people, each with the Bot they brought, named one way for every | ||
| // member: "Bob · Chief", "Ann (you) · Chief" (#229). Names come from the participant records | ||
| // (server member fields for a friend, the roster for my own Bot), never from message text. | ||
| export function faceSeats(room, roster) { | ||
| const live = (room.presentedParticipants ?? room.participants ?? []).filter(p => p.kind !== 'human' && p.leftSeq === undefined) | ||
| const seats = live.map((p) => { | ||
| const local = p.remote ? undefined : roster.byId[p.id] | ||
| return { | ||
| key: p.handle || p.id, | ||
| local, | ||
| record: p, | ||
| person: local ? cleanPeerName(p.ownerName || roster.self?.displayName, '') : ownerNameOf(p), | ||
| bot: local ? local.name : cleanPeerName(p.displayName || p.name, 'Bot'), | ||
| mine: Boolean(local), | ||
| } | ||
| }) | ||
| for (const id of room.members ?? []) { | ||
| const bot = roster.byId[id] | ||
| if (!bot || seats.some(seat => seat.local?.id === id)) continue | ||
| seats.push({ key: id, local: bot, record: { id }, person: cleanPeerName(roster.self?.displayName, ''), bot: bot.name, mine: true }) | ||
| } | ||
| return seats | ||
| } | ||
|
|
||
| export function faceSeatLabel(seat) { | ||
| if (!seat.person) return seat.bot | ||
| return `${seat.mine ? t('{name} (you)', { name: seat.person }) : seat.person} · ${seat.bot}` | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a face-room snapshot lists a remote seat before this home's seat (for example, the join-order shape on the later home) and both Bots share a name such as the default
Chief, thefromFriend === falsebranch leaves the remote candidate first.mentionSpansthen binds this home's own@Chiefto that remote seat, while hostfaceCandidatesdeliberately puts local candidates first, so the bubble labels and opens the friend's Chief even though the local Chief was called. Order local seats first for locally authored lines so the client mirrors host precedence.Useful? React with 👍 / 👎.