2026-06-01 00:59:22 +00:00
|
|
|
export interface Config {
|
|
|
|
|
url: string;
|
|
|
|
|
token: string | null;
|
2026-06-01 02:02:23 +00:00
|
|
|
userid: string;
|
2026-06-01 00:59:22 +00:00
|
|
|
owner: string;
|
|
|
|
|
repo: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface User {
|
|
|
|
|
id: number;
|
|
|
|
|
login: string;
|
|
|
|
|
full_name: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Label {
|
|
|
|
|
id: number;
|
|
|
|
|
name: string;
|
|
|
|
|
color: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Issue {
|
|
|
|
|
id: number;
|
|
|
|
|
number: number;
|
|
|
|
|
title: string;
|
|
|
|
|
state: 'open' | 'closed';
|
|
|
|
|
body: string;
|
|
|
|
|
user: User;
|
|
|
|
|
created_at: string;
|
|
|
|
|
updated_at: string;
|
|
|
|
|
comments: number;
|
|
|
|
|
labels: Label[];
|
|
|
|
|
pull_request?: any | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface Comment {
|
|
|
|
|
id: number;
|
|
|
|
|
user: User;
|
|
|
|
|
body: string;
|
|
|
|
|
created_at: string;
|
|
|
|
|
updated_at: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface SetupForm {
|
|
|
|
|
url: string;
|
2026-06-01 02:02:23 +00:00
|
|
|
userid: string;
|
2026-06-01 00:59:22 +00:00
|
|
|
token: string;
|
2026-06-01 02:27:57 +00:00
|
|
|
saveConfig: boolean;
|
|
|
|
|
activeField: 'url' | 'userid' | 'token' | 'saveConfig';
|
2026-06-01 00:59:22 +00:00
|
|
|
}
|
|
|
|
|
|
2026-06-01 03:06:53 +00:00
|
|
|
export interface CreateIssueForm {
|
|
|
|
|
title: string;
|
|
|
|
|
body: string;
|
|
|
|
|
activeField: 'title' | 'body';
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-01 03:18:12 +00:00
|
|
|
export interface AddCommentForm {
|
|
|
|
|
body: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type ScreenType = 'setup' | 'repo-picker' | 'list' | 'details' | 'create-issue' | 'add-comment';
|
|
|
|
|
|
2026-06-01 02:02:23 +00:00
|
|
|
|
|
|
|
|
export interface RepoItem {
|
|
|
|
|
id: number;
|
|
|
|
|
name: string;
|
|
|
|
|
full_name: string;
|
|
|
|
|
private: boolean;
|
|
|
|
|
description: string;
|
|
|
|
|
}
|
2026-06-01 00:59:22 +00:00
|
|
|
|
|
|
|
|
export interface AppState {
|
|
|
|
|
screen: ScreenType;
|
|
|
|
|
config: Config;
|
|
|
|
|
|
|
|
|
|
// List Screen State
|
|
|
|
|
issues: Issue[];
|
|
|
|
|
currentPage: number;
|
|
|
|
|
issuesPerPage: number;
|
|
|
|
|
totalIssuesCount: number; // calculated or fetched
|
|
|
|
|
loading: boolean;
|
|
|
|
|
error: string | null;
|
|
|
|
|
selectedIssueIndex: number; // cursor in list
|
|
|
|
|
searchQuery: string;
|
|
|
|
|
stateFilter: 'open' | 'closed' | 'all';
|
|
|
|
|
typeFilter: 'issues' | 'pulls' | 'all';
|
|
|
|
|
sortField: 'created' | 'updated' | 'comments';
|
|
|
|
|
sortOrder: 'asc' | 'desc';
|
|
|
|
|
|
|
|
|
|
// Detail Screen State
|
|
|
|
|
selectedIssue: Issue | null;
|
|
|
|
|
selectedIssueComments: Comment[];
|
|
|
|
|
commentsLoading: boolean;
|
|
|
|
|
detailScrollOffset: number;
|
|
|
|
|
|
2026-06-01 02:02:23 +00:00
|
|
|
// Repo Picker State
|
|
|
|
|
repos: RepoItem[];
|
|
|
|
|
selectedRepoIndex: number;
|
|
|
|
|
repoSearchQuery: string;
|
|
|
|
|
repoPickerActiveSearch: boolean;
|
|
|
|
|
|
2026-06-01 00:59:22 +00:00
|
|
|
// Setup Form State
|
|
|
|
|
setupForm: SetupForm;
|
2026-06-01 03:06:53 +00:00
|
|
|
|
|
|
|
|
// Create Issue Form State
|
|
|
|
|
createIssueForm: CreateIssueForm;
|
2026-06-01 03:18:12 +00:00
|
|
|
|
|
|
|
|
// Add Comment Form State
|
|
|
|
|
addCommentForm: AddCommentForm;
|
2026-06-01 00:59:22 +00:00
|
|
|
}
|
2026-06-01 02:02:23 +00:00
|
|
|
|