Skip to content

fix(platform-objects): stop the System Overview date bar from windowing the Organizations and Packages Installed tiles - #7703

Merged
os-zhuang merged 1 commit into
mainfrom
claude/issue-7613-system-overview-remaining-tiles
Aug 11, 2026
Merged

fix(platform-objects): stop the System Overview date bar from windowing the Organizations and Packages Installed tiles#7703
os-zhuang merged 1 commit into
mainfrom
claude/issue-7613-system-overview-remaining-tiles

Conversation

@claude

@claude claude Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #7613

Finishes Row 1 of the shipped System Overview board. #7531 (PR #7614, 8c20f755b) fixed "Total Users" and "Active Sessions"; this is the identical defect on the two tiles of the same inventory row that were deliberately left out of that card's scope.

Premise, re-verified before implementing

Checked against origin/main at 19bca8c, not taken from the dispatch:

claim state on origin/main
widget_organizations lacks filterBindings holds — the only two opt-outs in the file are widget_total_users (line 54) and widget_active_sessions (line 96)
widget_packages_installed lacks filterBindings holds — same measurement
the globalFilters block is unchanged holds — field: 'created_at', scope: 'dashboard', defaultValue: 'last_7_days'
widget_packages_installed carries filter: { status: 'installed' } holds — line 109

Both tiles are still defective, so this is not a no-op.

The defect

The board declares one dashboard-level filter, created_at defaulting to last_7_days, and a dashboard-level filter is broadcast into every widget's analytics query (#2501). A created_at column exists on sys_organization and sys_package_installation alike, so the broadcast landed on both:

  • "Organizations" counted organizations created in the last 7 days, under a description reading "Total organizations on the platform".
  • "Packages Installed" counted installations created in the last 7 days with status: 'installed', under one reading "Active package installations across projects".

Both are stocks, not flows. An organization founded last year has not stopped existing because the date bar says last_7_days, and a package installed a year ago is still installed. On a fresh datastore every row is recent, so the windowed count and the true total coincide — which is why both read as correct in a demo and under-report on any instance older than the window.

Fix, one line per tile:

filterBindings: { created_at: false },

On "Packages Installed" that opt-out is orthogonal to the widget's existing filter: { status: 'installed' } and both stand: the predicate decides which installations count, the opt-out decides how many. The source now says so at the site, so the next author does not read one as replacing the other.

The date bar still does its job

All six sys_audit_log widgets (rows 2-4) still inherit it — the pin asserts that explicitly, and it is what the filter was added for. No labels or descriptions changed, so no translation key moves.

The pin: two fixture sets, two blocks

Extends system-overview-tile-semantics.test.ts in the shape that file already establishes — property, not snapshot. 7 new cases, 8 to 15.

Fixtures straddle the 7-day boundary deliberately: an all-recent fixture makes every assertion in the file pass for free, which is the exact trap that let this ship. ORGANIZATIONS is 400 / 200 / 2 days old; PACKAGE_INSTALLATIONS adds two non-installed rows, one of them inside the window on purpose.

claim how it could pass vacuously the opposite direction that closes it
organizations invariant across windows the harness never applies a window an audit tile must move across the same two windows
organizations invariant across windows no fixture row sits outside the window the same tile without its opt-out reports 1 of 3
packages equals the installed-only count the window happened not to bite the same tile without its opt-out reports 1 of 3
the status predicate still applies the date bar had already removed those rows a non-installed row inside the window must still be dropped, and the claim is checked with the bar set and cleared

The installed-only count the tile is compared against is derived from the fixture directly, never from the widget's own filter — deriving it from the filter would make the comparison a tautology.

Every "still bound" control is an audit widget, deliberately. An audit tile is correctly windowed, so it is bound by intent and is a legitimate control. widget_organizations was "still bound" too before this PR and would have worked perfectly well as one — which is exactly the problem: pinning it that way would have written this bug into the suite as expected behaviour. The file header now carries that reasoning as a standing note for whoever extends it next. The two new controls are widget_recent_events and widget_login_events, distinct from the widget_events_by_type the #7531 block already uses.

Reverse verification

Direction predicted before running: red. Reverting the board file to origin/main with the tests in place turns exactly 3 of the 7 new cases red, naming the defect rather than a shape:

x widget_organizations > reports the same organizations under any date-range window, and with none
  -> window=7: expected [ 'o_this_week' ] to deeply equal [ 'o_founding', 'o_last_quarter', ...(1) ]
