Skip to content

fix(app): improvements to how collections are shown - #972

Merged
EdwardMoyse merged 8 commits into
mainfrom
fix/vertex-color-by-preserves-manual-colors
Jul 26, 2026
Merged

fix(app): improvements to how collections are shown#972
EdwardMoyse merged 8 commits into
mainfrom
fix/vertex-color-by-preserves-manual-colors

Conversation

@EdwardMoyse

Copy link
Copy Markdown
Member

The collection info panel wasn't showing much information because of the excessive decimal points. It's still not perfect, but it's definitely better.

EdwardMoyse and others added 8 commits July 26, 2026 13:57
- Remove the redundant 'index' column from Collections Info table (duplicate of 'No.')
- Format floating-point values to 2 decimal places for readability
- Arrays of numbers are also formatted to 2 decimal places per element

This makes the Collections Info panel much more readable, especially for
positional data like 'pos', 'eta', 'phi' which previously showed many
decimal places.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Improve formatValue to handle array values more robustly:
- Format array elements to 2 decimal places
- Preserve integer values without decimal points
- Wrap array output in brackets for clarity

This ensures pos arrays like [1.123456, 2.789012, 3.456789] display as
[1.12, 2.79, 3.46] instead of raw values.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
…olumn

The pos column was displaying raw stringified values. Improve formatValue
to handle:
- Stringified numbers: parse and format to 2 decimal places
- Stringified arrays: parse comma-separated values, format to 2 decimals
- Integer values: display without unnecessary decimals

Now pos arrays display as [1.12, 2.79, 3.46] instead of raw strings.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Replace replaceAll (ES2021) with split/join approach for broader
compatibility with the project's TypeScript target.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Root cause found: track.pos is a 2D array (array of [x, y, z] points
along the trajectory), not a flat array of numbers. The previous
formatValue only handled one level of array nesting, so each [x, y, z]
point fell through unformatted with full floating-point precision.

Rewrite formatValue to recurse into nested arrays, and also handle
Vector3-like {x, y, z} objects (which otherwise stringify to the
unhelpful "[object Object]"). Drop the earlier fragile
stringified-value-guessing logic, which was solving the wrong problem.

Verified against the actual ATLAS sample event: InDetTrackParticles_xAOD
track.pos is confirmed to be number[][], matching this fix.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
track.author defaulted to {} (an empty object literal) rather than a
proper string/number default, so whenever the XML had no trackAuthor
element (or the guard below never matched), the collections info panel
displayed it as the unhelpful "[object Object]" instead of being blank
or showing a real author code.

Also fixes an off-by-one in the guard: trackAuthor?.length >= i allowed
i === trackAuthor.length, one past the last valid index, which reads
undefined out of bounds. Changed to i < trackAuthor.length.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Two issues combined to hide table content:
1. The shared resizable overlay was capped at max-width: 85vw, limiting
   how wide the Collections Info panel could be dragged.
2. The table cells allowed text to wrap instead of forcing the table
   wider than its container, so .boxBody's scrollbar (overflow: scroll)
   never actually engaged for wide content like long pos arrays -
   content was clipped/wrapped instead of being reachable via scroll.

Raise the overlay max-width to 95vw, and set white-space: nowrap on the
collection table so it grows with its content and the container's
horizontal scrollbar takes over for whatever still doesn't fit.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
The white-space: nowrap change (and the overflow: auto tweak) made long
values like pos arrays force horizontal scrolling instead of wrapping,
which looked worse in practice. Keep the table's original wrapping
behavior; only the overlay's wider max-width (95vw) from the previous
commit is kept.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@EdwardMoyse
EdwardMoyse merged commit 111adb2 into main Jul 26, 2026
7 checks passed
@EdwardMoyse
EdwardMoyse deleted the fix/vertex-color-by-preserves-manual-colors branch July 26, 2026 18:15
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.

1 participant