@flanksource/clicky-ui 0.3.71 → 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/traces/TraceEventStream.cjs +37 -7
- package/dist/data/traces/TraceEventStream.cjs.map +1 -1
- package/dist/data/traces/TraceEventStream.d.ts.map +1 -1
- package/dist/data/traces/TraceEventStream.js +37 -7
- package/dist/data/traces/TraceEventStream.js.map +1 -1
- package/dist/data/traces/TraceFeed.cjs +71 -106
- package/dist/data/traces/TraceFeed.cjs.map +1 -1
- package/dist/data/traces/TraceFeed.d.ts +3 -10
- package/dist/data/traces/TraceFeed.d.ts.map +1 -1
- package/dist/data/traces/TraceFeed.js +72 -107
- package/dist/data/traces/TraceFeed.js.map +1 -1
- package/dist/data/traces/trace-feed.cjs.map +1 -1
- package/dist/data/traces/trace-feed.d.ts +15 -0
- package/dist/data/traces/trace-feed.d.ts.map +1 -1
- package/dist/data/traces/trace-feed.js.map +1 -1
- package/dist/data/traces/use-trace-feed.cjs +100 -0
- package/dist/data/traces/use-trace-feed.cjs.map +1 -0
- package/dist/data/traces/use-trace-feed.d.ts +11 -0
- package/dist/data/traces/use-trace-feed.d.ts.map +1 -0
- package/dist/data/traces/use-trace-feed.js +100 -0
- package/dist/data/traces/use-trace-feed.js.map +1 -0
- 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/hooks/event-hub.cjs +24 -2
- package/dist/hooks/event-hub.cjs.map +1 -1
- package/dist/hooks/event-hub.d.ts +2 -0
- package/dist/hooks/event-hub.d.ts.map +1 -1
- package/dist/hooks/event-hub.js +24 -2
- package/dist/hooks/event-hub.js.map +1 -1
- package/dist/hooks/event-stream.cjs +64 -0
- package/dist/hooks/event-stream.cjs.map +1 -0
- package/dist/hooks/event-stream.d.ts +13 -0
- package/dist/hooks/event-stream.d.ts.map +1 -0
- package/dist/hooks/event-stream.js +64 -0
- package/dist/hooks/event-stream.js.map +1 -0
- package/dist/hooks/log-tail-session.cjs +53 -0
- package/dist/hooks/log-tail-session.cjs.map +1 -0
- package/dist/hooks/log-tail-session.d.ts +31 -0
- package/dist/hooks/log-tail-session.d.ts.map +1 -0
- package/dist/hooks/log-tail-session.js +53 -0
- package/dist/hooks/log-tail-session.js.map +1 -0
- package/dist/hooks/tail-buffer.cjs +15 -0
- package/dist/hooks/tail-buffer.cjs.map +1 -0
- package/dist/hooks/tail-buffer.d.ts +11 -0
- package/dist/hooks/tail-buffer.d.ts.map +1 -0
- package/dist/hooks/tail-buffer.js +15 -0
- package/dist/hooks/tail-buffer.js.map +1 -0
- package/dist/hooks/use-live-snapshot.cjs +60 -0
- package/dist/hooks/use-live-snapshot.cjs.map +1 -0
- package/dist/hooks/use-live-snapshot.d.ts +9 -0
- package/dist/hooks/use-live-snapshot.d.ts.map +1 -0
- package/dist/hooks/use-live-snapshot.js +60 -0
- package/dist/hooks/use-live-snapshot.js.map +1 -0
- package/dist/hooks/use-log-tail.cjs +125 -112
- package/dist/hooks/use-log-tail.cjs.map +1 -1
- package/dist/hooks/use-log-tail.d.ts +2 -24
- package/dist/hooks/use-log-tail.d.ts.map +1 -1
- package/dist/hooks/use-log-tail.js +125 -112
- package/dist/hooks/use-log-tail.js.map +1 -1
- package/dist/hooks.cjs +6 -0
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +4 -1
- package/dist/index.cjs +14 -1
- package/dist/index.js +8 -2
- package/dist/runtime/barrels.json +7017 -6986
- package/dist/runtime/importmap.json +2129 -2115
- 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,53 +1,182 @@
|
|
|
1
1
|
// src/data/log-sections.ts
|
|
2
|
-
var
|
|
3
|
-
|
|
2
|
+
var COMMANDS = /* @__PURE__ */ new Set([
|
|
3
|
+
"group",
|
|
4
|
+
"endgroup",
|
|
5
|
+
"notice",
|
|
6
|
+
"warning",
|
|
7
|
+
"error",
|
|
8
|
+
"debug",
|
|
9
|
+
"progress",
|
|
10
|
+
"description",
|
|
11
|
+
"status",
|
|
12
|
+
"stop-commands"
|
|
13
|
+
]);
|
|
14
|
+
var ANNOTATIONS = {
|
|
15
|
+
error: "Error",
|
|
16
|
+
warning: "Warning",
|
|
17
|
+
notice: "Notice"
|
|
18
|
+
};
|
|
19
|
+
var ESCAPES = {
|
|
20
|
+
"%25": "%",
|
|
21
|
+
"%0D": "\r",
|
|
22
|
+
"%0A": "\n"
|
|
23
|
+
};
|
|
24
|
+
var DOWNLOADED_MARKER = /^##\[(group|endgroup)\](.*)$/;
|
|
25
|
+
var COUNT = /^\s*(\d+)\s*$/;
|
|
26
|
+
function readCommand(line) {
|
|
27
|
+
const marker = DOWNLOADED_MARKER.exec(line);
|
|
28
|
+
if (marker) return {
|
|
29
|
+
name: marker[1],
|
|
30
|
+
properties: {},
|
|
31
|
+
message: marker[2]
|
|
32
|
+
};
|
|
33
|
+
if (!line.startsWith("::")) return void 0;
|
|
34
|
+
const end = line.indexOf("::", 2);
|
|
35
|
+
if (end < 0) return void 0;
|
|
36
|
+
const head = line.slice(2, end);
|
|
37
|
+
const space = head.indexOf(" ");
|
|
38
|
+
const name = space < 0 ? head : head.slice(0, space);
|
|
39
|
+
if (!COMMANDS.has(name)) return void 0;
|
|
40
|
+
const properties = {};
|
|
41
|
+
const list = space < 0 ? "" : head.slice(space + 1).trim();
|
|
42
|
+
for (const property of list ? list.split(",") : []) {
|
|
43
|
+
const [key, ...value] = property.split("=");
|
|
44
|
+
if (!key?.trim() || value.length === 0) return void 0;
|
|
45
|
+
properties[key.trim()] = value.join("=");
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
name,
|
|
49
|
+
properties,
|
|
50
|
+
message: line.slice(end + 2).replace(/%25|%0D|%0A/g, (escape) => ESCAPES[escape])
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
/** `::progress::3/10` or `::progress done=3,total=10::`; undefined when it is neither. */
|
|
54
|
+
function readProgress({ properties, message }) {
|
|
55
|
+
const slash = message.indexOf("/");
|
|
56
|
+
const named = "done" in properties || "total" in properties;
|
|
57
|
+
const done = COUNT.exec(named ? properties.done ?? "" : message.slice(0, Math.max(slash, 0)));
|
|
58
|
+
const total = COUNT.exec(named ? properties.total ?? "" : message.slice(slash + 1));
|
|
59
|
+
return done && total ? {
|
|
60
|
+
done: Number(done[1]),
|
|
61
|
+
total: Number(total[1])
|
|
62
|
+
} : void 0;
|
|
63
|
+
}
|
|
4
64
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* `endgroup` with no open group is dropped (a
|
|
9
|
-
* still open at the end is returned
|
|
65
|
+
* Reads a log's workflow commands, as a step prints them (`::group::name`) or
|
|
66
|
+
* as GitHub's downloaded logs carry group markers (`##[group]name`).
|
|
67
|
+
*
|
|
68
|
+
* Groups become nested sections: an `endgroup` with no open group is dropped (a
|
|
69
|
+
* tail cut its start off) and a group still open at the end is returned
|
|
70
|
+
* unclosed (its output is still arriving). A status is a line of the log unless
|
|
71
|
+
* it repeats the one before it, annotations are lines, and the latest
|
|
72
|
+
* description, status and progress are returned beside the sections. A command
|
|
73
|
+
* that does not parse stays as it was printed.
|
|
10
74
|
*/
|
|
11
75
|
function parseLogSections(logs) {
|
|
12
76
|
const root = [];
|
|
77
|
+
const log = {
|
|
78
|
+
sections: root,
|
|
79
|
+
hasCommands: false
|
|
80
|
+
};
|
|
13
81
|
const stack = [];
|
|
14
82
|
let text = [];
|
|
15
|
-
|
|
83
|
+
let stopToken = "";
|
|
84
|
+
let lastStatus;
|
|
16
85
|
const flush = () => {
|
|
17
|
-
if (text.length > 0)
|
|
86
|
+
if (text.length > 0) (stack[stack.length - 1]?.children ?? root).push({
|
|
18
87
|
kind: "text",
|
|
19
88
|
text: text.join("\n")
|
|
20
89
|
});
|
|
21
90
|
text = [];
|
|
22
91
|
};
|
|
23
|
-
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
92
|
+
const add = (shown) => {
|
|
93
|
+
const lines = shown.split("\n").length;
|
|
94
|
+
for (const group of stack) group.lines += lines;
|
|
95
|
+
text.push(shown);
|
|
96
|
+
lastStatus = void 0;
|
|
97
|
+
};
|
|
98
|
+
const apply = (command, raw) => {
|
|
99
|
+
const { name, message } = command;
|
|
100
|
+
if (name === "group") {
|
|
27
101
|
flush();
|
|
28
102
|
const group = {
|
|
29
103
|
kind: "group",
|
|
30
|
-
name:
|
|
104
|
+
name: message.trim(),
|
|
31
105
|
lines: 0,
|
|
32
106
|
closed: false,
|
|
33
107
|
children: []
|
|
34
108
|
};
|
|
35
|
-
|
|
109
|
+
(stack[stack.length - 1]?.children ?? root).push(group);
|
|
36
110
|
stack.push(group);
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
if (GROUP_END.test(line)) {
|
|
111
|
+
lastStatus = void 0;
|
|
112
|
+
} else if (name === "endgroup") {
|
|
40
113
|
flush();
|
|
41
114
|
const group = stack.pop();
|
|
42
115
|
if (group) group.closed = true;
|
|
116
|
+
lastStatus = void 0;
|
|
117
|
+
} else if (name === "status") {
|
|
118
|
+
log.status = message;
|
|
119
|
+
if (message !== lastStatus) add(message);
|
|
120
|
+
lastStatus = message;
|
|
121
|
+
} else if (name === "description") log.description = message;
|
|
122
|
+
else if (name === "progress") {
|
|
123
|
+
const progress = readProgress(command);
|
|
124
|
+
if (progress) log.progress = progress;
|
|
125
|
+
else add(raw);
|
|
126
|
+
} else if (name === "stop-commands") {
|
|
127
|
+
stopToken = message;
|
|
128
|
+
if (!message) add(raw);
|
|
129
|
+
} else if (name !== "debug") add(`${ANNOTATIONS[name]}: ${message}`);
|
|
130
|
+
};
|
|
131
|
+
for (const raw of logs.split("\n")) {
|
|
132
|
+
const line = raw.replace(/\r$/, "");
|
|
133
|
+
if (stopToken) {
|
|
134
|
+
if (line === `::${stopToken}::`) stopToken = "";
|
|
135
|
+
else add(raw);
|
|
43
136
|
continue;
|
|
44
137
|
}
|
|
45
|
-
|
|
46
|
-
|
|
138
|
+
const command = readCommand(line);
|
|
139
|
+
if (command) {
|
|
140
|
+
log.hasCommands = true;
|
|
141
|
+
apply(command, raw);
|
|
142
|
+
} else add(raw);
|
|
47
143
|
}
|
|
48
144
|
flush();
|
|
49
|
-
return
|
|
145
|
+
return log;
|
|
146
|
+
}
|
|
147
|
+
/** A closed group is the one row it collapses to; an open one its header and contents. */
|
|
148
|
+
function rowsOf(section) {
|
|
149
|
+
if (section.kind === "text") return section.text.split("\n").length;
|
|
150
|
+
return section.closed ? 1 : 1 + countLogRows(section.children);
|
|
151
|
+
}
|
|
152
|
+
function countLogRows(sections) {
|
|
153
|
+
return sections.reduce((rows, section) => rows + rowsOf(section), 0);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* The first (`head`) or last (`tail`) rows of a log. A closed group counts as
|
|
157
|
+
* one row and is kept whole; an open group keeps its header.
|
|
158
|
+
*/
|
|
159
|
+
function takeLogRows(sections, limit, from) {
|
|
160
|
+
const taken = [];
|
|
161
|
+
let left = limit;
|
|
162
|
+
for (const section of from === "head" ? sections : [...sections].reverse()) {
|
|
163
|
+
if (left <= 0) break;
|
|
164
|
+
const rows = rowsOf(section);
|
|
165
|
+
if (rows <= left) taken.push(section);
|
|
166
|
+
else if (section.kind === "text") {
|
|
167
|
+
const lines = section.text.split("\n");
|
|
168
|
+
taken.push({
|
|
169
|
+
kind: "text",
|
|
170
|
+
text: (from === "head" ? lines.slice(0, left) : lines.slice(-left)).join("\n")
|
|
171
|
+
});
|
|
172
|
+
} else taken.push({
|
|
173
|
+
...section,
|
|
174
|
+
children: takeLogRows(section.children, left - 1, from)
|
|
175
|
+
});
|
|
176
|
+
left -= rows;
|
|
177
|
+
}
|
|
178
|
+
return from === "head" ? taken : taken.reverse();
|
|
50
179
|
}
|
|
51
|
-
export { parseLogSections };
|
|
180
|
+
export { countLogRows, parseLogSections, takeLogRows };
|
|
52
181
|
|
|
53
182
|
//# sourceMappingURL=log-sections.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log-sections.js","names":[],"sources":["../../src/data/log-sections.ts"],"sourcesContent":["/** A run of plain log lines, or a collapsible group of them. */\nexport type LogSection =\n | { kind: \"text\"; text: string }\n | { kind: \"group\"; name: string; lines: number; closed: boolean; children: LogSection[] };\n\nconst GROUP_START = /^(?:::group::|##\\[group\\])(.*)$/;\nconst GROUP_END = /^(?:::endgroup::|##\\[endgroup\\])\\s*$/;\n\n/**\n * Splits log text into sections at GitHub Actions group markers:\n * `::group::name` / `::endgroup::` as a step prints them, or `##[group]name` /\n * `##[endgroup]` as GitHub's downloaded logs carry them. Groups nest. An\n * `endgroup` with no open group is dropped (a tail cut its start off); a group\n * still open at the end is returned unclosed (its output is still arriving).\n */\nexport function parseLogSections(logs: string): LogSection[] {\n const root: LogSection[] = [];\n const stack: Extract<LogSection, { kind: \"group\" }>[] = [];\n let text: string[] = [];\n const target = () => stack[stack.length - 1]?.children ?? root;\n const flush = () => {\n if (text.length > 0) target().push({ kind: \"text\", text: text.join(\"\\n\") });\n text = [];\n };\n for (const raw of logs.split(\"\\n\")) {\n const line = raw.replace(/\\r$/, \"\");\n const start = GROUP_START.exec(line);\n if (start) {\n flush();\n const group = { kind: \"group\" as const, name: start[1]?.trim() ?? \"\", lines: 0, closed: false, children: [] };\n target().push(group);\n stack.push(group);\n continue;\n }\n if (GROUP_END.test(line)) {\n flush();\n const group = stack.pop();\n if (group) group.closed = true;\n continue;\n }\n for (const group of stack) group.lines++;\n text.push(raw);\n }\n flush();\n return root;\n}\n"],"mappings":";AAKA,IAAM,cAAc;AACpB,IAAM,YAAY;;;;;;;;AASlB,SAAgB,iBAAiB,MAA4B;CAC3D,MAAM,OAAqB,CAAC;CAC5B,MAAM,QAAkD,CAAC;CACzD,IAAI,OAAiB,CAAC;CACtB,MAAM,eAAe,MAAM,MAAM,SAAS,EAAE,EAAE,YAAY;CAC1D,MAAM,cAAc;EAClB,IAAI,KAAK,SAAS,GAAG,OAAO,CAAC,CAAC,KAAK;GAAE,MAAM;GAAQ,MAAM,KAAK,KAAK,IAAI;EAAE,CAAC;EAC1E,OAAO,CAAC;CACV;CACA,KAAK,MAAM,OAAO,KAAK,MAAM,IAAI,GAAG;EAClC,MAAM,OAAO,IAAI,QAAQ,OAAO,EAAE;EAClC,MAAM,QAAQ,YAAY,KAAK,IAAI;EACnC,IAAI,OAAO;GACT,MAAM;GACN,MAAM,QAAQ;IAAE,MAAM;IAAkB,MAAM,MAAM,EAAE,EAAE,KAAK,KAAK;IAAI,OAAO;IAAG,QAAQ;IAAO,UAAU,CAAC;GAAE;GAC5G,OAAO,CAAC,CAAC,KAAK,KAAK;GACnB,MAAM,KAAK,KAAK;GAChB;EACF;EACA,IAAI,UAAU,KAAK,IAAI,GAAG;GACxB,MAAM;GACN,MAAM,QAAQ,MAAM,IAAI;GACxB,IAAI,OAAO,MAAM,SAAS;GAC1B;EACF;EACA,KAAK,MAAM,SAAS,OAAO,MAAM;EACjC,KAAK,KAAK,GAAG;CACf;CACA,MAAM;CACN,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"log-sections.js","names":[],"sources":["../../src/data/log-sections.ts"],"sourcesContent":["/** A run of plain log lines, or a collapsible group of them. */\nexport type LogSection =\n | { kind: \"text\"; text: string }\n | { kind: \"group\"; name: string; lines: number; closed: boolean; children: LogSection[] };\n\ntype LogGroup = Extract<LogSection, { kind: \"group\" }>;\n\n/** A log as its workflow commands describe it. */\nexport type ParsedLog = {\n sections: LogSection[];\n /** The latest `::description::`. */\n description?: string;\n /** The latest `::status::`. */\n status?: string;\n /** The latest `::progress::`. */\n progress?: { done: number; total: number };\n /** The log held a command or group marker, so it differs from its sections. */\n hasCommands: boolean;\n};\n\ntype Command = { name: string; properties: Record<string, string>; message: string };\n\n// The commands gavel reads from a fixture step (fixtures/workflow_commands.go);\n// a line naming any other is ordinary output, as on GitHub.\nconst COMMANDS = new Set([\n \"group\", \"endgroup\", \"notice\", \"warning\", \"error\", \"debug\", \"progress\", \"description\", \"status\", \"stop-commands\",\n]);\nconst ANNOTATIONS: Record<string, string> = { error: \"Error\", warning: \"Warning\", notice: \"Notice\" };\nconst ESCAPES: Record<string, string> = { \"%25\": \"%\", \"%0D\": \"\\r\", \"%0A\": \"\\n\" };\nconst DOWNLOADED_MARKER = /^##\\[(group|endgroup)\\](.*)$/;\nconst COUNT = /^\\s*(\\d+)\\s*$/;\n\nfunction readCommand(line: string): Command | undefined {\n const marker = DOWNLOADED_MARKER.exec(line);\n if (marker) return { name: marker[1]!, properties: {}, message: marker[2]! };\n if (!line.startsWith(\"::\")) return undefined;\n const end = line.indexOf(\"::\", 2);\n if (end < 0) return undefined;\n const head = line.slice(2, end);\n const space = head.indexOf(\" \");\n const name = space < 0 ? head : head.slice(0, space);\n if (!COMMANDS.has(name)) return undefined;\n const properties: Record<string, string> = {};\n const list = space < 0 ? \"\" : head.slice(space + 1).trim();\n for (const property of list ? list.split(\",\") : []) {\n const [key, ...value] = property.split(\"=\");\n if (!key?.trim() || value.length === 0) return undefined;\n properties[key.trim()] = value.join(\"=\");\n }\n return { name, properties, message: line.slice(end + 2).replace(/%25|%0D|%0A/g, (escape) => ESCAPES[escape]!) };\n}\n\n/** `::progress::3/10` or `::progress done=3,total=10::`; undefined when it is neither. */\nfunction readProgress({ properties, message }: Command): ParsedLog[\"progress\"] {\n const slash = message.indexOf(\"/\");\n const named = \"done\" in properties || \"total\" in properties;\n const done = COUNT.exec(named ? (properties.done ?? \"\") : message.slice(0, Math.max(slash, 0)));\n const total = COUNT.exec(named ? (properties.total ?? \"\") : message.slice(slash + 1));\n return done && total ? { done: Number(done[1]), total: Number(total[1]) } : undefined;\n}\n\n/**\n * Reads a log's workflow commands, as a step prints them (`::group::name`) or\n * as GitHub's downloaded logs carry group markers (`##[group]name`).\n *\n * Groups become nested sections: an `endgroup` with no open group is dropped (a\n * tail cut its start off) and a group still open at the end is returned\n * unclosed (its output is still arriving). A status is a line of the log unless\n * it repeats the one before it, annotations are lines, and the latest\n * description, status and progress are returned beside the sections. A command\n * that does not parse stays as it was printed.\n */\nexport function parseLogSections(logs: string): ParsedLog {\n const root: LogSection[] = [];\n const log: ParsedLog = { sections: root, hasCommands: false };\n const stack: LogGroup[] = [];\n let text: string[] = [];\n let stopToken = \"\";\n let lastStatus: string | undefined;\n\n const flush = () => {\n if (text.length > 0) (stack[stack.length - 1]?.children ?? root).push({ kind: \"text\", text: text.join(\"\\n\") });\n text = [];\n };\n const add = (shown: string) => {\n const lines = shown.split(\"\\n\").length;\n for (const group of stack) group.lines += lines;\n text.push(shown);\n lastStatus = undefined;\n };\n const apply = (command: Command, raw: string) => {\n const { name, message } = command;\n if (name === \"group\") {\n flush();\n const group: LogGroup = { kind: \"group\", name: message.trim(), lines: 0, closed: false, children: [] };\n (stack[stack.length - 1]?.children ?? root).push(group);\n stack.push(group);\n lastStatus = undefined;\n } else if (name === \"endgroup\") {\n flush();\n const group = stack.pop();\n if (group) group.closed = true;\n lastStatus = undefined;\n } else if (name === \"status\") {\n log.status = message;\n if (message !== lastStatus) add(message);\n lastStatus = message;\n } else if (name === \"description\") {\n log.description = message;\n } else if (name === \"progress\") {\n const progress = readProgress(command);\n if (progress) log.progress = progress;\n else add(raw);\n } else if (name === \"stop-commands\") {\n stopToken = message;\n if (!message) add(raw);\n } else if (name !== \"debug\") {\n add(`${ANNOTATIONS[name]}: ${message}`);\n }\n };\n\n for (const raw of logs.split(\"\\n\")) {\n const line = raw.replace(/\\r$/, \"\");\n if (stopToken) {\n if (line === `::${stopToken}::`) stopToken = \"\";\n else add(raw);\n continue;\n }\n const command = readCommand(line);\n if (command) {\n log.hasCommands = true;\n apply(command, raw);\n } else {\n add(raw);\n }\n }\n flush();\n return log;\n}\n\n/** A closed group is the one row it collapses to; an open one its header and contents. */\nfunction rowsOf(section: LogSection): number {\n if (section.kind === \"text\") return section.text.split(\"\\n\").length;\n return section.closed ? 1 : 1 + countLogRows(section.children);\n}\n\nexport function countLogRows(sections: LogSection[]): number {\n return sections.reduce((rows, section) => rows + rowsOf(section), 0);\n}\n\n/**\n * The first (`head`) or last (`tail`) rows of a log. A closed group counts as\n * one row and is kept whole; an open group keeps its header.\n */\nexport function takeLogRows(sections: LogSection[], limit: number, from: \"head\" | \"tail\"): LogSection[] {\n const taken: LogSection[] = [];\n let left = limit;\n for (const section of from === \"head\" ? sections : [...sections].reverse()) {\n if (left <= 0) break;\n const rows = rowsOf(section);\n if (rows <= left) {\n taken.push(section);\n } else if (section.kind === \"text\") {\n const lines = section.text.split(\"\\n\");\n taken.push({ kind: \"text\", text: (from === \"head\" ? lines.slice(0, left) : lines.slice(-left)).join(\"\\n\") });\n } else {\n taken.push({ ...section, children: takeLogRows(section.children, left - 1, from) });\n }\n left -= rows;\n }\n return from === \"head\" ? taken : taken.reverse();\n}\n"],"mappings":";AAwBA,IAAM,2BAAW,IAAI,IA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AK,MAAM,WAAW,SAAS,SAAS,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,QAAQ,GAAG;EAC1E,IAAI,QAAQ,GAAG;EACf,MAAM,OAAO,OAAO,OAAO;EAC3B,IAAI,QAAQ,MACV,MAAM,KAAK,OAAO;OACb,IAAI,QAAQ,SAAS,QAAQ;GAClC,MAAM,QAAQ,QAAQ,KAAK,MAAM,IAAI;GACrC,MAAM,KAAK;IAAE,MAAM;IAAQ,OAAO,SAAS,SAAS,MAAM,MAAM,GAAG,IAAI,IAAI,MAAM,MAAM,CAAC,IAAI,EAAA,CAAG,KAAK,IAAI;GAAE,CAAC;EAC7G,OACE,MAAM,KAAK;GAAE,GAAG;GAAS,UAAU,YAAY,QAAQ,UAAU,OAAO,GAAG,IAAI;EAAE,CAAC;EAEpF,QAAQ;CACV;CACA,OAAO,SAAS,SAAS,QAAQ,MAAM,QAAQ;AACjD"}
|
|
@@ -277,7 +277,7 @@ function TestDetailPanel({ header = "full", tabVariant = "pill" } = {}) {
|
|
|
277
277
|
const detailAdapter = runner.adapters.resolveDetail(node, runner);
|
|
278
278
|
const actionAdapter = runner.adapters.resolveActions(selected, runner);
|
|
279
279
|
const tabs = runner.adapters.resolveTabs(node, runner);
|
|
280
|
-
if ((node.stdout || node.stderr) && !tabs.some((tab) => tab.id === "stdout")) tabs.unshift({
|
|
280
|
+
if ((node.log || node.stdout || node.stderr) && !tabs.some((tab) => tab.id === "stdout")) tabs.unshift({
|
|
281
281
|
id: "stdout",
|
|
282
282
|
label: "Stdout",
|
|
283
283
|
render: () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestDetailPanel.cjs","names":["useTestRunner","sum","TestFailureDetail","TestOutput","TestAttemptDetail","JsonView","UiCopy","UiHourglass","UiCheck","UiWarningCircle","useCopyFlash","useMemo","UiJson","buildNodeJson","SplitButton","buildNodeBrief","TestViewToggle","Button","Icon","UiRefresh","UiStop","outcomeFor","OutcomeIcon","UiClass","ToolIcon","toolKeyFor","_Fragment","UiClock","formatTestDuration","OpenInFilesLink","relPath","useState","Select","DetailTabSelectProvider","cn","TabButton"],"sources":["../../../src/data/test-runner/TestDetailPanel.tsx"],"sourcesContent":["import { useMemo, useState, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../../components/button\";\nimport { Select } from \"../../components/select\";\nimport { SplitButton } from \"../../components/SplitButton\";\nimport { useCopyFlash, type CopyFlashState } from \"../../components/clipboard\";\nimport type { DropdownMenuItem } from \"../../overlay/DropdownMenu\";\nimport { cn } from \"../../lib/utils\";\nimport { JsonView } from \"../JsonView\";\nimport { TabButton, type TabButtonVariant } from \"../TabButton\";\nimport { OpenInFilesLink } from \"../OpenInFilesLink\";\nimport { relPath } from \"../lint/paths\";\nimport {\n UiCheck,\n UiClass,\n UiClock,\n UiCopy,\n UiHourglass,\n UiJson,\n UiRefresh,\n UiStop,\n UiWarningCircle,\n} from \"../../icons\";\nimport type { Test } from \"./types\";\nimport { useTestRunner } from \"./context\";\nimport { DetailTabSelectProvider } from \"./detailTabContext\";\nimport { buildNodeBrief, buildNodeJson, type CopyItem } from \"./copy\";\nimport { formatTestDuration, outcomeFor, sum } from \"./status\";\nimport { toolKeyFor } from \"./marks\";\nimport { OutcomeIcon, ToolIcon } from \"./MarkIcons\";\nimport { TestFailureDetail, TestOutput } from \"./TestFailureDetail\";\nimport { TestAttemptDetail } from \"./TestAttemptDetail\";\nimport { TestViewToggle } from \"./TestViewToggle\";\n\n/** Built-in detail body — used when no adapter contributes `renderDetail`. */\nfunction DefaultDetailBody({ node }: { node: Test }) {\n const runner = useTestRunner();\n const attempt = node.attempts?.at(-1);\n const hasChildren = (node.children?.length ?? 0) > 0;\n const counts = hasChildren ? sum(node) : null;\n return (\n <div className=\"space-y-4 p-density-4\">\n {node.message && !node.failure_detail && (\n <p className=\"whitespace-pre-wrap break-words text-sm\">{node.message}</p>\n )}\n {node.failure_detail && <TestFailureDetail failure={node.failure_detail} />}\n <TestOutput node={node} />\n {attempt && (\n <TestAttemptDetail\n key={`${attempt.run_kind ?? \"\"}:${attempt.sequence}`}\n attempt={attempt}\n {...(runner.fetchProcessMetrics ? { fetchProcessMetrics: runner.fetchProcessMetrics } : {})}\n />\n )}\n {counts && counts.total > 0 && (\n <div className=\"flex flex-wrap gap-3 text-xs text-muted-foreground\">\n <span>{counts.total} total</span>\n {counts.passed > 0 && <span>{counts.passed} passed</span>}\n {counts.failed > 0 && <span>{counts.failed} failed</span>}\n {counts.skipped > 0 && <span>{counts.skipped} skipped</span>}\n </div>\n )}\n {node.detail != null && (\n <div className=\"space-y-1\">\n <div className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">Detail</div>\n <JsonView data={node.detail} />\n </div>\n )}\n </div>\n );\n}\n\nfunction copyMenuItem(item: CopyItem, copy: (text: string) => void): DropdownMenuItem {\n const icon = item.icon ? { icon: item.icon } : {};\n if (\"reason\" in item) {\n return { label: item.label, ...icon, disabled: true, title: item.reason, onSelect: () => {} };\n }\n return { label: item.label, ...icon, onSelect: () => copy(item.value) };\n}\n\nconst COPY_LABEL = {\n idle: \"Copy details\",\n pending: \"Copying…\",\n copied: \"Copied\",\n error: \"Copy failed\",\n} as const satisfies Record<CopyFlashState, string>;\nconst COPY_ICON = {\n idle: UiCopy,\n pending: UiHourglass,\n copied: UiCheck,\n error: UiWarningCircle,\n} as const satisfies Record<CopyFlashState, unknown>;\n\n/**\n * \"Copy details\" split button: the primary action copies a Markdown brief of\n * the generic sections plus every matching adapter's `copy` sections; the menu\n * offers the node as JSON and the adapters' items, disabled with a reason when\n * they have nothing to copy. The label flips to \"Copied\" or \"Copy failed\".\n */\nfunction CopyDetailsButton({ node }: { node: Test }) {\n const runner = useTestRunner();\n const { state, copy } = useCopyFlash();\n const sections = useMemo(() => runner.adapters.resolveCopy(node, runner), [node, runner]);\n const items: DropdownMenuItem[] = [\n { label: \"Copy as JSON\", icon: UiJson, onSelect: () => copy(buildNodeJson(node)) },\n ...sections.items.map((item) => copyMenuItem(item, copy)),\n ];\n return (\n <SplitButton\n label={COPY_LABEL[state]}\n icon={COPY_ICON[state]}\n variant=\"outline\"\n size=\"sm\"\n align=\"right\"\n title=\"More copy options\"\n onClick={() => copy(buildNodeBrief(node, sections))}\n items={items}\n />\n );\n}\n\ntype DetailHeaderProps = { node: Test; actionNode: Test; actions?: ReactNode; attemptChooser?: ReactNode };\n\n/** The attempt chooser, adapter actions, copy and rerun/stop controls for the shown node. */\nfunction DetailActions({ node, actionNode, actions, attemptChooser }: DetailHeaderProps) {\n const runner = useTestRunner();\n const canRerun = !!runner.onRerun && actionNode.framework !== \"task\";\n const canStop = !!runner.onStop && !!actionNode.can_stop && !!actionNode.task_id;\n return (\n <div className=\"ml-auto flex shrink-0 items-center gap-1\" data-detail-actions=\"\">\n {attemptChooser}\n {actions}\n {/* The list view carries the toggle in its toolbar, so its inline detail doesn't repeat it. */}\n {runner.view !== \"list\" && <TestViewToggle />}\n <CopyDetailsButton node={node} />\n {canRerun && (\n <Button\n size=\"sm\"\n disabled={runner.busy.rerun}\n onClick={() => runner.onRerun!(actionNode)}\n title=\"Rerun this test or subtree\"\n >\n <Icon icon={UiRefresh} className=\"mr-1 text-sm\" />\n {runner.busy.rerun ? \"Running...\" : \"Rerun\"}\n </Button>\n )}\n {canStop && (\n <Button\n size=\"sm\"\n variant=\"destructive\"\n disabled={runner.busy.stop}\n onClick={() => runner.onStop!(actionNode)}\n title=\"Stop this running task\"\n >\n <Icon icon={UiStop} className=\"mr-1 text-sm\" />\n {runner.busy.stop ? \"Stopping...\" : \"Stop\"}\n </Button>\n )}\n </div>\n );\n}\n\nfunction DetailHeader(props: DetailHeaderProps) {\n const { node } = props;\n const runner = useTestRunner();\n const outcome = outcomeFor(node);\n const location = node.file ? `${node.file}${node.line ? `:${node.line}` : \"\"}` : undefined;\n const frameworkBadge = runner.adapters.resolveFrameworkBadge(node, runner);\n return (\n <div\n className=\"flex min-w-0 items-center gap-2 border-b border-border px-density-4 py-density-2\"\n data-detail-header=\"\"\n >\n {outcome ? (\n <OutcomeIcon outcome={outcome} className=\"text-lg\" />\n ) : (\n <Icon icon={UiClass} className=\"shrink-0 text-lg text-muted-foreground\" />\n )}\n <h2 className=\"min-w-0 shrink truncate text-base font-semibold\" title={node.name}>\n {node.name}\n </h2>\n {node.framework && (\n <span\n className=\"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground\"\n data-framework-badge=\"\"\n >\n <ToolIcon tool={toolKeyFor(node)} className=\"text-sm\" />\n {node.framework}\n {frameworkBadge != null && (\n <>\n <span aria-hidden=\"true\">·</span>\n {frameworkBadge}\n </>\n )}\n </span>\n )}\n {node.duration ? (\n <span className=\"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground\">\n <Icon icon={UiClock} className=\"text-xs\" />\n {formatTestDuration(node.duration)}\n </span>\n ) : null}\n {location && (\n <span\n className=\"min-w-0 shrink-[100] truncate font-mono text-xs text-muted-foreground\"\n title={location}\n >\n {location}\n </span>\n )}\n {node.file && runner.onOpenFile && (\n <OpenInFilesLink\n className=\"shrink-0\"\n onOpenFile={runner.onOpenFile}\n target={{\n file: relPath(node.file, node.work_dir)!,\n ...(node.work_dir ? { workDir: node.work_dir } : {}),\n ...(node.line ? { line: node.line } : {}),\n }}\n />\n )}\n <DetailActions {...props} />\n </div>\n );\n}\n\n/**\n * The right pane. Resolves the node's adapter for body / tabs / header actions,\n * falling back to the built-in default body. Shows an empty state when nothing\n * is selected.\n *\n * `header=\"actions\"` drops the node's identity (outcome, name, tool, duration,\n * location) for hosts that already show it, e.g. an expandable card, and keeps\n * only the controls, in the tab row when there are tabs. `tabVariant` picks the\n * tab row style (filled `pill`, the default, or `underline`).\n */\nexport function TestDetailPanel({ header = \"full\", tabVariant = \"pill\" }: { header?: \"full\" | \"actions\"; tabVariant?: TabButtonVariant } = {}) {\n const runner = useTestRunner();\n const selected = runner.selected;\n const [attemptSelection, setAttemptSelection] = useState<{ key: string; id: number } | null>(null);\n // Tab state is controlled when the host supplies activeTab (e.g. to mirror it\n // into the URL); otherwise the panel owns it. The render below tolerates an\n // unknown id by falling back to the built-in \"detail\" tab.\n const controlled = runner.activeTab !== undefined;\n const [internalTab, setInternalTab] = useState<string>(\"detail\");\n const activeTab = controlled ? runner.activeTab! : internalTab;\n const setActiveTab = (id: string) => {\n if (controlled) runner.onTabChange?.(id);\n else setInternalTab(id);\n };\n\n if (!selected) {\n return (\n <div className=\"flex h-full items-center justify-center text-sm text-muted-foreground\">\n <div className=\"text-center\">\n <Icon icon={UiClass} className=\"mb-2 block text-4xl\" />\n Select a test to view its details.\n </div>\n </div>\n );\n }\n\n const attempts = runner.adapters.resolveAttempts(selected, runner);\n const key = selected.task_id ?? selected.name;\n const attemptId = runner.activeAttempt ?? (attemptSelection?.key === key ? attemptSelection.id : undefined);\n const attempt = attempts.find((a) => a.id === attemptId) ?? attempts.at(-1);\n const node = attempts.length > 1 && attempt ? attempt.node : selected;\n const attemptChooser = attempts.length > 1 && attempt ? (\n <div className=\"w-44 shrink-0\">\n <Select aria-label=\"Attempt\" value={String(attempt.id)} className=\"h-7 text-xs\" onChange={(event) => {\n const id = Number(event.target.value);\n if (runner.onAttemptChange) runner.onAttemptChange(id);\n else setAttemptSelection({ key, id });\n }} options={attempts.map((a) => ({ value: String(a.id), label: `Attempt ${a.id}/${attempts.length} · ${a.status}${a.durationMs !== undefined ? ` · ${formatTestDuration(a.durationMs * 1e6)}` : \"\"}` }))} />\n </div>\n ) : null;\n\n const detailAdapter = runner.adapters.resolveDetail(node, runner);\n const actionAdapter = runner.adapters.resolveActions(selected, runner);\n const tabs = runner.adapters.resolveTabs(node, runner);\n if ((node.stdout || node.stderr) && !tabs.some((tab) => tab.id === \"stdout\")) {\n tabs.unshift({\n id: \"stdout\",\n label: \"Stdout\",\n render: () => <div className=\"p-density-4\"><TestOutput node={node} view=\"full\" /></div>,\n });\n }\n const ownsScroll = runner.adapters.ownsScroll(node, runner);\n\n const body = (\n <DetailTabSelectProvider value={setActiveTab}>\n {detailAdapter?.renderDetail\n ? detailAdapter.renderDetail({ node, runner })\n : <DefaultDetailBody node={node} />}\n </DetailTabSelectProvider>\n );\n const actions = actionAdapter?.nodeActions?.({ node: selected, runner });\n\n // A size container, so log blocks can cap themselves at a share of the pane (cqh).\n const detailRegion = cn(\"min-h-0 flex-1 [container-type:size]\", !ownsScroll && \"overflow-y-auto\");\n\n const headerProps: DetailHeaderProps = { node, actionNode: selected, actions, attemptChooser };\n const fullHeader = header === \"full\";\n\n // No extra tabs → just the body under the header.\n if (tabs.length === 0) {\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {fullHeader ? (\n <DetailHeader {...headerProps} />\n ) : (\n <div className=\"flex shrink-0 border-b border-border px-density-2 py-density-1\">\n <DetailActions {...headerProps} />\n </div>\n )}\n <div className={detailRegion}>{body}</div>\n </div>\n );\n }\n\n const detailTab = { id: \"detail\", label: \"Detail\", render: () => body };\n const allTabs = [detailTab, ...tabs];\n const active = allTabs.find((t) => t.id === activeTab) ?? detailTab;\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {fullHeader && <DetailHeader {...headerProps} />}\n <div className={cn(\"flex shrink-0 items-center gap-1 border-b border-border px-density-2\", tabVariant === \"underline\" ? \"items-stretch\" : \"py-density-1\")}>\n {allTabs.map((t) => (\n <TabButton\n key={t.id}\n active={active.id === t.id}\n onClick={() => setActiveTab(t.id)}\n label={t.label}\n variant={tabVariant}\n />\n ))}\n {!fullHeader && <DetailActions {...headerProps} />}\n </div>\n <div className={detailRegion}>{active.render()}</div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAS,kBAAkB,EAAE,QAAwB;CACnD,MAAM,SAASA,gBAAAA,cAAc;CAC7B,MAAM,UAAU,KAAK,UAAU,GAAG,EAAE;CAEpC,MAAM,UADe,KAAK,UAAU,UAAU,KAA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AAD;IAAK,WAAWA,cAAAA,GAAG,wEAAwE,eAAe,cAAc,kBAAkB,cAAc;IAAxJ,UAAA,CACG,QAAQ,KAAK,MACZ,iBAAA,GAAA,kBAAA,IAAA,CAACC,kBAAAA,WAAD;KAEE,QAAQ,OAAO,OAAO,EAAE;KACxB,eAAe,aAAa,EAAE,EAAE;KAChC,OAAO,EAAE;KACT,SAAS;IACV,GALM,EAAE,EAKR,CACF,GACA,CAAC,cAAc,iBAAA,GAAA,kBAAA,IAAA,CAAC,eAAD,EAAe,GAAI,YAAc,CAAA,CAC9C;;GACL,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAW;IAAe,UAAA,OAAO,OAAO;GAAO,CAAA;EACjD;;AAET"}
|
|
1
|
+
{"version":3,"file":"TestDetailPanel.cjs","names":["useTestRunner","sum","TestFailureDetail","TestOutput","TestAttemptDetail","JsonView","UiCopy","UiHourglass","UiCheck","UiWarningCircle","useCopyFlash","useMemo","UiJson","buildNodeJson","SplitButton","buildNodeBrief","TestViewToggle","Button","Icon","UiRefresh","UiStop","outcomeFor","OutcomeIcon","UiClass","ToolIcon","toolKeyFor","_Fragment","UiClock","formatTestDuration","OpenInFilesLink","relPath","useState","Select","DetailTabSelectProvider","cn","TabButton"],"sources":["../../../src/data/test-runner/TestDetailPanel.tsx"],"sourcesContent":["import { useMemo, useState, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../../components/button\";\nimport { Select } from \"../../components/select\";\nimport { SplitButton } from \"../../components/SplitButton\";\nimport { useCopyFlash, type CopyFlashState } from \"../../components/clipboard\";\nimport type { DropdownMenuItem } from \"../../overlay/DropdownMenu\";\nimport { cn } from \"../../lib/utils\";\nimport { JsonView } from \"../JsonView\";\nimport { TabButton, type TabButtonVariant } from \"../TabButton\";\nimport { OpenInFilesLink } from \"../OpenInFilesLink\";\nimport { relPath } from \"../lint/paths\";\nimport {\n UiCheck,\n UiClass,\n UiClock,\n UiCopy,\n UiHourglass,\n UiJson,\n UiRefresh,\n UiStop,\n UiWarningCircle,\n} from \"../../icons\";\nimport type { Test } from \"./types\";\nimport { useTestRunner } from \"./context\";\nimport { DetailTabSelectProvider } from \"./detailTabContext\";\nimport { buildNodeBrief, buildNodeJson, type CopyItem } from \"./copy\";\nimport { formatTestDuration, outcomeFor, sum } from \"./status\";\nimport { toolKeyFor } from \"./marks\";\nimport { OutcomeIcon, ToolIcon } from \"./MarkIcons\";\nimport { TestFailureDetail, TestOutput } from \"./TestFailureDetail\";\nimport { TestAttemptDetail } from \"./TestAttemptDetail\";\nimport { TestViewToggle } from \"./TestViewToggle\";\n\n/** Built-in detail body — used when no adapter contributes `renderDetail`. */\nfunction DefaultDetailBody({ node }: { node: Test }) {\n const runner = useTestRunner();\n const attempt = node.attempts?.at(-1);\n const hasChildren = (node.children?.length ?? 0) > 0;\n const counts = hasChildren ? sum(node) : null;\n return (\n <div className=\"space-y-4 p-density-4\">\n {node.message && !node.failure_detail && (\n <p className=\"whitespace-pre-wrap break-words text-sm\">{node.message}</p>\n )}\n {node.failure_detail && <TestFailureDetail failure={node.failure_detail} />}\n <TestOutput node={node} />\n {attempt && (\n <TestAttemptDetail\n key={`${attempt.run_kind ?? \"\"}:${attempt.sequence}`}\n attempt={attempt}\n {...(runner.fetchProcessMetrics ? { fetchProcessMetrics: runner.fetchProcessMetrics } : {})}\n />\n )}\n {counts && counts.total > 0 && (\n <div className=\"flex flex-wrap gap-3 text-xs text-muted-foreground\">\n <span>{counts.total} total</span>\n {counts.passed > 0 && <span>{counts.passed} passed</span>}\n {counts.failed > 0 && <span>{counts.failed} failed</span>}\n {counts.skipped > 0 && <span>{counts.skipped} skipped</span>}\n </div>\n )}\n {node.detail != null && (\n <div className=\"space-y-1\">\n <div className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">Detail</div>\n <JsonView data={node.detail} />\n </div>\n )}\n </div>\n );\n}\n\nfunction copyMenuItem(item: CopyItem, copy: (text: string) => void): DropdownMenuItem {\n const icon = item.icon ? { icon: item.icon } : {};\n if (\"reason\" in item) {\n return { label: item.label, ...icon, disabled: true, title: item.reason, onSelect: () => {} };\n }\n return { label: item.label, ...icon, onSelect: () => copy(item.value) };\n}\n\nconst COPY_LABEL = {\n idle: \"Copy details\",\n pending: \"Copying…\",\n copied: \"Copied\",\n error: \"Copy failed\",\n} as const satisfies Record<CopyFlashState, string>;\nconst COPY_ICON = {\n idle: UiCopy,\n pending: UiHourglass,\n copied: UiCheck,\n error: UiWarningCircle,\n} as const satisfies Record<CopyFlashState, unknown>;\n\n/**\n * \"Copy details\" split button: the primary action copies a Markdown brief of\n * the generic sections plus every matching adapter's `copy` sections; the menu\n * offers the node as JSON and the adapters' items, disabled with a reason when\n * they have nothing to copy. The label flips to \"Copied\" or \"Copy failed\".\n */\nfunction CopyDetailsButton({ node }: { node: Test }) {\n const runner = useTestRunner();\n const { state, copy } = useCopyFlash();\n const sections = useMemo(() => runner.adapters.resolveCopy(node, runner), [node, runner]);\n const items: DropdownMenuItem[] = [\n { label: \"Copy as JSON\", icon: UiJson, onSelect: () => copy(buildNodeJson(node)) },\n ...sections.items.map((item) => copyMenuItem(item, copy)),\n ];\n return (\n <SplitButton\n label={COPY_LABEL[state]}\n icon={COPY_ICON[state]}\n variant=\"outline\"\n size=\"sm\"\n align=\"right\"\n title=\"More copy options\"\n onClick={() => copy(buildNodeBrief(node, sections))}\n items={items}\n />\n );\n}\n\ntype DetailHeaderProps = { node: Test; actionNode: Test; actions?: ReactNode; attemptChooser?: ReactNode };\n\n/** The attempt chooser, adapter actions, copy and rerun/stop controls for the shown node. */\nfunction DetailActions({ node, actionNode, actions, attemptChooser }: DetailHeaderProps) {\n const runner = useTestRunner();\n const canRerun = !!runner.onRerun && actionNode.framework !== \"task\";\n const canStop = !!runner.onStop && !!actionNode.can_stop && !!actionNode.task_id;\n return (\n <div className=\"ml-auto flex shrink-0 items-center gap-1\" data-detail-actions=\"\">\n {attemptChooser}\n {actions}\n {/* The list view carries the toggle in its toolbar, so its inline detail doesn't repeat it. */}\n {runner.view !== \"list\" && <TestViewToggle />}\n <CopyDetailsButton node={node} />\n {canRerun && (\n <Button\n size=\"sm\"\n disabled={runner.busy.rerun}\n onClick={() => runner.onRerun!(actionNode)}\n title=\"Rerun this test or subtree\"\n >\n <Icon icon={UiRefresh} className=\"mr-1 text-sm\" />\n {runner.busy.rerun ? \"Running...\" : \"Rerun\"}\n </Button>\n )}\n {canStop && (\n <Button\n size=\"sm\"\n variant=\"destructive\"\n disabled={runner.busy.stop}\n onClick={() => runner.onStop!(actionNode)}\n title=\"Stop this running task\"\n >\n <Icon icon={UiStop} className=\"mr-1 text-sm\" />\n {runner.busy.stop ? \"Stopping...\" : \"Stop\"}\n </Button>\n )}\n </div>\n );\n}\n\nfunction DetailHeader(props: DetailHeaderProps) {\n const { node } = props;\n const runner = useTestRunner();\n const outcome = outcomeFor(node);\n const location = node.file ? `${node.file}${node.line ? `:${node.line}` : \"\"}` : undefined;\n const frameworkBadge = runner.adapters.resolveFrameworkBadge(node, runner);\n return (\n <div\n className=\"flex min-w-0 items-center gap-2 border-b border-border px-density-4 py-density-2\"\n data-detail-header=\"\"\n >\n {outcome ? (\n <OutcomeIcon outcome={outcome} className=\"text-lg\" />\n ) : (\n <Icon icon={UiClass} className=\"shrink-0 text-lg text-muted-foreground\" />\n )}\n <h2 className=\"min-w-0 shrink truncate text-base font-semibold\" title={node.name}>\n {node.name}\n </h2>\n {node.framework && (\n <span\n className=\"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground\"\n data-framework-badge=\"\"\n >\n <ToolIcon tool={toolKeyFor(node)} className=\"text-sm\" />\n {node.framework}\n {frameworkBadge != null && (\n <>\n <span aria-hidden=\"true\">·</span>\n {frameworkBadge}\n </>\n )}\n </span>\n )}\n {node.duration ? (\n <span className=\"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground\">\n <Icon icon={UiClock} className=\"text-xs\" />\n {formatTestDuration(node.duration)}\n </span>\n ) : null}\n {location && (\n <span\n className=\"min-w-0 shrink-[100] truncate font-mono text-xs text-muted-foreground\"\n title={location}\n >\n {location}\n </span>\n )}\n {node.file && runner.onOpenFile && (\n <OpenInFilesLink\n className=\"shrink-0\"\n onOpenFile={runner.onOpenFile}\n target={{\n file: relPath(node.file, node.work_dir)!,\n ...(node.work_dir ? { workDir: node.work_dir } : {}),\n ...(node.line ? { line: node.line } : {}),\n }}\n />\n )}\n <DetailActions {...props} />\n </div>\n );\n}\n\n/**\n * The right pane. Resolves the node's adapter for body / tabs / header actions,\n * falling back to the built-in default body. Shows an empty state when nothing\n * is selected.\n *\n * `header=\"actions\"` drops the node's identity (outcome, name, tool, duration,\n * location) for hosts that already show it, e.g. an expandable card, and keeps\n * only the controls, in the tab row when there are tabs. `tabVariant` picks the\n * tab row style (filled `pill`, the default, or `underline`).\n */\nexport function TestDetailPanel({ header = \"full\", tabVariant = \"pill\" }: { header?: \"full\" | \"actions\"; tabVariant?: TabButtonVariant } = {}) {\n const runner = useTestRunner();\n const selected = runner.selected;\n const [attemptSelection, setAttemptSelection] = useState<{ key: string; id: number } | null>(null);\n // Tab state is controlled when the host supplies activeTab (e.g. to mirror it\n // into the URL); otherwise the panel owns it. The render below tolerates an\n // unknown id by falling back to the built-in \"detail\" tab.\n const controlled = runner.activeTab !== undefined;\n const [internalTab, setInternalTab] = useState<string>(\"detail\");\n const activeTab = controlled ? runner.activeTab! : internalTab;\n const setActiveTab = (id: string) => {\n if (controlled) runner.onTabChange?.(id);\n else setInternalTab(id);\n };\n\n if (!selected) {\n return (\n <div className=\"flex h-full items-center justify-center text-sm text-muted-foreground\">\n <div className=\"text-center\">\n <Icon icon={UiClass} className=\"mb-2 block text-4xl\" />\n Select a test to view its details.\n </div>\n </div>\n );\n }\n\n const attempts = runner.adapters.resolveAttempts(selected, runner);\n const key = selected.task_id ?? selected.name;\n const attemptId = runner.activeAttempt ?? (attemptSelection?.key === key ? attemptSelection.id : undefined);\n const attempt = attempts.find((a) => a.id === attemptId) ?? attempts.at(-1);\n const node = attempts.length > 1 && attempt ? attempt.node : selected;\n const attemptChooser = attempts.length > 1 && attempt ? (\n <div className=\"w-44 shrink-0\">\n <Select aria-label=\"Attempt\" value={String(attempt.id)} className=\"h-7 text-xs\" onChange={(event) => {\n const id = Number(event.target.value);\n if (runner.onAttemptChange) runner.onAttemptChange(id);\n else setAttemptSelection({ key, id });\n }} options={attempts.map((a) => ({ value: String(a.id), label: `Attempt ${a.id}/${attempts.length} · ${a.status}${a.durationMs !== undefined ? ` · ${formatTestDuration(a.durationMs * 1e6)}` : \"\"}` }))} />\n </div>\n ) : null;\n\n const detailAdapter = runner.adapters.resolveDetail(node, runner);\n const actionAdapter = runner.adapters.resolveActions(selected, runner);\n const tabs = runner.adapters.resolveTabs(node, runner);\n if ((node.log || node.stdout || node.stderr) && !tabs.some((tab) => tab.id === \"stdout\")) {\n tabs.unshift({\n id: \"stdout\",\n label: \"Stdout\",\n render: () => <div className=\"p-density-4\"><TestOutput node={node} view=\"full\" /></div>,\n });\n }\n const ownsScroll = runner.adapters.ownsScroll(node, runner);\n\n const body = (\n <DetailTabSelectProvider value={setActiveTab}>\n {detailAdapter?.renderDetail\n ? detailAdapter.renderDetail({ node, runner })\n : <DefaultDetailBody node={node} />}\n </DetailTabSelectProvider>\n );\n const actions = actionAdapter?.nodeActions?.({ node: selected, runner });\n\n // A size container, so log blocks can cap themselves at a share of the pane (cqh).\n const detailRegion = cn(\"min-h-0 flex-1 [container-type:size]\", !ownsScroll && \"overflow-y-auto\");\n\n const headerProps: DetailHeaderProps = { node, actionNode: selected, actions, attemptChooser };\n const fullHeader = header === \"full\";\n\n // No extra tabs → just the body under the header.\n if (tabs.length === 0) {\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {fullHeader ? (\n <DetailHeader {...headerProps} />\n ) : (\n <div className=\"flex shrink-0 border-b border-border px-density-2 py-density-1\">\n <DetailActions {...headerProps} />\n </div>\n )}\n <div className={detailRegion}>{body}</div>\n </div>\n );\n }\n\n const detailTab = { id: \"detail\", label: \"Detail\", render: () => body };\n const allTabs = [detailTab, ...tabs];\n const active = allTabs.find((t) => t.id === activeTab) ?? detailTab;\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {fullHeader && <DetailHeader {...headerProps} />}\n <div className={cn(\"flex shrink-0 items-center gap-1 border-b border-border px-density-2\", tabVariant === \"underline\" ? \"items-stretch\" : \"py-density-1\")}>\n {allTabs.map((t) => (\n <TabButton\n key={t.id}\n active={active.id === t.id}\n onClick={() => setActiveTab(t.id)}\n label={t.label}\n variant={tabVariant}\n />\n ))}\n {!fullHeader && <DetailActions {...headerProps} />}\n </div>\n <div className={detailRegion}>{active.render()}</div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAS,kBAAkB,EAAE,QAAwB;CACnD,MAAM,SAASA,gBAAAA,cAAc;CAC7B,MAAM,UAAU,KAAK,UAAU,GAAG,EAAE;CAEpC,MAAM,UADe,KAAK,UAAU,UAAU,KAAK,IACtBC,eAAAA,IAAI,IAAI,IAAI;CACzC,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACG,KAAK,WAAW,CAAC,KAAK,kBACrB,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IAAG,WAAU;IAA2C,UAAA,KAAK;GAAW,CAAA;GAEzE,KAAK,kBAAkB,iBAAA,GAAA,kBAAA,IAAA,CAACC,0BAAAA,mBAAD,EAAmB,SAAS,KAAK,eAAiB,CAAA;GAC1E,iBAAA,GAAA,kBAAA,IAAA,CAACC,0BAAAA,YAAD,EAAkB,KAAO,CAAA;GACxB,WACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,0BAAAA,mBAAD;IAEW;IACT,GAAK,OAAO,sBAAsB,EAAE,qBAAqB,OAAO,oBAAoB,IAAI,CAAC;GAC1F,GAHM,GAAG,QAAQ,YAAY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.adapters.resolveDetail(node, runner);
|
|
278
278
|
const actionAdapter = runner.adapters.resolveActions(selected, runner);
|
|
279
279
|
const tabs = runner.adapters.resolveTabs(node, runner);
|
|
280
|
-
if ((node.stdout || node.stderr) && !tabs.some((tab) => tab.id === "stdout")) tabs.unshift({
|
|
280
|
+
if ((node.log || node.stdout || node.stderr) && !tabs.some((tab) => tab.id === "stdout")) tabs.unshift({
|
|
281
281
|
id: "stdout",
|
|
282
282
|
label: "Stdout",
|
|
283
283
|
render: () => /* @__PURE__ */ jsx("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestDetailPanel.js","names":["_Fragment"],"sources":["../../../src/data/test-runner/TestDetailPanel.tsx"],"sourcesContent":["import { useMemo, useState, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../../components/button\";\nimport { Select } from \"../../components/select\";\nimport { SplitButton } from \"../../components/SplitButton\";\nimport { useCopyFlash, type CopyFlashState } from \"../../components/clipboard\";\nimport type { DropdownMenuItem } from \"../../overlay/DropdownMenu\";\nimport { cn } from \"../../lib/utils\";\nimport { JsonView } from \"../JsonView\";\nimport { TabButton, type TabButtonVariant } from \"../TabButton\";\nimport { OpenInFilesLink } from \"../OpenInFilesLink\";\nimport { relPath } from \"../lint/paths\";\nimport {\n UiCheck,\n UiClass,\n UiClock,\n UiCopy,\n UiHourglass,\n UiJson,\n UiRefresh,\n UiStop,\n UiWarningCircle,\n} from \"../../icons\";\nimport type { Test } from \"./types\";\nimport { useTestRunner } from \"./context\";\nimport { DetailTabSelectProvider } from \"./detailTabContext\";\nimport { buildNodeBrief, buildNodeJson, type CopyItem } from \"./copy\";\nimport { formatTestDuration, outcomeFor, sum } from \"./status\";\nimport { toolKeyFor } from \"./marks\";\nimport { OutcomeIcon, ToolIcon } from \"./MarkIcons\";\nimport { TestFailureDetail, TestOutput } from \"./TestFailureDetail\";\nimport { TestAttemptDetail } from \"./TestAttemptDetail\";\nimport { TestViewToggle } from \"./TestViewToggle\";\n\n/** Built-in detail body — used when no adapter contributes `renderDetail`. */\nfunction DefaultDetailBody({ node }: { node: Test }) {\n const runner = useTestRunner();\n const attempt = node.attempts?.at(-1);\n const hasChildren = (node.children?.length ?? 0) > 0;\n const counts = hasChildren ? sum(node) : null;\n return (\n <div className=\"space-y-4 p-density-4\">\n {node.message && !node.failure_detail && (\n <p className=\"whitespace-pre-wrap break-words text-sm\">{node.message}</p>\n )}\n {node.failure_detail && <TestFailureDetail failure={node.failure_detail} />}\n <TestOutput node={node} />\n {attempt && (\n <TestAttemptDetail\n key={`${attempt.run_kind ?? \"\"}:${attempt.sequence}`}\n attempt={attempt}\n {...(runner.fetchProcessMetrics ? { fetchProcessMetrics: runner.fetchProcessMetrics } : {})}\n />\n )}\n {counts && counts.total > 0 && (\n <div className=\"flex flex-wrap gap-3 text-xs text-muted-foreground\">\n <span>{counts.total} total</span>\n {counts.passed > 0 && <span>{counts.passed} passed</span>}\n {counts.failed > 0 && <span>{counts.failed} failed</span>}\n {counts.skipped > 0 && <span>{counts.skipped} skipped</span>}\n </div>\n )}\n {node.detail != null && (\n <div className=\"space-y-1\">\n <div className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">Detail</div>\n <JsonView data={node.detail} />\n </div>\n )}\n </div>\n );\n}\n\nfunction copyMenuItem(item: CopyItem, copy: (text: string) => void): DropdownMenuItem {\n const icon = item.icon ? { icon: item.icon } : {};\n if (\"reason\" in item) {\n return { label: item.label, ...icon, disabled: true, title: item.reason, onSelect: () => {} };\n }\n return { label: item.label, ...icon, onSelect: () => copy(item.value) };\n}\n\nconst COPY_LABEL = {\n idle: \"Copy details\",\n pending: \"Copying…\",\n copied: \"Copied\",\n error: \"Copy failed\",\n} as const satisfies Record<CopyFlashState, string>;\nconst COPY_ICON = {\n idle: UiCopy,\n pending: UiHourglass,\n copied: UiCheck,\n error: UiWarningCircle,\n} as const satisfies Record<CopyFlashState, unknown>;\n\n/**\n * \"Copy details\" split button: the primary action copies a Markdown brief of\n * the generic sections plus every matching adapter's `copy` sections; the menu\n * offers the node as JSON and the adapters' items, disabled with a reason when\n * they have nothing to copy. The label flips to \"Copied\" or \"Copy failed\".\n */\nfunction CopyDetailsButton({ node }: { node: Test }) {\n const runner = useTestRunner();\n const { state, copy } = useCopyFlash();\n const sections = useMemo(() => runner.adapters.resolveCopy(node, runner), [node, runner]);\n const items: DropdownMenuItem[] = [\n { label: \"Copy as JSON\", icon: UiJson, onSelect: () => copy(buildNodeJson(node)) },\n ...sections.items.map((item) => copyMenuItem(item, copy)),\n ];\n return (\n <SplitButton\n label={COPY_LABEL[state]}\n icon={COPY_ICON[state]}\n variant=\"outline\"\n size=\"sm\"\n align=\"right\"\n title=\"More copy options\"\n onClick={() => copy(buildNodeBrief(node, sections))}\n items={items}\n />\n );\n}\n\ntype DetailHeaderProps = { node: Test; actionNode: Test; actions?: ReactNode; attemptChooser?: ReactNode };\n\n/** The attempt chooser, adapter actions, copy and rerun/stop controls for the shown node. */\nfunction DetailActions({ node, actionNode, actions, attemptChooser }: DetailHeaderProps) {\n const runner = useTestRunner();\n const canRerun = !!runner.onRerun && actionNode.framework !== \"task\";\n const canStop = !!runner.onStop && !!actionNode.can_stop && !!actionNode.task_id;\n return (\n <div className=\"ml-auto flex shrink-0 items-center gap-1\" data-detail-actions=\"\">\n {attemptChooser}\n {actions}\n {/* The list view carries the toggle in its toolbar, so its inline detail doesn't repeat it. */}\n {runner.view !== \"list\" && <TestViewToggle />}\n <CopyDetailsButton node={node} />\n {canRerun && (\n <Button\n size=\"sm\"\n disabled={runner.busy.rerun}\n onClick={() => runner.onRerun!(actionNode)}\n title=\"Rerun this test or subtree\"\n >\n <Icon icon={UiRefresh} className=\"mr-1 text-sm\" />\n {runner.busy.rerun ? \"Running...\" : \"Rerun\"}\n </Button>\n )}\n {canStop && (\n <Button\n size=\"sm\"\n variant=\"destructive\"\n disabled={runner.busy.stop}\n onClick={() => runner.onStop!(actionNode)}\n title=\"Stop this running task\"\n >\n <Icon icon={UiStop} className=\"mr-1 text-sm\" />\n {runner.busy.stop ? \"Stopping...\" : \"Stop\"}\n </Button>\n )}\n </div>\n );\n}\n\nfunction DetailHeader(props: DetailHeaderProps) {\n const { node } = props;\n const runner = useTestRunner();\n const outcome = outcomeFor(node);\n const location = node.file ? `${node.file}${node.line ? `:${node.line}` : \"\"}` : undefined;\n const frameworkBadge = runner.adapters.resolveFrameworkBadge(node, runner);\n return (\n <div\n className=\"flex min-w-0 items-center gap-2 border-b border-border px-density-4 py-density-2\"\n data-detail-header=\"\"\n >\n {outcome ? (\n <OutcomeIcon outcome={outcome} className=\"text-lg\" />\n ) : (\n <Icon icon={UiClass} className=\"shrink-0 text-lg text-muted-foreground\" />\n )}\n <h2 className=\"min-w-0 shrink truncate text-base font-semibold\" title={node.name}>\n {node.name}\n </h2>\n {node.framework && (\n <span\n className=\"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground\"\n data-framework-badge=\"\"\n >\n <ToolIcon tool={toolKeyFor(node)} className=\"text-sm\" />\n {node.framework}\n {frameworkBadge != null && (\n <>\n <span aria-hidden=\"true\">·</span>\n {frameworkBadge}\n </>\n )}\n </span>\n )}\n {node.duration ? (\n <span className=\"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground\">\n <Icon icon={UiClock} className=\"text-xs\" />\n {formatTestDuration(node.duration)}\n </span>\n ) : null}\n {location && (\n <span\n className=\"min-w-0 shrink-[100] truncate font-mono text-xs text-muted-foreground\"\n title={location}\n >\n {location}\n </span>\n )}\n {node.file && runner.onOpenFile && (\n <OpenInFilesLink\n className=\"shrink-0\"\n onOpenFile={runner.onOpenFile}\n target={{\n file: relPath(node.file, node.work_dir)!,\n ...(node.work_dir ? { workDir: node.work_dir } : {}),\n ...(node.line ? { line: node.line } : {}),\n }}\n />\n )}\n <DetailActions {...props} />\n </div>\n );\n}\n\n/**\n * The right pane. Resolves the node's adapter for body / tabs / header actions,\n * falling back to the built-in default body. Shows an empty state when nothing\n * is selected.\n *\n * `header=\"actions\"` drops the node's identity (outcome, name, tool, duration,\n * location) for hosts that already show it, e.g. an expandable card, and keeps\n * only the controls, in the tab row when there are tabs. `tabVariant` picks the\n * tab row style (filled `pill`, the default, or `underline`).\n */\nexport function TestDetailPanel({ header = \"full\", tabVariant = \"pill\" }: { header?: \"full\" | \"actions\"; tabVariant?: TabButtonVariant } = {}) {\n const runner = useTestRunner();\n const selected = runner.selected;\n const [attemptSelection, setAttemptSelection] = useState<{ key: string; id: number } | null>(null);\n // Tab state is controlled when the host supplies activeTab (e.g. to mirror it\n // into the URL); otherwise the panel owns it. The render below tolerates an\n // unknown id by falling back to the built-in \"detail\" tab.\n const controlled = runner.activeTab !== undefined;\n const [internalTab, setInternalTab] = useState<string>(\"detail\");\n const activeTab = controlled ? runner.activeTab! : internalTab;\n const setActiveTab = (id: string) => {\n if (controlled) runner.onTabChange?.(id);\n else setInternalTab(id);\n };\n\n if (!selected) {\n return (\n <div className=\"flex h-full items-center justify-center text-sm text-muted-foreground\">\n <div className=\"text-center\">\n <Icon icon={UiClass} className=\"mb-2 block text-4xl\" />\n Select a test to view its details.\n </div>\n </div>\n );\n }\n\n const attempts = runner.adapters.resolveAttempts(selected, runner);\n const key = selected.task_id ?? selected.name;\n const attemptId = runner.activeAttempt ?? (attemptSelection?.key === key ? attemptSelection.id : undefined);\n const attempt = attempts.find((a) => a.id === attemptId) ?? attempts.at(-1);\n const node = attempts.length > 1 && attempt ? attempt.node : selected;\n const attemptChooser = attempts.length > 1 && attempt ? (\n <div className=\"w-44 shrink-0\">\n <Select aria-label=\"Attempt\" value={String(attempt.id)} className=\"h-7 text-xs\" onChange={(event) => {\n const id = Number(event.target.value);\n if (runner.onAttemptChange) runner.onAttemptChange(id);\n else setAttemptSelection({ key, id });\n }} options={attempts.map((a) => ({ value: String(a.id), label: `Attempt ${a.id}/${attempts.length} · ${a.status}${a.durationMs !== undefined ? ` · ${formatTestDuration(a.durationMs * 1e6)}` : \"\"}` }))} />\n </div>\n ) : null;\n\n const detailAdapter = runner.adapters.resolveDetail(node, runner);\n const actionAdapter = runner.adapters.resolveActions(selected, runner);\n const tabs = runner.adapters.resolveTabs(node, runner);\n if ((node.stdout || node.stderr) && !tabs.some((tab) => tab.id === \"stdout\")) {\n tabs.unshift({\n id: \"stdout\",\n label: \"Stdout\",\n render: () => <div className=\"p-density-4\"><TestOutput node={node} view=\"full\" /></div>,\n });\n }\n const ownsScroll = runner.adapters.ownsScroll(node, runner);\n\n const body = (\n <DetailTabSelectProvider value={setActiveTab}>\n {detailAdapter?.renderDetail\n ? detailAdapter.renderDetail({ node, runner })\n : <DefaultDetailBody node={node} />}\n </DetailTabSelectProvider>\n );\n const actions = actionAdapter?.nodeActions?.({ node: selected, runner });\n\n // A size container, so log blocks can cap themselves at a share of the pane (cqh).\n const detailRegion = cn(\"min-h-0 flex-1 [container-type:size]\", !ownsScroll && \"overflow-y-auto\");\n\n const headerProps: DetailHeaderProps = { node, actionNode: selected, actions, attemptChooser };\n const fullHeader = header === \"full\";\n\n // No extra tabs → just the body under the header.\n if (tabs.length === 0) {\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {fullHeader ? (\n <DetailHeader {...headerProps} />\n ) : (\n <div className=\"flex shrink-0 border-b border-border px-density-2 py-density-1\">\n <DetailActions {...headerProps} />\n </div>\n )}\n <div className={detailRegion}>{body}</div>\n </div>\n );\n }\n\n const detailTab = { id: \"detail\", label: \"Detail\", render: () => body };\n const allTabs = [detailTab, ...tabs];\n const active = allTabs.find((t) => t.id === activeTab) ?? detailTab;\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {fullHeader && <DetailHeader {...headerProps} />}\n <div className={cn(\"flex shrink-0 items-center gap-1 border-b border-border px-density-2\", tabVariant === \"underline\" ? \"items-stretch\" : \"py-density-1\")}>\n {allTabs.map((t) => (\n <TabButton\n key={t.id}\n active={active.id === t.id}\n onClick={() => setActiveTab(t.id)}\n label={t.label}\n variant={tabVariant}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F,GACA,CAAC,cAAc,oBAAC,eAAD,EAAe,GAAI,YAAc,CAAA,CAC9C;;GACL,oBAAC,OAAD;IAAK,WAAW;IAAe,UAAA,OAAO,OAAO;GAAO,CAAA;EACjD;;AAET"}
|
|
1
|
+
{"version":3,"file":"TestDetailPanel.js","names":["_Fragment"],"sources":["../../../src/data/test-runner/TestDetailPanel.tsx"],"sourcesContent":["import { useMemo, useState, type ReactNode } from \"react\";\nimport { Icon } from \"../Icon\";\nimport { Button } from \"../../components/button\";\nimport { Select } from \"../../components/select\";\nimport { SplitButton } from \"../../components/SplitButton\";\nimport { useCopyFlash, type CopyFlashState } from \"../../components/clipboard\";\nimport type { DropdownMenuItem } from \"../../overlay/DropdownMenu\";\nimport { cn } from \"../../lib/utils\";\nimport { JsonView } from \"../JsonView\";\nimport { TabButton, type TabButtonVariant } from \"../TabButton\";\nimport { OpenInFilesLink } from \"../OpenInFilesLink\";\nimport { relPath } from \"../lint/paths\";\nimport {\n UiCheck,\n UiClass,\n UiClock,\n UiCopy,\n UiHourglass,\n UiJson,\n UiRefresh,\n UiStop,\n UiWarningCircle,\n} from \"../../icons\";\nimport type { Test } from \"./types\";\nimport { useTestRunner } from \"./context\";\nimport { DetailTabSelectProvider } from \"./detailTabContext\";\nimport { buildNodeBrief, buildNodeJson, type CopyItem } from \"./copy\";\nimport { formatTestDuration, outcomeFor, sum } from \"./status\";\nimport { toolKeyFor } from \"./marks\";\nimport { OutcomeIcon, ToolIcon } from \"./MarkIcons\";\nimport { TestFailureDetail, TestOutput } from \"./TestFailureDetail\";\nimport { TestAttemptDetail } from \"./TestAttemptDetail\";\nimport { TestViewToggle } from \"./TestViewToggle\";\n\n/** Built-in detail body — used when no adapter contributes `renderDetail`. */\nfunction DefaultDetailBody({ node }: { node: Test }) {\n const runner = useTestRunner();\n const attempt = node.attempts?.at(-1);\n const hasChildren = (node.children?.length ?? 0) > 0;\n const counts = hasChildren ? sum(node) : null;\n return (\n <div className=\"space-y-4 p-density-4\">\n {node.message && !node.failure_detail && (\n <p className=\"whitespace-pre-wrap break-words text-sm\">{node.message}</p>\n )}\n {node.failure_detail && <TestFailureDetail failure={node.failure_detail} />}\n <TestOutput node={node} />\n {attempt && (\n <TestAttemptDetail\n key={`${attempt.run_kind ?? \"\"}:${attempt.sequence}`}\n attempt={attempt}\n {...(runner.fetchProcessMetrics ? { fetchProcessMetrics: runner.fetchProcessMetrics } : {})}\n />\n )}\n {counts && counts.total > 0 && (\n <div className=\"flex flex-wrap gap-3 text-xs text-muted-foreground\">\n <span>{counts.total} total</span>\n {counts.passed > 0 && <span>{counts.passed} passed</span>}\n {counts.failed > 0 && <span>{counts.failed} failed</span>}\n {counts.skipped > 0 && <span>{counts.skipped} skipped</span>}\n </div>\n )}\n {node.detail != null && (\n <div className=\"space-y-1\">\n <div className=\"text-[10px] uppercase tracking-wide text-muted-foreground\">Detail</div>\n <JsonView data={node.detail} />\n </div>\n )}\n </div>\n );\n}\n\nfunction copyMenuItem(item: CopyItem, copy: (text: string) => void): DropdownMenuItem {\n const icon = item.icon ? { icon: item.icon } : {};\n if (\"reason\" in item) {\n return { label: item.label, ...icon, disabled: true, title: item.reason, onSelect: () => {} };\n }\n return { label: item.label, ...icon, onSelect: () => copy(item.value) };\n}\n\nconst COPY_LABEL = {\n idle: \"Copy details\",\n pending: \"Copying…\",\n copied: \"Copied\",\n error: \"Copy failed\",\n} as const satisfies Record<CopyFlashState, string>;\nconst COPY_ICON = {\n idle: UiCopy,\n pending: UiHourglass,\n copied: UiCheck,\n error: UiWarningCircle,\n} as const satisfies Record<CopyFlashState, unknown>;\n\n/**\n * \"Copy details\" split button: the primary action copies a Markdown brief of\n * the generic sections plus every matching adapter's `copy` sections; the menu\n * offers the node as JSON and the adapters' items, disabled with a reason when\n * they have nothing to copy. The label flips to \"Copied\" or \"Copy failed\".\n */\nfunction CopyDetailsButton({ node }: { node: Test }) {\n const runner = useTestRunner();\n const { state, copy } = useCopyFlash();\n const sections = useMemo(() => runner.adapters.resolveCopy(node, runner), [node, runner]);\n const items: DropdownMenuItem[] = [\n { label: \"Copy as JSON\", icon: UiJson, onSelect: () => copy(buildNodeJson(node)) },\n ...sections.items.map((item) => copyMenuItem(item, copy)),\n ];\n return (\n <SplitButton\n label={COPY_LABEL[state]}\n icon={COPY_ICON[state]}\n variant=\"outline\"\n size=\"sm\"\n align=\"right\"\n title=\"More copy options\"\n onClick={() => copy(buildNodeBrief(node, sections))}\n items={items}\n />\n );\n}\n\ntype DetailHeaderProps = { node: Test; actionNode: Test; actions?: ReactNode; attemptChooser?: ReactNode };\n\n/** The attempt chooser, adapter actions, copy and rerun/stop controls for the shown node. */\nfunction DetailActions({ node, actionNode, actions, attemptChooser }: DetailHeaderProps) {\n const runner = useTestRunner();\n const canRerun = !!runner.onRerun && actionNode.framework !== \"task\";\n const canStop = !!runner.onStop && !!actionNode.can_stop && !!actionNode.task_id;\n return (\n <div className=\"ml-auto flex shrink-0 items-center gap-1\" data-detail-actions=\"\">\n {attemptChooser}\n {actions}\n {/* The list view carries the toggle in its toolbar, so its inline detail doesn't repeat it. */}\n {runner.view !== \"list\" && <TestViewToggle />}\n <CopyDetailsButton node={node} />\n {canRerun && (\n <Button\n size=\"sm\"\n disabled={runner.busy.rerun}\n onClick={() => runner.onRerun!(actionNode)}\n title=\"Rerun this test or subtree\"\n >\n <Icon icon={UiRefresh} className=\"mr-1 text-sm\" />\n {runner.busy.rerun ? \"Running...\" : \"Rerun\"}\n </Button>\n )}\n {canStop && (\n <Button\n size=\"sm\"\n variant=\"destructive\"\n disabled={runner.busy.stop}\n onClick={() => runner.onStop!(actionNode)}\n title=\"Stop this running task\"\n >\n <Icon icon={UiStop} className=\"mr-1 text-sm\" />\n {runner.busy.stop ? \"Stopping...\" : \"Stop\"}\n </Button>\n )}\n </div>\n );\n}\n\nfunction DetailHeader(props: DetailHeaderProps) {\n const { node } = props;\n const runner = useTestRunner();\n const outcome = outcomeFor(node);\n const location = node.file ? `${node.file}${node.line ? `:${node.line}` : \"\"}` : undefined;\n const frameworkBadge = runner.adapters.resolveFrameworkBadge(node, runner);\n return (\n <div\n className=\"flex min-w-0 items-center gap-2 border-b border-border px-density-4 py-density-2\"\n data-detail-header=\"\"\n >\n {outcome ? (\n <OutcomeIcon outcome={outcome} className=\"text-lg\" />\n ) : (\n <Icon icon={UiClass} className=\"shrink-0 text-lg text-muted-foreground\" />\n )}\n <h2 className=\"min-w-0 shrink truncate text-base font-semibold\" title={node.name}>\n {node.name}\n </h2>\n {node.framework && (\n <span\n className=\"inline-flex shrink-0 items-center gap-1 rounded bg-muted px-1.5 py-0.5 text-xs text-muted-foreground\"\n data-framework-badge=\"\"\n >\n <ToolIcon tool={toolKeyFor(node)} className=\"text-sm\" />\n {node.framework}\n {frameworkBadge != null && (\n <>\n <span aria-hidden=\"true\">·</span>\n {frameworkBadge}\n </>\n )}\n </span>\n )}\n {node.duration ? (\n <span className=\"inline-flex shrink-0 items-center gap-1 text-xs text-muted-foreground\">\n <Icon icon={UiClock} className=\"text-xs\" />\n {formatTestDuration(node.duration)}\n </span>\n ) : null}\n {location && (\n <span\n className=\"min-w-0 shrink-[100] truncate font-mono text-xs text-muted-foreground\"\n title={location}\n >\n {location}\n </span>\n )}\n {node.file && runner.onOpenFile && (\n <OpenInFilesLink\n className=\"shrink-0\"\n onOpenFile={runner.onOpenFile}\n target={{\n file: relPath(node.file, node.work_dir)!,\n ...(node.work_dir ? { workDir: node.work_dir } : {}),\n ...(node.line ? { line: node.line } : {}),\n }}\n />\n )}\n <DetailActions {...props} />\n </div>\n );\n}\n\n/**\n * The right pane. Resolves the node's adapter for body / tabs / header actions,\n * falling back to the built-in default body. Shows an empty state when nothing\n * is selected.\n *\n * `header=\"actions\"` drops the node's identity (outcome, name, tool, duration,\n * location) for hosts that already show it, e.g. an expandable card, and keeps\n * only the controls, in the tab row when there are tabs. `tabVariant` picks the\n * tab row style (filled `pill`, the default, or `underline`).\n */\nexport function TestDetailPanel({ header = \"full\", tabVariant = \"pill\" }: { header?: \"full\" | \"actions\"; tabVariant?: TabButtonVariant } = {}) {\n const runner = useTestRunner();\n const selected = runner.selected;\n const [attemptSelection, setAttemptSelection] = useState<{ key: string; id: number } | null>(null);\n // Tab state is controlled when the host supplies activeTab (e.g. to mirror it\n // into the URL); otherwise the panel owns it. The render below tolerates an\n // unknown id by falling back to the built-in \"detail\" tab.\n const controlled = runner.activeTab !== undefined;\n const [internalTab, setInternalTab] = useState<string>(\"detail\");\n const activeTab = controlled ? runner.activeTab! : internalTab;\n const setActiveTab = (id: string) => {\n if (controlled) runner.onTabChange?.(id);\n else setInternalTab(id);\n };\n\n if (!selected) {\n return (\n <div className=\"flex h-full items-center justify-center text-sm text-muted-foreground\">\n <div className=\"text-center\">\n <Icon icon={UiClass} className=\"mb-2 block text-4xl\" />\n Select a test to view its details.\n </div>\n </div>\n );\n }\n\n const attempts = runner.adapters.resolveAttempts(selected, runner);\n const key = selected.task_id ?? selected.name;\n const attemptId = runner.activeAttempt ?? (attemptSelection?.key === key ? attemptSelection.id : undefined);\n const attempt = attempts.find((a) => a.id === attemptId) ?? attempts.at(-1);\n const node = attempts.length > 1 && attempt ? attempt.node : selected;\n const attemptChooser = attempts.length > 1 && attempt ? (\n <div className=\"w-44 shrink-0\">\n <Select aria-label=\"Attempt\" value={String(attempt.id)} className=\"h-7 text-xs\" onChange={(event) => {\n const id = Number(event.target.value);\n if (runner.onAttemptChange) runner.onAttemptChange(id);\n else setAttemptSelection({ key, id });\n }} options={attempts.map((a) => ({ value: String(a.id), label: `Attempt ${a.id}/${attempts.length} · ${a.status}${a.durationMs !== undefined ? ` · ${formatTestDuration(a.durationMs * 1e6)}` : \"\"}` }))} />\n </div>\n ) : null;\n\n const detailAdapter = runner.adapters.resolveDetail(node, runner);\n const actionAdapter = runner.adapters.resolveActions(selected, runner);\n const tabs = runner.adapters.resolveTabs(node, runner);\n if ((node.log || node.stdout || node.stderr) && !tabs.some((tab) => tab.id === \"stdout\")) {\n tabs.unshift({\n id: \"stdout\",\n label: \"Stdout\",\n render: () => <div className=\"p-density-4\"><TestOutput node={node} view=\"full\" /></div>,\n });\n }\n const ownsScroll = runner.adapters.ownsScroll(node, runner);\n\n const body = (\n <DetailTabSelectProvider value={setActiveTab}>\n {detailAdapter?.renderDetail\n ? detailAdapter.renderDetail({ node, runner })\n : <DefaultDetailBody node={node} />}\n </DetailTabSelectProvider>\n );\n const actions = actionAdapter?.nodeActions?.({ node: selected, runner });\n\n // A size container, so log blocks can cap themselves at a share of the pane (cqh).\n const detailRegion = cn(\"min-h-0 flex-1 [container-type:size]\", !ownsScroll && \"overflow-y-auto\");\n\n const headerProps: DetailHeaderProps = { node, actionNode: selected, actions, attemptChooser };\n const fullHeader = header === \"full\";\n\n // No extra tabs → just the body under the header.\n if (tabs.length === 0) {\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {fullHeader ? (\n <DetailHeader {...headerProps} />\n ) : (\n <div className=\"flex shrink-0 border-b border-border px-density-2 py-density-1\">\n <DetailActions {...headerProps} />\n </div>\n )}\n <div className={detailRegion}>{body}</div>\n </div>\n );\n }\n\n const detailTab = { id: \"detail\", label: \"Detail\", render: () => body };\n const allTabs = [detailTab, ...tabs];\n const active = allTabs.find((t) => t.id === activeTab) ?? detailTab;\n\n return (\n <div className=\"flex h-full min-h-0 flex-col\">\n {fullHeader && <DetailHeader {...headerProps} />}\n <div className={cn(\"flex shrink-0 items-center gap-1 border-b border-border px-density-2\", tabVariant === \"underline\" ? \"items-stretch\" : \"py-density-1\")}>\n {allTabs.map((t) => (\n <TabButton\n key={t.id}\n active={active.id === t.id}\n onClick={() => setActiveTab(t.id)}\n label={t.label}\n variant={tabVariant}\n />\n ))}\n {!fullHeader && <DetailActions {...headerProps} />}\n </div>\n <div className={detailRegion}>{active.render()}</div>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,SAAS,kBAAkB,EAAE,QAAwB;CACnD,MAAM,SAAS,cAAc;CAC7B,MAAM,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|
47
47
|
]
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
+
var PREVIEW_LINES = 10;
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
52
|
+
* The node's log — both streams as they were written — or, without one, its
|
|
53
|
+
* stdout then its stderr. The preview is its last ten lines, where a long run's
|
|
54
|
+
* latest progress and its final error are, linking to the panel's Stdout tab.
|
|
53
55
|
*/
|
|
54
56
|
function TestOutput({ node, view = "preview" }) {
|
|
55
57
|
const selectTab = require_detailTabContext.useSelectDetailTab();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const lines = output.split(/\r?\n/);
|
|
58
|
+
const output = (node.log ? [node.log] : [node.stdout, node.stderr]).flatMap((stream) => stream ? [stream.replace(/\r?\n$/, "")] : []).join("\n");
|
|
59
|
+
if (!output) return null;
|
|
59
60
|
const preview = view === "preview";
|
|
60
61
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
61
62
|
className: "space-y-1",
|
|
@@ -65,12 +66,13 @@ function TestOutput({ node, view = "preview" }) {
|
|
|
65
66
|
children: "Output"
|
|
66
67
|
}),
|
|
67
68
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_LogViewer.LogViewer, {
|
|
68
|
-
logs:
|
|
69
|
+
logs: output,
|
|
69
70
|
variant: "terminal",
|
|
70
71
|
maxHeight: "none",
|
|
71
|
-
collapsedLines:
|
|
72
|
+
collapsedLines: Infinity,
|
|
73
|
+
...preview ? { tailLines: PREVIEW_LINES } : {}
|
|
72
74
|
}),
|
|
73
|
-
preview &&
|
|
75
|
+
preview && output.split("\n").length > PREVIEW_LINES && selectTab && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_button.Button, {
|
|
74
76
|
type: "button",
|
|
75
77
|
variant: "link",
|
|
76
78
|
size: "sm",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestFailureDetail.cjs","names":["useMemo","parseStackDump","LogViewer","StackDumpView","Expectation","useSelectDetailTab","Button"],"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.cjs","names":["useMemo","parseStackDump","LogViewer","StackDumpView","Expectation","useSelectDetailTab","Button"],"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":";;;;;;;;;;AAUA,SAAS,aAAa,EAAE,SAA4B;CAClD,MAAM,UAAA,GAASA,MAAAA,QAAAA,OAAcC,mBAAAA,eAAe,KAAK,GAAG,CAAC,KAAK,CAAC;CAC3D,IAAI,OAAO,WAAW,MAAM,OAAO,iBAAA,GAAA,kBAAA,IAAA,CAACC,kBAAAA,WAAD;EAAW,MAAM;EAAO,gBAAgB;CAAI,CAAA;CAC/E,OACE,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;EAAK,WAAU;EAAsC,sBAAmB;EACtE,UAAA,iBAAA,GAAA,kBAAA,IAAA,CAACC,sBAAAA,eAAD;GAAe,MAAM;GAAO,YAAY,OAAO,WAAW,WAAW;EAAI,CAAA;CACtE,CAAA;AAET;;;;;;AAOA,SAAgB,kBAAkB,EAAE,WAAuC;CACzE,MAAM,iBAAiB,CAAC,EACtB,QAAQ,WACR,QAAQ,YACR,QAAQ,UACR,QAAQ;CAEV,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACG,QAAQ,WACP,iBAAA,GAAA,kBAAA,IAAA,CAAC,KAAD;IAAG,WAAU;IAAsD,UAAA,QAAQ;GAAW,CAAA;GAEvF,kBACC,iBAAA,GAAA,kBAAA,IAAA,CAACC,oBAAAA,aAAD;IACE,OAAO,QAAQ;IACf,UAAU,QAAQ,YAAY,KAAA;IAC9B,QAAQ,QAAQ,UAAU,KAAA;IAC1B,UAAU,QAAQ;GACnB,CAAA;GAEF,QAAQ,SAAS,iBAAA,GAAA,kBAAA,IAAA,CAAC,cAAD,EAAc,OAAO,QAAQ,MAAQ,CAAA;EACpD;;AAET;AAEA,IAAM,gBAAgB;;;;;;AAOtB,SAAgB,WAAW,EAAE,MAAM,OAAO,aAAwD;CAChG,MAAM,YAAYC,yBAAAA,mBAAmB;CAErC,MAAM,UADU,KAAK,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,QAAQ,KAAK,MAAM,EAAA,CAC1C,SAAS,WAAW,SAAS,CAAC,OAAO,QAAQ,UAAU,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI;CAClG,IAAI,CAAC,QAAQ,OAAO;CACpB,MAAM,UAAU,SAAS;CACzB,OACE,iBAAA,GAAA,kBAAA,KAAA,CAAC,OAAD;EAAK,WAAU;EAAf,UAAA;GACG,WAAW,iBAAA,GAAA,kBAAA,IAAA,CAAC,OAAD;IAAK,WAAU;IAA4D,UAAA;GAAW,CAAA;GAClG,iBAAA,GAAA,kBAAA,IAAA,CAACH,kBAAAA,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,iBAAA,GAAA,kBAAA,IAAA,CAACI,eAAAA,QAAD;IAAQ,MAAK;IAAS,SAAQ;IAAO,MAAK;IAAK,WAAU;IAAO,eAAe,UAAU,QAAQ;IAAG,UAAA;GAE5F,CAAA;EAEP;;AAET"}
|
|
@@ -8,8 +8,9 @@ export declare function TestFailureDetail({ failure }: {
|
|
|
8
8
|
failure: FailureDetail;
|
|
9
9
|
}): import("react").JSX.Element;
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* The node's log — both streams as they were written — or, without one, its
|
|
12
|
+
* stdout then its stderr. The preview is its last ten lines, where a long run's
|
|
13
|
+
* latest progress and its final error are, linking to the panel's Stdout tab.
|
|
13
14
|
*/
|
|
14
15
|
export declare function TestOutput({ node, view }: {
|
|
15
16
|
node: Test;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TestFailureDetail.d.ts","sourceRoot":"","sources":["../../../src/data/test-runner/TestFailureDetail.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAanD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,+BAuBxE;
|
|
1
|
+
{"version":3,"file":"TestFailureDetail.d.ts","sourceRoot":"","sources":["../../../src/data/test-runner/TestFailureDetail.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAanD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,aAAa,CAAA;CAAE,+BAuBxE;AAID;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,IAAgB,EAAE,EAAE;IAAE,IAAI,EAAE,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;CAAE,sCAuB/F"}
|
|
@@ -47,15 +47,16 @@ function TestFailureDetail({ failure }) {
|
|
|
47
47
|
]
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
+
var PREVIEW_LINES = 10;
|
|
50
51
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
52
|
+
* The node's log — both streams as they were written — or, without one, its
|
|
53
|
+
* stdout then its stderr. The preview is its last ten lines, where a long run's
|
|
54
|
+
* latest progress and its final error are, linking to the panel's Stdout tab.
|
|
53
55
|
*/
|
|
54
56
|
function TestOutput({ node, view = "preview" }) {
|
|
55
57
|
const selectTab = useSelectDetailTab();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const lines = output.split(/\r?\n/);
|
|
58
|
+
const output = (node.log ? [node.log] : [node.stdout, node.stderr]).flatMap((stream) => stream ? [stream.replace(/\r?\n$/, "")] : []).join("\n");
|
|
59
|
+
if (!output) return null;
|
|
59
60
|
const preview = view === "preview";
|
|
60
61
|
return /* @__PURE__ */ jsxs("div", {
|
|
61
62
|
className: "space-y-1",
|
|
@@ -65,12 +66,13 @@ function TestOutput({ node, view = "preview" }) {
|
|
|
65
66
|
children: "Output"
|
|
66
67
|
}),
|
|
67
68
|
/* @__PURE__ */ jsx(LogViewer, {
|
|
68
|
-
logs:
|
|
69
|
+
logs: output,
|
|
69
70
|
variant: "terminal",
|
|
70
71
|
maxHeight: "none",
|
|
71
|
-
collapsedLines:
|
|
72
|
+
collapsedLines: Infinity,
|
|
73
|
+
...preview ? { tailLines: PREVIEW_LINES } : {}
|
|
72
74
|
}),
|
|
73
|
-
preview &&
|
|
75
|
+
preview && output.split("\n").length > PREVIEW_LINES && selectTab && /* @__PURE__ */ jsx(Button, {
|
|
74
76
|
type: "button",
|
|
75
77
|
variant: "link",
|
|
76
78
|
size: "sm",
|