feat: add GitHub issue comments display and AI validation integration

- Add comments section to issue detail panel with lazy loading
- Fetch comments via GraphQL API with pagination (50 at a time)
- Include comments in AI validation analysis when checkbox enabled
- Pass linked PRs info to AI validation for context
- Add "Work in Progress" badge in validation dialog for open PRs
- Add debug logging for validation requests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Kacper
2025-12-28 22:11:02 +01:00
parent 61881d99e2
commit 96196f906f
17 changed files with 777 additions and 28 deletions

View File

@@ -87,6 +87,7 @@ export type {
IssueValidationVerdict,
IssueValidationConfidence,
IssueComplexity,
LinkedPRInfo,
IssueValidationInput,
IssueValidationRequest,
IssueValidationResult,
@@ -94,6 +95,9 @@ export type {
IssueValidationErrorResponse,
IssueValidationEvent,
StoredValidation,
GitHubCommentAuthor,
GitHubComment,
IssueCommentsResult,
} from './issue-validation.js';
// Backlog plan types

View File

@@ -21,6 +21,15 @@ export type IssueValidationConfidence = 'high' | 'medium' | 'low';
*/
export type IssueComplexity = 'trivial' | 'simple' | 'moderate' | 'complex' | 'very_complex';
/**
* Linked PR info for validation
*/
export interface LinkedPRInfo {
number: number;
title: string;
state: string;
}
/**
* Issue data for validation (without projectPath)
* Used by UI when calling the validation API
@@ -30,6 +39,10 @@ export interface IssueValidationInput {
issueTitle: string;
issueBody: string;
issueLabels?: string[];
/** Comments to include in validation analysis */
comments?: GitHubComment[];
/** Linked pull requests for this issue */
linkedPRs?: LinkedPRInfo[];
}
/**
@@ -133,3 +146,41 @@ export interface StoredValidation {
/** ISO timestamp when user viewed this validation (undefined = not yet viewed) */
viewedAt?: string;
}
/**
* Author of a GitHub comment
*/
export interface GitHubCommentAuthor {
login: string;
avatarUrl?: string;
}
/**
* A comment on a GitHub issue
*/
export interface GitHubComment {
/** Unique comment ID */
id: string;
/** Author of the comment */
author: GitHubCommentAuthor;
/** Comment body (markdown) */
body: string;
/** ISO timestamp when comment was created */
createdAt: string;
/** ISO timestamp when comment was last updated */
updatedAt?: string;
}
/**
* Result from fetching issue comments
*/
export interface IssueCommentsResult {
/** List of comments */
comments: GitHubComment[];
/** Total number of comments on the issue */
totalCount: number;
/** Whether there are more comments to fetch */
hasNextPage: boolean;
/** Cursor for pagination (pass to next request) */
endCursor?: string;
}