Skip to content

Commit 14e7df9

Browse files
committed
Merge main into dev/1-feedback-count-total
Bring the branch onto 5f7de47 (#2933, plugin install profile name) so the client bundle and the 0008 patch are re-emitted from the new main.
1 parent 5f7de47 commit 14e7df9

8 files changed

Lines changed: 72 additions & 25 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The Feedback page's error count now divides by the whole log, not by the rows on screen: a log of sixty errors reads `Showing 8 of 60` folded and `Showing 50 of 60` open, instead of `Showing 8 of 50` and `Showing all 50` under a `Recent errors · 60` title. The count line and the title now report the same number, so ten errors are no longer missing from a page that claims to hold all of them. See [#2932](https://github.com/ThinkFlowLab/FlyBot/issues/2932).

‎core/client.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19194,13 +19194,13 @@ function FeedbackPage({ roster, actions, run, Section, Row: Row4 }) {
1919419194
),
1919519195
entry.code ? (0, import_react41.createElement)("span", { className: "bt-tag bt-fb-code" }, entry.status ? `${entry.code} ${entry.status}` : entry.code) : null
1919619196
)),
19197-
entries2.length > 8 ? (0, import_react41.createElement)(
19197+
total > 8 ? (0, import_react41.createElement)(
1919819198
"div",
1919919199
{ key: "more", className: "bt-set-row bt-fb-more-row" },
1920019200
(0, import_react41.createElement)(
1920119201
"span",
1920219202
{ className: "bt-set-hint bt-fb-count" },
19203-
allErrors ? t("Showing all {count}", { count: entries2.length }) : t("Showing {shown} of {count}", { shown: shown.length, count: entries2.length })
19203+
allErrors && entries2.length === total ? t("Showing all {count}", { count: total }) : t("Showing {shown} of {count}", { shown: shown.length, count: total })
1920419204
),
1920519205
(0, import_react41.createElement)("button", {
1920619206
type: "button",

‎core/src/client/feedback.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ export function FeedbackPage({ roster, actions, run, Section, Row }) {
143143
h('span', { className: 'bt-fb-text' }, entrySummary(entry)),
144144
h('span', { className: 'bt-set-hint' }, [whenText(entry.time), entry.bot, entry.where, t(SOURCES[entry.source] ?? 'FlyBot')].filter(Boolean).join(' · '))),
145145
entry.code ? h('span', { className: 'bt-tag bt-fb-code' }, entry.status ? `${entry.code} ${entry.status}` : entry.code) : null)),
146-
entries.length > 8
146+
total > 8
147147
? h('div', { key: 'more', className: 'bt-set-row bt-fb-more-row' },
148148
h('span', { className: 'bt-set-hint bt-fb-count' },
149-
allErrors
150-
? t('Showing all {count}', { count: entries.length })
151-
: t('Showing {shown} of {count}', { shown: shown.length, count: entries.length })),
149+
allErrors && entries.length === total
150+
? t('Showing all {count}', { count: total })
151+
: t('Showing {shown} of {count}', { shown: shown.length, count: total })),
152152
h('button', {
153153
type: 'button', className: 'bt-soft bt-soft-sm bt-fb-more', 'aria-expanded': allErrors,
154154
onClick: () => setAllErrors(!allErrors),

‎core/test/feedback-errors-more.test.js‎

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,41 @@ test('#2266: eight or fewer errors draw no control and keep the title as it was'
207207

208208
// #2884: `Show more` was an unlabelled way out — a reader with more than eight errors
209209
// could not tell whether the list was cut or complete from the page itself, and wrote
210-
// bug reports from the eight rows it showed. The control row now carries the count of
211-
// what is drawn against what is loaded: `Showing 8 of 50` while folded, `Showing all 50`
212-
// once open. A report of eight or fewer rows draws neither, exactly as before.
210+
// bug reports from the eight rows it showed. The control row carries the count of what
211+
// is drawn against the whole log: `Showing 8 of 60` while folded, `Showing 50 of 60` once
212+
// open (#2932). A report of eight or fewer rows draws neither, exactly as before.
213213
test('#2884: a list cut at eight rows says how many rows of how many it draws', async () => {
214214
const page = await mount({ entries: errorEntries(50), total: 60 })
215-
assert.equal(page.countText(), 'Showing 8 of 50', 'the folded list says it is drawing eight of the fifty rows it holds')
215+
assert.equal(page.countText(), 'Showing 8 of 60', 'the folded list says it is drawing eight of the sixty errors in the log')
216216
assert.equal(page.text(page.more).trim(), 'Show more')
217217
await page.click()
218-
assert.equal(page.countText(), 'Showing all 50', 'open, the panel says every loaded row is drawn')
218+
assert.equal(page.countText(), 'Showing 50 of 60', 'open, the panel says every loaded row is drawn of the sixty the log holds')
219219
assert.equal(page.rows.length, 50)
220220
await page.click()
221-
assert.equal(page.countText(), 'Showing 8 of 50', 'folded again, the count returns to eight')
221+
assert.equal(page.countText(), 'Showing 8 of 60', 'folded again, the count returns to eight')
222+
})
223+
224+
// #2932: `#2884` counted the rows on screen as the denominator, so the same panel said
225+
// `Recent errors · 60` in its title and `Showing all 50` underneath: ten errors had no
226+
// way out and the page claimed to hold everything. The count line divides by the log the
227+
// title counts, so a long log reads as a part of it even when every loaded row is drawn.
228+
test('#2932: the count line divides by the log, not by the rows the host sent', async () => {
229+
const page = await mount({ entries: errorEntries(50), total: 200 })
230+
assert.equal(page.title(), 'Recent errors · 200', 'the title reports the whole log')
231+
await page.click()
232+
assert.equal(page.countText(), 'Showing 50 of 200', 'open, the fifty drawn are a part of two hundred, not "all"')
233+
assert.equal(page.rows.length, 50)
234+
await page.click()
235+
assert.equal(page.countText(), 'Showing 8 of 200', 'folded, the denominator is the log')
236+
})
237+
238+
// #2932: a log that fits in the payload has nothing beyond the rows drawn, so opening it
239+
// still says every row is drawn — the words it had before, unchanged.
240+
test('#2932: a log that fits in the payload still says all of its rows are drawn', async () => {
241+
const page = await mount({ entries: errorEntries(50), total: 50 })
242+
assert.equal(page.countText(), 'Showing 8 of 50', 'folded, eight of the fifty errors in the log')
243+
await page.click()
244+
assert.equal(page.countText(), 'Showing all 50', 'open, all fifty rows in the log are drawn')
222245
})
223246

224247
test('#2884: eight or fewer rows draw no count line', async () => {

‎docs/subsystems/core-client.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ The browser side of the patched `ds-bot` core (`core/`): sources in `core/src/cl
1818
- Read-only banner: when another dsh holds the team (`roster.readOnly` a non-empty string), the sidebar draws the host's own sentence and, beside it, one **Reload** control in both shapes (wide and rail; the control stays outside the `role="status"` line so a live region remains text). It calls `actions.reloadTeam`, which re-reads the whole team (`state` without `since`, see `stateRequest` / `stateAnswerIsStale` in `sources.js`) so the banner and every refused control clear once the other holder let go, without a page reload that would drop what is in the composer. Tests: `core/test/sidebar-readonly-reload.test.js`, `core/test/client-reload-state.test.js`. Since #2502 that sentence and entry are one shared piece: `client/read-only.js` exports `readOnlyLine(h, roster, actions, { key, className, style, reload })` and `readOnlySaid`, where the first argument is the renderer `h` itself, passed by the caller so the new module never imports react and the generated bundle keeps its bindings, and the Settings header, the drawer's three hint sites (`details-drawer.js` Bot overview, Bot settings view and group overview), the Inbox dialog and the Memory panel draw them instead of their own copies. The Board, both New chat sites (the To: row once the admin is chosen, the composer otherwise) and the Project settings panel draw the same piece since then: each is an overlay that covers the sidebar's own entry, so the sentence they repeat needs its own way to answer it. The sentence stays `bt-hint bt-read-only` under `role="status"`, the button sits outside that node, and a press runs the same `actions.reloadTeam` read with `reportError(error, 'reload')` on failure; one view draws at most one entry, and `reload: false` keeps a sentence without the control so a second hint can never grow a second button. A writable window, and a sentence of only whitespace, draw neither. Tests: `core/test/readonly-reload-lines.test.js`.
1919
- Chat context rows: a tool the plugin registers at install draws one `tool-addition` row, and `cells.js` keeps every name in `TEAM_TOOLS` out of the chat (`SILENT_REGISTRATION_TOOLS`, #1101) — the Project Assistant's `project_digest` joins them (#1712), so its 09:00 Session shows the digest, not its registration.
2020
- A Settings dialog takes focus when it opens (`useDialogFocus` in `core/src/client/overlay-hooks.js`; the `.bt-settings` dialog carries `tabIndex -1` and a ref) and gives it back to the still-connected opener when it closes; it is not a focus trap, so Tab can still leave the dialog for the page behind the scrim (#2251). It is drawn for `DIALOG_EXIT_MS` (160 ms) with `pointer-events: none` on the leaving layer, so the unmount restores focus only while the dialog still holds it (or nothing does) — a click on the page during that window keeps its focus (#2270).
21-
- Settings → Feedback's error list (`feedback.js`) still titles the block with the whole log (`Recent errors · 60`) but lists only the newest eight, so when the report holds more rows one `Show more` control (`aria-expanded`) sits under them beside a count of what is drawn (`Showing 8 of 50` while folded, `Showing all 50` open), and draws every loaded error, folding back to `Show less`; a report of eight or fewer draws neither (#2266, #2884).
21+
- Settings → Feedback's error list (`feedback.js`) still titles the block with the whole log (`Recent errors · 60`) but lists only the newest eight, so when the report holds more rows one `Show more` control (`aria-expanded`) sits under them beside a count of what is drawn against the whole log the title counts (`Showing 8 of 60` while folded, `Showing 50 of 60` open, and `Showing all 50` only when the payload holds the whole log), and draws every loaded error, folding back to `Show less`; a report of eight or fewer draws neither (#2266, #2884, #2932).
2222
- An error toast keeps the host's code: `reportError` in `index.js` puts `error.code` into the toast payload and `feedback.js` draws it as a `bt-tag bt-toast-code`, so a reader can tell `bot/read-only` from any other refusal. That code is also the one action a toast can take: a `bot/read-only` toast offers **Reload** (`bt-toast-reload`) in place, which dismisses the toast and runs the client's own full-state read (`actions.reloadTeam`), so the window becomes writable once the other holder let go without a page reload that would drop the composer; a failed read goes to `actions.reportError(error, 'reload')` the way the sidebar's Reload does. Every other code, and a toast with no code, draws the sentence and **Details** exactly as before (P-502). That sentence is never blank: `api.js` answers a host refusal that carries no message of its own with `Request failed` (`result.error?.message || 'Request failed'` on the thrown error and on the noted copy alike), so a surface that prints `error.message` shows a refusal rather than nothing, and a memory row whose count sentence tests the failure for truth settles on it instead of `Loading…` (#2411). Tests: `core/test/api-empty-message.test.js`.
2323
- A link picked in a chat message opens in FlyBot's own panel: a capture-phase click handler on each bubble and on the person's own line (`bubbleLinkClick` in `cells.js`; a group card's container carries none, so a reply's link opens the tab of the Bot that spoke) takes an `http(s)` anchor before the host's delegate does, puts a tab in the panel's browser view (the globe button's view) with `actions.browserNewTab` and carries the URL with `actions.browserNavigate`; `browserNewTab` answers `null` for a Bot outside the roster, and with no tab — or no Desktop bridge — the page opens in the window itself. A mention, a file link and a modified or middle click are left alone, and the bubble renders bare `MarkdownText` so the host's `openFile`/`fileImages` reach it: a nested `MarkdownDelegateProvider` replaces the host's capabilities, and one that lacked `fileImages` drew every bubble image as its alt text (#2319). Left to the host a click opened a tab in the host's right sidebar, which this panel's fixed layer covers, so the content area looked blank (#2201). Tests: `core/test/chat-link-open.test.js`.
2424

‎patches/ds-bot/0001-core-fixes.patch‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -630,12 +630,12 @@ diff --git a/src/client/feedback.js b/src/client/feedback.js
630630
- h('span', { className: 'bt-set-hint' }, [whenText(entry.time), entry.bot, entry.where, t(SOURCES[entry.source] ?? 'DS Bot')].filter(Boolean).join(' · '))),
631631
+ h('span', { className: 'bt-set-hint' }, [whenText(entry.time), entry.bot, entry.where, t(SOURCES[entry.source] ?? 'FlyBot')].filter(Boolean).join(' · '))),
632632
entry.code ? h('span', { className: 'bt-tag bt-fb-code' }, entry.status ? `${entry.code} ${entry.status}` : entry.code) : null)),
633-
+ entries.length > 8
633+
+ total > 8
634634
+ ? h('div', { key: 'more', className: 'bt-set-row bt-fb-more-row' },
635635
+ h('span', { className: 'bt-set-hint bt-fb-count' },
636-
+ allErrors
637-
+ ? t('Showing all {count}', { count: entries.length })
638-
+ : t('Showing {shown} of {count}', { shown: shown.length, count: entries.length })),
636+
+ allErrors && entries.length === total
637+
+ ? t('Showing all {count}', { count: total })
638+
+ : t('Showing {shown} of {count}', { shown: shown.length, count: total })),
639639
+ h('button', {
640640
+ type: 'button', className: 'bt-soft bt-soft-sm bt-fb-more', 'aria-expanded': allErrors,
641641
+ onClick: () => setAllErrors(!allErrors),

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23551,13 +23551,13 @@ diff --git a/client.js b/client.js
2355123551
)),
2355223552
- (0, import_react26.createElement)(
2355323553
- Row3,
23554-
+ entries2.length > 8 ? (0, import_react41.createElement)(
23554+
+ total > 8 ? (0, import_react41.createElement)(
2355523555
+ "div",
2355623556
+ { key: "more", className: "bt-set-row bt-fb-more-row" },
2355723557
+ (0, import_react41.createElement)(
2355823558
+ "span",
2355923559
+ { className: "bt-set-hint bt-fb-count" },
23560-
+ allErrors ? t("Showing all {count}", { count: entries2.length }) : t("Showing {shown} of {count}", { shown: shown.length, count: entries2.length })
23560+
+ allErrors && entries2.length === total ? t("Showing all {count}", { count: total }) : t("Showing {shown} of {count}", { shown: shown.length, count: total })
2356123561
+ ),
2356223562
+ (0, import_react41.createElement)("button", {
2356323563
+ type: "button",

‎patches/ds-bot/files/test/feedback-errors-more.test.js‎

Lines changed: 29 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,41 @@ test('#2266: eight or fewer errors draw no control and keep the title as it was'
207207

208208
// #2884: `Show more` was an unlabelled way out — a reader with more than eight errors
209209
// could not tell whether the list was cut or complete from the page itself, and wrote
210-
// bug reports from the eight rows it showed. The control row now carries the count of
211-
// what is drawn against what is loaded: `Showing 8 of 50` while folded, `Showing all 50`
212-
// once open. A report of eight or fewer rows draws neither, exactly as before.
210+
// bug reports from the eight rows it showed. The control row carries the count of what
211+
// is drawn against the whole log: `Showing 8 of 60` while folded, `Showing 50 of 60` once
212+
// open (#2932). A report of eight or fewer rows draws neither, exactly as before.
213213
test('#2884: a list cut at eight rows says how many rows of how many it draws', async () => {
214214
const page = await mount({ entries: errorEntries(50), total: 60 })
215-
assert.equal(page.countText(), 'Showing 8 of 50', 'the folded list says it is drawing eight of the fifty rows it holds')
215+
assert.equal(page.countText(), 'Showing 8 of 60', 'the folded list says it is drawing eight of the sixty errors in the log')
216216
assert.equal(page.text(page.more).trim(), 'Show more')
217217
await page.click()
218-
assert.equal(page.countText(), 'Showing all 50', 'open, the panel says every loaded row is drawn')
218+
assert.equal(page.countText(), 'Showing 50 of 60', 'open, the panel says every loaded row is drawn of the sixty the log holds')
219219
assert.equal(page.rows.length, 50)
220220
await page.click()
221-
assert.equal(page.countText(), 'Showing 8 of 50', 'folded again, the count returns to eight')
221+
assert.equal(page.countText(), 'Showing 8 of 60', 'folded again, the count returns to eight')
222+
})
223+
224+
// #2932: `#2884` counted the rows on screen as the denominator, so the same panel said
225+
// `Recent errors · 60` in its title and `Showing all 50` underneath: ten errors had no
226+
// way out and the page claimed to hold everything. The count line divides by the log the
227+
// title counts, so a long log reads as a part of it even when every loaded row is drawn.
228+
test('#2932: the count line divides by the log, not by the rows the host sent', async () => {
229+
const page = await mount({ entries: errorEntries(50), total: 200 })
230+
assert.equal(page.title(), 'Recent errors · 200', 'the title reports the whole log')
231+
await page.click()
232+
assert.equal(page.countText(), 'Showing 50 of 200', 'open, the fifty drawn are a part of two hundred, not "all"')
233+
assert.equal(page.rows.length, 50)
234+
await page.click()
235+
assert.equal(page.countText(), 'Showing 8 of 200', 'folded, the denominator is the log')
236+
})
237+
238+
// #2932: a log that fits in the payload has nothing beyond the rows drawn, so opening it
239+
// still says every row is drawn — the words it had before, unchanged.
240+
test('#2932: a log that fits in the payload still says all of its rows are drawn', async () => {
241+
const page = await mount({ entries: errorEntries(50), total: 50 })
242+
assert.equal(page.countText(), 'Showing 8 of 50', 'folded, eight of the fifty errors in the log')
243+
await page.click()
244+
assert.equal(page.countText(), 'Showing all 50', 'open, all fifty rows in the log are drawn')
222245
})
223246

224247
test('#2884: eight or fewer rows draw no count line', async () => {

0 commit comments

Comments
 (0)