Repository navigation
client: a read-only window's new-group composer still draws a Send arrow that silently does nothing once an admin is chosen - #2504
Open
HugoXK wants to merge 1 commit into
Conversation
HugoXK
force-pushed
the
dev/2-composer-groupadmin-locked
branch
from
November 5, 2026 05:53
999a8ac to
4a3798c
Compare
HugoXK
marked this pull request as ready for review
November 5, 2026 05:59
Contributor
Author
|
Queue request — please take this tip to the merge queue.
|
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2503
Fixes #2506
Owner: Dev-2
Reviewer: Birfy
Written-by: FlyBot Dev-2
Claim-Id: 7a28ae9f7eb744ac9719db7351b3e7e2
Risk tier: T1
What changes
Two read-only shapes still drew a control whose press could only earn the host's
bot/read-only. They sit on the same screen and the same bundle lane, so one PR closes both; each has its own case and its own acceptance below.#2503— a new group chat that already picked its admin.#2499/#2501stopped the writes, but the composer ternary excluded exactly thegroup && admin !== nullshape from the host's sentence (that sentence is drawn on the To: line, whereCreate group chatwould be), so the composer fell through to a live Send button in a window wheresendMessagereturns atnew-chat.js:146before any branch. In a locked window the composer now draws no Send in any shape: where the button was it shows the host's own sentence (hostText(roster.readOnly),.bt-hint.bt-read-only,role="status"), and in the group-with-admin shape that sentence already stands on the To: line, so the composer draws nothing and the view carries it exactly once.#2506— the New… menu's Add coding agent row.addAgentisadd-agent, a write the host refuses (core/src/host/channel.js:310-312,READSdoes not carry it), and the row'sif ((roster.agents ?? []).length === 0)never readlockedWindoweven though the same function computeslockedat:42. A locked menu now does not draw the row at all — it is not replaced by a sentence, the menu is a preview — while the other rows (New chat, New Bot, New group chat, a plugin row) stay drawn, and a writable window keeps the row.Scope is those two guards, the two regression cases in one test file, the
#2501docs sentence made true per shape plus the menu's own item, and two changelog fragments. The send path,makeGroup's ownlockedguard, the To:-row sentence, the Create paths#2496already locked,service.jsandcore/src/host/**are untouched.Acceptance — #2503
In a read-only window, New… → New group chat → choose the admin → pick one more Bot → type a line:
sendButton(nodes) === undefined, not merely that a drawn button is disabled;callsis empty, so nosendand nocreate-room;.bt-hint.bt-read-onlywhose text ishostText(roster.readOnly), on the To: line where Create was;[['send', 'scout', 'hello there'], ['open-session', 'scout']], several picks arecreate-roomthensendthenopen-session, and no read-only line is drawn.Acceptance — #2506
In a read-only window, the New… menu (
mode: 'new', no To: row, no composer):New group chatis there) and theAdd coding agentrow is not: the case asserts the row is absent, not that a drawn row does nothing;callsstays empty; noadd-agentreaches the host, so nobot/read-onlycomes back;['add-agent'].Red first
Both cases fail on the clean base
550fb3acwith the base source in place and only the test file from this branch:They are independent: with both fixes in place, putting back only the composer ternary (
locked && !(group && admin !== null)) leaves# pass 6 / # fail 1with case 4 the only red, and dropping only!lockedfrom the Add coding agent guard leaves# pass 6 / # fail 1with case 6 the only red. With both in place the file is 7/7 green.What I ran at
4a3798c0ef4f2d2a8f18b23b4e69eb7892a97b92(TZ=UTC, clean tree, treebf57d007)npm run build(core), thennode scripts/ds-bot-patches.mjs generatetwice and a third time: the working diff is byte-identical between rounds (git diff | sha256sumequal), sogenerateis idempotent here.node scripts/ds-bot-patches.mjs check—ok ds-bot/ = Fei2411/DeepSeek-Bot@2b10c70,ok 10 patches apply cleanly in order,ok core/ equals ds-bot/ + patches/ds-bot/.TZ=UTC ARCH_DOCS_BASE=550fb3ac7d8eb74b749c1accf7586b0eb6d8a321 npm run verify— exit 0. Segment counts, each# fail 0: core 2915 passed, plugins/social 577, plugins/tree 137, plugins/timeline 141, plugins/workflow 440,.github/scripts+policy671,test:interop37,test:live-e2e26 — 4944 tests, 0 failed. Lint: 0 errors (78/36/9/2/16 warnings, none in the files this PR touches);build-client.mjs --checkandds-bot-patches check/canonicalgreen in the same run.What I did not run
core/src/client/**), no host code.Files
9 files, +123/−21 (
git diff --numstat 550fb3ac...4a3798c0ef4f2d2a8f18b23b4e69eb7892a97b92), treebf57d007:core/src/client/new-chat.js(+7/−4) — the composer ternary and the menu row's guard, hand-written.core/test/composer-send-readonly.test.js(+48/−2) — both regression cases plus the two writable controls, hand-written.docs/subsystems/core-client.md(+1/−1) — the#2499bullet now says the sentence stands on the To: line for this shape and the composer draws nothing, and the New… menu's item joins it.changelog.d/2503-composer-group-admin-locked.fixed.md(+1),changelog.d/2506-newchat-add-agent-locked.fixed.md(+1) — new fragments.core/client.js(+2/−2),patches/ds-bot/0003-flybot-api-client.patch(+11/−7),patches/ds-bot/0008-client-bundle.patch(+4/−3),patches/ds-bot/files/test/composer-send-readonly.test.js(+48/−2) — generated by build +generate, never hand-edited.{ "pr": 2504, "claim": "Dev-2", "issue": 2503, "summary": "Two read-only shapes that drew a control the host refuses are gone: a group composer whose admin is already chosen no longer draws a Send arrow that does nothing (the host's sentence stays once, on the To: line), and the New… menu no longer draws Add coding agent, whose add-agent the host answers with bot/read-only. Each has its own failing case and its own writable control, and this PR closes #2503 and #2506.", "files": [ "core/src/client/new-chat.js", "core/test/composer-send-readonly.test.js", "docs/subsystems/core-client.md", "changelog.d/2506-newchat-add-agent-locked.fixed.md" ], "checks": { "ran": "TZ=UTC ARCH_DOCS_BASE=550fb3ac npm run verify (plus npm run build and ds-bot-patches generate/check)", "result": "green", "at": "4a3798c0ef4f2d2a8f18b23b4e69eb7892a97b92" }, "next": "none — ready for review" }