Repository navigation
Commit d07ece7
feat(plugin-list, plugin-audit): the audit log loads as it scrolls and stops counting the ledger (#39365)
<!-- claude-projects-attribution: {"github_login":"os-bill"} -->
_Requested by **Bill** · [project
thread](https://claude.ai/code/project/chan_016iMXWSZDzqWRWvWzdNo8wg?thread=cmsg_016iMXWSZDzqWRWvWzdNo8wgJxHiXh4o1DDshASi6deAwZ)_
Fixes #39270
Ruling-ref: 7381289655 (ruling C; analysis 7378111006) · Claim:
7381451680 · Thread session: `session_01Utp6CZT8FUBCNmB1htsrbB`
## What changes
- **List view rule, every object**
(`ui/packages/plugin-list/src/ListView.tsx`): an ungrouped grid that
loads as it scrolls (no declared `pagination`) and whose view declares
`showRecordCount: false` sends the declined total (`$count: false`, wire
`count=false`). It pages on `hasMoreRows` = "the last window came back
full", which already existed for a missing total (objectstack#35554). On
that path `onTotalChange` is not called (its `(total: number) => void`
signature is unchanged); the list calls the new optional host prop
`onTotalDeclined()` once per settled load instead, so a host drops a
count an earlier view gave it and never reads the loaded rows as one (L2
7387302017 M3). Controls kept per the ruling's execution parameters: a
view that hides its count but keeps a numbered pager still asks for the
total; a grouped grid, the compact posture (its header prints the total)
and the capped posture (excluded from scroll-loading) still ask.
- **No surface prints the loaded rows as a count** (L2 7385481231 M1,
M2):
- Grid footer (`ui/packages/plugin-grid/src/ObjectGrid.tsx`,
`objectGridSummaries.ts`): when the host loads window by window, says
there is more, and hands no count larger than the rows loaded, the
summary row prints no 「Count N」 lead, asks no whole-set aggregate (that
query scans the set the list declined to count; per the zone's steer),
and labels each declared figure as over the rows on screen (`Sum (this
page)`, the existing page label). Once the last window is in, the loaded
rows are the set and the footer reads as before.
- Record stepper
(`ui/packages/app-shell/src/views/objectViewRecordNavigation.ts`,
`recordDrawerStack.tsx`, `ObjectDataPage.tsx`, wired through
`ObjectView.tsx` and `objectViewListRenderer.tsx`): `onTotalDeclined`
sets the list's total to `null`, which marks the drawer's root level and
the record page's `from` state `totalUnknown`; both then draw ↑ ↓
through the loaded rows with no 「N / M」 counter. A stale total from a
counted view is cleared. `ListViewBlock` is unchanged: it spreads host
props, so a host's `onTotalDeclined` reaches the list, and the page
tab's badge gets no number. The dashboard drill (`DrillRecordList.tsx`)
drops its total on `onTotalDeclined`.
- `ui/packages/plugin-list/README.md` (shipped): the `onTotalChange`
section now teaches the declined case and `onTotalDeclined` (L2 S2).
- **Ledger views**
(`packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts`):
all six `sys_audit_log` list views declare `showRecordCount: false` and
drop `pagination`. `all_events` now loads in windows of the default page
size instead of 100.
- **Standalone audit page**
(`ui/apps/console/src/pages/system/AuditLogPage.tsx`): it already paged
on the row past its window and never read `total`; it now sends
`count=false`.
- **Spec description** (`packages/spec/src/ui/view.zod.ts`):
`showRecordCount` says what `false` now does, and names the lists that
still ask for the total (numbered pager, grouped grid, a page region's
compact or capped form; L2 S1); reference docs regenerated (`gen:docs`).
The view metadata form's hint (`view.metadata-form.ts`) is the same
text, as its pin requires, with the `en` metadata-forms bundle
regenerated (`check-i18n-bundles --write`).
- **Component reference**: the plugin-list registry's `showRecordCount`
input description (`ui/packages/plugin-list/src/index.tsx`) says the
same; `sdui.manifest.json`, its record and
`content/docs/ui/components/plugins.mdx` are regenerated from it.
- No wire key, view key, ledger field, index or migration is added.
## Why
Opening Setup → Audit log ran a `count(*)` over the whole filtered
ledger beside every 50-row window: 3.5 s on the maintainer's 202k-row
deployment, 1.7 s cold on 200k rows in the dev's measurement (report
7377789707), with every other request stalled on SQLite. The window
itself is 2–4 ms. The ruling chose to stop asking for the total rather
than make the count cheaper.
## Premise check (ruling premises 4 and 8), at main 850d240
- Scroll-loading without a total: `hasMoreRows` falls back to
`dataLimitReached` when `serverTotal` is null; the adapter routes
`$count: false` to the raw GET with `count=false`; the server door omits
`total` and skips the count (`protocol-data-crud.ts`, pinned by
`protocol.count-opt-out.test.ts`).
- Cross-page select-all: the selection bar offers "all N matching" only
when `totalMatching > pageSize`; on the scroll-loading arm with no total
both are the rows in hand, so the offer is not drawn (no false "all N").
The ledger views declare no selection.
- Compact embedding: the compact posture draws one window and prints the
total in its header, so it keeps asking (declining there would print a
window size or show a silent window).
## Verification
- New
`ui/packages/plugin-list/src/__tests__/ListView.declinedTotal-39270.test.tsx`
(6 cases): every window asks `$count: false` and no count runs; rows
past the first window are reached (50 → 100 → 120, then `hasMoreRows`
false); no count bar, no figure beside the view name, `onTotalDeclined`
called and `onTotalChange` never; the counted control never calls
`onTotalDeclined`; controls (numbered pager, shown count, compact) still
ask.
-
`ui/packages/plugin-grid/src/__tests__/footerSummaryScope-12081.test.tsx`
(+2 cases): two windows loaded with more to come print no count lead,
label the sum `(this page)` and ask no aggregate; control: all rows in,
the lead counts them and the sum is plain. Ablated (`hostCountIsWindow`
off), the first fails.
- `objectViewRecordNavigation.listRows-27524.test.tsx` (+1 case): a
counted list that then declines drops its total, and the origin carries
`totalUnknown`.
- New
`ui/packages/app-shell/src/views/__tests__/recordStepper.totalUnknown-39270.test.tsx`
(7 cases): `listOriginOf` marks `totalUnknown` (ungrouped only); the
record page and the drawer root step with no counter; counted controls
keep 「2 / 50」 and 「2 of 3」. Ablated, 2 fail.
- New
`ui/apps/console/src/pages/system/AuditLogPage.declinedTotal-39270.test.tsx`:
every ledger read sends `count=false`, and Next reaches the 51st row.
- New
`packages/plugins/plugin-audit/src/objects/sys-audit-log-views-uncounted.test.ts`:
every declared view is a grid with `showRecordCount: false` and no
`pagination`.
- Ablation: with the `totalDeclined` rule and the page's `count=false`
reverted, 4 of the new UI cases fail; restored, all pass.
- `vitest run packages/plugin-list/ apps/console/src/pages/system/`: 244
files, 2436 tests passed. plugin-audit: the new pin +
`sys-audit-log-default-view.integration.test.ts` pass.
`@objectstack/spec check:generated` after `gen:docs`: the one stale
artifact regenerated.
- Real-stack check (browser, showcase boot): screenshots in a comment
below.
Clause-②: yes (widening) — one new optional host prop,
`onTotalDeclined?: () => void`, on `@object-ui/plugin-list`'s `ListView`
(`ListViewProps`); `onTotalChange` keeps its `(total: number) => void`
signature; nothing removed or narrowed
Metadata-protocol: semantic
Skills-docs: none — no `skills/**` or `ui/skills/**` text names
`showRecordCount` (grep at 850d240); the component reference row is
regenerated here.
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request.
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: its generated artifacts are
regenerated and committed.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01Utp6CZT8FUBCNmB1htsrbB
<!-- signed: repo:objectstack@os-bill · os-bill ·
session_01Utp6CZT8FUBCNmB1htsrbB -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent f00ab66 commit d07ece7
29 files changed
Lines changed: 674 additions & 46 deletions
File tree
- .changeset
- content/docs
- references
- data
- ui
- ui/components
- packages
- platform-objects/src/apps/translations
- plugins/plugin-audit/src/objects
- spec
- docs/references/api
- src/ui
- scripts
- ui
- apps/console/src/pages/system
- packages
- app-shell/src/views
- __tests__
- plugin-dashboard/src
- plugin-grid/src
- __tests__
- plugin-list
- src
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
462 | 462 | | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
| 465 | + | |
466 | 466 | | |
467 | 467 | | |
468 | 468 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1058 | 1058 | | |
1059 | 1059 | | |
1060 | 1060 | | |
1061 | | - | |
| 1061 | + | |
1062 | 1062 | | |
1063 | 1063 | | |
1064 | 1064 | | |
| |||
1536 | 1536 | | |
1537 | 1537 | | |
1538 | 1538 | | |
1539 | | - | |
| 1539 | + | |
1540 | 1540 | | |
1541 | 1541 | | |
1542 | 1542 | | |
| |||
2144 | 2144 | | |
2145 | 2145 | | |
2146 | 2146 | | |
2147 | | - | |
| 2147 | + | |
2148 | 2148 | | |
2149 | 2149 | | |
2150 | 2150 | | |
| |||
2196 | 2196 | | |
2197 | 2197 | | |
2198 | 2198 | | |
2199 | | - | |
| 2199 | + | |
2200 | 2200 | | |
2201 | 2201 | | |
2202 | 2202 | | |
| |||
2466 | 2466 | | |
2467 | 2467 | | |
2468 | 2468 | | |
2469 | | - | |
| 2469 | + | |
2470 | 2470 | | |
2471 | 2471 | | |
2472 | 2472 | | |
| |||
2584 | 2584 | | |
2585 | 2585 | | |
2586 | 2586 | | |
2587 | | - | |
| 2587 | + | |
2588 | 2588 | | |
2589 | 2589 | | |
2590 | 2590 | | |
| |||
0 commit comments