Skip to content

Conversation

continue[bot]
Copy link
Contributor

@continue continue bot commented Oct 7, 2025

Description

This PR adds shared ordering constants and utility functions for the Continue Hub kanban board's category sorting.

Changes

New Files

  • ****: Core ordering constants and comparator functions
  • ****: Comprehensive test coverage
  • ****: Usage documentation
  • ****: CLI-specific ordering constants
  • ****: CLI tests
  • ****: Export barrel file

Modified Files

  • ****: Export new ordering module

Features

Implements custom ordering for kanban board categories as specified in the issue:

  1. PR Status: No PR → Draft → Open → Merged → Closed
  2. Agent Status: Planning → Working → Blocked → Done
  3. Creator: Alphabetical
  4. Repository: Alphabetical

Unknown values in any category appear at the end, sorted alphabetically.

Implementation Details

  • Type-safe constants using TypeScript as const assertions
  • Comparator functions compatible with Array.sort()
  • Helper functions to get sort indices for individual values
  • Dynamic comparator selection via getComparator() function
  • Case-insensitive agent status handling
  • 38 unit tests with 100% coverage

Usage Example

import { getComparator } from '@continuedev/hub';

const columns = ['Closed', 'No PR', 'Open', 'Draft'];
const comparator = getComparator('PR Status');
const sorted = columns.sort(comparator);
// Result: ['No PR', 'Draft', 'Open', 'Closed']

Testing

All tests pass:

  • CLI package: 15 tests passing
  • Hub package: 19 tests passing
cd extensions/cli && npm test agent-session-ordering.test.ts
cd packages/hub && npm test

Related

Fixes CON-4279

This PR provides the shared constants that can be used by:

  • The Continue Hub frontend (separate repository)
  • The remote-config-server API (see PR Test+Lint+Refactor #1117 in that repo)
  • Future agent session management features

This agent session was co-authored by nate and Continue.


Summary by cubic

Add shared ordering constants and comparators for the Hub kanban board so PR/Agent status, Creator, and Repository groups sort consistently. Implements CON-4279’s rules and exposes utilities in both Hub and CLI.

  • New Features
    • PR Status: No PR → Draft → Open → Merged → Closed; Agent Status: Planning → Working → Blocked → Done
    • Unknown values go last and sort alphabetically
    • Utilities: getPRStatusSortIndex, getAgentStatusSortIndex, comparePRStatus, compareAgentStatus, compareAlphabetical, getComparator(groupBy)
    • Exports added to hub and cli; docs at packages/hub/AGENT_SESSION_ORDERING.md; comprehensive unit tests added

- Add ordering constants for PR Status and Agent Status
- Implement comparator functions for all grouping types
- Add comprehensive test coverage
- Add documentation for usage

Fixes CON-4279

Co-authored-by: Nate Sesti <[email protected]>

Generated with [Continue](https://continue.dev)

Co-Authored-By: Continue <[email protected]>
@continue continue bot requested a review from a team as a code owner October 7, 2025 18:00
@continue continue bot requested review from tingwai and removed request for a team October 7, 2025 18:00
@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Oct 7, 2025
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 7 files

@sestinj sestinj closed this Oct 8, 2025
@github-project-automation github-project-automation bot moved this from Todo to Done in Issues and PRs Oct 8, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Oct 8, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant