Skip to content

Jira active tasks right panel#2008

Closed
brherron wants to merge 7 commits into
pingdotgg:mainfrom
brherron:jira-active-tasks-right-panel
Closed

Jira active tasks right panel#2008
brherron wants to merge 7 commits into
pingdotgg:mainfrom
brherron:jira-active-tasks-right-panel

Conversation

@brherron
Copy link
Copy Markdown

@brherron brherron commented Apr 13, 2026

Note

Medium Risk
Adds new Jira configuration handling, WebSocket RPC endpoints, and client-side worktree/automation flows that interact with external Jira APIs and git state; failures could impact developer workflows and leak misconfigurations. Also changes server pathing for secretsDir and build invocation, which could affect runtime environments if assumptions differ.

Overview
Adds end-to-end Jira integration: a repo-root .t3-jira-config.json (git/worktree-aware) loader, JiraConfig/JiraService layers, and ADF-to-Markdown conversion for issue descriptions/comments, exposed via new WebSocket RPC methods (jira.getConfigStatus, jira.listActiveTasks, jira.getIssueDetail, jira.runAutomation).

Updates the web app to surface Jira in the UI: a Jira toggle in ChatHeader, a new tools-panel Jira tab (JiraPanelTab/JiraIssueDetailPane) with sorting and state-aware work actions that can create git worktrees/threads seeded with Jira prompts, and hooks to trigger Jira automations when branches are created or PRs are opened.

Also tweaks infrastructure: routes server build through a Node shim (scripts/cli.mjs) for the TypeScript CLI, moves secretsDir to baseDir/secrets, adds .t3-jira-config.json to .gitignore, and adds coverage/tests around the new Jira service and UI behavior.

Reviewed by Cursor Bugbot for commit d8ee5ad. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Add Jira active tasks right panel with state-aware work actions

  • Adds a resizable JiraSidePanel and JiraPanelTab that lists active Jira issues, supports sorting by status/key, and shows a JiraIssueDetailPane for the selected issue.
  • Introduces state-aware work action logic (buildJiraWorkActionState) that recommends Start Work, Continue Work, or Start Review based on issue status and matching git branches.
  • Adds server-side Jira services (JiraConfig, JiraService) with WebSocket RPC endpoints for getConfigStatus, listActiveTasks, getIssueDetail, and runAutomation.
  • ChatView gains an onRunJiraWorkAction handler that creates worktrees/branches, runs Jira automations, opens a new thread seeded with context-appropriate prompts, and invalidates Jira query caches.
  • Replaces the previous diff-only tools panel with a unified ToolsPanelContent that switches between Git and Jira tabs; the ChatHeader gains separate Git and Jira toggle buttons.
  • Jira config is loaded from .t3-jira-config.json at the git repo root, with adfToMarkdown used to convert ADF issue descriptions to Markdown for display.
  • Risk: the Jira panel state is stored in a Zustand store (useJiraToolsStore) shared across ChatView and the route, so mismatches in open/tab state could occur if both update simultaneously.
📊 Macroscope summarized def3767. 50 files reviewed, 13 issues evaluated, 2 issues filtered, 9 comments posted

🗂️ Filtered Issues

apps/server/scripts/cli.mjs — 0 comments posted, 1 evaluated, 1 filtered
  • line 6: npm_execpath returns the path to the package manager's CLI script (e.g., /usr/lib/node_modules/npm/bin/npm-cli.js for npm), not the runtime executable. If this script is invoked via npm (npm run ...), bunExecutable will be set to npm's CLI script path, and spawnSync(bunExecutable, [cliEntrypoint, ...]) will fail because npm's CLI script cannot execute a .ts file directly. The intent appears to be running cli.ts with bun's TypeScript support, so the fallback to "bun" is correct, but the npm_execpath check defeats this when npm is the invoking package manager. [ Cross-file consolidated ]
