Effective rendered row count for an interaction list: data-agent * `summary` entries that are immediately followed by an `instruction` get * folded into that instruction (see `pushInteractionEntries`), so they * shouldn't be double-counted in height estimation.
(interaction: InteractionEntry[] | undefined)
| 2454 | * folded into that instruction (see `pushInteractionEntries`), so they |
| 2455 | * shouldn't be double-counted in height estimation. */ |
| 2456 | function effectiveEntryCount(interaction: InteractionEntry[] | undefined): number { |
| 2457 | if (!interaction || interaction.length === 0) return 1; |
| 2458 | let n = 0; |
| 2459 | for (let i = 0; i < interaction.length; i++) { |
| 2460 | const e = interaction[i]; |
| 2461 | const next = interaction[i + 1]; |
| 2462 | if (e.role === 'summary' && e.from === 'data-agent' && next?.role === 'instruction') continue; |
| 2463 | n++; |
| 2464 | } |
| 2465 | return Math.max(1, n); |
| 2466 | } |
| 2467 | |
| 2468 | /** Estimated height of one trigger block: interaction entries + result table + its charts. */ |
| 2469 | function estimateTriggerBlockHeight( |
no outgoing calls
no test coverage detected