Skip to content

feat(issue-pane): rework the Jira panel and render self-hosted Jira bodies - #64

Merged
nplez1 merged 1 commit into
nplez1/mainfrom
nplez1/JIRA-Issues
Oct 9, 2026
Merged

nplez1 merged 1 commit into
nplez1/mainfrom
nplez1/JIRA-Issues

Conversation

@nplez1

@nplez1 nplez1 commented Oct 9, 2026

Copy link
Copy Markdown
Owner

ELI5

The right-hand "Issue" tab shows the Jira (or GitHub/Linear) issue a workspace is linked to. This PR makes that tab and the panel behind it actually usable: the icon identifies the provider, the issue number is the link, there are unlink/re-link actions, the comment box works like Slack's, and — the big one — Jira issues hosted on your own server finally render their description instead of a wall of {code} and {panel} braces.

What Changed

Before

  • The Issue tab used the same generic dot icon whatever the provider.
  • The panel header carried a full-width "Open in Jira" button; there was no way to unlink an issue or point the workspace at a different one from the panel.
  • The Jira comment box was a bare textarea with a labelled "Comment" button.
  • On a self-hosted Jira (Server/DC), descriptions and comments arrived as Jira wiki markup — {code}, {panel}, {*} — and were rendered as Markdown, so the macros appeared literally in the panel.
  • Creating a workspace from a Jira task could leave it with no link at all and no explanation.

After

  • The Issue tab shows the provider's own mark; the pane header's issue number is the clickable link (routed through Orca's Link Routing, with the Shift-modifier escape hatch), and a three-dot menu offers Unlink issue from workspace and Link another issue for Jira, GitHub and Linear.
  • The Jira comment box is the shared composer: a rounded bubble, formatting controls (bold / italic / code / quote / list) and a circular plane-only send button, with ⌘/Ctrl+Enter to post.
  • Self-hosted Jira bodies render from Jira's own HTML (renderedFields.description, renderedBody), with inline images pointed at Orca's cached attachments and root-relative links made absolute. Cloud keeps the ADF path.
  • The formatting controls produce formatting the site actually renders: a Jira comment typed as Markdown is converted to wiki markup for Server/DC and to ADF for Cloud at submit time.

Mechanism

  • IssuePaneHeader is presentational and now takes the provider's mark from one shared table (providerIconComponent), an onOpenIssue handler and the link actions; useLinkedIssuePaneActions owns them for the active workspace.
  • Unlinking reuses the workspace dialog's own rule: buildIssueUnlinkUpdates was extracted from worktree-meta-updates.ts and the dialog's empty-Issue-field branch now calls it too, so the panel and the dialog cannot drift. It empties the GitHub number slot, the Linear key when one is held, and a created-from issue item with its reading context — and leaves a PR/MR item alone. A folder workspace, which cannot store a link edit, gets the menu disabled with the reason visible rather than an action that silently does nothing.
  • The composer is a new provider-agnostic CommentComposer; applyMarkdownAction and the deferred caret-restore timer moved to lib/ and the existing PR-comment composer now uses both.
  • renderedJiraHtmlToBody parses Jira's HTML with parse5 (new declared dependency, bundled into the main bundle) and rewrites attachment images and relative links.
  • markdownCommentBody converts a composer body per site; the request carries bodyFormat: 'plain' | 'markdown' so only the composer's Markdown is reinterpreted.

Fix in the same area: a Jira task's link was silently dropped at composer-seed time when the issue's project field disagreed with its key — the Tasks-page path derived the project key from project.key while the identity check derives it from the key prefix, so the pair failed to match and the item was discarded without a toast. It now derives the key the same way the dialog does, and refuses loudly (the existing toast) when the URL is not a Jira issue URL or names a different key.

Why

  • Reuse over reimplementation. Unlink is the dialog's own clearing rule, not a second copy; the composer is one component for the panel and the Tasks view; the icon table is shared between the tab and the header.
  • Jira's HTML over a wiki-markup converter. The server already renders its own markup; converting wiki → Markdown by hand would be a large surface that still misses macros. Attachment images are resolved through the cache that already exists for ADF media.
  • A body-format flag over heuristics. A whole-body Markdown conversion cannot tell a literal - item from a list, so applying it to every caller would have changed bodies the CLI or a paired client sent. The optional field is additive: an older host ignores it and stores the body verbatim.
  • parse5 over regexes on HTML. Attribute values may contain >, quote styles vary, and entities must be decoded once and re-encoded once. A first pass with patterns reproduced four such defects; the parser removes the class.

Linked Issue

None — fork-local work on the JIRA-Issues worktree; this branch targets nplez1/main, not upstream.

Visual Proof

N/A — and I want to be straight about why this is a gap rather than a true "no visual change": this PR does change rendered UI (the tab icon, the pane header, the comment composer). No Electron instance was launched while making the change, so nothing here has been seen on screen. Behaviour is covered by the tests listed below. BEFORE is reproducible from the current nplez1/main tip; on request I'll attach BEFORE/AFTER CDP screenshots of hidden renderers.

Testing

pnpm tc      -> clean (exit 0)
pnpm lint    -> clean (exit 0)
pnpm test    -> 113,912 tests: 112,924 passed, 60 failed, 17 files, exit 1

All 60 failures are classified, and none belongs to this change:

Class Files Tests
Upstream-red logic (agent-session-*, agent-launch-*, structured-agent-session-*) 10 34
PTY/subprocess, bun project only (repro-13767-…, shell-startup-feature-channel, daemon/shell-ready) 3 22
Relay region correction — Cannot find package 'pg' imported from cloud/apps/relay/src/database.ts 1 1

Three further failures sit outside those classes and were classified rather than assumed: session-search-agent-set-downgrade, qoder-history-search-downgrade (both 30 s timeouts in the legacy-release-checkout family) and foreign-sqlite-reader-event-loop (an event-loop occupancy ratio). Re-running exactly those three files in isolation gives 3 files passed, 19 tests passed, exit 0 — load-sensitive, not this change's. Neither family references anything this PR touches.

This PR adds a runtime dependency (parse5), so I checked the packaging path directly. The desktop chain passes (build:electron-vite, verify:built-skills-cli, build:web-from-renderer), but pnpm build / pnpm build:unpack cannot complete on this machine: mobile/ is a separate workspace with its own lockfile and is not installed here, so beforePack stops at [verify-packaged-mobile-web-bundle] no bundle manifest at out/mobile-web/manifest.json before afterPack runs. Rather than assume, I applied the packaging guard's own condition to the real built bundle with its exported predicate: with parse5 in BUNDLED_MAIN_DEPENDENCIES the main bundle has no bare parse5 specifier, and removing that one entry reproduces a bare require("parse5") — which is precisely the Packaged main bundle has bare runtime imports without copied node_modules: parse5 failure that prompted the fix. The afterPack guard itself has not been executed here; CI or a full release build should confirm it.

Tests added/updated: jira-rendered-html (parse5 rewriting, incl. context paths and the four regex defects), jira-comment-body (Markdown → wiki/ADF, escapes, fenced code, CRLF parity, plain-text parity with textToAdf), jira-issue-server-body (self-hosted read path), jira-issue-mutations (per-site payloads, and that an unmarked body is stored verbatim), adf-markdown (marks survive a read), comment-composer, comment-composer-focus-timer, IssuePaneHeader (identifier link, menu, disabled reason), GithubLinkedIssuePane, worktree-meta-updates (buildIssueUnlinkUpdates), task-page-jira-item-source-context (project-key derivation, refusal cases). The four link-loss tests fail against the old derivation and pass against the new one — verified by restoring it temporarily.

Platforms: macOS (arm64) only. No packaged build was produced (see above). No Linux, Windows, SSH/remote host, or paired-client run. Self-hosted Jira behaviour is exercised against the real read/write code paths with a mocked HTTP transport; no request was made to a live Jira, so endpoint acceptance of the generated ADF is argued from the published ADF schema, not observed.

  • I manually tested these changes locally — not done: no app launch
  • Automated tests added/updated, or explained why not below

AI Disclosure

Written with an AI coding agent, with review passes by other models: two adversarial reviews by GPT-6.1-Sol (which found, and I then fixed, a packaging blocker — a new runtime dependency that the packaged-build guard would have rejected — plus a body-mangling regression and a lost-mark round-trip), and one investigation pass by Claude Opus 5.5 that located the silent link-loss mechanism above. Every claim in the testing table was reproduced locally.

Review

Both review passes are reflected above. Notably, the ADF this PR generates was validated against Atlassian's published ADF JSON schema (version 1, code marks, paragraphs inside blockquotes, paragraph-bearing list items, empty paragraph content), and the wiki wrappers against Atlassian's own wikimarkup token table.

Agent skill upstream boundary

  • Not applicable, or this change follows docs/reference/agent-skill-sharing-upstream-boundary.md and copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

  • Security: the rendered Jira HTML goes through CommentMarkdown's existing rehypeRaw + sanitize pipeline; injected data: image URLs were confirmed to render while scripts, event handlers and javascript: links are stripped.
  • Cross-platform: relative-link absolutization uses URL semantics so a context-path install (https://host/jira) does not double the prefix; no path or shortcut assumptions added.
  • Remote/SSH: the unlink action routes through the store action that enforces the remote-runtime capability gates rather than bypassing them; bodyFormat is optional, so a mixed-version client and host still interoperate.
  • Backwards compatibility: every pre-existing comment call path sends no bodyFormat and stores its body verbatim, exactly as before.
  • Performance: no new polling; the body conversion is pure string/JSON work on one comment at submit time.

Checklist

  • This PR is small and focused — not small: it is one surface (the issue panel) plus the Jira body rendering it depends on
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason — gap, explained above
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass — tc and lint clean; test is 57 documented failures + 3 load-sensitive ones, all classified above; pnpm build is blocked by the uninstalled mobile/ workspace, so the packaging guard's condition was verified directly against the built bundle instead

…odies

The right-sidebar issue panel, the Jira comment box, and how a self-hosted
Jira's bodies reach the screen, plus the fix for a task-created workspace
losing its Jira link.

- Issue tab takes the provider's own mark; the pane header makes the issue
  number the link and gains unlink / re-link actions for Jira, GitHub and
  Linear, reusing the workspace dialog's own clearing rule
- the Jira comment box becomes the shared Markdown composer (bubble, inline
  formatting, circular send); its Markdown is converted per site to wiki
  markup or ADF, and only bodies the composer wrote are reinterpreted
- self-hosted descriptions and comments render from Jira's own HTML, parsed
  with parse5, with attachment images served from the existing cache
- a Jira task's link is no longer dropped silently when the issue's project
  field disagrees with its key
@nplez1
nplez1 merged commit 13d584d into nplez1/main Oct 9, 2026
nplez1 added a commit that referenced this pull request Oct 9, 2026
Upstream @ 1cda323 (199 commits) onto the release line from 6a7b39c
(merge base e5ade4b). 37 conflicted paths: no-markers 15, both-rewrote 9,
modify/delete 7, union 4, rename-replay 1, duplicate-tail 1.

Conflict resolutions

- Upstream rebuilt the worktree-meta dialog in b1cd858, deleting the five
  files the fork's Jira-link PRs (#52, #64) had extended and shipping the same
  feature in a linked-items/attachments model. Fork owner decided the
  convergence: take upstream's model, drop the fork's superseded modules
  (use-worktree-issue-link, WorktreeIssueLinkField, worktree-issue-displacement,
  worktree-meta-updates and its test, plus use-worktree-meta-save,
  use-worktree-meta-issue-row, use-worktree-meta-jira-link,
  issue-link-provider-options, the dialog test harness and the fork dialog test).
  Jira linking survives on upstream's side, which is the superset: `provider:
  'jira'` attachments with jiraIdentifier and taskSourceContext, a "Jira task
  (URL)" composer kind backed by a site-aware source with an account chooser,
  and bare-key linking through the search rows.
- Re-homed the one fork-only rule that survived: buildIssueUnlinkUpdates moved to
  sidebar/workspace-issue-unlink-updates.ts, so the Jira issue pane's Unlink
  still clears the GitHub number, the Linear key and the created-from work item
  together.
- Re-seated the fork's merge-readiness marker into upstream's WorktreeReferenceStack
  (ReviewIconWithMergeMarker plus the hostedReviewMergeVerdictLabel suffix), and
  split WorktreeCardStatusSlot's label so a collection checks summary owns the
  checks half while the merge blocker still reaches the screen reader.
- The two retired test inventories took the deletion (ledger: "Test inventories
  retired upstream").

Breaks a clean merge left behind, found by the gates

- main-window-actions.ts imported getDashboardPopoutWindow, which the fork
  deleted; the serve-mode quit loop closes only the main window again, and the
  two tests that mocked the popout lost that mock.
- The fork's three Jira board RPC methods were missing the `permission` field
  upstream made required; they are `workspace`, like jira.listIssues.
- orphaned-local-worktree-cleanup's global cache invalidation is redundant now
  that the call site does the repo-scoped one, and it was the global clear
  upstream's test forbids on an orphan removal.
- en.json dropped 8 upstream copy changes the hand-union missed; both catalogs
  regenerated.
- managed-hook-install-lock.ts hard-coded ~/.orca for the install lock parent,
  bypassing HOME_DIRECTORY_NAME. Pre-existing, exposed by the merge's test.
- ai-vault-session-refresh's scan key kept the host query but the upstream
  list-request adapter dropped it, so a changed query served the unfiltered cache.

Generated files regenerated, not merged: bundled-skill-guides.ts,
en-runtime-required.json, the locale catalogs, and the rpc params catalog
(already current).

Verification: pnpm tc clean, post-sync.mjs green, targeted suites green.
nplez1 added a commit that referenced this pull request Oct 9, 2026
…it options

Merging a review-gated pull request with the admin bypass failed on every attempt
from the right sidebar, and from every other surface that offers it: the
confirmation appeared, the user accepted it, and the merge was refused with "This
pull request requires review approval before it can be merged." The same merge
succeeded on github.com. Confirmed on #63 and #64, both merged by hand in the end.

`getGitHubLocalGitOptionArgs` returns `[]` when a repo has no local git options —
the ordinary case for a local checkout with no WSL routing and no gh account bound
to the repo. Both host entry points spread that array immediately before a
trailing options object:

    ...getGitHubLocalGitOptionArgs(store, repo),
    { bypassBranchProtection: args.bypassBranchProtection === true }

An empty array spreads to nothing, so the options object became the sixth argument
(`localGitOptions`) and `mergePR`'s seventh parameter (`options`) took its default
`{}`. `options.bypassBranchProtection === true` was therefore false, so the
preflight refused to authorise the bypass it had just been asked for and returned
the review-approval error. A WSL repo, whose options array is non-empty, was
unaffected — which is why that suite passed while the SSH/local one asserted the
shifted call as if it were the contract.

Both call sites now materialise the argument with the `[0] ?? {}` idiom the
neighbouring runtime commands already use (`runtime-github-repository-query-commands`,
`runtime-github-review-query-commands`), so the trailing options object cannot be
displaced. Nothing else moves.

The running build carries the same shape (`out/main/index.js` in Orca NP
1.4.214-np.22), and the real preflight called against #63 while it was still open
returned `{"error":null,"adminBypass":true}` — the permission was never the
problem, only the lost flag.

Verified: the new and corrected suites fail 4 of 7 with the production change
stashed and pass with it; `github-wsl-runtime-routing`, `rpc/methods/github`,
`client-pr-admin-merge-bypass` and `pr-mutation-review-invalidation` pass (68
tests); `pnpm tc` and `pnpm lint` clean; full `pnpm test` 112,892 passed / 56
failed, every failure in a class already recorded as red on this machine's base
and none of them importing the changed modules.
nplez1 added a commit that referenced this pull request Oct 9, 2026
…it options (#67)

Merging a review-gated pull request with the admin bypass failed on every attempt
from the right sidebar, and from every other surface that offers it: the
confirmation appeared, the user accepted it, and the merge was refused with "This
pull request requires review approval before it can be merged." The same merge
succeeded on github.com. Confirmed on #63 and #64, both merged by hand in the end.

`getGitHubLocalGitOptionArgs` returns `[]` when a repo has no local git options —
the ordinary case for a local checkout with no WSL routing and no gh account bound
to the repo. Both host entry points spread that array immediately before a
trailing options object:

    ...getGitHubLocalGitOptionArgs(store, repo),
    { bypassBranchProtection: args.bypassBranchProtection === true }

An empty array spreads to nothing, so the options object became the sixth argument
(`localGitOptions`) and `mergePR`'s seventh parameter (`options`) took its default
`{}`. `options.bypassBranchProtection === true` was therefore false, so the
preflight refused to authorise the bypass it had just been asked for and returned
the review-approval error. A WSL repo, whose options array is non-empty, was
unaffected — which is why that suite passed while the SSH/local one asserted the
shifted call as if it were the contract.

Both call sites now materialise the argument with the `[0] ?? {}` idiom the
neighbouring runtime commands already use (`runtime-github-repository-query-commands`,
`runtime-github-review-query-commands`), so the trailing options object cannot be
displaced. Nothing else moves.

The running build carries the same shape (`out/main/index.js` in Orca NP
1.4.214-np.22), and the real preflight called against #63 while it was still open
returned `{"error":null,"adminBypass":true}` — the permission was never the
problem, only the lost flag.

Verified: the new and corrected suites fail 4 of 7 with the production change
stashed and pass with it; `github-wsl-runtime-routing`, `rpc/methods/github`,
`client-pr-admin-merge-bypass` and `pr-mutation-review-invalidation` pass (68
tests); `pnpm tc` and `pnpm lint` clean; full `pnpm test` 112,892 passed / 56
failed, every failure in a class already recorded as red on this machine's base
and none of them importing the changed modules.
@nplez1
nplez1 deleted the nplez1/JIRA-Issues branch October 24, 2026 03:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant