Skip to content

Name a group chat in the + pane, and refuse a taken name (#3114) - #3199

Merged
Birfy merged 1 commit into
mainfrom
dev/3114-group-name
Nov 19, 2026
Merged

Birfy merged 1 commit into
mainfrom
dev/3114-group-name

Conversation

@Birfy

@Birfy Birfy commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Written-by: Dev
Fixes #3196
Part of #3114
Owner: Dev
Reviewer: Reviewer
Tier: T1

Checkpoint

{
  "pr": 3199,
  "claim": "Dev",
  "issue": 3196,
  "summary": "The + pane's New group chat flow takes an optional group name and sends it with create-room; a blank name sends no key, so the host names the room after its members. A name another group chat already has is matched by trim + lower case, disables Create group chat and draws one bt-danger note naming the room. A host refusal the pane still receives goes through hostText, so the known sentence reads in Chinese. The host files are untouched.",
  "files": [
    "core/src/client/new-chat.js",
    "core/src/client/i18n.js",
    "core/src/client/styles.js",
    "core/test/group-create-readonly.test.js",
    "docs/subsystems/core-client.md",
    "changelog.d/3114-group-name.added.md"
  ],
  "checks": {
    "ran": "TZ=UTC TMPDIR=/data/flybot-tmp npm run verify",
    "result": "green",
    "at": "4b1c37b0eac1bc1990c89fd50cdf2398714911f3"
  },
  "next": "none — ready for review"
}

What changed

The sidebar's + → New group chat flow takes an optional Group name and refuses a name another group chat already has, before create-room is sent. Settings → Group chats already had a name field; this pane did not.

  • core/src/client/new-chat.js: a groupName state, finalGroupName = groupName.trim(), and a groupNameClash that compares roster.rooms names with trim + lower case — the host's own comparison in roster.findRooms — so Create group chat is disabled while it matches, with one bt-note bt-danger line naming the room that holds the name.
  • A blank name sends no name key at all, so the host keeps naming the room after its members.
  • A refusal that still reaches the pane is printed through hostText, so a known sentence reads in Chinese; the one new key is A group chat named {name} already exists.
  • core/src/client/styles.js: three lines — .bt-nc-name, its input, and .bt-nc-name+.bt-drop{top:82px} so the recipient list opens under the name row instead of over it; core/src/client/i18n.js: the one new key; docs/subsystems/core-client.md and one changelog fragment.

Nothing in core/src/host/ changed: create-room already takes name, and roster.createRoom already refuses a duplicate and cuts at ROOM_NAME_MAX.

Verification at the tip

Tip SHA: 4b1c37b0eac1bc1990c89fd50cdf2398714911f3

Ran: TZ=UTC TMPDIR=/data/flybot-tmp npm run verify → exit 0 (core suite 3345 tests / 3344 pass / 0 fail; every plugin suite 0 fail).
Ran: cd core && TZ=UTC node --test test/group-create-readonly.test.js → 6/6 after the change. With the implementation reverted and only the tests added, 3 of 6 failed: the pane offers one name field, the pane still offers the field, and Create is disabled for a taken name (false !== true).
Ran: node core/scripts/build-client.mjs --check → exit 0 on the committed core/client.js.
Ran: node scripts/ds-bot-patches.mjs check → ok 10 patches apply cleanly in order and core/ equals ds-bot/ + patches/ds-bot/; canonical → generate is a no-op.
Ran: node .github/scripts/check-mojibake.mjs --check → mojibake: ok — 0 occurrences.
Ran: node .github/scripts/changelog.mjs check → the fragments are well formed.
Ran: npm --prefix core run arch-docs → arch-docs: OK (11 changed file(s)).
Ran: the related suites one by one — new-chat 11, new-chat-menu 2, group-create-readonly 6, i18n 3, i18n-missing-entries 17, readonly-reload-lines 7, composer-send-readonly 7, client-bundle 2, settings-readonly-pages 15, create-bot-readonly 3, details-group-settings-readonly 3 = 76/76.

Not run: the smoke test — nothing in index.js or core/src/host/ changed.
Not run: the Settings → Group chats duplicate-name path (settings.js run) still prints the host's English sentence; that is known, recorded in #3196, and a separate change.
Not run: no visual check of the narrow window's To: row in a real browser.

@Birfy Birfy added the agent-pr Pull request opened by an agent label Nov 19, 2026
@Birfy Birfy self-assigned this Nov 19, 2026
@github-actions github-actions Bot added the risk:T1 Risk tier T1 (client, tests, generated files), set by the controller from the diff label Nov 19, 2026
The sidebar's New group chat flow had no name field while Settings did, and
a taken name only reached the host, which answered in English. The pane now
takes an optional Group name (blank sends no key, so the host names the room
after its members), refuses a name another room already has (trim + lower
case, the host's own comparison) by disabling Create with a Chinese note, and
prints a host refusal through hostText.

Part of #3114
Fixes #3196
@Birfy
Birfy force-pushed the dev/3114-group-name branch from 28070fd to 4b1c37b Compare November 19, 2026 01:27
@Birfy
Birfy added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 5f6c832 Nov 19, 2026
18 of 19 checks passed
@Birfy
Birfy deleted the dev/3114-group-name branch November 19, 2026 01:49
@github-actions github-actions Bot removed the agent-pr Pull request opened by an agent label Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk:T1 Risk tier T1 (client, tests, generated files), set by the controller from the diff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[#3114] 新建群聊能起名、重名当场拒绝(+ 面板)

1 participant