From 1f1df98bfa58d00f75ece21593747af08e14cf68 Mon Sep 17 00:00:00 2001 From: metif12 Date: Tue, 10 Nov 2026 10:45:54 +0330 Subject: [PATCH 1/4] feat: batch issue handling (Phase 1) --- issue_routes.v | 38 +++++++++++++++++++++++++++++++------- 1 file changed, 31 insertions(+), 7 deletions(-) diff --git a/issue_routes.v b/issue_routes.v index 71335bca..5aa149d4 100644 --- a/issue_routes.v +++ b/issue_routes.v @@ -40,7 +40,7 @@ fn (mut app App) handle_issues_count(username string, repo_name string) veb.Resu count := app.get_repo_issue_count(repo.id) return ctx.json(api.ApiIssueCount{ success: true - result: count + result: count }) } @@ -86,8 +86,8 @@ pub fn (mut app App) handle_add_repo_issue(mut ctx Context, username string, rep app.sync_repo_open_issue_count(repo.id) or { app.info(err.str()) } app.dispatch_webhook(repo.id, 'issue', WebhookIssuePayload{ action: 'opened' - repo: '${username}/${repo_name}' - title: title + repo: '${username}/${repo_name}' + title: title author: ctx.user.username }) has_first_issue_activity := app.has_activity(ctx.user.id, 'first_issue') @@ -261,8 +261,8 @@ pub fn (mut app App) handle_edit_issue(mut ctx Context, username string, repo_na } app.dispatch_webhook(repo.id, 'issue', WebhookIssuePayload{ action: 'updated' - repo: '${username}/${repo_name}' - title: title.trim_space() + repo: '${username}/${repo_name}' + title: title.trim_space() author: ctx.user.username }) return ctx.redirect('/${username}/${repo_name}/issue/${issue.id}') @@ -376,8 +376,8 @@ fn change_issue_status(mut app App, mut ctx Context, username string, repo_name action := if status == .closed { 'closed' } else { 'reopened' } app.dispatch_webhook(repo.id, 'issue', WebhookIssuePayload{ action: action - repo: '${username}/${repo_name}' - title: issue.title + repo: '${username}/${repo_name}' + title: issue.title author: ctx.user.username }) return ctx.redirect('/${username}/${repo_name}/issue/${issue.id}') @@ -457,3 +457,27 @@ pub fn (mut app App) user_issues(mut ctx Context, username string, tab string) v ctx.set_page_title([tab_title, user.username]) return $veb.html() } + +@['/:username/:repo_name/issues/batch'; post] +pub fn (mut app App) handle_batch_issues(mut ctx Context, username string, repo_name string) veb.Result { + repo := app.find_repo_by_name_and_username(repo_name, username) or { return ctx.not_found() } + if !app.can_admin_repo(ctx, repo) { + return ctx.not_found() + } + action := ctx.form['action'] or { '' } + ids_raw := ctx.form['issue_ids'] or { '' } + for part in ids_raw.split(',') { + id := part.trim_space().int() + if id <= 0 { continue } + match action { + 'close' { + app.set_issue_status(id, .closed) or { app.info(err.str()) } + } + 'open' { + app.set_issue_status(id, .open) or { app.info(err.str()) } + } + else {} + } + } + return ctx.redirect('///issues') +} From a427dfc1f04f154827de04750dcc0dbc9b0e2caa Mon Sep 17 00:00:00 2001 From: metif12 Date: Tue, 10 Nov 2026 10:47:33 +0330 Subject: [PATCH 2/4] feat: batch issue handling UI (Phase 1) --- templates/_issue_list.html | 1 + templates/issues.html | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/templates/_issue_list.html b/templates/_issue_list.html index aed4976f..af1c59c0 100644 --- a/templates/_issue_list.html +++ b/templates/_issue_list.html @@ -1,6 +1,7 @@