@adea-ai/ui 0.152.3 → 0.153.0
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/README.md +469 -580
- package/dist/components/composites/account-menu/account-menu.d.ts +5 -0
- package/dist/components/composites/account-menu/account-menu.d.ts.map +1 -1
- package/dist/components/composites/account-menu/account-menu.js +37 -13
- package/dist/components/composites/account-menu/account-menu.js.map +1 -1
- package/dist/components/composites/action-button/action-button.d.ts +2 -1
- package/dist/components/composites/action-button/action-button.d.ts.map +1 -1
- package/dist/components/composites/action-button/action-button.js +92 -66
- package/dist/components/composites/action-button/action-button.js.map +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.d.ts +3 -3
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js +1 -1
- package/dist/components/composites/appearance-editor/accent-swatch-groups.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.d.ts +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js +1 -1
- package/dist/components/composites/appearance-editor/appearance-choices.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-editor.js +57 -57
- package/dist/components/composites/appearance-editor/appearance-editor.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.d.ts.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-rows.js +9 -9
- package/dist/components/composites/appearance-editor/appearance-rows.js.map +1 -1
- package/dist/components/composites/appearance-editor/appearance-types.d.ts +7 -7
- package/dist/components/composites/appearance-editor/theme-preview.d.ts +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js +1 -1
- package/dist/components/composites/appearance-editor/theme-preview.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-browser.js +6 -10
- package/dist/components/composites/catalog-browser/catalog-browser.js.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.d.ts.map +1 -1
- package/dist/components/composites/catalog-browser/catalog-detail.js +36 -36
- package/dist/components/composites/catalog-browser/catalog-detail.js.map +1 -1
- package/dist/components/composites/chain-of-thought/chain-of-thought.d.ts +4 -4
- package/dist/components/composites/chain-of-thought/chain-of-thought.js.map +1 -1
- package/dist/components/composites/chat/chat.d.ts.map +1 -1
- package/dist/components/composites/chat/chat.js +33 -37
- package/dist/components/composites/chat/chat.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint-model.d.ts +3 -3
- package/dist/components/composites/checkpoint/checkpoint-model.js +2 -2
- package/dist/components/composites/checkpoint/checkpoint-model.js.map +1 -1
- package/dist/components/composites/checkpoint/checkpoint.d.ts +2 -2
- package/dist/components/composites/checkpoint/checkpoint.js.map +1 -1
- package/dist/components/composites/confirmation/confirmation.d.ts.map +1 -1
- package/dist/components/composites/confirmation/confirmation.js +1 -1
- package/dist/components/composites/confirmation/confirmation.js.map +1 -1
- package/dist/components/composites/context/context.d.ts +2 -2
- package/dist/components/composites/context/context.js.map +1 -1
- package/dist/components/composites/file-tree/build-file-tree.d.ts +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js +1 -1
- package/dist/components/composites/file-tree/build-file-tree.js.map +1 -1
- package/dist/components/composites/file-tree/file-tree.d.ts.map +1 -1
- package/dist/components/composites/file-tree/file-tree.js +7 -3
- package/dist/components/composites/file-tree/file-tree.js.map +1 -1
- package/dist/components/composites/icon-picker/icon-picker.js +1 -3
- package/dist/components/composites/icon-picker/icon-picker.js.map +1 -1
- package/dist/components/composites/inline-citation/citation.d.ts +1 -1
- package/dist/components/composites/inline-citation/citation.js +1 -1
- package/dist/components/composites/inline-citation/citation.js.map +1 -1
- package/dist/components/composites/inline-citation/inline-citation.d.ts +2 -2
- package/dist/components/composites/inline-citation/inline-citation.js.map +1 -1
- package/dist/components/composites/list-row/list-row-control.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row-control.js +22 -22
- package/dist/components/composites/list-row/list-row-control.js.map +1 -1
- package/dist/components/composites/list-row/list-row.d.ts +5 -0
- package/dist/components/composites/list-row/list-row.d.ts.map +1 -1
- package/dist/components/composites/list-row/list-row.js +75 -83
- package/dist/components/composites/list-row/list-row.js.map +1 -1
- package/dist/components/composites/message-scroller/message-scroller.d.ts +1 -1
- package/dist/components/composites/message-scroller/message-scroller.js.map +1 -1
- package/dist/components/composites/model-selector/model-selector.d.ts +4 -4
- package/dist/components/composites/model-selector/model-selector.js.map +1 -1
- package/dist/components/composites/model-selector/models.d.ts +2 -2
- package/dist/components/composites/model-selector/models.js +1 -1
- package/dist/components/composites/model-selector/models.js.map +1 -1
- package/dist/components/composites/plan/plan.d.ts.map +1 -1
- package/dist/components/composites/plan/plan.js +17 -15
- package/dist/components/composites/plan/plan.js.map +1 -1
- package/dist/components/composites/queue/queue.d.ts.map +1 -1
- package/dist/components/composites/queue/queue.js +5 -7
- package/dist/components/composites/queue/queue.js.map +1 -1
- package/dist/components/composites/reasoning/reasoning.d.ts +4 -4
- package/dist/components/composites/reasoning/reasoning.js +4 -4
- package/dist/components/composites/reasoning/reasoning.js.map +1 -1
- package/dist/components/composites/settings/settings-navigation.d.ts.map +1 -1
- package/dist/components/composites/settings/settings-navigation.js +63 -14
- package/dist/components/composites/settings/settings-navigation.js.map +1 -1
- package/dist/components/composites/settings/settings.d.ts.map +1 -1
- package/dist/components/composites/settings/settings.js +32 -32
- package/dist/components/composites/settings/settings.js.map +1 -1
- package/dist/components/composites/sources/source.d.ts +1 -1
- package/dist/components/composites/sources/source.js.map +1 -1
- package/dist/components/composites/sources/sources.d.ts +2 -2
- package/dist/components/composites/sources/sources.js.map +1 -1
- package/dist/components/composites/stack-trace/parse-stack-trace.d.ts +3 -3
- package/dist/components/composites/stack-trace/parse-stack-trace.js +4 -4
- package/dist/components/composites/stack-trace/parse-stack-trace.js.map +1 -1
- package/dist/components/composites/stack-trace/stack-trace.d.ts +3 -3
- package/dist/components/composites/stack-trace/stack-trace.js.map +1 -1
- package/dist/components/composites/stat/stat.d.ts.map +1 -1
- package/dist/components/composites/stat/stat.js +14 -16
- package/dist/components/composites/stat/stat.js.map +1 -1
- package/dist/components/composites/subagent/subagent.d.ts.map +1 -1
- package/dist/components/composites/subagent/subagent.js +6 -4
- package/dist/components/composites/subagent/subagent.js.map +1 -1
- package/dist/components/composites/task/task.d.ts +1 -1
- package/dist/components/composites/task/task.js.map +1 -1
- package/dist/components/composites/terminal/ansi.d.ts +3 -3
- package/dist/components/composites/terminal/ansi.js.map +1 -1
- package/dist/components/composites/terminal/terminal-model.d.ts +3 -3
- package/dist/components/composites/terminal/terminal-model.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal-model.js +1 -1
- package/dist/components/composites/terminal/terminal-model.js.map +1 -1
- package/dist/components/composites/terminal/terminal.d.ts.map +1 -1
- package/dist/components/composites/terminal/terminal.js +24 -11
- package/dist/components/composites/terminal/terminal.js.map +1 -1
- package/dist/components/composites/test-results/test-results-model.d.ts +4 -4
- package/dist/components/composites/test-results/test-results-model.js +2 -2
- package/dist/components/composites/test-results/test-results-model.js.map +1 -1
- package/dist/components/composites/test-results/test-results.d.ts +1 -1
- package/dist/components/composites/test-results/test-results.js.map +1 -1
- package/dist/components/composites/tool/tool.d.ts +4 -4
- package/dist/components/composites/tool/tool.js.map +1 -1
- package/dist/components/composites/tree/tree.d.ts +1 -1
- package/dist/components/composites/tree/tree.d.ts.map +1 -1
- package/dist/components/composites/tree/tree.js +25 -18
- package/dist/components/composites/tree/tree.js.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.d.ts +10 -4
- package/dist/components/composites/update-dialog/channel-control.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/channel-control.js +14 -19
- package/dist/components/composites/update-dialog/channel-control.js.map +1 -1
- package/dist/components/composites/update-dialog/index.d.ts +1 -1
- package/dist/components/composites/update-dialog/index.d.ts.map +1 -1
- package/dist/components/composites/update-dialog/update-dialog.js +4 -5
- package/dist/components/composites/update-dialog/update-dialog.js.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.d.ts.map +1 -1
- package/dist/components/composites/workspace-mark/workspace-mark.js +19 -20
- package/dist/components/composites/workspace-mark/workspace-mark.js.map +1 -1
- package/dist/components/conversation/busy-send-button.d.ts.map +1 -1
- package/dist/components/conversation/busy-send-button.js +18 -20
- package/dist/components/conversation/busy-send-button.js.map +1 -1
- package/dist/components/conversation/composer-menu.d.ts +3 -3
- package/dist/components/conversation/composer-menu.js +3 -3
- package/dist/components/conversation/composer-menu.js.map +1 -1
- package/dist/components/conversation/conversation-avatar.js +2 -4
- package/dist/components/conversation/conversation-avatar.js.map +1 -1
- package/dist/components/conversation/conversation-pane.d.ts.map +1 -1
- package/dist/components/conversation/conversation-pane.js +6 -5
- package/dist/components/conversation/conversation-pane.js.map +1 -1
- package/dist/components/conversation/conversation-surface.js +3 -7
- package/dist/components/conversation/conversation-surface.js.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
- package/dist/components/conversation/internal/chat-composer-shell.js +76 -76
- package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
- package/dist/components/conversation/message-composer.d.ts.map +1 -1
- package/dist/components/conversation/message-composer.js +32 -38
- package/dist/components/conversation/message-composer.js.map +1 -1
- package/dist/components/conversation/message-row.d.ts.map +1 -1
- package/dist/components/conversation/message-row.js +79 -73
- package/dist/components/conversation/message-row.js.map +1 -1
- package/dist/components/conversation/scroll-follow-core.d.ts +7 -7
- package/dist/components/conversation/scroll-follow-core.js +4 -4
- package/dist/components/conversation/scroll-follow-core.js.map +1 -1
- package/dist/components/conversation/scroll-follow.d.ts.map +1 -1
- package/dist/components/conversation/scroll-follow.js +19 -4
- package/dist/components/conversation/scroll-follow.js.map +1 -1
- package/dist/components/conversation/thread-panel.d.ts.map +1 -1
- package/dist/components/conversation/thread-panel.js +23 -23
- package/dist/components/conversation/thread-panel.js.map +1 -1
- package/dist/components/conversation/transcript-composition.d.ts.map +1 -1
- package/dist/components/conversation/transcript-composition.js +2 -2
- package/dist/components/conversation/transcript-composition.js.map +1 -1
- package/dist/components/layout/app-shell/app-shell.d.ts +1 -1
- package/dist/components/layout/app-shell/app-shell.js +1 -1
- package/dist/components/layout/app-shell/app-shell.js.map +1 -1
- package/dist/components/layout/app-shell/skip-link.d.ts.map +1 -1
- package/dist/components/layout/app-shell/skip-link.js +4 -6
- package/dist/components/layout/app-shell/skip-link.js.map +1 -1
- package/dist/components/layout/page/page.d.ts.map +1 -1
- package/dist/components/layout/page/page.js +17 -17
- package/dist/components/layout/page/page.js.map +1 -1
- package/dist/components/layout/panel/panel.js +2 -4
- package/dist/components/layout/panel/panel.js.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.d.ts.map +1 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js +16 -1
- package/dist/components/layout/pixel-resize-handle/pixel-resize-handle.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail-context.d.ts +1 -1
- package/dist/components/layout/side-rail/side-rail-context.js.map +1 -1
- package/dist/components/layout/side-rail/side-rail.d.ts.map +1 -1
- package/dist/components/layout/side-rail/side-rail.js +35 -34
- package/dist/components/layout/side-rail/side-rail.js.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.d.ts.map +1 -1
- package/dist/components/layout/sidebar-nav/sidebar-nav.js +23 -23
- package/dist/components/layout/sidebar-nav/sidebar-nav.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.d.ts.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core-retry.js +25 -7
- package/dist/components/layout/split-layout/resize-controller-core-retry.js.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.d.ts.map +1 -1
- package/dist/components/layout/split-layout/resize-controller-core.js +25 -7
- package/dist/components/layout/split-layout/resize-controller-core.js.map +1 -1
- package/dist/components/layout/split-layout/split-layout.d.ts.map +1 -1
- package/dist/components/layout/split-layout/split-layout.js +2 -2
- package/dist/components/layout/split-layout/split-layout.js.map +1 -1
- package/dist/components/layout/status-bar/status-bar.d.ts +1 -1
- package/dist/components/layout/status-bar/status-bar.js +1 -1
- package/dist/components/layout/status-bar/status-bar.js.map +1 -1
- package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/layout/top-bar/top-bar.js +7 -7
- package/dist/components/layout/top-bar/top-bar.js.map +1 -1
- package/dist/components/motion/presence.d.ts +2 -2
- package/dist/components/motion/presence.js.map +1 -1
- package/dist/components/theme/appearance-panel.d.ts +5 -5
- package/dist/components/theme/appearance-panel.js.map +1 -1
- package/dist/components/theme/lazy.d.ts +1 -1
- package/dist/components/theme/lazy.js.map +1 -1
- package/dist/components/theme/theme-catalogue-source.d.ts +2 -2
- package/dist/components/theme/theme-catalogue-source.js +2 -2
- package/dist/components/theme/theme-catalogue-source.js.map +1 -1
- package/dist/components/theme/theme-context.d.ts +2 -2
- package/dist/components/theme/theme-context.js +3 -3
- package/dist/components/theme/theme-context.js.map +1 -1
- package/dist/components/theme/theme-document.d.ts.map +1 -1
- package/dist/components/theme/theme-document.js +14 -9
- package/dist/components/theme/theme-document.js.map +1 -1
- package/dist/components/theme/theme-picker.d.ts +5 -5
- package/dist/components/theme/theme-picker.js.map +1 -1
- package/dist/components/theme/theme-provider-value.d.ts +0 -6
- package/dist/components/theme/theme-provider-value.d.ts.map +1 -1
- package/dist/components/theme/theme-provider-value.js +9 -3
- package/dist/components/theme/theme-provider-value.js.map +1 -1
- package/dist/components/theme/theme-script.d.ts +14 -0
- package/dist/components/theme/theme-script.d.ts.map +1 -1
- package/dist/components/theme/theme-script.js +1 -0
- package/dist/components/theme/theme-script.js.map +1 -1
- package/dist/components/theme/theme-state.d.ts +7 -7
- package/dist/components/theme/theme-state.js.map +1 -1
- package/dist/components/theme/theme-toggle.d.ts +1 -1
- package/dist/components/theme/theme-toggle.js.map +1 -1
- package/dist/components/ui/alert/alert.d.ts.map +1 -1
- package/dist/components/ui/alert/alert.js +4 -3
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.d.ts +1 -1
- package/dist/components/ui/alert-dialog/alert-dialog.js +3 -3
- package/dist/components/ui/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/ui/badge/badge.d.ts +1 -1
- package/dist/components/ui/badge/badge.js +2 -2
- package/dist/components/ui/badge/badge.js.map +1 -1
- package/dist/components/ui/board/board.d.ts.map +1 -1
- package/dist/components/ui/board/board.js +10 -6
- package/dist/components/ui/board/board.js.map +1 -1
- package/dist/components/ui/bubble/bubble.d.ts.map +1 -1
- package/dist/components/ui/bubble/bubble.js +6 -4
- package/dist/components/ui/bubble/bubble.js.map +1 -1
- package/dist/components/ui/button/button.js +2 -2
- package/dist/components/ui/button/button.js.map +1 -1
- package/dist/components/ui/button-group/button-group.d.ts +1 -1
- package/dist/components/ui/button-group/button-group.js +1 -1
- package/dist/components/ui/button-group/button-group.js.map +1 -1
- package/dist/components/ui/calendar/calendar.js +6 -6
- package/dist/components/ui/calendar/calendar.js.map +1 -1
- package/dist/components/ui/callout/callout.d.ts +4 -4
- package/dist/components/ui/callout/callout.js +4 -4
- package/dist/components/ui/callout/callout.js.map +1 -1
- package/dist/components/ui/card/card.d.ts +2 -2
- package/dist/components/ui/card/card.js +2 -2
- package/dist/components/ui/card/card.js.map +1 -1
- package/dist/components/ui/carousel/carousel.d.ts +4 -4
- package/dist/components/ui/carousel/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel/carousel.js.map +1 -1
- package/dist/components/ui/chart/chart-options.d.ts +7 -7
- package/dist/components/ui/chart/chart-options.js +9 -9
- package/dist/components/ui/chart/chart-options.js.map +1 -1
- package/dist/components/ui/chart/chart.d.ts.map +1 -1
- package/dist/components/ui/chart/chart.js +16 -7
- package/dist/components/ui/chart/chart.js.map +1 -1
- package/dist/components/ui/checkbox/checkbox.d.ts.map +1 -1
- package/dist/components/ui/checkbox/checkbox.js +8 -6
- package/dist/components/ui/checkbox/checkbox.js.map +1 -1
- package/dist/components/ui/code-block/code-block.d.ts.map +1 -1
- package/dist/components/ui/code-block/code-block.js +8 -6
- package/dist/components/ui/code-block/code-block.js.map +1 -1
- package/dist/components/ui/command/command.d.ts +4 -4
- package/dist/components/ui/command/command.js +4 -4
- package/dist/components/ui/command/command.js.map +1 -1
- package/dist/components/ui/context-menu/context-menu.d.ts +1 -1
- package/dist/components/ui/context-menu/context-menu.js.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/components/ui/detail-panel/detail-panel.js +13 -13
- package/dist/components/ui/detail-panel/detail-panel.js.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.d.ts +0 -4
- package/dist/components/ui/dialog/dialog-layer.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog-layer.js +17 -1
- package/dist/components/ui/dialog/dialog-layer.js.map +1 -1
- package/dist/components/ui/dialog/dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog/dialog.js +4 -3
- package/dist/components/ui/dialog/dialog.js.map +1 -1
- package/dist/components/ui/diff-block/diff-block.d.ts +6 -6
- package/dist/components/ui/diff-block/diff-block.js +3 -3
- package/dist/components/ui/diff-block/diff-block.js.map +1 -1
- package/dist/components/ui/drawer/drawer.d.ts +3 -3
- package/dist/components/ui/drawer/drawer.js +2 -2
- package/dist/components/ui/drawer/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.d.ts +5 -5
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +3 -3
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.d.ts +3 -3
- package/dist/components/ui/dropdown-menu/menu-parts.js +1 -1
- package/dist/components/ui/dropdown-menu/menu-parts.js.map +1 -1
- package/dist/components/ui/empty/empty-state.d.ts.map +1 -1
- package/dist/components/ui/empty/empty-state.js +33 -36
- package/dist/components/ui/empty/empty-state.js.map +1 -1
- package/dist/components/ui/empty/empty.d.ts +1 -1
- package/dist/components/ui/empty/empty.js +1 -1
- package/dist/components/ui/empty/empty.js.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.d.ts.map +1 -1
- package/dist/components/ui/entity-icon/entity-icon.js +7 -7
- package/dist/components/ui/entity-icon/entity-icon.js.map +1 -1
- package/dist/components/ui/field/field.d.ts.map +1 -1
- package/dist/components/ui/field/field.js +15 -15
- package/dist/components/ui/field/field.js.map +1 -1
- package/dist/components/ui/field/number-field.d.ts +1 -1
- package/dist/components/ui/field/number-field.js +1 -1
- package/dist/components/ui/field/number-field.js.map +1 -1
- package/dist/components/ui/hover-card/hover-card.d.ts +1 -1
- package/dist/components/ui/hover-card/hover-card.js.map +1 -1
- package/dist/components/ui/input-group/input-group.d.ts +1 -1
- package/dist/components/ui/input-group/input-group.js.map +1 -1
- package/dist/components/ui/input-otp/input-otp.d.ts +1 -1
- package/dist/components/ui/input-otp/input-otp.js.map +1 -1
- package/dist/components/ui/item/item.d.ts.map +1 -1
- package/dist/components/ui/item/item.js +26 -26
- package/dist/components/ui/item/item.js.map +1 -1
- package/dist/components/ui/kbd/kbd.d.ts +2 -2
- package/dist/components/ui/kbd/kbd.js +2 -2
- package/dist/components/ui/kbd/kbd.js.map +1 -1
- package/dist/components/ui/kbd/platform-modifier.d.ts +3 -3
- package/dist/components/ui/kbd/platform-modifier.js +3 -3
- package/dist/components/ui/kbd/platform-modifier.js.map +1 -1
- package/dist/components/ui/label/label.d.ts +1 -1
- package/dist/components/ui/label/label.js +1 -1
- package/dist/components/ui/label/label.js.map +1 -1
- package/dist/components/ui/marker/marker.d.ts.map +1 -1
- package/dist/components/ui/marker/marker.js +17 -19
- package/dist/components/ui/marker/marker.js.map +1 -1
- package/dist/components/ui/menubar/menubar.d.ts +2 -2
- package/dist/components/ui/menubar/menubar.js +1 -1
- package/dist/components/ui/menubar/menubar.js.map +1 -1
- package/dist/components/ui/message/message.d.ts.map +1 -1
- package/dist/components/ui/message/message.js +16 -18
- package/dist/components/ui/message/message.js.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.d.ts.map +1 -1
- package/dist/components/ui/modal-dialog/modal-dialog.js +7 -11
- package/dist/components/ui/modal-dialog/modal-dialog.js.map +1 -1
- package/dist/components/ui/native-select/native-select.d.ts +1 -1
- package/dist/components/ui/native-select/native-select.js.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.d.ts.map +1 -1
- package/dist/components/ui/navigation-menu/navigation-menu.js +5 -4
- package/dist/components/ui/navigation-menu/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination/pagination.js +2 -4
- package/dist/components/ui/pagination/pagination.js.map +1 -1
- package/dist/components/ui/popover/popover.d.ts.map +1 -1
- package/dist/components/ui/popover/popover.js +11 -4
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/progress/progress.d.ts.map +1 -1
- package/dist/components/ui/progress/progress.js +6 -8
- package/dist/components/ui/progress/progress.js.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.d.ts.map +1 -1
- package/dist/components/ui/questionnaire/questionnaire.js +73 -73
- package/dist/components/ui/questionnaire/questionnaire.js.map +1 -1
- package/dist/components/ui/radio-group/radio-group.d.ts.map +1 -1
- package/dist/components/ui/radio-group/radio-group.js +12 -6
- package/dist/components/ui/radio-group/radio-group.js.map +1 -1
- package/dist/components/ui/resizable/resizable.d.ts +2 -2
- package/dist/components/ui/resizable/resizable.js +3 -3
- package/dist/components/ui/resizable/resizable.js.map +1 -1
- package/dist/components/ui/select/select.d.ts +3 -3
- package/dist/components/ui/select/select.js +1 -1
- package/dist/components/ui/select/select.js.map +1 -1
- package/dist/components/ui/sheet/sheet.d.ts.map +1 -1
- package/dist/components/ui/sheet/sheet.js +4 -3
- package/dist/components/ui/sheet/sheet.js.map +1 -1
- package/dist/components/ui/skeleton/skeleton.d.ts +1 -1
- package/dist/components/ui/skeleton/skeleton.js +1 -1
- package/dist/components/ui/skeleton/skeleton.js.map +1 -1
- package/dist/components/ui/slider/slider.d.ts +1 -1
- package/dist/components/ui/slider/slider.js.map +1 -1
- package/dist/components/ui/spinner/spinner.d.ts +1 -1
- package/dist/components/ui/spinner/spinner.js +1 -1
- package/dist/components/ui/spinner/spinner.js.map +1 -1
- package/dist/components/ui/status-chip/status-chip.d.ts +13 -13
- package/dist/components/ui/status-chip/status-chip.d.ts.map +1 -1
- package/dist/components/ui/status-chip/status-chip.js +11 -11
- package/dist/components/ui/status-chip/status-chip.js.map +1 -1
- package/dist/components/ui/switch/switch.d.ts.map +1 -1
- package/dist/components/ui/switch/switch.js +8 -6
- package/dist/components/ui/switch/switch.js.map +1 -1
- package/dist/components/ui/tabs/tabs.d.ts +4 -4
- package/dist/components/ui/tabs/tabs.js +4 -4
- package/dist/components/ui/tabs/tabs.js.map +1 -1
- package/dist/components/ui/textarea/textarea.d.ts +1 -1
- package/dist/components/ui/textarea/textarea.js +1 -1
- package/dist/components/ui/textarea/textarea.js.map +1 -1
- package/dist/components/ui/toast/toast.d.ts.map +1 -1
- package/dist/components/ui/toast/toast.js +13 -15
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/toggle/toggle.d.ts +1 -1
- package/dist/components/ui/toggle/toggle.js +1 -1
- package/dist/components/ui/toggle/toggle.js.map +1 -1
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts +51 -0
- package/dist/components/ui/tooltip/deferred-tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip/deferred-tooltip.js +103 -0
- package/dist/components/ui/tooltip/deferred-tooltip.js.map +1 -0
- package/dist/components/ui/tooltip/index.d.ts +1 -0
- package/dist/components/ui/tooltip/index.d.ts.map +1 -1
- package/dist/components/ui/tooltip/index.js +3 -1
- package/dist/components/ui/tooltip/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip/tooltip.js +6 -5
- package/dist/components/ui/tooltip/tooltip.js.map +1 -1
- package/dist/components/ui/trace/trace.d.ts.map +1 -1
- package/dist/components/ui/trace/trace.js +17 -17
- package/dist/components/ui/trace/trace.js.map +1 -1
- package/dist/components/ui/typography/typography.d.ts +3 -3
- package/dist/components/ui/typography/typography.js +5 -5
- package/dist/components/ui/typography/typography.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -3
- package/dist/lib/accent-presets.d.ts +1 -1
- package/dist/lib/accent-presets.js.map +1 -1
- package/dist/lib/accent-roles.d.ts +2 -2
- package/dist/lib/accent-roles.js +2 -2
- package/dist/lib/accent-roles.js.map +1 -1
- package/dist/lib/appearance-font-settings.d.ts.map +1 -1
- package/dist/lib/appearance-font-settings.js +15 -7
- package/dist/lib/appearance-font-settings.js.map +1 -1
- package/dist/lib/create-poll.d.ts +39 -0
- package/dist/lib/create-poll.d.ts.map +1 -0
- package/dist/lib/create-poll.js +116 -0
- package/dist/lib/create-poll.js.map +1 -0
- package/dist/lib/font-zoom.d.ts +1 -1
- package/dist/lib/font-zoom.js +1 -1
- package/dist/lib/font-zoom.js.map +1 -1
- package/dist/lib/keyed-rows.d.ts +2 -1
- package/dist/lib/keyed-rows.d.ts.map +1 -1
- package/dist/lib/keyed-rows.js +3 -2
- package/dist/lib/keyed-rows.js.map +1 -1
- package/dist/lib/overlay.d.ts +5 -5
- package/dist/lib/overlay.js +5 -5
- package/dist/lib/overlay.js.map +1 -1
- package/dist/lib/preference-store.d.ts +2 -2
- package/dist/lib/preference-store.js +2 -2
- package/dist/lib/preference-store.js.map +1 -1
- package/dist/lib/safe-script.d.ts +2 -2
- package/dist/lib/safe-script.js +2 -2
- package/dist/lib/safe-script.js.map +1 -1
- package/dist/lib/scroll-geometry.d.ts +1 -1
- package/dist/lib/scroll-geometry.js +1 -1
- package/dist/lib/scroll-geometry.js.map +1 -1
- package/dist/lib/text.d.ts +1 -1
- package/dist/lib/text.js +1 -1
- package/dist/lib/text.js.map +1 -1
- package/dist/lib/theme-accents.js +3 -3
- package/dist/lib/theme-accents.js.map +1 -1
- package/dist/lib/theme-css.js.map +1 -1
- package/dist/lib/theme-defaults.d.ts +4 -4
- package/dist/lib/theme-defaults.js +4 -4
- package/dist/lib/theme-defaults.js.map +1 -1
- package/dist/lib/theme-engine-light.js.map +1 -1
- package/dist/lib/theme-engine.d.ts +2 -2
- package/dist/lib/theme-engine.js +2 -2
- package/dist/lib/theme-engine.js.map +1 -1
- package/dist/lib/theme-projection.d.ts +1 -1
- package/dist/lib/theme-projection.js +2 -2
- package/dist/lib/theme-projection.js.map +1 -1
- package/dist/lib/theme-records.d.ts +2 -2
- package/dist/lib/theme-records.js +2 -2
- package/dist/lib/theme-records.js.map +1 -1
- package/dist/lib/theme-types.d.ts +1 -1
- package/dist/lib/theme-types.js.map +1 -1
- package/dist/lib/themes.d.ts +13 -13
- package/dist/lib/themes.js +13 -13
- package/dist/lib/themes.js.map +1 -1
- package/dist/lib/tokens.d.ts +2 -2
- package/dist/lib/tokens.js +1 -1
- package/dist/lib/tokens.js.map +1 -1
- package/dist/lib/tooltip-focus-gate.d.ts +2 -2
- package/dist/lib/tooltip-focus-gate.js +2 -2
- package/dist/lib/tooltip-focus-gate.js.map +1 -1
- package/dist/lib/utils.d.ts +1 -1
- package/dist/lib/utils.js +1 -1
- package/dist/lib/utils.js.map +1 -1
- package/dist/lib/variants.d.ts +4 -4
- package/dist/lib/variants.js +1 -1
- package/dist/lib/variants.js.map +1 -1
- package/dist/lib/version-notes.d.ts +4 -4
- package/dist/lib/version-notes.js +4 -4
- package/dist/lib/version-notes.js.map +1 -1
- package/dist/lint.js.map +1 -1
- package/dist/r/account-menu.json +1 -0
- package/dist/r/lib.json +5 -0
- package/dist/r/registry.json +11 -0
- package/dist/r/src/components/composites/account-menu/account-menu.tsx +22 -2
- package/dist/r/src/components/composites/action-button/action-button.tsx +124 -78
- package/dist/r/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -3
- package/dist/r/src/components/composites/appearance-editor/appearance-choices.tsx +3 -3
- package/dist/r/src/components/composites/appearance-editor/appearance-editor.tsx +15 -9
- package/dist/r/src/components/composites/appearance-editor/appearance-rows.tsx +3 -1
- package/dist/r/src/components/composites/appearance-editor/appearance-types.ts +7 -7
- package/dist/r/src/components/composites/appearance-editor/theme-preview.tsx +1 -1
- package/dist/r/src/components/composites/catalog-browser/catalog-browser.tsx +6 -2
- package/dist/r/src/components/composites/catalog-browser/catalog-detail.tsx +15 -6
- package/dist/r/src/components/composites/chain-of-thought/chain-of-thought.tsx +4 -4
- package/dist/r/src/components/composites/chat/chat.tsx +15 -9
- package/dist/r/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
- package/dist/r/src/components/composites/checkpoint/checkpoint.tsx +2 -2
- package/dist/r/src/components/composites/confirmation/confirmation.tsx +8 -4
- package/dist/r/src/components/composites/context/context.tsx +2 -2
- package/dist/r/src/components/composites/file-tree/build-file-tree.ts +1 -1
- package/dist/r/src/components/composites/file-tree/file-tree.tsx +16 -2
- package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +1 -1
- package/dist/r/src/components/composites/inline-citation/citation.ts +1 -1
- package/dist/r/src/components/composites/inline-citation/inline-citation.tsx +2 -2
- package/dist/r/src/components/composites/list-row/list-row-control.tsx +31 -22
- package/dist/r/src/components/composites/list-row/list-row.tsx +69 -73
- package/dist/r/src/components/composites/message-scroller/message-scroller.tsx +1 -1
- package/dist/r/src/components/composites/model-selector/model-selector.tsx +4 -4
- package/dist/r/src/components/composites/model-selector/models.ts +2 -2
- package/dist/r/src/components/composites/plan/plan.tsx +19 -11
- package/dist/r/src/components/composites/queue/queue.tsx +5 -3
- package/dist/r/src/components/composites/reasoning/reasoning.tsx +4 -4
- package/dist/r/src/components/composites/settings/settings-navigation.tsx +57 -17
- package/dist/r/src/components/composites/settings/settings.tsx +14 -6
- package/dist/r/src/components/composites/sources/source.ts +1 -1
- package/dist/r/src/components/composites/sources/sources.tsx +2 -2
- package/dist/r/src/components/composites/stack-trace/parse-stack-trace.ts +7 -7
- package/dist/r/src/components/composites/stack-trace/stack-trace.tsx +3 -3
- package/dist/r/src/components/composites/stat/stat.tsx +20 -16
- package/dist/r/src/components/composites/subagent/subagent.tsx +6 -4
- package/dist/r/src/components/composites/task/task.tsx +1 -1
- package/dist/r/src/components/composites/terminal/ansi.ts +3 -3
- package/dist/r/src/components/composites/terminal/terminal-model.ts +3 -3
- package/dist/r/src/components/composites/terminal/terminal.tsx +24 -12
- package/dist/r/src/components/composites/test-results/test-results-model.ts +4 -4
- package/dist/r/src/components/composites/test-results/test-results.tsx +1 -1
- package/dist/r/src/components/composites/tool/tool.tsx +4 -4
- package/dist/r/src/components/composites/tree/tree.tsx +31 -15
- package/dist/r/src/components/composites/update-dialog/channel-control.tsx +17 -8
- package/dist/r/src/components/composites/update-dialog/index.ts +1 -0
- package/dist/r/src/components/composites/update-dialog/update-dialog.tsx +7 -7
- package/dist/r/src/components/composites/workspace-mark/workspace-mark.tsx +15 -12
- package/dist/r/src/components/conversation/busy-send-button.tsx +6 -2
- package/dist/r/src/components/conversation/composer-menu.tsx +3 -3
- package/dist/r/src/components/conversation/conversation-avatar.tsx +1 -1
- package/dist/r/src/components/conversation/conversation-pane.tsx +8 -5
- package/dist/r/src/components/conversation/conversation-surface.tsx +2 -2
- package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +18 -12
- package/dist/r/src/components/conversation/message-composer.tsx +4 -6
- package/dist/r/src/components/conversation/message-row.tsx +34 -26
- package/dist/r/src/components/conversation/scroll-follow-core.ts +8 -8
- package/dist/r/src/components/conversation/scroll-follow.ts +24 -8
- package/dist/r/src/components/conversation/thread-panel.tsx +7 -3
- package/dist/r/src/components/conversation/transcript-composition.tsx +4 -2
- package/dist/r/src/components/layout/app-shell/app-shell.tsx +1 -1
- package/dist/r/src/components/layout/app-shell/skip-link.tsx +3 -2
- package/dist/r/src/components/layout/page/page.tsx +15 -11
- package/dist/r/src/components/layout/panel/panel.tsx +1 -1
- package/dist/r/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +21 -1
- package/dist/r/src/components/layout/side-rail/side-rail-context.ts +1 -1
- package/dist/r/src/components/layout/side-rail/side-rail.tsx +38 -22
- package/dist/r/src/components/layout/sidebar-nav/sidebar-nav.tsx +22 -16
- package/dist/r/src/components/layout/split-layout/resize-controller-core-retry.tsx +25 -7
- package/dist/r/src/components/layout/split-layout/resize-controller-core.tsx +25 -7
- package/dist/r/src/components/layout/split-layout/split-layout.tsx +6 -2
- package/dist/r/src/components/layout/status-bar/status-bar.tsx +1 -1
- package/dist/r/src/components/layout/top-bar/top-bar.tsx +8 -6
- package/dist/r/src/components/motion/presence.tsx +2 -2
- package/dist/r/src/components/theme/appearance-panel.tsx +5 -5
- package/dist/r/src/components/theme/lazy.ts +1 -1
- package/dist/r/src/components/theme/theme-catalogue-source.ts +2 -2
- package/dist/r/src/components/theme/theme-context.ts +3 -3
- package/dist/r/src/components/theme/theme-document.ts +22 -11
- package/dist/r/src/components/theme/theme-picker.tsx +5 -5
- package/dist/r/src/components/theme/theme-provider-value.ts +15 -3
- package/dist/r/src/components/theme/theme-script.ts +20 -0
- package/dist/r/src/components/theme/theme-state.ts +7 -7
- package/dist/r/src/components/theme/theme-toggle.tsx +1 -1
- package/dist/r/src/components/ui/alert/alert.tsx +4 -3
- package/dist/r/src/components/ui/alert-dialog/alert-dialog.tsx +4 -4
- package/dist/r/src/components/ui/badge/badge.tsx +2 -2
- package/dist/r/src/components/ui/board/board.tsx +17 -5
- package/dist/r/src/components/ui/bubble/bubble.tsx +6 -4
- package/dist/r/src/components/ui/button/button.tsx +2 -2
- package/dist/r/src/components/ui/button-group/button-group.tsx +1 -1
- package/dist/r/src/components/ui/calendar/calendar.tsx +2 -2
- package/dist/r/src/components/ui/callout/callout.tsx +4 -4
- package/dist/r/src/components/ui/card/card.tsx +2 -2
- package/dist/r/src/components/ui/carousel/carousel.tsx +6 -6
- package/dist/r/src/components/ui/chart/chart-options.ts +9 -9
- package/dist/r/src/components/ui/chart/chart.tsx +14 -1
- package/dist/r/src/components/ui/checkbox/checkbox.tsx +9 -6
- package/dist/r/src/components/ui/code-block/code-block.tsx +14 -7
- package/dist/r/src/components/ui/command/command.tsx +7 -7
- package/dist/r/src/components/ui/context-menu/context-menu.tsx +1 -1
- package/dist/r/src/components/ui/detail-panel/detail-panel.tsx +5 -3
- package/dist/r/src/components/ui/dialog/dialog-layer.tsx +27 -1
- package/dist/r/src/components/ui/dialog/dialog.tsx +4 -3
- package/dist/r/src/components/ui/diff-block/diff-block.tsx +6 -6
- package/dist/r/src/components/ui/drawer/drawer.tsx +3 -3
- package/dist/r/src/components/ui/dropdown-menu/dropdown-menu.tsx +6 -6
- package/dist/r/src/components/ui/dropdown-menu/menu-parts.tsx +5 -5
- package/dist/r/src/components/ui/empty/empty-state.tsx +23 -18
- package/dist/r/src/components/ui/empty/empty.tsx +1 -1
- package/dist/r/src/components/ui/entity-icon/entity-icon.tsx +5 -1
- package/dist/r/src/components/ui/field/field.tsx +15 -7
- package/dist/r/src/components/ui/field/number-field.tsx +1 -1
- package/dist/r/src/components/ui/hover-card/hover-card.tsx +1 -1
- package/dist/r/src/components/ui/input-group/input-group.tsx +1 -1
- package/dist/r/src/components/ui/input-otp/input-otp.tsx +1 -1
- package/dist/r/src/components/ui/item/item.tsx +24 -18
- package/dist/r/src/components/ui/kbd/kbd.tsx +2 -2
- package/dist/r/src/components/ui/kbd/platform-modifier.ts +3 -3
- package/dist/r/src/components/ui/label/label.tsx +1 -1
- package/dist/r/src/components/ui/marker/marker.tsx +9 -5
- package/dist/r/src/components/ui/menubar/menubar.tsx +2 -2
- package/dist/r/src/components/ui/message/message.tsx +14 -13
- package/dist/r/src/components/ui/modal-dialog/modal-dialog.tsx +9 -5
- package/dist/r/src/components/ui/native-select/native-select.tsx +1 -1
- package/dist/r/src/components/ui/navigation-menu/navigation-menu.tsx +5 -4
- package/dist/r/src/components/ui/pagination/pagination.tsx +1 -1
- package/dist/r/src/components/ui/popover/popover.tsx +4 -2
- package/dist/r/src/components/ui/progress/progress.tsx +5 -3
- package/dist/r/src/components/ui/questionnaire/questionnaire.tsx +10 -5
- package/dist/r/src/components/ui/radio-group/radio-group.tsx +9 -6
- package/dist/r/src/components/ui/resizable/resizable.tsx +5 -5
- package/dist/r/src/components/ui/select/select.tsx +4 -4
- package/dist/r/src/components/ui/sheet/sheet.tsx +4 -3
- package/dist/r/src/components/ui/skeleton/skeleton.tsx +1 -1
- package/dist/r/src/components/ui/slider/slider.tsx +1 -1
- package/dist/r/src/components/ui/spinner/spinner.tsx +1 -1
- package/dist/r/src/components/ui/status-chip/status-chip.tsx +13 -13
- package/dist/r/src/components/ui/switch/switch.tsx +9 -6
- package/dist/r/src/components/ui/tabs/tabs.tsx +4 -4
- package/dist/r/src/components/ui/textarea/textarea.tsx +1 -1
- package/dist/r/src/components/ui/toast/toast.tsx +6 -4
- package/dist/r/src/components/ui/toggle/toggle.tsx +1 -1
- package/dist/r/src/components/ui/tooltip/deferred-tooltip.tsx +131 -0
- package/dist/r/src/components/ui/tooltip/index.ts +1 -0
- package/dist/r/src/components/ui/tooltip/tooltip.tsx +6 -4
- package/dist/r/src/components/ui/trace/trace.tsx +13 -9
- package/dist/r/src/components/ui/typography/typography.tsx +5 -5
- package/dist/r/src/lib/accent-presets.ts +1 -1
- package/dist/r/src/lib/accent-roles.ts +2 -2
- package/dist/r/src/lib/appearance-font-settings.ts +18 -7
- package/dist/r/src/lib/create-poll.ts +150 -0
- package/dist/r/src/lib/font-zoom.ts +3 -3
- package/dist/r/src/lib/keyed-rows.ts +3 -2
- package/dist/r/src/lib/overlay.ts +5 -5
- package/dist/r/src/lib/preference-store.ts +2 -2
- package/dist/r/src/lib/safe-script.ts +2 -2
- package/dist/r/src/lib/scroll-geometry.ts +1 -1
- package/dist/r/src/lib/text.ts +1 -1
- package/dist/r/src/lib/theme-accents.ts +3 -3
- package/dist/r/src/lib/theme-css.ts +2 -2
- package/dist/r/src/lib/theme-defaults.ts +4 -4
- package/dist/r/src/lib/theme-engine-light.ts +2 -2
- package/dist/r/src/lib/theme-engine.ts +2 -2
- package/dist/r/src/lib/theme-projection.ts +2 -2
- package/dist/r/src/lib/theme-records.ts +2 -2
- package/dist/r/src/lib/theme-types.ts +1 -1
- package/dist/r/src/lib/themes.ts +14 -14
- package/dist/r/src/lib/tokens.ts +2 -2
- package/dist/r/src/lib/tooltip-focus-gate.ts +11 -11
- package/dist/r/src/lib/utils.ts +1 -1
- package/dist/r/src/lib/variants.ts +4 -4
- package/dist/r/src/lib/version-notes.ts +4 -4
- package/dist/r/src/styles/base.css +12 -43
- package/dist/r/src/styles/fonts.css +1 -1
- package/dist/r/src/styles/theme.css +35 -35
- package/dist/r/tooltip.json +5 -0
- package/package.json +2 -1
- package/registry.json +11 -0
- package/src/components/composites/account-menu/account-menu.tsx +22 -2
- package/src/components/composites/action-button/action-button.tsx +124 -78
- package/src/components/composites/appearance-editor/accent-swatch-groups.tsx +3 -3
- package/src/components/composites/appearance-editor/appearance-choices.tsx +3 -3
- package/src/components/composites/appearance-editor/appearance-editor.tsx +15 -9
- package/src/components/composites/appearance-editor/appearance-rows.tsx +3 -1
- package/src/components/composites/appearance-editor/appearance-types.ts +7 -7
- package/src/components/composites/appearance-editor/theme-preview.tsx +1 -1
- package/src/components/composites/catalog-browser/catalog-browser.tsx +6 -2
- package/src/components/composites/catalog-browser/catalog-detail.tsx +15 -6
- package/src/components/composites/chain-of-thought/chain-of-thought.tsx +4 -4
- package/src/components/composites/chat/chat.tsx +15 -9
- package/src/components/composites/checkpoint/checkpoint-model.ts +3 -3
- package/src/components/composites/checkpoint/checkpoint.tsx +2 -2
- package/src/components/composites/confirmation/confirmation.tsx +8 -4
- package/src/components/composites/context/context.tsx +2 -2
- package/src/components/composites/file-tree/build-file-tree.ts +1 -1
- package/src/components/composites/file-tree/file-tree.tsx +16 -2
- package/src/components/composites/icon-picker/icon-picker.tsx +1 -1
- package/src/components/composites/inline-citation/citation.ts +1 -1
- package/src/components/composites/inline-citation/inline-citation.tsx +2 -2
- package/src/components/composites/list-row/list-row-control.tsx +31 -22
- package/src/components/composites/list-row/list-row.tsx +69 -73
- package/src/components/composites/message-scroller/message-scroller.tsx +1 -1
- package/src/components/composites/model-selector/model-selector.tsx +4 -4
- package/src/components/composites/model-selector/models.ts +2 -2
- package/src/components/composites/plan/plan.tsx +19 -11
- package/src/components/composites/queue/queue.tsx +5 -3
- package/src/components/composites/reasoning/reasoning.tsx +4 -4
- package/src/components/composites/settings/settings-navigation.tsx +57 -17
- package/src/components/composites/settings/settings.tsx +14 -6
- package/src/components/composites/sources/source.ts +1 -1
- package/src/components/composites/sources/sources.tsx +2 -2
- package/src/components/composites/stack-trace/parse-stack-trace.ts +7 -7
- package/src/components/composites/stack-trace/stack-trace.tsx +3 -3
- package/src/components/composites/stat/stat.tsx +20 -16
- package/src/components/composites/subagent/subagent.tsx +6 -4
- package/src/components/composites/task/task.tsx +1 -1
- package/src/components/composites/terminal/ansi.ts +3 -3
- package/src/components/composites/terminal/terminal-model.ts +3 -3
- package/src/components/composites/terminal/terminal.tsx +24 -12
- package/src/components/composites/test-results/test-results-model.ts +4 -4
- package/src/components/composites/test-results/test-results.tsx +1 -1
- package/src/components/composites/tool/tool.tsx +4 -4
- package/src/components/composites/tree/tree.tsx +31 -15
- package/src/components/composites/update-dialog/channel-control.tsx +17 -8
- package/src/components/composites/update-dialog/index.ts +1 -0
- package/src/components/composites/update-dialog/update-dialog.tsx +7 -7
- package/src/components/composites/workspace-mark/workspace-mark.tsx +15 -12
- package/src/components/conversation/busy-send-button.tsx +6 -2
- package/src/components/conversation/composer-menu.tsx +3 -3
- package/src/components/conversation/conversation-avatar.tsx +1 -1
- package/src/components/conversation/conversation-pane.tsx +8 -5
- package/src/components/conversation/conversation-surface.tsx +2 -2
- package/src/components/conversation/internal/chat-composer-shell.tsx +18 -12
- package/src/components/conversation/message-composer.tsx +4 -6
- package/src/components/conversation/message-row.tsx +34 -26
- package/src/components/conversation/scroll-follow-core.ts +8 -8
- package/src/components/conversation/scroll-follow.ts +24 -8
- package/src/components/conversation/thread-panel.tsx +7 -3
- package/src/components/conversation/transcript-composition.tsx +4 -2
- package/src/components/layout/app-shell/app-shell.tsx +1 -1
- package/src/components/layout/app-shell/skip-link.tsx +3 -2
- package/src/components/layout/page/page.tsx +15 -11
- package/src/components/layout/panel/panel.tsx +1 -1
- package/src/components/layout/pixel-resize-handle/pixel-resize-handle.tsx +21 -1
- package/src/components/layout/side-rail/side-rail-context.ts +1 -1
- package/src/components/layout/side-rail/side-rail.tsx +38 -22
- package/src/components/layout/sidebar-nav/sidebar-nav.tsx +22 -16
- package/src/components/layout/split-layout/resize-controller-core-retry.tsx +25 -7
- package/src/components/layout/split-layout/resize-controller-core.tsx +25 -7
- package/src/components/layout/split-layout/split-layout.tsx +6 -2
- package/src/components/layout/status-bar/status-bar.tsx +1 -1
- package/src/components/layout/top-bar/top-bar.tsx +8 -6
- package/src/components/motion/presence.tsx +2 -2
- package/src/components/theme/appearance-panel.tsx +5 -5
- package/src/components/theme/lazy.ts +1 -1
- package/src/components/theme/theme-catalogue-source.ts +2 -2
- package/src/components/theme/theme-context.ts +3 -3
- package/src/components/theme/theme-document.ts +22 -11
- package/src/components/theme/theme-picker.tsx +5 -5
- package/src/components/theme/theme-provider-value.ts +15 -3
- package/src/components/theme/theme-script.ts +20 -0
- package/src/components/theme/theme-state.ts +7 -7
- package/src/components/theme/theme-toggle.tsx +1 -1
- package/src/components/ui/alert/alert.tsx +4 -3
- package/src/components/ui/alert-dialog/alert-dialog.tsx +4 -4
- package/src/components/ui/badge/badge.tsx +2 -2
- package/src/components/ui/board/board.tsx +17 -5
- package/src/components/ui/bubble/bubble.tsx +6 -4
- package/src/components/ui/button/button.tsx +2 -2
- package/src/components/ui/button-group/button-group.tsx +1 -1
- package/src/components/ui/calendar/calendar.tsx +2 -2
- package/src/components/ui/callout/callout.tsx +4 -4
- package/src/components/ui/card/card.tsx +2 -2
- package/src/components/ui/carousel/carousel.tsx +6 -6
- package/src/components/ui/chart/chart-options.ts +9 -9
- package/src/components/ui/chart/chart.tsx +14 -1
- package/src/components/ui/checkbox/checkbox.tsx +9 -6
- package/src/components/ui/code-block/code-block.tsx +14 -7
- package/src/components/ui/command/command.tsx +7 -7
- package/src/components/ui/context-menu/context-menu.tsx +1 -1
- package/src/components/ui/detail-panel/detail-panel.tsx +5 -3
- package/src/components/ui/dialog/dialog-layer.tsx +27 -1
- package/src/components/ui/dialog/dialog.tsx +4 -3
- package/src/components/ui/diff-block/diff-block.tsx +6 -6
- package/src/components/ui/drawer/drawer.tsx +3 -3
- package/src/components/ui/dropdown-menu/dropdown-menu.tsx +6 -6
- package/src/components/ui/dropdown-menu/menu-parts.tsx +5 -5
- package/src/components/ui/empty/empty-state.tsx +23 -18
- package/src/components/ui/empty/empty.tsx +1 -1
- package/src/components/ui/entity-icon/entity-icon.tsx +5 -1
- package/src/components/ui/field/field.tsx +15 -7
- package/src/components/ui/field/number-field.tsx +1 -1
- package/src/components/ui/hover-card/hover-card.tsx +1 -1
- package/src/components/ui/input-group/input-group.tsx +1 -1
- package/src/components/ui/input-otp/input-otp.tsx +1 -1
- package/src/components/ui/item/item.tsx +24 -18
- package/src/components/ui/kbd/kbd.tsx +2 -2
- package/src/components/ui/kbd/platform-modifier.ts +3 -3
- package/src/components/ui/label/label.tsx +1 -1
- package/src/components/ui/marker/marker.tsx +9 -5
- package/src/components/ui/menubar/menubar.tsx +2 -2
- package/src/components/ui/message/message.tsx +14 -13
- package/src/components/ui/modal-dialog/modal-dialog.tsx +9 -5
- package/src/components/ui/native-select/native-select.tsx +1 -1
- package/src/components/ui/navigation-menu/navigation-menu.tsx +5 -4
- package/src/components/ui/pagination/pagination.tsx +1 -1
- package/src/components/ui/popover/popover.tsx +4 -2
- package/src/components/ui/progress/progress.tsx +5 -3
- package/src/components/ui/questionnaire/questionnaire.tsx +10 -5
- package/src/components/ui/radio-group/radio-group.tsx +9 -6
- package/src/components/ui/resizable/resizable.tsx +5 -5
- package/src/components/ui/select/select.tsx +4 -4
- package/src/components/ui/sheet/sheet.tsx +4 -3
- package/src/components/ui/skeleton/skeleton.tsx +1 -1
- package/src/components/ui/slider/slider.tsx +1 -1
- package/src/components/ui/spinner/spinner.tsx +1 -1
- package/src/components/ui/status-chip/status-chip.tsx +13 -13
- package/src/components/ui/switch/switch.tsx +9 -6
- package/src/components/ui/tabs/tabs.tsx +4 -4
- package/src/components/ui/textarea/textarea.tsx +1 -1
- package/src/components/ui/toast/toast.tsx +6 -4
- package/src/components/ui/toggle/toggle.tsx +1 -1
- package/src/components/ui/tooltip/deferred-tooltip.tsx +131 -0
- package/src/components/ui/tooltip/index.ts +1 -0
- package/src/components/ui/tooltip/tooltip.tsx +6 -4
- package/src/components/ui/trace/trace.tsx +13 -9
- package/src/components/ui/typography/typography.tsx +5 -5
- package/src/index.ts +1 -0
- package/src/lib/accent-presets.ts +1 -1
- package/src/lib/accent-roles.ts +2 -2
- package/src/lib/appearance-font-settings.ts +18 -7
- package/src/lib/create-poll.ts +150 -0
- package/src/lib/font-zoom.ts +3 -3
- package/src/lib/keyed-rows.ts +3 -2
- package/src/lib/overlay.ts +5 -5
- package/src/lib/preference-store.ts +2 -2
- package/src/lib/safe-script.ts +2 -2
- package/src/lib/scroll-geometry.ts +1 -1
- package/src/lib/text.ts +1 -1
- package/src/lib/theme-accents.ts +3 -3
- package/src/lib/theme-css.ts +2 -2
- package/src/lib/theme-defaults.ts +4 -4
- package/src/lib/theme-engine-light.ts +2 -2
- package/src/lib/theme-engine.ts +2 -2
- package/src/lib/theme-projection.ts +2 -2
- package/src/lib/theme-records.ts +2 -2
- package/src/lib/theme-types.ts +1 -1
- package/src/lib/themes.ts +14 -14
- package/src/lib/tokens.ts +2 -2
- package/src/lib/tooltip-focus-gate.ts +11 -11
- package/src/lib/utils.ts +1 -1
- package/src/lib/variants.ts +4 -4
- package/src/lib/version-notes.ts +4 -4
- package/src/lint/index.ts +1 -1
- package/src/styles/base.css +12 -43
- package/src/styles/fonts.css +1 -1
- package/src/styles/theme.css +35 -35
- package/src/styles/themes/aardvark-blue.css +98 -0
- package/src/styles/themes/aardvark-ink.css +98 -0
- package/src/styles/themes/adea-dark-colorblind.css +98 -0
- package/src/styles/themes/adea-dark-high-contrast.css +98 -0
- package/src/styles/themes/adea-dark.css +47 -0
- package/src/styles/themes/adea-light-colorblind.css +141 -0
- package/src/styles/themes/adea-light-high-contrast.css +141 -0
- package/src/styles/themes/adea-light.css +47 -0
- package/src/styles/themes/ayu-light.css +141 -0
- package/src/styles/themes/ayu-mirage.css +98 -0
- package/src/styles/themes/ayu.css +98 -0
- package/src/styles/themes/catppuccin-frappe.css +98 -0
- package/src/styles/themes/catppuccin-latte.css +141 -0
- package/src/styles/themes/catppuccin-macchiato.css +98 -0
- package/src/styles/themes/catppuccin-mocha.css +98 -0
- package/src/styles/themes/dracula.css +98 -0
- package/src/styles/themes/everforest-dark.css +98 -0
- package/src/styles/themes/everforest-light.css +141 -0
- package/src/styles/themes/gruvbox-dark.css +98 -0
- package/src/styles/themes/gruvbox-light.css +141 -0
- package/src/styles/themes/kanagawa.css +98 -0
- package/src/styles/themes/monokai.css +98 -0
- package/src/styles/themes/nord-light.css +141 -0
- package/src/styles/themes/nord.css +98 -0
- package/src/styles/themes/one-dark.css +98 -0
- package/src/styles/themes/rosepine-dawn.css +141 -0
- package/src/styles/themes/rosepine-moon.css +98 -0
- package/src/styles/themes/rosepine.css +98 -0
- package/src/styles/themes/solarized-dark.css +98 -0
- package/src/styles/themes/solarized-light.css +141 -0
- package/src/styles/themes/tokyonight-day.css +141 -0
- package/src/styles/themes/tokyonight-night.css +98 -0
- package/src/styles/themes/tokyonight-storm.css +98 -0
- package/src/styles/themes/vesper.css +98 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"terminal.js","names":["ArrowDown","Check","CircleAlert","CircleSlash","Copy","Eraser","LoaderCircle","createEffect","createMemo","createSignal","For","on","Show","splitProps","createCopyFeedback","cn","Button","createAnsiParser","isPlainStyle","resolveColors","ansiPlainText","isAtBottom","isFailedExit","revealEarlier","terminalStatusLabel","terminalWindow","output","command","status","maxLines","retainLines","maxHeight","wrap","size","onClear","copyLabel","copiedLabel","clearLabel","onCopy","ok","TERMINAL_MAX_LINES","FG_CLASS","BG_CLASS","segmentClass","style","fg","bg","bold","dim","italic","underline","strike","LineView","props","line","_el$","_tmpl$2","_$insert","_$createComponent","each","segments","children","segment","text","_el$7","_tmpl$3","_$effect","_$className","when","truncated","_el$2","_tmpl$","firstChild","_el$6","nextSibling","toLocaleString","sameAnsiLine","left","right","length","every","index","StatusReadout","_el$8","_tmpl$5","state","_el$9","_tmpl$4","fallback","_p$","_v$","_v$2","e","_$setAttribute","t","undefined","Terminal","local","rest","small","pageSize","Math","max","floor","newParser","parser","consumed","epoch","revision","next","startsWith","write","slice","equals","limit","setLimit","defer","empty","outputRows","rows","lines","open","openLine","push","parked","setParked","end","total","droppedLines","anchorEnd","current","position","lineWindow","visibleRows","start","retainedIndex","changedParkedLine","newerRows","later","scroller","following","onScroll","atEnd","scrollHeight","scrollTop","clientHeight","currentEpoch","jumpToLatest","focus","copied","failed","copyFailed","copy","copyText","regionLabel","_el$0","_tmpl$0","_el$1","_el$13","_el$16","_el$17","_$spread","_$mergeProps","class","_tmpl$1","_el$10","_tmpl$6","_el$12","_$memo","variant","onClick","title","hidden","evicted","_el$14","_tmpl$7","_el$15","lost","revealable","min","addEventListener","_$use","element","_el$26","_tmpl$10","_el$27","_el$18","_tmpl$8","_el$19","_tmpl$9","_el$23","_el$24","_v$3","_v$4","_v$5","a","_$setStyleProperty"],"sources":["../../../../src/components/composites/terminal/terminal.tsx"],"sourcesContent":["import {\n ArrowDown,\n Check,\n CircleAlert,\n CircleSlash,\n Copy,\n Eraser,\n LoaderCircle,\n} from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n For,\n on,\n Show,\n splitProps,\n type ComponentProps,\n} from 'solid-js'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport {\n createAnsiParser,\n isPlainStyle,\n resolveColors,\n type AnsiLine,\n type AnsiStyle,\n ansiPlainText,\n} from './ansi'\nimport {\n isAtBottom,\n isFailedExit,\n revealEarlier,\n terminalStatusLabel,\n terminalWindow,\n type TerminalStatus,\n} from './terminal-model'\n\n/**\n * Terminal.\n *\n * A command and its output, as it arrives. It is the thing to put inside an\n * agent's \"ran a command\" line (a `TraceLine`, with `size=\"sm\"`) when the output\n * is the evidence; reach for `CodeBlock` instead when the text is source or a\n * finished log that needs no live behaviour, and for `TestResults` when the\n * output is a test run the host can structure.\n *\n * It does not wrap `CodeBlock`. A block's `highlight` seam re-renders the whole\n * body whenever the code changes, which is exactly wrong for output that grows a\n * line at a time, and a terminal has to own its scroller to follow the tail. It\n * keeps the block's header and surface vocabulary so the two read as one family.\n *\n * ## What the output is allowed to do\n *\n * Output is untrusted bytes. It is parsed by `createAnsiParser` into plain text\n * and a fixed set of styles — sixteen theme colours, bold, dim, italic,\n * underline, strike-through, reverse — and everything else (cursor movement,\n * title and clipboard sequences, anything malformed) is dropped, never echoed.\n * Colours come from the theme's `--terminal-ansi-*` tokens, painted on the\n * theme's own terminal background, so a program's colours keep the contrast the\n * theme measured for them. Nothing is rendered as markup.\n *\n * ## Streaming\n *\n * `output` is the whole string so far. When the new value begins with the old\n * one, only the appended text is parsed, so a chunk costs the size of the chunk\n * and not of the transcript. Finished lines are keyed by identity and are never\n * re-rendered; only the line still being written changes, which is what makes a\n * `\\r` progress bar redraw in place. Batch appends per frame — the host sees a\n * prefix check proportional to the output on every change.\n *\n * Only the last `maxLines` finished lines are mounted. The rest are counted in\n * an explicit note with a control to show them a page at a time, because tens of\n * thousands of row elements are a frozen page, not a transcript. Copy still\n * writes `output` exactly as given — not the rendered lines, not the visible tail.\n *\n * ## Following the tail\n *\n * The terminal scrolls inside its own bounded box and follows new output only\n * while the reader is at the bottom of that box. Scrolling up *parks* the view:\n * the lines mounted are the ones that were there when they left, however much\n * output arrives, and \"Jump to latest\" is the only way back to the tail (reaching\n * the bottom of a parked view with nothing newer resumes it, because nothing was\n * missed). If retention discards the lines they were reading the note says how\n * many, and when none are left the oldest retained lines are shown. The page\n * itself is never scrolled. Scrolling is instant, so there is no animation to\n * reduce.\n *\n * ## Status is a claim\n *\n * `status` is drawn only when the host passes it, in words as well as an icon,\n * and only a non-zero exit is toned as a failure: this component does not decide\n * that a command \"passed\". Without a status the header says nothing about whether\n * the command is still running. `onClear` adds a clear button; without it the\n * output is the host's record and nothing here offers to erase it.\n */\nexport type TerminalProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** Everything the command has printed so far, exactly as received. */\n output: string\n /** The command line. Shown as text; the prompt glyph is decoration. */\n command?: string\n status?: TerminalStatus\n /** Finished lines mounted at once; earlier ones are counted and revealed a page at a time. */\n maxLines?: number\n /** Finished lines kept at all; older ones are discarded and counted. Default 200 000. */\n retainLines?: number\n /** Height of the output box, which scrolls past it. A number is pixels. Default `20rem`. */\n maxHeight?: number | string\n /** Soft-wrap long lines instead of scrolling sideways. Off: terminal columns keep their alignment. */\n wrap?: boolean\n /** `sm` is the compact chrome for output nested inside a Trace line. */\n size?: 'default' | 'sm'\n /** Show a clear button. The host empties `output`; the terminal erases nothing itself. */\n onClear?: () => void\n copyLabel?: string\n copiedLabel?: string\n clearLabel?: string\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\n/** Finished lines mounted by default. */\nexport const TERMINAL_MAX_LINES = 1000\n\n// One literal class per colour, written out in full so the stylesheet generator\n// can see each of them; a class assembled from an index would never be emitted.\nconst FG_CLASS = [\n 'text-(color:--terminal-ansi-black)',\n 'text-(color:--terminal-ansi-red)',\n 'text-(color:--terminal-ansi-green)',\n 'text-(color:--terminal-ansi-yellow)',\n 'text-(color:--terminal-ansi-blue)',\n 'text-(color:--terminal-ansi-magenta)',\n 'text-(color:--terminal-ansi-cyan)',\n 'text-(color:--terminal-ansi-white)',\n 'text-(color:--terminal-ansi-bright-black)',\n 'text-(color:--terminal-ansi-bright-red)',\n 'text-(color:--terminal-ansi-bright-green)',\n 'text-(color:--terminal-ansi-bright-yellow)',\n 'text-(color:--terminal-ansi-bright-blue)',\n 'text-(color:--terminal-ansi-bright-magenta)',\n 'text-(color:--terminal-ansi-bright-cyan)',\n 'text-(color:--terminal-ansi-bright-white)',\n] as const\nconst BG_CLASS = [\n 'bg-(--terminal-ansi-black)',\n 'bg-(--terminal-ansi-red)',\n 'bg-(--terminal-ansi-green)',\n 'bg-(--terminal-ansi-yellow)',\n 'bg-(--terminal-ansi-blue)',\n 'bg-(--terminal-ansi-magenta)',\n 'bg-(--terminal-ansi-cyan)',\n 'bg-(--terminal-ansi-white)',\n 'bg-(--terminal-ansi-bright-black)',\n 'bg-(--terminal-ansi-bright-red)',\n 'bg-(--terminal-ansi-bright-green)',\n 'bg-(--terminal-ansi-bright-yellow)',\n 'bg-(--terminal-ansi-bright-blue)',\n 'bg-(--terminal-ansi-bright-magenta)',\n 'bg-(--terminal-ansi-bright-cyan)',\n 'bg-(--terminal-ansi-bright-white)',\n] as const\n\nfunction segmentClass(style: AnsiStyle): string {\n const { fg, bg } = resolveColors(style)\n return cn(\n {\n 'font-bold': style.bold,\n 'opacity-70': style.dim,\n italic: style.italic,\n underline: style.underline && !style.strike,\n 'line-through': style.strike && !style.underline,\n '[text-decoration-line:underline_line-through]': style.underline && style.strike,\n 'text-(color:--terminal-background)': fg === 'default-bg',\n 'bg-(--terminal-foreground)': bg === 'default-fg',\n },\n typeof fg === 'number' && FG_CLASS[fg],\n typeof bg === 'number' && BG_CLASS[bg]\n )\n}\n\nfunction LineView(props: { line: AnsiLine; wrap: boolean }) {\n return (\n // `min-h-lh` keeps an empty line one line tall; a block with no text would\n // collapse and the transcript would lose its blank lines.\n <div\n class={cn('min-h-lh', {\n 'whitespace-pre-wrap [overflow-wrap:anywhere]': props.wrap,\n 'w-max min-w-full': !props.wrap,\n })}\n >\n <For each={props.line.segments}>\n {(segment) =>\n isPlainStyle(segment.style) ? (\n segment.text\n ) : (\n <span class={segmentClass(segment.style)}>{segment.text}</span>\n )\n }\n </For>\n <Show when={props.line.truncated > 0}>\n <span class=\"opacity-70 select-none\">\n {' '}\n … {props.line.truncated.toLocaleString()} more characters not shown\n </span>\n </Show>\n </div>\n )\n}\n\nfunction sameAnsiLine(left: AnsiLine, right: AnsiLine): boolean {\n return (\n left.truncated === right.truncated &&\n left.segments.length === right.segments.length &&\n left.segments.every(\n (segment, index) =>\n segment.text === right.segments[index]?.text &&\n segment.style === right.segments[index]?.style\n )\n )\n}\n\nfunction StatusReadout(props: { status: TerminalStatus }) {\n return (\n // A live region, so a command that finishes while the reader is elsewhere is\n // announced once, in words.\n <span\n role=\"status\"\n data-slot=\"terminal-status\"\n data-state={props.status.state}\n class={cn('flex shrink-0 items-center gap-1 text-xs', {\n 'text-destructive': isFailedExit(props.status),\n 'text-info': props.status.state === 'running',\n 'text-muted-foreground': props.status.state !== 'running' && !isFailedExit(props.status),\n })}\n >\n {/* A zero exit gets no glyph: a tick would be this component deciding the\n command succeeded, and some tools exit non-zero on purpose or zero on\n failure. The words carry the fact; only a non-zero code is toned. */}\n <Show when={props.status.state !== 'exited' || isFailedExit(props.status)}>\n <span aria-hidden=\"true\" class=\"grid size-3.5 place-items-center [&_svg]:size-3.5\">\n <Show\n when={props.status.state === 'running'}\n fallback={\n <Show when={props.status.state === 'cancelled'} fallback={<CircleAlert />}>\n <CircleSlash />\n </Show>\n }\n >\n <LoaderCircle class=\"motion-safe:animate-spin\" />\n </Show>\n </span>\n </Show>\n {terminalStatusLabel(props.status)}\n </span>\n )\n}\n\nexport function Terminal(props: TerminalProps) {\n const [local, rest] = splitProps(props, [\n 'output',\n 'command',\n 'status',\n 'maxLines',\n 'retainLines',\n 'maxHeight',\n 'wrap',\n 'size',\n 'onClear',\n 'copyLabel',\n 'copiedLabel',\n 'clearLabel',\n 'onCopy',\n 'class',\n ])\n\n const small = () => local.size === 'sm'\n const pageSize = () => Math.max(1, Math.floor(local.maxLines ?? TERMINAL_MAX_LINES))\n const maxHeight = () =>\n typeof local.maxHeight === 'number' ? `${local.maxHeight}px` : (local.maxHeight ?? '20rem')\n\n // The parser outlives renders: it holds the half-read escape sequence, the\n // current style and the open line. A new `output` that extends the old one is\n // fed only its tail; anything else (a clear, a different command) starts over.\n const newParser = () => createAnsiParser({ retainLines: local.retainLines })\n let parser = newParser()\n let consumed = ''\n // Bumped when the output restarts, so a parked position from the old output\n // is never applied to the new one.\n let epoch = 0\n const revision = createMemo(\n () => {\n const next = local.output\n if (next.length >= consumed.length && next.startsWith(consumed)) {\n parser.write(next.slice(consumed.length))\n } else {\n parser = newParser()\n parser.write(next)\n epoch += 1\n }\n consumed = next\n return epoch\n },\n undefined,\n { equals: false }\n )\n\n const [limit, setLimit] = createSignal(pageSize())\n createEffect(on(pageSize, (size) => setLimit(size), { defer: true }))\n // A cleared terminal is a fresh one: the next command starts at the page size.\n createEffect(\n on(\n () => local.output === '',\n (empty) => {\n if (empty) setLimit(pageSize())\n },\n { defer: true }\n )\n )\n\n const outputRows = createMemo(\n () => {\n revision()\n const rows = parser.lines.slice()\n const open = parser.openLine()\n if (open) rows.push(open)\n return rows\n },\n [],\n { equals: false }\n )\n // Where the reader parked, as a count of lines since the output began. An open\n // line is a row too: freeze its snapshot so streamed characters and CR redraws\n // do not rewrite the text under a parked reader.\n const [parked, setParked] = createSignal<{ epoch: number; end: number; open?: AnsiLine }>()\n const total = () => parser.droppedLines + outputRows().length\n const anchorEnd = () => {\n const current = revision()\n const position = parked()\n return position && position.epoch === current ? position.end : undefined\n }\n const lineWindow = createMemo(() => {\n revision()\n return terminalWindow(outputRows().length, parser.droppedLines, limit(), anchorEnd())\n })\n // Finished rows keep their parser identity. If an open row existed when the\n // reader parked, substitute its immutable snapshot until they jump to latest.\n const visibleRows = createMemo(\n () => {\n revision()\n const start = lineWindow().start\n const end = lineWindow().end\n const rows = outputRows().slice(start, end)\n const position = parked()\n if (position?.epoch === revision() && position.open) {\n const retainedIndex = position.end - 1 - parser.droppedLines\n if (retainedIndex >= start && retainedIndex < end) {\n rows[retainedIndex - start] = position.open\n }\n }\n return rows\n },\n [],\n { equals: false }\n )\n const changedParkedLine = () => {\n const position = parked()\n if (position?.epoch !== revision() || !position.open) return false\n const retainedIndex = position.end - 1 - parser.droppedLines\n const current = outputRows()[retainedIndex]\n return current !== undefined && !sameAnsiLine(position.open, current)\n }\n const newerRows = () => lineWindow().later + (changedParkedLine() ? 1 : 0)\n\n let scroller: HTMLDivElement | undefined\n const following = () => anchorEnd() === undefined\n\n const onScroll = () => {\n if (!scroller) return\n const atEnd = isAtBottom(scroller.scrollHeight, scroller.scrollTop, scroller.clientHeight)\n const position = anchorEnd()\n if (!atEnd) {\n if (position === undefined) {\n const currentEpoch = revision()\n setParked({ epoch: currentEpoch, end: total(), open: parser.openLine() })\n }\n } else if (position !== undefined && position >= total() && !changedParkedLine()) {\n // Back at the end of a view with nothing newer: nothing was missed.\n setParked(undefined)\n }\n }\n createEffect(\n on(revision, () => {\n if (scroller && following()) scroller.scrollTop = scroller.scrollHeight\n })\n )\n const jumpToLatest = () => {\n if (!scroller) return\n setParked(undefined)\n scroller.scrollTop = scroller.scrollHeight\n // The button is about to disappear; leave focus somewhere real.\n scroller.focus()\n }\n\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const copy = async () => {\n const ok = await copyText(ansiPlainText(local.output))\n local.onCopy?.(ok)\n }\n\n const empty = () => local.output === ''\n const regionLabel = () =>\n local.command ? `Output of ${local.command.slice(0, 120)}` : 'Terminal output'\n\n return (\n <div\n data-slot=\"terminal\"\n data-size={local.size ?? 'default'}\n aria-busy={local.status?.state === 'running' || undefined}\n class={cn(\n 'group/terminal overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n >\n <div class={cn('flex items-center gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}>\n <Show\n when={local.command !== undefined}\n fallback={<span class=\"flex-1 text-xs text-muted-foreground\">Terminal</span>}\n >\n <span class=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"shrink-0 font-code text-code text-muted-foreground select-none\"\n >\n $\n </span>\n <code\n title={local.command}\n class=\"line-clamp-2 min-w-0 font-code text-code text-foreground [overflow-wrap:anywhere]\"\n >\n {local.command}\n </code>\n </span>\n </Show>\n <Show when={local.status}>{(status) => <StatusReadout status={status()} />}</Show>\n {/* Hidden until the terminal is hovered or holds focus, never removed:\n a control that only exists under the pointer is unreachable by\n keyboard, and a touch screen has no hover, so it always shows there. */}\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/terminal:opacity-100 group-hover/terminal:opacity-100 [@media(hover:none)]:opacity-100\">\n <Show when={local.onClear !== undefined && !empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={local.clearLabel ?? 'Clear output'}\n onClick={() => local.onClear?.()}\n >\n <Eraser aria-hidden=\"true\" />\n </Button>\n </Show>\n <Show when={!empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy output')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </Show>\n </div>\n </div>\n\n <Show when={lineWindow().hidden > 0 || lineWindow().evicted > 0}>\n <div\n data-slot=\"terminal-hidden-note\"\n class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\"\n >\n <span>\n <Show when={lineWindow().hidden > 0}>\n {lineWindow().hidden.toLocaleString()} earlier{' '}\n {lineWindow().hidden === 1 ? 'line' : 'lines'} hidden\n <Show when={parser.droppedLines > 0}>\n {' '}\n ({parser.droppedLines.toLocaleString()} only in the copy)\n </Show>\n .\n </Show>\n <Show when={lineWindow().evicted > 0}>\n {' '}\n {lineWindow().lost\n ? `Older lines dropped. Showing the oldest ${lineWindow().end.toLocaleString()} kept.`\n : `${lineWindow().evicted.toLocaleString()} older lines dropped.`}\n </Show>\n </span>\n <Show when={lineWindow().revealable > 0}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => setLimit(revealEarlier(limit(), pageSize(), outputRows().length))}\n >\n Show {Math.min(pageSize(), lineWindow().revealable).toLocaleString()} earlier\n </Button>\n </Show>\n </div>\n </Show>\n\n <div class=\"relative\">\n <div\n ref={(element) => (scroller = element)}\n data-slot=\"terminal-body\"\n // A region that scrolls must be focusable, and a tab stop needs a name.\n role=\"region\"\n tabindex=\"0\"\n aria-label={regionLabel()}\n onScroll={onScroll}\n style={{ 'max-height': maxHeight() }}\n class=\"scroll-fade overflow-auto border-t border-border bg-(--terminal-background) text-(color:--terminal-foreground)\"\n >\n <Show\n when={!empty()}\n fallback={\n <p class={cn('m-0 opacity-70', small() ? 'px-2 py-1.5' : 'px-3 py-2')}>\n <span class=\"font-code text-code\">\n {local.status?.state === 'running' ? 'Waiting for output…' : 'No output'}\n </span>\n </p>\n }\n >\n <pre\n class={cn(\n 'm-0 font-code text-code leading-normal',\n small() ? 'px-2 py-1.5' : 'px-3 py-2'\n )}\n >\n <For each={visibleRows()}>\n {(line) => <LineView line={line} wrap={local.wrap === true} />}\n </For>\n </pre>\n </Show>\n </div>\n <Show when={newerRows() > 0}>\n <Button\n variant=\"secondary\"\n size=\"2xs\"\n class=\"absolute end-3 bottom-2 shadow-sm\"\n onClick={jumpToLatest}\n >\n <ArrowDown aria-hidden=\"true\" />\n Jump to latest\n <span class=\"text-muted-foreground tabular-nums\">\n ({newerRows().toLocaleString()} newer {newerRows() === 1 ? 'line' : 'lines'})\n </span>\n </Button>\n </Show>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2HA,IAAawC,qBAAqB;AAIlC,IAAMC,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAA2C;AAE7C,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js","names":["ArrowDown","Check","CircleAlert","CircleSlash","Copy","Eraser","LoaderCircle","createEffect","createMemo","createSignal","For","on","Show","splitProps","createCopyFeedback","cn","Button","createAnsiParser","isPlainStyle","resolveColors","ansiPlainText","isAtBottom","isFailedExit","revealEarlier","terminalStatusLabel","terminalWindow","output","command","status","maxLines","retainLines","maxHeight","wrap","size","onClear","copyLabel","copiedLabel","clearLabel","onCopy","ok","TERMINAL_MAX_LINES","FG_CLASS","BG_CLASS","segmentClass","style","fg","bg","bold","dim","italic","underline","strike","LineView","props","line","_el$","_tmpl$2","_$insert","_$createComponent","each","segments","children","segment","text","_el$7","_tmpl$3","_$effect","_$className","when","truncated","_el$2","_tmpl$","firstChild","_el$6","nextSibling","toLocaleString","sameAnsiLine","left","right","length","every","index","StatusReadout","_el$8","_tmpl$5","state","_el$9","_tmpl$4","fallback","_p$","_v$","_v$2","e","_$setAttribute","t","undefined","Terminal","local","rest","small","pageSize","Math","max","floor","newParser","parser","consumed","epoch","revision","next","startsWith","write","slice","equals","limit","setLimit","defer","empty","outputRows","outputRowCount","at","lines","openLine","start","end","rows","min","open","push","parked","setParked","total","droppedLines","anchorEnd","current","position","lineWindow","visibleRows","retainedIndex","changedParkedLine","newerRows","later","scroller","following","onScroll","atEnd","scrollHeight","scrollTop","clientHeight","currentEpoch","jumpToLatest","focus","copied","failed","copyFailed","copy","copyText","regionLabel","_el$0","_tmpl$0","_el$1","_el$13","_el$16","_el$17","_$spread","_$mergeProps","class","_tmpl$1","_el$10","_tmpl$6","_el$12","_$memo","variant","onClick","title","hidden","evicted","_el$14","_tmpl$7","_el$15","lost","revealable","addEventListener","_$use","element","_el$26","_tmpl$10","_el$27","_el$18","_tmpl$8","_el$19","_tmpl$9","_el$23","_el$24","_v$3","_v$4","_v$5","a","_$setStyleProperty"],"sources":["../../../../src/components/composites/terminal/terminal.tsx"],"sourcesContent":["import {\n ArrowDown,\n Check,\n CircleAlert,\n CircleSlash,\n Copy,\n Eraser,\n LoaderCircle,\n} from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n For,\n on,\n Show,\n splitProps,\n type ComponentProps,\n} from 'solid-js'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport {\n createAnsiParser,\n isPlainStyle,\n resolveColors,\n type AnsiLine,\n type AnsiStyle,\n ansiPlainText,\n} from './ansi'\nimport {\n isAtBottom,\n isFailedExit,\n revealEarlier,\n terminalStatusLabel,\n terminalWindow,\n type TerminalStatus,\n} from './terminal-model'\n\n/**\n * Terminal.\n *\n * A command and its output, as it arrives. It is the thing to put inside an\n * agent's \"ran a command\" line (a `TraceLine`, with `size=\"sm\"`) when the output\n * is the evidence; reach for `CodeBlock` instead when the text is source or a\n * finished log that needs no live behaviour, and for `TestResults` when the\n * output is a test run the host can structure.\n *\n * It does not wrap `CodeBlock`. A block's `highlight` seam re-renders the whole\n * body whenever the code changes, which is exactly wrong for output that grows a\n * line at a time, and a terminal has to own its scroller to follow the tail. It\n * keeps the block's header and surface vocabulary so the two read as one family.\n *\n * ## What the output is allowed to do\n *\n * Output is untrusted bytes. It is parsed by `createAnsiParser` into plain text\n * and a fixed set of styles — sixteen theme colours, bold, dim, italic,\n * underline, strike-through, reverse — and everything else (cursor movement,\n * title and clipboard sequences, anything malformed) is dropped, never echoed.\n * Colours come from the theme's `--terminal-ansi-*` tokens, painted on the\n * theme's own terminal background, so a program's colours keep the contrast the\n * theme measured for them. Nothing is rendered as markup.\n *\n * ## Streaming\n *\n * `output` is the whole string so far. When the new value begins with the old\n * one, only the appended text is parsed, so a chunk costs the size of the chunk\n * and not of the transcript. Finished lines are keyed by identity and are never\n * re-rendered; only the line still being written changes, which is what makes a\n * `\\r` progress bar redraw in place. Batch appends per frame — the host sees a\n * prefix check proportional to the output on every change.\n *\n * Only the last `maxLines` finished lines are mounted. The rest are counted in\n * an explicit note with a control to show them a page at a time, because tens of\n * thousands of row elements are a frozen page, not a transcript. Copy still\n * writes `output` exactly as given — not the rendered lines, not the visible tail.\n *\n * ## Following the tail\n *\n * The terminal scrolls inside its own bounded box and follows new output only\n * while the reader is at the bottom of that box. Scrolling up *parks* the view:\n * the lines mounted are the ones that were there when they left, however much\n * output arrives, and \"Jump to latest\" is the only way back to the tail (reaching\n * the bottom of a parked view with nothing newer resumes it, because nothing was\n * missed). If retention discards the lines they were reading the note says how\n * many, and when none are left the oldest retained lines are shown. The page\n * itself is never scrolled. Scrolling is instant, so there is no animation to\n * reduce.\n *\n * ## Status is a claim\n *\n * `status` is drawn only when the host passes it, in words as well as an icon,\n * and only a non-zero exit is toned as a failure: this component does not decide\n * that a command \"passed\". Without a status the header says nothing about whether\n * the command is still running. `onClear` adds a clear button; without it the\n * output is the host's record and nothing here offers to erase it.\n */\nexport type TerminalProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** Everything the command has printed so far, exactly as received. */\n output: string\n /** The command line. Shown as text; the prompt glyph is decoration. */\n command?: string\n status?: TerminalStatus\n /** Finished lines mounted at once; earlier ones are counted and revealed a page at a time. */\n maxLines?: number\n /** Finished lines kept at all; older ones are discarded and counted. Default 200 000. */\n retainLines?: number\n /** Height of the output box, which scrolls past it. A number is pixels. Default `20rem`. */\n maxHeight?: number | string\n /** Soft-wrap long lines instead of scrolling sideways. Off: terminal columns keep their alignment. */\n wrap?: boolean\n /** `sm` is the compact chrome for output nested inside a Trace line. */\n size?: 'default' | 'sm'\n /** Show a clear button. The host empties `output`; the terminal erases nothing itself. */\n onClear?: () => void\n copyLabel?: string\n copiedLabel?: string\n clearLabel?: string\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\n/** Finished lines mounted by default. */\nexport const TERMINAL_MAX_LINES = 1000\n\n// One literal class per colour, written out in full so the stylesheet generator\n// can see each of them; a class assembled from an index would never be emitted.\nconst FG_CLASS = [\n 'text-(color:--terminal-ansi-black)',\n 'text-(color:--terminal-ansi-red)',\n 'text-(color:--terminal-ansi-green)',\n 'text-(color:--terminal-ansi-yellow)',\n 'text-(color:--terminal-ansi-blue)',\n 'text-(color:--terminal-ansi-magenta)',\n 'text-(color:--terminal-ansi-cyan)',\n 'text-(color:--terminal-ansi-white)',\n 'text-(color:--terminal-ansi-bright-black)',\n 'text-(color:--terminal-ansi-bright-red)',\n 'text-(color:--terminal-ansi-bright-green)',\n 'text-(color:--terminal-ansi-bright-yellow)',\n 'text-(color:--terminal-ansi-bright-blue)',\n 'text-(color:--terminal-ansi-bright-magenta)',\n 'text-(color:--terminal-ansi-bright-cyan)',\n 'text-(color:--terminal-ansi-bright-white)',\n] as const\nconst BG_CLASS = [\n 'bg-(--terminal-ansi-black)',\n 'bg-(--terminal-ansi-red)',\n 'bg-(--terminal-ansi-green)',\n 'bg-(--terminal-ansi-yellow)',\n 'bg-(--terminal-ansi-blue)',\n 'bg-(--terminal-ansi-magenta)',\n 'bg-(--terminal-ansi-cyan)',\n 'bg-(--terminal-ansi-white)',\n 'bg-(--terminal-ansi-bright-black)',\n 'bg-(--terminal-ansi-bright-red)',\n 'bg-(--terminal-ansi-bright-green)',\n 'bg-(--terminal-ansi-bright-yellow)',\n 'bg-(--terminal-ansi-bright-blue)',\n 'bg-(--terminal-ansi-bright-magenta)',\n 'bg-(--terminal-ansi-bright-cyan)',\n 'bg-(--terminal-ansi-bright-white)',\n] as const\n\nfunction segmentClass(style: AnsiStyle): string {\n const { fg, bg } = resolveColors(style)\n return cn(\n {\n 'font-bold': style.bold,\n 'opacity-70': style.dim,\n italic: style.italic,\n underline: style.underline && !style.strike,\n 'line-through': style.strike && !style.underline,\n '[text-decoration-line:underline_line-through]': style.underline && style.strike,\n 'text-(color:--terminal-background)': fg === 'default-bg',\n 'bg-(--terminal-foreground)': bg === 'default-fg',\n },\n typeof fg === 'number' && FG_CLASS[fg],\n typeof bg === 'number' && BG_CLASS[bg]\n )\n}\n\nfunction LineView(props: { line: AnsiLine; wrap: boolean }) {\n return (\n // `min-h-lh` keeps an empty line one line tall; a block with no text would\n // collapse and the transcript would lose its blank lines.\n <div\n class={cn('min-h-lh', {\n 'whitespace-pre-wrap [overflow-wrap:anywhere]': props.wrap,\n 'w-max min-w-full': !props.wrap,\n })}\n >\n <For each={props.line.segments}>\n {(segment) =>\n isPlainStyle(segment.style) ? (\n segment.text\n ) : (\n <span class={segmentClass(segment.style)}>{segment.text}</span>\n )\n }\n </For>\n <Show when={props.line.truncated > 0}>\n <span class=\"opacity-70 select-none\">\n {' '}\n … {props.line.truncated.toLocaleString()} more characters not shown\n </span>\n </Show>\n </div>\n )\n}\n\nfunction sameAnsiLine(left: AnsiLine, right: AnsiLine): boolean {\n return (\n left.truncated === right.truncated &&\n left.segments.length === right.segments.length &&\n left.segments.every(\n (segment, index) =>\n segment.text === right.segments[index]?.text &&\n segment.style === right.segments[index]?.style\n )\n )\n}\n\nfunction StatusReadout(props: { status: TerminalStatus }) {\n return (\n // A live region, so a command that finishes while the reader is elsewhere is\n // announced once, in words.\n <span\n role=\"status\"\n data-slot=\"terminal-status\"\n data-state={props.status.state}\n class={cn('flex shrink-0 items-center gap-1 text-xs', {\n 'text-destructive': isFailedExit(props.status),\n 'text-info': props.status.state === 'running',\n 'text-muted-foreground': props.status.state !== 'running' && !isFailedExit(props.status),\n })}\n >\n {/* A zero exit gets no glyph: a tick would be this component deciding the\n command succeeded, and some tools exit non-zero on purpose or zero on\n failure. The words carry the fact; only a non-zero code is toned. */}\n <Show when={props.status.state !== 'exited' || isFailedExit(props.status)}>\n <span aria-hidden=\"true\" class=\"grid size-3.5 place-items-center [&_svg]:size-3.5\">\n <Show\n when={props.status.state === 'running'}\n fallback={\n <Show when={props.status.state === 'cancelled'} fallback={<CircleAlert />}>\n <CircleSlash />\n </Show>\n }\n >\n <LoaderCircle class=\"motion-safe:animate-spin\" />\n </Show>\n </span>\n </Show>\n {terminalStatusLabel(props.status)}\n </span>\n )\n}\n\nexport function Terminal(props: TerminalProps) {\n const [local, rest] = splitProps(props, [\n 'output',\n 'command',\n 'status',\n 'maxLines',\n 'retainLines',\n 'maxHeight',\n 'wrap',\n 'size',\n 'onClear',\n 'copyLabel',\n 'copiedLabel',\n 'clearLabel',\n 'onCopy',\n 'class',\n ])\n\n const small = () => local.size === 'sm'\n const pageSize = () => Math.max(1, Math.floor(local.maxLines ?? TERMINAL_MAX_LINES))\n const maxHeight = () =>\n typeof local.maxHeight === 'number' ? `${local.maxHeight}px` : (local.maxHeight ?? '20rem')\n\n // The parser outlives renders: it holds the half-read escape sequence, the\n // current style and the open line. A new `output` that extends the old one is\n // fed only its tail; anything else (a clear, a different command) starts over.\n const newParser = () => createAnsiParser({ retainLines: local.retainLines })\n let parser = newParser()\n let consumed = ''\n // Bumped when the output restarts, so a parked position from the old output\n // is never applied to the new one.\n let epoch = 0\n const revision = createMemo(\n () => {\n const next = local.output\n if (next.length >= consumed.length && next.startsWith(consumed)) {\n parser.write(next.slice(consumed.length))\n } else {\n parser = newParser()\n parser.write(next)\n epoch += 1\n }\n consumed = next\n return epoch\n },\n undefined,\n { equals: false }\n )\n\n const [limit, setLimit] = createSignal(pageSize())\n createEffect(on(pageSize, (size) => setLimit(size), { defer: true }))\n // A cleared terminal is a fresh one: the next command starts at the page size.\n createEffect(\n on(\n () => local.output === '',\n (empty) => {\n if (empty) setLimit(pageSize())\n },\n { defer: true }\n )\n )\n\n // The retained buffer can hold hundreds of thousands of lines, and only a window\n // of them is drawn, so rows are read by position instead of copying the buffer\n // on every streamed chunk. The open line, when there is one, is the last row.\n const outputRows = {\n get length() {\n return outputRowCount()\n },\n at(index: number): AnsiLine | undefined {\n revision()\n return index === parser.lines.length ? parser.openLine() : parser.lines[index]\n },\n slice(start: number, end: number): AnsiLine[] {\n revision()\n const rows = parser.lines.slice(start, Math.min(end, parser.lines.length))\n const open = parser.openLine()\n if (open && end > parser.lines.length && start <= parser.lines.length) rows.push(open)\n return rows\n },\n }\n const outputRowCount = createMemo(() => {\n revision()\n return parser.lines.length + (parser.openLine() ? 1 : 0)\n })\n // Where the reader parked, as a count of lines since the output began. An open\n // line is a row too: freeze its snapshot so streamed characters and CR redraws\n // do not rewrite the text under a parked reader.\n const [parked, setParked] = createSignal<{ epoch: number; end: number; open?: AnsiLine }>()\n const total = () => parser.droppedLines + outputRows.length\n const anchorEnd = () => {\n const current = revision()\n const position = parked()\n return position && position.epoch === current ? position.end : undefined\n }\n const lineWindow = createMemo(() => {\n revision()\n return terminalWindow(outputRows.length, parser.droppedLines, limit(), anchorEnd())\n })\n // Finished rows keep their parser identity. If an open row existed when the\n // reader parked, substitute its immutable snapshot until they jump to latest.\n const visibleRows = createMemo(\n () => {\n revision()\n const start = lineWindow().start\n const end = lineWindow().end\n const rows = outputRows.slice(start, end)\n const position = parked()\n if (position?.epoch === revision() && position.open) {\n const retainedIndex = position.end - 1 - parser.droppedLines\n if (retainedIndex >= start && retainedIndex < end) {\n rows[retainedIndex - start] = position.open\n }\n }\n return rows\n },\n [],\n { equals: false }\n )\n const changedParkedLine = () => {\n const position = parked()\n if (position?.epoch !== revision() || !position.open) return false\n const retainedIndex = position.end - 1 - parser.droppedLines\n const current = outputRows.at(retainedIndex)\n return current !== undefined && !sameAnsiLine(position.open, current)\n }\n const newerRows = () => lineWindow().later + (changedParkedLine() ? 1 : 0)\n\n let scroller: HTMLDivElement | undefined\n const following = () => anchorEnd() === undefined\n\n const onScroll = () => {\n if (!scroller) return\n const atEnd = isAtBottom(scroller.scrollHeight, scroller.scrollTop, scroller.clientHeight)\n const position = anchorEnd()\n if (!atEnd) {\n if (position === undefined) {\n const currentEpoch = revision()\n setParked({ epoch: currentEpoch, end: total(), open: parser.openLine() })\n }\n } else if (position !== undefined && position >= total() && !changedParkedLine()) {\n // Back at the end of a view with nothing newer: nothing was missed.\n setParked(undefined)\n }\n }\n createEffect(\n on(revision, () => {\n if (scroller && following()) scroller.scrollTop = scroller.scrollHeight\n })\n )\n const jumpToLatest = () => {\n if (!scroller) return\n setParked(undefined)\n scroller.scrollTop = scroller.scrollHeight\n // The button is about to disappear; leave focus somewhere real.\n scroller.focus()\n }\n\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const copy = async () => {\n const ok = await copyText(ansiPlainText(local.output))\n local.onCopy?.(ok)\n }\n\n const empty = () => local.output === ''\n const regionLabel = () =>\n local.command ? `Output of ${local.command.slice(0, 120)}` : 'Terminal output'\n\n return (\n <div\n data-slot=\"terminal\"\n data-size={local.size ?? 'default'}\n aria-busy={local.status?.state === 'running' || undefined}\n class={cn(\n 'group/terminal overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n >\n <div class={cn('flex items-center gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}>\n <Show\n when={local.command !== undefined}\n fallback={<span class=\"flex-1 text-xs text-muted-foreground\">Terminal</span>}\n >\n <span class=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"shrink-0 font-code text-code text-muted-foreground select-none\"\n >\n $\n </span>\n <code\n title={local.command}\n class=\"line-clamp-2 min-w-0 font-code text-code text-foreground [overflow-wrap:anywhere]\"\n >\n {local.command}\n </code>\n </span>\n </Show>\n <Show when={local.status}>{(status) => <StatusReadout status={status()} />}</Show>\n {/* Hidden until the terminal is hovered or holds focus, never removed:\n a control that only exists under the pointer is unreachable by\n keyboard, and a touch screen has no hover, so it always shows there. */}\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/terminal:opacity-100 group-hover/terminal:opacity-100 [@media(hover:none)]:opacity-100\">\n <Show when={local.onClear !== undefined && !empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={local.clearLabel ?? 'Clear output'}\n onClick={() => local.onClear?.()}\n >\n <Eraser aria-hidden=\"true\" />\n </Button>\n </Show>\n <Show when={!empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy output')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </Show>\n </div>\n </div>\n\n <Show when={lineWindow().hidden > 0 || lineWindow().evicted > 0}>\n <div\n data-slot=\"terminal-hidden-note\"\n class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\"\n >\n <span>\n <Show when={lineWindow().hidden > 0}>\n {lineWindow().hidden.toLocaleString()} earlier{' '}\n {lineWindow().hidden === 1 ? 'line' : 'lines'} hidden\n <Show when={parser.droppedLines > 0}>\n {' '}\n ({parser.droppedLines.toLocaleString()} only in the copy)\n </Show>\n .\n </Show>\n <Show when={lineWindow().evicted > 0}>\n {' '}\n {lineWindow().lost\n ? `Older lines dropped. Showing the oldest ${lineWindow().end.toLocaleString()} kept.`\n : `${lineWindow().evicted.toLocaleString()} older lines dropped.`}\n </Show>\n </span>\n <Show when={lineWindow().revealable > 0}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => setLimit(revealEarlier(limit(), pageSize(), outputRows.length))}\n >\n Show {Math.min(pageSize(), lineWindow().revealable).toLocaleString()} earlier\n </Button>\n </Show>\n </div>\n </Show>\n\n <div class=\"relative\">\n <div\n ref={(element) => (scroller = element)}\n data-slot=\"terminal-body\"\n // A region that scrolls must be focusable, and a tab stop needs a name.\n role=\"region\"\n tabindex=\"0\"\n aria-label={regionLabel()}\n onScroll={onScroll}\n style={{ 'max-height': maxHeight() }}\n class=\"scroll-fade overflow-auto border-t border-border bg-(--terminal-background) text-(color:--terminal-foreground)\"\n >\n <Show\n when={!empty()}\n fallback={\n <p class={cn('m-0 opacity-70', small() ? 'px-2 py-1.5' : 'px-3 py-2')}>\n <span class=\"font-code text-code\">\n {local.status?.state === 'running' ? 'Waiting for output…' : 'No output'}\n </span>\n </p>\n }\n >\n <pre\n class={cn(\n 'm-0 font-code text-code leading-normal',\n small() ? 'px-2 py-1.5' : 'px-3 py-2'\n )}\n >\n <For each={visibleRows()}>\n {(line) => <LineView line={line} wrap={local.wrap === true} />}\n </For>\n </pre>\n </Show>\n </div>\n <Show when={newerRows() > 0}>\n <Button\n variant=\"secondary\"\n size=\"2xs\"\n class=\"absolute end-3 bottom-2 shadow-sm\"\n onClick={jumpToLatest}\n >\n <ArrowDown aria-hidden=\"true\" />\n Jump to latest\n <span class=\"text-muted-foreground tabular-nums\">\n ({newerRows().toLocaleString()} newer {newerRows() === 1 ? 'line' : 'lines'})\n </span>\n </Button>\n </Show>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA2HA,IAAawC,qBAAqB;AAIlC,IAAMC,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAA2C;AAE7C,IAAMC,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAAmC;AAGrC,SAASC,aAAaC,OAA0B;CAC9C,MAAM,EAAEC,IAAIC,OAAO3B,cAAcyB,KAAK;CACtC,OAAO7B,GACL;EACE,aAAa6B,MAAMG;EACnB,cAAcH,MAAMI;EACpBC,QAAQL,MAAMK;EACdC,WAAWN,MAAMM,aAAa,CAACN,MAAMO;EACrC,gBAAgBP,MAAMO,UAAU,CAACP,MAAMM;EACvC,iDAAiDN,MAAMM,aAAaN,MAAMO;EAC1E,sCAAsCN,OAAO;EAC7C,8BAA8BC,OAAO;CACvC,GACA,OAAOD,OAAO,YAAYJ,SAASI,KACnC,OAAOC,OAAO,YAAYJ,SAASI,GACrC;AACF;AAEA,SAASM,SAASC,OAA0C;CAC1D,cAEE;EAAA,IAAAE,OAAAC,QAAA;EAAAC,OAAAF,MAAAG,gBAOGhD,KAAG;GAAA,IAACiD,OAAI;IAAA,OAAEN,MAAMC,KAAKM;GAAQ;GAAAC,WAC1BC,YACA5C,aA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;KAAY,IAAAzF,WAAA;MAAA,OAAA;OAAAH,gBAEpB1D,WAAS,EAAA,eAAA,OAAA,CAAA;OAAA;cAAA;QAAA,IAAA8L,SAAAC,QAAA,GAAAC,SAAAF,OAAAtH,WAAAE,aAAAuH,SAAAD,OAAAtH,YAAAA;QAAAuH,OAAAvH;QAAAjB,OAAAqI,cAGNlD,UAAU,CAAC,CAACjE,eAAe,GAACqH,MAAA;QAAAvI,OAAAqI,cAASlD,UAAU,MAAM,IAAI,SAAS,SAAOqD,MAAA;QAAA,OAAAH;OAAA,EAAA,CAAA;MAAA;KAAA;IAAA,CAAA;GAAA;EAAA,CAAA,GAAA,IAAA;EAAA5H,QAAAuB,QAAA;GAAA,IAAAyG,OAnIvEnL,GAAG,2BAA2BoF,MAAM,IAAI,gBAAgB,WAAW,GAACgG,OA8FhEtC,YAAY,GAACuC,OAEFrK,UAAU;GAACmK,SAAAzG,IAAAG,KAAAzB,UAAA6F,OAAAvE,IAAAG,IAAAsG,IAAA;GAAAC,SAAA1G,IAAAK,KAAAD,aAAAsE,QAAA,cAAA1E,IAAAK,IAAAqG,IAAA;GAAAC,SAAA3G,IAAA4G,KAAAC,iBAAAnC,QAAA,cAAA1E,IAAA4G,IAAAD,IAAA;GAAA,OAAA3G;EAAA,GAAA;GAAAG,GAAAG,KAAAA;GAAAD,GAAAC,KAAAA;GAAAsG,GAAAtG,KAAAA;EAAA,CAAA;EAAA,OAAA+D;CAAA,EAAA,CAAA;AA0C5C"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* with the counts the host reported, and how a duration is said.
|
|
4
4
|
*
|
|
5
5
|
* The one rule that shapes everything here is that a count is a claim. There are
|
|
6
|
-
* two honest sources for one
|
|
7
|
-
* chose to list
|
|
6
|
+
* two honest sources for one, the host's own tally (`summary`), and the tests it
|
|
7
|
+
* chose to list, and they are allowed to disagree: a host may list only the
|
|
8
8
|
* failures, a runner may count tests it did not stream, a suite may have been cut
|
|
9
9
|
* short. So nothing is silently recomputed. A supplied count is shown as given; if
|
|
10
10
|
* the tests listed do not add up to it, the listed number is shown beside it; and
|
|
@@ -84,7 +84,7 @@ export type RunCounts = Readonly<{
|
|
|
84
84
|
*
|
|
85
85
|
* With a summary: exactly the counts it supplied, as given. `differs` is set
|
|
86
86
|
* when tests are listed at all and the listed number for that outcome is not the
|
|
87
|
-
* supplied one
|
|
87
|
+
* supplied one, a host that lists only failures will see "40 passed (0 listed)",
|
|
88
88
|
* which is true and tells the reader the list is partial. Without a summary: the
|
|
89
89
|
* outcomes that occur among the listed tests, with `basis: 'listed'`.
|
|
90
90
|
*/
|
|
@@ -102,7 +102,7 @@ export type SuiteState = 'failed' | 'passed' | 'running' | undefined;
|
|
|
102
102
|
* What a suite can say about itself from the tests listed in it. Any listed
|
|
103
103
|
* failure makes it `failed`; a listed test still running makes it `running`;
|
|
104
104
|
* `passed` needs at least one passed test and every listed test to be passed or
|
|
105
|
-
* skipped. Anything else
|
|
105
|
+
* skipped. Anything else, no tests, a test with no status, is silence.
|
|
106
106
|
*/
|
|
107
107
|
export declare function suiteState(counts: ListedCounts): SuiteState;
|
|
108
108
|
/** A suite's key among its siblings: its id if it has one, otherwise its position. */
|
|
@@ -43,7 +43,7 @@ var OUTCOMES = [
|
|
|
43
43
|
*
|
|
44
44
|
* With a summary: exactly the counts it supplied, as given. `differs` is set
|
|
45
45
|
* when tests are listed at all and the listed number for that outcome is not the
|
|
46
|
-
* supplied one
|
|
46
|
+
* supplied one, a host that lists only failures will see "40 passed (0 listed)",
|
|
47
47
|
* which is true and tells the reader the list is partial. Without a summary: the
|
|
48
48
|
* outcomes that occur among the listed tests, with `basis: 'listed'`.
|
|
49
49
|
*/
|
|
@@ -115,7 +115,7 @@ function formatDuration(ms, style = "short") {
|
|
|
115
115
|
* What a suite can say about itself from the tests listed in it. Any listed
|
|
116
116
|
* failure makes it `failed`; a listed test still running makes it `running`;
|
|
117
117
|
* `passed` needs at least one passed test and every listed test to be passed or
|
|
118
|
-
* skipped. Anything else
|
|
118
|
+
* skipped. Anything else, no tests, a test with no status, is silence.
|
|
119
119
|
*/
|
|
120
120
|
function suiteState(counts) {
|
|
121
121
|
if (counts.failed > 0) return "failed";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-results-model.js","names":[],"sources":["../../../../src/components/composites/test-results/test-results-model.ts"],"sourcesContent":["/**\n * The test run's pure rules: what the listed tests add up to, how that compares\n * with the counts the host reported, and how a duration is said.\n *\n * The one rule that shapes everything here is that a count is a claim. There are\n * two honest sources for one — the host's own tally (`summary`), and the tests it\n * chose to list — and they are allowed to disagree: a host may list only the\n * failures, a runner may count tests it did not stream, a suite may have been cut\n * short. So nothing is silently recomputed. A supplied count is shown as given; if\n * the tests listed do not add up to it, the listed number is shown beside it; and\n * when no summary was supplied, the counts that are shown are labelled as coming\n * from the tests listed, not presented as the run's totals.\n */\n\nexport type TestOutcome = 'passed' | 'failed' | 'skipped'\n/** `running` and `pending` are states of a test that has no outcome yet; they are not counted. */\nexport type TestCaseStatus = TestOutcome | 'running' | 'pending'\n\nexport type TestCase = Readonly<{\n /** Stable identity for keyed rendering. Defaults to the position. */\n id?: string\n name: string\n /** Absent means the host did not say; the test is listed and nothing is claimed. */\n status?: TestCaseStatus\n durationMs?: number\n /** The failure message, as text. */\n message?: string\n /** A stack trace for `StackTrace` to read. */\n stack?: string\n /** A unified diff of expected against actual for `DiffBlock`. */\n diff?: string\n}>\n\nexport type TestSuite = Readonly<{\n id?: string\n name: string\n /** The file the suite lives in, shown as text. */\n file?: string\n durationMs?: number\n tests?: readonly TestCase[]\n suites?: readonly TestSuite[]\n}>\n\n/** The host's own tally. Every field is optional; only supplied ones are shown. */\nexport type TestSummary = Readonly<{\n passed?: number\n failed?: number\n skipped?: number\n total?: number\n durationMs?: number\n}>\n\nexport type ListedCounts = Readonly<{\n passed: number\n failed: number\n skipped: number\n running: number\n pending: number\n /** Tests listed with no status. */\n unknown: number\n /** Every test listed, whatever its status. */\n total: number\n}>\n\nconst empty: ListedCounts = {\n passed: 0,\n failed: 0,\n skipped: 0,\n running: 0,\n pending: 0,\n unknown: 0,\n total: 0,\n}\n\nconst KNOWN_STATUSES: ReadonlySet<string> = new Set([\n 'passed',\n 'failed',\n 'skipped',\n 'running',\n 'pending',\n])\n\n/** Count the tests in a list of suites, at any depth. Iterative: suites come from a host. */\nexport function listedCounts(suites: readonly TestSuite[]): ListedCounts {\n const counts = { ...empty }\n const stack = [...suites]\n while (stack.length > 0) {\n const suite = stack.pop()!\n for (const test of suite.tests ?? []) {\n counts.total += 1\n // A status the host invented is as good as none.\n if (test.status !== undefined && KNOWN_STATUSES.has(test.status)) counts[test.status] += 1\n else counts.unknown += 1\n }\n for (const child of suite.suites ?? []) stack.push(child)\n }\n return counts\n}\n\nexport type CountLine = Readonly<{\n outcome: TestOutcome\n /** The number to show: the host's if it gave one, otherwise the listed one. */\n count: number\n /** How many tests of this outcome are listed. */\n listed: number\n /** The host gave a count and the list does not agree with it. */\n differs: boolean\n}>\n\nexport type RunCounts = Readonly<{\n /** Whose numbers these are. `listed` must be labelled as such. */\n basis: 'reported' | 'listed'\n lines: readonly CountLine[]\n /** The host's total, when supplied. */\n reportedTotal?: number\n /** The reported total, when the host gave one and the list disagrees. */\n totalNote?: Readonly<{ reported: number; listed: number }>\n}>\n\nfunction validCount(value: unknown): value is number {\n return typeof value === 'number' && Number.isInteger(value) && value >= 0\n}\n\nconst OUTCOMES: readonly TestOutcome[] = ['failed', 'passed', 'skipped']\n\n/**\n * Decide which numbers to show.\n *\n * With a summary: exactly the counts it supplied, as given. `differs` is set\n * when tests are listed at all and the listed number for that outcome is not the\n * supplied one — a host that lists only failures will see \"40 passed (0 listed)\",\n * which is true and tells the reader the list is partial. Without a summary: the\n * outcomes that occur among the listed tests, with `basis: 'listed'`.\n */\nexport function reconcileCounts(summary: TestSummary | undefined, listed: ListedCounts): RunCounts {\n const supplied = OUTCOMES.filter((outcome) => validCount(summary?.[outcome]))\n const hasTotal = validCount(summary?.total)\n\n if (summary && (supplied.length > 0 || hasTotal)) {\n const lines: CountLine[] = supplied.map((outcome) => {\n const count = summary[outcome] as number\n return {\n outcome,\n count,\n listed: listed[outcome],\n differs: listed.total > 0 && listed[outcome] !== count,\n }\n })\n const totalNote =\n hasTotal && listed.total > 0 && summary.total !== listed.total\n ? { reported: summary.total as number, listed: listed.total }\n : undefined\n return {\n basis: 'reported',\n lines,\n ...(hasTotal && { reportedTotal: summary.total as number }),\n ...(totalNote && { totalNote }),\n }\n }\n\n const lines: CountLine[] = OUTCOMES.filter((outcome) => listed[outcome] > 0).map((outcome) => ({\n outcome,\n count: listed[outcome],\n listed: listed[outcome],\n differs: false,\n }))\n return { basis: 'listed', lines }\n}\n\n/** The words for one count: \"38 passed\", or \"40 passed (38 listed)\" when the list disagrees. */\nexport function describeCount(line: CountLine): string {\n const base = `${line.count.toLocaleString()} ${line.outcome}`\n return line.differs ? `${base} (${line.listed.toLocaleString()} listed)` : base\n}\n\nconst plural = (n: number, one: string) => (n === 1 ? one : `${one}s`)\n\n/**\n * A duration. `short` is for a meta column (\"120 ms\", \"3.4 s\"); `long` is for a\n * sentence (\"120 milliseconds\", \"3.4 seconds\", \"2 minutes 5 seconds\"). Anything\n * that is not a finite non-negative number has no duration, so none is drawn.\n */\nexport function formatDuration(ms: unknown, style: 'short' | 'long' = 'short'): string | undefined {\n if (typeof ms !== 'number' || !Number.isFinite(ms) || ms < 0) return undefined\n if (ms > 0 && ms < 1) return style === 'short' ? '<1 ms' : 'less than 1 millisecond'\n if (ms < 1000) {\n const whole = Math.round(ms)\n return style === 'short' ? `${whole} ms` : `${whole} ${plural(whole, 'millisecond')}`\n }\n if (ms < 60_000) {\n const seconds = ms < 10_000 ? Math.round(ms / 100) / 10 : Math.round(ms / 1000)\n const text = Number.isInteger(seconds) ? String(seconds) : seconds.toFixed(1)\n return style === 'short' ? `${text} s` : `${text} ${seconds === 1 ? 'second' : 'seconds'}`\n }\n const totalSeconds = Math.round(ms / 1000)\n const minutes = Math.floor(totalSeconds / 60)\n const seconds = totalSeconds % 60\n if (style === 'short') return seconds === 0 ? `${minutes} min` : `${minutes} min ${seconds} s`\n const m = `${minutes.toLocaleString()} ${plural(minutes, 'minute')}`\n return seconds === 0 ? m : `${m} ${seconds} ${plural(seconds, 'second')}`\n}\n\nexport type SuiteState = 'failed' | 'passed' | 'running' | undefined\n\n/**\n * What a suite can say about itself from the tests listed in it. Any listed\n * failure makes it `failed`; a listed test still running makes it `running`;\n * `passed` needs at least one passed test and every listed test to be passed or\n * skipped. Anything else — no tests, a test with no status — is silence.\n */\nexport function suiteState(counts: ListedCounts): SuiteState {\n if (counts.failed > 0) return 'failed'\n if (counts.running > 0) return 'running'\n if (counts.passed > 0 && counts.pending === 0 && counts.unknown === 0) return 'passed'\n return undefined\n}\n\n/** A suite's key among its siblings: its id if it has one, otherwise its position. */\nexport function suiteKey(parent: string, suite: TestSuite, index: number): string {\n return `${parent}/${suite.id ?? `s${index}`}`\n}\n\nexport function testKey(parent: string, test: TestCase, index: number): string {\n return `${parent}:${test.id ?? `t${index}`}`\n}\n\n/** Distinguish repeated ids without tying a row to the object instance it renders. */\nexport function repeatedKey(key: string, occurrence: number): string {\n return JSON.stringify([key, occurrence])\n}\n\n/**\n * A row's identity among its siblings only: the host id verbatim, or its\n * position when it has none. The leading letter keeps the two apart, so an id\n * that looks like a position never collides with one. A row's place in the tree\n * is the list of these keys from the root, never one string that nests its\n * parent's, so a key stays as long as its own id however deep the row sits.\n */\nexport function siblingKey(item: Readonly<{ id?: string }>, index: number): string {\n return item.id === undefined ? `p${index}` : `i${item.id}`\n}\n\nexport type BoundedEntry<T> = Readonly<{\n key: string\n item: T\n index: number\n}>\n\n/** Build keyed rows only for the currently visible prefix of a bounded list. */\nexport function boundedEntries<T>(\n items: readonly T[],\n visibleCount: number,\n itemKey: (item: T, index: number) => string\n): Readonly<{\n entries: readonly BoundedEntry<T>[]\n byKey: ReadonlyMap<string, BoundedEntry<T>>\n}> {\n const entries: BoundedEntry<T>[] = []\n const byKey = new Map<string, BoundedEntry<T>>()\n const occurrences = new Map<string, number>()\n const count = Math.max(0, Math.min(items.length, Math.floor(visibleCount)))\n\n for (let index = 0; index < count; index += 1) {\n const item = items[index]!\n const base = itemKey(item, index)\n const occurrence = occurrences.get(base) ?? 0\n occurrences.set(base, occurrence + 1)\n const entry = { key: repeatedKey(base, occurrence), item, index }\n entries.push(entry)\n byKey.set(entry.key, entry)\n }\n\n return { entries, byKey }\n}\n\n/** The key of the first failing test in reading order. */\nexport function firstFailureKey(suites: readonly TestSuite[]): string | undefined {\n type Frame = { suites: readonly TestSuite[]; parent: string; index: number }\n const stack: Frame[] = [{ suites, parent: '', index: 0 }]\n while (stack.length > 0) {\n const frame = stack[stack.length - 1]!\n const suite = frame.suites[frame.index]\n if (!suite) {\n stack.pop()\n continue\n }\n frame.index += 1\n const key = suiteKey(frame.parent, suite, frame.index - 1)\n for (let i = 0; i < (suite.tests?.length ?? 0); i += 1) {\n if (suite.tests![i]!.status === 'failed') return testKey(key, suite.tests![i]!, i)\n }\n if (suite.suites?.length) stack.push({ suites: suite.suites, parent: key, index: 0 })\n }\n return undefined\n}\n\nexport type FirstFailureRenderPath = Readonly<{\n /**\n * The rendering key of each suite from the root through the suite containing\n * the failure, one entry per level. A key is unique among its siblings, so\n * a suite is on the path when its entry at its own depth is its key and its\n * parent was on the path.\n */\n suites: readonly string[]\n /** The failed test's rendering key among the tests of the last suite on the path. */\n test: string\n}>\n\n/** True when both describe the same failure at the same place in the tree. */\nexport function sameFailure(\n left: FirstFailureRenderPath | undefined,\n right: FirstFailureRenderPath | undefined\n): boolean {\n if (left === right) return true\n if (!left || !right) return false\n if (left.test !== right.test || left.suites.length !== right.suites.length) return false\n for (let index = 0; index < left.suites.length; index += 1)\n if (left.suites[index] !== right.suites[index]) return false\n return true\n}\n\n/**\n * The first failure's unique rendering keys, including its ancestor suites. The\n * work is linear in the suites visited and the path it returns is linear in the\n * depth, so a long chain of nested suites costs no more than a wide list.\n */\nexport function firstFailureRenderPath(\n suites: readonly TestSuite[]\n): FirstFailureRenderPath | undefined {\n type Frame = {\n suites: readonly TestSuite[]\n index: number\n occurrences: Map<string, number>\n /** The rendering key of the suite these are the children of; absent at the root. */\n key?: string\n }\n const stack: Frame[] = [{ suites, index: 0, occurrences: new Map() }]\n while (stack.length > 0) {\n const frame = stack[stack.length - 1]!\n const suite = frame.suites[frame.index]\n if (!suite) {\n stack.pop()\n continue\n }\n frame.index += 1\n const base = siblingKey(suite, frame.index - 1)\n const occurrence = frame.occurrences.get(base) ?? 0\n frame.occurrences.set(base, occurrence + 1)\n const key = repeatedKey(base, occurrence)\n const tests = suite.tests ?? []\n const testOccurrences = new Map<string, number>()\n for (let i = 0; i < tests.length; i += 1) {\n const testBase = siblingKey(tests[i]!, i)\n const testOccurrence = testOccurrences.get(testBase) ?? 0\n testOccurrences.set(testBase, testOccurrence + 1)\n if (tests[i]!.status === 'failed') {\n const path: string[] = []\n for (let depth = 1; depth < stack.length; depth += 1) path.push(stack[depth]!.key!)\n path.push(key)\n return { suites: path, test: repeatedKey(testBase, testOccurrence) }\n }\n }\n if (suite.suites?.length) {\n stack.push({ suites: suite.suites, index: 0, occurrences: new Map(), key })\n }\n }\n return undefined\n}\n"],"mappings":";AAgEA,IAAM,QAAsB;CAC1B,QAAQ;CACR,QAAQ;CACR,SAAS;CACT,SAAS;CACT,SAAS;CACT,SAAS;CACT,OAAO;AACT;AAEA,IAAM,iCAAsC,IAAI,IAAI;CAClD;CACA;CACA;CACA;CACA;AACF,CAAC;;AAGD,SAAgB,aAAa,QAA4C;CACvE,MAAM,SAAS,EAAE,GAAG,MAAM;CAC1B,MAAM,QAAQ,CAAC,GAAG,MAAM;CACxB,OAAO,MAAM,SAAS,GAAG;EACvB,MAAM,QAAQ,MAAM,IAAI;EACxB,KAAK,MAAM,QAAQ,MAAM,SAAS,CAAC,GAAG;GACpC,OAAO,SAAS;GAEhB,IAAI,KAAK,WAAW,KAAA,KAAa,eAAe,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AAM,QAAQ,KAAK,GAAG;GACxC,MAAM,WAAW,WAAW,MAAM,IAAK,CAAC;GACxC,MAAM,iBAAiB,gBAAgB,IAAI,QAAQ,KAAK;GACxD,gBAAgB,IAAI,UAAU,iBAAiB,CAAC;GAChD,IAAI,MAAM,EAAE,CAAE,WAAW,UAAU;IACjC,MAAM,OAAiB,CAAC;IACxB,KAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GAAG,KAAK,KAAK,MAAM,MAAM,CAAE,GAAI;IAClF,KAAK,KAAK,GAAG;IACb,OAAO;KAAE,QAAQ;KAAM,MAAM,YAAY,UAAU,cAAc;IAAE;GACrE;EACF;EACA,IAAI,MAAM,QAAQ,QAChB,MAAM,KAAK;GAAE,QAAQ,MAAM;GAAQ,OAAO;GAAG,6BAAa,IAAI,IAAI;GAAG;EAAI,CAAC;CAE9E;AAEF"}
|
|
1
|
+
{"version":3,"file":"test-results-model.js","names":[],"sources":["../../../../src/components/composites/test-results/test-results-model.ts"],"sourcesContent":["/**\n * The test run's pure rules: what the listed tests add up to, how that compares\n * with the counts the host reported, and how a duration is said.\n *\n * The one rule that shapes everything here is that a count is a claim. There are\n * two honest sources for one, the host's own tally (`summary`), and the tests it\n * chose to list, and they are allowed to disagree: a host may list only the\n * failures, a runner may count tests it did not stream, a suite may have been cut\n * short. So nothing is silently recomputed. A supplied count is shown as given; if\n * the tests listed do not add up to it, the listed number is shown beside it; and\n * when no summary was supplied, the counts that are shown are labelled as coming\n * from the tests listed, not presented as the run's totals.\n */\n\nexport type TestOutcome = 'passed' | 'failed' | 'skipped'\n/** `running` and `pending` are states of a test that has no outcome yet; they are not counted. */\nexport type TestCaseStatus = TestOutcome | 'running' | 'pending'\n\nexport type TestCase = Readonly<{\n /** Stable identity for keyed rendering. Defaults to the position. */\n id?: string\n name: string\n /** Absent means the host did not say; the test is listed and nothing is claimed. */\n status?: TestCaseStatus\n durationMs?: number\n /** The failure message, as text. */\n message?: string\n /** A stack trace for `StackTrace` to read. */\n stack?: string\n /** A unified diff of expected against actual for `DiffBlock`. */\n diff?: string\n}>\n\nexport type TestSuite = Readonly<{\n id?: string\n name: string\n /** The file the suite lives in, shown as text. */\n file?: string\n durationMs?: number\n tests?: readonly TestCase[]\n suites?: readonly TestSuite[]\n}>\n\n/** The host's own tally. Every field is optional; only supplied ones are shown. */\nexport type TestSummary = Readonly<{\n passed?: number\n failed?: number\n skipped?: number\n total?: number\n durationMs?: number\n}>\n\nexport type ListedCounts = Readonly<{\n passed: number\n failed: number\n skipped: number\n running: number\n pending: number\n /** Tests listed with no status. */\n unknown: number\n /** Every test listed, whatever its status. */\n total: number\n}>\n\nconst empty: ListedCounts = {\n passed: 0,\n failed: 0,\n skipped: 0,\n running: 0,\n pending: 0,\n unknown: 0,\n total: 0,\n}\n\nconst KNOWN_STATUSES: ReadonlySet<string> = new Set([\n 'passed',\n 'failed',\n 'skipped',\n 'running',\n 'pending',\n])\n\n/** Count the tests in a list of suites, at any depth. Iterative: suites come from a host. */\nexport function listedCounts(suites: readonly TestSuite[]): ListedCounts {\n const counts = { ...empty }\n const stack = [...suites]\n while (stack.length > 0) {\n const suite = stack.pop()!\n for (const test of suite.tests ?? []) {\n counts.total += 1\n // A status the host invented is as good as none.\n if (test.status !== undefined && KNOWN_STATUSES.has(test.status)) counts[test.status] += 1\n else counts.unknown += 1\n }\n for (const child of suite.suites ?? []) stack.push(child)\n }\n return counts\n}\n\nexport type CountLine = Readonly<{\n outcome: TestOutcome\n /** The number to show: the host's if it gave one, otherwise the listed one. */\n count: number\n /** How many tests of this outcome are listed. */\n listed: number\n /** The host gave a count and the list does not agree with it. */\n differs: boolean\n}>\n\nexport type RunCounts = Readonly<{\n /** Whose numbers these are. `listed` must be labelled as such. */\n basis: 'reported' | 'listed'\n lines: readonly CountLine[]\n /** The host's total, when supplied. */\n reportedTotal?: number\n /** The reported total, when the host gave one and the list disagrees. */\n totalNote?: Readonly<{ reported: number; listed: number }>\n}>\n\nfunction validCount(value: unknown): value is number {\n return typeof value === 'number' && Number.isInteger(value) && value >= 0\n}\n\nconst OUTCOMES: readonly TestOutcome[] = ['failed', 'passed', 'skipped']\n\n/**\n * Decide which numbers to show.\n *\n * With a summary: exactly the counts it supplied, as given. `differs` is set\n * when tests are listed at all and the listed number for that outcome is not the\n * supplied one, a host that lists only failures will see \"40 passed (0 listed)\",\n * which is true and tells the reader the list is partial. Without a summary: the\n * outcomes that occur among the listed tests, with `basis: 'listed'`.\n */\nexport function reconcileCounts(summary: TestSummary | undefined, listed: ListedCounts): RunCounts {\n const supplied = OUTCOMES.filter((outcome) => validCount(summary?.[outcome]))\n const hasTotal = validCount(summary?.total)\n\n if (summary && (supplied.length > 0 || hasTotal)) {\n const lines: CountLine[] = supplied.map((outcome) => {\n const count = summary[outcome] as number\n return {\n outcome,\n count,\n listed: listed[outcome],\n differs: listed.total > 0 && listed[outcome] !== count,\n }\n })\n const totalNote =\n hasTotal && listed.total > 0 && summary.total !== listed.total\n ? { reported: summary.total as number, listed: listed.total }\n : undefined\n return {\n basis: 'reported',\n lines,\n ...(hasTotal && { reportedTotal: summary.total as number }),\n ...(totalNote && { totalNote }),\n }\n }\n\n const lines: CountLine[] = OUTCOMES.filter((outcome) => listed[outcome] > 0).map((outcome) => ({\n outcome,\n count: listed[outcome],\n listed: listed[outcome],\n differs: false,\n }))\n return { basis: 'listed', lines }\n}\n\n/** The words for one count: \"38 passed\", or \"40 passed (38 listed)\" when the list disagrees. */\nexport function describeCount(line: CountLine): string {\n const base = `${line.count.toLocaleString()} ${line.outcome}`\n return line.differs ? `${base} (${line.listed.toLocaleString()} listed)` : base\n}\n\nconst plural = (n: number, one: string) => (n === 1 ? one : `${one}s`)\n\n/**\n * A duration. `short` is for a meta column (\"120 ms\", \"3.4 s\"); `long` is for a\n * sentence (\"120 milliseconds\", \"3.4 seconds\", \"2 minutes 5 seconds\"). Anything\n * that is not a finite non-negative number has no duration, so none is drawn.\n */\nexport function formatDuration(ms: unknown, style: 'short' | 'long' = 'short'): string | undefined {\n if (typeof ms !== 'number' || !Number.isFinite(ms) || ms < 0) return undefined\n if (ms > 0 && ms < 1) return style === 'short' ? '<1 ms' : 'less than 1 millisecond'\n if (ms < 1000) {\n const whole = Math.round(ms)\n return style === 'short' ? `${whole} ms` : `${whole} ${plural(whole, 'millisecond')}`\n }\n if (ms < 60_000) {\n const seconds = ms < 10_000 ? Math.round(ms / 100) / 10 : Math.round(ms / 1000)\n const text = Number.isInteger(seconds) ? String(seconds) : seconds.toFixed(1)\n return style === 'short' ? `${text} s` : `${text} ${seconds === 1 ? 'second' : 'seconds'}`\n }\n const totalSeconds = Math.round(ms / 1000)\n const minutes = Math.floor(totalSeconds / 60)\n const seconds = totalSeconds % 60\n if (style === 'short') return seconds === 0 ? `${minutes} min` : `${minutes} min ${seconds} s`\n const m = `${minutes.toLocaleString()} ${plural(minutes, 'minute')}`\n return seconds === 0 ? m : `${m} ${seconds} ${plural(seconds, 'second')}`\n}\n\nexport type SuiteState = 'failed' | 'passed' | 'running' | undefined\n\n/**\n * What a suite can say about itself from the tests listed in it. Any listed\n * failure makes it `failed`; a listed test still running makes it `running`;\n * `passed` needs at least one passed test and every listed test to be passed or\n * skipped. Anything else, no tests, a test with no status, is silence.\n */\nexport function suiteState(counts: ListedCounts): SuiteState {\n if (counts.failed > 0) return 'failed'\n if (counts.running > 0) return 'running'\n if (counts.passed > 0 && counts.pending === 0 && counts.unknown === 0) return 'passed'\n return undefined\n}\n\n/** A suite's key among its siblings: its id if it has one, otherwise its position. */\nexport function suiteKey(parent: string, suite: TestSuite, index: number): string {\n return `${parent}/${suite.id ?? `s${index}`}`\n}\n\nexport function testKey(parent: string, test: TestCase, index: number): string {\n return `${parent}:${test.id ?? `t${index}`}`\n}\n\n/** Distinguish repeated ids without tying a row to the object instance it renders. */\nexport function repeatedKey(key: string, occurrence: number): string {\n return JSON.stringify([key, occurrence])\n}\n\n/**\n * A row's identity among its siblings only: the host id verbatim, or its\n * position when it has none. The leading letter keeps the two apart, so an id\n * that looks like a position never collides with one. A row's place in the tree\n * is the list of these keys from the root, never one string that nests its\n * parent's, so a key stays as long as its own id however deep the row sits.\n */\nexport function siblingKey(item: Readonly<{ id?: string }>, index: number): string {\n return item.id === undefined ? `p${index}` : `i${item.id}`\n}\n\nexport type BoundedEntry<T> = Readonly<{\n key: string\n item: T\n index: number\n}>\n\n/** Build keyed rows only for the currently visible prefix of a bounded list. */\nexport function boundedEntries<T>(\n items: readonly T[],\n visibleCount: number,\n itemKey: (item: T, index: number) => string\n): Readonly<{\n entries: readonly BoundedEntry<T>[]\n byKey: ReadonlyMap<string, BoundedEntry<T>>\n}> {\n const entries: BoundedEntry<T>[] = []\n const byKey = new Map<string, BoundedEntry<T>>()\n const occurrences = new Map<string, number>()\n const count = Math.max(0, Math.min(items.length, Math.floor(visibleCount)))\n\n for (let index = 0; index < count; index += 1) {\n const item = items[index]!\n const base = itemKey(item, index)\n const occurrence = occurrences.get(base) ?? 0\n occurrences.set(base, occurrence + 1)\n const entry = { key: repeatedKey(base, occurrence), item, index }\n entries.push(entry)\n byKey.set(entry.key, entry)\n }\n\n return { entries, byKey }\n}\n\n/** The key of the first failing test in reading order. */\nexport function firstFailureKey(suites: readonly TestSuite[]): string | undefined {\n type Frame = { suites: readonly TestSuite[]; parent: string; index: number }\n const stack: Frame[] = [{ suites, parent: '', index: 0 }]\n while (stack.length > 0) {\n const frame = stack[stack.length - 1]!\n const suite = frame.suites[frame.index]\n if (!suite) {\n stack.pop()\n continue\n }\n frame.index += 1\n const key = suiteKey(frame.parent, suite, frame.index - 1)\n for (let i = 0; i < (suite.tests?.length ?? 0); i += 1) {\n if (suite.tests![i]!.status === 'failed') return testKey(key, suite.tests![i]!, i)\n }\n if (suite.suites?.length) stack.push({ suites: suite.suites, parent: key, index: 0 })\n }\n return undefined\n}\n\nexport type FirstFailureRenderPath = Readonly<{\n /**\n * The rendering key of each suite from the root through the suite containing\n * the failure, one entry per level. A key is unique among its siblings, so\n * a suite is on the path when its entry at its own depth is its key and its\n * parent was on the path.\n */\n suites: readonly string[]\n /** The failed test's rendering key among the tests of the last suite on the path. */\n test: string\n}>\n\n/** True when both describe the same failure at the same place in the tree. */\nexport function sameFailure(\n left: FirstFailureRenderPath | undefined,\n right: FirstFailureRenderPath | undefined\n): boolean {\n if (left === right) return true\n if (!left || !right) return false\n if (left.test !== right.test || left.suites.length !== right.suites.length) return false\n for (let index = 0; index < left.suites.length; index += 1)\n if (left.suites[index] !== right.suites[index]) return false\n return true\n}\n\n/**\n * The first failure's unique rendering keys, including its ancestor suites. The\n * work is linear in the suites visited and the path it returns is linear in the\n * depth, so a long chain of nested suites costs no more than a wide list.\n */\nexport function firstFailureRenderPath(\n suites: readonly TestSuite[]\n): FirstFailureRenderPath | undefined {\n type Frame = {\n suites: readonly TestSuite[]\n index: number\n occurrences: Map<string, number>\n /** The rendering key of the suite these are the children of; absent at the root. */\n key?: string\n }\n const stack: Frame[] = [{ suites, index: 0, occurrences: new Map() }]\n while (stack.length > 0) {\n const frame = stack[stack.length - 1]!\n const suite = frame.suites[frame.index]\n if (!suite) {\n stack.pop()\n continue\n }\n frame.index += 1\n const base = siblingKey(suite, frame.index - 1)\n const occurrence = frame.occurrences.get(base) ?? 0\n frame.occurrences.set(base, occurrence + 1)\n const key = repeatedKey(base, occurrence)\n const tests = suite.tests ?? []\n const testOccurrences = new Map<string, number>()\n for (let i = 0; i < tests.length; i += 1) {\n const testBase = siblingKey(tests[i]!, i)\n const testOccurrence = testOccurrences.get(testBase) ?? 0\n testOccurrences.set(testBase, testOccurrence + 1)\n if (tests[i]!.status === 'failed') {\n const path: string[] = []\n for (let depth = 1; depth < stack.length; depth += 1) path.push(stack[depth]!.key!)\n path.push(key)\n return { suites: path, test: repeatedKey(testBase, testOccurrence) }\n }\n }\n if (suite.suites?.length) {\n stack.push({ suites: suite.suites, index: 0, occurrences: new Map(), key })\n }\n }\n return undefined\n}\n"],"mappings":";AAgEA,IAAM,QAAsB;CAC1B,QAAQ;CACR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,MAAM,MAAM,SAAS;EACnC,MAAM,QAAQ,MAAM,OAAO,MAAM;EACjC,IAAI,CAAC,OAAO;GACV,MAAM,IAAI;GACV;EACF;EACA,MAAM,SAAS;EACf,MAAM,OAAO,WAAW,OAAO,MAAM,QAAQ,CAAC;EAC9C,MAAM,aAAa,MAAM,YAAY,IAAI,IAAI,KAAK;EAClD,MAAM,YAAY,IAAI,MAAM,aAAa,CAAC;EAC1C,MAAM,MAAM,YAAY,MAAM,UAAU;EACxC,MAAM,QAAQ,MAAM,SAAS,CAAC;EAC9B,MAAM,kCAAkB,IAAI,IAAoB;EAChD,KAAK,IAAI,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK,GAAG;GACxC,MAAM,WAAW,WAAW,MAAM,IAAK,CAAC;GACxC,MAAM,iBAAiB,gBAAgB,IAAI,QAAQ,KAAK;GACxD,gBAAgB,IAAI,UAAU,iBAAiB,CAAC;GAChD,IAAI,MAAM,EAAE,CAAE,WAAW,UAAU;IACjC,MAAM,OAAiB,CAAC;IACxB,KAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,QAAQ,SAAS,GAAG,KAAK,KAAK,MAAM,MAAM,CAAE,GAAI;IAClF,KAAK,KAAK,GAAG;IACb,OAAO;KAAE,QAAQ;KAAM,MAAM,YAAY,UAAU,cAAc;IAAE;GACrE;EACF;EACA,IAAI,MAAM,QAAQ,QAChB,MAAM,KAAK;GAAE,QAAQ,MAAM;GAAQ,OAAO;GAAG,6BAAa,IAAI,IAAI;GAAG;EAAI,CAAC;CAE9E;AAEF"}
|
|
@@ -15,7 +15,7 @@ import { type TestSuite, type TestSummary } from './test-results-model';
|
|
|
15
15
|
* Nothing is computed that the host did not supply data for, and nothing the host
|
|
16
16
|
* supplied is quietly recomputed. `summary` is the host's own tally and is shown
|
|
17
17
|
* as given. If tests are listed and their number for an outcome does not match, the
|
|
18
|
-
* listed number is shown beside it
|
|
18
|
+
* listed number is shown beside it, "40 passed (2 listed)", which is also how a
|
|
19
19
|
* host that lists only its failures reads. Without a `summary` the counts shown are
|
|
20
20
|
* those of the tests listed, and the component says so; it does not present them as
|
|
21
21
|
* the run's totals. A suite is marked failed or passed only from the tests listed in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-results.js","names":["Check","CircleCheck","CircleMinus","CircleX","Copy","FlaskConical","LoaderCircle","createComputed","createMemo","createEffect","createSignal","For","Show","splitProps","createCopyFeedback","cn","Button","DiffBlock","Trace","TraceDetail","TraceLine","StackTrace","boundedEntries","describeCount","firstFailureRenderPath","formatDuration","listedCounts","reconcileCounts","sameFailure","siblingKey","suiteState","suites","summary","running","listLimit","onOpenFrame","label","TEST_RESULTS_LIST_LIMIT","OUTCOME_ICON","failed","_$createComponent","passed","skipped","CountReadout","props","line","_el$","_tmpl$","_$insert","outcome","_$effect","_$setAttribute","SEGMENT_CLASS","SummaryBar","lines","visible","filter","count","when","length","children","_el$2","_tmpl$2","each","_el$3","_tmpl$3","_p$","_v$","_v$2","e","_$className","t","_$setStyleProperty","undefined","TRACE_STATUS","status","pending","keepFocusThroughReorder","keys","noted","HTMLElement","active","document","activeElement","closest","element","isConnected","body","focus","preventScroll","Bounded","items","itemKey","item","index","limit","noun","key","shown","setShown","page","entries","visibleKeys","map","entry","hidden","byKey","get","_el$4","_tmpl$4","variant","size","onClick","_$memo","Math","min","toLocaleString","TEST_RESULTS_MESSAGE_LIMIT","FailureMessage","text","onCopy","ok","all","setAll","copied","copyFailed","copy","copyText","clipped","cut","last","charCodeAt","slice","_el$5","_tmpl$5","_el$6","_tmpl$6","_el$7","firstChild","fallback","title","TestLine","test","keyed","failure","state","hasDetail","Boolean","message","diff","stack","failureKey","equals","open","setOpen","previousFailure","collapsedFailure","currentFailure","handleOpenChange","next","name","statusLabel","meta","durationMs","onOpenChange","patch","complete","SuiteLine","suite","depth","counts","tests","holdsFailure","description","parts","file","join","icon","_el$8","_tmpl$7","_index","nested","TestResults","local","rest","listed","max","floor","duration","nothing","reportedTotal","_el$9","_tmpl$11","_$spread","_$mergeProps","class","_tmpl$12","_el$0","_tmpl$10","_el$1","_el$10","_tmpl$8","_el$11","totalNote","_el$12","_tmpl$9","_el$13","note","_el$18","_tmpl$13","_el$19","_el$21","nextSibling","reported","_el$14","_tmpl$0","basis","_tmpl$1"],"sources":["../../../../src/components/composites/test-results/test-results.tsx"],"sourcesContent":["import {\n Check,\n CircleCheck,\n CircleMinus,\n CircleX,\n Copy,\n FlaskConical,\n LoaderCircle,\n} from 'lucide-solid'\nimport {\n createComputed,\n createMemo,\n createEffect,\n createSignal,\n For,\n Show,\n splitProps,\n type Accessor,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { DiffBlock } from '../../ui/diff-block'\nimport { Trace, TraceDetail, TraceLine, type TraceStatus } from '../../ui/trace'\nimport { StackTrace, type StackTraceProps } from '../stack-trace'\nimport {\n boundedEntries,\n describeCount,\n firstFailureRenderPath,\n formatDuration,\n listedCounts,\n reconcileCounts,\n sameFailure,\n siblingKey,\n suiteState,\n type CountLine,\n type TestCase,\n type TestCaseStatus,\n type TestOutcome,\n type TestSuite,\n type TestSummary,\n type FirstFailureRenderPath,\n} from './test-results-model'\n\n/**\n * TestResults.\n *\n * A test run: how it went in words and in a segmented bar, then the suites it\n * ran as `Trace` lines, each opening onto its tests, and a failing test opening\n * onto its message, diff and stack. It is for a run the host can structure; reach\n * for `Terminal` when all there is to show is the command's output, and for\n * `StackTrace` alone when one call failed outside a test.\n *\n * ## Counts are claims\n *\n * Nothing is computed that the host did not supply data for, and nothing the host\n * supplied is quietly recomputed. `summary` is the host's own tally and is shown\n * as given. If tests are listed and their number for an outcome does not match, the\n * listed number is shown beside it — \"40 passed (2 listed)\" — which is also how a\n * host that lists only its failures reads. Without a `summary` the counts shown are\n * those of the tests listed, and the component says so; it does not present them as\n * the run's totals. A suite is marked failed or passed only from the tests listed in\n * it, and its spoken label says \"listed\" so it claims no more than that.\n *\n * ## Not colour-only\n *\n * The bar is decoration: every segment has a counterpart in the words beside it,\n * each with its own shape (a cross, a tick, a dash). Segments are separated by a\n * gap and never narrower than a visible sliver, so one failure in five thousand\n * tests is still on the bar.\n *\n * ## Bounded\n *\n * Suites and tests are listed `listLimit` at a time with \"show more\", and a suite's\n * tests are not rendered until it is open. The first failure in reading order opens\n * when its row is visible; a failure beyond a \"show more\" boundary stays unmounted\n * until its page is revealed. When a running result first reports a failure, its\n * suite and test open once. Later updates preserve the user's disclosure choices.\n *\n * Failure details are text: the message is a `pre`, the diff goes to `DiffBlock`\n * and the stack to `StackTrace`. If a stack already begins with the message, pass\n * only the stack; nothing here de-duplicates what the host sends.\n */\nexport type TestResultsProps = Omit<ComponentProps<'section'>, 'children'> & {\n suites: readonly TestSuite[]\n /** The host's own counts. Shown as given; see the component comment. */\n summary?: TestSummary\n /** The run is still going. */\n running?: boolean\n /** Suites, or tests within a suite, listed before \"show more\". Default 50. */\n listLimit?: number\n /** Passed to each failure's `StackTrace`. */\n onOpenFrame?: StackTraceProps['onOpenFrame']\n /** The section's accessible name. Default \"Test results\". */\n label?: string\n}\n\nexport const TEST_RESULTS_LIST_LIMIT = 50\n\nconst OUTCOME_ICON: Readonly<Record<TestOutcome, () => JSX.Element>> = {\n failed: () => <CircleX aria-hidden=\"true\" class=\"size-3.5 text-destructive\" />,\n passed: () => <CircleCheck aria-hidden=\"true\" class=\"size-3.5 text-success\" />,\n skipped: () => <CircleMinus aria-hidden=\"true\" class=\"size-3.5 text-muted-foreground\" />,\n}\n\nfunction CountReadout(props: { line: CountLine }) {\n return (\n <span class=\"flex items-center gap-1 whitespace-nowrap\" data-outcome={props.line.outcome}>\n {OUTCOME_ICON[props.line.outcome]()}\n {describeCount(props.line)}\n </span>\n )\n}\n\n// Segments are drawn in this order so the bar reads the same in every run.\nconst SEGMENT_CLASS: Readonly<Record<TestOutcome, string>> = {\n failed: 'bg-destructive',\n passed: 'bg-success',\n skipped: 'bg-muted-foreground/40',\n}\n\nfunction SummaryBar(props: { lines: readonly CountLine[] }) {\n const visible = () => props.lines.filter((line) => line.count > 0)\n return (\n <Show when={visible().length > 0}>\n <div\n aria-hidden=\"true\"\n data-slot=\"test-results-bar\"\n class=\"flex h-1.5 w-full gap-px overflow-hidden rounded-full bg-muted\"\n >\n <For each={visible()}>\n {(line) => (\n <span\n class={cn('min-w-1', SEGMENT_CLASS[line.outcome])}\n style={{ flex: `${line.count} 1 0` }}\n />\n )}\n </For>\n </div>\n </Show>\n )\n}\n\nconst TRACE_STATUS: Readonly<Record<TestCaseStatus, { status: TraceStatus; label: string }>> = {\n passed: { status: 'success', label: 'Passed' },\n failed: { status: 'error', label: 'Failed' },\n skipped: { status: 'cancelled', label: 'Skipped' },\n running: { status: 'running', label: 'Running' },\n pending: { status: 'pending', label: 'Not run yet' },\n}\n\n/**\n * Keep keyboard focus through a reorder. Solid moves a keyed row's node instead\n * of replacing it, and a browser blurs a focused element that is moved, so an\n * immutable reorder would drop the reader's place onto the body even though the\n * node and its open state survive. The focused element is noted just before the\n * rows move and given focus back just after, but only when nothing else has taken\n * focus meanwhile, and only inside a test run, so a reader who has moved on is\n * never pulled back and an unrelated element is never refocused.\n */\nfunction keepFocusThroughReorder(keys: Accessor<readonly string[]>) {\n let noted: HTMLElement | undefined\n createComputed(() => {\n keys()\n const active = typeof document === 'undefined' ? null : document.activeElement\n noted =\n active instanceof HTMLElement && active.closest('[data-slot=\"test-results\"]')\n ? active\n : undefined\n })\n createEffect(() => {\n keys()\n const element = noted\n noted = undefined\n if (!element || !element.isConnected) return\n const active = document.activeElement\n if (active === null || active === document.body) element.focus({ preventScroll: true })\n })\n}\n\n/** A list that shows its first `limit` items and offers the rest. */\nfunction Bounded<T>(props: {\n items: readonly T[]\n itemKey: (item: T, index: number) => string\n limit: number\n noun: string\n children: (item: Accessor<T>, index: Accessor<number>, key: string) => JSX.Element\n}) {\n const [shown, setShown] = createSignal(props.limit)\n const page = createMemo(() => boundedEntries(props.items, shown(), props.itemKey))\n const visible = () => page().entries\n const visibleKeys = createMemo(() => visible().map((entry) => entry.key))\n keepFocusThroughReorder(visibleKeys)\n const hidden = () => props.items.length - visible().length\n return (\n <>\n <For each={visibleKeys()}>\n {(key) => {\n const entry = createMemo(() => page().byKey.get(key)!)\n return props.children(\n () => entry().item,\n () => entry().index,\n key\n )\n }}\n </For>\n <Show when={hidden() > 0}>\n <li class=\"px-1.5 py-0.5\">\n <Button variant=\"ghost\" size=\"2xs\" onClick={() => setShown(shown() + props.limit)}>\n Show {Math.min(hidden(), props.limit).toLocaleString()} more {props.noun} (\n {hidden().toLocaleString()} hidden)\n </Button>\n </li>\n </Show>\n </>\n )\n}\n\n/** Characters of a failure message drawn before the rest is offered. */\nexport const TEST_RESULTS_MESSAGE_LIMIT = 4_000\n\n/**\n * A failed test's message, which a runner may print at any length: a captured\n * log, a serialized object, a long assertion. It opens on its own for the first\n * failure, so it is bounded where the diff and stack are already bounded: the\n * body scrolls past a fixed height, only the first characters are drawn until the\n * reader asks for the rest, and Copy writes all of it.\n */\nfunction FailureMessage(props: { text: string; onCopy?: (ok: boolean) => void }) {\n const [all, setAll] = createSignal(false)\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const clipped = () => props.text.length > TEST_RESULTS_MESSAGE_LIMIT\n const cut = () => {\n // Never inside a surrogate pair, which would draw a replacement character.\n const last = props.text.charCodeAt(TEST_RESULTS_MESSAGE_LIMIT - 1)\n return last >= 0xd800 && last <= 0xdbff\n ? TEST_RESULTS_MESSAGE_LIMIT - 1\n : TEST_RESULTS_MESSAGE_LIMIT\n }\n const shown = () => (clipped() && !all() ? props.text.slice(0, cut()) : props.text)\n const copy = async () => {\n const ok = await copyText(props.text)\n props.onCopy?.(ok)\n }\n return (\n <>\n {/* A region that scrolls is a tab stop and needs a name. */}\n <pre\n data-slot=\"test-results-message\"\n tabindex=\"0\"\n role=\"group\"\n aria-label=\"Failure message\"\n class=\"m-0 max-h-64 overflow-auto font-code text-code whitespace-pre-wrap text-foreground [overflow-wrap:anywhere]\"\n >\n {shown()}\n </pre>\n <Show when={clipped()}>\n <div class=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground\">\n <span class=\"italic\">\n <Show\n when={!all()}\n fallback={`All ${props.text.length.toLocaleString()} characters shown.`}\n >\n Showing the first {cut().toLocaleString()} of {props.text.length.toLocaleString()}{' '}\n characters (copy has all of it).\n </Show>\n </span>\n <Show when={!all()}>\n <Button variant=\"ghost\" size=\"2xs\" onClick={() => setAll(true)}>\n Show all {props.text.length.toLocaleString()} characters\n </Button>\n </Show>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n {copied() ? 'Copied' : 'Copy message'}\n </Button>\n </div>\n </Show>\n </>\n )\n}\n\nfunction TestLine(props: {\n test: Accessor<TestCase>\n keyed: string\n failure?: FirstFailureRenderPath\n onOpenFrame?: TestResultsProps['onOpenFrame']\n}) {\n const test = () => props.test()\n const state = () => (test().status ? TRACE_STATUS[test().status as TestCaseStatus] : undefined)\n // Whether there is anything to disclose. Read once per change, so the disclosure\n // exists while closed without anything below it being built.\n const hasDetail = createMemo(() => Boolean(test().message || test().diff || test().stack))\n // Only the last suite on the failure's path is given it, so a key among\n // this suite's tests is enough to know the failure is this test.\n const failureKey = createMemo(\n () => (props.failure?.test === props.keyed ? props.failure : undefined),\n undefined,\n { equals: sameFailure }\n )\n const [open, setOpen] = createSignal(failureKey() !== undefined)\n let previousFailure = failureKey()\n let collapsedFailure: FirstFailureRenderPath | undefined\n\n createEffect(() => {\n const currentFailure = failureKey()\n if (\n currentFailure &&\n !sameFailure(currentFailure, previousFailure) &&\n !sameFailure(currentFailure, collapsedFailure)\n ) {\n setOpen(true)\n }\n previousFailure = currentFailure\n })\n\n const handleOpenChange = (next: boolean) => {\n if (!next && failureKey()) collapsedFailure = failureKey()\n else if (next) collapsedFailure = undefined\n setOpen(next)\n }\n\n return (\n <TraceLine\n title={test().name}\n status={state()?.status}\n statusLabel={state()?.label}\n meta={formatDuration(test().durationMs)}\n open={open()}\n onOpenChange={handleOpenChange}\n >\n {hasDetail() ? (\n // A closed test builds nothing: the body is made when it is opened, so a diff or\n // stack is not parsed for every test of an open suite.\n <Show when={open()}>\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={test().message}>\n <FailureMessage text={test().message!} />\n </Show>\n <Show when={test().diff}>\n <DiffBlock patch={test().diff!} complete title=\"Expected and received\" />\n </Show>\n <Show when={test().stack}>\n <StackTrace text={test().stack!} onOpenFrame={props.onOpenFrame} />\n </Show>\n </TraceDetail>\n </Show>\n ) : undefined}\n </TraceLine>\n )\n}\n\nfunction SuiteLine(props: {\n suite: Accessor<TestSuite>\n /** This suite's key among its siblings. */\n keyed: string\n /** How many suites enclose this one. */\n depth: number\n limit: number\n /** The first failure, given only to suites on the way to it. */\n failure?: FirstFailureRenderPath\n onOpenFrame?: TestResultsProps['onOpenFrame']\n}) {\n const suite = () => props.suite()\n const counts = createMemo(() => listedCounts([suite()]))\n const state = createMemo(() => suiteState(counts()))\n const children = () => (suite().tests?.length ?? 0) + (suite().suites?.length ?? 0) > 0\n const [open, setOpen] = createSignal(state() === 'failed')\n // The parent passes the failure down only while it is on the way to it, so\n // one comparison at this suite's own depth settles whether it is on the path.\n // Memoised: each level reads its parent's, so a bare function would re-run the\n // whole chain above it on every read and cost exponential time in the depth.\n const failure = createMemo(\n () => (props.failure?.suites[props.depth] === props.keyed ? props.failure : undefined),\n undefined,\n { equals: sameFailure }\n )\n const holdsFailure = createMemo(() => failure()?.suites.length === props.depth + 1)\n let previousFailure = failure()\n let collapsedFailure: FirstFailureRenderPath | undefined\n\n createEffect(() => {\n const currentFailure = failure()\n if (\n currentFailure &&\n !sameFailure(currentFailure, previousFailure) &&\n !sameFailure(currentFailure, collapsedFailure)\n ) {\n setOpen(true)\n }\n previousFailure = currentFailure\n })\n\n const handleOpenChange = (next: boolean) => {\n if (!next && failure()) collapsedFailure = failure()\n else if (next) collapsedFailure = undefined\n setOpen(next)\n }\n\n const description = () => {\n const parts = [\n suite().file,\n counts().failed > 0 ? `${counts().failed.toLocaleString()} failed` : undefined,\n ]\n return parts.filter(Boolean).join(' · ') || undefined\n }\n return (\n <TraceLine\n icon={<FlaskConical />}\n title={suite().name}\n description={description()}\n status={\n state() === 'failed'\n ? 'error'\n : state() === 'running'\n ? 'running'\n : state() === 'passed'\n ? 'success'\n : undefined\n }\n statusLabel={\n state() === 'failed'\n ? 'Has failing tests'\n : state() === 'passed'\n ? 'All listed tests passed'\n : undefined\n }\n meta={formatDuration(suite().durationMs)}\n open={open()}\n onOpenChange={handleOpenChange}\n >\n {children() ? (\n <div>\n <Show when={open()}>\n <Trace size=\"sm\" aria-label={`${suite().name} tests`}>\n <Bounded\n items={suite().tests ?? []}\n itemKey={siblingKey}\n limit={props.limit}\n noun=\"tests\"\n >\n {(test, _index, key) => (\n <TestLine\n test={test}\n keyed={key}\n failure={holdsFailure() ? failure() : undefined}\n onOpenFrame={props.onOpenFrame}\n />\n )}\n </Bounded>\n <Bounded\n items={suite().suites ?? []}\n itemKey={siblingKey}\n limit={props.limit}\n noun=\"suites\"\n >\n {(nested, _index, key) => (\n <SuiteLine\n suite={nested}\n keyed={key}\n depth={props.depth + 1}\n limit={props.limit}\n failure={failure()}\n onOpenFrame={props.onOpenFrame}\n />\n )}\n </Bounded>\n </Trace>\n </Show>\n </div>\n ) : undefined}\n </TraceLine>\n )\n}\n\nexport function TestResults(props: TestResultsProps) {\n const [local, rest] = splitProps(props, [\n 'suites',\n 'summary',\n 'running',\n 'listLimit',\n 'onOpenFrame',\n 'label',\n 'class',\n ])\n\n const listed = createMemo(() => listedCounts(local.suites))\n const counts = createMemo(() => reconcileCounts(local.summary, listed()))\n const limit = () => Math.max(1, Math.floor(local.listLimit ?? TEST_RESULTS_LIST_LIMIT))\n const failure = createMemo(() => firstFailureRenderPath(local.suites), undefined, {\n equals: sameFailure,\n })\n const duration = () => formatDuration(local.summary?.durationMs, 'long')\n const nothing = () =>\n counts().lines.length === 0 &&\n counts().reportedTotal === undefined &&\n local.suites.length === 0 &&\n !local.running\n\n return (\n <section\n data-slot=\"test-results\"\n aria-label={local.label ?? 'Test results'}\n aria-busy={local.running || undefined}\n class={cn('flex min-w-0 flex-col gap-2', local.class)}\n {...rest}\n >\n <Show\n when={!nothing()}\n fallback={<p class=\"m-0 text-sm text-muted-foreground\">No test results</p>}\n >\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm\">\n <Show when={local.running}>\n <span class=\"flex items-center gap-1 text-info\">\n <LoaderCircle aria-hidden=\"true\" class=\"size-3.5 motion-safe:animate-spin\" />\n Running\n </span>\n </Show>\n <For each={counts().lines}>{(line) => <CountReadout line={line} />}</For>\n <Show\n when={\n counts().lines.length === 0 &&\n !counts().totalNote &&\n counts().reportedTotal !== undefined\n }\n >\n <span class=\"text-muted-foreground\">\n {counts().reportedTotal?.toLocaleString()} tests reported\n </span>\n </Show>\n <Show when={counts().totalNote}>\n {(note) => (\n <span class=\"text-muted-foreground\">\n {note().reported.toLocaleString()} tests reported (\n {note().listed.toLocaleString()} listed)\n </span>\n )}\n </Show>\n <Show when={duration()}>\n <span class=\"text-muted-foreground\">in {duration()}</span>\n </Show>\n </div>\n <SummaryBar lines={counts().lines} />\n <Show when={counts().basis === 'listed' && counts().lines.length > 0}>\n <p class=\"m-0 text-xs text-muted-foreground\">Counts are from the tests listed below.</p>\n </Show>\n </div>\n <Show when={local.suites.length > 0}>\n <Trace aria-label=\"Test suites\">\n <Bounded items={local.suites} itemKey={siblingKey} limit={limit()} noun=\"suites\">\n {(suite, _index, key) => (\n <SuiteLine\n suite={suite}\n keyed={key}\n depth={0}\n limit={limit()}\n failure={failure()}\n onOpenFrame={local.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WAAA,OAAEA,QAAQ;UAAC;UAAA,IAClB7G,cAAW;WAAA,OAAEoJ,MAAMpJ;UAAW;SAAA,CAAA;QAEjC,CAAA;OAAA;MAAA,CAAA;KAAA;IAAA,CAAA,CAAA;GAAA;EAAA,CAAA,CAAA;EAAA,OAAA4J;CAAA,EAAA,CAAA;AAOf"}
|
|
1
|
+
{"version":3,"file":"test-results.js","names":["Check","CircleCheck","CircleMinus","CircleX","Copy","FlaskConical","LoaderCircle","createComputed","createMemo","createEffect","createSignal","For","Show","splitProps","createCopyFeedback","cn","Button","DiffBlock","Trace","TraceDetail","TraceLine","StackTrace","boundedEntries","describeCount","firstFailureRenderPath","formatDuration","listedCounts","reconcileCounts","sameFailure","siblingKey","suiteState","suites","summary","running","listLimit","onOpenFrame","label","TEST_RESULTS_LIST_LIMIT","OUTCOME_ICON","failed","_$createComponent","passed","skipped","CountReadout","props","line","_el$","_tmpl$","_$insert","outcome","_$effect","_$setAttribute","SEGMENT_CLASS","SummaryBar","lines","visible","filter","count","when","length","children","_el$2","_tmpl$2","each","_el$3","_tmpl$3","_p$","_v$","_v$2","e","_$className","t","_$setStyleProperty","undefined","TRACE_STATUS","status","pending","keepFocusThroughReorder","keys","noted","HTMLElement","active","document","activeElement","closest","element","isConnected","body","focus","preventScroll","Bounded","items","itemKey","item","index","limit","noun","key","shown","setShown","page","entries","visibleKeys","map","entry","hidden","byKey","get","_el$4","_tmpl$4","variant","size","onClick","_$memo","Math","min","toLocaleString","TEST_RESULTS_MESSAGE_LIMIT","FailureMessage","text","onCopy","ok","all","setAll","copied","copyFailed","copy","copyText","clipped","cut","last","charCodeAt","slice","_el$5","_tmpl$5","_el$6","_tmpl$6","_el$7","firstChild","fallback","title","TestLine","test","keyed","failure","state","hasDetail","Boolean","message","diff","stack","failureKey","equals","open","setOpen","previousFailure","collapsedFailure","currentFailure","handleOpenChange","next","name","statusLabel","meta","durationMs","onOpenChange","patch","complete","SuiteLine","suite","depth","counts","tests","holdsFailure","description","parts","file","join","icon","_el$8","_tmpl$7","_index","nested","TestResults","local","rest","listed","max","floor","duration","nothing","reportedTotal","_el$9","_tmpl$11","_$spread","_$mergeProps","class","_tmpl$12","_el$0","_tmpl$10","_el$1","_el$10","_tmpl$8","_el$11","totalNote","_el$12","_tmpl$9","_el$13","note","_el$18","_tmpl$13","_el$19","_el$21","nextSibling","reported","_el$14","_tmpl$0","basis","_tmpl$1"],"sources":["../../../../src/components/composites/test-results/test-results.tsx"],"sourcesContent":["import {\n Check,\n CircleCheck,\n CircleMinus,\n CircleX,\n Copy,\n FlaskConical,\n LoaderCircle,\n} from 'lucide-solid'\nimport {\n createComputed,\n createMemo,\n createEffect,\n createSignal,\n For,\n Show,\n splitProps,\n type Accessor,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport { DiffBlock } from '../../ui/diff-block'\nimport { Trace, TraceDetail, TraceLine, type TraceStatus } from '../../ui/trace'\nimport { StackTrace, type StackTraceProps } from '../stack-trace'\nimport {\n boundedEntries,\n describeCount,\n firstFailureRenderPath,\n formatDuration,\n listedCounts,\n reconcileCounts,\n sameFailure,\n siblingKey,\n suiteState,\n type CountLine,\n type TestCase,\n type TestCaseStatus,\n type TestOutcome,\n type TestSuite,\n type TestSummary,\n type FirstFailureRenderPath,\n} from './test-results-model'\n\n/**\n * TestResults.\n *\n * A test run: how it went in words and in a segmented bar, then the suites it\n * ran as `Trace` lines, each opening onto its tests, and a failing test opening\n * onto its message, diff and stack. It is for a run the host can structure; reach\n * for `Terminal` when all there is to show is the command's output, and for\n * `StackTrace` alone when one call failed outside a test.\n *\n * ## Counts are claims\n *\n * Nothing is computed that the host did not supply data for, and nothing the host\n * supplied is quietly recomputed. `summary` is the host's own tally and is shown\n * as given. If tests are listed and their number for an outcome does not match, the\n * listed number is shown beside it, \"40 passed (2 listed)\", which is also how a\n * host that lists only its failures reads. Without a `summary` the counts shown are\n * those of the tests listed, and the component says so; it does not present them as\n * the run's totals. A suite is marked failed or passed only from the tests listed in\n * it, and its spoken label says \"listed\" so it claims no more than that.\n *\n * ## Not colour-only\n *\n * The bar is decoration: every segment has a counterpart in the words beside it,\n * each with its own shape (a cross, a tick, a dash). Segments are separated by a\n * gap and never narrower than a visible sliver, so one failure in five thousand\n * tests is still on the bar.\n *\n * ## Bounded\n *\n * Suites and tests are listed `listLimit` at a time with \"show more\", and a suite's\n * tests are not rendered until it is open. The first failure in reading order opens\n * when its row is visible; a failure beyond a \"show more\" boundary stays unmounted\n * until its page is revealed. When a running result first reports a failure, its\n * suite and test open once. Later updates preserve the user's disclosure choices.\n *\n * Failure details are text: the message is a `pre`, the diff goes to `DiffBlock`\n * and the stack to `StackTrace`. If a stack already begins with the message, pass\n * only the stack; nothing here de-duplicates what the host sends.\n */\nexport type TestResultsProps = Omit<ComponentProps<'section'>, 'children'> & {\n suites: readonly TestSuite[]\n /** The host's own counts. Shown as given; see the component comment. */\n summary?: TestSummary\n /** The run is still going. */\n running?: boolean\n /** Suites, or tests within a suite, listed before \"show more\". Default 50. */\n listLimit?: number\n /** Passed to each failure's `StackTrace`. */\n onOpenFrame?: StackTraceProps['onOpenFrame']\n /** The section's accessible name. Default \"Test results\". */\n label?: string\n}\n\nexport const TEST_RESULTS_LIST_LIMIT = 50\n\nconst OUTCOME_ICON: Readonly<Record<TestOutcome, () => JSX.Element>> = {\n failed: () => <CircleX aria-hidden=\"true\" class=\"size-3.5 text-destructive\" />,\n passed: () => <CircleCheck aria-hidden=\"true\" class=\"size-3.5 text-success\" />,\n skipped: () => <CircleMinus aria-hidden=\"true\" class=\"size-3.5 text-muted-foreground\" />,\n}\n\nfunction CountReadout(props: { line: CountLine }) {\n return (\n <span class=\"flex items-center gap-1 whitespace-nowrap\" data-outcome={props.line.outcome}>\n {OUTCOME_ICON[props.line.outcome]()}\n {describeCount(props.line)}\n </span>\n )\n}\n\n// Segments are drawn in this order so the bar reads the same in every run.\nconst SEGMENT_CLASS: Readonly<Record<TestOutcome, string>> = {\n failed: 'bg-destructive',\n passed: 'bg-success',\n skipped: 'bg-muted-foreground/40',\n}\n\nfunction SummaryBar(props: { lines: readonly CountLine[] }) {\n const visible = () => props.lines.filter((line) => line.count > 0)\n return (\n <Show when={visible().length > 0}>\n <div\n aria-hidden=\"true\"\n data-slot=\"test-results-bar\"\n class=\"flex h-1.5 w-full gap-px overflow-hidden rounded-full bg-muted\"\n >\n <For each={visible()}>\n {(line) => (\n <span\n class={cn('min-w-1', SEGMENT_CLASS[line.outcome])}\n style={{ flex: `${line.count} 1 0` }}\n />\n )}\n </For>\n </div>\n </Show>\n )\n}\n\nconst TRACE_STATUS: Readonly<Record<TestCaseStatus, { status: TraceStatus; label: string }>> = {\n passed: { status: 'success', label: 'Passed' },\n failed: { status: 'error', label: 'Failed' },\n skipped: { status: 'cancelled', label: 'Skipped' },\n running: { status: 'running', label: 'Running' },\n pending: { status: 'pending', label: 'Not run yet' },\n}\n\n/**\n * Keep keyboard focus through a reorder. Solid moves a keyed row's node instead\n * of replacing it, and a browser blurs a focused element that is moved, so an\n * immutable reorder would drop the reader's place onto the body even though the\n * node and its open state survive. The focused element is noted just before the\n * rows move and given focus back just after, but only when nothing else has taken\n * focus meanwhile, and only inside a test run, so a reader who has moved on is\n * never pulled back and an unrelated element is never refocused.\n */\nfunction keepFocusThroughReorder(keys: Accessor<readonly string[]>) {\n let noted: HTMLElement | undefined\n createComputed(() => {\n keys()\n const active = typeof document === 'undefined' ? null : document.activeElement\n noted =\n active instanceof HTMLElement && active.closest('[data-slot=\"test-results\"]')\n ? active\n : undefined\n })\n createEffect(() => {\n keys()\n const element = noted\n noted = undefined\n if (!element || !element.isConnected) return\n const active = document.activeElement\n if (active === null || active === document.body) element.focus({ preventScroll: true })\n })\n}\n\n/** A list that shows its first `limit` items and offers the rest. */\nfunction Bounded<T>(props: {\n items: readonly T[]\n itemKey: (item: T, index: number) => string\n limit: number\n noun: string\n children: (item: Accessor<T>, index: Accessor<number>, key: string) => JSX.Element\n}) {\n const [shown, setShown] = createSignal(props.limit)\n const page = createMemo(() => boundedEntries(props.items, shown(), props.itemKey))\n const visible = () => page().entries\n const visibleKeys = createMemo(() => visible().map((entry) => entry.key))\n keepFocusThroughReorder(visibleKeys)\n const hidden = () => props.items.length - visible().length\n return (\n <>\n <For each={visibleKeys()}>\n {(key) => {\n const entry = createMemo(() => page().byKey.get(key)!)\n return props.children(\n () => entry().item,\n () => entry().index,\n key\n )\n }}\n </For>\n <Show when={hidden() > 0}>\n <li class=\"px-1.5 py-0.5\">\n <Button variant=\"ghost\" size=\"2xs\" onClick={() => setShown(shown() + props.limit)}>\n Show {Math.min(hidden(), props.limit).toLocaleString()} more {props.noun} (\n {hidden().toLocaleString()} hidden)\n </Button>\n </li>\n </Show>\n </>\n )\n}\n\n/** Characters of a failure message drawn before the rest is offered. */\nexport const TEST_RESULTS_MESSAGE_LIMIT = 4_000\n\n/**\n * A failed test's message, which a runner may print at any length: a captured\n * log, a serialized object, a long assertion. It opens on its own for the first\n * failure, so it is bounded where the diff and stack are already bounded: the\n * body scrolls past a fixed height, only the first characters are drawn until the\n * reader asks for the rest, and Copy writes all of it.\n */\nfunction FailureMessage(props: { text: string; onCopy?: (ok: boolean) => void }) {\n const [all, setAll] = createSignal(false)\n const { copied, failed: copyFailed, copy: copyText } = createCopyFeedback()\n const clipped = () => props.text.length > TEST_RESULTS_MESSAGE_LIMIT\n const cut = () => {\n // Never inside a surrogate pair, which would draw a replacement character.\n const last = props.text.charCodeAt(TEST_RESULTS_MESSAGE_LIMIT - 1)\n return last >= 0xd800 && last <= 0xdbff\n ? TEST_RESULTS_MESSAGE_LIMIT - 1\n : TEST_RESULTS_MESSAGE_LIMIT\n }\n const shown = () => (clipped() && !all() ? props.text.slice(0, cut()) : props.text)\n const copy = async () => {\n const ok = await copyText(props.text)\n props.onCopy?.(ok)\n }\n return (\n <>\n {/* A region that scrolls is a tab stop and needs a name. */}\n <pre\n data-slot=\"test-results-message\"\n tabindex=\"0\"\n role=\"group\"\n aria-label=\"Failure message\"\n class=\"m-0 max-h-64 overflow-auto font-code text-code whitespace-pre-wrap text-foreground [overflow-wrap:anywhere]\"\n >\n {shown()}\n </pre>\n <Show when={clipped()}>\n <div class=\"flex flex-wrap items-center gap-x-2 gap-y-1 text-xs text-muted-foreground\">\n <span class=\"italic\">\n <Show\n when={!all()}\n fallback={`All ${props.text.length.toLocaleString()} characters shown.`}\n >\n Showing the first {cut().toLocaleString()} of {props.text.length.toLocaleString()}{' '}\n characters (copy has all of it).\n </Show>\n </span>\n <Show when={!all()}>\n <Button variant=\"ghost\" size=\"2xs\" onClick={() => setAll(true)}>\n Show all {props.text.length.toLocaleString()} characters\n </Button>\n </Show>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n {copied() ? 'Copied' : 'Copy message'}\n </Button>\n </div>\n </Show>\n </>\n )\n}\n\nfunction TestLine(props: {\n test: Accessor<TestCase>\n keyed: string\n failure?: FirstFailureRenderPath\n onOpenFrame?: TestResultsProps['onOpenFrame']\n}) {\n const test = () => props.test()\n const state = () => (test().status ? TRACE_STATUS[test().status as TestCaseStatus] : undefined)\n // Whether there is anything to disclose. Read once per change, so the disclosure\n // exists while closed without anything below it being built.\n const hasDetail = createMemo(() => Boolean(test().message || test().diff || test().stack))\n // Only the last suite on the failure's path is given it, so a key among\n // this suite's tests is enough to know the failure is this test.\n const failureKey = createMemo(\n () => (props.failure?.test === props.keyed ? props.failure : undefined),\n undefined,\n { equals: sameFailure }\n )\n const [open, setOpen] = createSignal(failureKey() !== undefined)\n let previousFailure = failureKey()\n let collapsedFailure: FirstFailureRenderPath | undefined\n\n createEffect(() => {\n const currentFailure = failureKey()\n if (\n currentFailure &&\n !sameFailure(currentFailure, previousFailure) &&\n !sameFailure(currentFailure, collapsedFailure)\n ) {\n setOpen(true)\n }\n previousFailure = currentFailure\n })\n\n const handleOpenChange = (next: boolean) => {\n if (!next && failureKey()) collapsedFailure = failureKey()\n else if (next) collapsedFailure = undefined\n setOpen(next)\n }\n\n return (\n <TraceLine\n title={test().name}\n status={state()?.status}\n statusLabel={state()?.label}\n meta={formatDuration(test().durationMs)}\n open={open()}\n onOpenChange={handleOpenChange}\n >\n {hasDetail() ? (\n // A closed test builds nothing: the body is made when it is opened, so a diff or\n // stack is not parsed for every test of an open suite.\n <Show when={open()}>\n <TraceDetail class=\"flex flex-col gap-2\">\n <Show when={test().message}>\n <FailureMessage text={test().message!} />\n </Show>\n <Show when={test().diff}>\n <DiffBlock patch={test().diff!} complete title=\"Expected and received\" />\n </Show>\n <Show when={test().stack}>\n <StackTrace text={test().stack!} onOpenFrame={props.onOpenFrame} />\n </Show>\n </TraceDetail>\n </Show>\n ) : undefined}\n </TraceLine>\n )\n}\n\nfunction SuiteLine(props: {\n suite: Accessor<TestSuite>\n /** This suite's key among its siblings. */\n keyed: string\n /** How many suites enclose this one. */\n depth: number\n limit: number\n /** The first failure, given only to suites on the way to it. */\n failure?: FirstFailureRenderPath\n onOpenFrame?: TestResultsProps['onOpenFrame']\n}) {\n const suite = () => props.suite()\n const counts = createMemo(() => listedCounts([suite()]))\n const state = createMemo(() => suiteState(counts()))\n const children = () => (suite().tests?.length ?? 0) + (suite().suites?.length ?? 0) > 0\n const [open, setOpen] = createSignal(state() === 'failed')\n // The parent passes the failure down only while it is on the way to it, so\n // one comparison at this suite's own depth settles whether it is on the path.\n // Memoised: each level reads its parent's, so a bare function would re-run the\n // whole chain above it on every read and cost exponential time in the depth.\n const failure = createMemo(\n () => (props.failure?.suites[props.depth] === props.keyed ? props.failure : undefined),\n undefined,\n { equals: sameFailure }\n )\n const holdsFailure = createMemo(() => failure()?.suites.length === props.depth + 1)\n let previousFailure = failure()\n let collapsedFailure: FirstFailureRenderPath | undefined\n\n createEffect(() => {\n const currentFailure = failure()\n if (\n currentFailure &&\n !sameFailure(currentFailure, previousFailure) &&\n !sameFailure(currentFailure, collapsedFailure)\n ) {\n setOpen(true)\n }\n previousFailure = currentFailure\n })\n\n const handleOpenChange = (next: boolean) => {\n if (!next && failure()) collapsedFailure = failure()\n else if (next) collapsedFailure = undefined\n setOpen(next)\n }\n\n const description = () => {\n const parts = [\n suite().file,\n counts().failed > 0 ? `${counts().failed.toLocaleString()} failed` : undefined,\n ]\n return parts.filter(Boolean).join(' · ') || undefined\n }\n return (\n <TraceLine\n icon={<FlaskConical />}\n title={suite().name}\n description={description()}\n status={\n state() === 'failed'\n ? 'error'\n : state() === 'running'\n ? 'running'\n : state() === 'passed'\n ? 'success'\n : undefined\n }\n statusLabel={\n state() === 'failed'\n ? 'Has failing tests'\n : state() === 'passed'\n ? 'All listed tests passed'\n : undefined\n }\n meta={formatDuration(suite().durationMs)}\n open={open()}\n onOpenChange={handleOpenChange}\n >\n {children() ? (\n <div>\n <Show when={open()}>\n <Trace size=\"sm\" aria-label={`${suite().name} tests`}>\n <Bounded\n items={suite().tests ?? []}\n itemKey={siblingKey}\n limit={props.limit}\n noun=\"tests\"\n >\n {(test, _index, key) => (\n <TestLine\n test={test}\n keyed={key}\n failure={holdsFailure() ? failure() : undefined}\n onOpenFrame={props.onOpenFrame}\n />\n )}\n </Bounded>\n <Bounded\n items={suite().suites ?? []}\n itemKey={siblingKey}\n limit={props.limit}\n noun=\"suites\"\n >\n {(nested, _index, key) => (\n <SuiteLine\n suite={nested}\n keyed={key}\n depth={props.depth + 1}\n limit={props.limit}\n failure={failure()}\n onOpenFrame={props.onOpenFrame}\n />\n )}\n </Bounded>\n </Trace>\n </Show>\n </div>\n ) : undefined}\n </TraceLine>\n )\n}\n\nexport function TestResults(props: TestResultsProps) {\n const [local, rest] = splitProps(props, [\n 'suites',\n 'summary',\n 'running',\n 'listLimit',\n 'onOpenFrame',\n 'label',\n 'class',\n ])\n\n const listed = createMemo(() => listedCounts(local.suites))\n const counts = createMemo(() => reconcileCounts(local.summary, listed()))\n const limit = () => Math.max(1, Math.floor(local.listLimit ?? TEST_RESULTS_LIST_LIMIT))\n const failure = createMemo(() => firstFailureRenderPath(local.suites), undefined, {\n equals: sameFailure,\n })\n const duration = () => formatDuration(local.summary?.durationMs, 'long')\n const nothing = () =>\n counts().lines.length === 0 &&\n counts().reportedTotal === undefined &&\n local.suites.length === 0 &&\n !local.running\n\n return (\n <section\n data-slot=\"test-results\"\n aria-label={local.label ?? 'Test results'}\n aria-busy={local.running || undefined}\n class={cn('flex min-w-0 flex-col gap-2', local.class)}\n {...rest}\n >\n <Show\n when={!nothing()}\n fallback={<p class=\"m-0 text-sm text-muted-foreground\">No test results</p>}\n >\n <div class=\"flex flex-col gap-1.5\">\n <div class=\"flex flex-wrap items-center gap-x-3 gap-y-1 text-sm\">\n <Show when={local.running}>\n <span class=\"flex items-center gap-1 text-info\">\n <LoaderCircle aria-hidden=\"true\" class=\"size-3.5 motion-safe:animate-spin\" />\n Running\n </span>\n </Show>\n <For each={counts().lines}>{(line) => <CountReadout line={line} />}</For>\n <Show\n when={\n counts().lines.length === 0 &&\n !counts().totalNote &&\n counts().reportedTotal !== undefined\n }\n >\n <span class=\"text-muted-foreground\">\n {counts().reportedTotal?.toLocaleString()} tests reported\n </span>\n </Show>\n <Show when={counts().totalNote}>\n {(note) => (\n <span class=\"text-muted-foreground\">\n {note().reported.toLocaleString()} tests reported (\n {note().listed.toLocaleString()} listed)\n </span>\n )}\n </Show>\n <Show when={duration()}>\n <span class=\"text-muted-foreground\">in {duration()}</span>\n </Show>\n </div>\n <SummaryBar lines={counts().lines} />\n <Show when={counts().basis === 'listed' && counts().lines.length > 0}>\n <p class=\"m-0 text-xs text-muted-foreground\">Counts are from the tests listed below.</p>\n </Show>\n </div>\n <Show when={local.suites.length > 0}>\n <Trace aria-label=\"Test suites\">\n <Bounded items={local.suites} itemKey={siblingKey} limit={limit()} noun=\"suites\">\n {(suite, _index, key) => (\n <SuiteLine\n suite={suite}\n keyed={key}\n depth={0}\n limit={limit()}\n failure={failure()}\n onOpenFrame={local.onOpenFrame}\n />\n )}\n </Bounded>\n </Trace>\n </Show>\n </Show>\n </section>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAmGA,IAAaqC,0BAA0B;AAEvC,IAAMC,eAAiE;CACrEC,cAAQC,gBAAOrC,SAAO;EAAA,eAAA;EAAA,SAAA;CAAA,CAAA;CACtBsC,cAAQD,gBAAOvC,aAAW;EAAA,eAAA;EAAA,SAAA;CAAA,CAAA;CAC1ByC,eAASF,gBAAOtC,aAAW;EAAA,eAAA;EAAA,SAAA;CAAA,CAAA;AAC7B;AAEA,SAASyC,aAAaC,OAA4B;CAChD,cAAA;EAAA,IAAAE,OAAAC,OAAA;EAAAC,OAAAF,YAEKR,aAAaM,MAAMC,KAAKI,QAAQ,CAAC,GAAC,IAAA;EAAAD,OAAAF,YAClCvB,cAAcqB,MAAMC,IAAI,GAAC,IAAA;EAAAK,aAAAC,aAAAL,MAAA,gBAF0CF,MAAMC,KAAKI,OAAO,CAAA;EAAA,OAAAH;CAAA,EAAA,CAAA;AAK5F;AAGA,IAAMM,gBAAuD;CAC3Db,QAAQ;CACRE,QAAQ;CACRC,SAAS;AACX;AAEA,SAASW,WAAWT,OAAwC;CAC1D,MAAMW,gBAAgBX,MAAMU,MAAME,QAAQX,SAASA,KAAKY,QAAQ,CAAC;CACjE,OAAAjB,gBACG5B,MAAI;EAAA,IAAC8C,OAAI;GAAA,OAAEH,QAAQ,CAAC,CAACI,SAAS;EAAC;EAAA,IAAAC,WAAA;GAAA,IAAAC,QAAAC,QAAA;GAAAd,OAAAa,OAAArB,gBAM3B7B,KAAG;IAAA,IAACoD,OAAI;KAAA,OAAER,QAAQ;IAAC;IAAAK,WAChBf,gBAAI;KAAA,IAAAmB,QAAAC,QAAA;KAAAf,QAAAgB,QAAA;MAAA,IAAAC,MAEKpD,GAAG,WAAWqC,cAAcP,KAA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wE,OAAO;UAAC,IACR1E,QAAK;WAAA,OAAEA,MAAM;UAAC;UAAA,IACdiD,UAAO;WAAA,OAAEA,QAAQ;UAAC;UAAA,IAClB7G,cAAW;WAAA,OAAEoJ,MAAMpJ;UAAW;SAAA,CAAA;QAEjC,CAAA;OAAA;MAAA,CAAA;KAAA;IAAA,CAAA,CAAA;GAAA;EAAA,CAAA,CAAA;EAAA,OAAA4J;CAAA,EAAA,CAAA;AAOf"}
|
|
@@ -4,8 +4,8 @@ import { type TraceLineProps } from '../../ui/trace';
|
|
|
4
4
|
* Tool.
|
|
5
5
|
*
|
|
6
6
|
* One tool call, from what was asked to what came back, as a `TraceLine`: the
|
|
7
|
-
* tool's name and a short description on the line, and
|
|
8
|
-
* to show
|
|
7
|
+
* tool's name and a short description on the line, and, when there is anything
|
|
8
|
+
* to show, an input section, an output section and an error underneath. Reach
|
|
9
9
|
* for `Subagent` when the "tool" is another agent with steps of its own, for a
|
|
10
10
|
* bare `CodeBlock` when the point is the output itself and not the call that made
|
|
11
11
|
* it, and for a confirmation (passed as `children`) when the reader has to decide
|
|
@@ -13,7 +13,7 @@ import { type TraceLineProps } from '../../ui/trace';
|
|
|
13
13
|
*
|
|
14
14
|
* ## Everything is optional, and absence is not a claim
|
|
15
15
|
*
|
|
16
|
-
* A call with no `status` shows no mark at all
|
|
16
|
+
* A call with no `status` shows no mark at all, an event that merely arrived is
|
|
17
17
|
* not "done". `input`, `output` and `errorText` each render a section only when
|
|
18
18
|
* the host passed them: no empty "Output" box under a call that is still running,
|
|
19
19
|
* and no invented "No output" under one that failed. An error with no output is
|
|
@@ -30,7 +30,7 @@ import { type TraceLineProps } from '../../ui/trace';
|
|
|
30
30
|
*
|
|
31
31
|
* ## Payloads are untrusted and unbounded
|
|
32
32
|
*
|
|
33
|
-
* `input` and `output` are `unknown
|
|
33
|
+
* `input` and `output` are `unknown`, whatever the model sent and the tool
|
|
34
34
|
* returned. They go through `formatToolValue`, which cannot throw (circular
|
|
35
35
|
* references, `BigInt`, throwing getters) and stops after `maxChars`; a cut view
|
|
36
36
|
* says so rather than presenting half a document as the whole. Sections render in
|