Skip to content

Apply objectLimit globally after filtering#221

Open
zergzorg wants to merge 3 commits into
tscircuit:mainfrom
zergzorg:codex/global-object-limit-42
Open

Apply objectLimit globally after filtering#221
zergzorg wants to merge 3 commits into
tscircuit:mainfrom
zergzorg:codex/global-object-limit-42

Conversation

@zergzorg
Copy link
Copy Markdown

@zergzorg zergzorg commented May 20, 2026

/claim #42

Summary

  • filters each InteractiveGraphics object bucket first, then applies one shared objectLimit across all rendered object groups
  • keeps the warning count based on the pre-limit filtered object total
  • adds a focused unit-tested helper for the global limiter

Verification

  • bun test tests/apply-object-limit.test.ts
  • bun test tests/mergeGraphics.test.ts
  • bun test
  • bunx biome check site/utils/applyObjectLimit.ts site/components/InteractiveGraphics/InteractiveGraphics.tsx tests/apply-object-limit.test.ts
  • bunx tsc --noEmit
  • bun run build
  • bun run vercel-build
  • git diff --check

Notes

The patch keeps existing per-bucket filtering and sorting behavior, but moves limiting to a single post-filter cap so objectLimit={3} cannot render more than three total graphics objects across buckets.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 20, 2026

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

Project Deployment Actions Updated (UTC)
graphics-debug Ready Ready Preview, Comment May 21, 2026 7:32am

Request Review

Signed-off-by: zergzorg <kaluga@me.com>
@zergzorg
Copy link
Copy Markdown
Author

Follow-up after comparing current #42 attempts:

  • Expanded applyObjectLimit regression coverage from 3 to 6 focused cases.
  • New cases cover carrying unused budget to earlier groups, preserving all group keys after the shared budget is consumed, and treating negative limits as zero.
  • No production behavior changed; this strengthens the proof around the existing global-limit helper.

Validation:

  • bun test tests/apply-object-limit.test.ts — passed, 6 tests.
  • bun test — passed, 68 tests.
  • bunx biome check site/utils/applyObjectLimit.ts site/components/InteractiveGraphics/InteractiveGraphics.tsx tests/apply-object-limit.test.ts — passed.
  • bunx tsc --noEmit — passed.
  • bun run build — passed.
  • bun run vercel-build — passed.
  • git diff --check — passed.

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.

1 participant