fix(app): improvements to how collections are shown - #972
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.