apps/web/src/components/ChatView.tsx — 0 comments posted, 3 evaluated, 1 filtered
  • line 3285: After creating a Jira thread in onRunJiraWorkAction, the code calls useJiraToolsStore.getState().setJiraOpen(true) (line 3285) expecting the Jira panel to appear. However, since RightPanel only renders based on planSidebarOpen (not jiraOpen), the Jira panel will never be shown after thread creation. The state is updated but there's no corresponding UI response. [ Failed validation ]

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 13, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 30135aa8-3ea7-49f8-89da-257a6dbe82e4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list. labels Apr 13, 2026
Comment thread apps/web/src/components/right-panel/JiraIssueDetailPane.tsx
Comment thread apps/web/src/components/right-panel/JiraSidePanel.tsx
Comment thread apps/web/src/components/ChatMarkdown.tsx
Comment thread apps/web/src/components/right-panel/JiraPanelTab.test.tsx
brherron and others added 6 commits April 13, 2026 16:40
- Repo-local Jira config loaded server-side from .t3-jira-config.json (resolved via git rev-parse --git-common-dir)
- Effect-TS JiraConfig + JiraService layers with listActiveTasks, getIssueDetail, runAutomation
- ADF-to-Markdown converter (no external deps)
- 4 new WS RPC methods: jira.getConfigStatus, jira.listActiveTasks, jira.getIssueDetail, jira.runAutomation
- Right panel with Plan/Jira tabs replacing standalone PlanSidebar
- JiraPanelTab: active task list, ticket detail view, pinned active ticket derived from branch name, Start Work flow (worktree + branch + runAutomation + new thread)
- GitActionsControl: after PR created, calls jira.runAutomation("on_pr_opened") non-fatally
- Jira toggle button in ChatHeader

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@brherron brherron force-pushed the jira-active-tasks-right-panel branch from def3767 to 625e06e Compare April 13, 2026 22:42
Comment thread apps/web/src/components/right-panel/JiraIssueDetailPane.tsx
@brherron brherron closed this Apr 13, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 5 total unresolved issues (including 4 from previous reviews).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit d8ee5ad. Configure here.

Comment thread apps/web/src/components/ChatView.tsx
@brherron brherron deleted the jira-active-tasks-right-panel branch April 13, 2026 22:47
@brherron
Copy link
Copy Markdown
Author

Oops. Meant to push this to personal fork.

Comment thread apps/web/src/components/chat/ChatHeader.test.tsx
Comment thread apps/web/src/components/right-panel/JiraIssueDetailPane.tsx
Comment thread apps/web/src/jiraToolsStore.ts
Comment thread apps/server/scripts/cli.ts
Comment thread apps/web/src/components/right-panel/JiraIssueDetailPane.tsx
Comment thread apps/server/src/jira/adfToMarkdown.ts
Comment thread apps/web/src/components/right-panel/JiraSidePanel.tsx
Comment thread apps/web/src/components/right-panel/JiraIssueDetailPane.tsx
Comment thread apps/web/src/components/right-panel/JiraIssueDetailPane.tsx
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp Bot commented Apr 13, 2026

Approvability

Verdict: Needs human review

2 blocking correctness issues found. Diff is too large for automated approval analysis. A human reviewer should evaluate this PR.

You can customize Macroscope's approvability policy. Learn more.

import { spawnSync } from "node:child_process";
import { fileURLToPath } from "node:url";

const bunExecutable = process.env.npm_execpath ?? "bun";
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium scripts/cli.mjs:6

When this script is invoked via npm run, process.env.npm_execpath contains npm's CLI script path (e.g., /usr/lib/node_modules/npm/bin/npm-cli.js), not a runtime executable. spawnSync then attempts to use that npm script to execute cli.ts, which fails because npm's CLI cannot directly run TypeScript files. The intent is to run cli.ts with bun, so the npm_execpath check is counterproductive when npm is the package manager. Consider removing the npm_execpath fallback or checking that the value is actually bun.

