Skip to content

feat(app-shell): extract the approval decision-progress indicator (objectui#12033) - #12039

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-12033-approval-progress
Oct 9, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-12033-approval-progress

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #12033
Clause-②: no

A3 of the objectui#2763 split, dispatched by the domain:ui seat 3 (claim comment 6076025575). Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8.

What changes

  • New module-internal widget packages/app-shell/src/views/approval-progress/DecisionProgressIndicator.tsx. It takes a pending request's decision_progress (plus, optionally, the eligible-approver count) and draws the tally for each behavior the approval-service contract declares: unanimous, quorum (M-of-N) and per_group (countersign).
  • RecordApprovalsPanel.tsx renders the widget in place of its inline block. The markup moved unchanged.
  • No export from @object-ui/app-shell's entry, no SDUI component type, no new prop on any exported component, no new locale row. useRecordApprovals.ts is read only (its ApprovalDecisionProgress type). The built declarations confirm it: after pnpm --filter @object-ui/app-shell build, only the widget's own .d.ts names it; dist/index.d.ts, dist/views/index.d.ts and the panel's .d.ts do not.
  • .changeset/12033-approval-decision-progress.md: patch on @object-ui/app-shell.

Premise, measured on main 8f815f4

  • The card's "ordered step list" is not the decision_progress rendering. That list is the panel's flow_steps stepper (labelled by approvalsInbox.stepProgress, pinned by RecordApprovalsPanel.stepProgressVertical.test.tsx). decision_progress is drawn by a separate block below it: a segmented bar plus one badge per group. The widget is bound to decision_progress, as the parent's A3 text and the ruling say, so it extracts that block. The flow_steps stepper stays in the panel; the stepProgressVertical suite is unchanged and green.
  • The panel already drew all three shapes. unanimous and quorum share the approvalsInbox.progressApprovals row and draw need ticks, with the eligible-approver count beside them. per_group uses approvalsInbox.progressGroups, never shows the eligible count, and adds one badge per groups entry (a check when satisfied, a hollow circle otherwise). A tally above 12 decisions is one continuous fill. No shape is new, so nothing visible changes. What was missing were pins: the panel's suites pinned only per_group.
  • The contract's shapes (objectstack packages/spec/src/contracts/approval-service.ts, the decision_progress member): behavior is unanimous, quorum or per_group, with got, need and an optional groups list of group / got / need / satisfied; absent on first_response. ApprovalDecisionProgress in useRecordApprovals.ts mirrors it field for field, and the widget reads only those fields.

The re-point is DOM-identical (one-time proof, not committed)

A temporary test rendered the merge-base panel (copied verbatim from 8f815f4) and the re-pointed panel over eight fixtures: unanimous, quorum with and without eligible approvers, per_group with a three-step flow_steps, a 20-decision tally, need 0, got above need, and first_response (no tally). Each fixture was rendered with no i18next instance and with an en instance: 16 comparisons. Each required container.innerHTML to be byte-equal, and required the progressbar to be present in every fixture except first_response, so an empty render could not pass. Result: 16 of 16 equal (per_group, for example, is 5305 bytes on both sides). Both temporary files were deleted before anything else read the tree.

i18n

No new rows and no duplicates. The widget asks for the same four approvalsInbox.* rows the panel asked for (progressApprovals, progressGroups, progressEligible, progressBar), with the same default text and arguments. One difference: it names them by literal key, not through the panel's tr(key: string) forwarder. So check:i18n-keys now checks these call sites (the key exists, the default text matches en, the arguments match the holes). Positive control: changing the widget's progressApprovals default text made that gate exit 1 with [default-value-drift] approvalsInbox.progressApprovals at the widget. The restore was proven by blob hash.

Pins

DecisionProgressIndicator.test.tsx has one pin per shape plus the two edge branches. The pins check structure: tick count, filled ticks, the progressbar's value range, the group badges and the icon on each badge. They also check which pack row each label comes from. The expected label is produced by the same i18next instance, asked for the key, so no English prose is pinned.

  • unanimous: one tick per approver, filled up to got, eligible count shown.
  • quorum (M-of-N): need ticks (the M), not the eligible N; eligible count shown. With no eligible count, the tally shows alone.
  • per_group: a tick per group with the satisfied ones filled, one badge per group, no eligible count.
  • More than 12 decisions: one continuous fill (25% for 5 of 20).
  • got above need: the progressbar value is capped at need.

Reverse verification (ablation-replace on the committed tree, each restore proven by blob hash)

  • M-of-N count broken. The bar draws max(need, eligible) ticks, so it counts N instead of M. Result: red, 2 failed / 4 passed. The quorum pin got 5 ticks where it expects 2, and the per_group pin got 3 where it expects 2. The unanimous pin stayed green because its eligible count is below need.
  • Per-group branch dropped ({false && dp.groups && (). Result: red, 2 failed / 14 passed across the widget suite and RecordApprovalsPanel.test.tsx. The widget's per_group pin and the panel's own per_group test both went red.
  • After each restore, the widget's blob equals HEAD's (0ec44e53a26c) and git diff HEAD is empty.

Gates, all on 0e0fd992b

command exit the gate's own verdict
pnpm exec vitest run over approval-progress/, every RecordApprovalsPanel* suite, both RecordDetailView.approval* suites, and the temporary proof 0 Test Files 9 passed (9), Tests 74 passed (74)
pnpm --filter @object-ui/app-shell type-check (after turbo run build --filter=@object-ui/app-shell^..., 28 of 28) 0 both tsc --noEmit and tsc -p tsconfig.test.json clean
pnpm --filter @object-ui/app-shell build 0 dist completeness: 1 package(s) complete (1040 emitted files verified)
pnpm exec eslint on the three touched source files 0 0 errors, 6 warnings, all six in the panel's untouched code; the merge-base panel has the same six
pnpm check:i18n-keys 0 every in-scope call-site key resolves, every inline default matches
pnpm check:control-bytes · check:test-path-roots · check:changeset-claims · check:pending-changeset-literals · check:unreferenced-sources · check:i18n-dead-keys · check:vi-mock-specifiers · check:vi-mock-inherit · check:vi-mock-override-shape 0 each OK
pnpm check:new-line-citations 0 0 new citation(s)
node scripts/check-changeset-presence.mjs · -no-major · -fixed · -overwrite 0 each one changeset declared, no major, none overwritten
CI=true pnpm exec vite build in apps/console, then node scripts/check-eager-closure-budget.mjs 0 aggregate closure 3162.6 KB measured / 3204.6 KB ceiling (headroom 42.0 KB = 0.47x the 89.0 KB regression)
pnpm exec vitest run packages/app-shell/ (the full package suite) running still running under the verify lock when this PR was opened; its verdict is in the os-dev-report comment on the card

First-load bytes: +74 B gzip over the eager closure (3,238,404 to 3,238,478, 289 eager chunks on both builds). The control build was this tree with the panel checked out at 8f815f4, which leaves the widget unreferenced. The panel's chunk record-approvals-renderer grew 61 B gzip. The other changed chunks moved by 1 to 6 bytes because their import specifiers carry the renamed chunk's hash.

Declared narrowing: the targeted vitest run, the DOM proof and the two ablations ran outside the verify lock, with one worker. That was after about 30 minutes queued behind another seat's full app-shell suite. The type-check, build, both console builds and the full suite ran under the lock.

Acceptance notes

  • Two more renderings of the same tally sit outside this claim's surface and are not touched. One is the console Approval Center drawer in ApprovalsInboxPage.tsx, a near line-for-line twin that objectui#2763 B3 deletes. The other is the DetailView approval band in plugin-detail, a different, compact rendering in a package that app-shell depends on, so it cannot import this widget.
  • eligibleApprovers is the caller's pending-approver count (pending_approvers.length), as the panel always showed it. It is not a decision_progress field: the contract carries no N for a quorum, and the widget adds none.
  • Observation only: a comment in RecordApprovalsPanel.test.tsx says the counts are not interpolated without an i18next instance. That stopped being true when the provider-less fallback began interpolating (objectui#6219). The comment is unchanged here.

Generated by Claude Code

claude added 2 commits October 9, 2026 07:03
…jectui#12033)

One module-internal widget, `views/approval-progress/DecisionProgressIndicator`,
draws an approval request's `decision_progress` tally: unanimous, quorum
(M-of-N) and per-group countersign, as the approval-service contract declares
it. `RecordApprovalsPanel` renders it in place of its inline block with the
same markup, so the panel's DOM does not change. The copy keys are the same
`approvalsInbox.*` rows, now asked for by literal key.

No export from the package entry and no SDUI component type; registration is
objectui#2763 B1's step.

Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>
… (objectui#12033)

Claude-Session: https://claude.ai/code/session_01CGZy1BGCjdN5cXqL9cnvB8
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 289 chunks) 3162.6 KB 3204.6 KB
Main entry chunk (gzip) 71.6 KB 350 KB
Entry file index-DtStHnNb.js —
Status PASS —

The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it.


📦 Bundle Size Report

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 19.52KB 7.19KB
app-shell (runtime-config.js) 22.59KB 7.89KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.11KB 3.87KB
auth (ActiveOrganizationStorage.js) 27.95KB 10.04KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.22KB 10.61KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.40KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.72KB 2.24KB
auth (SocialSignInButtons.js) 9.70KB 3.93KB
auth (UserMenu.js) 3.39KB 1.21KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 41.19KB 11.12KB
auth (createAuthenticatedFetch.js) 8.54KB 3.46KB
auth (index.js) 3.63KB 1.64KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 11.08KB 4.58KB
collaboration (CommentThread.js) 27.11KB 7.97KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.28KB 2.60KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.50KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 587.83KB 141.44KB
core (index.js) 10.00KB 3.96KB
create-plugin (index.js) 27.94KB 9.51KB
data-objectstack (index.js) 240.39KB 67.09KB
fields (index.js) 268.74KB 68.04KB
i18n (LocalizationContext.js) 2.92KB 1.42KB
i18n (builtinAggregateLabels.js) 0.86KB 0.49KB
i18n (currency.js) 2.59KB 1.22KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 8.87KB 3.64KB
i18n (index.js) 5.52KB 2.39KB
i18n (pickLocalized.js) 9.86KB 3.95KB
i18n (provider.js) 39.35KB 12.88KB
i18n (translateFn.js) 0.20KB 0.18KB
i18n (useDisplayLocale.js) 3.52KB 1.76KB
i18n (useObjectLabel.js) 36.87KB 9.88KB
i18n (useSafeTranslation.js) 7.14KB 2.92KB
layout (index.js) 41.50KB 11.82KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.99KB 0.87KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 6.62KB 2.45KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useSpecGesture.js) 5.52KB 2.10KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 13.86KB 5.00KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 6.52KB 2.26KB
permissions (discardProofCache.js) 1.04KB 0.55KB
permissions (evaluator.js) 8.33KB 3.07KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 4.83KB 2.27KB
plugin-ai (index.js) 16.04KB 3.92KB
plugin-calendar (index.js) 53.43KB 15.54KB
plugin-charts (index.js) 84.71KB 23.25KB
plugin-chatbot (index.js) 201.52KB 47.99KB
plugin-dashboard (index.js) 144.20KB 38.95KB
plugin-designer (index.js) 233.53KB 49.80KB
plugin-detail (index.js) 248.57KB 65.47KB
plugin-editor (index.js) 2.23KB 1.05KB
plugin-form (index.js) 177.11KB 45.88KB
plugin-gantt (index.js) 179.17KB 45.07KB
plugin-grid (index.js) 249.62KB 69.16KB
plugin-kanban (index.js) 52.77KB 16.56KB
plugin-list (index.js) 120.25KB 30.26KB
plugin-map (index.js) 27.24KB 9.03KB
plugin-markdown (index.js) 13.88KB 4.80KB
plugin-report (index.js) 44.12KB 12.29KB
plugin-timeline (index.js) 39.10KB 11.81KB
plugin-tree (index.js) 15.07KB 5.33KB
plugin-view (index.js) 91.20KB 23.04KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.81KB 3.58KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 120.63KB 39.56KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 4.50KB 2.06KB
react (schema-input.js) 4.31KB 2.07KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (body-dialect.js) 4.50KB 1.99KB
sdui-parser (codegen.js) 9.45KB 3.76KB
sdui-parser (dashboard-widget-options.js) 3.07KB 1.30KB
sdui-parser (index.js) 7.30KB 3.12KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 25.28KB 7.80KB
sdui-parser (provenance.js) 3.84KB 1.90KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 23.87KB 7.83KB
types (ai.js) 4.39KB 2.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 4.12KB 1.61KB
types (authoring-nodes.js) 0.20KB 0.19KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (cloud.js) 0.20KB 0.18KB
types (complex.js) 4.44KB 2.07KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (dashboard-widget-layout.js) 2.06KB 0.96KB
types (data-display.js) 3.75KB 1.85KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.85KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (expression.js) 0.20KB 0.18KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 1.13KB 0.65KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 5.78KB 2.70KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 5.00KB 2.39KB
types (navigation.js) 0.20KB 0.18KB
types (node-slots.js) 7.18KB 2.34KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 2.52KB 1.31KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (select-option.js) 0.20KB 0.19KB
types (spec-report.js) 4.99KB 1.96KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (strict-authoring-face.js) 19.93KB 7.25KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 8.11KB 3.32KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review October 9, 2026 08:30
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge October 9, 2026 08:30
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Oct 9, 2026
Merged via the queue into main with commit ba9e820 Oct 9, 2026
45 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-12033-approval-progress branch October 9, 2026 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

approvals A3 (child of objectui#2763): a reusable progress/quorum widget for decision_progress (unanimous, M-of-N, per-group countersign)

2 participants