mirror of
https://github.com/stablyai/orca.git
synced 2026-09-23 16:02:24 +00:00
* feat: add GitLab Issues tab and workspace creation for issues/MRs - Extend TaskPage GitLab section with Issues | MRs tabs (outside card) plus a repo selector via RepoMultiCombobox, matching the GitHub UX. - Add separate IPC paths: listIssues (with "Assigned to me" filter) and listMRs (with Open/Closed/Merged/All filters). - Add "Start workspace" (→) button to every GitLab row and "Create workspace" action inside GitLabItemDialog for both issues and MRs. - Extend CreateWorktreeArgs / worktree.create RPC to accept linkedGitLabMR and linkedGitLabIssue, and wire them through the runtime, IPC, preload, and renderer store slices. - Fix self-hosted GitLab support by falling back to glab CLI (issue view / mr view / issue list / mr list) when the remote host is not in getGlabKnownHosts(). - Update useComposerState to initialise GitLab-linked context from initialLinkedWorkItem. * Remove logs * fix: address GitLab issues review findings --------- Co-authored-by: Neil <4138956+nwparker@users.noreply.github.com>
109 lines
3.5 KiB
TypeScript
109 lines
3.5 KiB
TypeScript
/* GitLab preload bindings — split out of `src/preload/index.ts` so
|
|
adding or changing a `gl.*` channel doesn't surface as a merge
|
|
conflict on every upstream sync of the much larger central preload
|
|
file. Composed back into `api.gl` from `index.ts`. */
|
|
import { ipcRenderer } from 'electron'
|
|
|
|
export const glApi = {
|
|
viewer: (): Promise<unknown> => ipcRenderer.invoke('gitlab:viewer'),
|
|
|
|
projectSlug: (args: { repoPath: string }): Promise<unknown> =>
|
|
ipcRenderer.invoke('gitlab:projectSlug', args),
|
|
|
|
mrForBranch: (args: {
|
|
repoPath: string
|
|
branch: string
|
|
linkedMRIid?: number | null
|
|
}): Promise<unknown> => ipcRenderer.invoke('gitlab:mrForBranch', args),
|
|
|
|
mr: (args: { repoPath: string; iid: number }): Promise<unknown> =>
|
|
ipcRenderer.invoke('gitlab:mr', args),
|
|
|
|
listMRs: (args: {
|
|
repoPath: string
|
|
state?: 'opened' | 'merged' | 'closed' | 'all'
|
|
page?: number
|
|
perPage?: number
|
|
}): Promise<unknown> => ipcRenderer.invoke('gitlab:listMRs', args),
|
|
|
|
listWorkItems: (args: {
|
|
repoPath: string
|
|
state?: 'opened' | 'merged' | 'closed' | 'all'
|
|
page?: number
|
|
perPage?: number
|
|
}): Promise<unknown> => ipcRenderer.invoke('gitlab:listWorkItems', args),
|
|
|
|
issue: (args: { repoPath: string; number: number }): Promise<unknown> =>
|
|
ipcRenderer.invoke('gitlab:issue', args),
|
|
|
|
listIssues: (args: {
|
|
repoPath: string
|
|
state?: 'opened' | 'closed' | 'all'
|
|
assignee?: string
|
|
limit?: number
|
|
}): Promise<{ items: unknown[]; error?: unknown }> =>
|
|
ipcRenderer.invoke('gitlab:listIssues', args),
|
|
|
|
createIssue: (args: {
|
|
repoPath: string
|
|
title: string
|
|
body: string
|
|
}): Promise<{ ok: true; number: number; url: string } | { ok: false; error: string }> =>
|
|
ipcRenderer.invoke('gitlab:createIssue', args),
|
|
|
|
updateIssue: (args: {
|
|
repoPath: string
|
|
number: number
|
|
updates: unknown
|
|
}): Promise<{ ok: true } | { ok: false; error: string }> =>
|
|
ipcRenderer.invoke('gitlab:updateIssue', args),
|
|
|
|
addIssueComment: (args: { repoPath: string; number: number; body: string }): Promise<unknown> =>
|
|
ipcRenderer.invoke('gitlab:addIssueComment', args),
|
|
|
|
listLabels: (args: { repoPath: string }): Promise<string[]> =>
|
|
ipcRenderer.invoke('gitlab:listLabels', args),
|
|
|
|
listAssignableUsers: (args: { repoPath: string }): Promise<unknown[]> =>
|
|
ipcRenderer.invoke('gitlab:listAssignableUsers', args),
|
|
|
|
todos: (args: { repoPath: string }): Promise<unknown[]> =>
|
|
ipcRenderer.invoke('gitlab:todos', args),
|
|
|
|
workItemDetails: (args: {
|
|
repoPath: string
|
|
iid: number
|
|
type: 'issue' | 'mr'
|
|
}): Promise<unknown> => ipcRenderer.invoke('gitlab:workItemDetails', args),
|
|
|
|
closeMR: (args: {
|
|
repoPath: string
|
|
iid: number
|
|
}): Promise<{ ok: true } | { ok: false; error: string }> =>
|
|
ipcRenderer.invoke('gitlab:closeMR', args),
|
|
|
|
reopenMR: (args: {
|
|
repoPath: string
|
|
iid: number
|
|
}): Promise<{ ok: true } | { ok: false; error: string }> =>
|
|
ipcRenderer.invoke('gitlab:reopenMR', args),
|
|
|
|
mergeMR: (args: {
|
|
repoPath: string
|
|
iid: number
|
|
method?: 'merge' | 'squash' | 'rebase'
|
|
}): Promise<{ ok: true } | { ok: false; error: string }> =>
|
|
ipcRenderer.invoke('gitlab:mergeMR', args),
|
|
|
|
addMRComment: (args: { repoPath: string; iid: number; body: string }): Promise<unknown> =>
|
|
ipcRenderer.invoke('gitlab:addMRComment', args),
|
|
|
|
workItemByPath: (args: {
|
|
repoPath: string
|
|
host: string
|
|
path: string
|
|
iid: number
|
|
type: 'issue' | 'mr'
|
|
}): Promise<unknown> => ipcRenderer.invoke('gitlab:workItemByPath', args)
|
|
}
|