-const bunExecutable = process.env.npm_execpath ?? "bun";
+const bunExecutable = "bun";
Also found in 1 other location(s)

apps/server/scripts/cli.ts:147

The bunExecutable variable is assigned process.env.npm_execpath ?? process.execPath, but when running the build via npm (where npm_execpath points to npm's executable), the command npm tsdown will fail because npm doesn't accept tsdown as a direct subcommand. Similarly, the fallback process.execPath is the Node.js binary path, so node tsdown would also fail. This logic only works correctly when bun is the package manager.

🤖 Copy this AI Prompt to have your agent fix this:
In file apps/server/scripts/cli.mjs around line 6:

When this script is invoked via `npm run`, `process.env.npm_execpath` contains npm's CLI script path (e.g., `/usr/lib/node_modules/npm/bin/npm-cli.js`), not a runtime executable. `spawnSync` then attempts to use that npm script to execute `cli.ts`, which fails because npm's CLI cannot directly run TypeScript files. The intent is to run `cli.ts` with bun, so the `npm_execpath` check is counterproductive when npm is the package manager. Consider removing the `npm_execpath` fallback or checking that the value is actually bun.

Evidence trail:
apps/server/scripts/cli.mjs line 6 shows `const bunExecutable = process.env.npm_execpath ?? "bun";`. The variable name `bunExecutable` indicates intent to use bun. apps/server/package.json shows `"build": "node scripts/cli.mjs build"` which is invoked via `npm run build`. npm documentation confirms `npm_execpath` is set to the path of npm's executable (https://docs.npmjs.com/cli/v10/using-npm/scripts#environment). npm's CLI cannot execute TypeScript files directly - only a runtime like bun or ts-node can.

Also found in 1 other location(s):
- apps/server/scripts/cli.ts:147 -- The `bunExecutable` variable is assigned `process.env.npm_execpath ?? process.execPath`, but when running the build via npm (where `npm_execpath` points to npm's executable), the command `npm tsdown` will fail because npm doesn't accept `tsdown` as a direct subcommand. Similarly, the fallback `process.execPath` is the Node.js binary path, so `node tsdown` would also fail. This logic only works correctly when bun is the package manager.

[keybindings, nonTerminalShortcutLabelOptions],
);
const onToggleDiff = useCallback(() => {
const applyToolsPanelState = useCallback(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium components/ChatView.tsx:1474

The onDiffPanelOpen callback is no longer invoked when toggling the Git panel via the header button or keyboard shortcut. The refactored onToggleGit handler uses applyToolsPanelState which updates the Jira store and navigates, but never calls onDiffPanelOpen?.(). This breaks any parent component relying on this callback for coordination when the git panel is toggled.

🤖 Copy this AI Prompt to have your agent fix this:
In file apps/web/src/components/ChatView.tsx around line 1474:

The `onDiffPanelOpen` callback is no longer invoked when toggling the Git panel via the header button or keyboard shortcut. The refactored `onToggleGit` handler uses `applyToolsPanelState` which updates the Jira store and navigates, but never calls `onDiffPanelOpen?.()`. This breaks any parent component relying on this callback for coordination when the git panel is toggled.

Evidence trail:
1. ChatView.tsx lines 1503-1516 (REVIEWED_COMMIT): `onToggleGit` handler does not call `onDiffPanelOpen?.()`
2. ChatView.tsx git_show commit 3157505398a3f689fc63dae02be6109f3de67e87: Shows old `onToggleDiff` was renamed to `onToggleGit` and the `if (!diffOpen) { onDiffPanelOpen?.(); }` block was removed
3. _chat.$environmentId.$threadId.tsx lines 298, 321 (REVIEWED_COMMIT): `onDiffPanelOpen={markDiffOpened}` but `markDiffOpened` is not defined
4. git_grep for `const markDiffOpened` returns no results - confirming it's undefined
5. ChatView.tsx line 3440: `onOpenTurnDiff` still calls `onDiffPanelOpen?.()`, showing the callback is expected to function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant