Skip to content

Commit e5fc62d

Browse files
authored
client: a read-only window's new-group composer still draws a Send arrow that silently does nothing once an admin is chosen (#2504)
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`/`#2501` stopped the writes, but the composer ternary excluded exactly the `group && admin !== null` shape from the host's sentence (that sentence is drawn on the To: line, where `Create group chat` would be), so the composer fell through to a live Send button in a window where `sendMessage` returns at `new-chat.js:146` before 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. `addAgent` is `add-agent`, a write the host refuses (`core/src/host/channel.js:310-312`, `READS` does not carry it), and the row's `if ((roster.agents ?? []).length === 0)` never read `lockedWindow` even though the same function computes `locked` at `: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 `#2501` docs sentence made true per shape plus the menu's own item, and two changelog fragments. The send path, `makeGroup`'s own `locked` guard, the To:-row sentence, the Create paths `#2496` already locked, `service.js` and `core/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: - the composer draws no Send control at all — the case asserts `sendButton(nodes) === undefined`, not merely that a drawn button is disabled; - Enter in the composer reaches the host with nothing: `calls` is empty, so no `send` and no `create-room`; - the host's own sentence appears exactly once, in one `.bt-hint.bt-read-only` whose text is `hostText(roster.readOnly)`, on the To: line where Create was; - the writable control next door is unchanged: Send is drawn and enabled, one press is `[['send', 'scout', 'hello there'], ['open-session', 'scout']]`, several picks are `create-room` then `send` then `open-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): - the menu itself is drawn (`New group chat` is there) and the `Add coding agent` row is not: the case asserts the row is absent, not that a drawn row does nothing; - with the row absent there is no press to make, and drawing or pressing nothing writes nothing: `calls` stays empty; no `add-agent` reaches the host, so no `bot/read-only` comes back; - the writable control next door is unchanged: the row is drawn and exactly one press sends exactly one `['add-agent']`. ## Red first Both cases fail on the clean base `550fb3ac` with the base source in place and only the test file from this branch: ``` not ok 4 - a read-only window draws no Send for a group that still has its admin chosen the composer draws no live Send control - undefined + { type: 'button', className: 'bt-nc-send', disabled: false, onClick: [Function: sendMessage] } not ok 6 - a read-only New… menu draws no Add coding agent row no Add coding agent row in a read-only window true !== false # tests 7 # pass 5 # fail 2 ``` They are independent: with both fixes in place, putting back only the composer ternary (`locked && !(group && admin !== null)`) leaves `# pass 6 / # fail 1` with case 4 the only red, and dropping only `!locked` from the Add coding agent guard leaves `# pass 6 / # fail 1` with case 6 the only red. With both in place the file is 7/7 green. ## What I ran at `4a3798c0ef4f2d2a8f18b23b4e69eb7892a97b92` (`TZ=UTC`, clean tree, tree `bf57d007`) - `npm run build` (core), then `node scripts/ds-bot-patches.mjs generate` twice and a third time: the working diff is byte-identical between rounds (`git diff | sha256sum` equal), so `generate` is 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` + `policy` **671**, `test:interop` **37**, `test:live-e2e` **26** — 4944 tests, 0 failed. Lint: 0 errors (78/36/9/2/16 warnings, none in the files this PR touches); `build-client.mjs --check` and `ds-bot-patches check`/`canonical` green in the same run. ## What I did not run - The host smoke test and a live service on a bench port — this change is client-only (`core/src/client/**`), no host code. ## Files 9 files, +123/−21 (`git diff --numstat 550fb3a...4a3798c`), tree `bf57d007`: - `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 `#2499` bullet 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. <!-- flybot:checkpoint --> ```json { "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" } ``` <!-- /flybot:checkpoint -->
1 parent 550fb3a commit e5fc62d

9 files changed

