gitdataai/libs/api/agent/issue_triage.rs
ZhenYi dfa5f7664a feat: add notification drawer, command registry, keyboard shortcuts, hooks
New components:
- NotificationDrawer: global bell button with unread badge + Sheet drawer
- CommandPalette: Cmd+K / Ctrl+Alt+F command palette with real API data
- KeyboardShortcutsSheet: ? shortcut reference sheet
- GlobalNavigationShortcuts: g+n/i/r/m two-key navigation
- useNotification: real-time notification management hook
- useCommandRegistry: global command registration hook
- useKeyboardShortcut: keyboard shortcut formatting hook
- useTypingIndicator: unified typing indicator hook
- LinkPreview / CodeBlock / CodeReference: code-aware chat rendering
- ContentRenderer: unified content rendering
- MiniChat: compact inline chat component
- MentionBadge: @mention badge renderer

New libs:
- libs/api/agent/issue_triage.rs: AI issue triage API endpoint
- libs/service/agent/issue_triage.rs: AI triage service
- src/lib/mention.ts: mention parsing and rendering
- src/lib/link-unfurl.ts: URL pattern detection
- src/lib/code-lang-detect.ts: code language detection
- src/lib/code-ref-parser.ts: line-level code reference parsing
2026-04-25 09:53:49 +08:00

38 lines
1.1 KiB
Rust

use actix_web::{HttpResponse, Result, web};
use service::AppService;
use session::Session;
use crate::ApiResponse;
#[derive(Debug, Clone, serde::Deserialize, utoipa::IntoParams)]
pub struct TriageIssueQuery {
pub issue_number: i64,
}
#[utoipa::path(
get,
path = "/api/agents/{project}/triage",
params(
("project" = String, Path, description = "Project name"),
("issue_number" = i64, Query, description = "Issue number to triage"),
),
responses(
(status = 200, description = "Issue triage result", body = ApiResponse<service::agent::issue_triage::IssueTriageResponse>),
(status = 401, description = "Unauthorized"),
(status = 404, description = "Issue not found"),
),
tag = "Agent"
)]
pub async fn triage_issue(
service: web::Data<AppService>,
_session: Session,
path: web::Path<String>,
query: web::Query<TriageIssueQuery>,
) -> Result<HttpResponse, crate::error::ApiError> {
let project_name = path.into_inner();
let resp = service
.triage_issue(project_name, query.issue_number)
.await?;
Ok(crate::ApiResponse::ok(resp).to_response())
}