Loading
Add blame group normalization and per-chunk mapping
What does this MR do and why?
Adds two pure functions to source_viewer/utils.js that will replace the
absolute-positioning math currently used for the inline blame gutter:
normalizeBlameGroups(blameData)— blame groups are requested per chunk and appended in fetch-completion order, so the flat list can arrive out of order, and a commit whose block straddles two requests shows up as two consecutive groups for the same SHA. This sorts and merges them into one group per contiguous run of lines. It merges on overlap rather than exact contiguity, so a duplicate delivery is absorbed instead of stacked as a second group.blameGroupsForChunk(blameGroups, chunk)— maps normalized groups onto a single chunk's grid rows, clamping any group that starts before the chunk or runs past its last line, and returns 1-basedrowStart/rowSpanplus ahasSeparatorflag for rendering group boundaries.
Neither function has a caller yet — that wiring lands in the next MR. This is intentional: it keeps this diff reviewable purely on the function contracts and specs, with zero runtime risk since nothing in the app executes this code path yet.
Related to #589723 (closed)
This MR targets master. It's the first of three MRs split out of
!248531 (closed) following
review feedback asking for smaller diffs.
Implementation breakdown
| Step | MR | Status |
|---|---|---|
| Blame group normalization and per-chunk mapping (utils only, no callers) | (this MR) | |
| Render inline blame in a CSS subgrid instead of an overlay | !251529 (merged) | |
| Cache per-chunk blame slices across renders | !251530 (merged) | |
Migrate simple_viewer.vue off blame_info.vue, remove legacy blame positioning code |
TBD | Planned |
Edited by Joseph Fletcher