@dxos/plugin-github 0.7.4 → 0.14.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/LICENSE +102 -5
- package/PLUGIN.mdl +784 -0
- package/dist/lib/GitHubCapabilities.mjs +10 -0
- package/dist/lib/GitHubCapabilities.mjs.map +1 -0
- package/dist/lib/GitHubEvents.mjs +15 -0
- package/dist/lib/GitHubEvents.mjs.map +1 -0
- package/dist/lib/GitHubOperation.mjs +384 -0
- package/dist/lib/GitHubOperation.mjs.map +1 -0
- package/dist/lib/GitHubPlugin.mjs +16 -0
- package/dist/lib/GitHubPlugin.mjs.map +1 -0
- package/dist/lib/Walkthrough.mjs +59 -0
- package/dist/lib/Walkthrough.mjs.map +1 -0
- package/dist/lib/capabilities.browser.mjs +54 -0
- package/dist/lib/capabilities.browser.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +54 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/capabilities.node.mjs +30 -0
- package/dist/lib/capabilities.node.mjs.map +1 -0
- package/dist/lib/capabilities.tauri.mjs +54 -0
- package/dist/lib/capabilities.tauri.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs +30 -0
- package/dist/lib/capabilities.workerd.mjs.map +1 -0
- package/dist/lib/chunk-ImportPullRequestDialog.mjs +116 -0
- package/dist/lib/chunk-ImportPullRequestDialog.mjs.map +1 -0
- package/dist/lib/chunk-PLUGIN.mjs +6 -0
- package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
- package/dist/lib/chunk-PullRequestArticle.mjs +1506 -0
- package/dist/lib/chunk-PullRequestArticle.mjs.map +1 -0
- package/dist/lib/chunk-PullRequestArticle2.mjs +2 -0
- package/dist/lib/chunk-PullRequestCardMenu.mjs +123 -0
- package/dist/lib/chunk-PullRequestCardMenu.mjs.map +1 -0
- package/dist/lib/chunk-PullRequestsArticle.mjs +594 -0
- package/dist/lib/chunk-PullRequestsArticle.mjs.map +1 -0
- package/dist/lib/chunk-WalkthroughArticle.mjs +26 -0
- package/dist/lib/chunk-WalkthroughArticle.mjs.map +1 -0
- package/dist/lib/chunk-add-pull-request-comment.mjs +19 -0
- package/dist/lib/chunk-add-pull-request-comment.mjs.map +1 -0
- package/dist/lib/chunk-add-pull-request-review-comment.mjs +25 -0
- package/dist/lib/chunk-add-pull-request-review-comment.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +39 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-connector.mjs +70 -0
- package/dist/lib/chunk-connector.mjs.map +1 -0
- package/dist/lib/chunk-constants.mjs +11 -0
- package/dist/lib/chunk-constants.mjs.map +1 -0
- package/dist/lib/chunk-errors.mjs +29 -0
- package/dist/lib/chunk-errors.mjs.map +1 -0
- package/dist/lib/chunk-generate-walkthrough.mjs +86 -0
- package/dist/lib/chunk-generate-walkthrough.mjs.map +1 -0
- package/dist/lib/chunk-generate.mjs +719 -0
- package/dist/lib/chunk-generate.mjs.map +1 -0
- package/dist/lib/chunk-get-pull-request-diff.mjs +25 -0
- package/dist/lib/chunk-get-pull-request-diff.mjs.map +1 -0
- package/dist/lib/chunk-get-pull-request-status.mjs +29 -0
- package/dist/lib/chunk-get-pull-request-status.mjs.map +1 -0
- package/dist/lib/chunk-get-repositories.mjs +32 -0
- package/dist/lib/chunk-get-repositories.mjs.map +1 -0
- package/dist/lib/chunk-github-api.mjs +375 -0
- package/dist/lib/chunk-github-api.mjs.map +1 -0
- package/dist/lib/chunk-github-link.mjs +59 -0
- package/dist/lib/chunk-github-link.mjs.map +1 -0
- package/dist/lib/chunk-import-pull-request-from-snapshot.mjs +25 -0
- package/dist/lib/chunk-import-pull-request-from-snapshot.mjs.map +1 -0
- package/dist/lib/chunk-import-pull-request.mjs +171 -0
- package/dist/lib/chunk-import-pull-request.mjs.map +1 -0
- package/dist/lib/chunk-link-resolver.mjs +109 -0
- package/dist/lib/chunk-link-resolver.mjs.map +1 -0
- package/dist/lib/chunk-markdown-extension.mjs +92 -0
- package/dist/lib/chunk-markdown-extension.mjs.map +1 -0
- package/dist/lib/chunk-materialize-target.mjs +36 -0
- package/dist/lib/chunk-materialize-target.mjs.map +1 -0
- package/dist/lib/chunk-operation-handler.mjs +12 -0
- package/dist/lib/chunk-operation-handler.mjs.map +1 -0
- package/dist/lib/chunk-page-action.mjs +22 -0
- package/dist/lib/chunk-page-action.mjs.map +1 -0
- package/dist/lib/chunk-pull-request.mjs +58 -0
- package/dist/lib/chunk-pull-request.mjs.map +1 -0
- package/dist/lib/chunk-pull-request2.mjs +110 -0
- package/dist/lib/chunk-pull-request2.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +233 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-refresh-pull-requests.mjs +49 -0
- package/dist/lib/chunk-refresh-pull-requests.mjs.map +1 -0
- package/dist/lib/chunk-rolldown-runtime.mjs +13 -0
- package/dist/lib/chunk-schema.mjs +15 -0
- package/dist/lib/chunk-schema.mjs.map +1 -0
- package/dist/lib/chunk-skill-definition.mjs +10 -0
- package/dist/lib/chunk-skill-definition.mjs.map +1 -0
- package/dist/lib/chunk-submit-pull-request-approval.mjs +56 -0
- package/dist/lib/chunk-submit-pull-request-approval.mjs.map +1 -0
- package/dist/lib/chunk-sync-pull-request.mjs +26 -0
- package/dist/lib/chunk-sync-pull-request.mjs.map +1 -0
- package/dist/lib/chunk-sync.mjs +481 -0
- package/dist/lib/chunk-sync.mjs.map +1 -0
- package/dist/lib/chunk-useOpenObject.mjs +43 -0
- package/dist/lib/chunk-useOpenObject.mjs.map +1 -0
- package/dist/lib/extensions.mjs +132 -0
- package/dist/lib/extensions.mjs.map +1 -0
- package/dist/lib/index.mjs +4 -0
- package/dist/lib/meta.mjs +47 -0
- package/dist/lib/meta.mjs.map +1 -0
- package/dist/lib/ns/Extensions.mjs +18 -0
- package/dist/lib/ns/Extensions.mjs.map +1 -0
- package/dist/lib/operations.mjs +23 -0
- package/dist/lib/operations.mjs.map +1 -0
- package/dist/lib/plugin.mjs +9 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/skills.mjs +44 -0
- package/dist/lib/skills.mjs.map +1 -0
- package/dist/lib/testing.mjs +189 -0
- package/dist/lib/testing.mjs.map +1 -0
- package/dist/lib/translations.mjs +136 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +5 -0
- package/dist/types/dx.config.d.ts +28 -0
- package/dist/types/dx.config.d.ts.map +1 -0
- package/dist/types/src/Extensions.d.ts +2 -0
- package/dist/types/src/Extensions.d.ts.map +1 -0
- package/dist/types/src/GitHubPlugin.d.ts +37 -0
- package/dist/types/src/GitHubPlugin.d.ts.map +1 -0
- package/dist/types/src/GitHubPlugin.workerd.test.d.ts +2 -0
- package/dist/types/src/GitHubPlugin.workerd.test.d.ts.map +1 -0
- package/dist/types/src/approval.d.ts +21 -0
- package/dist/types/src/approval.d.ts.map +1 -0
- package/dist/types/src/approval.test.d.ts +2 -0
- package/dist/types/src/approval.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +9 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/connector.d.ts +17 -0
- package/dist/types/src/capabilities/connector.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/browser.d.ts +13 -0
- package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/node.d.ts +13 -0
- package/dist/types/src/capabilities/gen/node.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts +13 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts +13 -0
- package/dist/types/src/capabilities/gen/workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +13 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/link-resolver.d.ts +10 -0
- package/dist/types/src/capabilities/link-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/markdown-extension.d.ts +14 -0
- package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler.d.ts +5 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/page-action.d.ts +5 -0
- package/dist/types/src/capabilities/page-action.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/schema.d.ts +12 -0
- package/dist/types/src/capabilities/schema.d.ts.map +1 -0
- package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
- package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
- package/dist/types/src/cards/GitHubCard.d.ts +11 -0
- package/dist/types/src/cards/GitHubCard.d.ts.map +1 -0
- package/dist/types/src/cards/GitHubCard.stories.d.ts +45 -0
- package/dist/types/src/cards/GitHubCard.stories.d.ts.map +1 -0
- package/dist/types/src/cards/PullRequestCard.d.ts +9 -0
- package/dist/types/src/cards/PullRequestCard.d.ts.map +1 -0
- package/dist/types/src/cards/index.d.ts +3 -0
- package/dist/types/src/cards/index.d.ts.map +1 -0
- package/dist/types/src/components/CommentComposer/CommentComposer.d.ts +30 -0
- package/dist/types/src/components/CommentComposer/CommentComposer.d.ts.map +1 -0
- package/dist/types/src/components/CommentComposer/index.d.ts +2 -0
- package/dist/types/src/components/CommentComposer/index.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/DiffStat.d.ts +8 -0
- package/dist/types/src/components/PullRequestFiles/DiffStat.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/FileTree.d.ts +17 -0
- package/dist/types/src/components/PullRequestFiles/FileTree.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/PullRequestFiles.d.ts +23 -0
- package/dist/types/src/components/PullRequestFiles/PullRequestFiles.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/files.d.ts +39 -0
- package/dist/types/src/components/PullRequestFiles/files.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/files.test.d.ts +2 -0
- package/dist/types/src/components/PullRequestFiles/files.test.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestFiles/index.d.ts +5 -0
- package/dist/types/src/components/PullRequestFiles/index.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/ArtifactPill.d.ts +21 -0
- package/dist/types/src/components/PullRequestOverview/ArtifactPill.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/CheckRunList.d.ts +18 -0
- package/dist/types/src/components/PullRequestOverview/CheckRunList.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/CheckRunList.test.d.ts +2 -0
- package/dist/types/src/components/PullRequestOverview/CheckRunList.test.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestDetails.d.ts +10 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestDetails.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestOverview.d.ts +16 -0
- package/dist/types/src/components/PullRequestOverview/PullRequestOverview.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/RelatedCards.d.ts +28 -0
- package/dist/types/src/components/PullRequestOverview/RelatedCards.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestOverview/index.d.ts +6 -0
- package/dist/types/src/components/PullRequestOverview/index.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestStatus/PullRequestStatus.d.ts +20 -0
- package/dist/types/src/components/PullRequestStatus/PullRequestStatus.d.ts.map +1 -0
- package/dist/types/src/components/PullRequestStatus/index.d.ts +2 -0
- package/dist/types/src/components/PullRequestStatus/index.d.ts.map +1 -0
- package/dist/types/src/components/WalkthroughView/WalkthroughView.d.ts +18 -0
- package/dist/types/src/components/WalkthroughView/WalkthroughView.d.ts.map +1 -0
- package/dist/types/src/components/WalkthroughView/extensions.d.ts +16 -0
- package/dist/types/src/components/WalkthroughView/extensions.d.ts.map +1 -0
- package/dist/types/src/components/WalkthroughView/index.d.ts +3 -0
- package/dist/types/src/components/WalkthroughView/index.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +5 -8
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/constants.d.ts +7 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.d.ts +6 -0
- package/dist/types/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.d.ts.map +1 -0
- package/dist/types/src/containers/ImportPullRequestDialog/index.d.ts +3 -0
- package/dist/types/src/containers/ImportPullRequestDialog/index.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/PullRequestArticle.d.ts +15 -0
- package/dist/types/src/containers/PullRequestArticle/PullRequestArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/failure.d.ts +10 -0
- package/dist/types/src/containers/PullRequestArticle/failure.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/failure.test.d.ts +2 -0
- package/dist/types/src/containers/PullRequestArticle/failure.test.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PullRequestArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestCardMenu/PullRequestCardMenu.d.ts +14 -0
- package/dist/types/src/containers/PullRequestCardMenu/PullRequestCardMenu.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestCardMenu/index.d.ts +2 -0
- package/dist/types/src/containers/PullRequestCardMenu/index.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/PullRequestsArticle.d.ts +13 -0
- package/dist/types/src/containers/PullRequestsArticle/PullRequestsArticle.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.d.ts +44 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.test.d.ts +2 -0
- package/dist/types/src/containers/PullRequestsArticle/arrange.test.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/format.d.ts +3 -0
- package/dist/types/src/containers/PullRequestsArticle/format.d.ts.map +1 -0
- package/dist/types/src/containers/PullRequestsArticle/index.d.ts +2 -0
- package/dist/types/src/containers/PullRequestsArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/WalkthroughArticle/WalkthroughArticle.d.ts +13 -0
- package/dist/types/src/containers/WalkthroughArticle/WalkthroughArticle.d.ts.map +1 -0
- package/dist/types/src/containers/WalkthroughArticle/index.d.ts +2 -0
- package/dist/types/src/containers/WalkthroughArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +7 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/errors.d.ts +157 -0
- package/dist/types/src/errors.d.ts.map +1 -0
- package/dist/types/src/extensions/index.d.ts +3 -0
- package/dist/types/src/extensions/index.d.ts.map +1 -0
- package/dist/types/src/extensions/links.d.ts +21 -0
- package/dist/types/src/extensions/links.d.ts.map +1 -0
- package/dist/types/src/extensions/links.test.d.ts +2 -0
- package/dist/types/src/extensions/links.test.d.ts.map +1 -0
- package/dist/types/src/extensions/references.d.ts +23 -0
- package/dist/types/src/extensions/references.d.ts.map +1 -0
- package/dist/types/src/extensions/references.test.d.ts +2 -0
- package/dist/types/src/extensions/references.test.d.ts.map +1 -0
- package/dist/types/src/github-link.d.ts +29 -0
- package/dist/types/src/github-link.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +5 -2
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useOpenObject.d.ts +9 -0
- package/dist/types/src/hooks/useOpenObject.d.ts.map +1 -0
- package/dist/types/src/hooks/usePullRequestChecks.d.ts +10 -0
- package/dist/types/src/hooks/usePullRequestChecks.d.ts.map +1 -0
- package/dist/types/src/hooks/usePullRequestDiff.d.ts +12 -0
- package/dist/types/src/hooks/usePullRequestDiff.d.ts.map +1 -0
- package/dist/types/src/hooks/usePullRequestFiles.d.ts +22 -0
- package/dist/types/src/hooks/usePullRequestFiles.d.ts.map +1 -0
- package/dist/types/src/hooks/useSyncPullRequest.d.ts +10 -0
- package/dist/types/src/hooks/useSyncPullRequest.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +34 -11
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/operations/add-pull-request-comment.d.ts +5 -0
- package/dist/types/src/operations/add-pull-request-comment.d.ts.map +1 -0
- package/dist/types/src/operations/add-pull-request-review-comment.d.ts +5 -0
- package/dist/types/src/operations/add-pull-request-review-comment.d.ts.map +1 -0
- package/dist/types/src/operations/generate-walkthrough.d.ts +11 -0
- package/dist/types/src/operations/generate-walkthrough.d.ts.map +1 -0
- package/dist/types/src/operations/get-pull-request-diff.d.ts +5 -0
- package/dist/types/src/operations/get-pull-request-diff.d.ts.map +1 -0
- package/dist/types/src/operations/get-pull-request-status.d.ts +5 -0
- package/dist/types/src/operations/get-pull-request-status.d.ts.map +1 -0
- package/dist/types/src/operations/get-repositories.d.ts +13 -0
- package/dist/types/src/operations/get-repositories.d.ts.map +1 -0
- package/dist/types/src/operations/import-pull-request-from-snapshot.d.ts +12 -0
- package/dist/types/src/operations/import-pull-request-from-snapshot.d.ts.map +1 -0
- package/dist/types/src/operations/import-pull-request.d.ts +63 -0
- package/dist/types/src/operations/import-pull-request.d.ts.map +1 -0
- package/dist/types/src/operations/import-pull-request.test.d.ts +2 -0
- package/dist/types/src/operations/import-pull-request.test.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/materialize-target.d.ts +12 -0
- package/dist/types/src/operations/materialize-target.d.ts.map +1 -0
- package/dist/types/src/operations/pull-request.d.ts +48 -0
- package/dist/types/src/operations/pull-request.d.ts.map +1 -0
- package/dist/types/src/operations/pull-request.test.d.ts +2 -0
- package/dist/types/src/operations/pull-request.test.d.ts.map +1 -0
- package/dist/types/src/operations/refresh-pull-requests.d.ts +5 -0
- package/dist/types/src/operations/refresh-pull-requests.d.ts.map +1 -0
- package/dist/types/src/operations/refresh.d.ts +37 -0
- package/dist/types/src/operations/refresh.d.ts.map +1 -0
- package/dist/types/src/operations/refresh.test.d.ts +2 -0
- package/dist/types/src/operations/refresh.test.d.ts.map +1 -0
- package/dist/types/src/operations/submit-pull-request-approval.d.ts +5 -0
- package/dist/types/src/operations/submit-pull-request-approval.d.ts.map +1 -0
- package/dist/types/src/operations/sync-pull-request.d.ts +5 -0
- package/dist/types/src/operations/sync-pull-request.d.ts.map +1 -0
- package/dist/types/src/operations/sync.d.ts +123 -0
- package/dist/types/src/operations/sync.d.ts.map +1 -0
- package/dist/types/src/operations/sync.test.d.ts +2 -0
- package/dist/types/src/operations/sync.test.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/plugin.test.d.ts +2 -0
- package/dist/types/src/plugin.test.d.ts.map +1 -0
- package/dist/types/src/pull-request-body.d.ts +37 -0
- package/dist/types/src/pull-request-body.d.ts.map +1 -0
- package/dist/types/src/pull-request-body.test.d.ts +2 -0
- package/dist/types/src/pull-request-body.test.d.ts.map +1 -0
- package/dist/types/src/pull-request.d.ts +28 -0
- package/dist/types/src/pull-request.d.ts.map +1 -0
- package/dist/types/src/pull-request.test.d.ts +2 -0
- package/dist/types/src/pull-request.test.d.ts.map +1 -0
- package/dist/types/src/services/github-api.d.ts +332 -0
- package/dist/types/src/services/github-api.d.ts.map +1 -0
- package/dist/types/src/services/index.d.ts +2 -0
- package/dist/types/src/services/index.d.ts.map +1 -0
- package/dist/types/src/skills/GitHubSkill.d.ts +12 -0
- package/dist/types/src/skills/GitHubSkill.d.ts.map +1 -0
- package/dist/types/src/skills/index.d.ts +2 -0
- package/dist/types/src/skills/index.d.ts.map +1 -0
- package/dist/types/src/stories/Generate.stories.d.ts +27 -0
- package/dist/types/src/stories/Generate.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Links.stories.d.ts +23 -0
- package/dist/types/src/stories/Links.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestArticle.stories.d.ts +359 -0
- package/dist/types/src/stories/PullRequestArticle.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestFiles.stories.d.ts +365 -0
- package/dist/types/src/stories/PullRequestFiles.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestOverview.stories.d.ts +367 -0
- package/dist/types/src/stories/PullRequestOverview.stories.d.ts.map +1 -0
- package/dist/types/src/stories/PullRequestsArticle.stories.d.ts +357 -0
- package/dist/types/src/stories/PullRequestsArticle.stories.d.ts.map +1 -0
- package/dist/types/src/stories/Walkthrough.stories.d.ts +380 -0
- package/dist/types/src/stories/Walkthrough.stories.d.ts.map +1 -0
- package/dist/types/src/stories/github.d.ts +23 -0
- package/dist/types/src/stories/github.d.ts.map +1 -0
- package/dist/types/src/stories/github.test.d.ts +2 -0
- package/dist/types/src/stories/github.test.d.ts.map +1 -0
- package/dist/types/src/stories/walkthrough-fixture.d.ts +8 -0
- package/dist/types/src/stories/walkthrough-fixture.d.ts.map +1 -0
- package/dist/types/src/testing/fixtures.d.ts +14 -0
- package/dist/types/src/testing/fixtures.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +4 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/plugin.d.ts +4 -0
- package/dist/types/src/testing/plugin.d.ts.map +1 -0
- package/dist/types/src/testing/pull-request-13348.d.ts +6 -0
- package/dist/types/src/testing/pull-request-13348.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +339 -53
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/GitHubCapabilities.d.ts +13 -0
- package/dist/types/src/types/GitHubCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/GitHubEvents.d.ts +8 -0
- package/dist/types/src/types/GitHubEvents.d.ts.map +1 -0
- package/dist/types/src/types/GitHubOperation.d.ts +281 -0
- package/dist/types/src/types/GitHubOperation.d.ts.map +1 -0
- package/dist/types/src/types/PullRequestsView.d.ts +35 -0
- package/dist/types/src/types/PullRequestsView.d.ts.map +1 -0
- package/dist/types/src/types/Walkthrough.d.ts +31 -0
- package/dist/types/src/types/Walkthrough.d.ts.map +1 -0
- package/dist/types/src/types/Walkthrough.test.d.ts +2 -0
- package/dist/types/src/types/Walkthrough.test.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +5 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/walkthrough/fill.d.ts +28 -0
- package/dist/types/src/walkthrough/fill.d.ts.map +1 -0
- package/dist/types/src/walkthrough/fill.test.d.ts +2 -0
- package/dist/types/src/walkthrough/fill.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generate.d.ts +67 -0
- package/dist/types/src/walkthrough/generate.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generate.test.d.ts +2 -0
- package/dist/types/src/walkthrough/generate.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generated.d.ts +20 -0
- package/dist/types/src/walkthrough/generated.d.ts.map +1 -0
- package/dist/types/src/walkthrough/generated.test.d.ts +2 -0
- package/dist/types/src/walkthrough/generated.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/headings.d.ts +8 -0
- package/dist/types/src/walkthrough/headings.d.ts.map +1 -0
- package/dist/types/src/walkthrough/headings.test.d.ts +2 -0
- package/dist/types/src/walkthrough/headings.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/index.d.ts +9 -0
- package/dist/types/src/walkthrough/index.d.ts.map +1 -0
- package/dist/types/src/walkthrough/patch.d.ts +48 -0
- package/dist/types/src/walkthrough/patch.d.ts.map +1 -0
- package/dist/types/src/walkthrough/plan.d.ts +55 -0
- package/dist/types/src/walkthrough/plan.d.ts.map +1 -0
- package/dist/types/src/walkthrough/plan.test.d.ts +2 -0
- package/dist/types/src/walkthrough/plan.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/prompt.d.ts +33 -0
- package/dist/types/src/walkthrough/prompt.d.ts.map +1 -0
- package/dist/types/src/walkthrough/prompt.test.d.ts +2 -0
- package/dist/types/src/walkthrough/prompt.test.d.ts.map +1 -0
- package/dist/types/src/walkthrough/score.d.ts +43 -0
- package/dist/types/src/walkthrough/score.d.ts.map +1 -0
- package/dist/types/src/walkthrough/score.test.d.ts +2 -0
- package/dist/types/src/walkthrough/score.test.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/dx.config.ts +39 -0
- package/package.json +167 -48
- package/src/Extensions.ts +7 -0
- package/src/GitHubPlugin.ts +15 -0
- package/src/GitHubPlugin.workerd.test.ts +23 -0
- package/src/approval.test.ts +40 -0
- package/src/approval.ts +39 -0
- package/src/capabilities/app-graph-builder.ts +47 -0
- package/src/capabilities/connector.ts +95 -0
- package/src/capabilities/gen/browser.ts +82 -0
- package/src/capabilities/gen/node.ts +43 -0
- package/src/capabilities/gen/tauri.ts +82 -0
- package/src/capabilities/gen/workerd.ts +43 -0
- package/src/capabilities/index.ts +71 -0
- package/src/capabilities/link-resolver.ts +137 -0
- package/src/capabilities/markdown-extension.ts +146 -0
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/page-action.ts +32 -0
- package/src/capabilities/react-surface.ts +98 -0
- package/src/capabilities/schema.ts +16 -0
- package/src/capabilities/skill-definition.ts +14 -0
- package/src/cards/GitHubCard.stories.tsx +165 -0
- package/src/cards/GitHubCard.tsx +93 -0
- package/src/cards/PullRequestCard.tsx +23 -0
- package/src/cards/index.ts +6 -0
- package/src/components/CommentComposer/CommentComposer.tsx +109 -0
- package/src/components/CommentComposer/index.ts +5 -0
- package/src/components/PullRequestFiles/DiffStat.tsx +15 -0
- package/src/components/PullRequestFiles/FileTree.tsx +102 -0
- package/src/components/PullRequestFiles/PullRequestFiles.tsx +87 -0
- package/src/components/PullRequestFiles/files.test.ts +59 -0
- package/src/components/PullRequestFiles/files.ts +115 -0
- package/src/components/PullRequestFiles/index.ts +8 -0
- package/src/components/PullRequestOverview/ArtifactPill.tsx +82 -0
- package/src/components/PullRequestOverview/CheckRunList.test.ts +29 -0
- package/src/components/PullRequestOverview/CheckRunList.tsx +141 -0
- package/src/components/PullRequestOverview/PullRequestDetails.tsx +15 -0
- package/src/components/PullRequestOverview/PullRequestOverview.tsx +110 -0
- package/src/components/PullRequestOverview/RelatedCards.tsx +147 -0
- package/src/components/PullRequestOverview/index.ts +9 -0
- package/src/components/PullRequestStatus/PullRequestStatus.tsx +84 -0
- package/src/components/PullRequestStatus/index.ts +5 -0
- package/src/components/WalkthroughView/WalkthroughView.tsx +62 -0
- package/src/components/WalkthroughView/extensions.ts +53 -0
- package/src/components/WalkthroughView/index.ts +6 -0
- package/src/components/index.ts +6 -9
- package/src/constants.ts +12 -0
- package/src/containers/ImportPullRequestDialog/ImportPullRequestDialog.tsx +160 -0
- package/src/containers/ImportPullRequestDialog/index.ts +7 -0
- package/src/containers/PullRequestArticle/PullRequestArticle.tsx +573 -0
- package/src/containers/PullRequestArticle/failure.test.ts +42 -0
- package/src/containers/PullRequestArticle/failure.ts +16 -0
- package/src/containers/PullRequestArticle/index.ts +5 -0
- package/src/containers/PullRequestCardMenu/PullRequestCardMenu.tsx +134 -0
- package/src/containers/PullRequestCardMenu/index.ts +5 -0
- package/src/containers/PullRequestsArticle/PullRequestsArticle.tsx +361 -0
- package/src/containers/PullRequestsArticle/arrange.test.ts +122 -0
- package/src/containers/PullRequestsArticle/arrange.ts +245 -0
- package/src/containers/PullRequestsArticle/format.ts +31 -0
- package/src/containers/PullRequestsArticle/index.ts +5 -0
- package/src/containers/WalkthroughArticle/WalkthroughArticle.tsx +31 -0
- package/src/containers/WalkthroughArticle/index.ts +5 -0
- package/src/containers/index.ts +11 -0
- package/src/errors.ts +61 -0
- package/src/extensions/index.ts +6 -0
- package/src/extensions/links.test.ts +133 -0
- package/src/extensions/links.ts +91 -0
- package/src/extensions/references.test.ts +83 -0
- package/src/extensions/references.ts +100 -0
- package/src/github-link.ts +70 -0
- package/src/hooks/index.ts +6 -3
- package/src/hooks/useOpenObject.ts +48 -0
- package/src/hooks/usePullRequestChecks.ts +81 -0
- package/src/hooks/usePullRequestDiff.ts +57 -0
- package/src/hooks/usePullRequestFiles.ts +98 -0
- package/src/hooks/useSyncPullRequest.ts +51 -0
- package/src/index.ts +4 -6
- package/src/meta.ts +8 -13
- package/src/operations/add-pull-request-comment.ts +31 -0
- package/src/operations/add-pull-request-review-comment.ts +32 -0
- package/src/operations/generate-walkthrough.ts +124 -0
- package/src/operations/get-pull-request-diff.ts +37 -0
- package/src/operations/get-pull-request-status.ts +44 -0
- package/src/operations/get-repositories.ts +53 -0
- package/src/operations/import-pull-request-from-snapshot.ts +48 -0
- package/src/operations/import-pull-request.test.ts +151 -0
- package/src/operations/import-pull-request.ts +149 -0
- package/src/operations/index.ts +30 -0
- package/src/operations/materialize-target.ts +60 -0
- package/src/operations/pull-request.test.ts +120 -0
- package/src/operations/pull-request.ts +141 -0
- package/src/operations/refresh-pull-requests.ts +69 -0
- package/src/operations/refresh.test.ts +112 -0
- package/src/operations/refresh.ts +111 -0
- package/src/operations/submit-pull-request-approval.ts +41 -0
- package/src/operations/sync-pull-request.ts +34 -0
- package/src/operations/sync.test.ts +453 -0
- package/src/operations/sync.ts +807 -0
- package/src/plugin.test.ts +40 -0
- package/src/plugin.ts +37 -0
- package/src/pull-request-body.test.ts +61 -0
- package/src/pull-request-body.ts +144 -0
- package/src/pull-request.test.ts +67 -0
- package/src/pull-request.ts +80 -0
- package/src/services/github-api.ts +735 -0
- package/src/services/index.ts +5 -0
- package/src/skills/GitHubSkill.ts +46 -0
- package/src/skills/index.ts +5 -0
- package/src/stories/Generate.stories.tsx +152 -0
- package/src/stories/Links.stories.tsx +153 -0
- package/src/stories/PullRequestArticle.stories.tsx +107 -0
- package/src/stories/PullRequestFiles.stories.tsx +69 -0
- package/src/stories/PullRequestOverview.stories.tsx +114 -0
- package/src/stories/PullRequestsArticle.stories.tsx +170 -0
- package/src/stories/Walkthrough.stories.tsx +110 -0
- package/src/stories/github.test.ts +65 -0
- package/src/stories/github.ts +70 -0
- package/src/stories/walkthrough-fixture.ts +115 -0
- package/src/testing/fixtures.ts +99 -0
- package/src/testing/index.ts +7 -0
- package/src/testing/plugin.ts +25 -0
- package/src/testing/pull-request-13348.ts +104 -0
- package/src/testing/pull-request-13363.patch +2981 -0
- package/src/translations.ts +135 -63
- package/src/types/GitHubCapabilities.ts +27 -0
- package/src/types/GitHubEvents.ts +16 -0
- package/src/types/GitHubOperation.ts +397 -0
- package/src/types/PullRequestsView.ts +45 -0
- package/src/types/Walkthrough.test.ts +75 -0
- package/src/types/Walkthrough.ts +66 -0
- package/src/types/index.ts +8 -0
- package/src/vite-env.d.ts +15 -0
- package/src/walkthrough/fill.test.ts +337 -0
- package/src/walkthrough/fill.ts +246 -0
- package/src/walkthrough/generate.test.ts +219 -0
- package/src/walkthrough/generate.ts +248 -0
- package/src/walkthrough/generated.test.ts +70 -0
- package/src/walkthrough/generated.ts +70 -0
- package/src/walkthrough/headings.test.ts +40 -0
- package/src/walkthrough/headings.ts +39 -0
- package/src/walkthrough/index.ts +12 -0
- package/src/walkthrough/patch.ts +154 -0
- package/src/walkthrough/plan.test.ts +178 -0
- package/src/walkthrough/plan.ts +251 -0
- package/src/walkthrough/prompt.test.ts +100 -0
- package/src/walkthrough/prompt.ts +147 -0
- package/src/walkthrough/score.test.ts +272 -0
- package/src/walkthrough/score.ts +430 -0
- package/README.md +0 -15
- package/dist/lib/browser/chunk-S4MPSBA5.mjs +0 -21
- package/dist/lib/browser/chunk-S4MPSBA5.mjs.map +0 -7
- package/dist/lib/browser/index.css +0 -7
- package/dist/lib/browser/index.css.map +0 -7
- package/dist/lib/browser/index.mjs +0 -1535
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/meta.mjs +0 -11
- package/dist/lib/browser/meta.mjs.map +0 -7
- package/dist/types/src/GithubPlugin.d.ts +0 -4
- package/dist/types/src/GithubPlugin.d.ts.map +0 -1
- package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts +0 -4
- package/dist/types/src/components/EmbeddedMain/EmbeddedMain.d.ts.map +0 -1
- package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts +0 -9
- package/dist/types/src/components/EmbeddedMain/GfmPreview.d.ts.map +0 -1
- package/dist/types/src/components/EmbeddedMain/index.d.ts +0 -2
- package/dist/types/src/components/EmbeddedMain/index.d.ts.map +0 -1
- package/dist/types/src/components/ExportDialog.d.ts +0 -8
- package/dist/types/src/components/ExportDialog.d.ts.map +0 -1
- package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts +0 -3
- package/dist/types/src/components/GithubApiProviders/GitHubSettings.d.ts.map +0 -1
- package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts +0 -15
- package/dist/types/src/components/GithubApiProviders/OctokitProvider.d.ts.map +0 -1
- package/dist/types/src/components/GithubApiProviders/index.d.ts +0 -3
- package/dist/types/src/components/GithubApiProviders/index.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts +0 -6
- package/dist/types/src/components/GithubEchoResolverProviders/DocumentTreeItem.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts +0 -7
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverContext.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts +0 -6
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverDialog.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts +0 -16
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverProps.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts +0 -3
- package/dist/types/src/components/GithubEchoResolverProviders/ResolverTree.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts +0 -11
- package/dist/types/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts +0 -3
- package/dist/types/src/components/GithubEchoResolverProviders/index.d.ts.map +0 -1
- package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts +0 -6
- package/dist/types/src/components/GithubEchoResolverProviders/spaceResolvers.d.ts.map +0 -1
- package/dist/types/src/components/ImportDialog.d.ts +0 -7
- package/dist/types/src/components/ImportDialog.d.ts.map +0 -1
- package/dist/types/src/components/Issue.d.ts +0 -5
- package/dist/types/src/components/Issue.d.ts.map +0 -1
- package/dist/types/src/components/Loading/Loading.d.ts +0 -15
- package/dist/types/src/components/Loading/Loading.d.ts.map +0 -1
- package/dist/types/src/components/Loading/Loading.stories.d.ts +0 -40
- package/dist/types/src/components/Loading/Loading.stories.d.ts.map +0 -1
- package/dist/types/src/components/Loading/index.d.ts +0 -2
- package/dist/types/src/components/Loading/index.d.ts.map +0 -1
- package/dist/types/src/components/MarkdownActions.d.ts +0 -7
- package/dist/types/src/components/MarkdownActions.d.ts.map +0 -1
- package/dist/types/src/components/UrlDialog.d.ts +0 -6
- package/dist/types/src/components/UrlDialog.d.ts.map +0 -1
- package/dist/types/src/hooks/useDocGhId.d.ts +0 -6
- package/dist/types/src/hooks/useDocGhId.d.ts.map +0 -1
- package/dist/types/src/hooks/useGhIdFromUrl.d.ts +0 -2
- package/dist/types/src/hooks/useGhIdFromUrl.d.ts.map +0 -1
- package/dist/types/src/types.d.ts +0 -30
- package/dist/types/src/types.d.ts.map +0 -1
- package/src/GithubPlugin.tsx +0 -127
- package/src/components/EmbeddedMain/EmbeddedMain.tsx +0 -294
- package/src/components/EmbeddedMain/GfmPreview.tsx +0 -110
- package/src/components/EmbeddedMain/embedded.css +0 -3
- package/src/components/EmbeddedMain/index.ts +0 -5
- package/src/components/ExportDialog.tsx +0 -157
- package/src/components/GithubApiProviders/GitHubSettings.tsx +0 -72
- package/src/components/GithubApiProviders/OctokitProvider.tsx +0 -60
- package/src/components/GithubApiProviders/index.ts +0 -6
- package/src/components/GithubEchoResolverProviders/DocumentTreeItem.tsx +0 -26
- package/src/components/GithubEchoResolverProviders/ResolverContext.tsx +0 -137
- package/src/components/GithubEchoResolverProviders/ResolverDialog.tsx +0 -34
- package/src/components/GithubEchoResolverProviders/ResolverProps.ts +0 -23
- package/src/components/GithubEchoResolverProviders/ResolverTree.tsx +0 -86
- package/src/components/GithubEchoResolverProviders/SpacePickerTreeItem.tsx +0 -105
- package/src/components/GithubEchoResolverProviders/index.ts +0 -6
- package/src/components/GithubEchoResolverProviders/spaceResolvers.ts +0 -86
- package/src/components/ImportDialog.tsx +0 -72
- package/src/components/Issue.tsx +0 -62
- package/src/components/Loading/Loading.stories.tsx +0 -32
- package/src/components/Loading/Loading.tsx +0 -70
- package/src/components/Loading/index.ts +0 -5
- package/src/components/MarkdownActions.tsx +0 -136
- package/src/components/UrlDialog.tsx +0 -52
- package/src/hooks/useDocGhId.ts +0 -38
- package/src/hooks/useGhIdFromUrl.ts +0 -26
- package/src/types.ts +0 -51
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { Masonry } from '@dxos/react-ui-masonry';
|
|
8
|
+
import * as Button from '@dxos/react-ui/Button';
|
|
9
|
+
import * as Card from '@dxos/react-ui/Card';
|
|
10
|
+
import * as Hooks from '@dxos/react-ui/Hooks';
|
|
11
|
+
import * as Icon from '@dxos/react-ui/Icon';
|
|
12
|
+
import * as Layout from '@dxos/react-ui/Layout';
|
|
13
|
+
|
|
14
|
+
import { meta } from '#meta';
|
|
15
|
+
|
|
16
|
+
import { type ArtifactLink, type PullRequestBody } from '../../pull-request-body.ts';
|
|
17
|
+
import { ArtifactMedia, artifactIcon } from './ArtifactPill.tsx';
|
|
18
|
+
|
|
19
|
+
/** One tile of the related grid: a demo artifact, or a link out of the pull request. */
|
|
20
|
+
export type RelatedItem =
|
|
21
|
+
| { kind: 'artifact'; id: string; artifact: ArtifactLink }
|
|
22
|
+
| { kind: 'link'; id: string; icon: string; iconClassNames?: string; title: string; href?: string; detail?: string };
|
|
23
|
+
|
|
24
|
+
export type RelatedCardsProps = Pick<PullRequestBody, 'artifacts' | 'claudeCode' | 'previewUrl'>;
|
|
25
|
+
|
|
26
|
+
/** What {@link RelatedCards} would show; empty when the pull request links to nothing beyond its diff. */
|
|
27
|
+
export const useRelatedItems = ({ artifacts, claudeCode, previewUrl }: RelatedCardsProps): RelatedItem[] => {
|
|
28
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
29
|
+
return useMemo(() => {
|
|
30
|
+
const items: RelatedItem[] = artifacts.map((artifact) => ({ kind: 'artifact', id: artifact.url, artifact }));
|
|
31
|
+
if (previewUrl) {
|
|
32
|
+
items.push({
|
|
33
|
+
kind: 'link',
|
|
34
|
+
id: 'preview',
|
|
35
|
+
icon: 'ph--rocket-launch--regular',
|
|
36
|
+
iconClassNames: 'text-success-text',
|
|
37
|
+
title: t('preview-deployment.label'),
|
|
38
|
+
href: previewUrl,
|
|
39
|
+
detail: hostOf(previewUrl),
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
if (claudeCode) {
|
|
43
|
+
items.push({
|
|
44
|
+
kind: 'link',
|
|
45
|
+
id: 'claude',
|
|
46
|
+
icon: 'px--anthropic--regular',
|
|
47
|
+
iconClassNames: 'text-warning-text',
|
|
48
|
+
title: claudeCode.sessionUrl ? t('claude-session.label') : t('claude-generated.label'),
|
|
49
|
+
href: claudeCode.sessionUrl,
|
|
50
|
+
detail: claudeCode.sessionUrl?.split('/').at(-1),
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return items;
|
|
54
|
+
}, [artifacts, claudeCode, previewUrl, t]);
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* What the pull request points at beyond its diff, one card each — its demo media, the preview
|
|
59
|
+
* deployment built from it, and the session that wrote it — in the masonry grid related objects
|
|
60
|
+
* use everywhere else. Renders inside its host's scroller rather than owning one.
|
|
61
|
+
*/
|
|
62
|
+
export const RelatedCards = ({ items }: { items: readonly RelatedItem[] }) => (
|
|
63
|
+
<Masonry.Root Tile={RelatedCard} centered={false}>
|
|
64
|
+
<Masonry.Viewport items={items} getId={(item: RelatedItem) => item.id} scroll={false} />
|
|
65
|
+
</Masonry.Root>
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
const RelatedCard = ({ data: item }: { data: RelatedItem }) => {
|
|
69
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
70
|
+
if (item.kind === 'link') {
|
|
71
|
+
return (
|
|
72
|
+
<Card.Root data-testid={`pull-request.related.${item.id}`}>
|
|
73
|
+
<CardHeading icon={item.icon} iconClassNames={item.iconClassNames} title={item.title} href={item.href} />
|
|
74
|
+
{item.detail && (
|
|
75
|
+
<Card.Row>
|
|
76
|
+
<Card.Text variant='muted' truncate>
|
|
77
|
+
{item.detail}
|
|
78
|
+
</Card.Text>
|
|
79
|
+
</Card.Row>
|
|
80
|
+
)}
|
|
81
|
+
</Card.Root>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const { artifact } = item;
|
|
86
|
+
return (
|
|
87
|
+
<Card.Root data-testid='pull-request.related.artifact'>
|
|
88
|
+
<CardHeading
|
|
89
|
+
icon={artifactIcon[artifact.kind]}
|
|
90
|
+
title={artifact.label ?? t(`artifact-${artifact.kind}.label`)}
|
|
91
|
+
href={artifact.url}
|
|
92
|
+
/>
|
|
93
|
+
<Card.Row>
|
|
94
|
+
<Card.Text variant='muted' truncate>
|
|
95
|
+
{artifact.name}
|
|
96
|
+
</Card.Text>
|
|
97
|
+
</Card.Row>
|
|
98
|
+
{artifact.kind !== 'file' && (
|
|
99
|
+
<Card.Body>
|
|
100
|
+
{/* `col-span-3` spans the card's gutters, as `Card.Poster` does; the body is `display: contents`. */}
|
|
101
|
+
<ArtifactMedia artifact={artifact} classNames='col-span-3 aspect-video max-h-[200px] object-cover' />
|
|
102
|
+
</Card.Body>
|
|
103
|
+
)}
|
|
104
|
+
</Card.Root>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
const CardHeading = ({
|
|
109
|
+
icon,
|
|
110
|
+
iconClassNames,
|
|
111
|
+
title,
|
|
112
|
+
href,
|
|
113
|
+
}: {
|
|
114
|
+
icon: string;
|
|
115
|
+
iconClassNames?: string;
|
|
116
|
+
title: string;
|
|
117
|
+
href?: string;
|
|
118
|
+
}) => {
|
|
119
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
120
|
+
return (
|
|
121
|
+
<Card.Header>
|
|
122
|
+
<Layout.Block>
|
|
123
|
+
<Icon.Icon icon={icon} classNames={iconClassNames} />
|
|
124
|
+
</Layout.Block>
|
|
125
|
+
<Card.Title>{title}</Card.Title>
|
|
126
|
+
{href && (
|
|
127
|
+
<Layout.Block rail='end'>
|
|
128
|
+
<Button.Root
|
|
129
|
+
iconOnly
|
|
130
|
+
variant='ghost'
|
|
131
|
+
icon='ph--arrow-square-out--regular'
|
|
132
|
+
label={t('open-link.label')}
|
|
133
|
+
onClick={() => window.open(href, '_blank', 'noopener,noreferrer')}
|
|
134
|
+
/>
|
|
135
|
+
</Layout.Block>
|
|
136
|
+
)}
|
|
137
|
+
</Card.Header>
|
|
138
|
+
);
|
|
139
|
+
};
|
|
140
|
+
|
|
141
|
+
const hostOf = (url: string): string => {
|
|
142
|
+
try {
|
|
143
|
+
return new URL(url).host;
|
|
144
|
+
} catch {
|
|
145
|
+
return url;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import * as Hooks from '@dxos/react-ui/Hooks';
|
|
8
|
+
import * as Layout from '@dxos/react-ui/Layout';
|
|
9
|
+
import { type PullRequest } from '@dxos/types';
|
|
10
|
+
|
|
11
|
+
import { meta } from '#meta';
|
|
12
|
+
import { type GitHubOperation } from '#types';
|
|
13
|
+
|
|
14
|
+
const stateHue: Record<PullRequest.State, string> = {
|
|
15
|
+
open: 'green',
|
|
16
|
+
closed: 'red',
|
|
17
|
+
merged: 'purple',
|
|
18
|
+
draft: 'neutral',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const reviewHue: Record<GitHubOperation.ReviewState, string> = {
|
|
22
|
+
approved: 'green',
|
|
23
|
+
changes_requested: 'red',
|
|
24
|
+
none: 'neutral',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const ciHue: Record<GitHubOperation.CiState, string> = {
|
|
28
|
+
success: 'green',
|
|
29
|
+
failure: 'red',
|
|
30
|
+
pending: 'amber',
|
|
31
|
+
none: 'neutral',
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type PullRequestStatusProps = {
|
|
35
|
+
reference: string;
|
|
36
|
+
title?: string;
|
|
37
|
+
state?: PullRequest.State;
|
|
38
|
+
/** Absent until the live status has arrived; the review and CI tags read as unknown until then. */
|
|
39
|
+
review?: { state: GitHubOperation.ReviewState; approvals: number };
|
|
40
|
+
ci?: { state: GitHubOperation.CiState; checks: GitHubOperation.CheckCounts };
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** One line answering where the pull request stands: open or merged, approved or not, CI green or red. */
|
|
44
|
+
export const PullRequestStatus = ({ reference, title, state, review, ci }: PullRequestStatusProps) => {
|
|
45
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
46
|
+
return (
|
|
47
|
+
<Layout.Flex
|
|
48
|
+
align='center'
|
|
49
|
+
gap='sm'
|
|
50
|
+
role='status'
|
|
51
|
+
classNames='px-3 py-1.5 border-b border-separator-subtle text-sm min-w-0'
|
|
52
|
+
data-testid='pull-request.status'
|
|
53
|
+
>
|
|
54
|
+
<span className='dx-tag dx-tag-inline shrink-0' data-hue='neutral'>
|
|
55
|
+
{reference}
|
|
56
|
+
</span>
|
|
57
|
+
{title && <span className='truncate grow'>{title}</span>}
|
|
58
|
+
<Layout.Flex align='center' gap='sm' classNames='shrink-0 ml-auto'>
|
|
59
|
+
{state && (
|
|
60
|
+
<span className='dx-tag dx-tag-inline' data-hue={stateHue[state]} data-testid='pull-request.status.state'>
|
|
61
|
+
{t(`pull-request-state.${state}.label`)}
|
|
62
|
+
</span>
|
|
63
|
+
)}
|
|
64
|
+
<span
|
|
65
|
+
className='dx-tag dx-tag-inline'
|
|
66
|
+
data-hue={review ? reviewHue[review.state] : 'neutral'}
|
|
67
|
+
data-testid='pull-request.status.review'
|
|
68
|
+
>
|
|
69
|
+
{review
|
|
70
|
+
? t(`review-status.${review.state}.label`, { count: review.approvals })
|
|
71
|
+
: t('review-status.unknown.label')}
|
|
72
|
+
</span>
|
|
73
|
+
<span
|
|
74
|
+
className='dx-tag dx-tag-inline'
|
|
75
|
+
data-hue={ci ? ciHue[ci.state] : 'neutral'}
|
|
76
|
+
data-testid='pull-request.status.ci'
|
|
77
|
+
>
|
|
78
|
+
{ci ? t(`ci-status.${ci.state}.label`) : t('ci-status.unknown.label')}
|
|
79
|
+
{ci && ci.checks.total > 0 && ` ${ci.checks.passed}/${ci.checks.total}`}
|
|
80
|
+
</span>
|
|
81
|
+
</Layout.Flex>
|
|
82
|
+
</Layout.Flex>
|
|
83
|
+
);
|
|
84
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React, { useMemo } from 'react';
|
|
6
|
+
|
|
7
|
+
import { TextEditor } from '@dxos/react-ui-editor';
|
|
8
|
+
import * as Button from '@dxos/react-ui/Button';
|
|
9
|
+
import * as Hooks from '@dxos/react-ui/Hooks';
|
|
10
|
+
import * as Layout from '@dxos/react-ui/Layout';
|
|
11
|
+
import * as Status from '@dxos/react-ui/Status';
|
|
12
|
+
|
|
13
|
+
import { meta } from '#meta';
|
|
14
|
+
|
|
15
|
+
import { spaceHeadings } from '../../walkthrough/headings.ts';
|
|
16
|
+
import { type DiffDocumentOptions, diffDocumentExtensions } from './extensions.ts';
|
|
17
|
+
|
|
18
|
+
export type WalkthroughViewProps = Omit<DiffDocumentOptions, 'themeMode'> & {
|
|
19
|
+
/** The markdown document: prose, headings and ```diff fences. */
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* A read-only diff document: a whole walkthrough with its navigation rail, or one file's change as a
|
|
25
|
+
* single fence. Either way the chunks are the walkthrough's own, so a file reads the same in both.
|
|
26
|
+
*/
|
|
27
|
+
export const WalkthroughView = ({ value, sidebar, layout, onLineComment }: WalkthroughViewProps) => {
|
|
28
|
+
const themeMode = Hooks.useThemeMode();
|
|
29
|
+
const extensions = useMemo(
|
|
30
|
+
() => diffDocumentExtensions({ themeMode, sidebar, layout, onLineComment }),
|
|
31
|
+
[themeMode, sidebar, layout, onLineComment],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
// Walkthroughs stored before generation spaced their headings still read with a blank line above each.
|
|
35
|
+
const markdown = useMemo(() => spaceHeadings(value), [value]);
|
|
36
|
+
|
|
37
|
+
// Only CodeMirror's own scroller may scroll: it carries the editor's themed scrollbar, whereas an
|
|
38
|
+
// overflowing host would draw the browser's.
|
|
39
|
+
return (
|
|
40
|
+
<TextEditor value={markdown} extensions={extensions} focusable={false} classNames='dx-expand overflow-hidden' />
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type WalkthroughPlaceholderProps = {
|
|
45
|
+
generating?: boolean;
|
|
46
|
+
onGenerate: () => void;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
/** What the walkthrough tab shows before there is a walkthrough: the offer to write one, or its progress. */
|
|
50
|
+
export const WalkthroughPlaceholder = ({ generating, onGenerate }: WalkthroughPlaceholderProps) => {
|
|
51
|
+
const { t } = Hooks.useTranslation(meta.profile.key);
|
|
52
|
+
return (
|
|
53
|
+
<Layout.Flex column center gap='md' classNames='dx-expand'>
|
|
54
|
+
<Status.Empty>{t(generating ? 'walkthrough-generating.message' : 'no-walkthrough.message')}</Status.Empty>
|
|
55
|
+
{!generating && (
|
|
56
|
+
<Button.Root variant='primary' onClick={onGenerate}>
|
|
57
|
+
{t('generate-walkthrough.label')}
|
|
58
|
+
</Button.Root>
|
|
59
|
+
)}
|
|
60
|
+
</Layout.Flex>
|
|
61
|
+
);
|
|
62
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Extension } from '@codemirror/state';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
type DiffLayout,
|
|
9
|
+
type DiffLineTarget,
|
|
10
|
+
type ThemeExtensionsOptions,
|
|
11
|
+
createBasicExtensions,
|
|
12
|
+
createMarkdownExtensions,
|
|
13
|
+
createThemeExtensions,
|
|
14
|
+
decorateMarkdown,
|
|
15
|
+
diffBlocks,
|
|
16
|
+
scrollbarAutohide,
|
|
17
|
+
walkthroughSidebar,
|
|
18
|
+
walkthroughTheme,
|
|
19
|
+
} from '@dxos/ui-editor';
|
|
20
|
+
import { type ThemeMode } from '@dxos/ui-types';
|
|
21
|
+
|
|
22
|
+
/** A definite content width, which the diff chunks cap themselves against. */
|
|
23
|
+
const slots: ThemeExtensionsOptions['slots'] = {
|
|
24
|
+
content: { className: 'dx-container-type-inline-size w-full mx-auto! max-w-[min(72rem,100%-3rem)] py-3!' },
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type DiffDocumentOptions = {
|
|
28
|
+
themeMode: ThemeMode;
|
|
29
|
+
/** The navigation rail beside the document; `none` for a document that is a single file. */
|
|
30
|
+
sidebar?: 'full' | 'stats' | 'none';
|
|
31
|
+
layout?: DiffLayout;
|
|
32
|
+
onLineComment?: (target: DiffLineTarget, anchor: HTMLElement) => void;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* A read-only markdown document whose ```diff fences render as diff chunks — the one reading surface
|
|
37
|
+
* both a walkthrough and a single changed file are shown in, so the two cannot drift apart.
|
|
38
|
+
*/
|
|
39
|
+
export const diffDocumentExtensions = ({
|
|
40
|
+
themeMode,
|
|
41
|
+
sidebar = 'none',
|
|
42
|
+
layout,
|
|
43
|
+
onLineComment,
|
|
44
|
+
}: DiffDocumentOptions): Extension => [
|
|
45
|
+
createThemeExtensions({ themeMode, slots }),
|
|
46
|
+
createBasicExtensions({ lineWrapping: true, readOnly: true }),
|
|
47
|
+
createMarkdownExtensions(),
|
|
48
|
+
decorateMarkdown(),
|
|
49
|
+
scrollbarAutohide(),
|
|
50
|
+
walkthroughTheme(),
|
|
51
|
+
diffBlocks({ layout, ...(onLineComment ? { onLineComment } : {}) }),
|
|
52
|
+
sidebar === 'none' ? [] : walkthroughSidebar({ variant: sidebar }),
|
|
53
|
+
];
|
package/src/components/index.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
//
|
|
2
|
-
// Copyright
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './Issue';
|
|
11
|
-
export * from './MarkdownActions';
|
|
12
|
-
export * from './UrlDialog';
|
|
5
|
+
export * from './CommentComposer/index.ts';
|
|
6
|
+
export * from './PullRequestFiles/index.ts';
|
|
7
|
+
export * from './PullRequestOverview/index.ts';
|
|
8
|
+
export * from './PullRequestStatus/index.ts';
|
|
9
|
+
export * from './WalkthroughView/index.ts';
|
package/src/constants.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
/** Source string used in `AccessToken.source` and `Obj.Meta.keys[i].source` for GitHub. */
|
|
6
|
+
export const GITHUB_SOURCE = 'github.com';
|
|
7
|
+
|
|
8
|
+
/** Connector id matching the `ConnectorEntry.id` contributed by this plugin. */
|
|
9
|
+
export const GITHUB_PROVIDER_ID = 'github';
|
|
10
|
+
|
|
11
|
+
/** Base URL for the GitHub REST API. */
|
|
12
|
+
export const GITHUB_API_BASE = 'https://api.github.com';
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Schema from 'effect/Schema';
|
|
6
|
+
import React, { useCallback } from 'react';
|
|
7
|
+
|
|
8
|
+
import * as Hooks from '@dxos/app-framework/Hooks';
|
|
9
|
+
import * as ToolkitHooks from '@dxos/app-toolkit/Hooks';
|
|
10
|
+
import * as LayoutOperation from '@dxos/app-toolkit/LayoutOperation';
|
|
11
|
+
import { log } from '@dxos/log';
|
|
12
|
+
import { Form } from '@dxos/react-ui-form';
|
|
13
|
+
import * as Dialog from '@dxos/react-ui/Dialog';
|
|
14
|
+
import * as UiHooks from '@dxos/react-ui/Hooks';
|
|
15
|
+
import * as SystemButton from '@dxos/react-ui/SystemButton';
|
|
16
|
+
|
|
17
|
+
import { meta } from '#meta';
|
|
18
|
+
import { GitHubOperation } from '#types';
|
|
19
|
+
|
|
20
|
+
import { GitHubRepoInaccessibleError } from '../../errors.ts';
|
|
21
|
+
import { parsePullRequestReference } from '../../extensions/index.ts';
|
|
22
|
+
import { useOpenObject } from '../../hooks/index.ts';
|
|
23
|
+
import { GitHubApi } from '../../services/index.ts';
|
|
24
|
+
|
|
25
|
+
const ImportPullRequestForm = Schema.Struct({
|
|
26
|
+
reference: Schema.String.pipe(
|
|
27
|
+
// Validated here as well as in the operation: a typo should be answered by the field the user is
|
|
28
|
+
// looking at, not by a toast after a round trip to GitHub.
|
|
29
|
+
Schema.check(
|
|
30
|
+
Schema.makeFilter(
|
|
31
|
+
(value: string) =>
|
|
32
|
+
parsePullRequestReference(value) !== undefined || 'Paste a pull request link or owner/repo#number.',
|
|
33
|
+
),
|
|
34
|
+
),
|
|
35
|
+
Schema.annotate({ title: 'Pull request', description: 'https://github.com/owner/repo/pull/123 or owner/repo#123' }),
|
|
36
|
+
),
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
type ImportPullRequestForm = Schema.Schema.Type<typeof ImportPullRequestForm>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The status `GitHubRepoInaccessibleError` recorded, for the case the HTTP failure has already been
|
|
43
|
+
* folded into it and `GitHubApi.responseStatus` no longer sees a response.
|
|
44
|
+
*/
|
|
45
|
+
const readStatus = (error: unknown): number | undefined => {
|
|
46
|
+
if (!GitHubRepoInaccessibleError.is(error)) {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
const status = error.context.status;
|
|
50
|
+
return typeof status === 'number' ? status : undefined;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Names the failure the user can act on. A rejected credential and a repository the connection
|
|
55
|
+
* cannot see both read as "not found" from the API, but only the first is fixed by reconnecting —
|
|
56
|
+
* and a space with no connection at all is fixed by making one.
|
|
57
|
+
*/
|
|
58
|
+
const importFailureKey = (error: unknown): string => {
|
|
59
|
+
if (!GitHubRepoInaccessibleError.is(error)) {
|
|
60
|
+
return 'import-pull-request-failed.title';
|
|
61
|
+
}
|
|
62
|
+
if (error.context.tokenStatus === 401) {
|
|
63
|
+
return 'import-pull-request-token-rejected.title';
|
|
64
|
+
}
|
|
65
|
+
return error.context.connected === true
|
|
66
|
+
? 'import-pull-request-inaccessible.title'
|
|
67
|
+
: 'import-pull-request-not-connected.title';
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Imports a pull request the user names, into the space they are working in, and opens it.
|
|
72
|
+
*
|
|
73
|
+
* The space is the active one rather than a chosen one: the command is reached from wherever the
|
|
74
|
+
* user already is, and a picker would ask a question they have already answered.
|
|
75
|
+
*/
|
|
76
|
+
export const ImportPullRequestDialog = () => {
|
|
77
|
+
const { t } = UiHooks.useTranslation(meta.profile.key);
|
|
78
|
+
const { invokePromise } = Hooks.useOperationInvoker();
|
|
79
|
+
const openObject = useOpenObject();
|
|
80
|
+
const space = ToolkitHooks.useActiveSpace();
|
|
81
|
+
|
|
82
|
+
const handleCancel = useCallback(async () => {
|
|
83
|
+
await invokePromise(LayoutOperation.UpdateDialog, { state: false });
|
|
84
|
+
}, [invokePromise]);
|
|
85
|
+
|
|
86
|
+
const handleSave = useCallback(
|
|
87
|
+
async ({ reference }: ImportPullRequestForm) => {
|
|
88
|
+
if (!space) {
|
|
89
|
+
// The command is reachable from the root, which has no space of its own; saying so beats a
|
|
90
|
+
// button that appears to do nothing.
|
|
91
|
+
await invokePromise(LayoutOperation.AddToast, {
|
|
92
|
+
id: `${meta.profile.key}.import-pull-request`,
|
|
93
|
+
icon: 'ph--warning--regular',
|
|
94
|
+
title: ['import-pull-request-no-space.title', { ns: meta.profile.key }],
|
|
95
|
+
});
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
const { data, error } = await invokePromise(
|
|
100
|
+
GitHubOperation.ImportPullRequest,
|
|
101
|
+
{ reference: reference.trim() },
|
|
102
|
+
{ spaceId: space.db.spaceId },
|
|
103
|
+
);
|
|
104
|
+
|
|
105
|
+
const pullRequest = data?.pullRequest.target;
|
|
106
|
+
if (error || !pullRequest) {
|
|
107
|
+
const status = GitHubApi.responseStatus(error) ?? readStatus(error);
|
|
108
|
+
// A minified build serialises the invoker's error as a bare, headerless stack, so the name and
|
|
109
|
+
// the HTTP status it carries are logged explicitly — without them a feedback bundle names the
|
|
110
|
+
// failure without saying what it was.
|
|
111
|
+
log.warn('pull request import failed', { reference, errorName: error?.name, status, err: error });
|
|
112
|
+
await invokePromise(LayoutOperation.AddToast, {
|
|
113
|
+
id: `${meta.profile.key}.import-pull-request`,
|
|
114
|
+
icon: 'ph--warning--regular',
|
|
115
|
+
title: [importFailureKey(error), { ns: meta.profile.key }],
|
|
116
|
+
// The status is what separates a reference the user should re-check from a connection they
|
|
117
|
+
// should repair, and it is otherwise visible only in the logs.
|
|
118
|
+
description: status ? `${reference} — HTTP ${status}` : reference,
|
|
119
|
+
});
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// Closed only on success: a failed import keeps the reference the user typed, which is the
|
|
124
|
+
// thing they would otherwise have to find again.
|
|
125
|
+
await invokePromise(LayoutOperation.UpdateDialog, { state: false });
|
|
126
|
+
await openObject(pullRequest);
|
|
127
|
+
},
|
|
128
|
+
[invokePromise, openObject, space],
|
|
129
|
+
);
|
|
130
|
+
|
|
131
|
+
return (
|
|
132
|
+
<Dialog.Content>
|
|
133
|
+
{/* The form spans the dialog, so its actions sit in the footer while reading the form's context. */}
|
|
134
|
+
<Form.Root
|
|
135
|
+
autoFocus
|
|
136
|
+
schema={ImportPullRequestForm}
|
|
137
|
+
defaultValues={{ reference: '' }}
|
|
138
|
+
onSave={handleSave}
|
|
139
|
+
onCancel={handleCancel}
|
|
140
|
+
>
|
|
141
|
+
<Dialog.Header>
|
|
142
|
+
<Dialog.Title>{t('import-pull-request-dialog.title')}</Dialog.Title>
|
|
143
|
+
<Dialog.CloseTrigger asChild>
|
|
144
|
+
<SystemButton.Close />
|
|
145
|
+
</Dialog.CloseTrigger>
|
|
146
|
+
</Dialog.Header>
|
|
147
|
+
<Dialog.Body>
|
|
148
|
+
<Form.Content>
|
|
149
|
+
<Form.Fields />
|
|
150
|
+
</Form.Content>
|
|
151
|
+
</Dialog.Body>
|
|
152
|
+
<Dialog.Footer>
|
|
153
|
+
<Form.Actions submitLabel={t('import-pull-request-submit.label')} />
|
|
154
|
+
</Dialog.Footer>
|
|
155
|
+
</Form.Root>
|
|
156
|
+
</Dialog.Content>
|
|
157
|
+
);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
ImportPullRequestDialog.displayName = 'ImportPullRequestDialog';
|