Skip to content

fix(xr): keep BabiaXR charts on the analysis table (XR epic S3) - #71

Merged
aMonteSl merged 1 commit into
v1.2.1from
claude/project-thread-kvvyg6-charts
Nov 25, 2026
Merged

aMonteSl merged 1 commit into
v1.2.1from
claude/project-thread-kvvyg6-charts

Conversation

@aMonteSl

Copy link
Copy Markdown
Collaborator

Requested by Adrián · project thread

This is story S3 of the XR review epic. It covers audit findings CHARTS-1 (blocker), CHARTS-2, CHARTS-3 and CHARTS-6; the audit is in docs/xr-audit/charts.md.

What changes

Axes shrink again (CHARTS-1). BabiaXR 1.3.4 resizes an axis by animating line__<axis>axis.end. A-Frame 1.7.1 never applies that animation, so an axis kept the length of its first build: a 40-row bars chart ended 1.35 m off the table.

  • The new babiaCompat.js part of the analysis-table runtime writes the line directly.
  • Labels keep Babia's fade.
  • Every resize asks the enclosing containment for one re-fit. Without it, a 400-row chart stayed a sliver for about 15 s.

Position, not only size (CHARTS-2). computeAnchorOffset still centres the primary bounds. It then shifts the chart just enough to keep the containment bounds (axes included) on the usable tabletop. getChartStatus() reports off-table, with overhangX/overhangZ, instead of ok while anything sticks out.

Fresh measurements (CHARTS-3). refreshGeometryBoundingBox recomputes a cached boundingBox whenever the position attribute was replaced or its version changed.

One build, from the slice (CHARTS-6).

  • Row-budgeted charts are now generated with from: codexrChartDataSlice__data next to an empty slice producer, so the first Babia build already uses the top 20/30 rows.
  • The compat part keeps an empty babia-queryjson from fetching '' (the page itself).
  • syncActiveChartDataSlice never re-points a chart that reads the slice back to raw data.

Tests

npm test passes 1084/1084, and lint stays at the 158-warning budget.

New unit tests in test/analysis/xrChartTableBounds.test.cjs cover:

  • the axis patch;
  • the single re-fit after a burst of resizes;
  • the empty producer that waits;
  • the anchor clamp with an asymmetric axis box;
  • bounding boxes after an in-place rewrite;
  • generated templates and their pairing with the runtime prefix.

New opt-in browser harness npm run test:xr-chart-bounds-harness:

  • It generates real directory scenes with the compiled generator and runtime assets.
  • It covers 8 chart types × 3/30/300 files.
  • It asserts each chart stabilizes with zero overhang past the table, that budgeted charts only ever read the slice, and that there are no page errors.
  • It passes. It is documented in DEVELOPMENT.md and test/README.md.

All four existing harnesses (xr, xr-mode, project-evolution, xr-immersive) pass.

Headless re-measurement against the audit scripts:

case before after
bars, 40 files 1.35 m off the table, status ok on the table
barsmap, 400 files 2.6 m off on the table, same fit as 40 files
re-analysis 40 → 5 files 2.48 m off on the table
remap x → language 1.42 m off on the table
evolution frame with 3 rows 1.51 m off on the table

Out of scope

These are left for later stories:

  • The brief oversized frames while a chart grows or switches (CHARTS-4/5): a tower up to ~35 m tall for 2–3 s, before the fit. This belongs to S8 (unified chart pipeline).
  • Pie and donut sizes. Their final size is unchanged here and is decided in S8.

Needs a manual check

Open a directory analysis with more than 20 files in a browser and in the headset. Check that bars, cylinders and maps sit on the table with their axes, and after an edit plus re-analysis.


Generated by Claude Code

- babiaCompat.js (analysis-table runtime): write Babia axis lines directly
  (A-Frame 1.7.1 never applies the line.end animation, so an axis kept the
  length of its first build) and ask the containment for a re-fit when an
  axis resizes; let an empty babia-queryjson wait instead of fetching ''.
- Anchor keeps the containment bounds (axes) on the usable tabletop;
  getChartStatus reports off-table instead of ok while they overhang.
- Bounding boxes are recomputed when the position attribute changed.
- Generated row-budgeted charts read codexrChartDataSlice__data from
  their first build; the slice sync never re-points them at raw data.
- New opt-in browser harness test:xr-chart-bounds-harness (8 chart types
  x 3/30/300 files on real generated scenes) and unit tests.

Part of the XR environment review epic (S3).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FkKtAtQus8TVjhG9bhytC
@aMonteSl
aMonteSl merged commit ac8ba48 into v1.2.1 Nov 25, 2026
7 checks passed
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