Skip to content

Fix global objectLimit handling after filters#216

Open
radiantjade wants to merge 1 commit into
tscircuit:mainfrom
radiantjade:fix-global-object-limit-after-filters
Open

Fix global objectLimit handling after filters#216
radiantjade wants to merge 1 commit into
tscircuit:mainfrom
radiantjade:fix-global-object-limit-after-filters

Conversation

@radiantjade
Copy link
Copy Markdown

Fixes #42

This keeps the existing objectLimit prop, but applies it as a single render budget after layer, step, and viewport filtering. The red warning now compares against the pre-limit filtered object count, so it appears only when the limit is actually truncating visible objects.

I split the limit logic into a small helper and added focused regression coverage for global ordering, zero limits, no-limit behavior, and normalization.

Verification:

  • bun run format
  • bun test
  • bun run build

/claim #42

The objectLimit prop was already present, but it limited each object bucket separately and calculated the warning from the already-limited count. This makes the cap apply once across the rendered object groups after layer, step, and viewport filtering while preserving the pre-limit count for the red warning.

Constraint: Issue tscircuit#42 requires layer/step filters to run before counting objects toward the display limit.
Rejected: Keep per-type slicing | it can still render more than objectLimit total objects.
Confidence: high
Scope-risk: narrow
Tested: bun run format
Tested: bun test
Tested: bun run build
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 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 15, 2026 4:31am

Request Review

@radiantjade
Copy link
Copy Markdown
Author

Demo video for the claim requirement: https://github.com/radiantjade/graphics-debug/releases/download/graphics-debug-216-demo-20260515/graphics-debug-216-demo.mp4

It summarizes the global objectLimit behavior, preview URL, and passing verification for this PR.

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.

Add option objectLimit that limits the number of objects displayed (after filters) on InteractiveGraphics

1 participant