Skip to content

feat(jira): sort Jira issues by key, issue, status, priority, assignee and updated#7959

Merged
AmethystLiang merged 4 commits into
stablyai:mainfrom
andres-vr:feat/sort-jira-issues
Jul 11, 2026
Merged

feat(jira): sort Jira issues by key, issue, status, priority, assignee and updated#7959
AmethystLiang merged 4 commits into
stablyai:mainfrom
andres-vr:feat/sort-jira-issues

Conversation

@andres-vr

@andres-vr andres-vr commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Note

This PR should be merged after #7958 as the sorting was built on top of the grouping functionality.

Description

Adds interactive header columns to Jira issues in the task page (Key, Issue, Status, Priority, Assignee, Updated) supporting togglable sorting directions (asc and desc). Priority sorting is mapped numerically, and status sorting reverses the standard group order.

User-Visible Changes

  • Interactive column headers for Key, Issue, Status, Priority, Assignee, and Updated.
    • Clicking Status sorts the status sections, defaulting to desc (down) on the first click since the default is already asc (no icon shown).
    • Sorting by Priority orders from Low to High (asc) and High to Low (desc).
    • Clicking Assignee sorts alphabetically by display name.
    • Up and down arrows are displayed next to the active sorted column header.

Media

Screenshot 2026-07-09 at 20 07 11 Screenshot 2026-07-09 at 20 07 29

AI Code Review Summary

- Cross-Platform: No platform-specific components or shortcuts were introduced.
- SSH/Remote/Local: Works natively with cached issues list state. Fully compatible with remote environments.
- Agent/Integration Parity: Custom sorting algorithms operate strictly on the generic `JiraIssue` interfaces.
- Performance Risk: Low. Issue sorting and section grouping are cached via `useMemo` hooks depending strictly on active sort column and direction state.
- Security: Standard client-side array sorting. No security risk.

Technical Details

- Modified `sortedJiraIssues` to sort by Key, Title, Priority, Assignee, and Updated.
- Inverted priority weights comparison (`weightB - weightA`) to ensure `asc` corresponds to Low -> High.
- Status column sort reverses the order of the status sections.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change updates the Jira tab to support sortable columns and collapsible status-based issue groupings. It adds Jira priority and project-status loading, priority-aware sorting utilities, status section construction, sortable headers with direction indicators, and keyboard-accessible expandable sections containing existing issue rows and actions. A Vitest suite covers priority weighting, issue sorting, and section grouping and ordering.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding Jira issue sorting across the listed columns.
Description check ✅ Passed The description covers the summary, screenshots/media, AI review, and notes, but it omits the template's explicit Testing and Security Audit sections.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 7

🧹 Nitpick comments (1)
src/renderer/src/components/task-page-jira-sorting.test.ts (1)

267-431: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Tests reimplement sorting logic instead of importing the actual implementation.

Each sorting test duplicates the comparator logic from TaskPage.tsx inline rather than calling the real sortedJiraIssues/jiraIssueSections memos. For example, the priority sort test at line 348 uses weightA - weightB while the actual implementation uses weightB - weightA with a direction flip — both produce correct results for their respective directions, but the test doesn't validate the real code path. If the implementation changes, these tests won't catch regressions.

Consider refactoring getJiraPriorityWeight, the sort comparator, and the section-grouping logic into testable pure functions that both TaskPage.tsx and this test file import.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 64ee2e38-3e36-456f-9814-349409da64d6

📥 Commits

Reviewing files that changed from the base of the PR and between 8adfef4 and f0fa8c3.

📒 Files selected for processing (2)
  • src/renderer/src/components/TaskPage.tsx
  • src/renderer/src/components/task-page-jira-sorting.test.ts

Comment thread src/renderer/src/components/task-page-jira-sorting.test.ts
Comment thread src/renderer/src/components/TaskPage.tsx Outdated
Comment thread src/renderer/src/components/TaskPage.tsx Outdated
Comment thread src/renderer/src/components/TaskPage.tsx Outdated
Comment thread src/renderer/src/components/TaskPage.tsx Outdated
Comment thread src/renderer/src/components/TaskPage.tsx Outdated
Comment thread src/renderer/src/components/TaskPage.tsx Outdated
@andres-vr
andres-vr force-pushed the feat/sort-jira-issues branch 2 times, most recently from 3ab4d91 to 43afda6 Compare July 10, 2026 07:59

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 89c572d1-011e-4d83-8684-d69335750ad8

📥 Commits

Reviewing files that changed from the base of the PR and between f0fa8c3 and 3ab4d91.

📒 Files selected for processing (3)
  • src/renderer/src/components/TaskPage.tsx
  • src/renderer/src/components/jira-issue-sorter.ts
  • src/renderer/src/components/task-page-jira-sorting.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/renderer/src/components/TaskPage.tsx

Comment thread src/renderer/src/components/jira-issue-sorter.ts Outdated
Comment thread src/renderer/src/components/jira-issue-sorter.ts
@andres-vr
andres-vr force-pushed the feat/sort-jira-issues branch from 43afda6 to b35dd3f Compare July 10, 2026 08:50

@coderabbitai coderabbitai Bot left a comment

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.

🧹 Nitpick comments (1)
src/main/jira/issues.ts (1)

850-891: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add a brief comment explaining the board column reordering logic.

The reordering of statuses by Agile board column configuration (lines 867-891) is a design-driven, non-obvious behavior. Per coding guidelines, code driven by a design doc or non-obvious constraint should include a brief explanatory comment.

💬 Suggested comment
       Array.isArray(configResponse.columnConfig.columns)
     ) {
+      // Order statuses by their position in the board's column configuration
+      // so the renderer can group issues in board-column order.
       const orderedNames: string[] = []
       const seen = new Set<string>()

Source: Coding guidelines


ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: bdc56081-0add-4d45-8ec1-68bf10c65860

📥 Commits

Reviewing files that changed from the base of the PR and between 43afda6 and b35dd3f.

📒 Files selected for processing (10)
  • src/main/ipc/jira.ts
  • src/main/jira/issues.ts
  • src/main/runtime/orca-runtime.ts
  • src/main/runtime/rpc/methods/jira.ts
  • src/preload/api-types.ts
  • src/preload/index.ts
  • src/renderer/src/components/TaskPage.tsx
  • src/renderer/src/components/jira-issue-sorter.ts
  • src/renderer/src/components/task-page-jira-sorting.test.ts
  • src/renderer/src/runtime/runtime-jira-client.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/renderer/src/components/task-page-jira-sorting.test.ts
  • src/renderer/src/components/jira-issue-sorter.ts
  • src/renderer/src/components/TaskPage.tsx

Andres Van Reepingen and others added 4 commits July 10, 2026 19:34
Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Add test coverage for the new Jira issue sorting features including:
- Priority weight calculation with fallback logic
- Sorting by key, title, priority, assignee, and updated date
- Issue grouping and section ordering after sorting
- Handling of edge cases like unassigned assignees and unknown priorities

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Extract getJiraPriorityWeight and sorting logic into a shared jira-issue-sorter module.
- Fix grid column definitions on md viewports in TaskPage.tsx.
- Implement cancelled flags in useEffect hooks in TaskPage.tsx to guard against stale responses.
- Swapped priority weights mapping to blocker=99, lowest=1, missing=0 to sort ascending from lowest-to-highest priority using weightA - weightB.
- Focus-ring enhancements on sort button headers and aria-expanded/chevron fix on collapsible groups.
- Remove duplicate helpers from unit tests and verify the new sorting expectations.
@AmethystLiang
AmethystLiang force-pushed the feat/sort-jira-issues branch from b48c887 to 647d8be Compare July 11, 2026 02:35

@AmethystLiang AmethystLiang left a comment

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.

Thanks! I rebased this onto the merged Jira grouping work and completed the maintainer review.

  • Added reliable desktop and compact sorting controls.
  • Corrected priority ordering across custom, multi-site Jira schemes.
  • Added accessibility, localization, and production-path regression coverage.
  • Verified focused tests, full type/lint gates, performance, and Electron behavior.

@AmethystLiang
AmethystLiang merged commit 632a3c1 into stablyai:main Jul 11, 2026
1 check passed
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.

3 participants