(
data: Record<string, unknown>,
nodes: SnapshotNode[],
options: SnapshotTextOptions,
helperPresentation: AndroidHelperPresentationInput = { nodes, filteredCount: 0 },
)
| 617 | } |
| 618 | |
| 619 | function buildSnapshotNotices( |
| 620 | data: Record<string, unknown>, |
| 621 | nodes: SnapshotNode[], |
| 622 | options: SnapshotTextOptions, |
| 623 | helperPresentation: AndroidHelperPresentationInput = { nodes, filteredCount: 0 }, |
| 624 | ): string[] { |
| 625 | const notices = readSnapshotWarnings(data); |
| 626 | // The structured snapshot quality verdict already carries a sharper version of this hint. |
| 627 | if (shouldRenderLegacySparseSnapshotHint(data)) { |
| 628 | const sparseSnapshotHint = formatSparseSnapshotHint(nodes, options); |
| 629 | if (sparseSnapshotHint) notices.push(sparseSnapshotHint); |
| 630 | } |
| 631 | if (!options.raw && helperPresentation.filteredCount > 0) { |
| 632 | notices.push( |
| 633 | `Collapsed ${helperPresentation.filteredCount} Android helper node${helperPresentation.filteredCount === 1 ? '' : 's'} from the agent-facing text snapshot; use --raw or --json for the full hierarchy.`, |
| 634 | ); |
| 635 | } |
| 636 | const repeatedNavNodes = helperPresentation.filteredCount > 0 ? helperPresentation.nodes : nodes; |
| 637 | if (!options.raw && detectPossibleRepeatedNavSubtree(repeatedNavNodes)) { |
| 638 | notices.push('Warning: possible repeated nav subtree detected.'); |
| 639 | } |
| 640 | return notices; |
| 641 | } |
| 642 | |
| 643 | function shouldRenderLegacySparseSnapshotHint(data: Record<string, unknown>): boolean { |
| 644 | return !data.snapshotQuality && !isWebSnapshotData(data); |
no test coverage detected