paperclip-github-plugin 0.9.10 → 0.9.11

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 CHANGED
@@ -35,7 +35,7 @@ The plugin adds a full in-host workflow instead of a one-off import script:
35
35
  - saved sync diagnostics that let operators inspect the latest per-issue failures, raw errors, and suggested next steps
36
36
  - a project sidebar item that opens a live project-scoped Pull Requests page for the mapped repository and can show the open PR count through a lightweight badge read
37
37
  - manual sync actions from global, project, and issue surfaces
38
- - a GitHub detail tab on synced Paperclip issues that includes GitHub-marked action buttons plus the GitHub issue creator with avatar, and lets operators manually link or unlink a Paperclip issue from a GitHub issue or pull request
38
+ - a GitHub detail tab on synced Paperclip issues that includes GitHub-marked action buttons plus the GitHub issue creator with avatar, lets operators manually link or unlink a Paperclip issue from a GitHub issue or pull request, and shows compact troubleshooting details if the host cannot provide a resolvable issue context
39
39
  - GitHub link annotations on sync-generated status transition comments when the host supports comment annotations
40
40
 
41
41
  ## How it works
package/dist/manifest.js CHANGED
@@ -642,7 +642,7 @@ var PULL_REQUEST_ASSET_API_ROUTE_URL_PATH = `/api/plugins/${GITHUB_SYNC_PLUGIN_I
642
642
  var require2 = createRequire(import.meta.url);
643
643
  var packageJson = require2("../package.json");
644
644
  var SCHEDULE_TICK_CRON = "* * * * *";
645
- var MANIFEST_VERSION = "0.9.10"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
645
+ var MANIFEST_VERSION = "0.9.11"?.trim() || typeof packageJson.version === "string" && packageJson.version.trim() || process.env.npm_package_version?.trim() || "0.0.0-dev";
646
646
  var manifest = {
647
647
  id: GITHUB_SYNC_PLUGIN_ID,
648
648
  apiVersion: 1,
package/dist/ui/index.js CHANGED
@@ -11996,7 +11996,7 @@ var urlAttributes = {
11996
11996
  ]
11997
11997
  };
11998
11998
 
11999
- // node_modules/.pnpm/react-markdown@10.1.0_@types+react@19.2.14_react@19.2.6/node_modules/react-markdown/lib/index.js
11999
+ // node_modules/.pnpm/react-markdown@10.1.0_@types+react@19.2.15_react@19.2.6/node_modules/react-markdown/lib/index.js
12000
12000
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
12001
12001
  import { useEffect, useState } from "react";
12002
12002
 
@@ -19152,7 +19152,7 @@ function isUint8Array2(value) {
19152
19152
  );
19153
19153
  }
19154
19154
 
19155
- // node_modules/.pnpm/react-markdown@10.1.0_@types+react@19.2.14_react@19.2.6/node_modules/react-markdown/lib/index.js
19155
+ // node_modules/.pnpm/react-markdown@10.1.0_@types+react@19.2.15_react@19.2.6/node_modules/react-markdown/lib/index.js
19156
19156
  var changelog = "https://github.com/remarkjs/react-markdown/blob/main/changelog.md";
19157
19157
  var emptyPlugins = [];
19158
19158
  var emptyRemarkRehypeOptions = { allowDangerousHtml: true };
@@ -26785,6 +26785,15 @@ var EXTENSION_SURFACE_STYLES = `
26785
26785
  line-height: 1.5;
26786
26786
  }
26787
26787
 
26788
+ .ghsync-extension-note p,
26789
+ .ghsync-extension-diagnostics {
26790
+ margin: 8px 0 0;
26791
+ }
26792
+
26793
+ .ghsync-extension-diagnostics {
26794
+ padding-left: 18px;
26795
+ }
26796
+
26788
26797
  .ghsync-issue-detail {
26789
26798
  display: grid;
26790
26799
  gap: 16px;
@@ -28878,7 +28887,7 @@ function getIssueIdentifierFromLocation(pathname) {
28878
28887
  }
28879
28888
  function useResolvedIssueId(params) {
28880
28889
  const pathname = typeof window === "undefined" ? "" : window.location.pathname;
28881
- const issueIdentifier = params.entityType === "issue" ? getIssueIdentifierFromLocation(pathname) : null;
28890
+ const issueIdentifier = getIssueIdentifierFromLocation(pathname);
28882
28891
  const resolution = usePluginData("issue.resolveByIdentifier", {
28883
28892
  ...params.companyId && issueIdentifier ? { companyId: params.companyId } : {},
28884
28893
  ...params.projectId && issueIdentifier ? { projectId: params.projectId } : {},
@@ -28895,16 +28904,19 @@ function useResolvedIssueId(params) {
28895
28904
  }
28896
28905
  }, [issueIdentifier, params.companyId, params.projectId, resolution.refresh]);
28897
28906
  if (issueIdentifier) {
28907
+ const contextIssueId = params.entityId && params.entityId !== issueIdentifier ? params.entityId : null;
28898
28908
  return {
28899
- issueId: resolution.data?.issueId ?? null,
28909
+ issueId: resolution.data?.issueId ?? contextIssueId,
28900
28910
  issueIdentifier,
28901
- loading: resolution.loading && !resolution.data
28911
+ loading: resolution.loading && !resolution.data && !contextIssueId,
28912
+ errorMessage: resolution.error?.message ?? null
28902
28913
  };
28903
28914
  }
28904
28915
  return {
28905
- issueId: params.entityId ?? null,
28916
+ issueId: params.entityType === "issue" || !params.entityType ? params.entityId ?? null : null,
28906
28917
  issueIdentifier: null,
28907
- loading: false
28918
+ loading: false,
28919
+ errorMessage: null
28908
28920
  };
28909
28921
  }
28910
28922
  function formatSyncProgressRepository(repositoryUrl) {
@@ -34898,8 +34910,7 @@ function GitHubSyncEntityToolbarButton() {
34898
34910
  }
34899
34911
  function GitHubSyncIssueDetailTabContent(props) {
34900
34912
  const details = usePluginData("issue.githubDetails", {
34901
- ...props.companyId ? { companyId: props.companyId } : {},
34902
- ...props.issueId ? { issueId: props.issueId } : {}
34913
+ ...props.companyId && props.issueId ? { companyId: props.companyId, issueId: props.issueId } : {}
34903
34914
  });
34904
34915
  const issueDetails = details.data?.paperclipIssueId === props.issueId ? details.data : null;
34905
34916
  const detailTabState = resolveGitHubIssueDetailTabState({
@@ -34907,7 +34918,10 @@ function GitHubSyncIssueDetailTabContent(props) {
34907
34918
  detailsLoading: details.loading,
34908
34919
  detailsError: Boolean(details.error),
34909
34920
  issueDetails,
34910
- canLinkManually: Boolean(props.companyId && props.issueId)
34921
+ canLinkManually: Boolean(props.companyId && props.issueId),
34922
+ issueIdentifier: props.issueIdentifier,
34923
+ issueResolutionError: Boolean(props.issueResolutionErrorMessage),
34924
+ expectedIssueContext: Boolean(props.expectedIssueContext)
34911
34925
  });
34912
34926
  const issueSyncButton = useGitHubSyncButtonController({
34913
34927
  companyId: props.companyId,
@@ -35014,7 +35028,34 @@ function GitHubSyncIssueDetailTabContent(props) {
35014
35028
  return /* @__PURE__ */ jsxs2("section", { className: "ghsync-issue-detail", style: props.themeVars, children: [
35015
35029
  /* @__PURE__ */ jsx2("style", { children: EXTENSION_SURFACE_STYLES }),
35016
35030
  detailTabState === "loading" ? /* @__PURE__ */ jsx2("p", { className: "ghsync-extension-empty", children: "Loading GitHub sync details\u2026" }) : null,
35017
- detailTabState === "error" && details.error ? /* @__PURE__ */ jsx2("p", { className: "ghsync-extension-empty", children: details.error.message }) : null,
35031
+ detailTabState === "error" ? /* @__PURE__ */ jsxs2("div", { className: "ghsync-issue-detail__intro", children: [
35032
+ /* @__PURE__ */ jsx2("div", { className: "ghsync-extension-heading", children: /* @__PURE__ */ jsxs2("div", { className: "ghsync-issue-detail__headline", children: [
35033
+ /* @__PURE__ */ jsx2("h4", { children: "GitHub sync details unavailable" }),
35034
+ /* @__PURE__ */ jsx2("p", { children: details.error?.message ?? props.issueResolutionErrorMessage ?? "GitHub Sync could not load this issue detail view." })
35035
+ ] }) }),
35036
+ /* @__PURE__ */ jsx2(
35037
+ GitHubIssueDetailTroubleshooting,
35038
+ {
35039
+ companyId: props.companyId,
35040
+ issueId: props.issueId,
35041
+ issueIdentifier: props.issueIdentifier
35042
+ }
35043
+ )
35044
+ ] }) : null,
35045
+ detailTabState === "unresolved" ? /* @__PURE__ */ jsxs2("div", { className: "ghsync-issue-detail__intro", children: [
35046
+ /* @__PURE__ */ jsx2("div", { className: "ghsync-extension-heading", children: /* @__PURE__ */ jsxs2("div", { className: "ghsync-issue-detail__headline", children: [
35047
+ /* @__PURE__ */ jsx2("h4", { children: "GitHub sync details unavailable" }),
35048
+ /* @__PURE__ */ jsx2("p", { children: "GitHub Sync could not resolve the current Paperclip issue context." })
35049
+ ] }) }),
35050
+ /* @__PURE__ */ jsx2(
35051
+ GitHubIssueDetailTroubleshooting,
35052
+ {
35053
+ companyId: props.companyId,
35054
+ issueId: props.issueId,
35055
+ issueIdentifier: props.issueIdentifier
35056
+ }
35057
+ )
35058
+ ] }) : null,
35018
35059
  detailTabState === "unlinked" ? /* @__PURE__ */ jsx2("div", { className: "ghsync-issue-detail__intro", children: /* @__PURE__ */ jsxs2("div", { className: "ghsync-extension-heading", children: [
35019
35060
  /* @__PURE__ */ jsxs2("div", { className: "ghsync-issue-detail__headline", children: [
35020
35061
  /* @__PURE__ */ jsx2("h4", { children: "GitHub link" }),
@@ -35254,16 +35295,59 @@ function resolveGitHubIssueDetailTabState(params) {
35254
35295
  if (params.issueDetails) {
35255
35296
  return "ready";
35256
35297
  }
35257
- if (params.detailsError) {
35298
+ if (params.detailsError || params.issueResolutionError) {
35258
35299
  return "error";
35259
35300
  }
35260
35301
  if (params.canLinkManually) {
35261
35302
  return "unlinked";
35262
35303
  }
35304
+ if (params.issueIdentifier || params.expectedIssueContext) {
35305
+ return "unresolved";
35306
+ }
35263
35307
  return "hidden";
35264
35308
  }
35265
- function GitHubSyncIssueTaskDetailView() {
35266
- const context = useHostContext();
35309
+ function getContextStringValue(context, key) {
35310
+ const value = context?.[key];
35311
+ return typeof value === "string" && value.trim() ? value.trim() : null;
35312
+ }
35313
+ function resolveGitHubIssueTaskDetailContext(params) {
35314
+ const companyId = getContextStringValue(params.slotContext, "companyId") ?? getContextStringValue(params.hostContext, "companyId");
35315
+ const projectId = getContextStringValue(params.slotContext, "projectId") ?? getContextStringValue(params.hostContext, "projectId");
35316
+ const entityId = getContextStringValue(params.slotContext, "entityId") ?? getContextStringValue(params.hostContext, "entityId");
35317
+ const entityType = getContextStringValue(params.slotContext, "entityType") ?? getContextStringValue(params.hostContext, "entityType");
35318
+ return {
35319
+ ...companyId ? { companyId } : {},
35320
+ ...projectId ? { projectId } : {},
35321
+ ...entityId ? { entityId } : {},
35322
+ ...entityType ? { entityType } : {}
35323
+ };
35324
+ }
35325
+ function shouldExpectGitHubIssueTaskDetailContext(params) {
35326
+ if (params.issueIdentifier) {
35327
+ return true;
35328
+ }
35329
+ if (params.entityType === "issue") {
35330
+ return true;
35331
+ }
35332
+ return !params.entityType && Boolean(params.entityId);
35333
+ }
35334
+ function GitHubIssueDetailTroubleshooting(props) {
35335
+ return /* @__PURE__ */ jsxs2("div", { className: "ghsync-extension-note", children: [
35336
+ /* @__PURE__ */ jsx2("strong", { children: "Troubleshooting" }),
35337
+ /* @__PURE__ */ jsxs2("ul", { className: "ghsync-extension-diagnostics", children: [
35338
+ /* @__PURE__ */ jsx2("li", { children: props.companyId ? `Company context: ${props.companyId}` : "Missing company context from the host slot." }),
35339
+ /* @__PURE__ */ jsx2("li", { children: props.issueId ? `Issue id: ${props.issueId}` : "Missing canonical Paperclip issue id." }),
35340
+ props.issueIdentifier ? /* @__PURE__ */ jsx2("li", { children: `Route issue identifier: ${props.issueIdentifier}` }) : null
35341
+ ] }),
35342
+ /* @__PURE__ */ jsx2("p", { children: "Refresh the issue page, then reopen this detail view. If this remains unresolved, include these values when reporting the GitHub Sync plugin issue." })
35343
+ ] });
35344
+ }
35345
+ function GitHubSyncIssueTaskDetailView(props) {
35346
+ const hostContext = useHostContext();
35347
+ const context = resolveGitHubIssueTaskDetailContext({
35348
+ slotContext: props?.context ?? null,
35349
+ hostContext
35350
+ });
35267
35351
  const themeMode = useResolvedThemeMode();
35268
35352
  const theme = themeMode === "light" ? LIGHT_PALETTE : DARK_PALETTE;
35269
35353
  const themeVars = buildThemeVars(theme, themeMode);
@@ -35273,13 +35357,21 @@ function GitHubSyncIssueTaskDetailView() {
35273
35357
  entityId: context.entityId,
35274
35358
  entityType: context.entityType
35275
35359
  });
35360
+ const expectedIssueContext = shouldExpectGitHubIssueTaskDetailContext({
35361
+ entityId: context.entityId,
35362
+ entityType: context.entityType,
35363
+ issueIdentifier: resolvedIssue.issueIdentifier
35364
+ });
35276
35365
  const detailKey = `${context.companyId ?? "company-none"}:${resolvedIssue.issueIdentifier ?? context.entityId ?? "issue-none"}`;
35277
35366
  return /* @__PURE__ */ jsx2(
35278
35367
  GitHubSyncIssueDetailTabContent,
35279
35368
  {
35280
35369
  companyId: context.companyId,
35281
35370
  issueId: resolvedIssue.issueId,
35371
+ issueIdentifier: resolvedIssue.issueIdentifier,
35372
+ expectedIssueContext,
35282
35373
  loadingIssueId: resolvedIssue.loading,
35374
+ issueResolutionErrorMessage: resolvedIssue.errorMessage,
35283
35375
  themeVars
35284
35376
  },
35285
35377
  detailKey
@@ -35340,11 +35432,13 @@ export {
35340
35432
  index_default as default,
35341
35433
  patchPluginConfig,
35342
35434
  resolveGitHubIssueDetailTabState,
35435
+ resolveGitHubIssueTaskDetailContext,
35343
35436
  resolveGitHubTokenSecretRefForPropagation,
35344
35437
  resolveOrCreateProject,
35345
35438
  resolvePreviewPersonLabels,
35346
35439
  resolveSavedTokenUiState,
35347
35440
  resolveToolbarButtonState,
35441
+ shouldExpectGitHubIssueTaskDetailContext,
35348
35442
  syncGitHubTokenPropagationForAgents
35349
35443
  };
35350
35444
  //# sourceMappingURL=index.js.map