Skip to content

feat(viewer): group IDS panel results by requirement - #3037

Merged
louistrue merged 3 commits into
mainfrom
ids-panel-requirement-grouping
Aug 22, 2026
Merged

feat(viewer): group IDS panel results by requirement#3037
louistrue merged 3 commits into
mainfrom
ids-panel-requirement-grouping

Conversation

@BIMvoice

Copy link
Copy Markdown
Collaborator

Groups the in-app IDS panel's results by requirement, mirroring what #2979 does for the HTML export. Disjoint files — this is IDSPanel.tsx + a new idsRequirementGrouping.ts; #2979 is confined to idsExportService.ts.

RED — surgical, regressing the grouping key from reqResult.requirement.id back to the entity id: 3 pass / 3 fail. Unmutated 6/6.

A docblock claim that was wrong in both directions

computeCheckStats said the check-level rate is "distinct from (and always <=) the specification's own entity-level passRate".

That is inverted. spec.passRate = passedCount / totalEntities (validator.ts:359-360), and passed: allPassed is false as soon as one requirement fails (validator.ts:479-496) — so an entity passes only when all its checks pass, and the check rate normally sits above. Measured: entity A passes 1 of 2 checks, entity B passes both → entity-level 50%, check-level 75%.

But "always >=" is also wrong, so that is not what it now says. Counter-example, verified by running: entity A with a single not_applicable requirement counts as a passing entity while contributing zero applicable checks; entity B fails its only check. Entity-level 50%, check-level 0%.

The two rates have different denominators, so neither direction holds unconditionally. The docblock now says "normally above", names the mechanism, and names the exception.

The inverted claim appeared in three places, not one: the docblock, the comment beside the rendered figure in IDSPanel.tsx:242, and a test title asserting <=.

Two tests added pinning both directions as arithmetic — the 50%/75% case and the not_applicable exception. Mutation-checked, both killed: collapsing a failing entity's checks into failures → 2 fail; substituting the entity-level formula for checkPassRate → 3 fail.

idsRequirementGrouping.test.ts 6 → 8, all pass. Full apps/viewer 5344 pass / 0 fail / 6 skipped. tsc --noEmit 0 errors.

🤖 Generated with Claude Code

…2933)

The in-app IDS results panel had the same defect confirmed in the
concurrent HTML export rework: requirement results were only visible
by expanding one entity at a time, so a user could not see, per
requirement, how many checks passed/failed or which elements failed
without clicking into every entity.

Add apps/viewer/src/hooks/ids/idsRequirementGrouping.ts — pure helpers
that re-slice a specification's entityResults by requirement (keyed on
requirement.id, stable across entities within a spec since the
validator reuses the same IDSRequirement object per requirement) and
compute a check-level pass rate (one check = one entity x one
requirement). not_applicable is excluded from both numerator and
denominator of every rate, matching how the validator itself treats
applicableCount/passedCount/failedCount.

IDSPanel's SpecificationCard now renders a "Requirement Breakdown"
section (facet type, description, pass/fail/n-a counts, failing
elements with type/name/GlobalId/reason, click-to-select) above the
existing per-entity list, and a check-level rate line next to the
existing entity-level PassRateBar — the two legitimately differ
whenever one entity fails more than one requirement.

This module is standalone, not shared with idsExportService.ts (owned
by a concurrent HTML/JSON export rework) — no shared grouping helper
existed between the two before this change.
`computeCheckStats`'s docblock, the IDSPanel comment beside the rendered
figure, and a test title all said the check-level rate is "always <=" the
specification's entity-level `passRate`. The relation runs the other way:
`spec.passRate` is passing ENTITIES over total entities, and an entity is
failed by its FIRST failing requirement while its remaining requirements
still count as passes here. Entity A passing 1 of 2 checks and entity B
passing both give 50% entity-level against 75% check-level.

It is not "always >=" either, so the prose now says "normally": the two
rates have different denominators, and an entity whose requirements are all
`not_applicable` counts as a passing entity while contributing no applicable
check at all.

Both directions are now arithmetic rather than prose. Mutation-checked:
collapsing a failing entity's checks into failures, and substituting the
entity-level formula outright, each turn the new tests red.
@BIMvoice
BIMvoice requested a review from louistrue as a code owner August 21, 2026 14:08
@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@louistrue, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Limit details: You’ve used all 2 included reviews currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 04730f16-47e8-4f60-9ffd-47fe690bf231

📥 Commits

Reviewing files that changed from the base of the PR and between fe38b33 and cd9573a.

📒 Files selected for processing (3)
  • apps/viewer/src/components/viewer/IDSPanel.tsx
  • apps/viewer/src/hooks/ids/idsRequirementGrouping.test.ts
  • apps/viewer/src/hooks/ids/idsRequirementGrouping.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Viewer benchmark

✅ No threshold regressions detected.

01_Snowdon_Towers_Sample_Structural(1).ifc

Baseline recorded 2026-07-01T20:31:05.538Z on github-actions ubuntu-latest, viewer-benchmark-ci (headless Chrome, SwiftShader ANGLE), production build.

Metric Current Baseline Delta Threshold Status
firstBatchWaitMs 1804ms 2905ms -37.9% +50%
firstVisibleGeometryMs 2379ms 3652ms -34.9% +50%
streamCompleteMs 3031ms 3598ms -15.8% +50%
spatialReadyMs 1336ms 1032ms +29.5% +50%
metadataCompleteMs 1821ms 3063ms -40.5% +50%
totalWallClockMs 4000ms 3700ms +8.1% +50%

AC20-FZK-Haus.ifc

Baseline recorded 2026-07-01T20:30:59.972Z on github-actions ubuntu-latest, viewer-benchmark-ci (headless Chrome, SwiftShader ANGLE), production build.

Metric Current Baseline Delta Threshold Status
firstBatchWaitMs 367ms 1075ms -65.9% +50%
firstVisibleGeometryMs 1162ms 1572ms -26.1% +50%
streamCompleteMs 1066ms 1980ms -46.2% +50%
spatialReadyMs 1084ms 915ms +18.5% +50%
metadataCompleteMs 1227ms 1392ms -11.9% +50%
totalWallClockMs 1200ms 3300ms -63.6% +50%

Refresh the baseline from a CI run: dispatch the Benchmark workflow with record_baseline, download the benchmark-baseline artifact, and commit baseline.json (see tests/benchmark/README.md).

@vercel

vercel Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated (UTC)
ifc-lite-dev Ready Ready Preview Aug 21, 2026 9:09pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ifc-lite-viewer-embed Ignored Ignored Aug 21, 2026 9:09pm

@louistrue
louistrue merged commit 666aa49 into main Aug 22, 2026
24 checks passed
@louistrue
louistrue deleted the ids-panel-requirement-grouping branch August 22, 2026 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants