Skip to content

Commit 9241a66

Browse files
docs(ui): name the producer the account suffix check defends
The comment above withAccountDisambiguator claimed the rendered name is never inspected, which the suffix check contradicts. State the real contract instead: the account itself still comes only from the recorded value, and the endsWith check is idempotence against the chat pane's inline rename, which seeds its input with the rendered title and persists a partial edit verbatim.
1 parent af73ff7 commit 9241a66

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

‎ui/src/lib/session-display.ts‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,12 @@ type SessionKeyInfo = {
110110
/**
111111
* Two DMs from different accounts routinely share a name, so the account is the
112112
* only discriminator; `default` is what key builders write for absence and says
113-
* nothing. The account is appended from the recorded fact alone — never by
114-
* inspecting the rendered name, which cannot tell an account apart from a user
115-
* label that happens to read like one.
113+
* nothing. Which account to show comes from the recorded fact alone, never from
114+
* the rendered name. The suffix check is idempotence, not inference: the chat
115+
* pane's inline rename seeds its input with the rendered title
116+
* (`beginHeaderRename`), so a partially edited submit can persist a label that
117+
* already ends in this suffix, and appending twice would render
118+
* `Alice · cards · cards`.
116119
*/
117120
function withAccountDisambiguator(name: string, accountId: string | undefined): string {
118121
if (!accountId || accountId === "default") {

0 commit comments

Comments
 (0)