@flanksource/clicky-ui 0.3.72 → 0.3.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai.cjs +5 -0
- package/dist/ai.js +3 -1
- package/dist/comment-anchoring.cjs +3 -0
- package/dist/comment-anchoring.js +2 -1
- package/dist/comments/CommentCapture.cjs +6 -8
- package/dist/comments/CommentCapture.cjs.map +1 -1
- package/dist/comments/CommentCapture.d.ts.map +1 -1
- package/dist/comments/CommentCapture.js +6 -8
- package/dist/comments/CommentCapture.js.map +1 -1
- package/dist/comments/CommentComposer.cjs +12 -8
- package/dist/comments/CommentComposer.cjs.map +1 -1
- package/dist/comments/CommentComposer.d.ts.map +1 -1
- package/dist/comments/CommentComposer.js +12 -8
- package/dist/comments/CommentComposer.js.map +1 -1
- package/dist/comments/CommentThread.cjs +2 -1
- package/dist/comments/CommentThread.cjs.map +1 -1
- package/dist/comments/CommentThread.d.ts +1 -1
- package/dist/comments/CommentThread.d.ts.map +1 -1
- package/dist/comments/CommentThread.js +2 -1
- package/dist/comments/CommentThread.js.map +1 -1
- package/dist/comments/CommentThreadList.cjs +5 -3
- package/dist/comments/CommentThreadList.cjs.map +1 -1
- package/dist/comments/CommentThreadList.d.ts +1 -1
- package/dist/comments/CommentThreadList.d.ts.map +1 -1
- package/dist/comments/CommentThreadList.js +5 -3
- package/dist/comments/CommentThreadList.js.map +1 -1
- package/dist/comments/anchoring/dom-anchor.cjs +32 -4
- package/dist/comments/anchoring/dom-anchor.cjs.map +1 -1
- package/dist/comments/anchoring/dom-anchor.d.ts +8 -4
- package/dist/comments/anchoring/dom-anchor.d.ts.map +1 -1
- package/dist/comments/anchoring/dom-anchor.js +31 -5
- package/dist/comments/anchoring/dom-anchor.js.map +1 -1
- package/dist/comments/anchoring/frame-anchor.cjs +74 -0
- package/dist/comments/anchoring/frame-anchor.cjs.map +1 -0
- package/dist/comments/anchoring/frame-anchor.d.ts +21 -0
- package/dist/comments/anchoring/frame-anchor.d.ts.map +1 -0
- package/dist/comments/anchoring/frame-anchor.js +70 -0
- package/dist/comments/anchoring/frame-anchor.js.map +1 -0
- package/dist/comments/comment-detail.d.ts +1 -0
- package/dist/comments/comment-detail.d.ts.map +1 -1
- package/dist/comments/comment-types.cjs.map +1 -1
- package/dist/comments/comment-types.d.ts +2 -0
- package/dist/comments/comment-types.d.ts.map +1 -1
- package/dist/comments/comment-types.js.map +1 -1
- package/dist/comments/gavel/CommentInbox.cjs +49 -59
- package/dist/comments/gavel/CommentInbox.cjs.map +1 -1
- package/dist/comments/gavel/CommentInbox.d.ts +12 -8
- package/dist/comments/gavel/CommentInbox.d.ts.map +1 -1
- package/dist/comments/gavel/CommentInbox.js +51 -61
- package/dist/comments/gavel/CommentInbox.js.map +1 -1
- package/dist/comments/gavel/CommentInboxThread.cjs.map +1 -1
- package/dist/comments/gavel/CommentInboxThread.d.ts +1 -3
- package/dist/comments/gavel/CommentInboxThread.d.ts.map +1 -1
- package/dist/comments/gavel/CommentInboxThread.js.map +1 -1
- package/dist/comments/gavel/comment-agent-assignment.cjs +41 -0
- package/dist/comments/gavel/comment-agent-assignment.cjs.map +1 -0
- package/dist/comments/gavel/comment-agent-assignment.d.ts +15 -0
- package/dist/comments/gavel/comment-agent-assignment.d.ts.map +1 -0
- package/dist/comments/gavel/comment-agent-assignment.js +39 -0
- package/dist/comments/gavel/comment-agent-assignment.js.map +1 -0
- package/dist/comments/gavel/gavel-projection.cjs +43 -13
- package/dist/comments/gavel/gavel-projection.cjs.map +1 -1
- package/dist/comments/gavel/gavel-projection.d.ts +3 -0
- package/dist/comments/gavel/gavel-projection.d.ts.map +1 -1
- package/dist/comments/gavel/gavel-projection.js +43 -14
- package/dist/comments/gavel/gavel-projection.js.map +1 -1
- package/dist/comments/gavel/inbox-model.cjs +3 -12
- package/dist/comments/gavel/inbox-model.cjs.map +1 -1
- package/dist/comments/gavel/inbox-model.d.ts +2 -2
- package/dist/comments/gavel/inbox-model.d.ts.map +1 -1
- package/dist/comments/gavel/inbox-model.js +4 -12
- package/dist/comments/gavel/inbox-model.js.map +1 -1
- package/dist/comments/gavel/inbox-prompt.cjs +1 -0
- package/dist/comments/gavel/inbox-prompt.cjs.map +1 -1
- package/dist/comments/gavel/inbox-prompt.d.ts.map +1 -1
- package/dist/comments/gavel/inbox-prompt.js +1 -0
- package/dist/comments/gavel/inbox-prompt.js.map +1 -1
- package/dist/comments/gavel/index.d.ts +1 -0
- package/dist/comments/gavel/index.d.ts.map +1 -1
- package/dist/comments-gavel.cjs +5 -1
- package/dist/comments-gavel.js +4 -3
- package/dist/comments.cjs +5 -0
- package/dist/comments.d.ts +1 -0
- package/dist/comments.d.ts.map +1 -1
- package/dist/comments.js +3 -1
- package/dist/components/AccordionList.cjs +2 -2
- package/dist/components/AccordionList.cjs.map +1 -1
- package/dist/components/AccordionList.js +2 -2
- package/dist/components/AccordionList.js.map +1 -1
- package/dist/components/examples/form-extensions/extension.d.ts +1 -1
- package/dist/components/examples/form-extensions/extension.d.ts.map +1 -1
- package/dist/components/json-schema-form-array-add-menu.cjs +44 -0
- package/dist/components/json-schema-form-array-add-menu.cjs.map +1 -0
- package/dist/components/json-schema-form-array-add-menu.d.ts +10 -0
- package/dist/components/json-schema-form-array-add-menu.d.ts.map +1 -0
- package/dist/components/json-schema-form-array-add-menu.js +44 -0
- package/dist/components/json-schema-form-array-add-menu.js.map +1 -0
- package/dist/components/json-schema-form-exclusive-key-select.cjs +28 -0
- package/dist/components/json-schema-form-exclusive-key-select.cjs.map +1 -0
- package/dist/components/json-schema-form-exclusive-key-select.d.ts +12 -0
- package/dist/components/json-schema-form-exclusive-key-select.d.ts.map +1 -0
- package/dist/components/json-schema-form-exclusive-key-select.js +28 -0
- package/dist/components/json-schema-form-exclusive-key-select.js.map +1 -0
- package/dist/components/json-schema-form-exclusive-keys.cjs +23 -0
- package/dist/components/json-schema-form-exclusive-keys.cjs.map +1 -0
- package/dist/components/json-schema-form-exclusive-keys.d.ts +8 -0
- package/dist/components/json-schema-form-exclusive-keys.d.ts.map +1 -0
- package/dist/components/json-schema-form-exclusive-keys.js +22 -0
- package/dist/components/json-schema-form-exclusive-keys.js.map +1 -0
- package/dist/components/json-schema-form-layout.cjs +18 -5
- package/dist/components/json-schema-form-layout.cjs.map +1 -1
- package/dist/components/json-schema-form-layout.d.ts +3 -1
- package/dist/components/json-schema-form-layout.d.ts.map +1 -1
- package/dist/components/json-schema-form-layout.js +19 -6
- package/dist/components/json-schema-form-layout.js.map +1 -1
- package/dist/components/json-schema-form-object-array-view.cjs +13 -7
- package/dist/components/json-schema-form-object-array-view.cjs.map +1 -1
- package/dist/components/json-schema-form-object-array-view.d.ts.map +1 -1
- package/dist/components/json-schema-form-object-array-view.js +13 -7
- package/dist/components/json-schema-form-object-array-view.js.map +1 -1
- package/dist/components/json-schema-form-object.cjs +6 -0
- package/dist/components/json-schema-form-object.cjs.map +1 -1
- package/dist/components/json-schema-form-object.d.ts.map +1 -1
- package/dist/components/json-schema-form-object.js +6 -0
- package/dist/components/json-schema-form-object.js.map +1 -1
- package/dist/components/json-schema-form-render.cjs +56 -35
- package/dist/components/json-schema-form-render.cjs.map +1 -1
- package/dist/components/json-schema-form-render.d.ts +1 -0
- package/dist/components/json-schema-form-render.d.ts.map +1 -1
- package/dist/components/json-schema-form-render.js +56 -35
- package/dist/components/json-schema-form-render.js.map +1 -1
- package/dist/components/json-schema-form-resolve.cjs +1 -0
- package/dist/components/json-schema-form-resolve.cjs.map +1 -1
- package/dist/components/json-schema-form-resolve.d.ts +2 -1
- package/dist/components/json-schema-form-resolve.d.ts.map +1 -1
- package/dist/components/json-schema-form-resolve.js +1 -1
- package/dist/components/json-schema-form-resolve.js.map +1 -1
- package/dist/components/json-schema-form-runtime-types.d.ts +8 -0
- package/dist/components/json-schema-form-runtime-types.d.ts.map +1 -1
- package/dist/components/json-schema-form-section-actions.cjs +12 -0
- package/dist/components/json-schema-form-section-actions.cjs.map +1 -0
- package/dist/components/json-schema-form-section-actions.d.ts +8 -0
- package/dist/components/json-schema-form-section-actions.d.ts.map +1 -0
- package/dist/components/json-schema-form-section-actions.js +11 -0
- package/dist/components/json-schema-form-section-actions.js.map +1 -0
- package/dist/components/json-schema-form-sibling-prefix.cjs +23 -0
- package/dist/components/json-schema-form-sibling-prefix.cjs.map +1 -0
- package/dist/components/json-schema-form-sibling-prefix.d.ts +9 -0
- package/dist/components/json-schema-form-sibling-prefix.d.ts.map +1 -0
- package/dist/components/json-schema-form-sibling-prefix.js +23 -0
- package/dist/components/json-schema-form-sibling-prefix.js.map +1 -0
- package/dist/components/json-schema-form-sibling-select.cjs +25 -0
- package/dist/components/json-schema-form-sibling-select.cjs.map +1 -0
- package/dist/components/json-schema-form-sibling-select.d.ts +9 -0
- package/dist/components/json-schema-form-sibling-select.d.ts.map +1 -0
- package/dist/components/json-schema-form-sibling-select.js +25 -0
- package/dist/components/json-schema-form-sibling-select.js.map +1 -0
- package/dist/components/json-schema-form-table-array.cjs +4 -3
- package/dist/components/json-schema-form-table-array.cjs.map +1 -1
- package/dist/components/json-schema-form-table-array.js +4 -3
- package/dist/components/json-schema-form-table-array.js.map +1 -1
- package/dist/components/json-schema-form-tags-combobox.cjs +54 -24
- package/dist/components/json-schema-form-tags-combobox.cjs.map +1 -1
- package/dist/components/json-schema-form-tags-combobox.d.ts.map +1 -1
- package/dist/components/json-schema-form-tags-combobox.js +55 -25
- package/dist/components/json-schema-form-tags-combobox.js.map +1 -1
- package/dist/components.cjs +2 -0
- package/dist/components.d.ts +2 -1
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +2 -1
- package/dist/data/LogViewer.cjs +90 -19
- package/dist/data/LogViewer.cjs.map +1 -1
- package/dist/data/LogViewer.d.ts +9 -5
- package/dist/data/LogViewer.d.ts.map +1 -1
- package/dist/data/LogViewer.js +91 -20
- package/dist/data/LogViewer.js.map +1 -1
- package/dist/data/TaskProgress.cjs +5 -5
- package/dist/data/TaskProgress.cjs.map +1 -1
- package/dist/data/TaskProgress.js +5 -5
- package/dist/data/TaskProgress.js.map +1 -1
- package/dist/data/ai/SessionChatComposer.cjs +44 -22
- package/dist/data/ai/SessionChatComposer.cjs.map +1 -1
- package/dist/data/ai/SessionChatComposer.d.ts.map +1 -1
- package/dist/data/ai/SessionChatComposer.js +44 -22
- package/dist/data/ai/SessionChatComposer.js.map +1 -1
- package/dist/data/ai/SessionInspector.cjs +1 -1
- package/dist/data/ai/SessionInspector.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.host-tabs.cjs +12 -0
- package/dist/data/ai/SessionInspector.host-tabs.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.host-tabs.d.ts +4 -1
- package/dist/data/ai/SessionInspector.host-tabs.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.host-tabs.js +12 -1
- package/dist/data/ai/SessionInspector.host-tabs.js.map +1 -1
- package/dist/data/ai/SessionInspector.js +2 -2
- package/dist/data/ai/SessionInspector.js.map +1 -1
- package/dist/data/ai/SessionInspector.legacy.cjs +1 -1
- package/dist/data/ai/SessionInspector.legacy.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.legacy.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.legacy.js +2 -2
- package/dist/data/ai/SessionInspector.legacy.js.map +1 -1
- package/dist/data/ai/SessionInspector.transcript.cjs +5 -19
- package/dist/data/ai/SessionInspector.transcript.cjs.map +1 -1
- package/dist/data/ai/SessionInspector.transcript.d.ts.map +1 -1
- package/dist/data/ai/SessionInspector.transcript.js +6 -20
- package/dist/data/ai/SessionInspector.transcript.js.map +1 -1
- package/dist/data/ai/SessionPicker.cjs +159 -0
- package/dist/data/ai/SessionPicker.cjs.map +1 -0
- package/dist/data/ai/SessionPicker.d.ts +39 -0
- package/dist/data/ai/SessionPicker.d.ts.map +1 -0
- package/dist/data/ai/SessionPicker.js +159 -0
- package/dist/data/ai/SessionPicker.js.map +1 -0
- package/dist/data/ai/SessionPicker.model.cjs +21 -0
- package/dist/data/ai/SessionPicker.model.cjs.map +1 -0
- package/dist/data/ai/SessionPicker.model.d.ts +26 -0
- package/dist/data/ai/SessionPicker.model.d.ts.map +1 -0
- package/dist/data/ai/SessionPicker.model.js +20 -0
- package/dist/data/ai/SessionPicker.model.js.map +1 -0
- package/dist/data/ai/SessionTail.cjs +25 -15
- package/dist/data/ai/SessionTail.cjs.map +1 -1
- package/dist/data/ai/SessionTail.d.ts.map +1 -1
- package/dist/data/ai/SessionTail.js +25 -15
- package/dist/data/ai/SessionTail.js.map +1 -1
- package/dist/data/ai/SessionViewer.input.cjs +59 -1
- package/dist/data/ai/SessionViewer.input.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.input.d.ts +22 -0
- package/dist/data/ai/SessionViewer.input.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.input.js +58 -2
- package/dist/data/ai/SessionViewer.input.js.map +1 -1
- package/dist/data/ai/SessionViewer.rows.cjs +10 -3
- package/dist/data/ai/SessionViewer.rows.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.rows.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.rows.js +11 -4
- package/dist/data/ai/SessionViewer.rows.js.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.cjs +35 -0
- package/dist/data/ai/SessionViewer.tool-details.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.d.ts +10 -1
- package/dist/data/ai/SessionViewer.tool-details.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.tool-details.js +35 -1
- package/dist/data/ai/SessionViewer.tool-details.js.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.cjs +5 -1
- package/dist/data/ai/SessionViewer.tool-row.cjs.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.d.ts.map +1 -1
- package/dist/data/ai/SessionViewer.tool-row.js +7 -3
- package/dist/data/ai/SessionViewer.tool-row.js.map +1 -1
- package/dist/data/ai/index.d.ts +2 -0
- package/dist/data/ai/index.d.ts.map +1 -1
- package/dist/data/git/GitChangeList.cjs +40 -7
- package/dist/data/git/GitChangeList.cjs.map +1 -1
- package/dist/data/git/GitChangeList.d.ts +3 -0
- package/dist/data/git/GitChangeList.d.ts.map +1 -1
- package/dist/data/git/GitChangeList.js +40 -7
- package/dist/data/git/GitChangeList.js.map +1 -1
- package/dist/data/git/pickers/GitFilePicker.cjs +19 -7
- package/dist/data/git/pickers/GitFilePicker.cjs.map +1 -1
- package/dist/data/git/pickers/GitFilePicker.d.ts +4 -2
- package/dist/data/git/pickers/GitFilePicker.d.ts.map +1 -1
- package/dist/data/git/pickers/GitFilePicker.js +19 -7
- package/dist/data/git/pickers/GitFilePicker.js.map +1 -1
- package/dist/data/git/pickers/GitPickers.cjs +3 -3
- package/dist/data/git/pickers/GitPickers.cjs.map +1 -1
- package/dist/data/git/pickers/GitPickers.js +3 -3
- package/dist/data/git/pickers/GitPickers.js.map +1 -1
- package/dist/data/git/pickers/GitPickersDemo.d.ts.map +1 -1
- package/dist/data/git/pickers/GitSourcePicker.cjs +11 -4
- package/dist/data/git/pickers/GitSourcePicker.cjs.map +1 -1
- package/dist/data/git/pickers/GitSourcePicker.d.ts +4 -2
- package/dist/data/git/pickers/GitSourcePicker.d.ts.map +1 -1
- package/dist/data/git/pickers/GitSourcePicker.js +11 -4
- package/dist/data/git/pickers/GitSourcePicker.js.map +1 -1
- package/dist/data/git/pickers/ReferencePicker.cjs +27 -3
- package/dist/data/git/pickers/ReferencePicker.cjs.map +1 -1
- package/dist/data/git/pickers/ReferencePicker.d.ts.map +1 -1
- package/dist/data/git/pickers/ReferencePicker.js +27 -3
- package/dist/data/git/pickers/ReferencePicker.js.map +1 -1
- package/dist/data/git/pickers/RepositoryCatalogPicker.cjs +2 -1
- package/dist/data/git/pickers/RepositoryCatalogPicker.cjs.map +1 -1
- package/dist/data/git/pickers/RepositoryCatalogPicker.d.ts +3 -2
- package/dist/data/git/pickers/RepositoryCatalogPicker.d.ts.map +1 -1
- package/dist/data/git/pickers/RepositoryCatalogPicker.js +2 -1
- package/dist/data/git/pickers/RepositoryCatalogPicker.js.map +1 -1
- package/dist/data/git/pickers/types.d.ts +7 -0
- package/dist/data/git/pickers/types.d.ts.map +1 -1
- package/dist/data/lint/LintList.cjs +89 -89
- package/dist/data/lint/LintList.cjs.map +1 -1
- package/dist/data/lint/LintList.d.ts +3 -2
- package/dist/data/lint/LintList.d.ts.map +1 -1
- package/dist/data/lint/LintList.js +90 -90
- package/dist/data/lint/LintList.js.map +1 -1
- package/dist/data/log-sections.cjs +152 -21
- package/dist/data/log-sections.cjs.map +1 -1
- package/dist/data/log-sections.d.ts +31 -6
- package/dist/data/log-sections.d.ts.map +1 -1
- package/dist/data/log-sections.js +151 -22
- package/dist/data/log-sections.js.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.cjs +1 -1
- package/dist/data/test-runner/TestDetailPanel.cjs.map +1 -1
- package/dist/data/test-runner/TestDetailPanel.js +1 -1
- package/dist/data/test-runner/TestDetailPanel.js.map +1 -1
- package/dist/data/test-runner/TestFailureDetail.cjs +10 -8
- package/dist/data/test-runner/TestFailureDetail.cjs.map +1 -1
- package/dist/data/test-runner/TestFailureDetail.d.ts +3 -2
- package/dist/data/test-runner/TestFailureDetail.d.ts.map +1 -1
- package/dist/data/test-runner/TestFailureDetail.js +10 -8
- package/dist/data/test-runner/TestFailureDetail.js.map +1 -1
- package/dist/data/test-runner/TestTreeNode.cjs +9 -4
- package/dist/data/test-runner/TestTreeNode.cjs.map +1 -1
- package/dist/data/test-runner/TestTreeNode.d.ts.map +1 -1
- package/dist/data/test-runner/TestTreeNode.js +9 -4
- package/dist/data/test-runner/TestTreeNode.js.map +1 -1
- package/dist/data/test-runner/attempts.cjs +2 -1
- package/dist/data/test-runner/attempts.cjs.map +1 -1
- package/dist/data/test-runner/attempts.d.ts.map +1 -1
- package/dist/data/test-runner/attempts.js +2 -1
- package/dist/data/test-runner/attempts.js.map +1 -1
- package/dist/data/test-runner/copy.cjs +1 -2
- package/dist/data/test-runner/copy.cjs.map +1 -1
- package/dist/data/test-runner/copy.d.ts.map +1 -1
- package/dist/data/test-runner/copy.js +1 -2
- package/dist/data/test-runner/copy.js.map +1 -1
- package/dist/data/test-runner/types.d.ts +3 -0
- package/dist/data/test-runner/types.d.ts.map +1 -1
- package/dist/data/traces/GoProfileView.cjs +10 -7
- package/dist/data/traces/GoProfileView.cjs.map +1 -1
- package/dist/data/traces/GoProfileView.d.ts.map +1 -1
- package/dist/data/traces/GoProfileView.js +10 -7
- package/dist/data/traces/GoProfileView.js.map +1 -1
- package/dist/data/verification/adapters.cjs +1 -0
- package/dist/data/verification/adapters.cjs.map +1 -1
- package/dist/data/verification/adapters.d.ts.map +1 -1
- package/dist/data/verification/adapters.js +1 -0
- package/dist/data/verification/adapters.js.map +1 -1
- package/dist/data/version-info.cjs +3 -3
- package/dist/data/version-info.js +3 -3
- package/dist/data.cjs +2 -2
- package/dist/data.d.ts +1 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +2 -2
- package/dist/index.cjs +8 -1
- package/dist/index.js +5 -2
- package/dist/runtime/barrels.json +6604 -6582
- package/dist/runtime/importmap.json +2129 -2120
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/comments/gavel/CommentInboxReview.cjs +0 -169
- package/dist/comments/gavel/CommentInboxReview.cjs.map +0 -1
- package/dist/comments/gavel/CommentInboxReview.d.ts +0 -20
- package/dist/comments/gavel/CommentInboxReview.d.ts.map +0 -1
- package/dist/comments/gavel/CommentInboxReview.js +0 -169
- package/dist/comments/gavel/CommentInboxReview.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestFailureDetail.js","names":[],"sources":["../../../src/data/test-runner/TestFailureDetail.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { LogViewer } from \"../LogViewer\";\nimport { parseStackDump } from \"../diagnostics/stacktrace\";\nimport { StackDumpView } from \"../diagnostics/StackDumpView\";\nimport { Expectation } from \"./Expectation\";\nimport { useSelectDetailTab } from \"./detailTabContext\";\nimport type { FailureDetail, Test } from \"./types\";\n\n/** A failure stack: a Go panic dump as goroutine cards, anything else as a log. */\nfunction FailureStack({ stack }: { stack: string }) {\n const parsed = useMemo(() => parseStackDump(stack), [stack]);\n if (parsed.format !== \"go\") return <LogViewer logs={stack} collapsedLines={6} />;\n return (\n <div className=\"flex max-h-[32rem] min-h-0 flex-col\" data-failure-stack=\"go\">\n <StackDumpView text={stack} singleItem={parsed.goroutines.length === 1} />\n </div>\n );\n}\n\n/**\n * Renders a structured failure: its summary, the expectation, and the stack.\n * A stack that is a Go goroutine dump (a panic) is shown as searchable\n * goroutine cards; any other stack stays a log.\n */\nexport function TestFailureDetail({ failure }: { failure: FailureDetail }) {\n const hasExpectation = !!(\n failure.matcher ||\n failure.expected ||\n failure.actual ||\n failure.location\n );\n return (\n <div className=\"space-y-2\">\n {failure.summary && (\n <p className=\"text-sm font-medium text-red-700 dark:text-red-300\">{failure.summary}</p>\n )}\n {hasExpectation && (\n <Expectation\n check={failure.matcher}\n expected={failure.expected || undefined}\n actual={failure.actual || undefined}\n location={failure.location}\n />\n )}\n {failure.stack && <FailureStack stack={failure.stack} />}\n </div>\n );\n}\n\n/**\n *
|
|
1
|
+
{"version":3,"file":"TestFailureDetail.js","names":[],"sources":["../../../src/data/test-runner/TestFailureDetail.tsx"],"sourcesContent":["import { useMemo } from \"react\";\nimport { Button } from \"../../components/button\";\nimport { LogViewer } from \"../LogViewer\";\nimport { parseStackDump } from \"../diagnostics/stacktrace\";\nimport { StackDumpView } from \"../diagnostics/StackDumpView\";\nimport { Expectation } from \"./Expectation\";\nimport { useSelectDetailTab } from \"./detailTabContext\";\nimport type { FailureDetail, Test } from \"./types\";\n\n/** A failure stack: a Go panic dump as goroutine cards, anything else as a log. */\nfunction FailureStack({ stack }: { stack: string }) {\n const parsed = useMemo(() => parseStackDump(stack), [stack]);\n if (parsed.format !== \"go\") return <LogViewer logs={stack} collapsedLines={6} />;\n return (\n <div className=\"flex max-h-[32rem] min-h-0 flex-col\" data-failure-stack=\"go\">\n <StackDumpView text={stack} singleItem={parsed.goroutines.length === 1} />\n </div>\n );\n}\n\n/**\n * Renders a structured failure: its summary, the expectation, and the stack.\n * A stack that is a Go goroutine dump (a panic) is shown as searchable\n * goroutine cards; any other stack stays a log.\n */\nexport function TestFailureDetail({ failure }: { failure: FailureDetail }) {\n const hasExpectation = !!(\n failure.matcher ||\n failure.expected ||\n failure.actual ||\n failure.location\n );\n return (\n <div className=\"space-y-2\">\n {failure.summary && (\n <p className=\"text-sm font-medium text-red-700 dark:text-red-300\">{failure.summary}</p>\n )}\n {hasExpectation && (\n <Expectation\n check={failure.matcher}\n expected={failure.expected || undefined}\n actual={failure.actual || undefined}\n location={failure.location}\n />\n )}\n {failure.stack && <FailureStack stack={failure.stack} />}\n </div>\n );\n}\n\nconst PREVIEW_LINES = 10;\n\n/**\n * The node's log — both streams as they were written — or, without one, its\n * stdout then its stderr. The preview is its last ten lines, where a long run's\n * latest progress and its final error are, linking to the panel's Stdout tab.\n */\nexport function TestOutput({ node, view = \"preview\" }: { node: Test; view?: \"preview\" | \"full\" }) {\n const selectTab = useSelectDetailTab();\n const streams = node.log ? [node.log] : [node.stdout, node.stderr];\n const output = streams.flatMap((stream) => stream ? [stream.replace(/\\r?\\n$/, \"\")] : []).join(\"\\n\");\n if (!output) return null;\n const preview = view === \"preview\";\n return (\n <div className=\"space-y-1\">\n {preview && <div className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">Output</div>}\n <LogViewer\n logs={output}\n variant=\"terminal\"\n maxHeight=\"none\"\n collapsedLines={Infinity}\n {...(preview ? { tailLines: PREVIEW_LINES } : {})}\n />\n {preview && output.split(\"\\n\").length > PREVIEW_LINES && selectTab && (\n <Button type=\"button\" variant=\"link\" size=\"sm\" className=\"px-0\" onClick={() => selectTab(\"stdout\")}>\n Show more in Stdout\n </Button>\n )}\n </div>\n );\n}\n"],"mappings":";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AA4D,UAAA;GAAW,CAAA;GAClG,oBAAC,WAAD;IACE,MAAM;IACN,SAAQ;IACR,WAAU;IACV,gBAAgB;IAChB,GAAK,UAAU,EAAE,WAAW,cAAc,IAAI,CAAC;GAChD,CAAA;GACA,WAAW,OAAO,MAAM,IAAI,CAAC,CAAC,SAAS,iBAAiB,aACvD,oBAAC,QAAD;IAAQ,MAAK;IAAS,SAAQ;IAAO,MAAK;IAAK,WAAU;IAAO,eAAe,UAAU,QAAQ;IAAG,UAAA;GAE5F,CAAA;EAEP;;AAET"}
|
|
@@ -148,10 +148,15 @@ function TestTreeNode({ node, selected }) {
|
|
|
148
148
|
"data-row-message": "",
|
|
149
149
|
children: message
|
|
150
150
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: "flex-1" }),
|
|
151
|
-
node.progress && node.progress.total > 0 && !node.passed && !node.failed && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
152
|
-
className: "flex
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
node.progress && (node.progress.total > 0 || node.progress.phase) && !node.passed && !node.failed && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
152
|
+
className: "flex min-w-0 items-center gap-1 text-xs text-blue-600 dark:text-blue-400",
|
|
153
|
+
"data-row-progress": "",
|
|
154
|
+
children: [node.progress.phase && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
155
|
+
className: "truncate",
|
|
156
|
+
title: node.progress.phase,
|
|
157
|
+
children: node.progress.phase
|
|
158
|
+
}), node.progress.total > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
159
|
+
className: "shrink-0 tabular-nums",
|
|
155
160
|
children: [
|
|
156
161
|
node.progress.done,
|
|
157
162
|
"/",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestTreeNode.cjs","names":["sum","Badge","useTestRunner","testStatus","outcomeFor","totalDuration","_Fragment","OutcomeIcon","Icon","UiClass","ToolIcon","toolKeyFor","cn","humanizeName","ElapsedDuration","formatTestDuration","IconButton","UiStop","UiRefresh"],"sources":["../../../src/data/test-runner/TestTreeNode.tsx"],"sourcesContent":["import { Icon } from \"../Icon\";\nimport { ElapsedDuration } from \"../ElapsedDuration\";\nimport { Badge } from \"../Badge\";\nimport { IconButton } from \"../../components/IconButton\";\nimport { UiClass, UiRefresh, UiStop } from \"../../icons\";\nimport { cn } from \"../../lib/utils\";\nimport type { Test } from \"./types\";\nimport { useTestRunner } from \"./context\";\nimport {\n formatTestDuration,\n humanizeName,\n outcomeFor,\n sum,\n testStatus,\n totalDuration,\n} from \"./status\";\nimport { toolKeyFor } from \"./marks\";\nimport { OutcomeIcon, ToolIcon } from \"./MarkIcons\";\n\nconst NAME_TONE: Record<string, string> = {\n failed: \"text-red-600 dark:text-red-400\",\n timedout: \"text-amber-600 dark:text-amber-400\",\n warned: \"text-amber-600 dark:text-amber-400\",\n aborted: \"text-muted-foreground\",\n running: \"text-blue-600 dark:text-blue-400\",\n skipped: \"text-muted-foreground\",\n pending: \"text-muted-foreground\",\n passed: \"text-foreground\",\n};\n\nconst MESSAGE_STATUSES = new Set([\"failed\", \"timedout\", \"warned\", \"aborted\", \"skipped\"]);\n\n/**\n * Per-status roll-up count badges shown on a container row. A roll-up that is\n * all passed shows none: the row's green outcome icon already says so, and a\n * lone green count only repeats it. The passed count shows beside any other\n * status.\n */\nfunction CountBadges({ node }: { node: Test }) {\n const s = sum(node);\n if (s.total === 0 || s.passed === s.total) return null;\n return (\n <span className=\"flex shrink-0 items-center gap-1\">\n {s.passed > 0 && <Badge tone=\"success\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.passed} />}\n {s.failed > 0 && <Badge tone=\"danger\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.failed} />}\n {s.warned > 0 && <Badge tone=\"warning\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.warned} />}\n {s.timedout > 0 && <Badge tone=\"danger\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.timedout} />}\n {s.aborted > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.aborted} />}\n {s.skipped > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.skipped} />}\n {s.running > 0 && <Badge tone=\"info\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.running} />}\n {s.pending > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.pending} />}\n </span>\n );\n}\n\n/**\n * Renders one test tree row: status icon, optional adapter decoration + framework\n * icon, status-colored name, duration, per-status count badges, and (when the\n * runner exposes the handlers) rerun/stop buttons. Designed as the `renderRow`\n * for the clicky `Tree`.\n */\nexport function TestTreeNode({ node, selected }: { node: Test; selected: boolean }) {\n const runner = useTestRunner();\n const hasChildren = (node.children?.length ?? 0) > 0;\n const status = testStatus(node);\n const outcome = outcomeFor(node);\n const fwAdapter = runner.adapters.resolveFrameworkIcon(node, runner);\n const fwNode = fwAdapter?.renderFrameworkIcon?.({ node, runner });\n const leadingAdapter = runner.adapters.resolveRowLeading(node, runner);\n const dur = node.duration || (hasChildren ? totalDuration(node) : 0);\n const live = !!node.running && !!node.started && !node.duration;\n const canRerun = !!runner.onRerun && node.framework !== \"task\";\n const canStop = !!runner.onStop && !!node.can_stop && !!node.task_id;\n const showMessage = status && (MESSAGE_STATUSES.has(status) || (node.framework === \"task\" && (status === \"running\" || status === \"pending\")));\n const message = showMessage ? (node.message ?? \"\").trim() : \"\";\n\n return (\n <>\n {outcome ? (\n <OutcomeIcon outcome={outcome} />\n ) : (\n <Icon icon={UiClass} className=\"shrink-0 text-muted-foreground\" />\n )}\n\n {fwNode != null ? (\n <span className=\"flex shrink-0 items-center text-sm\">{fwNode}</span>\n ) : (\n <ToolIcon tool={toolKeyFor(node)} className=\"text-sm\" />\n )}\n\n {leadingAdapter?.renderRowLeading?.({ node, runner })}\n\n <span\n className={cn(\n \"min-w-0 truncate\",\n selected ? \"font-semibold\" : \"font-medium\",\n (status && NAME_TONE[status]) || \"text-foreground\",\n )}\n title={message || undefined}\n >\n {runner.adapters.resolveRowLabel(node, runner) ?? humanizeName(node.name, node.framework)}\n </span>\n {/* The verdict trails the name on the same line and gives way first. */}\n {message ? (\n <span\n className=\"min-w-0 flex-1 shrink-[100] truncate text-xs text-muted-foreground\"\n title={message}\n data-row-message=\"\"\n >\n {message}\n </span>\n ) : (\n <span className=\"flex-1\" />\n )}\n\n {node.progress && node.progress.total > 0 && !node.passed && !node.failed && (\n <span className=\"flex shrink-0 items-center gap-1 text-xs text-blue-600 dark:text-blue-400\">\n {node.progress.phase && <span>{node.progress.phase}</span>}\n <span className=\"tabular-nums\">\n {node.progress.done}/{node.progress.total}\n </span>\n </span>\n )}\n\n {live ? (\n <ElapsedDuration\n startedAt={node.started}\n finishedAt={undefined}\n format={(ms) => formatTestDuration(ms * 1e6)}\n className=\"shrink-0 text-xs text-muted-foreground\"\n />\n ) : (\n dur > 0 && <span className=\"shrink-0 text-xs text-muted-foreground\">{formatTestDuration(dur)}</span>\n )}\n\n {hasChildren && <CountBadges node={node} />}\n\n {canStop && (\n <IconButton\n icon={UiStop}\n label=\"Stop\"\n disabled={runner.busy.stop}\n onClick={(e) => {\n e.stopPropagation();\n runner.onStop!(node);\n }}\n />\n )}\n\n {canRerun && (\n <IconButton\n icon={UiRefresh}\n label=\"Rerun\"\n disabled={runner.busy.rerun}\n onClick={(e) => {\n e.stopPropagation();\n runner.onRerun!(node);\n }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,IAAM,YAAoC;CACxC,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;AACV;AAEA,IAAM,mCAAmB,IAAI,IAAI;CAAC;CAAU;CAAY;CAAU;CAAW;AAAS,CAAC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CAAC,QAAD;GAAM,WAAU;GAA0C,UAAAA,eAAAA,mBAAmB,GAAG;EAAQ,CAAA;EAGpG,eAAe,iBAAA,GAAA,kBAAA,IAAA,CAAC,aAAD,EAAmB,KAAO,CAAA;EAEzC,WACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,mBAAAA,YAAD;GACE,MAAMC,eAAAA;GACN,OAAM;GACN,UAAU,OAAO,KAAK;GACtB,UAAU,MAAM;IACd,EAAE,gBAAgB;IAClB,OAAO,OAAQ,IAAI;GACrB;EACD,CAAA;EAGF,YACC,iBAAA,GAAA,kBAAA,IAAA,CAACD,mBAAAA,YAAD;GACE,MAAME,kBAAAA;GACN,OAAM;GACN,UAAU,OAAO,KAAK;GACtB,UAAU,MAAM;IACd,EAAE,gBAAgB;IAClB,OAAO,QAAS,IAAI;GACtB;EACD,CAAA;CAEH,EAAA,CAAA;AAEN"}
|
|
1
|
+
{"version":3,"file":"TestTreeNode.cjs","names":["sum","Badge","useTestRunner","testStatus","outcomeFor","totalDuration","_Fragment","OutcomeIcon","Icon","UiClass","ToolIcon","toolKeyFor","cn","humanizeName","ElapsedDuration","formatTestDuration","IconButton","UiStop","UiRefresh"],"sources":["../../../src/data/test-runner/TestTreeNode.tsx"],"sourcesContent":["import { Icon } from \"../Icon\";\nimport { ElapsedDuration } from \"../ElapsedDuration\";\nimport { Badge } from \"../Badge\";\nimport { IconButton } from \"../../components/IconButton\";\nimport { UiClass, UiRefresh, UiStop } from \"../../icons\";\nimport { cn } from \"../../lib/utils\";\nimport type { Test } from \"./types\";\nimport { useTestRunner } from \"./context\";\nimport {\n formatTestDuration,\n humanizeName,\n outcomeFor,\n sum,\n testStatus,\n totalDuration,\n} from \"./status\";\nimport { toolKeyFor } from \"./marks\";\nimport { OutcomeIcon, ToolIcon } from \"./MarkIcons\";\n\nconst NAME_TONE: Record<string, string> = {\n failed: \"text-red-600 dark:text-red-400\",\n timedout: \"text-amber-600 dark:text-amber-400\",\n warned: \"text-amber-600 dark:text-amber-400\",\n aborted: \"text-muted-foreground\",\n running: \"text-blue-600 dark:text-blue-400\",\n skipped: \"text-muted-foreground\",\n pending: \"text-muted-foreground\",\n passed: \"text-foreground\",\n};\n\nconst MESSAGE_STATUSES = new Set([\"failed\", \"timedout\", \"warned\", \"aborted\", \"skipped\"]);\n\n/**\n * Per-status roll-up count badges shown on a container row. A roll-up that is\n * all passed shows none: the row's green outcome icon already says so, and a\n * lone green count only repeats it. The passed count shows beside any other\n * status.\n */\nfunction CountBadges({ node }: { node: Test }) {\n const s = sum(node);\n if (s.total === 0 || s.passed === s.total) return null;\n return (\n <span className=\"flex shrink-0 items-center gap-1\">\n {s.passed > 0 && <Badge tone=\"success\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.passed} />}\n {s.failed > 0 && <Badge tone=\"danger\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.failed} />}\n {s.warned > 0 && <Badge tone=\"warning\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.warned} />}\n {s.timedout > 0 && <Badge tone=\"danger\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.timedout} />}\n {s.aborted > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.aborted} />}\n {s.skipped > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.skipped} />}\n {s.running > 0 && <Badge tone=\"info\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.running} />}\n {s.pending > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.pending} />}\n </span>\n );\n}\n\n/**\n * Renders one test tree row: status icon, optional adapter decoration + framework\n * icon, status-colored name, duration, per-status count badges, and (when the\n * runner exposes the handlers) rerun/stop buttons. Designed as the `renderRow`\n * for the clicky `Tree`.\n */\nexport function TestTreeNode({ node, selected }: { node: Test; selected: boolean }) {\n const runner = useTestRunner();\n const hasChildren = (node.children?.length ?? 0) > 0;\n const status = testStatus(node);\n const outcome = outcomeFor(node);\n const fwAdapter = runner.adapters.resolveFrameworkIcon(node, runner);\n const fwNode = fwAdapter?.renderFrameworkIcon?.({ node, runner });\n const leadingAdapter = runner.adapters.resolveRowLeading(node, runner);\n const dur = node.duration || (hasChildren ? totalDuration(node) : 0);\n const live = !!node.running && !!node.started && !node.duration;\n const canRerun = !!runner.onRerun && node.framework !== \"task\";\n const canStop = !!runner.onStop && !!node.can_stop && !!node.task_id;\n const showMessage = status && (MESSAGE_STATUSES.has(status) || (node.framework === \"task\" && (status === \"running\" || status === \"pending\")));\n const message = showMessage ? (node.message ?? \"\").trim() : \"\";\n\n return (\n <>\n {outcome ? (\n <OutcomeIcon outcome={outcome} />\n ) : (\n <Icon icon={UiClass} className=\"shrink-0 text-muted-foreground\" />\n )}\n\n {fwNode != null ? (\n <span className=\"flex shrink-0 items-center text-sm\">{fwNode}</span>\n ) : (\n <ToolIcon tool={toolKeyFor(node)} className=\"text-sm\" />\n )}\n\n {leadingAdapter?.renderRowLeading?.({ node, runner })}\n\n <span\n className={cn(\n \"min-w-0 truncate\",\n selected ? \"font-semibold\" : \"font-medium\",\n (status && NAME_TONE[status]) || \"text-foreground\",\n )}\n title={message || undefined}\n >\n {runner.adapters.resolveRowLabel(node, runner) ?? humanizeName(node.name, node.framework)}\n </span>\n {/* The verdict trails the name on the same line and gives way first. */}\n {message ? (\n <span\n className=\"min-w-0 flex-1 shrink-[100] truncate text-xs text-muted-foreground\"\n title={message}\n data-row-message=\"\"\n >\n {message}\n </span>\n ) : (\n <span className=\"flex-1\" />\n )}\n\n {node.progress && (node.progress.total > 0 || node.progress.phase) && !node.passed && !node.failed && (\n <span className=\"flex min-w-0 items-center gap-1 text-xs text-blue-600 dark:text-blue-400\" data-row-progress=\"\">\n {node.progress.phase && <span className=\"truncate\" title={node.progress.phase}>{node.progress.phase}</span>}\n {node.progress.total > 0 && (\n <span className=\"shrink-0 tabular-nums\">\n {node.progress.done}/{node.progress.total}\n </span>\n )}\n </span>\n )}\n\n {live ? (\n <ElapsedDuration\n startedAt={node.started}\n finishedAt={undefined}\n format={(ms) => formatTestDuration(ms * 1e6)}\n className=\"shrink-0 text-xs text-muted-foreground\"\n />\n ) : (\n dur > 0 && <span className=\"shrink-0 text-xs text-muted-foreground\">{formatTestDuration(dur)}</span>\n )}\n\n {hasChildren && <CountBadges node={node} />}\n\n {canStop && (\n <IconButton\n icon={UiStop}\n label=\"Stop\"\n disabled={runner.busy.stop}\n onClick={(e) => {\n e.stopPropagation();\n runner.onStop!(node);\n }}\n />\n )}\n\n {canRerun && (\n <IconButton\n icon={UiRefresh}\n label=\"Rerun\"\n disabled={runner.busy.rerun}\n onClick={(e) => {\n e.stopPropagation();\n runner.onRerun!(node);\n }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,IAAM,YAAoC;CACxC,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;AACV;AAEA,IAAM,mCAAmB,IAAI,IAAI;CAAC;CAAU;CAAY;CAAU;CAAW;AAAS,CAAC;;;;;;;AAQvF,SAAS,YAAY,EAAE,QAAwB;CAC7C,MAAM,IAAIA,eAAAA,IAAI,IAAI;CAClB,IAAI,EAAE,UAAU,KAAK,EAAE,WAAW,EAAE,OAAO,OAAO;CAClD,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,QAAD;EAAM,WAAU;EAAhB,UAAA;GACG,EAAE,SAAS,KAAK,iBAAA,GAAA,kBAAA,IAAA,CAACC,cAAAA,OAAD;IAAO,MAAK;IAAU,SAAQ;IAAU,WAAU;IAAa,MAAK;IAAM,OAAO,EAAE;GAAS,CAAA;GAC5G,EAAE,SAAS,KAAK,iBAAA,GAAA,kBAAA,IAAA,CAACA,cAAAA,OAAD;IAAO,MAAK;IAAS,SAAQ;IAAU,WAAU;IAAa,MAAK;IAAM,OAAO,E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,MAAME,kBAAAA;GACN,OAAM;GACN,UAAU,OAAO,KAAK;GACtB,UAAU,MAAM;IACd,EAAE,gBAAgB;IAClB,OAAO,QAAS,IAAI;GACtB;EACD,CAAA;CAEH,EAAA,CAAA;AAEN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestTreeNode.d.ts","sourceRoot":"","sources":["../../../src/data/test-runner/TestTreeNode.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAiDpC;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,+
|
|
1
|
+
{"version":3,"file":"TestTreeNode.d.ts","sourceRoot":"","sources":["../../../src/data/test-runner/TestTreeNode.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAiDpC;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,+BAuGjF"}
|
|
@@ -148,10 +148,15 @@ function TestTreeNode({ node, selected }) {
|
|
|
148
148
|
"data-row-message": "",
|
|
149
149
|
children: message
|
|
150
150
|
}) : /* @__PURE__ */ jsx("span", { className: "flex-1" }),
|
|
151
|
-
node.progress && node.progress.total > 0 && !node.passed && !node.failed && /* @__PURE__ */ jsxs("span", {
|
|
152
|
-
className: "flex
|
|
153
|
-
|
|
154
|
-
|
|
151
|
+
node.progress && (node.progress.total > 0 || node.progress.phase) && !node.passed && !node.failed && /* @__PURE__ */ jsxs("span", {
|
|
152
|
+
className: "flex min-w-0 items-center gap-1 text-xs text-blue-600 dark:text-blue-400",
|
|
153
|
+
"data-row-progress": "",
|
|
154
|
+
children: [node.progress.phase && /* @__PURE__ */ jsx("span", {
|
|
155
|
+
className: "truncate",
|
|
156
|
+
title: node.progress.phase,
|
|
157
|
+
children: node.progress.phase
|
|
158
|
+
}), node.progress.total > 0 && /* @__PURE__ */ jsxs("span", {
|
|
159
|
+
className: "shrink-0 tabular-nums",
|
|
155
160
|
children: [
|
|
156
161
|
node.progress.done,
|
|
157
162
|
"/",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestTreeNode.js","names":["_Fragment"],"sources":["../../../src/data/test-runner/TestTreeNode.tsx"],"sourcesContent":["import { Icon } from \"../Icon\";\nimport { ElapsedDuration } from \"../ElapsedDuration\";\nimport { Badge } from \"../Badge\";\nimport { IconButton } from \"../../components/IconButton\";\nimport { UiClass, UiRefresh, UiStop } from \"../../icons\";\nimport { cn } from \"../../lib/utils\";\nimport type { Test } from \"./types\";\nimport { useTestRunner } from \"./context\";\nimport {\n formatTestDuration,\n humanizeName,\n outcomeFor,\n sum,\n testStatus,\n totalDuration,\n} from \"./status\";\nimport { toolKeyFor } from \"./marks\";\nimport { OutcomeIcon, ToolIcon } from \"./MarkIcons\";\n\nconst NAME_TONE: Record<string, string> = {\n failed: \"text-red-600 dark:text-red-400\",\n timedout: \"text-amber-600 dark:text-amber-400\",\n warned: \"text-amber-600 dark:text-amber-400\",\n aborted: \"text-muted-foreground\",\n running: \"text-blue-600 dark:text-blue-400\",\n skipped: \"text-muted-foreground\",\n pending: \"text-muted-foreground\",\n passed: \"text-foreground\",\n};\n\nconst MESSAGE_STATUSES = new Set([\"failed\", \"timedout\", \"warned\", \"aborted\", \"skipped\"]);\n\n/**\n * Per-status roll-up count badges shown on a container row. A roll-up that is\n * all passed shows none: the row's green outcome icon already says so, and a\n * lone green count only repeats it. The passed count shows beside any other\n * status.\n */\nfunction CountBadges({ node }: { node: Test }) {\n const s = sum(node);\n if (s.total === 0 || s.passed === s.total) return null;\n return (\n <span className=\"flex shrink-0 items-center gap-1\">\n {s.passed > 0 && <Badge tone=\"success\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.passed} />}\n {s.failed > 0 && <Badge tone=\"danger\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.failed} />}\n {s.warned > 0 && <Badge tone=\"warning\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.warned} />}\n {s.timedout > 0 && <Badge tone=\"danger\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.timedout} />}\n {s.aborted > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.aborted} />}\n {s.skipped > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.skipped} />}\n {s.running > 0 && <Badge tone=\"info\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.running} />}\n {s.pending > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.pending} />}\n </span>\n );\n}\n\n/**\n * Renders one test tree row: status icon, optional adapter decoration + framework\n * icon, status-colored name, duration, per-status count badges, and (when the\n * runner exposes the handlers) rerun/stop buttons. Designed as the `renderRow`\n * for the clicky `Tree`.\n */\nexport function TestTreeNode({ node, selected }: { node: Test; selected: boolean }) {\n const runner = useTestRunner();\n const hasChildren = (node.children?.length ?? 0) > 0;\n const status = testStatus(node);\n const outcome = outcomeFor(node);\n const fwAdapter = runner.adapters.resolveFrameworkIcon(node, runner);\n const fwNode = fwAdapter?.renderFrameworkIcon?.({ node, runner });\n const leadingAdapter = runner.adapters.resolveRowLeading(node, runner);\n const dur = node.duration || (hasChildren ? totalDuration(node) : 0);\n const live = !!node.running && !!node.started && !node.duration;\n const canRerun = !!runner.onRerun && node.framework !== \"task\";\n const canStop = !!runner.onStop && !!node.can_stop && !!node.task_id;\n const showMessage = status && (MESSAGE_STATUSES.has(status) || (node.framework === \"task\" && (status === \"running\" || status === \"pending\")));\n const message = showMessage ? (node.message ?? \"\").trim() : \"\";\n\n return (\n <>\n {outcome ? (\n <OutcomeIcon outcome={outcome} />\n ) : (\n <Icon icon={UiClass} className=\"shrink-0 text-muted-foreground\" />\n )}\n\n {fwNode != null ? (\n <span className=\"flex shrink-0 items-center text-sm\">{fwNode}</span>\n ) : (\n <ToolIcon tool={toolKeyFor(node)} className=\"text-sm\" />\n )}\n\n {leadingAdapter?.renderRowLeading?.({ node, runner })}\n\n <span\n className={cn(\n \"min-w-0 truncate\",\n selected ? \"font-semibold\" : \"font-medium\",\n (status && NAME_TONE[status]) || \"text-foreground\",\n )}\n title={message || undefined}\n >\n {runner.adapters.resolveRowLabel(node, runner) ?? humanizeName(node.name, node.framework)}\n </span>\n {/* The verdict trails the name on the same line and gives way first. */}\n {message ? (\n <span\n className=\"min-w-0 flex-1 shrink-[100] truncate text-xs text-muted-foreground\"\n title={message}\n data-row-message=\"\"\n >\n {message}\n </span>\n ) : (\n <span className=\"flex-1\" />\n )}\n\n {node.progress && node.progress.total > 0 && !node.passed && !node.failed && (\n <span className=\"flex
|
|
1
|
+
{"version":3,"file":"TestTreeNode.js","names":["_Fragment"],"sources":["../../../src/data/test-runner/TestTreeNode.tsx"],"sourcesContent":["import { Icon } from \"../Icon\";\nimport { ElapsedDuration } from \"../ElapsedDuration\";\nimport { Badge } from \"../Badge\";\nimport { IconButton } from \"../../components/IconButton\";\nimport { UiClass, UiRefresh, UiStop } from \"../../icons\";\nimport { cn } from \"../../lib/utils\";\nimport type { Test } from \"./types\";\nimport { useTestRunner } from \"./context\";\nimport {\n formatTestDuration,\n humanizeName,\n outcomeFor,\n sum,\n testStatus,\n totalDuration,\n} from \"./status\";\nimport { toolKeyFor } from \"./marks\";\nimport { OutcomeIcon, ToolIcon } from \"./MarkIcons\";\n\nconst NAME_TONE: Record<string, string> = {\n failed: \"text-red-600 dark:text-red-400\",\n timedout: \"text-amber-600 dark:text-amber-400\",\n warned: \"text-amber-600 dark:text-amber-400\",\n aborted: \"text-muted-foreground\",\n running: \"text-blue-600 dark:text-blue-400\",\n skipped: \"text-muted-foreground\",\n pending: \"text-muted-foreground\",\n passed: \"text-foreground\",\n};\n\nconst MESSAGE_STATUSES = new Set([\"failed\", \"timedout\", \"warned\", \"aborted\", \"skipped\"]);\n\n/**\n * Per-status roll-up count badges shown on a container row. A roll-up that is\n * all passed shows none: the row's green outcome icon already says so, and a\n * lone green count only repeats it. The passed count shows beside any other\n * status.\n */\nfunction CountBadges({ node }: { node: Test }) {\n const s = sum(node);\n if (s.total === 0 || s.passed === s.total) return null;\n return (\n <span className=\"flex shrink-0 items-center gap-1\">\n {s.passed > 0 && <Badge tone=\"success\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.passed} />}\n {s.failed > 0 && <Badge tone=\"danger\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.failed} />}\n {s.warned > 0 && <Badge tone=\"warning\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.warned} />}\n {s.timedout > 0 && <Badge tone=\"danger\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.timedout} />}\n {s.aborted > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.aborted} />}\n {s.skipped > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.skipped} />}\n {s.running > 0 && <Badge tone=\"info\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.running} />}\n {s.pending > 0 && <Badge tone=\"neutral\" variant=\"outline\" className=\"rounded-sm\" size=\"xxs\" count={s.pending} />}\n </span>\n );\n}\n\n/**\n * Renders one test tree row: status icon, optional adapter decoration + framework\n * icon, status-colored name, duration, per-status count badges, and (when the\n * runner exposes the handlers) rerun/stop buttons. Designed as the `renderRow`\n * for the clicky `Tree`.\n */\nexport function TestTreeNode({ node, selected }: { node: Test; selected: boolean }) {\n const runner = useTestRunner();\n const hasChildren = (node.children?.length ?? 0) > 0;\n const status = testStatus(node);\n const outcome = outcomeFor(node);\n const fwAdapter = runner.adapters.resolveFrameworkIcon(node, runner);\n const fwNode = fwAdapter?.renderFrameworkIcon?.({ node, runner });\n const leadingAdapter = runner.adapters.resolveRowLeading(node, runner);\n const dur = node.duration || (hasChildren ? totalDuration(node) : 0);\n const live = !!node.running && !!node.started && !node.duration;\n const canRerun = !!runner.onRerun && node.framework !== \"task\";\n const canStop = !!runner.onStop && !!node.can_stop && !!node.task_id;\n const showMessage = status && (MESSAGE_STATUSES.has(status) || (node.framework === \"task\" && (status === \"running\" || status === \"pending\")));\n const message = showMessage ? (node.message ?? \"\").trim() : \"\";\n\n return (\n <>\n {outcome ? (\n <OutcomeIcon outcome={outcome} />\n ) : (\n <Icon icon={UiClass} className=\"shrink-0 text-muted-foreground\" />\n )}\n\n {fwNode != null ? (\n <span className=\"flex shrink-0 items-center text-sm\">{fwNode}</span>\n ) : (\n <ToolIcon tool={toolKeyFor(node)} className=\"text-sm\" />\n )}\n\n {leadingAdapter?.renderRowLeading?.({ node, runner })}\n\n <span\n className={cn(\n \"min-w-0 truncate\",\n selected ? \"font-semibold\" : \"font-medium\",\n (status && NAME_TONE[status]) || \"text-foreground\",\n )}\n title={message || undefined}\n >\n {runner.adapters.resolveRowLabel(node, runner) ?? humanizeName(node.name, node.framework)}\n </span>\n {/* The verdict trails the name on the same line and gives way first. */}\n {message ? (\n <span\n className=\"min-w-0 flex-1 shrink-[100] truncate text-xs text-muted-foreground\"\n title={message}\n data-row-message=\"\"\n >\n {message}\n </span>\n ) : (\n <span className=\"flex-1\" />\n )}\n\n {node.progress && (node.progress.total > 0 || node.progress.phase) && !node.passed && !node.failed && (\n <span className=\"flex min-w-0 items-center gap-1 text-xs text-blue-600 dark:text-blue-400\" data-row-progress=\"\">\n {node.progress.phase && <span className=\"truncate\" title={node.progress.phase}>{node.progress.phase}</span>}\n {node.progress.total > 0 && (\n <span className=\"shrink-0 tabular-nums\">\n {node.progress.done}/{node.progress.total}\n </span>\n )}\n </span>\n )}\n\n {live ? (\n <ElapsedDuration\n startedAt={node.started}\n finishedAt={undefined}\n format={(ms) => formatTestDuration(ms * 1e6)}\n className=\"shrink-0 text-xs text-muted-foreground\"\n />\n ) : (\n dur > 0 && <span className=\"shrink-0 text-xs text-muted-foreground\">{formatTestDuration(dur)}</span>\n )}\n\n {hasChildren && <CountBadges node={node} />}\n\n {canStop && (\n <IconButton\n icon={UiStop}\n label=\"Stop\"\n disabled={runner.busy.stop}\n onClick={(e) => {\n e.stopPropagation();\n runner.onStop!(node);\n }}\n />\n )}\n\n {canRerun && (\n <IconButton\n icon={UiRefresh}\n label=\"Rerun\"\n disabled={runner.busy.rerun}\n onClick={(e) => {\n e.stopPropagation();\n runner.onRerun!(node);\n }}\n />\n )}\n </>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAmBA,IAAM,YAAoC;CACxC,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,QAAQ;AACV;AAEA,IAAM,mCAAmB,IAAI,IAAI;CAAC;CAAU;CAAY;CAAU;CAAW;AAAS,CAAC;;;;;;;AAQvF,SAAS,YAAY,EAAE,QAAwB;CAC7C,MAAM,IAAI,IAAI,IAAI;CAClB,IAAI,EAAE,UAAU,KAAK,EAAE,WAAW,EAAE,OAAO,OAAO;CAClD,OACE,qBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA;GACG,EAAE,SAAS,KAAK,oBAAC,OAAD;IAAO,MAAK;IAAU,SAAQ;IAAU,WAAU;IAAa,MAAK;IAAM,OAAO,EAAE;GAAS,CAAA;GAC5G,EAAE,SAAS,KAAK,oBAAC,OAAD;IAAO,MAAK;IAAS,SAAQ;IAAU,WAAU;IAAa,MAAK;IAAM,OAAO,EAAE;GAAS,CAAA;GAC3G,EAAE,SAAS,KAAK,oBAAC,OAAD;IAAO,MAAK;IAAU,SAAQ;IAAU,WAAU;IAAa,MAAK;IAAM,OAAO,EAAE;GAAS,CAAA;GAC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B,KAAK,GAAG;GAC3C,WAAU;EACX,CAAA,IAED,MAAM,KAAK,oBAAC,QAAD;GAAM,WAAU;GAA0C,UAAA,mBAAmB,GAAG;EAAQ,CAAA;EAGpG,eAAe,oBAAC,aAAD,EAAmB,KAAO,CAAA;EAEzC,WACC,oBAAC,YAAD;GACE,MAAM;GACN,OAAM;GACN,UAAU,OAAO,KAAK;GACtB,UAAU,MAAM;IACd,EAAE,gBAAgB;IAClB,OAAO,OAAQ,IAAI;GACrB;EACD,CAAA;EAGF,YACC,oBAAC,YAAD;GACE,MAAM;GACN,OAAM;GACN,UAAU,OAAO,KAAK;GACtB,UAAU,MAAM;IACd,EAAE,gBAAgB;IAClB,OAAO,QAAS,IAAI;GACtB;EACD,CAAA;CAEH,EAAA,CAAA;AAEN"}
|
|
@@ -19,7 +19,7 @@ function isAttemptLive(attempt) {
|
|
|
19
19
|
* detail only describes the final result, so only the last attempt keeps it.
|
|
20
20
|
*/
|
|
21
21
|
function attemptTest(test, attempt, isLast) {
|
|
22
|
-
const { passed: _passed, failed: _failed, skipped: _skipped, warned: _warned, aborted: _aborted, pending: _pending, running: _running, timed_out: _timedOut, failure_detail: failureDetail, message: _message, stdout: _stdout, stderr: _stderr, duration: _duration, ...identity } = test;
|
|
22
|
+
const { passed: _passed, failed: _failed, skipped: _skipped, warned: _warned, aborted: _aborted, pending: _pending, running: _running, timed_out: _timedOut, failure_detail: failureDetail, message: _message, stdout: _stdout, stderr: _stderr, log: _log, duration: _duration, ...identity } = test;
|
|
23
23
|
const status = attemptStatus(attempt);
|
|
24
24
|
return {
|
|
25
25
|
...identity,
|
|
@@ -32,6 +32,7 @@ function attemptTest(test, attempt, isLast) {
|
|
|
32
32
|
...attempt.message !== void 0 ? { message: attempt.message } : {},
|
|
33
33
|
...attempt.stdout !== void 0 ? { stdout: attempt.stdout } : {},
|
|
34
34
|
...attempt.stderr !== void 0 ? { stderr: attempt.stderr } : {},
|
|
35
|
+
...attempt.log !== void 0 ? { log: attempt.log } : {},
|
|
35
36
|
...attempt.duration !== void 0 ? { duration: attempt.duration } : {},
|
|
36
37
|
...attempt.command !== void 0 ? { command: attempt.command } : {},
|
|
37
38
|
...isLast && failureDetail ? { failure_detail: failureDetail } : {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attempts.cjs","names":[],"sources":["../../../src/data/test-runner/attempts.ts"],"sourcesContent":["import type { DetailAttempt } from \"./adapter\";\nimport type { Test, TestAttempt } from \"./types\";\n\nexport type AttemptStatus = \"timedout\" | \"failed\" | \"skipped\" | \"passed\" | \"pending\" | \"running\";\n\n/** An attempt's single status; one with no verdict flag and not queued is still running. */\nexport function attemptStatus(attempt: TestAttempt): AttemptStatus {\n if (attempt.timed_out) return \"timedout\";\n if (attempt.failed) return \"failed\";\n if (attempt.skipped) return \"skipped\";\n if (attempt.passed) return \"passed\";\n if (attempt.pending) return \"pending\";\n return \"running\";\n}\n\n/** The attempt has started and has no verdict yet, so its process can still be read live. */\nexport function isAttemptLive(attempt: TestAttempt): boolean {\n const status = attemptStatus(attempt);\n return status === \"running\" || status === \"pending\";\n}\n\n/**\n * The test as one attempt saw it: the attempt's verdict, output and duration\n * over the test's identity, with `attempts` narrowed to that attempt. A failure\n * detail only describes the final result, so only the last attempt keeps it.\n */\nfunction attemptTest(test: Test, attempt: TestAttempt, isLast: boolean): Test {\n const {\n passed: _passed,\n failed: _failed,\n skipped: _skipped,\n warned: _warned,\n aborted: _aborted,\n pending: _pending,\n running: _running,\n timed_out: _timedOut,\n failure_detail: failureDetail,\n message: _message,\n stdout: _stdout,\n stderr: _stderr,\n duration: _duration,\n ...identity\n } = test;\n const status = attemptStatus(attempt);\n return {\n ...identity,\n ...(status === \"timedout\" ? { timed_out: true } : {}),\n ...(status === \"failed\" ? { failed: true } : {}),\n ...(status === \"skipped\" ? { skipped: true } : {}),\n ...(status === \"passed\" ? { passed: true } : {}),\n ...(status === \"pending\" ? { pending: true } : {}),\n ...(status === \"running\" ? { running: true } : {}),\n ...(attempt.message !== undefined ? { message: attempt.message } : {}),\n ...(attempt.stdout !== undefined ? { stdout: attempt.stdout } : {}),\n ...(attempt.stderr !== undefined ? { stderr: attempt.stderr } : {}),\n ...(attempt.duration !== undefined ? { duration: attempt.duration } : {}),\n ...(attempt.command !== undefined ? { command: attempt.command } : {}),\n ...(isLast && failureDetail ? { failure_detail: failureDetail } : {}),\n attempts: [attempt],\n };\n}\n\n/**\n * The attempts of `test.attempts` as chooser entries, numbered from 1 in the\n * order they ran. Empty when the test has none.\n */\nexport function testAttemptViews(test: Test): DetailAttempt[] {\n const attempts = test.attempts ?? [];\n return attempts.map((attempt, index) => ({\n id: index + 1,\n status: attemptStatus(attempt),\n ...(attempt.duration !== undefined && attempt.duration > 0 ? { durationMs: attempt.duration / 1e6 } : {}),\n node: attemptTest(test, attempt, index === attempts.length - 1),\n }));\n}\n"],"mappings":";;AAMA,SAAgB,cAAc,SAAqC;CACjE,IAAI,QAAQ,WAAW,OAAO;CAC9B,IAAI,QAAQ,QAAQ,OAAO;CAC3B,IAAI,QAAQ,SAAS,OAAO;CAC5B,IAAI,QAAQ,QAAQ,OAAO;CAC3B,IAAI,QAAQ,SAAS,OAAO;CAC5B,OAAO;AACT;;AAGA,SAAgB,cAAc,SAA+B;CAC3D,MAAM,SAAS,cAAc,OAAO;CACpC,OAAO,WAAW,aAAa,WAAW;AAC5C;;;;;;AAOA,SAAS,YAAY,MAAY,SAAsB,QAAuB;CAC5E,MAAM,EACJ,QAAQ,SACR,QAAQ,SACR,SAAS,UACT,QAAQ,SACR,SAAS,UACT,SAAS,UACT,SAAS,UACT,WAAW,WACX,gBAAgB,eAChB,SAAS,UACT,QAAQ,SACR,QAAQ,SACR,UAAU,WACV,GAAG,aACD;CACJ,MAAM,SAAS,cAAc,OAAO;CACpC,OAAO;EACL,GAAG;EACH,GAAI,WAAW,aAAa,EAAE,WAAW,KAAK,IAAI,CAAC;EACnD,GAAI,WAAW,WAAW,EAAE,QAAQ,KAAK,IAAI,CAAC;EAC9C,GAAI,WAAW,YAAY,EAAE,SAAS,KAAK,IAAI,CAAC;EAChD,GAAI,WAAW,WAAW,EAAE,QAAQ,KAAK,IAAI,CAAC;EAC9C,GAAI,WAAW,YAAY,EAAE,SAAS,KAAK,IAAI,CAAC;EAChD,GAAI,WAAW,YAAY,EAAE,SAAS,KAAK,IAAI,CAAC;EAChD,GAAI,QAAQ,YAAY,KAAA,IAAY,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EACpE,GAAI,QAAQ,WAAW,KAAA,IAAY,EAAE,QAAQ,QAAQ,OAAO,IAAI,CAAC;EACjE,GAAI,QAAQ,WAAW,KAAA,IAAY,EAAE,QAAQ,QAAQ,OAAO,IAAI,CAAC;EACjE,GAAI,QAAQ,aAAa,KAAA,IAAY,EAAE,UAAU,QAAQ,SAAS,IAAI,CAAC;EACvE,GAAI,QAAQ,YAAY,KAAA,IAAY,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EACpE,GAAI,UAAU,gBAAgB,EAAE,gBAAgB,cAAc,IAAI,CAAC;EACnE,UAAU,CAAC,OAAO;CACpB;AACF;;;;;AAMA,SAAgB,iBAAiB,MAA6B;CAC5D,MAAM,WAAW,KAAK,YAAY,CAAC;CACnC,OAAO,SAAS,KAAK,SAAS,WAAW;EACvC,IAAI,QAAQ;EACZ,QAAQ,cAAc,OAAO;EAC7B,GAAI,QAAQ,aAAa,KAAA,KAAa,QAAQ,WAAW,IAAI,EAAE,YAAY,QAAQ,WAAW,IAAI,IAAI,CAAC;EACvG,MAAM,YAAY,MAAM,SAAS,UAAU,SAAS,SAAS,CAAC;CAChE,EAAE;AACJ"}
|
|
1
|
+
{"version":3,"file":"attempts.cjs","names":[],"sources":["../../../src/data/test-runner/attempts.ts"],"sourcesContent":["import type { DetailAttempt } from \"./adapter\";\nimport type { Test, TestAttempt } from \"./types\";\n\nexport type AttemptStatus = \"timedout\" | \"failed\" | \"skipped\" | \"passed\" | \"pending\" | \"running\";\n\n/** An attempt's single status; one with no verdict flag and not queued is still running. */\nexport function attemptStatus(attempt: TestAttempt): AttemptStatus {\n if (attempt.timed_out) return \"timedout\";\n if (attempt.failed) return \"failed\";\n if (attempt.skipped) return \"skipped\";\n if (attempt.passed) return \"passed\";\n if (attempt.pending) return \"pending\";\n return \"running\";\n}\n\n/** The attempt has started and has no verdict yet, so its process can still be read live. */\nexport function isAttemptLive(attempt: TestAttempt): boolean {\n const status = attemptStatus(attempt);\n return status === \"running\" || status === \"pending\";\n}\n\n/**\n * The test as one attempt saw it: the attempt's verdict, output and duration\n * over the test's identity, with `attempts` narrowed to that attempt. A failure\n * detail only describes the final result, so only the last attempt keeps it.\n */\nfunction attemptTest(test: Test, attempt: TestAttempt, isLast: boolean): Test {\n const {\n passed: _passed,\n failed: _failed,\n skipped: _skipped,\n warned: _warned,\n aborted: _aborted,\n pending: _pending,\n running: _running,\n timed_out: _timedOut,\n failure_detail: failureDetail,\n message: _message,\n stdout: _stdout,\n stderr: _stderr,\n log: _log,\n duration: _duration,\n ...identity\n } = test;\n const status = attemptStatus(attempt);\n return {\n ...identity,\n ...(status === \"timedout\" ? { timed_out: true } : {}),\n ...(status === \"failed\" ? { failed: true } : {}),\n ...(status === \"skipped\" ? { skipped: true } : {}),\n ...(status === \"passed\" ? { passed: true } : {}),\n ...(status === \"pending\" ? { pending: true } : {}),\n ...(status === \"running\" ? { running: true } : {}),\n ...(attempt.message !== undefined ? { message: attempt.message } : {}),\n ...(attempt.stdout !== undefined ? { stdout: attempt.stdout } : {}),\n ...(attempt.stderr !== undefined ? { stderr: attempt.stderr } : {}),\n ...(attempt.log !== undefined ? { log: attempt.log } : {}),\n ...(attempt.duration !== undefined ? { duration: attempt.duration } : {}),\n ...(attempt.command !== undefined ? { command: attempt.command } : {}),\n ...(isLast && failureDetail ? { failure_detail: failureDetail } : {}),\n attempts: [attempt],\n };\n}\n\n/**\n * The attempts of `test.attempts` as chooser entries, numbered from 1 in the\n * order they ran. Empty when the test has none.\n */\nexport function testAttemptViews(test: Test): DetailAttempt[] {\n const attempts = test.attempts ?? [];\n return attempts.map((attempt, index) => ({\n id: index + 1,\n status: attemptStatus(attempt),\n ...(attempt.duration !== undefined && attempt.duration > 0 ? { durationMs: attempt.duration / 1e6 } : {}),\n node: attemptTest(test, attempt, index === attempts.length - 1),\n }));\n}\n"],"mappings":";;AAMA,SAAgB,cAAc,SAAqC;CACjE,IAAI,QAAQ,WAAW,OAAO;CAC9B,IAAI,QAAQ,QAAQ,OAAO;CAC3B,IAAI,QAAQ,SAAS,OAAO;CAC5B,IAAI,QAAQ,QAAQ,OAAO;CAC3B,IAAI,QAAQ,SAAS,OAAO;CAC5B,OAAO;AACT;;AAGA,SAAgB,cAAc,SAA+B;CAC3D,MAAM,SAAS,cAAc,OAAO;CACpC,OAAO,WAAW,aAAa,WAAW;AAC5C;;;;;;AAOA,SAAS,YAAY,MAAY,SAAsB,QAAuB;CAC5E,MAAM,EACJ,QAAQ,SACR,QAAQ,SACR,SAAS,UACT,QAAQ,SACR,SAAS,UACT,SAAS,UACT,SAAS,UACT,WAAW,WACX,gBAAgB,eAChB,SAAS,UACT,QAAQ,SACR,QAAQ,SACR,KAAK,MACL,UAAU,WACV,GAAG,aACD;CACJ,MAAM,SAAS,cAAc,OAAO;CACpC,OAAO;EACL,GAAG;EACH,GAAI,WAAW,aAAa,EAAE,WAAW,KAAK,IAAI,CAAC;EACnD,GAAI,WAAW,WAAW,EAAE,QAAQ,KAAK,IAAI,CAAC;EAC9C,GAAI,WAAW,YAAY,EAAE,SAAS,KAAK,IAAI,CAAC;EAChD,GAAI,WAAW,WAAW,EAAE,QAAQ,KAAK,IAAI,CAAC;EAC9C,GAAI,WAAW,YAAY,EAAE,SAAS,KAAK,IAAI,CAAC;EAChD,GAAI,WAAW,YAAY,EAAE,SAAS,KAAK,IAAI,CAAC;EAChD,GAAI,QAAQ,YAAY,KAAA,IAAY,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EACpE,GAAI,QAAQ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,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAG3D;
|
|
1
|
+
{"version":3,"file":"attempts.d.ts","sourceRoot":"","sources":["../../../src/data/test-runner/attempts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEjD,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAEjG,4FAA4F;AAC5F,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,aAAa,CAOjE;AAED,6FAA6F;AAC7F,wBAAgB,aAAa,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAG3D;AA6CD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,IAAI,GAAG,aAAa,EAAE,CAQ5D"}
|
|
@@ -19,7 +19,7 @@ function isAttemptLive(attempt) {
|
|
|
19
19
|
* detail only describes the final result, so only the last attempt keeps it.
|
|
20
20
|
*/
|
|
21
21
|
function attemptTest(test, attempt, isLast) {
|
|
22
|
-
const { passed: _passed, failed: _failed, skipped: _skipped, warned: _warned, aborted: _aborted, pending: _pending, running: _running, timed_out: _timedOut, failure_detail: failureDetail, message: _message, stdout: _stdout, stderr: _stderr, duration: _duration, ...identity } = test;
|
|
22
|
+
const { passed: _passed, failed: _failed, skipped: _skipped, warned: _warned, aborted: _aborted, pending: _pending, running: _running, timed_out: _timedOut, failure_detail: failureDetail, message: _message, stdout: _stdout, stderr: _stderr, log: _log, duration: _duration, ...identity } = test;
|
|
23
23
|
const status = attemptStatus(attempt);
|
|
24
24
|
return {
|
|
25
25
|
...identity,
|
|
@@ -32,6 +32,7 @@ function attemptTest(test, attempt, isLast) {
|
|
|
32
32
|
...attempt.message !== void 0 ? { message: attempt.message } : {},
|
|
33
33
|
...attempt.stdout !== void 0 ? { stdout: attempt.stdout } : {},
|
|
34
34
|
...attempt.stderr !== void 0 ? { stderr: attempt.stderr } : {},
|
|
35
|
+
...attempt.log !== void 0 ? { log: attempt.log } : {},
|
|
35
36
|
...attempt.duration !== void 0 ? { duration: attempt.duration } : {},
|
|
36
37
|
...attempt.command !== void 0 ? { command: attempt.command } : {},
|
|
37
38
|
...isLast && failureDetail ? { failure_detail: failureDetail } : {},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"attempts.js","names":[],"sources":["../../../src/data/test-runner/attempts.ts"],"sourcesContent":["import type { DetailAttempt } from \"./adapter\";\nimport type { Test, TestAttempt } from \"./types\";\n\nexport type AttemptStatus = \"timedout\" | \"failed\" | \"skipped\" | \"passed\" | \"pending\" | \"running\";\n\n/** An attempt's single status; one with no verdict flag and not queued is still running. */\nexport function attemptStatus(attempt: TestAttempt): AttemptStatus {\n if (attempt.timed_out) return \"timedout\";\n if (attempt.failed) return \"failed\";\n if (attempt.skipped) return \"skipped\";\n if (attempt.passed) return \"passed\";\n if (attempt.pending) return \"pending\";\n return \"running\";\n}\n\n/** The attempt has started and has no verdict yet, so its process can still be read live. */\nexport function isAttemptLive(attempt: TestAttempt): boolean {\n const status = attemptStatus(attempt);\n return status === \"running\" || status === \"pending\";\n}\n\n/**\n * The test as one attempt saw it: the attempt's verdict, output and duration\n * over the test's identity, with `attempts` narrowed to that attempt. A failure\n * detail only describes the final result, so only the last attempt keeps it.\n */\nfunction attemptTest(test: Test, attempt: TestAttempt, isLast: boolean): Test {\n const {\n passed: _passed,\n failed: _failed,\n skipped: _skipped,\n warned: _warned,\n aborted: _aborted,\n pending: _pending,\n running: _running,\n timed_out: _timedOut,\n failure_detail: failureDetail,\n message: _message,\n stdout: _stdout,\n stderr: _stderr,\n duration: _duration,\n ...identity\n } = test;\n const status = attemptStatus(attempt);\n return {\n ...identity,\n ...(status === \"timedout\" ? { timed_out: true } : {}),\n ...(status === \"failed\" ? { failed: true } : {}),\n ...(status === \"skipped\" ? { skipped: true } : {}),\n ...(status === \"passed\" ? { passed: true } : {}),\n ...(status === \"pending\" ? { pending: true } : {}),\n ...(status === \"running\" ? { running: true } : {}),\n ...(attempt.message !== undefined ? { message: attempt.message } : {}),\n ...(attempt.stdout !== undefined ? { stdout: attempt.stdout } : {}),\n ...(attempt.stderr !== undefined ? { stderr: attempt.stderr } : {}),\n ...(attempt.duration !== undefined ? { duration: attempt.duration } : {}),\n ...(attempt.command !== undefined ? { command: attempt.command } : {}),\n ...(isLast && failureDetail ? { failure_detail: failureDetail } : {}),\n attempts: [attempt],\n };\n}\n\n/**\n * The attempts of `test.attempts` as chooser entries, numbered from 1 in the\n * order they ran. Empty when the test has none.\n */\nexport function testAttemptViews(test: Test): DetailAttempt[] {\n const attempts = test.attempts ?? [];\n return attempts.map((attempt, index) => ({\n id: index + 1,\n status: attemptStatus(attempt),\n ...(attempt.duration !== undefined && attempt.duration > 0 ? { durationMs: attempt.duration / 1e6 } : {}),\n node: attemptTest(test, attempt, index === attempts.length - 1),\n }));\n}\n"],"mappings":";;AAMA,SAAgB,cAAc,SAAqC;CACjE,IAAI,QAAQ,WAAW,OAAO;CAC9B,IAAI,QAAQ,QAAQ,OAAO;CAC3B,IAAI,QAAQ,SAAS,OAAO;CAC5B,IAAI,QAAQ,QAAQ,OAAO;CAC3B,IAAI,QAAQ,SAAS,OAAO;CAC5B,OAAO;AACT;;AAGA,SAAgB,cAAc,SAA+B;CAC3D,MAAM,SAAS,cAAc,OAAO;CACpC,OAAO,WAAW,aAAa,WAAW;AAC5C;;;;;;AAOA,SAAS,YAAY,MAAY,SAAsB,QAAuB;CAC5E,MAAM,EACJ,QAAQ,SACR,QAAQ,SACR,SAAS,UACT,QAAQ,SACR,SAAS,UACT,SAAS,UACT,SAAS,UACT,WAAW,WACX,gBAAgB,eAChB,SAAS,UACT,QAAQ,SACR,QAAQ,SACR,UAAU,WACV,GAAG,aACD;CACJ,MAAM,SAAS,cAAc,OAAO;CACpC,OA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from \"./adapter\";\nimport type { Test, TestAttempt } from \"./types\";\n\nexport type AttemptStatus = \"timedout\" | \"failed\" | \"skipped\" | \"passed\" | \"pending\" | \"running\";\n\n/** An attempt's single status; one with no verdict flag and not queued is still running. */\nexport function attemptStatus(attempt: TestAttempt): AttemptStatus {\n if (attempt.timed_out) return \"timedout\";\n if (attempt.failed) return \"failed\";\n if (attempt.skipped) return \"skipped\";\n if (attempt.passed) return \"passed\";\n if (attempt.pending) return \"pending\";\n return \"running\";\n}\n\n/** The attempt has started and has no verdict yet, so its process can still be read live. */\nexport function isAttemptLive(attempt: TestAttempt): boolean {\n const status = attemptStatus(attempt);\n return status === \"running\" || status === \"pending\";\n}\n\n/**\n * The test as one attempt saw it: the attempt's verdict, output and duration\n * over the test's identity, with `attempts` narrowed to that attempt. A failure\n * detail only describes the final result, so only the last attempt keeps it.\n */\nfunction attemptTest(test: Test, attempt: TestAttempt, isLast: boolean): Test {\n const {\n passed: _passed,\n failed: _failed,\n skipped: _skipped,\n warned: _warned,\n aborted: _aborted,\n pending: _pending,\n running: _running,\n timed_out: _timedOut,\n failure_detail: failureDetail,\n message: _message,\n stdout: _stdout,\n stderr: _stderr,\n log: _log,\n duration: _duration,\n ...identity\n } = test;\n const status = attemptStatus(attempt);\n return {\n ...identity,\n ...(status === \"timedout\" ? { timed_out: true } : {}),\n ...(status === \"failed\" ? { failed: true } : {}),\n ...(status === \"skipped\" ? { skipped: true } : {}),\n ...(status === \"passed\" ? { passed: true } : {}),\n ...(status === \"pending\" ? { pending: true } : {}),\n ...(status === \"running\" ? { running: true } : {}),\n ...(attempt.message !== undefined ? { message: attempt.message } : {}),\n ...(attempt.stdout !== undefined ? { stdout: attempt.stdout } : {}),\n ...(attempt.stderr !== undefined ? { stderr: attempt.stderr } : {}),\n ...(attempt.log !== undefined ? { log: attempt.log } : {}),\n ...(attempt.duration !== undefined ? { duration: attempt.duration } : {}),\n ...(attempt.command !== undefined ? { command: attempt.command } : {}),\n ...(isLast && failureDetail ? { failure_detail: failureDetail } : {}),\n attempts: [attempt],\n };\n}\n\n/**\n * The attempts of `test.attempts` as chooser entries, numbered from 1 in the\n * order they ran. Empty when the test has none.\n */\nexport function testAttemptViews(test: Test): DetailAttempt[] {\n const attempts = test.attempts ?? [];\n return attempts.map((attempt, index) => ({\n id: index + 1,\n status: attemptStatus(attempt),\n ...(attempt.duration !== undefined && attempt.duration > 0 ? { durationMs: attempt.duration / 1e6 } : {}),\n node: attemptTest(test, attempt, index === attempts.length - 1),\n }));\n}\n"],"mappings":";;AAMA,SAAgB,cAAc,SAAqC;CACjE,IAAI,QAAQ,WAAW,OAAO;CAC9B,IAAI,QAAQ,QAAQ,OAAO;CAC3B,IAAI,QAAQ,SAAS,OAAO;CAC5B,IAAI,QAAQ,QAAQ,OAAO;CAC3B,IAAI,QAAQ,SAAS,OAAO;CAC5B,OAAO;AACT;;AAGA,SAAgB,cAAc,SAA+B;CAC3D,MAAM,SAAS,cAAc,OAAO;CACpC,OAAO,WAAW,aAAa,WAAW;AAC5C;;;;;;AAOA,SAAS,YAAY,MAAY,SAAsB,QAAuB;CAC5E,MAAM,EACJ,QAAQ,SACR,QAAQ,SACR,SAAS,UACT,QAAQ,SACR,SAAS,UACT,SAAS,UACT,SAAS,UACT,WAAW,WACX,gBAAgB,eAChB,SAAS,UACT,QAAQ,SACR,QAAQ,SACR,KAAK,MACL,UAAU,WACV,GAAG,aACD;CACJ,MAAM,SAAS,cAAc,OAAO;CACpC,OAAO;EACL,GAAG;EACH,GAAI,WAAW,aAAa,EAAE,WAAW,KAAK,IAAI,CAAC;EACnD,GAAI,WAAW,WAAW,EAAE,QAAQ,KAAK,IAAI,CAAC;EAC9C,GAAI,WAAW,YAAY,EAAE,SAAS,KAAK,IAAI,CAAC;EAChD,GAAI,WAAW,WAAW,EAAE,QAAQ,KAAK,IAAI,CAAC;EAC9C,GAAI,WAAW,YAAY,EAAE,SAAS,KAAK,IAAI,CAAC;EAChD,GAAI,WAAW,YAAY,EAAE,SAAS,KAAK,IAAI,CAAC;EAChD,GAAI,QAAQ,YAAY,KAAA,IAAY,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EACpE,GAAI,QAAQ,WAAW,KAAA,IAAY,EAAE,QAAQ,QAAQ,OAAO,IAAI,CAAC;EACjE,GAAI,QAAQ,WAAW,KAAA,IAAY,EAAE,QAAQ,QAAQ,OAAO,IAAI,CAAC;EACjE,GAAI,QAAQ,QAAQ,KAAA,IAAY,EAAE,KAAK,QAAQ,IAAI,IAAI,CAAC;EACxD,GAAI,QAAQ,aAAa,KAAA,IAAY,EAAE,UAAU,QAAQ,SAAS,IAAI,CAAC;EACvE,GAAI,QAAQ,YAAY,KAAA,IAAY,EAAE,SAAS,QAAQ,QAAQ,IAAI,CAAC;EACpE,GAAI,UAAU,gBAAgB,EAAE,gBAAgB,cAAc,IAAI,CAAC;EACnE,UAAU,CAAC,OAAO;CACpB;AACF;;;;;AAMA,SAAgB,iBAAiB,MAA6B;CAC5D,MAAM,WAAW,KAAK,YAAY,CAAC;CACnC,OAAO,SAAS,KAAK,SAAS,WAAW;EACvC,IAAI,QAAQ;EACZ,QAAQ,cAAc,OAAO;EAC7B,GAAI,QAAQ,aAAa,KAAA,KAAa,QAAQ,WAAW,IAAI,EAAE,YAAY,QAAQ,WAAW,IAAI,IAAI,CAAC;EACvG,MAAM,YAAY,MAAM,SAAS,UAAU,SAAS,SAAS,CAAC;CAChE,EAAE;AACJ"}
|
|
@@ -51,8 +51,7 @@ function genericCopySections(node) {
|
|
|
51
51
|
...section("Error", errorBody(node)),
|
|
52
52
|
...section("Expectation", expectationBody(node)),
|
|
53
53
|
...section("Stack", node.failure_detail?.stack),
|
|
54
|
-
...section("stdout", node.stdout),
|
|
55
|
-
...section("stderr", node.stderr)
|
|
54
|
+
...node.log ? section("output", node.log) : [...section("stdout", node.stdout), ...section("stderr", node.stderr)]
|
|
56
55
|
],
|
|
57
56
|
items: []
|
|
58
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.cjs","names":["formatTestDuration","outcomeFor"],"sources":["../../../src/data/test-runner/copy.ts"],"sourcesContent":["// Clipboard payloads for the detail header's \"Copy details\" split button. The\n// primary payload is a Markdown brief: a `# name` heading, `- **Label:** value`\n// facts, then one fenced `## Title` section per piece of evidence. The generic\n// sections here read only common `Test` fields; node adapters contribute the\n// domain sections (a command, a CEL assertion, a recording) and extra menu items\n// through `TestNodeAdapter.copy`. Pure — no React, no clipboard — so every\n// payload is unit-testable as a string.\n\nimport type { StaticIconComponent } from \"../Icon\";\nimport type { Test } from \"./types\";\nimport { formatTestDuration, outcomeFor } from \"./status\";\n\n/** One `- **label:** value` line under the brief's heading. */\nexport type BriefFact = { label: string; value: string };\n\n/**\n * One `## title` block of the brief: fenced (tagged with `lang`) by default, or\n * inserted as-is when `markdown` — for lists and links that must stay live.\n */\nexport type BriefSection = { title: string; lang?: string; markdown?: boolean; body: string };\n\ntype CopyItemBase = { label: string; icon?: StaticIconComponent | string };\n\n/** A copy menu item: the text it copies, or why there is nothing to copy. */\nexport type CopyItem = (CopyItemBase & { value: string }) | (CopyItemBase & { reason: string });\n\nexport type CopySections = {\n facts?: BriefFact[];\n brief?: BriefSection[];\n items?: CopyItem[];\n};\n\n/** Generic sections rendered after every adapter section, so evidence reads before raw output. */\nconst OUTPUT_TITLES = new Set([\"stdout\", \"stderr\"]);\n\nfunction fact(label: string, value: string | undefined): BriefFact[] {\n return value ? [{ label, value }] : [];\n}\n\nfunction section(title: string, body: string | undefined, lang?: string): BriefSection[] {\n if (!body) return [];\n return [lang ? { title, lang, body } : { title, body }];\n}\n\nfunction nodeLocation(node: Test): string | undefined {\n if (!node.file) return undefined;\n return node.line ? `${node.file}:${node.line}` : node.file;\n}\n\nfunction errorBody(node: Test): string {\n const summary = node.failure_detail?.summary;\n const lines = [node.message, summary !== node.message ? summary : undefined];\n return lines.filter(Boolean).join(\"\\n\");\n}\n\nfunction expectationBody(node: Test): string {\n const failure = node.failure_detail;\n if (!failure) return \"\";\n return [\n failure.matcher && `matcher: ${failure.matcher}`,\n failure.expected && `expected: ${failure.expected}`,\n failure.actual && `actual: ${failure.actual}`,\n failure.location && `at: ${failure.location}`,\n ]\n .filter(Boolean)\n .join(\"\\n\");\n}\n\n/** Sections every node gets, read from the common `Test` fields only. */\nexport function genericCopySections(node: Test): Required<CopySections> {\n const duration = node.duration ? formatTestDuration(node.duration) : undefined;\n return {\n facts: [\n ...fact(\"Result\", outcomeFor(node) ?? undefined),\n ...fact(\"Tool\", node.framework),\n ...fact(\"Location\", nodeLocation(node)),\n ...fact(\"Duration\", duration),\n ],\n brief: [\n ...section(\"Error\", errorBody(node)),\n ...section(\"Expectation\", expectationBody(node)),\n ...section(\"Stack\", node.failure_detail?.stack),\n ...section(\"stdout\", node.stdout)
|
|
1
|
+
{"version":3,"file":"copy.cjs","names":["formatTestDuration","outcomeFor"],"sources":["../../../src/data/test-runner/copy.ts"],"sourcesContent":["// Clipboard payloads for the detail header's \"Copy details\" split button. The\n// primary payload is a Markdown brief: a `# name` heading, `- **Label:** value`\n// facts, then one fenced `## Title` section per piece of evidence. The generic\n// sections here read only common `Test` fields; node adapters contribute the\n// domain sections (a command, a CEL assertion, a recording) and extra menu items\n// through `TestNodeAdapter.copy`. Pure — no React, no clipboard — so every\n// payload is unit-testable as a string.\n\nimport type { StaticIconComponent } from \"../Icon\";\nimport type { Test } from \"./types\";\nimport { formatTestDuration, outcomeFor } from \"./status\";\n\n/** One `- **label:** value` line under the brief's heading. */\nexport type BriefFact = { label: string; value: string };\n\n/**\n * One `## title` block of the brief: fenced (tagged with `lang`) by default, or\n * inserted as-is when `markdown` — for lists and links that must stay live.\n */\nexport type BriefSection = { title: string; lang?: string; markdown?: boolean; body: string };\n\ntype CopyItemBase = { label: string; icon?: StaticIconComponent | string };\n\n/** A copy menu item: the text it copies, or why there is nothing to copy. */\nexport type CopyItem = (CopyItemBase & { value: string }) | (CopyItemBase & { reason: string });\n\nexport type CopySections = {\n facts?: BriefFact[];\n brief?: BriefSection[];\n items?: CopyItem[];\n};\n\n/** Generic sections rendered after every adapter section, so evidence reads before raw output. */\nconst OUTPUT_TITLES = new Set([\"stdout\", \"stderr\"]);\n\nfunction fact(label: string, value: string | undefined): BriefFact[] {\n return value ? [{ label, value }] : [];\n}\n\nfunction section(title: string, body: string | undefined, lang?: string): BriefSection[] {\n if (!body) return [];\n return [lang ? { title, lang, body } : { title, body }];\n}\n\nfunction nodeLocation(node: Test): string | undefined {\n if (!node.file) return undefined;\n return node.line ? `${node.file}:${node.line}` : node.file;\n}\n\nfunction errorBody(node: Test): string {\n const summary = node.failure_detail?.summary;\n const lines = [node.message, summary !== node.message ? summary : undefined];\n return lines.filter(Boolean).join(\"\\n\");\n}\n\nfunction expectationBody(node: Test): string {\n const failure = node.failure_detail;\n if (!failure) return \"\";\n return [\n failure.matcher && `matcher: ${failure.matcher}`,\n failure.expected && `expected: ${failure.expected}`,\n failure.actual && `actual: ${failure.actual}`,\n failure.location && `at: ${failure.location}`,\n ]\n .filter(Boolean)\n .join(\"\\n\");\n}\n\n/** Sections every node gets, read from the common `Test` fields only. */\nexport function genericCopySections(node: Test): Required<CopySections> {\n const duration = node.duration ? formatTestDuration(node.duration) : undefined;\n return {\n facts: [\n ...fact(\"Result\", outcomeFor(node) ?? undefined),\n ...fact(\"Tool\", node.framework),\n ...fact(\"Location\", nodeLocation(node)),\n ...fact(\"Duration\", duration),\n ],\n brief: [\n ...section(\"Error\", errorBody(node)),\n ...section(\"Expectation\", expectationBody(node)),\n ...section(\"Stack\", node.failure_detail?.stack),\n ...(node.log ? section(\"output\", node.log) : [...section(\"stdout\", node.stdout), ...section(\"stderr\", node.stderr)]),\n ],\n items: [],\n };\n}\n\nfunction uniqueBy<T>(values: T[], key: (value: T) => string): T[] {\n const seen = new Set<string>();\n return values.filter((value) => {\n const k = key(value);\n if (seen.has(k)) return false;\n seen.add(k);\n return true;\n });\n}\n\n/** Concatenates sections in order, keeping the first fact/section/item per label or title. */\nexport function mergeCopySections(parts: CopySections[]): Required<CopySections> {\n return {\n facts: uniqueBy(\n parts.flatMap((p) => p.facts ?? []),\n (f) => f.label,\n ),\n brief: uniqueBy(\n parts.flatMap((p) => p.brief ?? []),\n (s) => s.title,\n ),\n items: uniqueBy(\n parts.flatMap((p) => p.items ?? []),\n (i) => i.label,\n ),\n };\n}\n\n// A fence one backtick longer than any run in the body, so captured output that\n// itself contains ``` cannot close the block early (CommonMark).\nfunction fence(body: string): string {\n const longest = Math.max(0, ...(body.match(/`+/g) ?? []).map((run) => run.length));\n return \"`\".repeat(Math.max(3, longest + 1));\n}\n\n/** The Markdown brief: `# name`, the facts as bullets, then each non-empty section (fenced unless `markdown`). */\nexport function buildBrief(node: Test, sections: BriefSection[], facts: BriefFact[]): string {\n const lines = [`# ${node.name}`];\n if (facts.length > 0) lines.push(\"\", ...facts.map((f) => `- **${f.label}:** ${f.value}`));\n for (const s of sections) {\n if (!s.body) continue;\n lines.push(\"\", `## ${s.title}`, \"\");\n if (s.markdown) {\n lines.push(s.body);\n continue;\n }\n const marker = fence(s.body);\n lines.push(`${marker}${s.lang ?? \"\"}`, s.body, marker);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * The primary \"Copy details\" payload: generic facts and error/expectation\n * sections, then the adapters' sections, then the captured stdout/stderr.\n */\nexport function buildNodeBrief(node: Test, adapter: CopySections): string {\n const generic = genericCopySections(node);\n const merged = mergeCopySections([\n { facts: generic.facts, brief: generic.brief.filter((s) => !OUTPUT_TITLES.has(s.title)) },\n adapter,\n { brief: generic.brief.filter((s) => OUTPUT_TITLES.has(s.title)) },\n ]);\n return buildBrief(node, merged.brief, merged.facts);\n}\n\n/** \"Copy as JSON\": the node without its children subtree, 2-space indented. */\nexport function buildNodeJson(node: Test): string {\n const { children: _children, ...rest } = node;\n return JSON.stringify(rest, null, 2);\n}\n"],"mappings":";;;AAiCA,IAAM,gCAAgB,IAAI,IAAI,CAAC,UAAU,QAAQ,CAAC;AAElD,SAAS,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,QAAQ,GAAG,CAAC,YAAY,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,CAAC,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAEhG,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,YAAY,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC;CACpB,CAAC;AAsCF,yEAAyE;AACzE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAC,YAAY,CAAC,CAiBtE;AAYD,8FAA8F;AAC9F,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,GAAG,QAAQ,CAAC,YAAY,CAAC,CAe/E;AASD,kHAAkH;AAClH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,CAc3F;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,YAAY,GAAG,MAAM,CAQxE;AAED,+EAA+E;AAC/E,wBAAgB,aAAa,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAGhD"}
|
|
@@ -51,8 +51,7 @@ function genericCopySections(node) {
|
|
|
51
51
|
...section("Error", errorBody(node)),
|
|
52
52
|
...section("Expectation", expectationBody(node)),
|
|
53
53
|
...section("Stack", node.failure_detail?.stack),
|
|
54
|
-
...section("stdout", node.stdout),
|
|
55
|
-
...section("stderr", node.stderr)
|
|
54
|
+
...node.log ? section("output", node.log) : [...section("stdout", node.stdout), ...section("stderr", node.stderr)]
|
|
56
55
|
],
|
|
57
56
|
items: []
|
|
58
57
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.js","names":[],"sources":["../../../src/data/test-runner/copy.ts"],"sourcesContent":["// Clipboard payloads for the detail header's \"Copy details\" split button. The\n// primary payload is a Markdown brief: a `# name` heading, `- **Label:** value`\n// facts, then one fenced `## Title` section per piece of evidence. The generic\n// sections here read only common `Test` fields; node adapters contribute the\n// domain sections (a command, a CEL assertion, a recording) and extra menu items\n// through `TestNodeAdapter.copy`. Pure — no React, no clipboard — so every\n// payload is unit-testable as a string.\n\nimport type { StaticIconComponent } from \"../Icon\";\nimport type { Test } from \"./types\";\nimport { formatTestDuration, outcomeFor } from \"./status\";\n\n/** One `- **label:** value` line under the brief's heading. */\nexport type BriefFact = { label: string; value: string };\n\n/**\n * One `## title` block of the brief: fenced (tagged with `lang`) by default, or\n * inserted as-is when `markdown` — for lists and links that must stay live.\n */\nexport type BriefSection = { title: string; lang?: string; markdown?: boolean; body: string };\n\ntype CopyItemBase = { label: string; icon?: StaticIconComponent | string };\n\n/** A copy menu item: the text it copies, or why there is nothing to copy. */\nexport type CopyItem = (CopyItemBase & { value: string }) | (CopyItemBase & { reason: string });\n\nexport type CopySections = {\n facts?: BriefFact[];\n brief?: BriefSection[];\n items?: CopyItem[];\n};\n\n/** Generic sections rendered after every adapter section, so evidence reads before raw output. */\nconst OUTPUT_TITLES = new Set([\"stdout\", \"stderr\"]);\n\nfunction fact(label: string, value: string | undefined): BriefFact[] {\n return value ? [{ label, value }] : [];\n}\n\nfunction section(title: string, body: string | undefined, lang?: string): BriefSection[] {\n if (!body) return [];\n return [lang ? { title, lang, body } : { title, body }];\n}\n\nfunction nodeLocation(node: Test): string | undefined {\n if (!node.file) return undefined;\n return node.line ? `${node.file}:${node.line}` : node.file;\n}\n\nfunction errorBody(node: Test): string {\n const summary = node.failure_detail?.summary;\n const lines = [node.message, summary !== node.message ? summary : undefined];\n return lines.filter(Boolean).join(\"\\n\");\n}\n\nfunction expectationBody(node: Test): string {\n const failure = node.failure_detail;\n if (!failure) return \"\";\n return [\n failure.matcher && `matcher: ${failure.matcher}`,\n failure.expected && `expected: ${failure.expected}`,\n failure.actual && `actual: ${failure.actual}`,\n failure.location && `at: ${failure.location}`,\n ]\n .filter(Boolean)\n .join(\"\\n\");\n}\n\n/** Sections every node gets, read from the common `Test` fields only. */\nexport function genericCopySections(node: Test): Required<CopySections> {\n const duration = node.duration ? formatTestDuration(node.duration) : undefined;\n return {\n facts: [\n ...fact(\"Result\", outcomeFor(node) ?? undefined),\n ...fact(\"Tool\", node.framework),\n ...fact(\"Location\", nodeLocation(node)),\n ...fact(\"Duration\", duration),\n ],\n brief: [\n ...section(\"Error\", errorBody(node)),\n ...section(\"Expectation\", expectationBody(node)),\n ...section(\"Stack\", node.failure_detail?.stack),\n ...section(\"stdout\", node.stdout)
|
|
1
|
+
{"version":3,"file":"copy.js","names":[],"sources":["../../../src/data/test-runner/copy.ts"],"sourcesContent":["// Clipboard payloads for the detail header's \"Copy details\" split button. The\n// primary payload is a Markdown brief: a `# name` heading, `- **Label:** value`\n// facts, then one fenced `## Title` section per piece of evidence. The generic\n// sections here read only common `Test` fields; node adapters contribute the\n// domain sections (a command, a CEL assertion, a recording) and extra menu items\n// through `TestNodeAdapter.copy`. Pure — no React, no clipboard — so every\n// payload is unit-testable as a string.\n\nimport type { StaticIconComponent } from \"../Icon\";\nimport type { Test } from \"./types\";\nimport { formatTestDuration, outcomeFor } from \"./status\";\n\n/** One `- **label:** value` line under the brief's heading. */\nexport type BriefFact = { label: string; value: string };\n\n/**\n * One `## title` block of the brief: fenced (tagged with `lang`) by default, or\n * inserted as-is when `markdown` — for lists and links that must stay live.\n */\nexport type BriefSection = { title: string; lang?: string; markdown?: boolean; body: string };\n\ntype CopyItemBase = { label: string; icon?: StaticIconComponent | string };\n\n/** A copy menu item: the text it copies, or why there is nothing to copy. */\nexport type CopyItem = (CopyItemBase & { value: string }) | (CopyItemBase & { reason: string });\n\nexport type CopySections = {\n facts?: BriefFact[];\n brief?: BriefSection[];\n items?: CopyItem[];\n};\n\n/** Generic sections rendered after every adapter section, so evidence reads before raw output. */\nconst OUTPUT_TITLES = new Set([\"stdout\", \"stderr\"]);\n\nfunction fact(label: string, value: string | undefined): BriefFact[] {\n return value ? [{ label, value }] : [];\n}\n\nfunction section(title: string, body: string | undefined, lang?: string): BriefSection[] {\n if (!body) return [];\n return [lang ? { title, lang, body } : { title, body }];\n}\n\nfunction nodeLocation(node: Test): string | undefined {\n if (!node.file) return undefined;\n return node.line ? `${node.file}:${node.line}` : node.file;\n}\n\nfunction errorBody(node: Test): string {\n const summary = node.failure_detail?.summary;\n const lines = [node.message, summary !== node.message ? summary : undefined];\n return lines.filter(Boolean).join(\"\\n\");\n}\n\nfunction expectationBody(node: Test): string {\n const failure = node.failure_detail;\n if (!failure) return \"\";\n return [\n failure.matcher && `matcher: ${failure.matcher}`,\n failure.expected && `expected: ${failure.expected}`,\n failure.actual && `actual: ${failure.actual}`,\n failure.location && `at: ${failure.location}`,\n ]\n .filter(Boolean)\n .join(\"\\n\");\n}\n\n/** Sections every node gets, read from the common `Test` fields only. */\nexport function genericCopySections(node: Test): Required<CopySections> {\n const duration = node.duration ? formatTestDuration(node.duration) : undefined;\n return {\n facts: [\n ...fact(\"Result\", outcomeFor(node) ?? undefined),\n ...fact(\"Tool\", node.framework),\n ...fact(\"Location\", nodeLocation(node)),\n ...fact(\"Duration\", duration),\n ],\n brief: [\n ...section(\"Error\", errorBody(node)),\n ...section(\"Expectation\", expectationBody(node)),\n ...section(\"Stack\", node.failure_detail?.stack),\n ...(node.log ? section(\"output\", node.log) : [...section(\"stdout\", node.stdout), ...section(\"stderr\", node.stderr)]),\n ],\n items: [],\n };\n}\n\nfunction uniqueBy<T>(values: T[], key: (value: T) => string): T[] {\n const seen = new Set<string>();\n return values.filter((value) => {\n const k = key(value);\n if (seen.has(k)) return false;\n seen.add(k);\n return true;\n });\n}\n\n/** Concatenates sections in order, keeping the first fact/section/item per label or title. */\nexport function mergeCopySections(parts: CopySections[]): Required<CopySections> {\n return {\n facts: uniqueBy(\n parts.flatMap((p) => p.facts ?? []),\n (f) => f.label,\n ),\n brief: uniqueBy(\n parts.flatMap((p) => p.brief ?? []),\n (s) => s.title,\n ),\n items: uniqueBy(\n parts.flatMap((p) => p.items ?? []),\n (i) => i.label,\n ),\n };\n}\n\n// A fence one backtick longer than any run in the body, so captured output that\n// itself contains ``` cannot close the block early (CommonMark).\nfunction fence(body: string): string {\n const longest = Math.max(0, ...(body.match(/`+/g) ?? []).map((run) => run.length));\n return \"`\".repeat(Math.max(3, longest + 1));\n}\n\n/** The Markdown brief: `# name`, the facts as bullets, then each non-empty section (fenced unless `markdown`). */\nexport function buildBrief(node: Test, sections: BriefSection[], facts: BriefFact[]): string {\n const lines = [`# ${node.name}`];\n if (facts.length > 0) lines.push(\"\", ...facts.map((f) => `- **${f.label}:** ${f.value}`));\n for (const s of sections) {\n if (!s.body) continue;\n lines.push(\"\", `## ${s.title}`, \"\");\n if (s.markdown) {\n lines.push(s.body);\n continue;\n }\n const marker = fence(s.body);\n lines.push(`${marker}${s.lang ?? \"\"}`, s.body, marker);\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * The primary \"Copy details\" payload: generic facts and error/expectation\n * sections, then the adapters' sections, then the captured stdout/stderr.\n */\nexport function buildNodeBrief(node: Test, adapter: CopySections): string {\n const generic = genericCopySections(node);\n const merged = mergeCopySections([\n { facts: generic.facts, brief: generic.brief.filter((s) => !OUTPUT_TITLES.has(s.title)) },\n adapter,\n { brief: generic.brief.filter((s) => OUTPUT_TITLES.has(s.title)) },\n ]);\n return buildBrief(node, merged.brief, merged.facts);\n}\n\n/** \"Copy as JSON\": the node without its children subtree, 2-space indented. */\nexport function buildNodeJson(node: Test): string {\n const { children: _children, ...rest } = node;\n return JSON.stringify(rest, null, 2);\n}\n"],"mappings":";;;AAiCA,IAAM,gCAAgB,IAAI,IAAI,CAAC,UAAU,QAAQ,CAAC;AAElD,SAAS,KAAK,OAAe,OAAwC;CACnE,OAAO,QAAQ,CAAC;EAAE;EAAO;CAAM,CAAC,IAAI,CAAC;AACvC;AAEA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SAAS,MAAM,EAAE,IAAI;EAC3B,MAAM,KAAK,GAAG,SAAS,EAAE,QAAQ,MAAM,EAAE,MAAM,MAAM;CACvD;CACA,OAAO,MAAM,KAAK,IAAI;AACxB;;;;;AAMA,SAAgB,eAAe,MAAY,SAA+B;CACxE,MAAM,UAAU,oBAAoB,IAAI;CACxC,MAAM,SAAS,kBAAkB;EAC/B;GAAE,OAAO,QAAQ;GAAO,OAAO,QAAQ,MAAM,QAAQ,MAAM,CAAC,cAAc,IAAI,EAAE,KAAK,CAAC;EAAE;EACxF;EACA,EAAE,OAAO,QAAQ,MAAM,QAAQ,MAAM,cAAc,IAAI,EAAE,KAAK,CAAC,EAAE;CACnE,CAAC;CACD,OAAO,WAAW,MAAM,OAAO,OAAO,OAAO,KAAK;AACpD;;AAGA,SAAgB,cAAc,MAAoB;CAChD,MAAM,EAAE,UAAU,WAAW,GAAG,SAAS;CACzC,OAAO,KAAK,UAAU,MAAM,MAAM,CAAC;AACrC"}
|
|
@@ -46,6 +46,8 @@ export interface Test {
|
|
|
46
46
|
can_stop?: boolean;
|
|
47
47
|
stdout?: string;
|
|
48
48
|
stderr?: string;
|
|
49
|
+
/** Both streams verbatim in the order they were written, workflow commands included; unset when it would be stdout again. */
|
|
50
|
+
log?: string;
|
|
49
51
|
children?: Test[];
|
|
50
52
|
summary?: TestSummary;
|
|
51
53
|
attempts?: TestAttempt[];
|
|
@@ -80,6 +82,7 @@ export interface TestAttempt {
|
|
|
80
82
|
message?: string;
|
|
81
83
|
stdout?: string;
|
|
82
84
|
stderr?: string;
|
|
85
|
+
log?: string;
|
|
83
86
|
stack_trace?: string;
|
|
84
87
|
cpu_percent?: number;
|
|
85
88
|
rss?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/data/test-runner/types.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EA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
|
]
|
|
39
39
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ol", {
|
|
40
40
|
className: "space-y-0.5 font-mono text-[11px] leading-4",
|
|
41
|
-
children: stack.frames.map((frame, depth) =>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
className: "
|
|
45
|
-
children:
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
children: stack.frames.map((frame, depth) => {
|
|
42
|
+
const location = frameLocation(frame).split(/[\\/]/).at(-1);
|
|
43
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("li", {
|
|
44
|
+
className: require_utils.cn("break-all", frame.func === func ? "font-semibold text-foreground" : "text-muted-foreground"),
|
|
45
|
+
children: [frame.func, location && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
46
|
+
className: "ml-2 text-[10px] font-normal opacity-80",
|
|
47
|
+
children: location
|
|
48
|
+
})]
|
|
49
|
+
}, depth);
|
|
50
|
+
})
|
|
48
51
|
})]
|
|
49
52
|
}, index))
|
|
50
53
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoProfileView.cjs","names":["stacksThrough","formatProfileValue","cn","useMemo","profileValueTypes","useState","aggregateProfile","Select","Fragment","Icon","UiChevronDown","UiChevronRight","formatProcessTimestamp"],"sources":["../../../src/data/traces/GoProfileView.tsx"],"sourcesContent":["import { Fragment, useMemo, useState } from \"react\";\nimport { Select } from \"../../components/select\";\nimport { UiChevronDown, UiChevronRight } from \"../../icons\";\nimport { cn } from \"../../lib/utils\";\nimport { Icon } from \"../Icon\";\nimport {\n aggregateProfile,\n formatProfileValue,\n profileValueTypes,\n stacksThrough,\n type ProfileFunctionRow,\n} from \"./profile-aggregate\";\nimport { formatProcessTimestamp } from \"./process-tree\";\nimport type { GoProfileRecord, ProfileSample, StackFrame } from \"./types\";\n\nconst DEFAULT_TOP_N = 20;\nconst DRILL_DOWN_STACKS = 5;\n\ntype SortKey = \"flat\" | \"cum\";\n\nfunction frameLocation(frame: StackFrame): string {\n return frame.file ? `${frame.file}${frame.line ? `:${frame.line}` : \"\"}` : \"\";\n}\n\nfunction Percent({ value, total }: { value: number; total: number }) {\n return <span className=\"text-muted-foreground\">{total > 0 ? `${((value / total) * 100).toFixed(1)}%` : \"—\"}</span>;\n}\n\nfunction DrillDown({\n samples,\n sampleType,\n unit,\n func,\n total,\n}: {\n samples: ProfileSample[];\n sampleType: string;\n unit: string;\n func: string;\n total: number;\n}) {\n const stacks = stacksThrough(samples, sampleType, func, DRILL_DOWN_STACKS);\n return (\n <div className=\"space-y-density-2\" data-profile-stacks={func}>\n {stacks.map((stack, index) => (\n <div key={index} className=\"rounded border border-border bg-muted/30 p-density-2\">\n <div className=\"mb-1 text-[11px] text-muted-foreground\">\n {formatProfileValue(stack.value, unit)} <Percent value={stack.value} total={total} />\n </div>\n <ol className=\"space-y-0.5 font-mono text-[11px] leading-4\">\n {stack.frames.map((frame, depth) => (\n <li key={depth} className={cn(\"break-all\", frame.func === func ? \"font-semibold text-foreground\" : \"text-muted-foreground\")}>\n {frame.func}\n {frameLocation(frame) && <span className=\"ml-2 text-[10px] font-normal opacity-80\">{frameLocation(frame)}</span>}\n </li>\n ))}\n </ol>\n </div>\n ))}\n </div>\n );\n}\n\nexport type ProfileTopTableProps = {\n /** Samples of any profile: a value of some type and unit attributed to a stack, innermost frame first. */\n samples: ProfileSample[];\n /** Functions shown before \"Show all\"; defaults to 20. */\n topN?: number;\n className?: string;\n};\n\n/**\n * The heaviest functions of a profile: a table by flat value (the innermost\n * frame) and cumulative value (anywhere in the stack), sortable by either, per\n * sample type, with a drill-down from a function to the stacks that reach it.\n * Not specific to Go: any samples of a value, a unit and a stack fit.\n */\nexport function ProfileTopTable({ samples, topN = DEFAULT_TOP_N, className }: ProfileTopTableProps) {\n const types = useMemo(() => profileValueTypes(samples), [samples]);\n // pprof's default sample index is its last value type: cpu, inuse_space.\n const [picked, setPicked] = useState<string | null>(null);\n const sampleType = types.find((type) => type.sampleType === picked)?.sampleType ?? types[types.length - 1]?.sampleType;\n const [sortKey, setSortKey] = useState<SortKey>(\"flat\");\n const [showAll, setShowAll] = useState(false);\n const [open, setOpen] = useState<string | null>(null);\n const aggregate = useMemo(() => (sampleType ? aggregateProfile(samples, sampleType) : undefined), [samples, sampleType]);\n\n if (!sampleType || !aggregate) {\n return <div className=\"text-sm text-muted-foreground\">The profile has no samples</div>;\n }\n\n const sorted: ProfileFunctionRow[] =\n sortKey === \"flat\" ? aggregate.functions : [...aggregate.functions].sort((a, b) => b.cum - a.cum || b.flat - a.flat);\n const shown = showAll ? sorted : sorted.slice(0, topN);\n const sortHeader = (key: SortKey, label: string) => (\n <th scope=\"col\" className=\"px-2 py-1 text-right font-medium\" aria-sort={sortKey === key ? \"descending\" : \"none\"}>\n <button type=\"button\" className={cn(\"hover:text-foreground\", sortKey === key && \"text-foreground\")} onClick={() => setSortKey(key)}>\n {label}\n </button>\n </th>\n );\n\n return (\n <div className={cn(\"space-y-density-2\", className)} data-profile-top=\"\">\n <div className=\"flex flex-wrap items-center justify-between gap-density-2 text-xs text-muted-foreground\">\n <span>\n Total {formatProfileValue(aggregate.total, aggregate.unit)} across {aggregate.functions.length} functions\n </span>\n {types.length > 1 && (\n <div className=\"min-w-[12rem]\">\n <Select\n aria-label=\"Sample type\"\n value={sampleType}\n onChange={(event) => {\n setPicked(event.target.value);\n setOpen(null);\n }}\n options={types.map((type) => ({ value: type.sampleType, label: `${type.sampleType} (${type.unit})` }))}\n />\n </div>\n )}\n </div>\n <table className=\"w-full table-fixed border-collapse text-xs\">\n <thead className=\"text-muted-foreground\">\n <tr className=\"border-b border-border\">\n <th scope=\"col\" className=\"px-2 py-1 text-left font-medium\">\n Function\n </th>\n {sortHeader(\"flat\", \"Flat\")}\n <th scope=\"col\" className=\"w-16 px-2 py-1 text-right font-medium\">\n Flat %\n </th>\n {sortHeader(\"cum\", \"Cum\")}\n <th scope=\"col\" className=\"w-16 px-2 py-1 text-right font-medium\">\n Cum %\n </th>\n </tr>\n </thead>\n <tbody>\n {shown.map((row) => {\n const expanded = open === row.func;\n return (\n <Fragment key={row.func}>\n <tr className=\"border-b border-border/60 hover:bg-muted/40\" data-profile-function={row.func}>\n <td className=\"px-2 py-1\">\n <button\n type=\"button\"\n aria-expanded={expanded}\n className=\"flex w-full items-start gap-1 text-left\"\n onClick={() => setOpen(expanded ? null : row.func)}\n >\n <Icon icon={expanded ? UiChevronDown : UiChevronRight} className=\"mt-0.5 shrink-0 text-[11px]\" />\n <span className=\"min-w-0\">\n <span className=\"block break-all font-mono text-[11px] font-semibold\">{row.func}</span>\n {frameLocation(row) && (\n <span className=\"block break-all text-[10px] text-muted-foreground\">{frameLocation(row)}</span>\n )}\n </span>\n </button>\n </td>\n <td className=\"px-2 py-1 text-right tabular-nums\">{formatProfileValue(row.flat, aggregate.unit)}</td>\n <td className=\"px-2 py-1 text-right tabular-nums\">\n <Percent value={row.flat} total={aggregate.total} />\n </td>\n <td className=\"px-2 py-1 text-right tabular-nums\">{formatProfileValue(row.cum, aggregate.unit)}</td>\n <td className=\"px-2 py-1 text-right tabular-nums\">\n <Percent value={row.cum} total={aggregate.total} />\n </td>\n </tr>\n {expanded && (\n <tr>\n <td colSpan={5} className=\"px-2 py-density-2\">\n <DrillDown\n samples={samples}\n sampleType={sampleType}\n unit={aggregate.unit}\n func={row.func}\n total={aggregate.total}\n />\n </td>\n </tr>\n )}\n </Fragment>\n );\n })}\n </tbody>\n </table>\n {!showAll && sorted.length > shown.length && (\n <button type=\"button\" className=\"text-xs text-primary hover:underline\" onClick={() => setShowAll(true)}>\n Show all {sorted.length} functions\n </button>\n )}\n </div>\n );\n}\n\nexport type GoProfileViewProps = {\n /** `goprof` records, possibly of several checkpoints and processes; those of one process are shown. */\n records: GoProfileRecord[];\n /** The `process_tree` key whose profiles to show; required when the records span processes. */\n processKey?: string;\n topN?: number;\n className?: string;\n};\n\ntype ProfileCheckpoint = { checkpointId: string; takenAt: string; reason: string; source: string; profile: string; records: GoProfileRecord[] };\n\nfunction profileCheckpoints(records: GoProfileRecord[]): ProfileCheckpoint[] {\n const groups = new Map<string, GoProfileRecord[]>();\n for (const record of records) groups.set(record.checkpointId, [...(groups.get(record.checkpointId) ?? []), record]);\n return [...groups]\n .map(([checkpointId, group]): ProfileCheckpoint => {\n const [first] = group as [GoProfileRecord, ...GoProfileRecord[]];\n return {\n checkpointId,\n takenAt: first.takenAt,\n reason: first.reason,\n source: first.source,\n profile: first.profile,\n records: group,\n };\n })\n .sort((a, b) => Date.parse(a.takenAt) - Date.parse(b.takenAt));\n}\n\n/**\n * A Go pprof profile as the `goprof` kind stores it: the checkpoint chooser\n * (profile type, source and time; the latest by default) over a top-N table of\n * functions by flat and cumulative value with a frames drill-down. Props-only.\n */\nexport function GoProfileView({ records, processKey, topN, className }: GoProfileViewProps) {\n const keys = useMemo(() => new Set(records.map((record) => record.key)), [records]);\n if (keys.size > 1 && processKey === undefined) {\n throw new Error(`GoProfileView got records of ${keys.size} processes; pass processKey to choose one`);\n }\n const own = useMemo(\n () => (processKey === undefined ? records : records.filter((record) => record.key === processKey)),\n [records, processKey],\n );\n const checkpoints = useMemo(() => profileCheckpoints(own), [own]);\n const [picked, setPicked] = useState<string | null>(null);\n const selected = checkpoints.find((checkpoint) => checkpoint.checkpointId === picked) ?? checkpoints[checkpoints.length - 1];\n\n if (!selected) return <div className=\"text-sm text-muted-foreground\">No profile collected yet</div>;\n\n return (\n <div className={cn(\"space-y-density-2\", className)} data-go-profile={selected.profile}>\n {checkpoints.length > 1 ? (\n <div className=\"max-w-md\">\n <Select\n aria-label=\"Profile checkpoint\"\n value={selected.checkpointId}\n onChange={(event) => setPicked(event.target.value)}\n options={[...checkpoints].reverse().map((checkpoint) => ({\n value: checkpoint.checkpointId,\n label: [formatProcessTimestamp(checkpoint.takenAt), checkpoint.profile, checkpoint.reason, checkpoint.source]\n .filter(Boolean)\n .join(\" · \"),\n }))}\n />\n </div>\n ) : (\n <div className=\"text-xs text-muted-foreground\">\n {[selected.profile, formatProcessTimestamp(selected.takenAt), selected.reason, selected.source].filter(Boolean).join(\" · \")}\n </div>\n )}\n <ProfileTopTable key={selected.checkpointId} samples={selected.records} {...(topN !== undefined ? { topN } : {})} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAeA,IAAM,gBAAgB;AACtB,IAAM,oBAAoB;AAI1B,SAAS,cAAc,OAA2B;CAChD,OAAO,MAAM,OAAO,GAAG,MAAM,OAAO,MAAM,OAAO,IAAI,MAAM,SAAS,OAAO;AAC7E;AAEA,SAAS,QAAQ,EAAE,OAAO,SAA2C;CACnE,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,WAAU;EAAyB,UAAA,QAAQ,IAAI,IAAK,QAAQ,QAAS,IAAA,CAAK,QAAQ,CAAC,EAAE,KAAK;CAAU,CAAA;AACnH;AAEA,SAAS,UAAU,EACjB,SACA,YACA,MACA,MACA,SAOC;CACD,MAAM,SAASA,0BAAAA,cAAc,SAAS,YAAY,MAAM,iBAAiB;CACzE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EAAoB,uBAAqB;EACrD,UAAA,OAAO,KAAK,OAAO,UAClB,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAiB,WAAU;GAA3B,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACGC,0BAAAA,mBAAmB,MAAM,OAAO,IAAI;KAAE;KAAC,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;MAAS,OAAO,MAAM;MAAc;KAAQ,CAAA;IACjF;GACL,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;IAAI,WAAU;IACX,UAAA,MAAM,OAAO,KAAK,OAAO,UACxB,iBAAA,GAAA,kBAAA,KAAA,CAAC,MAAD;KAAgB,WAAWC,cAAAA,GAAG,aAAa,MAAM,SAAS,OAAO,kCAAkC,uBAAuB;KA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,WAAU;GACb,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACK,eAAAA,QAAD;IACE,cAAW;IACX,OAAO,SAAS;IAChB,WAAW,UAAU,UAAU,MAAM,OAAO,KAAK;IACjD,SAAS,CAAC,GAAG,WAAW,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,gBAAgB;KACvD,OAAO,WAAW;KAClB,OAAO;MAACK,qBAAAA,uBAAuB,WAAW,OAAO;MAAG,WAAW;MAAS,WAAW;MAAQ,WAAW;KAAM,CAAC,CAC1G,OAAO,OAAO,CAAC,CACf,KAAK,KAAK;IACf,EAAE;GACH,CAAA;EACE,CAAA,IAEL,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;GAAK,WAAU;GACZ,UAAA;IAAC,SAAS;IAASA,qBAAAA,uBAAuB,SAAS,OAAO;IAAG,SAAS;IAAQ,SAAS;GAAM,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,KAAK;EACvH,CAAA,GAEP,iBAAA,GAAA,kBAAA,IAAA,CAAC,iBAAD;GAA6C,SAAS,SAAS;GAAS,GAAK,SAAS,KAAA,IAAY,EAAE,KAAK,IAAI,CAAC;EAAK,GAA7F,SAAS,YAAoF,CAChH;;AAET"}
|
|
1
|
+
{"version":3,"file":"GoProfileView.cjs","names":["stacksThrough","formatProfileValue","cn","useMemo","profileValueTypes","useState","aggregateProfile","Select","Fragment","Icon","UiChevronDown","UiChevronRight","formatProcessTimestamp"],"sources":["../../../src/data/traces/GoProfileView.tsx"],"sourcesContent":["import { Fragment, useMemo, useState } from \"react\";\nimport { Select } from \"../../components/select\";\nimport { UiChevronDown, UiChevronRight } from \"../../icons\";\nimport { cn } from \"../../lib/utils\";\nimport { Icon } from \"../Icon\";\nimport {\n aggregateProfile,\n formatProfileValue,\n profileValueTypes,\n stacksThrough,\n type ProfileFunctionRow,\n} from \"./profile-aggregate\";\nimport { formatProcessTimestamp } from \"./process-tree\";\nimport type { GoProfileRecord, ProfileSample, StackFrame } from \"./types\";\n\nconst DEFAULT_TOP_N = 20;\nconst DRILL_DOWN_STACKS = 5;\n\ntype SortKey = \"flat\" | \"cum\";\n\nfunction frameLocation(frame: StackFrame): string {\n return frame.file ? `${frame.file}${frame.line ? `:${frame.line}` : \"\"}` : \"\";\n}\n\nfunction Percent({ value, total }: { value: number; total: number }) {\n return <span className=\"text-muted-foreground\">{total > 0 ? `${((value / total) * 100).toFixed(1)}%` : \"—\"}</span>;\n}\n\nfunction DrillDown({\n samples,\n sampleType,\n unit,\n func,\n total,\n}: {\n samples: ProfileSample[];\n sampleType: string;\n unit: string;\n func: string;\n total: number;\n}) {\n const stacks = stacksThrough(samples, sampleType, func, DRILL_DOWN_STACKS);\n return (\n <div className=\"space-y-density-2\" data-profile-stacks={func}>\n {stacks.map((stack, index) => (\n <div key={index} className=\"rounded border border-border bg-muted/30 p-density-2\">\n <div className=\"mb-1 text-[11px] text-muted-foreground\">\n {formatProfileValue(stack.value, unit)} <Percent value={stack.value} total={total} />\n </div>\n <ol className=\"space-y-0.5 font-mono text-[11px] leading-4\">\n {stack.frames.map((frame, depth) => {\n const location = frameLocation(frame).split(/[\\\\/]/).at(-1);\n return (\n <li key={depth} className={cn(\"break-all\", frame.func === func ? \"font-semibold text-foreground\" : \"text-muted-foreground\")}>\n {frame.func}\n {location && <span className=\"ml-2 text-[10px] font-normal opacity-80\">{location}</span>}\n </li>\n );\n })}\n </ol>\n </div>\n ))}\n </div>\n );\n}\n\nexport type ProfileTopTableProps = {\n /** Samples of any profile: a value of some type and unit attributed to a stack, innermost frame first. */\n samples: ProfileSample[];\n /** Functions shown before \"Show all\"; defaults to 20. */\n topN?: number;\n className?: string;\n};\n\n/**\n * The heaviest functions of a profile: a table by flat value (the innermost\n * frame) and cumulative value (anywhere in the stack), sortable by either, per\n * sample type, with a drill-down from a function to the stacks that reach it.\n * Not specific to Go: any samples of a value, a unit and a stack fit.\n */\nexport function ProfileTopTable({ samples, topN = DEFAULT_TOP_N, className }: ProfileTopTableProps) {\n const types = useMemo(() => profileValueTypes(samples), [samples]);\n // pprof's default sample index is its last value type: cpu, inuse_space.\n const [picked, setPicked] = useState<string | null>(null);\n const sampleType = types.find((type) => type.sampleType === picked)?.sampleType ?? types[types.length - 1]?.sampleType;\n const [sortKey, setSortKey] = useState<SortKey>(\"flat\");\n const [showAll, setShowAll] = useState(false);\n const [open, setOpen] = useState<string | null>(null);\n const aggregate = useMemo(() => (sampleType ? aggregateProfile(samples, sampleType) : undefined), [samples, sampleType]);\n\n if (!sampleType || !aggregate) {\n return <div className=\"text-sm text-muted-foreground\">The profile has no samples</div>;\n }\n\n const sorted: ProfileFunctionRow[] =\n sortKey === \"flat\" ? aggregate.functions : [...aggregate.functions].sort((a, b) => b.cum - a.cum || b.flat - a.flat);\n const shown = showAll ? sorted : sorted.slice(0, topN);\n const sortHeader = (key: SortKey, label: string) => (\n <th scope=\"col\" className=\"px-2 py-1 text-right font-medium\" aria-sort={sortKey === key ? \"descending\" : \"none\"}>\n <button type=\"button\" className={cn(\"hover:text-foreground\", sortKey === key && \"text-foreground\")} onClick={() => setSortKey(key)}>\n {label}\n </button>\n </th>\n );\n\n return (\n <div className={cn(\"space-y-density-2\", className)} data-profile-top=\"\">\n <div className=\"flex flex-wrap items-center justify-between gap-density-2 text-xs text-muted-foreground\">\n <span>\n Total {formatProfileValue(aggregate.total, aggregate.unit)} across {aggregate.functions.length} functions\n </span>\n {types.length > 1 && (\n <div className=\"min-w-[12rem]\">\n <Select\n aria-label=\"Sample type\"\n value={sampleType}\n onChange={(event) => {\n setPicked(event.target.value);\n setOpen(null);\n }}\n options={types.map((type) => ({ value: type.sampleType, label: `${type.sampleType} (${type.unit})` }))}\n />\n </div>\n )}\n </div>\n <table className=\"w-full table-fixed border-collapse text-xs\">\n <thead className=\"text-muted-foreground\">\n <tr className=\"border-b border-border\">\n <th scope=\"col\" className=\"px-2 py-1 text-left font-medium\">\n Function\n </th>\n {sortHeader(\"flat\", \"Flat\")}\n <th scope=\"col\" className=\"w-16 px-2 py-1 text-right font-medium\">\n Flat %\n </th>\n {sortHeader(\"cum\", \"Cum\")}\n <th scope=\"col\" className=\"w-16 px-2 py-1 text-right font-medium\">\n Cum %\n </th>\n </tr>\n </thead>\n <tbody>\n {shown.map((row) => {\n const expanded = open === row.func;\n return (\n <Fragment key={row.func}>\n <tr className=\"border-b border-border/60 hover:bg-muted/40\" data-profile-function={row.func}>\n <td className=\"px-2 py-1\">\n <button\n type=\"button\"\n aria-expanded={expanded}\n className=\"flex w-full items-start gap-1 text-left\"\n onClick={() => setOpen(expanded ? null : row.func)}\n >\n <Icon icon={expanded ? UiChevronDown : UiChevronRight} className=\"mt-0.5 shrink-0 text-[11px]\" />\n <span className=\"min-w-0\">\n <span className=\"block break-all font-mono text-[11px] font-semibold\">{row.func}</span>\n {frameLocation(row) && (\n <span className=\"block break-all text-[10px] text-muted-foreground\">{frameLocation(row)}</span>\n )}\n </span>\n </button>\n </td>\n <td className=\"px-2 py-1 text-right tabular-nums\">{formatProfileValue(row.flat, aggregate.unit)}</td>\n <td className=\"px-2 py-1 text-right tabular-nums\">\n <Percent value={row.flat} total={aggregate.total} />\n </td>\n <td className=\"px-2 py-1 text-right tabular-nums\">{formatProfileValue(row.cum, aggregate.unit)}</td>\n <td className=\"px-2 py-1 text-right tabular-nums\">\n <Percent value={row.cum} total={aggregate.total} />\n </td>\n </tr>\n {expanded && (\n <tr>\n <td colSpan={5} className=\"px-2 py-density-2\">\n <DrillDown\n samples={samples}\n sampleType={sampleType}\n unit={aggregate.unit}\n func={row.func}\n total={aggregate.total}\n />\n </td>\n </tr>\n )}\n </Fragment>\n );\n })}\n </tbody>\n </table>\n {!showAll && sorted.length > shown.length && (\n <button type=\"button\" className=\"text-xs text-primary hover:underline\" onClick={() => setShowAll(true)}>\n Show all {sorted.length} functions\n </button>\n )}\n </div>\n );\n}\n\nexport type GoProfileViewProps = {\n /** `goprof` records, possibly of several checkpoints and processes; those of one process are shown. */\n records: GoProfileRecord[];\n /** The `process_tree` key whose profiles to show; required when the records span processes. */\n processKey?: string;\n topN?: number;\n className?: string;\n};\n\ntype ProfileCheckpoint = { checkpointId: string; takenAt: string; reason: string; source: string; profile: string; records: GoProfileRecord[] };\n\nfunction profileCheckpoints(records: GoProfileRecord[]): ProfileCheckpoint[] {\n const groups = new Map<string, GoProfileRecord[]>();\n for (const record of records) groups.set(record.checkpointId, [...(groups.get(record.checkpointId) ?? []), record]);\n return [...groups]\n .map(([checkpointId, group]): ProfileCheckpoint => {\n const [first] = group as [GoProfileRecord, ...GoProfileRecord[]];\n return {\n checkpointId,\n takenAt: first.takenAt,\n reason: first.reason,\n source: first.source,\n profile: first.profile,\n records: group,\n };\n })\n .sort((a, b) => Date.parse(a.takenAt) - Date.parse(b.takenAt));\n}\n\n/**\n * A Go pprof profile as the `goprof` kind stores it: the checkpoint chooser\n * (profile type, source and time; the latest by default) over a top-N table of\n * functions by flat and cumulative value with a frames drill-down. Props-only.\n */\nexport function GoProfileView({ records, processKey, topN, className }: GoProfileViewProps) {\n const keys = useMemo(() => new Set(records.map((record) => record.key)), [records]);\n if (keys.size > 1 && processKey === undefined) {\n throw new Error(`GoProfileView got records of ${keys.size} processes; pass processKey to choose one`);\n }\n const own = useMemo(\n () => (processKey === undefined ? records : records.filter((record) => record.key === processKey)),\n [records, processKey],\n );\n const checkpoints = useMemo(() => profileCheckpoints(own), [own]);\n const [picked, setPicked] = useState<string | null>(null);\n const selected = checkpoints.find((checkpoint) => checkpoint.checkpointId === picked) ?? checkpoints[checkpoints.length - 1];\n\n if (!selected) return <div className=\"text-sm text-muted-foreground\">No profile collected yet</div>;\n\n return (\n <div className={cn(\"space-y-density-2\", className)} data-go-profile={selected.profile}>\n {checkpoints.length > 1 ? (\n <div className=\"max-w-md\">\n <Select\n aria-label=\"Profile checkpoint\"\n value={selected.checkpointId}\n onChange={(event) => setPicked(event.target.value)}\n options={[...checkpoints].reverse().map((checkpoint) => ({\n value: checkpoint.checkpointId,\n label: [formatProcessTimestamp(checkpoint.takenAt), checkpoint.profile, checkpoint.reason, checkpoint.source]\n .filter(Boolean)\n .join(\" · \"),\n }))}\n />\n </div>\n ) : (\n <div className=\"text-xs text-muted-foreground\">\n {[selected.profile, formatProcessTimestamp(selected.takenAt), selected.reason, selected.source].filter(Boolean).join(\" · \")}\n </div>\n )}\n <ProfileTopTable key={selected.checkpointId} samples={selected.records} {...(topN !== undefined ? { topN } : {})} />\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAeA,IAAM,gBAAgB;AACtB,IAAM,oBAAoB;AAI1B,SAAS,cAAc,OAA2B;CAChD,OAAO,MAAM,OAAO,GAAG,MAAM,OAAO,MAAM,OAAO,IAAI,MAAM,SAAS,OAAO;AAC7E;AAEA,SAAS,QAAQ,EAAE,OAAO,SAA2C;CACnE,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAAC,QAAD;EAAM,WAAU;EAAyB,UAAA,QAAQ,IAAI,IAAK,QAAQ,QAAS,IAAA,CAAK,QAAQ,CAAC,EAAE,KAAK;CAAU,CAAA;AACnH;AAEA,SAAS,UAAU,EACjB,SACA,YACA,MACA,MACA,SAOC;CACD,MAAM,SAASA,0BAAAA,cAAc,SAAS,YAAY,MAAM,iBAAiB;CACzE,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EAAoB,uBAAqB;EACrD,UAAA,OAAO,KAAK,OAAO,UAClB,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;GAAiB,WAAU;GAA3B,UAAA,CACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;IAAK,WAAU;IAAf,UAAA;KACGC,0BAAAA,mBAAmB,MAAM,OAAO,IAAI;KAAE;KAAC,iBAAA,GAAA,kBAAA,IAAA,CAAC,SAAD;MAAS,OAAO,MAAM;MAAc;KAAQ,CAAA;IACjF;GACL,CAAA,GAAA,iBAAA,GAAA,kBAAA,IAAA,CAAC,MAAD;IAAI,WAAU;IACX,UAAA,MAAM,OAAO,KAA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