Lines changed: 123 additions & 21 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
In a read-only window a new group chat that already picked its admin no longer draws a **Send** arrow that does nothing: the composer draws no send control at all, and the host's own read-only sentence stays once, on the To: line where **Create group chat** would be. A writable window is unchanged ([#2503](https://github.com/ThinkFlowLab/FlyBot/issues/2503)).
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A read-only window's New… menu no longer offers **Add coding agent**: `addAgent` is a write the host answers `bot/read-only`, so the row is not drawn at all while the other rows stay as a preview, and a writable window keeps the row ([#2506](https://github.com/ThinkFlowLab/FlyBot/issues/2506)).

‎core/client.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16158,7 +16158,7 @@ function NewChat({ mode, roster, actions }) {
1615816158
}
1615916159
});
1616016160
}
16161-
if ((roster.agents ?? []).length === 0) {
16161+
if (!locked && (roster.agents ?? []).length === 0) {
1616216162
options.push({ key: "agent", icon: (0, import_react34.createElement)(TerminalIcon), label: t("Add coding agent"), hint: t("A coding session without a Bot"), run: () => run(async () => {
1616316163
await actions.addAgent();
1616416164
close();
@@ -16327,7 +16327,7 @@ ${listed}`, { axis: "y", ...QUICK_EDGES });
1632716327
}
1632816328
}
1632916329
}),
16330-
locked && !(group && admin !== null) ? (0, import_react34.createElement)("div", { className: "bt-hint bt-read-only", role: "status" }, hostText(roster.readOnly)) : (0, import_react34.createElement)("button", { type: "button", className: "bt-nc-send", "aria-label": t("Send message"), disabled: busy || message.trim() === "" || picked.length === 0, onClick: sendMessage }, (0, import_react34.createElement)(ArrowUpIcon))
16330+
locked ? group && admin !== null ? null : (0, import_react34.createElement)("div", { className: "bt-hint bt-read-only", role: "status" }, hostText(roster.readOnly)) : (0, import_react34.createElement)("button", { type: "button", className: "bt-nc-send", "aria-label": t("Send message"), disabled: busy || message.trim() === "" || picked.length === 0, onClick: sendMessage }, (0, import_react34.createElement)(ArrowUpIcon))
1633116331
)
1633216332
)
1633316333
)

‎core/src/client/new-chat.js‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,9 @@ export function NewChat({ mode, roster, actions }) {
185185
},
186186
})
187187
}
188-
// A team holds at most one Agent; the entry exists only while there is none.
189-
if ((roster.agents ?? []).length === 0) {
188+
// A team holds at most one Agent; the entry exists only while there is none, and a read-only
189+
// window does not offer it at all: the host answers `add-agent` with `bot/read-only` (P-571b).
190+
if (!locked && (roster.agents ?? []).length === 0) {
190191
options.push({ key: 'agent', icon: h(TerminalIcon), label: t('Add coding agent'), hint: t('A coding session without a Bot'), run: () => run(async () => { await actions.addAgent(); close() }) })
191192
}
192193
}
@@ -295,7 +296,9 @@ export function NewChat({ mode, roster, actions }) {
295296
if (event.key === 'Enter' && !event.shiftKey && !event.nativeEvent.isComposing) { event.preventDefault(); sendMessage() }
296297
},
297298
}),
298-
locked && !(group && admin !== null)
299-
? h('div', { className: 'bt-hint bt-read-only', role: 'status' }, hostText(roster.readOnly))
299+
locked
300+
? (group && admin !== null
301+
? null
302+
: h('div', { className: 'bt-hint bt-read-only', role: 'status' }, hostText(roster.readOnly)))
300303
: h('button', { type: 'button', className: 'bt-nc-send', 'aria-label': t('Send message'), disabled: busy || message.trim() === '' || picked.length === 0, onClick: sendMessage }, h(ArrowUpIcon))))))
301304
}

‎core/test/composer-send-readonly.test.js‎

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
// `create-room` + `send` for several, and `openBot` sent the typed line when a picker row was
33
// pressed — every shape reached a host that can only answer `bot/read-only` after the fact. A
44
// locked window now draws the host's own sentence beside the composer instead of a live Send, no
5-
// press writes, and a writable window sends exactly as before.
5+
// press writes, and a writable window sends exactly as before. The New… menu is the same shape one
6+
// step earlier (P-571b): `Add coding agent` asked a host that answers `bot/read-only`, so a locked
7+
// menu does not draw it and a writable one keeps it.
68
import { test } from 'node:test'
79
import assert from 'node:assert/strict'
810
import { fileURLToPath } from 'node:url'
@@ -73,7 +75,7 @@ const actionsOf = () => {
7375
send: async (id, text) => { calls.push(['send', id, text]) },
7476
openSession: id => { calls.push(['open-session', id]) }, closeOverlay() {}, notify() {},
7577
setFlags: async (id, flags) => { calls.push(['set-flags', id, flags]) },
76-
newChatActionRows() {}, addAgent: async () => {}, createBot: async () => ({ id: 'new' }),
78+
newChatActionRows() {}, addAgent: async () => { calls.push(['add-agent']) }, createBot: async () => ({ id: 'new' }),
7779
openSettings() {}, openPalette() {},
7880
},
7981
}
@@ -172,6 +174,12 @@ const groupSend = async (roster, picks, { enter = false } = {}) => {
172174
const sent = await view.send({ enter })
173175
return { calls: view.calls, ...sent }
174176
}
177+
// The New… menu itself: a short action list, no To: row and no composer.
178+
const menuPane = (roster) => {
179+
const { calls, actions } = actionsOf()
180+
const pane = mount({ mode: 'new', roster, actions })
181+
return { calls, nodes: () => pane.draw() }
182+
}
175183
// A picker row pressed with a line typed is the other send path (`openBot`, a search pane).
176184
const searchThenOpen = async (roster, name) => {
177185
const { calls, actions } = actionsOf()
@@ -208,6 +216,26 @@ test('a read-only window sends nothing when a picker row is pressed with a line
208216
assert.ok(locked.calls.some(call => call[0] === 'open-session' && call[1] === 'chief'), 'opening the session may stay')
209217
})
210218

219+
// A read-only group chat whose admin is still chosen keeps its Create slot as the host's sentence
220+
// on the To: line; the composer below must not draw a second live Send for it.
221+
test('a read-only window draws no Send for a group that still has its admin chosen', async () => {
222+
const view = groupCompose(rosterWith(SENTENCE))
223+
await view.pick('Chief')
224+
await view.pick('Scout')
225+
let nodes = view.pane.draw()
226+
typeLine(nodes, 'hello there')
227+
await flush()
228+
nodes = view.pane.draw()
229+
assert.equal(sendButton(nodes), undefined, 'the composer draws no live Send control')
230+
enterInComposer(nodes)
231+
await flush()
232+
nodes = view.pane.draw()
233+
assert.deepEqual(view.calls, [], 'Enter writes nothing')
234+
const line = readOnlyLine(nodes)
235+
assert.equal(line.length, 1, "the host's own sentence is shown exactly once")
236+
assert.equal(ownText(line[0]).trim(), SENTENCE)
237+
})
238+
211239
test('a writable window still sends once from the composer', async () => {
212240
for (const roster of [rosterWith(undefined), rosterWith(''), rosterWith(' ')]) {
213241
const open = await groupSend(roster, ['Scout'])
@@ -221,3 +249,21 @@ test('a writable window still sends once from the composer', async () => {
221249
assert.deepEqual(many.calls[2], ['open-session', 'r-new'], 'then open the new room')
222250
}
223251
})
252+
253+
// P-571b: the Add coding agent row is an ask the host answers `bot/read-only`, so a locked window
254+
// must not offer it at all; a writable one keeps the row and it still posts.
255+
test('a read-only New… menu draws no Add coding agent row', async () => {
256+
const menu = menuPane(rosterWith(SENTENCE))
257+
const nodes = menu.nodes()
258+
assert.ok(nodes.some(optionRow('New group chat')), 'the menu itself is drawn')
259+
assert.equal(nodes.some(optionRow('Add coding agent')), false, 'no Add coding agent row in a read-only window')
260+
assert.deepEqual(menu.calls, [], 'drawing the menu writes nothing')
261+
})
262+
263+
test('a writable New… menu keeps Add coding agent and asks once when it is pressed', async () => {
264+
const menu = menuPane(rosterWith(undefined))
265+
const nodes = menu.nodes()
266+
press(nodes, optionRow('Add coding agent'))
267+
await flush()
268+
assert.deepEqual(menu.calls, [['add-agent']], 'one press asks add-agent exactly once')
269+
})

‎docs/subsystems/core-client.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ The member's own chat keeps its `busyAcks[sessionId]` bubble and its visibility
225225
- Create Bot starts on the Main Bot's model (#230): `startModel()` (`bot-draft.js`) picks the Main Bot's chosen model, else the one it last ran on, when it is served; then `roster.defaultModel`, then the first served model. Only served models are picked, so a provider without a credential is never preselected.
226226
- A read-only window draws no Create control in the new-Bot form (#2307): `CreateBot` (`create-bot.js`) reads `lockedWindow(roster)`, the one predicate the other surfaces use, and when it is locked the footer shows the host's own sentence (`.bt-hint.bt-read-only`, `hostText(roster.readOnly)`) where `Create` was, and `create()` returns before `create-bot`; the rest of the form stays as a preview. Both entries end in the same component — the sidebar **+** pane (`new-chat.js`) and Settings → Bots (`settings.js` inline) — so both are covered by the one gate. A writable window is unchanged. Test: `core/test/create-bot-readonly.test.js`.
227227
- Group creation follows the same rule (#2496): `NewGroupForm` (`group-settings.js`) and the group mode of `NewChat` (`new-chat.js`) each read `lockedWindow(roster)`, keep their pickers as a preview, and put `hostText(roster.readOnly)` in a `.bt-hint.bt-read-only` where `Create` was; `create()` and `makeGroup()` return before `create-room`. The entries and the action layer are unchanged. Test: `core/test/group-create-readonly.test.js`.
228-
- The composer's Send follows it (#2499): in a read-only window `sendMessage` returns before `send` and `create-room`, and `openBot` keeps the session open (a read) while dropping the unhide and the typed line; the composer puts `hostText(roster.readOnly)` in a `.bt-hint.bt-read-only` (`role="status"`) where the Send button was, drawn once (the group form's own line already stands when it picked an admin). A writable window sends exactly as before. Test: `core/test/composer-send-readonly.test.js`.
228+
- The composer's Send follows it (#2499): in a read-only window `sendMessage` returns before `send` and `create-room`, and `openBot` keeps the session open (a read) while dropping the unhide and the typed line; the composer draws no Send button at all: where it was, it shows `hostText(roster.readOnly)` in a `.bt-hint.bt-read-only` (`role="status"`); in a group chat that already picked its admin the sentence stands on the To: line, where Create was, and the composer draws nothing, so it appears once. A writable window sends exactly as before. The New… menu follows the same lock (#2506): the short action menu in `NewChat` reads the one `lockedWindow` predicate and, in a read-only window, draws no **Add coding agent** row at all — `addAgent` is a write the host refuses with `bot/read-only` — while the other rows stay drawn as a preview and a writable window keeps the row, where one press asks `add-agent` exactly once. Test: `core/test/composer-send-readonly.test.js`.
229229
- A missing model credential has its fix under the error (#405): `TurnErrorCell` (`model-menu.js`) shadows DSH's `turn-error` chat node (`locale: 'chat'`, so title and the AUTH / QUOTA / account copy are DSH's own strings). When the failure says the route has no API key (`missingModelKey`, e.g. `no API key for provider route "deepseek-official"`), the row says the Bot's model has no API key yet (the raw provider text is not drawn, not even on hover, since a provider may echo part of a key) and, for a `deepseek*` route, offers the same chips as a Bot with no model (`setupChoices`: Sign in to DeepSeek where the shell can, Enter a DeepSeek API key, Open settings to set up a custom model); any other or unnamed route gets Manage models. Under the DeepSeek chips (here and in the no-model dock) a **How to set a DeepSeek API key** link (`KeyHelpLink`, new tab) opens [docs/deepseek-api-key.md](../deepseek-api-key.md) on GitHub: DSH's own key dialog keeps only a typed or pasted key (#451), so the guide also gives the credentials file and `DEEPSEEK_API_KEY` ways. Every other failure reads as DSH writes it, with no buttons.
230230
- **Models and providers…**, **Manage models** and **Open settings to set up a custom model** open DSH's Settings on its Models page (#407), not General: the `settings.launcher` seat's `openSettings()` takes no section, so `openHarnessModels()` (`sidebar.js`) calls the seat's `openOnboarding('flybot-models')`. That `settings.onboarding` step (`ModelsSettingsStep`, order 1000, after DSH's own steps) is handed `openSection`: opened on purpose (`explicit`) it calls `openSection('models')`, then `complete()`; in first-run onboarding it only completes. With no seat it falls back to `openHarnessSettings()`. FlyBot's own **Harness settings** entry still opens DSH settings as a whole.
231231
- Settings say each thing once (#230): the Model and Main Bot cards show no row label that repeats the card title (`SwitchRow` `showLabel: false` keeps the switch's accessible name), the Create Bot dialog has its Back / Close in the header only (the footer Back / Cancel is for the inline form), and the account menu is as wide as its longest item (`width:max-content`, capped to the viewport) instead of cutting `Switch to classic Agent mode`.

‎patches/ds-bot/0003-flybot-api-client.patch‎

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,7 +2343,7 @@ diff --git a/src/client/new-chat.js b/src/client/new-chat.js
23432343
const text = message.trim()
23442344
if (group && admin !== null) { await makeGroup(); return }
23452345
if (text === '' || picked.length === 0) return
2346-
@@ -87,24 +87,51 @@ export function NewChat({ mode, roster, actions }) {
2346+
@@ -87,24 +87,52 @@ export function NewChat({ mode, roster, actions }) {
23472347
close()
23482348
return
23492349
}
@@ -2364,6 +2364,8 @@ diff --git a/src/client/new-chat.js b/src/client/new-chat.js
23642364
- options.push({ key: 'new', icon: h(PlusIcon), label: t('Create new Bot'), run: createBot })
23652365
- options.push({ key: 'group', icon: h(PeopleIcon), label: t('Create group chat'), run: () => { setGroup(true); setCursor(0); inputRef.current?.focus() } })
23662366
- // A team holds at most one DSH Agent; the entry exists only while there is none.
2367+
- if ((roster.agents ?? []).length === 0) {
2368+
- options.push({ key: 'agent', icon: h(FishLogo, { size: 16 }), label: t('Add DSH Agent'), run: () => run(async () => { await actions.addAgent(); close() }) })
23672369
+ if (menuOnly) {
23682370
+ options.push({ key: 'chat', icon: h(ChatIcon), label: t('New chat'), hint: t('Message one of your Bots'), run: () => { setCompose(true); setCursor(0); setTimeout(() => inputRef.current?.focus()) } })
23692371
+ }
@@ -2383,9 +2385,9 @@ diff --git a/src/client/new-chat.js b/src/client/new-chat.js
23832385
+ },
23842386
+ })
23852387
+ }
2386-
+ // A team holds at most one Agent; the entry exists only while there is none.
2387-
if ((roster.agents ?? []).length === 0) {
2388-
- options.push({ key: 'agent', icon: h(FishLogo, { size: 16 }), label: t('Add DSH Agent'), run: () => run(async () => { await actions.addAgent(); close() }) })
2388+
+ // A team holds at most one Agent; the entry exists only while there is none, and a read-only
2389+
+ // window does not offer it at all: the host answers `add-agent` with `bot/read-only` (P-571b).
2390+
+ if (!locked && (roster.agents ?? []).length === 0) {
23892391
+ options.push({ key: 'agent', icon: h(TerminalIcon), label: t('Add coding agent'), hint: t('A coding session without a Bot'), run: () => run(async () => { await actions.addAgent(); close() }) })
23902392
}
23912393
}
@@ -2483,13 +2485,15 @@ diff --git a/src/client/new-chat.js b/src/client/new-chat.js
24832485
h('div', { className: 'bt-nc-card' },
24842486
h('span', { className: 'bt-nc-plus', 'aria-hidden': true }, h(PlusIcon)),
24852487
h('textarea', {
2486-
@@ -176,5 +176,7 @@ export function NewChat({ mode, roster, actions }) {
2488+
@@ -176,5 +176,9 @@ export function NewChat({ mode, roster, actions }) {
24872489
if (event.key === 'Enter' && !event.shiftKey && !event.nativeEvent.isComposing) { event.preventDefault(); sendMessage() }
24882490
},
24892491
}),
24902492
- h('button', { type: 'button', className: 'bt-nc-send', 'aria-label': t('Send message'), disabled: busy || message.trim() === '' || picked.length === 0, onClick: sendMessage }, h(ArrowUpIcon))))))
2491-
+ locked && !(group && admin !== null)
2492-
+ ? h('div', { className: 'bt-hint bt-read-only', role: 'status' }, hostText(roster.readOnly))
2493+
+ locked
2494+
+ ? (group && admin !== null
2495+
+ ? null
2496+
+ : h('div', { className: 'bt-hint bt-read-only', role: 'status' }, hostText(roster.readOnly)))
24932497
+ : h('button', { type: 'button', className: 'bt-nc-send', 'aria-label': t('Send message'), disabled: busy || message.trim() === '' || picked.length === 0, onClick: sendMessage }, h(ArrowUpIcon))))))
24942498
}
24952499
diff --git a/src/client/overlay-hooks.js b/src/client/overlay-hooks.js

‎patches/ds-bot/0008-client-bundle.patch‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20587,6 +20587,8 @@ diff --git a/client.js b/client.js
2058720587
setCursor(0);
2058820588
inputRef.current?.focus();
2058920589
} });
20590+
- if ((roster.agents ?? []).length === 0) {
20591+
- options.push({ key: "agent", icon: (0, import_react20.createElement)(import_dsh_client_ui_primitives4.FishLogo, { size: 16 }), label: t("Add DSH Agent"), run: () => run(async () => {
2059020592
+ for (const action of newChatActionRows({ mode, group, picked, query, roster })) {
2059120593
+ options.push({
2059220594
+ key: action.key,
@@ -20601,8 +20603,7 @@ diff --git a/client.js b/client.js
2060120603
+ }
2060220604
+ });
2060320605
+ }
20604-
if ((roster.agents ?? []).length === 0) {
20605-
- options.push({ key: "agent", icon: (0, import_react20.createElement)(import_dsh_client_ui_primitives4.FishLogo, { size: 16 }), label: t("Add DSH Agent"), run: () => run(async () => {
20606+
+ if (!locked && (roster.agents ?? []).length === 0) {
2060620607
+ options.push({ key: "agent", icon: (0, import_react34.createElement)(TerminalIcon), label: t("Add coding agent"), hint: t("A coding session without a Bot"), run: () => run(async () => {
2060720608
await actions.addAgent();
2060820609
close();
@@ -20774,7 +20775,7 @@ diff --git a/client.js b/client.js
2077420775
}
2077520776
}),
2077620777
- (0, import_react20.createElement)("button", { type: "button", className: "bt-nc-send", "aria-label": t("Send message"), disabled: busy || message.trim() === "" || picked.length === 0, onClick: sendMessage }, (0, import_react20.createElement)(ArrowUpIcon))
20777-
+ locked && !(group && admin !== null) ? (0, import_react34.createElement)("div", { className: "bt-hint bt-read-only", role: "status" }, hostText(roster.readOnly)) : (0, import_react34.createElement)("button", { type: "button", className: "bt-nc-send", "aria-label": t("Send message"), disabled: busy || message.trim() === "" || picked.length === 0, onClick: sendMessage }, (0, import_react34.createElement)(ArrowUpIcon))
20778+
+ locked ? group && admin !== null ? null : (0, import_react34.createElement)("div", { className: "bt-hint bt-read-only", role: "status" }, hostText(roster.readOnly)) : (0, import_react34.createElement)("button", { type: "button", className: "bt-nc-send", "aria-label": t("Send message"), disabled: busy || message.trim() === "" || picked.length === 0, onClick: sendMessage }, (0, import_react34.createElement)(ArrowUpIcon))
2077820779
)
2077920780
)
2078020781
)

0 commit comments

Comments
 (0)