MCPcopy Create free account
hub / github.com/modem-dev/hunk / measurePlannedDiffSectionRowHeight

Function measurePlannedDiffSectionRowHeight

src/ui/diff/diffSectionGeometry.ts:175–207  ·  view source on GitHub ↗

Measure how many terminal rows one planned row occupies in a concrete section row plan.

(
  row: PlannedReviewRow,
  {
    layout,
    lineNumberDigits,
    showHunkHeaders,
    reserveAddNoteColumn,
    showLineNumbers,
    theme,
    width,
    wrapLines,
  }: DiffSectionRowHeightOptions,
)

Source from the content-addressed store, hash-verified

173
174/** Measure how many terminal rows one planned row occupies in a concrete section row plan. */
175function measurePlannedDiffSectionRowHeight(
176 row: PlannedReviewRow,
177 {
178 layout,
179 lineNumberDigits,
180 showHunkHeaders,
181 reserveAddNoteColumn,
182 showLineNumbers,
183 theme,
184 width,
185 wrapLines,
186 }: DiffSectionRowHeightOptions,
187) {
188 if (row.kind === "inline-note") {
189 return measureAgentInlineNoteHeight({
190 annotation: row.annotation,
191 anchorSide: row.anchorSide,
192 layout,
193 width,
194 });
195 }
196
197 return measureRenderedRowHeight(
198 row.row,
199 width,
200 lineNumberDigits,
201 showLineNumbers,
202 showHunkHeaders,
203 wrapLines,
204 theme,
205 reserveAddNoteColumn,
206 );
207}
208
209/** Measure one file section from the same render plan used by PierreDiffView. */
210export function measureDiffSectionGeometry(

Callers 1

Calls 2

measureRenderedRowHeightFunction · 0.90

Tested by

no test coverage detected