x widget_packages_installed > matches an independently-computed installed-only count, under any window
  -> window=7: expected [ 'p_this_week' ] to deeply equal [ 'p_legacy', 'p_last_quarter', ...(1) ]
x widget_packages_installed > the widget-level `status` filter still stands after the opt-out
  -> window=7: expected [ 'p_this_week' ] to include 'p_legacy'

The other 4 stay green, which is their expected direction: the two ignoreOptOut legs and the two audit controls describe the pre-fix board on purpose. The 8 cases from #7531 also stay green, correctly — that revert restores origin/main, which already carries their opt-outs.

Third case worth flagging: it goes red on its toContain('p_legacy') leg rather than on a status leg. That is the honest reading — the block pins that both the predicate and the opt-out stand, so removing either breaks it. Its not.toContain legs stay green under the revert, because the status predicate is untouched by this PR.

Verification

command result
pnpm --filter @objectstack/platform-objects test 13 files, 311 passed (304 before, 7 new)
pnpm --filter @objectstack/platform-objects typecheck clean
pnpm --filter '@objectstack/platform-objects^...' build built first, per the stale-dist rule
pnpm exec eslint packages/platform-objects/src/apps/dashboards 0 problems
node scripts/check-nul-bytes.mjs OK, 7100 files
pnpm check:i18n OK, 9 packages in sync (platform-objects: 8 bundles)
pnpm check:empty-changeset exit 0
validateWidgetBindings over the real board 0 findings on either touched tile

check:i18n first refused with PREREQUISITE NOT MET - the workspace CLI is not built and named its own fix; the workspace CLI was built and the gate then ran for real. The EXIT=$? reading is the one quoted above, not a piped one.

The validateWidgetBindings run reports 2 pre-existing chart-config-missing advisories on widget_events_by_type and widget_events_by_user — the same two PR #7614 already recorded as live on main. Neither widget is touched here and neither advisory is introduced by this diff.

Scope

setup-nav.contributions.ts was not touched, per the #7544 serialization constraint. No packages/spec change was needed: this is board-metadata authoring, and filterBindings is an existing authorable key the contract already declares.

Out-of-scope findings

None new. #7568 remains open as the same class on a different surface (the showcase ops dashboard) and is untouched.


Generated by Claude Code

…ng the Organizations and Packages Installed tiles

Finishes Row 1 of the System Overview board. #7531 fixed "Total Users" and
"Active Sessions"; the identical defect was still live on the other two tiles
of the same inventory row.

The board declares a `created_at` global filter defaulting to `last_7_days`,
and a dashboard-level filter is broadcast into every widget's analytics query
(#2501). A `created_at` column exists on `sys_organization` and
`sys_package_installation` alike, so the broadcast landed on both: the
"Organizations" tile counted organizations created in the last 7 days under a
description reading "Total organizations on the platform", and "Packages
Installed" counted installations created in the last 7 days under one reading
"Active package installations across projects".

Both tiles now opt out with `filterBindings: { created_at: false }`. On
"Packages Installed" that opt-out is orthogonal to the existing
`filter: { status: 'installed' }` and both stand.

The tile-semantics pin gains two fixture sets and two blocks, in the shape the
file already establishes: invariance across windows, fixtures that straddle the
7-day boundary, and each claim's opposite direction in the same block. Every
"still bound" control stays an audit widget, deliberately -- a Row 1 tile that
is still bound is bound by this defect, not by intent.

Fixes #7613

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GvsNM43jua7yR67dF3Mp4j
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Aug 11, 2026 11:32am

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/platform-objects.

2 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:

  • content/docs/plugins/packages.mdx (via @objectstack/platform-objects)
  • content/docs/ui/setup-app.mdx (via @objectstack/platform-objects)

Advisory only. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs origin/main → pass the list as args.docs.

@github-actions github-actions Bot added documentation Improvements or additions to documentation tests tooling labels Aug 11, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review August 11, 2026 12:04
@os-zhuang
os-zhuang added this pull request to the merge queue Aug 11, 2026
Merged via the queue into main with commit 3a2dde7 Aug 11, 2026
26 checks passed
@os-zhuang
os-zhuang deleted the claude/issue-7613-system-overview-remaining-tiles branch August 11, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

System Overview: the same created_at fan-out still windows the other two Row 1 inventory tiles, "Organizations" and "Packages Installed"

2 participants