diff --git a/.agents/notes/implemented/feature/2026-11-11-forge-review-page.i18n.yaml b/.agents/notes/implemented/feature/2026-11-11-forge-review-page.i18n.yaml index ea1862a84e..20b8a24784 100644 --- a/.agents/notes/implemented/feature/2026-11-11-forge-review-page.i18n.yaml +++ b/.agents/notes/implemented/feature/2026-11-11-forge-review-page.i18n.yaml @@ -9,8 +9,8 @@ en: ad1da0c97cfc9c2d zh: f4420c0b004fd189 /agent-note-code-review-page/decision: - en: b0ba35d7c5818dc3 - zh: 5414ec6190be0726 + en: 1b41b08e216af622 + zh: e76b77274c20eaad /agent-note-code-review-page/alternatives-considered: en: 963b1be39a0e4bac zh: 940b86a5e2036477 diff --git a/.agents/notes/implemented/feature/2026-11-11-forge-review-page.md b/.agents/notes/implemented/feature/2026-11-11-forge-review-page.md index 205baefe8f..ac3bd903f1 100644 --- a/.agents/notes/implemented/feature/2026-11-11-forge-review-page.md +++ b/.agents/notes/implemented/feature/2026-11-11-forge-review-page.md @@ -15,9 +15,11 @@ A left-navigation Code review page in [`dsh-experimental-client-ui-forge`](../.. - **Lists** — an optional `ForgeProvider` capability (`viewer`, `listForViewer`, `countForViewer`) returns summaries of open change requests; GitHub answers each list with one GraphQL search, because one document with several searches times out. The Host reads the lists only while a page or count stream lasts, outside the forge's status polling, since a batch snapshot of dozens of change requests exceeds GitHub's query timeout; only the shown change request is polled through `ForgeService.watch`. - **Reads by URL** — the page's `forgePanel/review*` methods name a change request by URL and no Session; they share the Session-bound methods' implementation and are reachable only by callers that may use the Host's code host credentials. - **Description** — `readDescription` returns the Markdown body, labels, and signed addresses for private attachments, which the page substitutes before rendering with HTML omitted. +- **Activity** — two more optional `ForgeProvider` methods, `readActivity` and `addComment`, give the summary tab the comments, submitted reviews, commits, and changes of state of a change request and a field that adds a comment. A provider maps its host's records to one entry type, so the page words every entry in the reader's language and shows a host's own sentence only for a record the type has no kind for. A review's comments on lines stay on the changes tab, which already reads, answers, and resolves them; the activity counts them and opens that tab. +- **Automatic merge** — a snapshot's optional `autoMerge` and the optional `ForgeProvider.setAutoMerge` let the merge action turn the host's automatic merge on for a confirmed head, show that it is on, and cancel it. The field is optional so a provider that sets none changes nothing, and the snapshot carries what the signed-in user may do, so no surface asks the host before it draws the button. Merge queues and merge trains stay out: there the same button would queue the change request, which is another action. - **Changes** — the page draws the changes view itself, split from the right-sidebar tab, with a panel state that holds only the shown change request; plugin lenses, annotations, and slots stay with the Session tab, whose extension points name a Session. - **Chat** — the chat tab embeds `conversation.content` for the blank Session `connectWorkspace` resolves in the Workspace named like the repository, and never offers an existing conversation. A Workspace picked in the Hero is handled by the page, as every owner of the content handles its own picks: the page connects that Workspace's blank and shows it in the chat tab, where the main Conversation opens it as the main Session. The change request is bound when the Session's first message enters its inbox, so a blank that is never used stays unbound. -- **Hosts** — the page lists every configured host together; choosing among hosts and accounts waits for a second provider that lists change requests. +- **Hosts** — the page lists every configured host together, GitHub and GitLab. A host whose read failed is read again later each time without delaying the others, since the bundle ships a GitLab host most users are not signed in to. A repository scope names its host and is read there only: one `owner/name` can exist on two hosts, and a GitLab project path nests groups. The filter offers each host once the lists span several, and a host that could not be read shows one notice after the lists. A row names no host, because every row would then need a second line of small text; choosing among accounts of one host is not offered. ## Alternatives considered diff --git a/.agents/notes/implemented/feature/2026-11-11-forge-review-page.zh.md b/.agents/notes/implemented/feature/2026-11-11-forge-review-page.zh.md index 3c342919a6..734425db80 100644 --- a/.agents/notes/implemented/feature/2026-11-11-forge-review-page.zh.md +++ b/.agents/notes/implemented/feature/2026-11-11-forge-review-page.zh.md @@ -15,9 +15,11 @@ Status: implemented - **列表**——可选的 `ForgeProvider` 能力(`viewer`、`listForViewer`、`countForViewer`)返回未关闭变更请求的摘要;GitHub 每个列表用一次 GraphQL 搜索回答,因为在一个文档中放多个搜索会超时。Host 只在页面流或计数流存在时读取列表,不经过 forge 的状态轮询,因为几十个变更请求的批量快照会超过 GitHub 的查询时限;只有显示中的变更请求经 `ForgeService.watch` 轮询。 - **按 URL 读取**——页面的 `forgePanel/review*` 方法以 URL 而不是会话指定变更请求;它们与会话绑定的方法共用实现,只有可以使用 Host 代码托管凭据的调用方能访问。 - **描述**——`readDescription` 返回 Markdown 正文、标签以及私有附件的签名地址,页面替换这些地址后以省略 HTML 的方式渲染。 +- **动态**——另外两个可选的 `ForgeProvider` 方法 `readActivity` 与 `addComment` 为概要标签页提供变更请求的评论、已提交的评审、提交和状态变化,以及一个添加评论的输入框。提供方把所在主机的记录映射为同一种条目类型,所以页面用读者的语言表述每个条目,只有该类型没有对应种类的记录才显示主机自己的句子。评审在行上留下的评论仍在变更标签页,那里已经能读取、回复和解决它们;动态只显示条数并打开该标签页。 +- **自动合并**——快照可选的 `autoMerge` 与可选的 `ForgeProvider.setAutoMerge` 让合并操作可以为确认过的 head 启用平台的自动合并、显示它已启用,并取消它。该字段是可选的,所以不设置自动合并的提供方不受影响;快照带着当前用户能做什么,所以任何界面在绘制按钮前都不必询问平台。合并队列与合并列车不在其中:在那里同一个按钮会把变更请求加入队列,那是另一种操作。 - **变更**——页面自己绘制变更视图(从右侧栏标签中拆出),面板状态只含显示中的变更请求;插件的透镜、行注释和插槽仍只在会话标签中,因为这些扩展点以会话为对象。 - **对话**——对话标签为 `connectWorkspace` 在与仓库同名的工作区中解析出的空白会话嵌入 `conversation.content`,从不提供已有对话。在 Hero 中选择工作区由页面自己处理,这与内容的每个属主处理各自的选择一致:页面连接该工作区的空白会话并在对话标签中显示它,而主 Conversation 会把它打开为主会话。该会话的首条消息进入收件箱时才绑定变更请求,因此从未使用的空白会话保持未绑定。 -- **主机**——页面把所有已配置的主机合并列出;在主机与账号之间选择要等到第二个能列出变更请求的提供方。 +- **主机**——页面把所有已配置的主机合并列出,包括 GitHub 与 GitLab。读取失败的主机每次间隔更久再读,不拖慢其他主机,因为套件自带的 GitLab 主机多数用户并未登录。仓库范围带有主机,只在该主机上读取:同一个 `owner/name` 可以存在于两个主机,GitLab 的项目路径还有嵌套分组。列表跨多个主机时,筛选列出每个主机;读取失败的主机在列表之后显示一条提示。列表行不写主机,否则每一行都要多一行小字;同一主机的多个账号之间不提供选择。 ## Alternatives considered diff --git a/apps/web/tests/expected/forge-panel/changes-view.expected.md b/apps/web/tests/expected/forge-panel/changes-view.expected.md index 1e3111ba0c..72b2900bcb 100644 --- a/apps/web/tests/expected/forge-panel/changes-view.expected.md +++ b/apps/web/tests/expected/forge-panel/changes-view.expected.md @@ -2,7 +2,7 @@ - text: "Add the pull request panel #7" - button "查看的提交:全部提交": 全部提交 - button "提交评审" -- button "在浏览器中打开" +- button "在 GitHub 中打开" - button "全部 2 个文件" - button "分层透镜:全部": 全部 - switch "隐藏测试文件" diff --git a/apps/web/tests/expected/forge-panel/extension-annotations.expected.md b/apps/web/tests/expected/forge-panel/extension-annotations.expected.md index dcb20c165d..e8ea06890e 100644 --- a/apps/web/tests/expected/forge-panel/extension-annotations.expected.md +++ b/apps/web/tests/expected/forge-panel/extension-annotations.expected.md @@ -2,7 +2,7 @@ - text: "Add the pull request panel #7" - button "查看的提交:全部提交": 全部提交 - button "提交评审" -- button "在浏览器中打开" +- button "在 GitHub 中打开" - radiogroup "分层透镜": - radio "全部 6" [checked] - radio "接口 1" diff --git a/apps/web/tests/expected/forge-panel/extension-lens.expected.md b/apps/web/tests/expected/forge-panel/extension-lens.expected.md index e1ec761358..5c6e057051 100644 --- a/apps/web/tests/expected/forge-panel/extension-lens.expected.md +++ b/apps/web/tests/expected/forge-panel/extension-lens.expected.md @@ -2,7 +2,7 @@ - text: "Add the pull request panel #7" - button "查看的提交:全部提交": 全部提交 - button "提交评审" -- button "在浏览器中打开" +- button "在 GitHub 中打开" - radiogroup "分层透镜": - radio "全部 1" [checked] - radio "接口 0" diff --git a/apps/web/tests/expected/forge-panel/file-tree-toggle.expected.md b/apps/web/tests/expected/forge-panel/file-tree-toggle.expected.md index e7f09431a2..50582f8b66 100644 --- a/apps/web/tests/expected/forge-panel/file-tree-toggle.expected.md +++ b/apps/web/tests/expected/forge-panel/file-tree-toggle.expected.md @@ -2,7 +2,7 @@ - text: "Add the pull request panel #7" - button "查看的提交:全部提交": 全部提交 - button "提交评审" -- button "在浏览器中打开" +- button "在 GitHub 中打开" - radiogroup "分层透镜": - radio "全部 2" [checked] - radio "接口 0" diff --git a/apps/web/tests/expected/forge-panel/review-layers.expected.md b/apps/web/tests/expected/forge-panel/review-layers.expected.md index e160dbbd40..41dcd33c6c 100644 --- a/apps/web/tests/expected/forge-panel/review-layers.expected.md +++ b/apps/web/tests/expected/forge-panel/review-layers.expected.md @@ -2,7 +2,7 @@ - text: "Add the pull request panel #7" - button "查看的提交:全部提交": 全部提交 - button "提交评审" -- button "在浏览器中打开" +- button "在 GitHub 中打开" - radiogroup "分层透镜": - radio "全部 3" [checked] - radio "接口 1" diff --git a/apps/web/tests/forge-panel.e2e.ts b/apps/web/tests/forge-panel.e2e.ts index ff6cae3532..061062c068 100644 --- a/apps/web/tests/forge-panel.e2e.ts +++ b/apps/web/tests/forge-panel.e2e.ts @@ -143,6 +143,13 @@ if (args[0] === 'api' && args[3] === '-H' && args[4] === 'Accept: application/vn process.stdout.write(text) process.exit(0) } +if (args[0] === 'api' && args[3] === '--method' && args[4] === 'POST' && args[5] === 'repos/octo/demo/issues/7/comments') { + const { body } = JSON.parse(readFileSync(0, 'utf8')) + state.comments = [...state.comments ?? [], { body, at: new Date().toISOString() }] + save() + process.stdout.write(JSON.stringify({ id: 1000 + state.comments.length, html_url: 'https://github.com/octo/demo/pull/7#issuecomment-1' })) + process.exit(0) +} if (args[0] === 'api' && args[3] === '--method' && args[4] === 'POST' && args[5].startsWith('repos/octo/demo/actions/')) { appendFileSync(join(here, 'reruns.jsonl'), args[5] + '\\n') state.reruns = [...state.reruns ?? [], args[5]] @@ -186,6 +193,10 @@ if (args[0] === 'api' && args[1] === 'graphql' && args.includes('--input')) { } state.updated = variables.input.updateMethod payload = { clientMutationId: null } + } else if (field === 'enablePullRequestAutoMerge' || field === 'disablePullRequestAutoMerge') { + // The automatic merge of pull request 7, which later status reads report. + state.autoMerge = field === 'enablePullRequestAutoMerge' ? variables.input.mergeMethod : null + payload = { clientMutationId: null } } else if (field === 'addPullRequestReview') { current.pending = { id: 'review-1', commit: variables.commit, threads: [] } for (const thread of variables.threads ?? []) current.pending.threads.push(draft(thread)) @@ -230,6 +241,52 @@ if (args[0] === 'api' && args[1] === 'graphql') { }) const overview = existsSync(join(here, 'overview.json')) ? JSON.parse(readFileSync(join(here, 'overview.json'), 'utf8')) : {} const none = { totalCount: 0, nodes: [] } + if (query.includes('bodyHTML')) { + process.stdout.write(JSON.stringify({ data: { repository: { pullRequest: { + body: 'Adds the panel.', bodyHTML: '

Adds the panel.

', createdAt: '2026-10-08T00:00:00Z', labels: none, + } } } })) + process.exit(0) + } + if (query.includes('timelineItems(')) { + const account = login => ({ __typename: 'User', login, avatarUrl: null }) + const commit = (oid, messageHeadline) => ({ __typename: 'PullRequestCommit', + commit: { oid: oid.repeat(40), messageHeadline, committedDate: '2026-10-08T01:00:00Z', author: { user: account('octo') } } }) + const comment = (body, createdAt, login) => ({ __typename: 'IssueComment', createdAt, body, author: account(login), + url: 'https://github.com/octo/demo/pull/7#issuecomment-1' }) + process.stdout.write(JSON.stringify({ data: { repository: { isArchived: false, viewerPermission: 'WRITE', pullRequest: { + locked: false, merged: false, timelineItems: { pageInfo: { hasPreviousPage: false }, nodes: [ + commit('d', 'Add the panel'), commit('e', 'Fix the build'), + { __typename: 'ReviewRequestedEvent', createdAt: '2026-10-08T02:00:00Z', actor: account('octo'), requestedReviewer: { login: 'mona' } }, + { __typename: 'PullRequestReview', createdAt: '2026-10-08T03:00:00Z', submittedAt: '2026-10-08T03:00:00Z', body: '', state: 'APPROVED', + url: 'https://github.com/octo/demo/pull/7#pullrequestreview-1', author: account('mona'), comments: { totalCount: 0 } }, + comment('Looks **good** to me.', '2026-10-08T04:00:00Z', 'mona'), + ...(state.comments ?? []).map(posted => comment(posted.body, posted.at, 'octocat')), + ] }, + } } } })) + process.exit(0) + } + if (query.includes('search(type: ISSUE')) { + // The review page's lists and their count, which only a case that writes lists.json shows. + if (!existsSync(join(here, 'lists.json'))) { + process.stderr.write('no lists fixture\\n') + process.exit(1) + } + const lists = JSON.parse(readFileSync(join(here, 'lists.json'), 'utf8')) + if (query.includes('review: search(')) { + process.stdout.write(JSON.stringify({ data: { review: { issueCount: lists['review-requested'].length }, + authored: { issueCount: lists.authored.length }, involved: { issueCount: lists.involved.length } } })) + process.exit(0) + } + const q = args.find(arg => arg.startsWith('q=')).slice(2) + const filter = q.includes('involves:@me') ? 'involved' : q.includes('review-requested:@me') ? 'review-requested' : 'authored' + const row = number => ({ __typename: 'PullRequest', number, title: 'Pull request ' + number, url: 'https://github.com/octo/demo/pull/' + number, isDraft: false, + updatedAt: new Date(Date.now() - 5 * 60000).toISOString(), headRefOid: 'a'.repeat(40), reviewDecision: null, + repository: { name: 'demo', owner: { login: 'octo' } }, author: { __typename: 'User', login: 'octo', avatarUrl: null }, + commits: { nodes: [{ commit: { statusCheckRollup: { state: 'SUCCESS' } } }] }, viewerLatestReview: null, + viewerLatestReviewRequest: filter === 'review-requested' ? { requestedReviewer: { __typename: 'User' } } : null }) + process.stdout.write(JSON.stringify({ data: { viewer: { login: VIEWER }, search: { issueCount: lists[filter].length, nodes: lists[filter].map(row) } } })) + process.exit(0) + } const requested = (state.requested ?? []).map(login => ({ asCodeOwner: false, requestedReviewer: { __typename: 'User', login, avatarUrl: null } })) const requests = overview.reviewRequests ?? none const reviewing = { totalCount: requests.totalCount + requested.length, nodes: [...requests.nodes, ...requested] } @@ -244,6 +301,9 @@ if (args[0] === 'api' && args[1] === 'graphql') { nodes: Array.from({ length: 100 }, (_, i) => check('lint', 'FAILURE', '2026-10-08T00:00:42Z', i + 1)), } } } }] }, viewerCanUpdateBranch: (overview.viewerCanUpdateBranch ?? false) && state.updated === undefined, canBeRebased: overview.canBeRebased ?? false, + viewerCanEnableAutoMerge: (overview.autoMergeAllowed ?? false) && (state.autoMerge ?? null) === null, + viewerCanDisableAutoMerge: (state.autoMerge ?? null) !== null, isMergeQueueEnabled: false, + autoMergeRequest: (state.autoMerge ?? null) === null ? null : { mergeMethod: state.autoMerge, enabledBy: { login: VIEWER } }, reviewRequests: reviewing, latestReviews: overview.latestReviews ?? none, latestOpinionatedReviews: overview.latestOpinionatedReviews ?? none, closingIssuesReferences: overview.closingIssues ?? none, ...overview.mergeable === undefined ? {} : { mergeable: overview.mergeable }, @@ -258,6 +318,7 @@ if (args[0] === 'api' && args[1] === 'graphql') { pageInfo: { hasNextPage: false, endCursor: null }, nodes: [check('lint', 'SUCCESS', '2026-10-09T00:00:42Z')], } } } }] }, viewerCanUpdateBranch: false, canBeRebased: true, reviewRequests: none, latestReviews: none, latestOpinionatedReviews: none, + viewerCanEnableAutoMerge: false, viewerCanDisableAutoMerge: false, isMergeQueueEnabled: false, autoMergeRequest: null, closingIssuesReferences: none, }, } @@ -472,12 +533,43 @@ interface PanelLaunch { readonly tripwire: ReturnType } +/** + * A GitLab CLI double for the review page's lists on gitlab.com: user `lin` is asked to review merge request 12 of the + * nested-group project `group/sub/app`, updated three minutes before each read, and has no other merge request. + */ +const GLAB = `#!/usr/bin/env node +import { readFileSync } from 'node:fs' +const args = process.argv.slice(2) +if (args[0] === 'api' && args[1] === 'graphql') { + const { query, variables } = JSON.parse(readFileSync(0, 'utf8')) + const row = { iid: '12', title: 'Fix the gateway timeout', webUrl: 'https://gitlab.com/group/sub/app/-/merge_requests/12', draft: false, + updatedAt: new Date(Date.now() - 3 * 60000).toISOString(), diffHeadSha: 'c'.repeat(40), approved: false, + author: { username: 'mona', avatarUrl: null, bot: false }, project: { fullPath: 'group/sub/app' }, headPipeline: { status: 'SUCCESS' }, + reviewers: { nodes: [{ username: 'lin', mergeRequestInteraction: { reviewState: 'UNREVIEWED' } }] } } + const page = nodes => ({ count: nodes.length, nodes }) + const listed = variables.project === null || variables.project === 'group/sub/app' ? [row] : [] + const user = query.includes('awaited:') ? { awaited: { count: 1 }, authored: { count: 0 }, reviewed: { count: 0 }, assigned: { count: 0 } } + : query.includes('reviewed:') ? { reviewed: page([]), assigned: page([]) } + : query.includes('list: reviewRequestedMergeRequests') ? { list: page(listed) } + : query.includes('list: authoredMergeRequests') ? { list: page([]) } : {} + process.stdout.write(JSON.stringify({ data: { currentUser: { username: 'lin', ...user } } })) + process.exit(0) +} +if (args[0] === 'api') { + process.stdout.write(JSON.stringify({ username: 'lin' })) + process.exit(0) +} +process.stderr.write('unexpected glab call\\n') +process.exit(1) +` + /** * Launch the bundle against a GitHub checkout of `main` and `release` and open the New Session screen of that workspace. * @param failureShot - name of the screenshot saved when the test fails. * @param scenario - normal conversation, a restoration follow-up, or a numbered PR lookup through `bash` or a PTC program. - * @param options - desktop transport, checkout branch, browser input, sandbox runner availability, diff output limit, and - * whether the extension fixture plugin loads. + * @param options - desktop transport, checkout branch, browser input, sandbox runner availability, diff output limit, + * whether the extension fixture plugin loads, the pull requests each review page list of github.com holds, and whether + * the GitLab provider runs {@link GLAB} instead of the machine's GitLab CLI. * @returns the scaffold, page, and checkout. */ async function launchPanel(failureShot: string, scenario: 'normal' | 'follow-up' | 'reference' | 'ptc-reference' = 'normal', @@ -488,6 +580,8 @@ async function launchPanel(failureShot: string, scenario: 'normal' | 'follow-up' missingSandbox?: boolean maxDiffBytes?: number extension?: boolean + lists?: Readonly> + glab?: boolean } = {}): Promise { const { desktop } = options const resources: { scaffold?: WebScaffold; browser?: Browser } = {} @@ -502,12 +596,19 @@ async function launchPanel(failureShot: string, scenario: 'normal' | 'follow-up' const gh = join(root, 'gh') await writeFile(gh, GH) await chmod(gh, 0o755) + if (options.lists !== undefined) await writeFile(join(root, 'lists.json'), JSON.stringify(options.lists)) + const glab = join(root, 'glab') + if (options.glab === true) { + await writeFile(glab, GLAB) + await chmod(glab, 0o755) + } await writeFile(join(root, 'pr-7.diff'), PR7_DIFF) await writeFile(join(root, 'pr-9.diff'), PR9_DIFF) const panelText = `${Array.from({ length: 20 }, (_, index) => panelLine(index + 1, 'new')).join('\n')}\n` await writeFile(join(root, 'contents.json'), JSON.stringify({ [`src/panel.ts@${HEAD7}`]: panelText })) const overlay = join(root, 'forge.patch.yml') await writeFile(overlay, `- id: forge-github\n config: ${JSON.stringify({ ghCommand: gh })}\n` + + (options.glab === true ? `- id: forge-gitlab\n config: ${JSON.stringify({ glabCommand: glab })}\n` : '') + (options.maxDiffBytes === undefined ? '' : `- id: forge-panel\n config: ${JSON.stringify({ maxDiffBytes: options.maxDiffBytes })}\n`) + (options.missingSandbox ? `- id: sandbox\n config: ${JSON.stringify({ runnerCommand: [join(root, 'missing-sandbox')], runnerFailureSignatures: ['sandbox startup failed'] })}\n` : '')) const override = join(root, 'replay.override.json') @@ -768,6 +869,188 @@ it.skipIf(MODE === 'record')('reports incomplete filter configuration and retrie expect(tripwire.warnings).toEqual([]) }) +it.skipIf(MODE === 'record')('lists the change requests of a GitHub and a GitLab host on the Code review page and narrows them to one host or project', async () => { + const { scaffold, page, tripwire } = await launchPanel('web-e2e-forge-review-lists', 'normal', { + glab: true, lists: { 'review-requested': [7], 'authored': [], 'involved': [] }, + }) + // The scaffold expects its recorded model call to be consumed, so the borrowed conversation runs first. + const { settled } = await sendPrompt(page, scaffold) + await settled + const entry = page.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '代码评审', exact: true }) + // The navigation entry counts the requests of both hosts. + await page.getByRole('button', { name: '代码评审', exact: true, description: '2 个变更请求等你评审' }).waitFor() + await entry.click() + const list = page.locator('[data-forge-review-list]') + const requested = list.locator('[data-forge-review-section="review-requested"]') + const items = requested.locator('[data-forge-review-item]') + const shown = async (): Promise<(string | null)[]> => await items.evaluateAll(rows => rows.map(row => row.textContent)) + const MERGE = 'https://gitlab.com/group/sub/app/-/merge_requests/12' + + // Both hosts' change requests show together, most recently updated first, each on a card without a closing issue. + await list.locator(`[data-forge-review-item="${MERGE}"]`).waitFor() + await list.locator(`[data-forge-review-item="${PULL}"]`).waitFor() + await expect.poll(shown).toEqual([ + expect.stringMatching(/^Fix the gateway timeoutapp#12·mona\d+分钟$/), expect.stringMatching(/^Pull request 7demo#7·octo\d+分钟$/), + ]) + expect(await requested.getByRole('button', { name: /待我评审/ }).textContent()).toBe('待我评审2') + expect(await list.locator('[data-forge-review-failure]').count()).toBe(0) + + // The repository submenu offers each host with its repositories below it; a host narrows the lists on the page. + await list.getByRole('button', { name: '筛选', exact: true }).click() + await page.getByRole('menuitem', { name: /^仓库/ }).click() + const offered = page.getByRole('menu').last().getByRole('menuitem') + await expect.poll(async () => await offered.allTextContents()).toEqual(['全部仓库', 'github.com', 'octo/demo', 'gitlab.com', 'group/sub/app']) + await offered.filter({ hasText: 'gitlab.com' }).click() + // One repository is left in the lists, so its name leaves the card. + await expect.poll(shown).toEqual([expect.stringMatching(/^Fix the gateway timeout#12·mona\d+分钟$/)]) + expect(await requested.getByRole('button', { name: /待我评审/ }).textContent()).toBe('待我评审1') + + // A project in a nested group is one choice, read on its own host only: GitHub is not asked for it, so no host fails. + await list.getByRole('button', { name: '筛选', exact: true }).click() + expect(await page.getByRole('menuitem', { name: /^仓库/ }).textContent()).toBe('仓库gitlab.com') + await page.getByRole('menuitem', { name: /^仓库/ }).click() + await page.getByRole('menu').last().getByRole('menuitem', { name: 'group/sub/app', exact: true }).click() + await expect.poll(shown).toEqual([expect.stringMatching(/^Fix the gateway timeout#12·mona\d+分钟$/)]) + expect(await list.locator('[data-forge-review-item]').count()).toBe(1) + expect(await list.locator('[data-forge-review-failure]').count()).toBe(0) + expect(tripwire.pageErrors).toEqual([]) + expect(tripwire.warnings).toEqual([]) +}) + +it.skipIf(MODE === 'record')('shows the activity of a pull request on the Code review page and adds a comment to it', async () => { + const { scaffold, page, root, tripwire } = await launchPanel('web-e2e-forge-review-activity', 'normal', { + lists: { 'review-requested': [7], 'authored': [], 'involved': [] }, + }) + // The scaffold expects its recorded model call to be consumed, so the borrowed conversation runs first. + const { settled } = await sendPrompt(page, scaffold) + await settled + await page.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '代码评审', exact: true }).click() + await page.locator(`[data-forge-review-item="${PULL}"]`).click() + const activity = page.locator(`[data-forge-review-detail="${PULL}"]`).getByRole('region', { name: '动态', exact: true }) + + // Commits fold into one line; the review request, the approval, and the comment follow in the code host's order. + const lines = async (): Promise => await activity.locator('[data-forge-review-line]') + .evaluateAll(rows => rows.map(row => (row.textContent ?? '').replace(/\d+ ?(天|个月|年)前.*$/, ''))) + await expect.poll(lines).toEqual(['2 次提交', 'octo 请求 mona 评审', 'mona 批准了这些更改']) + const comments = activity.locator('[data-forge-review-comment]') + await expect.poll(async () => await comments.count()).toBe(1) + expect(await comments.first().locator('strong').textContent()).toBe('good') + await activity.getByRole('button', { name: '2 次提交', exact: true }).click() + await expect.poll(lines).toEqual(['2 次提交', 'Add the panel', 'Fix the build', 'octo 请求 mona 评审', 'mona 批准了这些更改']) + + // A comment goes to the pull request's conversation in one request and then shows at the end of the activity. + const field = activity.getByRole('textbox', { name: '留下评论', exact: true }) + const send = activity.getByRole('button', { name: '评论', exact: true }) + expect(await send.isDisabled()).toBe(true) + await field.fill('Thanks for the fix') + await send.click() + await expect.poll(async () => await comments.count()).toBe(2) + expect(await comments.last().textContent()).toContain('Thanks for the fix') + expect(await field.inputValue()).toBe('') + const calls = (await readFile(join(root, 'calls.jsonl'), 'utf8')).trim().split('\n').map(line => JSON.parse(line) as string[]) + expect(calls.filter(call => call[4] === 'POST')) + .toEqual([['api', '--hostname', 'github.com', '--method', 'POST', 'repos/octo/demo/issues/7/comments', '--input', '-']]) + expect(tripwire.pageErrors).toEqual([]) + expect(tripwire.warnings).toEqual([]) +}) + +it.skipIf(MODE === 'record')('keeps the link actions in the detail header, folds them when it is narrow, and turns the automatic merge on and off', async () => { + const { scaffold, page, root, tripwire } = await launchPanel('web-e2e-forge-review-header', 'normal', { + lists: { 'review-requested': [7], 'authored': [], 'involved': [] }, + }) + // Pull request 7 is blocked by its checks and its review; the repository lets the viewer turn the automatic merge on. + await writeFile(join(root, 'overview.json'), JSON.stringify({ viewerPermission: 'WRITE', autoMergeAllowed: true })) + // The scaffold expects its recorded model call to be consumed, so the borrowed conversation runs first. + const { settled } = await sendPrompt(page, scaffold) + await settled + await page.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '代码评审', exact: true }).click() + await page.locator(`[data-forge-review-item="${PULL}"]`).click() + const detail = page.locator(`[data-forge-review-detail="${PULL}"]`) + await detail.getByRole('heading', { level: 1, name: 'Add the pull request panel' }).waitFor() + + // The three link actions show as buttons, the first with the code host's name; the menu that folds them is hidden. + const links = detail.locator('[data-forge-review-actions]') + const more = detail.getByRole('button', { name: '更多操作', exact: true }) + expect(await links.getByRole('button').evaluateAll(buttons => buttons.map(button => button.getAttribute('aria-label')))) + .toEqual(['在 GitHub 中打开', '复制链接', '刷新状态']) + expect(await more.isVisible()).toBe(false) + + // The status column's two action lines span their blocks like a check's line, so each highlights across its block. + const lineWidth = async (line: string): Promise => (await detail.locator(line).first().boundingBox())?.width + await detail.locator('[data-forge-review-request]').waitFor() + const checkLine = await lineWidth('[data-forge-check-item]') + expect(checkLine).toBeGreaterThan(200) + expect(await lineWidth('[data-forge-review-rerun]')).toBe(checkLine) + expect(await lineWidth('[data-forge-review-request]')).toBe(checkLine) + + // The automatic merge: on for the head the page shows, then the state with its cancellation. + await detail.getByRole('button', { name: '自动合并', exact: true }).click() + await page.getByRole('menu').getByText('满足合并条件后,将 #7 合并到 main', { exact: true }).waitFor() + await page.getByRole('menuitem', { name: '启用自动合并', exact: true }).click() + const enabled = detail.getByRole('button', { name: '已启用自动合并', exact: true }) + await enabled.waitFor() + await enabled.click() + await page.getByRole('menu').getByText(/由 lin 启用/).waitFor() + await page.getByRole('menuitem', { name: '取消自动合并', exact: true }).click() + await detail.getByRole('button', { name: '自动合并', exact: true }).waitFor() + const mutations = (await readFile(join(root, 'mutations.jsonl'), 'utf8')).trim().split('\n').map((line): unknown => JSON.parse(line)) + expect(mutations).toEqual([ + { field: 'enablePullRequestAutoMerge', variables: { input: { pullRequestId: 'pull-7', mergeMethod: 'SQUASH', expectedHeadOid: HEAD7 } } }, + { field: 'disablePullRequestAutoMerge', variables: { input: { pullRequestId: 'pull-7' } } }, + ]) + + // A narrow detail folds the three link actions into the menu and keeps the merge action beside it on one row. + await page.setViewportSize({ width: 700, height: 900 }) + await more.waitFor() + expect(await links.isVisible()).toBe(false) + // The sidebar leaves the page a frame after the window narrows; until then the detail is narrower and its bar has two rows. + await expect.poll(async () => (await detail.locator('header > div').first().boundingBox())?.height).toBe(32) + await more.click() + expect(await page.getByRole('menu').getByRole('menuitem').allTextContents()).toEqual(['在 GitHub 中打开', '复制变更请求链接', '刷新状态']) + expect(tripwire.pageErrors).toEqual([]) + expect(tripwire.warnings).toEqual([]) +}) + +it.skipIf(MODE === 'record')('adds a host on the GitLab row of the Plugins page, which the provider serves without a restart', async () => { + const { scaffold, page, tripwire } = await launchPanel('web-e2e-forge-hosts') + // The scaffold expects its recorded model call to be consumed, so the borrowed conversation runs first. + const { settled } = await sendPrompt(page, scaffold) + await settled + const merge = 'https://gitlab.example.test/group/app/-/merge_requests/3' + expect(scaffold.ctx.forge.changeRequestFromUrl(merge)).toBeUndefined() + await page.getByRole('navigation', { name: '全局面板' }).getByRole('button', { name: '插件', exact: true }).click() + await page.locator('[data-plugin-panel]').getByText('变更请求与工作树', { exact: true }).first().click() + await page.getByRole('button', { name: '配置 GitLab 变更请求', exact: true }).click() + const hosts = page.getByRole('list', { name: '主机', exact: true }) + await hosts.locator('[data-forge-host="gitlab.com"]').waitFor() + const input = page.getByRole('textbox', { name: '要添加的主机', exact: true }) + + // The GitHub row serves github.com, and a host has one provider. + await input.fill('github.com') + await input.press('Enter') + await page.getByRole('alert').filter({ hasText: 'github.com 已由 GitHub 组件使用' }).waitFor() + expect(await hosts.getByRole('listitem').count()).toBe(1) + + await input.fill(merge) + await input.press('Enter') + const added = hosts.locator('[data-forge-host="gitlab.example.test"]') + const unsaved = added.getByText('未保存', { exact: true }) + await unsaved.waitFor() + expect(scaffold.ctx.forge.changeRequestFromUrl(merge)).toBeUndefined() + await page.getByRole('button', { name: '保存', exact: true }).click() + // The sign-in state that takes the mark's place depends on the GitLab CLI of the machine, so only the mark's removal is expected. + await unsaved.waitFor({ state: 'detached' }) + + expect(scaffold.ctx.forge.changeRequestFromUrl(merge)).toEqual({ + repository: { forge: 'gitlab', host: 'gitlab.example.test', owner: 'group', name: 'app' }, number: 3, + }) + expect(scaffold.ctx.forge.changeRequestFromUrl('https://gitlab.com/group/app/-/merge_requests/3')).toBeDefined() + expect(scaffold.ctx.forge.changeRequestFromUrl(PULL)).toBeDefined() + expect(await readFile(scaffold.ctx.settings.documentPath, 'utf8')).toMatch(/- id: forge-gitlab\n(?: .*\n)* +hosts:\n +- gitlab\.com\n +- gitlab\.example\.test\n/) + expect(tripwire.pageErrors).toEqual([]) + expect(tripwire.warnings).toEqual([]) +}) + /** * Expect the panel to show PR 7, which the model viewed by number without its URL in the output, and the lookup that resolved it. * @param launch - the panel launched for a reference scenario. @@ -1436,7 +1719,7 @@ it.skipIf(MODE === 'record')('shows the local changes of the Session by scope an if (await expand.count() > 0) await expand.click() await draft.getByRole('button', { name: '查看 #9 的变更:新增 30 行,删除 2 行', exact: true }).click({ timeout: 20_000 }) await wide.getByRole('status').filter({ hasText: '变更太大,无法在这里显示' }).waitFor({ timeout: 20_000 }) - await wide.getByRole('button', { name: '在浏览器中查看', exact: true }).waitFor() + await wide.getByRole('button', { name: '在 GitHub 中查看', exact: true }).waitFor() expect(await wide.getByRole('button', { name: '重试', exact: true }).count()).toBe(0) const calls = (await readFile(join(root, 'calls.jsonl'), 'utf8')).trim().split('\n').map(line => JSON.parse(line) as string[]) diff --git a/docs/config-catalog.md b/docs/config-catalog.md index 974c42fad9..9478c51ebf 100644 --- a/docs/config-catalog.md +++ b/docs/config-catalog.md @@ -1323,7 +1323,7 @@ export interface CotTranslationPreferences { ## `@deepseek-ai/dsh-experimental-client-ui-forge` - `inject`: `forge` · `forgeSession` · `sessionProjections` · `workingDirectory` · `fs` · `subprocess` · `sandbox` · `sandboxPolicy` · `agents` -- `source`: [`packages/experimental/client-ui-forge/src/types.ts:587`](../packages/experimental/client-ui-forge/src/types.ts) +- `source`: [`packages/experimental/client-ui-forge/src/types.ts:602`](../packages/experimental/client-ui-forge/src/types.ts) ```ts config-catalog /** Host settings of the forge panel Remote. */ @@ -1391,7 +1391,7 @@ export interface Config { reviewListIntervalMs?: number /** Milliseconds between two reads of the review page's navigation count while it is shown. */ reviewCountIntervalMs?: number - /** Largest delay in milliseconds between two reads of the review page's lists or count after consecutive failures. */ + /** Largest delay in milliseconds between two reads of the review page's lists or count on one host after its consecutive failed reads. */ reviewMaxBackoffMs?: number /** Most change requests one review page list shows, capped by each provider's own limit. */ reviewPageSize?: number @@ -1428,7 +1428,7 @@ export interface Config { ## `@deepseek-ai/dsh-experimental-forge` -- `source`: [`packages/experimental/forge/src/types.ts:833`](../packages/experimental/forge/src/types.ts) +- `source`: [`packages/experimental/forge/src/types.ts:932`](../packages/experimental/forge/src/types.ts) ```ts config-catalog /** Poll cadence and fetch deadline for watched change requests. */ @@ -1451,15 +1451,19 @@ export interface Config { ## `@deepseek-ai/dsh-experimental-forge-github` - `inject`: `forge` -- `source`: [`packages/experimental/forge-github/src/index.ts:19`](../packages/experimental/forge-github/src/index.ts) +- `refs`: `Volatile` (`@deepseek-ai/cordis`) +- `source`: [`packages/experimental/forge-github/src/index.ts:22`](../packages/experimental/forge-github/src/index.ts) ```ts config-catalog /** GitHub CLI executable, served hosts, and invocation limits. */ export interface Config { /** GitHub CLI executable name or absolute host path. */ ghCommand?: string - /** Host names this provider serves; list GitHub Enterprise hosts explicitly. */ - hosts?: string[] + /** + * Host names this provider serves, at least one; list GitHub Enterprise hosts explicitly. Editable live: the + * provider registers again with the new list. + */ + hosts: Volatile /** Deadline in milliseconds for one `gh` invocation. */ timeoutMs?: number /** Maximum captured bytes per `gh` output stream and combined JSON bytes of one complete check read or review read. */ @@ -1824,15 +1828,19 @@ export interface Config { ## `@deepseek-ai/dsh-forge-gitlab` - `inject`: `forge` -- `source`: [`packages/experimental/forge-gitlab/src/index.ts:19`](../packages/experimental/forge-gitlab/src/index.ts) +- `refs`: `Volatile` (`@deepseek-ai/cordis`) +- `source`: [`packages/experimental/forge-gitlab/src/index.ts:22`](../packages/experimental/forge-gitlab/src/index.ts) ```ts config-catalog /** GitLab CLI executable, served hosts, and read limits. */ export interface Config { /** GitLab CLI executable name or absolute host path. */ glabCommand?: string - /** Host names this provider serves; list self-managed GitLab hosts explicitly. */ - hosts?: string[] + /** + * Host names this provider serves, at least one; list self-managed GitLab hosts explicitly. Editable live: the + * provider registers again with the new list. + */ + hosts: Volatile /** Deadline in milliseconds for one `glab` invocation. */ timeoutMs?: number /** Maximum captured bytes per `glab` output stream and combined JSON bytes of one complete check read or review read. */ @@ -1841,7 +1849,11 @@ export interface Config { maxReviewThreads?: number /** Most commits one merge request commit listing returns, the oldest ones when there are more. */ maxCommits?: number - /** Most merge requests one status query reads; GitLab refuses a query over its complexity limit, which halves the batch. */ + /** + * Most merge requests one status query reads, 1 by default: in a query that reads several, GitLab 19.5 reports a + * mergeable merge request after the first as conflicting. GitLab refuses a query over its complexity limit, which + * halves the batch. + */ statusBatchSize?: number /** Most `glab` processes one status fetch runs at once. */ maxConcurrentRequests?: number diff --git a/docs/config-catalog.zh.md b/docs/config-catalog.zh.md index 645923c719..a5e06817a3 100644 --- a/docs/config-catalog.zh.md +++ b/docs/config-catalog.zh.md @@ -1325,7 +1325,7 @@ export interface CotTranslationPreferences { ## `@deepseek-ai/dsh-experimental-client-ui-forge` - `inject`: `forge` · `forgeSession` · `sessionProjections` · `workingDirectory` · `fs` · `subprocess` · `sandbox` · `sandboxPolicy` · `agents` -- `source`: [`packages/experimental/client-ui-forge/src/types.ts:587`](../packages/experimental/client-ui-forge/src/types.ts) +- `source`: [`packages/experimental/client-ui-forge/src/types.ts:602`](../packages/experimental/client-ui-forge/src/types.ts) ```ts config-catalog /** Host settings of the forge panel Remote. */ @@ -1393,7 +1393,7 @@ export interface Config { reviewListIntervalMs?: number /** Milliseconds between two reads of the review page's navigation count while it is shown. */ reviewCountIntervalMs?: number - /** Largest delay in milliseconds between two reads of the review page's lists or count after consecutive failures. */ + /** Largest delay in milliseconds between two reads of the review page's lists or count on one host after its consecutive failed reads. */ reviewMaxBackoffMs?: number /** Most change requests one review page list shows, capped by each provider's own limit. */ reviewPageSize?: number @@ -1430,7 +1430,7 @@ export interface Config { ## `@deepseek-ai/dsh-experimental-forge` -- `source`: [`packages/experimental/forge/src/types.ts:833`](../packages/experimental/forge/src/types.ts) +- `source`: [`packages/experimental/forge/src/types.ts:932`](../packages/experimental/forge/src/types.ts) ```ts config-catalog /** Poll cadence and fetch deadline for watched change requests. */ @@ -1453,15 +1453,19 @@ export interface Config { ## `@deepseek-ai/dsh-experimental-forge-github` - `inject`: `forge` -- `source`: [`packages/experimental/forge-github/src/index.ts:19`](../packages/experimental/forge-github/src/index.ts) +- `refs`: `Volatile` (`@deepseek-ai/cordis`) +- `source`: [`packages/experimental/forge-github/src/index.ts:22`](../packages/experimental/forge-github/src/index.ts) ```ts config-catalog /** GitHub CLI executable, served hosts, and invocation limits. */ export interface Config { /** GitHub CLI executable name or absolute host path. */ ghCommand?: string - /** Host names this provider serves; list GitHub Enterprise hosts explicitly. */ - hosts?: string[] + /** + * Host names this provider serves, at least one; list GitHub Enterprise hosts explicitly. Editable live: the + * provider registers again with the new list. + */ + hosts: Volatile /** Deadline in milliseconds for one `gh` invocation. */ timeoutMs?: number /** Maximum captured bytes per `gh` output stream and combined JSON bytes of one complete check read or review read. */ @@ -1826,15 +1830,19 @@ export interface Config { ## `@deepseek-ai/dsh-forge-gitlab` - `inject`: `forge` -- `source`: [`packages/experimental/forge-gitlab/src/index.ts:19`](../packages/experimental/forge-gitlab/src/index.ts) +- `refs`: `Volatile` (`@deepseek-ai/cordis`) +- `source`: [`packages/experimental/forge-gitlab/src/index.ts:22`](../packages/experimental/forge-gitlab/src/index.ts) ```ts config-catalog /** GitLab CLI executable, served hosts, and read limits. */ export interface Config { /** GitLab CLI executable name or absolute host path. */ glabCommand?: string - /** Host names this provider serves; list self-managed GitLab hosts explicitly. */ - hosts?: string[] + /** + * Host names this provider serves, at least one; list self-managed GitLab hosts explicitly. Editable live: the + * provider registers again with the new list. + */ + hosts: Volatile /** Deadline in milliseconds for one `glab` invocation. */ timeoutMs?: number /** Maximum captured bytes per `glab` output stream and combined JSON bytes of one complete check read or review read. */ @@ -1843,7 +1851,11 @@ export interface Config { maxReviewThreads?: number /** Most commits one merge request commit listing returns, the oldest ones when there are more. */ maxCommits?: number - /** Most merge requests one status query reads; GitLab refuses a query over its complexity limit, which halves the batch. */ + /** + * Most merge requests one status query reads, 1 by default: in a query that reads several, GitLab 19.5 reports a + * mergeable merge request after the first as conflicting. GitLab refuses a query over its complexity limit, which + * halves the batch. + */ statusBatchSize?: number /** Most `glab` processes one status fetch runs at once. */ maxConcurrentRequests?: number diff --git a/docs/event-producer-consumer.md b/docs/event-producer-consumer.md index 7818bc7c06..fc7dedc672 100644 --- a/docs/event-producer-consumer.md +++ b/docs/event-producer-consumer.md @@ -47,8 +47,8 @@ Application listeners are outside this package matrix. Desktop Host subscribes t | `deepseek-account/signed-out` | `emit` | [`packages/account/deepseek-account/src/index.ts:28`](../packages/account/deepseek-account/src/index.ts) | [`deepseek-account`](../packages/account/deepseek-account) (`emit`) | [`llm-deepseek-account`](../packages/llm/llm-deepseek-account) | | `domain/changed` | `emit` | [`packages/storage/storage-domain/src/events.ts:46`](../packages/storage/storage-domain/src/events.ts) | [`storage-domain`](../packages/storage/storage-domain) (`emit`) | `workspace-controller` | | `feedback/committed` | `parallel` | [`packages/feedback/message-feedback/src/index.ts:58`](../packages/feedback/message-feedback/src/index.ts) | [`message-feedback`](../packages/feedback/message-feedback) (`parallel`) | [`session-telemetry-otel`](../packages/session/session-telemetry-otel) | -| `forge/providers-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:33`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `client-ui-forge`, `forge-session` | -| `forge/review-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:42`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `client-ui-forge` | +| `forge/providers-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:35`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `client-ui-forge`, `forge-session` | +| `forge/review-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:44`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `client-ui-forge` | | `fs/delete-intent` | `waterfall` | [`packages/fs/fs/src/index.ts:83`](../packages/fs/fs/src/index.ts) | [`tool-fs`](../packages/fs/tool-fs) (`waterfall`) | [`fs-observation-policy`](../packages/fs/fs-observation-policy), [`workspace-changes`](../packages/deliverables/workspace-changes) | | `fs/edit-intent` | `waterfall` | [`packages/fs/fs/src/index.ts:75`](../packages/fs/fs/src/index.ts) | `liveshare` (`waterfall`), [`tool-fs`](../packages/fs/tool-fs) (`waterfall`), [`tool-str-replace-editor`](../packages/fs/tool-str-replace-editor) (`waterfall`) | [`fs-observation-policy`](../packages/fs/fs-observation-policy), [`workspace-changes`](../packages/deliverables/workspace-changes) | | `fs/observed` | `emit` | [`packages/fs/fs/src/index.ts:93`](../packages/fs/fs/src/index.ts) | `liveshare` (`emit`), [`tool-fs`](../packages/fs/tool-fs) (`emit`), [`tool-str-replace-editor`](../packages/fs/tool-str-replace-editor) (`emit`) | [`fs-observation-policy`](../packages/fs/fs-observation-policy), [`skill-filesystem`](../packages/skill/skill-filesystem), `workspace-files` | @@ -124,7 +124,7 @@ Application listeners are outside this package matrix. Desktop Host subscribes t | `internal/plugin` | - | `computer-use-cua-driver-native`, `inspector`, `loader`, [`lsp-stdio`](../packages/lsp/lsp-stdio), [`mcp-client`](../packages/mcp/mcp-client), [`mcp-manager`](../packages/mcp/mcp-manager), `modules` | | `internal/service` | - | `client-ui-forge`, `gateway`, [`speech-to-text-deepseek`](../packages/experimental/speech-to-text-deepseek) | | `internal/status` | - | [`agent`](../packages/core/agent), `claude-code-mods`, `inspector`, `modules`, `server`, `translator`, [`web`](../packages/web/web) | -| `loader/volatile-update` | - | [`action-cards`](../packages/interaction/action-cards), [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager), `modules`, [`plugin-market`](../packages/boot/plugin-market), `product-analytics`, `speech-to-text`, [`timeline`](../packages/experimental/timeline) | +| `loader/volatile-update` | - | [`action-cards`](../packages/interaction/action-cards), `forge-github`, [`forge-gitlab`](../packages/experimental/forge-gitlab), [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager), `modules`, [`plugin-market`](../packages/boot/plugin-market), `product-analytics`, `speech-to-text`, [`timeline`](../packages/experimental/timeline) | | `locale/change` | `locale` (`emit`) | `locale` | | `slots/changed` | `ui-renderer` (`emit`) | - | | `theme/change` | `ui-theme` (`emit`) | `ui-layout`, `ui-theme` | diff --git a/docs/event-producer-consumer.zh.md b/docs/event-producer-consumer.zh.md index a5d05b6744..b3a23191d0 100644 --- a/docs/event-producer-consumer.zh.md +++ b/docs/event-producer-consumer.zh.md @@ -49,8 +49,8 @@ | `deepseek-account/signed-out` | `emit` | [`packages/account/deepseek-account/src/index.ts:28`](../packages/account/deepseek-account/src/index.ts) | [`deepseek-account`](../packages/account/deepseek-account) (`emit`) | [`llm-deepseek-account`](../packages/llm/llm-deepseek-account) | | `domain/changed` | `emit` | [`packages/storage/storage-domain/src/events.ts:46`](../packages/storage/storage-domain/src/events.ts) | [`storage-domain`](../packages/storage/storage-domain) (`emit`) | `workspace-controller` | | `feedback/committed` | `parallel` | [`packages/feedback/message-feedback/src/index.ts:58`](../packages/feedback/message-feedback/src/index.ts) | [`message-feedback`](../packages/feedback/message-feedback) (`parallel`) | [`session-telemetry-otel`](../packages/session/session-telemetry-otel) | -| `forge/providers-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:33`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `client-ui-forge`, `forge-session` | -| `forge/review-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:42`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `client-ui-forge` | +| `forge/providers-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:35`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `client-ui-forge`, `forge-session` | +| `forge/review-changed` | `parallel` | [`packages/experimental/forge/src/index.ts:44`](../packages/experimental/forge/src/index.ts) | `forge` (`parallel`) | `client-ui-forge` | | `fs/delete-intent` | `waterfall` | [`packages/fs/fs/src/index.ts:83`](../packages/fs/fs/src/index.ts) | [`tool-fs`](../packages/fs/tool-fs) (`waterfall`) | [`fs-observation-policy`](../packages/fs/fs-observation-policy), [`workspace-changes`](../packages/deliverables/workspace-changes) | | `fs/edit-intent` | `waterfall` | [`packages/fs/fs/src/index.ts:75`](../packages/fs/fs/src/index.ts) | `liveshare` (`waterfall`), [`tool-fs`](../packages/fs/tool-fs) (`waterfall`), [`tool-str-replace-editor`](../packages/fs/tool-str-replace-editor) (`waterfall`) | [`fs-observation-policy`](../packages/fs/fs-observation-policy), [`workspace-changes`](../packages/deliverables/workspace-changes) | | `fs/observed` | `emit` | [`packages/fs/fs/src/index.ts:93`](../packages/fs/fs/src/index.ts) | `liveshare` (`emit`), [`tool-fs`](../packages/fs/tool-fs) (`emit`), [`tool-str-replace-editor`](../packages/fs/tool-str-replace-editor) (`emit`) | [`fs-observation-policy`](../packages/fs/fs-observation-policy), [`skill-filesystem`](../packages/skill/skill-filesystem), `workspace-files` | @@ -126,7 +126,7 @@ | `internal/plugin` | - | `computer-use-cua-driver-native`, `inspector`, `loader`, [`lsp-stdio`](../packages/lsp/lsp-stdio), [`mcp-client`](../packages/mcp/mcp-client), [`mcp-manager`](../packages/mcp/mcp-manager), `modules` | | `internal/service` | - | `client-ui-forge`, `gateway`, [`speech-to-text-deepseek`](../packages/experimental/speech-to-text-deepseek) | | `internal/status` | - | [`agent`](../packages/core/agent), `claude-code-mods`, `inspector`, `modules`, `server`, `translator`, [`web`](../packages/web/web) | -| `loader/volatile-update` | - | [`action-cards`](../packages/interaction/action-cards), [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager), `modules`, [`plugin-market`](../packages/boot/plugin-market), `product-analytics`, `speech-to-text`, [`timeline`](../packages/experimental/timeline) | +| `loader/volatile-update` | - | [`action-cards`](../packages/interaction/action-cards), `forge-github`, [`forge-gitlab`](../packages/experimental/forge-gitlab), [`llm-deepseek`](../packages/llm/llm-deepseek), [`llm-deepseek-api-key`](../packages/llm/llm-deepseek-api-key), [`llm-pi-ai`](../packages/llm/llm-pi-ai), [`mcp-manager`](../packages/mcp/mcp-manager), `modules`, [`plugin-market`](../packages/boot/plugin-market), `product-analytics`, `speech-to-text`, [`timeline`](../packages/experimental/timeline) | | `locale/change` | `locale` (`emit`) | `locale` | | `slots/changed` | `ui-renderer` (`emit`) | - | | `theme/change` | `ui-theme` (`emit`) | `ui-layout`, `ui-theme` | diff --git a/docs/module-graph.md b/docs/module-graph.md index d51d4f0ba3..a430783b85 100644 --- a/docs/module-graph.md +++ b/docs/module-graph.md @@ -1357,6 +1357,7 @@ flowchart TD pkg_experimental_claude_code_mods --> pkg_working_directory pkg_experimental_forge_github --> pkg_experimental_forge pkg_experimental_forge_github --> pkg_experimental_forge_session + pkg_experimental_forge_github --> pkg_settings pkg_experimental_forge_github --> pkg_subprocess pkg_experimental_worktree --> pkg_agent pkg_experimental_worktree --> pkg_error @@ -1373,6 +1374,7 @@ flowchart TD pkg_experimental_worktree --> pkg_workspace pkg_forge_gitlab --> pkg_experimental_forge pkg_forge_gitlab --> pkg_experimental_forge_session + pkg_forge_gitlab --> pkg_settings pkg_forge_gitlab --> pkg_subprocess pkg_tool_session_query --> pkg_agent pkg_tool_session_query --> pkg_llm @@ -2007,9 +2009,9 @@ flowchart TD | [`compaction-tool-result-pruner`](../packages/compaction/compaction-tool-result-pruner) | `compaction` | [`compaction`](../packages/compaction/compaction), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`token-meter`](../packages/llm/token-meter) | | [`experimental-browser-use-runtime`](../packages/experimental/browser-use-runtime) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`error`](../packages/util/error), [`mcp-client`](../packages/mcp/mcp-client), [`scope`](../packages/core/scope), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) | | [`experimental-claude-code-mods`](../packages/experimental/claude-code-mods) | `experimental` | [`agent`](../packages/core/agent), [`commands`](../packages/interaction/commands), [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`storage-domain`](../packages/storage/storage-domain), [`subprocess`](../packages/subprocess/subprocess), [`token-meter`](../packages/llm/token-meter), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-questions`](../packages/interaction/user-questions), [`working-directory`](../packages/session/working-directory) | -| [`experimental-forge-github`](../packages/experimental/forge-github) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`experimental-forge-session`](../packages/experimental/forge-session), [`subprocess`](../packages/subprocess/subprocess) | +| [`experimental-forge-github`](../packages/experimental/forge-github) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`experimental-forge-session`](../packages/experimental/forge-session), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess) | | [`experimental-worktree`](../packages/experimental/worktree) | `experimental` | [`agent`](../packages/core/agent), [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess), [`working-directory`](../packages/session/working-directory), [`workspace`](../packages/workspace/workspace) | -| [`forge-gitlab`](../packages/experimental/forge-gitlab) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`experimental-forge-session`](../packages/experimental/forge-session), [`subprocess`](../packages/subprocess/subprocess) | +| [`forge-gitlab`](../packages/experimental/forge-gitlab) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`experimental-forge-session`](../packages/experimental/forge-session), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess) | | [`tool-session-query`](../packages/experimental/tool-session-query) | `experimental` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-query`](../packages/session-query/session-query), [`system-prompt`](../packages/core/system-prompt), [`timeout`](../packages/util/timeout), [`tools`](../packages/core/tools) | | [`webhook-github`](../packages/experimental/webhook-github) | `experimental` | [`credentials`](../packages/credentials/credentials), [`host-webserver`](../packages/host/webserver), [`session`](../packages/core/session), [`webhook`](../packages/experimental/webhook) | | [`mcp-manager`](../packages/mcp/mcp-manager) | `mcp` | [`credentials`](../packages/credentials/credentials), [`mcp-client`](../packages/mcp/mcp-client), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`util-values`](../packages/util/values) | diff --git a/docs/module-graph.zh.md b/docs/module-graph.zh.md index a6da621d4e..be4716c32b 100644 --- a/docs/module-graph.zh.md +++ b/docs/module-graph.zh.md @@ -1359,6 +1359,7 @@ flowchart TD pkg_experimental_claude_code_mods --> pkg_working_directory pkg_experimental_forge_github --> pkg_experimental_forge pkg_experimental_forge_github --> pkg_experimental_forge_session + pkg_experimental_forge_github --> pkg_settings pkg_experimental_forge_github --> pkg_subprocess pkg_experimental_worktree --> pkg_agent pkg_experimental_worktree --> pkg_error @@ -1375,6 +1376,7 @@ flowchart TD pkg_experimental_worktree --> pkg_workspace pkg_forge_gitlab --> pkg_experimental_forge pkg_forge_gitlab --> pkg_experimental_forge_session + pkg_forge_gitlab --> pkg_settings pkg_forge_gitlab --> pkg_subprocess pkg_tool_session_query --> pkg_agent pkg_tool_session_query --> pkg_llm @@ -2009,9 +2011,9 @@ flowchart TD | [`compaction-tool-result-pruner`](../packages/compaction/compaction-tool-result-pruner) | `compaction` | [`compaction`](../packages/compaction/compaction), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`token-meter`](../packages/llm/token-meter) | | [`experimental-browser-use-runtime`](../packages/experimental/browser-use-runtime) | `experimental` | [`agent`](../packages/core/agent), [`browser-use`](../packages/browser-use/browser-use), [`error`](../packages/util/error), [`mcp-client`](../packages/mcp/mcp-client), [`scope`](../packages/core/scope), [`system-prompt`](../packages/core/system-prompt), [`tools`](../packages/core/tools), [`working-directory`](../packages/session/working-directory) | | [`experimental-claude-code-mods`](../packages/experimental/claude-code-mods) | `experimental` | [`agent`](../packages/core/agent), [`commands`](../packages/interaction/commands), [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`llm`](../packages/llm/llm), [`scope`](../packages/core/scope), [`session`](../packages/core/session), [`storage-domain`](../packages/storage/storage-domain), [`subprocess`](../packages/subprocess/subprocess), [`token-meter`](../packages/llm/token-meter), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`user-questions`](../packages/interaction/user-questions), [`working-directory`](../packages/session/working-directory) | -| [`experimental-forge-github`](../packages/experimental/forge-github) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`experimental-forge-session`](../packages/experimental/forge-session), [`subprocess`](../packages/subprocess/subprocess) | +| [`experimental-forge-github`](../packages/experimental/forge-github) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`experimental-forge-session`](../packages/experimental/forge-session), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess) | | [`experimental-worktree`](../packages/experimental/worktree) | `experimental` | [`agent`](../packages/core/agent), [`error`](../packages/util/error), [`fs`](../packages/fs/fs), [`sandbox`](../packages/sandbox/sandbox), [`sandbox-policy`](../packages/sandbox/sandbox-policy), [`session`](../packages/core/session), [`session-projection`](../packages/session/session-projection), [`session-projection-cache`](../packages/session/session-projection-cache), [`session-query`](../packages/session-query/session-query), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess), [`working-directory`](../packages/session/working-directory), [`workspace`](../packages/workspace/workspace) | -| [`forge-gitlab`](../packages/experimental/forge-gitlab) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`experimental-forge-session`](../packages/experimental/forge-session), [`subprocess`](../packages/subprocess/subprocess) | +| [`forge-gitlab`](../packages/experimental/forge-gitlab) | `experimental` | [`experimental-forge`](../packages/experimental/forge), [`experimental-forge-session`](../packages/experimental/forge-session), [`settings`](../packages/settings/settings), [`subprocess`](../packages/subprocess/subprocess) | | [`tool-session-query`](../packages/experimental/tool-session-query) | `experimental` | [`agent`](../packages/core/agent), [`llm`](../packages/llm/llm), [`session`](../packages/core/session), [`session-query`](../packages/session-query/session-query), [`system-prompt`](../packages/core/system-prompt), [`timeout`](../packages/util/timeout), [`tools`](../packages/core/tools) | | [`webhook-github`](../packages/experimental/webhook-github) | `experimental` | [`credentials`](../packages/credentials/credentials), [`host-webserver`](../packages/host/webserver), [`session`](../packages/core/session), [`webhook`](../packages/experimental/webhook) | | [`mcp-manager`](../packages/mcp/mcp-manager) | `mcp` | [`credentials`](../packages/credentials/credentials), [`mcp-client`](../packages/mcp/mcp-client), [`tools`](../packages/core/tools), [`typert-protocol`](../packages/typert/protocol), [`util-values`](../packages/util/values) | diff --git a/docs/subsystems/forge.i18n.yaml b/docs/subsystems/forge.i18n.yaml index fb3ff5e387..75492a7272 100644 --- a/docs/subsystems/forge.i18n.yaml +++ b/docs/subsystems/forge.i18n.yaml @@ -6,14 +6,14 @@ en: 37c9cbfb3141702b zh: c5fcbb7f4fda1dbc /forges/providers-and-change-requests: - en: 8df1bf8a6d294252 - zh: 79ba96596739569f + en: ef1335232f8e2156 + zh: b19c42e7f8671b01 /forges/status-polling: en: 33640257c4f9197d zh: b0f435bc3e03cfa4 /forges/change-request-actions: - en: ae735fbdbdf2d870 - zh: 9903fcc571104ad8 + en: dc3b95bf473a2ddc + zh: 8399387a6195f70f /forges/review-threads: en: 6a4162560b1aa158 zh: 5349e9f25d08fd97 @@ -23,6 +23,9 @@ /forges/viewer-lists-and-descriptions: en: 05dba49e668fbd82 zh: 7502689f5dd46118 +/forges/activity-and-comments: + en: fdfee3180c86d028 + zh: 8b092bb23594c7a7 /forges/session-bindings: en: 74255d6005e1c9e8 zh: 252d0d552f1e26a1 @@ -30,8 +33,8 @@ en: 83ad892728d13987 zh: d19b012f5898ef07 /forges/panel/review-page: - en: f576f6e104ec9546 - zh: b97efdd34b3a9d1b + en: de8dc146c603314b + zh: 976884cb9b3a7464 /forges/extension-api: en: f35345e482e84f4f zh: 2ecb7d9498decb31 diff --git a/docs/subsystems/forge.md b/docs/subsystems/forge.md index b7484fdaa3..5f4e8defd4 100644 --- a/docs/subsystems/forge.md +++ b/docs/subsystems/forge.md @@ -68,6 +68,17 @@ interface ForgeProvider { countForViewer?(host: string, signal: AbortSignal): Promise | ForgeFailure> /** Read the description and labels of a change request. Omission declares that this provider reads no descriptions. */ readDescription?(ref: ChangeRequestRef, signal: AbortSignal): Promise + /** + * Read the activity of a change request: the comments in its conversation, its submitted reviews, its commits, and + * the changes of its state. Omission declares that this provider reads no activity. + */ + readActivity?(ref: ChangeRequestRef, signal: AbortSignal): Promise + /** + * Add a comment of Markdown source `body` to a change request's conversation, resolving to undefined once the host + * saved it. A comment is never retried. Omission declares that this provider adds no comments, and its `readActivity` + * then denies `viewerCanComment`. + */ + addComment?(ref: ChangeRequestRef, body: string, signal: AbortSignal): Promise /** Publish a comment or completed review. Omission declares that this provider cannot write reviews. */ submitReview?(ref: ChangeRequestRef, request: ForgeReviewRequest, signal: AbortSignal): Promise /** @@ -120,6 +131,14 @@ interface ForgeProvider { markReady(ref: ChangeRequestRef, signal: AbortSignal): Promise /** Merge a change request while its head is still `request.headSha`, resolving to undefined once merged. */ merge(ref: ChangeRequestRef, request: MergeRequest, signal: AbortSignal): Promise + /** + * Turn the host's automatic merge of a change request on, while its head is still the request's `headSha`, or off, + * resolving to undefined once the host accepted it. Omission declares that the provider sets no automatic merge, and + * its snapshots then carry no `autoMerge`. + */ + setAutoMerge?( + ref: ChangeRequestRef, request: AutoMergeRequest, signal: AbortSignal, + ): Promise /** * Read the changes of a change request at head commit `headSha` as the host computes them, as one unified * patch with `a/` and `b/` path prefixes. A patch is returned only when it describes `headSha`; once the @@ -184,6 +203,28 @@ interface ForgeProvider { } ``` +`ctx.forge.register` returns the disposer of the registration. Its `replace` puts another provider of the same family in the registered one's place; a provider whose host list is edited while it runs calls it to serve the new list: + +```ts type-equiv +/** + * What `ctx.forge.register` returns: the disposer, plus the replacement of the registered provider by another provider + * of the same forge family, for a provider whose configuration changes while it runs. + */ +interface ForgeRegistrationHandle { + /** Unregister the provider this registration holds and wait for its calls, and those of the providers it replaced, to finish. */ + (): Promise + /** + * Replace the registered provider in one synchronous step, so no reader finds the family without a provider. The + * replaced provider's in-flight calls are cancelled and their results discarded; watches of the family poll at once + * and `forge/providers-changed` announces the change. + * @param provider - provider of the same forge family. + * @throws when the registration was withdrawn, `provider.forge` is another family, or another family's provider + * serves one of `provider.hosts`, compared without case; the registered provider then keeps serving. + */ + replace(provider: ForgeProvider): void +} +``` + ```ts type-equiv /** One commit of a change request. */ interface ForgeCommit { @@ -336,6 +377,11 @@ interface ChangeRequestSnapshot { readonly mergeReady: boolean /** Merge methods the repository accepts, the signed-in user's usual one first. */ readonly mergeMethods: readonly MergeMethod[] + /** + * How the change request stands with its host's automatic merge; omitted by a provider that sets none, whose change + * requests then offer no automatic merge. + */ + readonly autoMerge?: ChangeRequestAutoMerge /** * Ways the signed-in user can bring the base branch's new commits into the head branch now; empty while the head is * up to date, while the branches conflict, when the user cannot update the head branch, or when the provider cannot, @@ -487,6 +533,32 @@ interface MergeRequest { } ``` +`ctx.forge.setAutoMerge` turns the host's automatic merge of a change request on, for the head commit the user confirmed and with one of the snapshot's `mergeMethods`, or off; the host then merges the change request by itself once its merge requirements are met. A snapshot's `autoMerge` says whether it is on, with which method and turned on by whom when the host names them, and whether the signed-in user can turn it on or off now. A provider that sets no automatic merge omits both, and `setAutoMerge` then fails without asking the host. + +```ts type-equiv +/** How a change request stands with its host's automatic merge. */ +interface ChangeRequestAutoMerge { + /** Whether the host merges the change request by itself once its merge requirements are met. */ + readonly enabled: boolean + /** How the commits enter the base branch then, while enabled and the host names the method; null otherwise. */ + readonly method: MergeMethod | null + /** Login of the account that turned it on, while enabled and the host names one; null otherwise. */ + readonly enabledBy: string | null + /** Whether the signed-in user can turn it on now through `setAutoMerge`; false while it is on. */ + readonly canEnable: boolean + /** Whether the signed-in user can turn it off now through `setAutoMerge`; false while it is off. */ + readonly canDisable: boolean +} +``` + +```ts type-equiv +/** Turning a change request's automatic merge on for the head commit the user saw, or off. */ +type AutoMergeRequest = + /** `method` is one of the snapshot's `mergeMethods`; the host refuses once the head is no longer `headSha`. */ + | { readonly enabled: true; readonly method: MergeMethod; readonly headSha: string } + | { readonly enabled: false } +``` + ```ts type-equiv /** Why a provider could not change a change request, or could not confirm that it did. */ interface ForgeActionFailure { @@ -927,10 +999,6 @@ interface ChangeRequestSummary { * `organization/slug`, when the request asks a team the user belongs to rather than the user. */ readonly viewerRequest: { readonly team: string | null } | null - /** Issues the host closes once the change request merges, in host order, at most the provider's limit. */ - readonly closingIssues: readonly ChangeRequestIssue[] - /** Whether the host reported more closing issues than `closingIssues` holds. */ - readonly closingIssuesTruncated: boolean /** ISO 8601 time of the host's last update to the change request. */ readonly updatedAt: string } @@ -979,6 +1047,55 @@ interface ChangeRequestLabel { } ``` +## Activity and comments + +`ctx.forge.readActivity` reads what happened on a change request: the comments in its conversation, its submitted reviews, its commits, and the changes of its state, oldest first, at most the provider's limit with the latest entries kept. `ctx.forge.addComment` adds a comment to the conversation and then polls the change request at once when it is watched. A provider implements either method or both: `readActivity` of a provider without it returns `unsupported`, `addComment` of one without it fails, and an activity's `viewerCanComment` says whether the signed-in user can add a comment. The text of a comment or review is Markdown source whose raw HTML must not render as HTML. The [GitHub](../../packages/experimental/forge-github/README.md#use-this-package) and [GitLab](../../packages/experimental/forge-gitlab/README.md#use-this-package) provider READMEs own the requests and how each host's records become entries. + +```ts type-equiv +/** + * One entry of a change request's activity: a comment in its conversation, a submitted review, a commit, a change of + * its state, or a record the host words itself. + */ +type ChangeRequestActivityItem = { + /** ISO 8601 time of the entry. */ + readonly at: string + /** Account the entry is by, or null when the host names none or the account no longer exists. */ + readonly actor: ForgeCommentAuthor | null +} & ( + /** A comment in the conversation. `body` is Markdown source; it may contain raw HTML, which readers must not render as HTML. */ + | { readonly kind: 'comment'; readonly body: string; readonly url: string | null } + /** + * A submitted review: its decision, its own Markdown text, which follows the rule of a comment's `body` and is empty + * without one, and the number of comments it left on lines and files. + */ + | { readonly kind: 'review'; readonly verdict: ReviewVerdict; readonly body: string; readonly comments: number; readonly url: string | null } + /** + * A commit added to the change request: its object name, abbreviated when the host records only an abbreviation, and + * the first line of its message. + */ + | { readonly kind: 'commit'; readonly sha: string; readonly title: string } + | { readonly kind: 'merged' | 'closed' | 'reopened' | 'ready-for-review' | 'converted-to-draft' | 'force-pushed' } + | { readonly kind: 'auto-merge-enabled' | 'auto-merge-disabled' } + /** A review was requested from an account or a team, named as the host spells it; null when the host names neither. */ + | { readonly kind: 'review-requested'; readonly reviewer: string | null } + | { readonly kind: 'renamed'; readonly from: string; readonly to: string } + /** A record with no kind of its own, as plain text in the host's own words. */ + | { readonly kind: 'other'; readonly text: string } +) +``` + +```ts type-equiv +/** The activity of a change request. */ +interface ChangeRequestActivity { + /** Entries oldest first, at most the provider's limit; the latest ones when the change request has more. */ + readonly items: readonly ChangeRequestActivityItem[] + /** Whether the change request has entries older than `items` holds. */ + readonly truncated: boolean + /** Whether the signed-in user can add a comment through `addComment`; false for a provider without it. */ + readonly viewerCanComment: boolean +} +``` + ## Session bindings `ctx.forgeSession` derives each Session's bindings from its own log by the command rules that providers register: forge-github's `gh` rule and forge-gitlab's `glab` rule bind the URLs that `gh pr create` and `glab mr create` results print and the change request that `gh pr view`, `glab mr view`, and their sibling reference commands act on, and `git push` results trigger head-branch discovery through `ctx.forge`; the panel also reports the branch its checkout tracks for the same discovery. Track, dismiss, and discovery actions are `plugin:forge-session/binding` records, which stay outside the model-visible conversation. The `forgeChangeRequests` projection's client view, which the Session summary carries, lists the bindings without their status. The [Session binding README](../../packages/experimental/forge-session/README.md#use-this-package) owns the recognition and discovery rules. @@ -1598,7 +1715,7 @@ interface ForgeLocalChanges { ### Review page -The [code review page](../../packages/experimental/client-ui-forge/README.md#use-this-package) reads change requests by URL instead of through a Session binding. Its `forgePanel` methods (`reviewLists`, `reviewCount`, `reviewChangeRequest`, `reviewDescription`, and the `review*` reads and actions that mirror the Session-bound ones) resolve the URL with `ForgeService.changeRequestFromUrl`, fail with `forgePanel/unrecognized-url` when no provider serves it, and name no Session resource, so only callers that may use the Host's code host credentials reach them. One list hub reads the [viewer lists](#viewer-lists-and-descriptions) only while a list or count stream lasts: streams of one repository scope share one reader that reads every list of every host each `reviewListIntervalMs`, hosts in parallel and each host's lists in order, stops the round's further reads on a host that refuses the viewer or is rate-limited, and backs off after failed rounds up to `reviewMaxBackoffMs`; the count reads every `reviewCountIntervalMs`, and lists of every repository refresh it too. `reviewLists` streams `ForgeReviewFrame` values with each host's lists, the items of the latest successful read, and the failure of the latest read; `reviewCount` streams `ForgeReviewCountFrame` values; and `reviewChangeRequest` streams `ForgeReviewChangeRequest` values for the shown change request, which is polled through `ForgeService.watch` while its stream lasts. +The [code review page](../../packages/experimental/client-ui-forge/README.md#use-this-package) reads change requests by URL instead of through a Session binding. Its `forgePanel` methods (`reviewLists`, `reviewCount`, `reviewChangeRequest`, `reviewDescription`, `reviewActivity`, `reviewComment`, `reviewSetAutoMerge`, and the `review*` reads and actions that mirror the Session-bound ones) resolve the URL with `ForgeService.changeRequestFromUrl`, fail with `forgePanel/unrecognized-url` when no provider serves it, and name no Session resource, so only callers that may use the Host's code host credentials reach them. One list hub reads the [viewer lists](#viewer-lists-and-descriptions) only while a list or count stream lasts: streams of one repository scope share one reader that reads every list of every host each `reviewListIntervalMs`, hosts in parallel and each host's lists in order, stops the round's further reads on a host that refuses the viewer or is rate-limited, and reads a host whose read failed again later each time, up to `reviewMaxBackoffMs`, while the other hosts keep their cadence; the count reads every `reviewCountIntervalMs` in the same way, and lists of every repository refresh it too. A scope is every repository of every host or one `ForgeReviewRepository`, which names its host and is read on that host only. `reviewLists` streams `ForgeReviewFrame` values with each host's lists, the items of the latest successful read, the failure of the latest read, and, for a host that refused the viewer, the sign-in command its provider's `readiness` names; `reviewCount` streams `ForgeReviewCountFrame` values; and `reviewChangeRequest` streams `ForgeReviewChangeRequest` values for the shown change request, which is polled through `ForgeService.watch` while its stream lasts. The chat tab starts in the blank Session `connectWorkspace` resolves and records the change request with `reviewStage`; the Host keeps that choice in memory and binds the change request once the Session's next message enters its inbox, so an untouched blank stays unbound. @@ -1737,11 +1854,12 @@ Registry of forge providers. Watchers of one change request share a single polli * registration ends. Unregistering cancels and awaits its in-flight calls; * results from the withdrawn registration are discarded. * @param provider - provider to serve `provider.forge` on `provider.hosts`. - * @returns the disposer that unregisters the provider and waits for its calls to finish. + * @returns the disposer that unregisters the provider and waits for its calls to finish, carrying + * {@link ForgeRegistrationHandle.replace}. * @throws when another provider already serves the same forge or one of the same hosts, compared without case, and * when the provider names a batch size that is not a positive safe integer. */ -register(provider: ForgeProvider): () => Promise +register(provider: ForgeProvider): ForgeRegistrationHandle /** * Name a forge family and its change requests for readers. @@ -1783,13 +1901,13 @@ changeRequestUrl(ref: ChangeRequestRef): string async findByHead(repository: ForgeRepository, branch: string, signal: AbortSignal): Promise /** - * Report whether the provider can reach the repository's host with current credentials. - * @param repository - repository served by a registered provider. + * Report whether a provider can reach one host with current credentials. + * @param repository - forge family of a registered provider and the host to probe; a repository names both. * @param signal - cancellation for the probe. * @returns the provider's readiness for the host. - * @throws when no provider serves the repository's forge. + * @throws when no provider serves the forge. */ -async readiness(repository: ForgeRepository, signal: AbortSignal): Promise +async readiness(repository: Pick, signal: AbortSignal): Promise /** * Mark a draft change request ready for review, then poll it at once when it is watched. @@ -1854,6 +1972,17 @@ async reviewerCandidates( ref: ChangeRequestRef, query: string, signal: AbortSig */ async updateBranch(ref: ChangeRequestRef, request: BranchUpdateRequest, signal: AbortSignal): Promise +/** + * Turn the host's automatic merge of a change request on, while its head is still the request's `headSha`, or off, + * then poll it at once when it is watched. + * @param ref - change request served by a registered provider. + * @param request - on with the merge method and the head commit the user confirmed, or off. + * @param signal - cancellation of the request. + * @returns undefined once the host accepted it, or why it did not; a provider that sets no automatic merge fails. + * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts. + */ +async setAutoMerge( ref: ChangeRequestRef, request: AutoMergeRequest, signal: AbortSignal, ): Promise + /** * Read complete check details independently of periodic polling. * @param ref - change request served by a registered provider. @@ -1995,6 +2124,25 @@ async countForViewer(forge: string, host: string, signal: AbortSignal): Promise< */ async readDescription(ref: ChangeRequestRef, signal: AbortSignal): Promise +/** + * Read the activity of a change request: its comments, submitted reviews, commits, and changes of state. + * @param ref - change request served by a registered provider. + * @param signal - cancellation of the read. + * @returns the activity, or why the host did not provide it; `unsupported` when the provider reads no activity. + * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts. + */ +async readActivity(ref: ChangeRequestRef, signal: AbortSignal): Promise + +/** + * Add a comment to a change request's conversation, then poll it at once when it is watched. + * @param ref - change request served by a registered provider. + * @param body - Markdown source of the comment. + * @param signal - cancellation of the request. + * @returns undefined once the host saved the comment, or why it did not; a provider that adds no comments fails. + * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts. + */ +async addComment(ref: ChangeRequestRef, body: string, signal: AbortSignal): Promise + /** * Publish one comment or a completed review, then refresh the watched status; a publication the host took is announced * with `forge/review-changed`. @@ -2116,13 +2264,15 @@ Serves the forge panel. Following a Session inspects the checkout of its current /** * Stream the review page's lists of the signed-in user's open change requests on every host a provider lists them on: * the lists read so far first, then a frame after each read settles. Readers of one repository scope share one - * reader, which reads every `reviewListIntervalMs` while some stream lasts and backs off after failed rounds up to - * `reviewMaxBackoffMs`; nothing is read while no stream lasts. The stream ends when `signal` aborts or the Remote stops. - * @param repository - one repository to list in, or null for every repository the user can read. + * reader, which reads each host every `reviewListIntervalMs` while some stream lasts and reads a host whose read failed + * again later each time, up to `reviewMaxBackoffMs`, without delaying the other hosts; nothing is read while no stream + * lasts. The stream ends when `signal` aborts or the Remote stops. + * @param repository - one repository to list in, read on its host only, or null for every repository the user can + * read on every host. * @param signal - ends the stream. * @returns frames, each complete. */ -@Remote({ mode: 'stream' }) async *reviewLists( repository: { readonly owner: string; readonly name: string } | null, signal: AbortSignal, ): AsyncIterable +@Remote({ mode: 'stream' }) async *reviewLists( repository: ForgeReviewRepository | null, signal: AbortSignal, ): AsyncIterable /** * Stream the number of open change requests that ask the signed-in user for a review, summed over the hosts read: @@ -2139,6 +2289,18 @@ Serves the forge panel. Following a Session inspects the checkout of its current */ @Remote // oxlint-disable-next-line typescript/require-await -- async keeps a refused or cancelled request a rejection, as Remote callers expect async reviewRefresh(signal: AbortSignal): Promise +/** + * Report whether a provider reaches one of its hosts with the Host's current credentials, for the host list on the + * Plugins page of that provider's row. The read names no Session, so, like the review page reads, only callers that + * may use the Host's code host credentials reach it. + * @param forge - forge family of a registered provider, such as `gitlab`. + * @param host - host name as the provider's configuration lists it. + * @param signal - request cancellation. + * @returns the provider's readiness for the host; `unavailable` with the reason when no provider serves the family, + * the probe fails, or it runs past `readinessTimeoutMs`. + */ +@Remote async hostReadiness(forge: string, host: string, signal: AbortSignal): Promise + /** * Poll one change request the review page shows at once; its stream reports the result. * @param url - web URL of the change request. @@ -2169,6 +2331,27 @@ Serves the forge panel. Following a Session inspects the checkout of its current */ @Remote async reviewDescription(url: string, signal: AbortSignal): Promise +/** + * Read the activity of a change request for the review page: its comments, submitted reviews, commits, and changes + * of state. + * @param url - web URL of the change request. + * @param signal - request cancellation. + * @returns the activity, or null when the change request's provider reads none. + * @throws `forgePanel/unrecognized-url` when no provider serves the URL; `forgePanel/activity-failed` with the + * host's reason when the host does not provide it. + */ +@Remote async reviewActivity(url: string, signal: AbortSignal): Promise + +/** + * Add a comment to the conversation of a change request the review page shows. + * @param url - web URL of the change request. + * @param body - Markdown source of the comment. + * @param signal - request cancellation. + * @throws `forgePanel/unrecognized-url` when no provider serves the URL; `forgePanel/action-failed` when `body` is + * blank, or with the host's reason; `forgePanel/action-unknown` when the host's answer did not confirm the comment. + */ +@Remote async reviewComment(url: string, body: string, signal: AbortSignal): Promise + /** * Read every check of a change request the review page shows. * @param url - web URL of the change request. @@ -2288,6 +2471,17 @@ Serves the forge panel. Following a Session inspects the checkout of its current */ @Remote async reviewMerge(url: string, method: MergeMethod, headSha: string, signal: AbortSignal): Promise +/** + * Turn the code host's automatic merge of a change request the review page shows on, while its head is still the + * request's `headSha`, or off. + * @param url - web URL of the change request. + * @param request - on with the merge method and the head commit the user confirmed, or off. + * @param signal - request cancellation. + * @throws `forgePanel/unrecognized-url` when no provider serves the URL; `forgePanel/stale-head`, + * `forgePanel/action-failed`, or `forgePanel/action-unknown` with the host's reason. + */ +@Remote async reviewSetAutoMerge(url: string, request: AutoMergeRequest, signal: AbortSignal): Promise + /** * Rerun the failed checks of a change request the review page shows. * @param url - web URL of the change request. @@ -2649,6 +2843,20 @@ registerLens(lens: ForgeLens): () => Promise */ @Remote async merge(session: Session, url: string, method: MergeMethod, headSha: string, signal: AbortSignal): Promise +/** + * Turn the code host's automatic merge of a change request of a Session on, while its head is still the request's + * `headSha`, or off; the change request is polled again once the host answers. + * @param session - Session the change request is bound to. + * @param url - binding URL of the change request. + * @param request - on with the merge method and the head commit the user confirmed, or off. + * @param signal - request cancellation. + * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves; + * `forgePanel/stale-head` when the head moved past the request's `headSha`; `forgePanel/action-failed` with the + * host's reason when the host refuses otherwise, cannot be reached, or sets no automatic merge; + * `forgePanel/action-unknown` when the host's answer did not confirm the change. + */ +@Remote async setAutoMerge(session: Session, url: string, request: AutoMergeRequest, signal: AbortSignal): Promise + /** * Rerun the failed checks of a change request of a Session while its head is still the commit whose checks the user * saw; the change request is polled again once the host answers. @@ -2881,11 +3089,11 @@ Source: [`packages/experimental/forge-session/src/index.ts`](../../packages/expe #### `forge/providers-changed` — parallel -Announces a provider registration or withdrawal after the registry changes. Listener failures are logged without preventing other listeners from running. +Announces a provider registration, replacement, or withdrawal after the registry changes. Listener failures are logged without preventing other listeners from running. ```ts cordis-catalog /** - * Announces a provider registration or withdrawal after the registry changes. + * Announces a provider registration, replacement, or withdrawal after the registry changes. * Listener failures are logged without preventing other listeners from running. * @param forge - family whose provider changed. * @mode parallel diff --git a/docs/subsystems/forge.zh.md b/docs/subsystems/forge.zh.md index dd5e6ba128..e151f991a7 100644 --- a/docs/subsystems/forge.zh.md +++ b/docs/subsystems/forge.zh.md @@ -68,6 +68,17 @@ interface ForgeProvider { countForViewer?(host: string, signal: AbortSignal): Promise | ForgeFailure> /** Read the description and labels of a change request. Omission declares that this provider reads no descriptions. */ readDescription?(ref: ChangeRequestRef, signal: AbortSignal): Promise + /** + * Read the activity of a change request: the comments in its conversation, its submitted reviews, its commits, and + * the changes of its state. Omission declares that this provider reads no activity. + */ + readActivity?(ref: ChangeRequestRef, signal: AbortSignal): Promise + /** + * Add a comment of Markdown source `body` to a change request's conversation, resolving to undefined once the host + * saved it. A comment is never retried. Omission declares that this provider adds no comments, and its `readActivity` + * then denies `viewerCanComment`. + */ + addComment?(ref: ChangeRequestRef, body: string, signal: AbortSignal): Promise /** Publish a comment or completed review. Omission declares that this provider cannot write reviews. */ submitReview?(ref: ChangeRequestRef, request: ForgeReviewRequest, signal: AbortSignal): Promise /** @@ -120,6 +131,14 @@ interface ForgeProvider { markReady(ref: ChangeRequestRef, signal: AbortSignal): Promise /** Merge a change request while its head is still `request.headSha`, resolving to undefined once merged. */ merge(ref: ChangeRequestRef, request: MergeRequest, signal: AbortSignal): Promise + /** + * Turn the host's automatic merge of a change request on, while its head is still the request's `headSha`, or off, + * resolving to undefined once the host accepted it. Omission declares that the provider sets no automatic merge, and + * its snapshots then carry no `autoMerge`. + */ + setAutoMerge?( + ref: ChangeRequestRef, request: AutoMergeRequest, signal: AbortSignal, + ): Promise /** * Read the changes of a change request at head commit `headSha` as the host computes them, as one unified * patch with `a/` and `b/` path prefixes. A patch is returned only when it describes `headSha`; once the @@ -184,6 +203,28 @@ interface ForgeProvider { } ``` +`ctx.forge.register` 返回该次注册的 disposer。它的 `replace` 用同一家族的另一个提供方替换已注册的提供方;主机列表在运行期间被修改的提供方调用它来服务新的列表: + +```ts type-equiv +/** + * What `ctx.forge.register` returns: the disposer, plus the replacement of the registered provider by another provider + * of the same forge family, for a provider whose configuration changes while it runs. + */ +interface ForgeRegistrationHandle { + /** Unregister the provider this registration holds and wait for its calls, and those of the providers it replaced, to finish. */ + (): Promise + /** + * Replace the registered provider in one synchronous step, so no reader finds the family without a provider. The + * replaced provider's in-flight calls are cancelled and their results discarded; watches of the family poll at once + * and `forge/providers-changed` announces the change. + * @param provider - provider of the same forge family. + * @throws when the registration was withdrawn, `provider.forge` is another family, or another family's provider + * serves one of `provider.hosts`, compared without case; the registered provider then keeps serving. + */ + replace(provider: ForgeProvider): void +} +``` + ```ts type-equiv /** One commit of a change request. */ interface ForgeCommit { @@ -336,6 +377,11 @@ interface ChangeRequestSnapshot { readonly mergeReady: boolean /** Merge methods the repository accepts, the signed-in user's usual one first. */ readonly mergeMethods: readonly MergeMethod[] + /** + * How the change request stands with its host's automatic merge; omitted by a provider that sets none, whose change + * requests then offer no automatic merge. + */ + readonly autoMerge?: ChangeRequestAutoMerge /** * Ways the signed-in user can bring the base branch's new commits into the head branch now; empty while the head is * up to date, while the branches conflict, when the user cannot update the head branch, or when the provider cannot, @@ -487,6 +533,32 @@ interface MergeRequest { } ``` +`ctx.forge.setAutoMerge` 为用户确认过的 head 提交启用代码托管平台的自动合并(方式取快照 `mergeMethods` 中的一种),或取消它;启用后,变更请求满足合并条件时由平台自行合并。快照的 `autoMerge` 说明它是否已启用、平台给出时的合并方式与启用人,以及当前用户现在能否启用或取消。不设置自动合并的提供方两者都不提供,此时 `setAutoMerge` 不询问平台,直接返回失败。 + +```ts type-equiv +/** How a change request stands with its host's automatic merge. */ +interface ChangeRequestAutoMerge { + /** Whether the host merges the change request by itself once its merge requirements are met. */ + readonly enabled: boolean + /** How the commits enter the base branch then, while enabled and the host names the method; null otherwise. */ + readonly method: MergeMethod | null + /** Login of the account that turned it on, while enabled and the host names one; null otherwise. */ + readonly enabledBy: string | null + /** Whether the signed-in user can turn it on now through `setAutoMerge`; false while it is on. */ + readonly canEnable: boolean + /** Whether the signed-in user can turn it off now through `setAutoMerge`; false while it is off. */ + readonly canDisable: boolean +} +``` + +```ts type-equiv +/** Turning a change request's automatic merge on for the head commit the user saw, or off. */ +type AutoMergeRequest = + /** `method` is one of the snapshot's `mergeMethods`; the host refuses once the head is no longer `headSha`. */ + | { readonly enabled: true; readonly method: MergeMethod; readonly headSha: string } + | { readonly enabled: false } +``` + ```ts type-equiv /** Why a provider could not change a change request, or could not confirm that it did. */ interface ForgeActionFailure { @@ -931,10 +1003,6 @@ interface ChangeRequestSummary { * `organization/slug`, when the request asks a team the user belongs to rather than the user. */ readonly viewerRequest: { readonly team: string | null } | null - /** Issues the host closes once the change request merges, in host order, at most the provider's limit. */ - readonly closingIssues: readonly ChangeRequestIssue[] - /** Whether the host reported more closing issues than `closingIssues` holds. */ - readonly closingIssuesTruncated: boolean /** ISO 8601 time of the host's last update to the change request. */ readonly updatedAt: string } @@ -983,6 +1051,55 @@ interface ChangeRequestLabel { } ``` +## 动态与评论 + +`ctx.forge.readActivity` 读取变更请求上发生过的事:对话中的评论、已提交的评审、提交,以及状态的变化,按时间从旧到新,最多为提供方的上限,超出时保留最新的条目。`ctx.forge.addComment` 向对话添加一条评论,之后如果该变更请求正被监视,就立即轮询一次。提供方可以实现其中一个或两个方法:没有 `readActivity` 的提供方返回 `unsupported`,没有 `addComment` 的提供方返回失败;动态的 `viewerCanComment` 说明当前用户能否添加评论。评论和评审的正文是 Markdown 源文本,其中的原始 HTML 不得作为 HTML 渲染。请求以及各主机的记录如何变成条目,由 [GitHub](../../packages/experimental/forge-github/README.zh.md#use-this-package) 与 [GitLab](../../packages/experimental/forge-gitlab/README.zh.md#use-this-package) 提供方的 README 说明。 + +```ts type-equiv +/** + * One entry of a change request's activity: a comment in its conversation, a submitted review, a commit, a change of + * its state, or a record the host words itself. + */ +type ChangeRequestActivityItem = { + /** ISO 8601 time of the entry. */ + readonly at: string + /** Account the entry is by, or null when the host names none or the account no longer exists. */ + readonly actor: ForgeCommentAuthor | null +} & ( + /** A comment in the conversation. `body` is Markdown source; it may contain raw HTML, which readers must not render as HTML. */ + | { readonly kind: 'comment'; readonly body: string; readonly url: string | null } + /** + * A submitted review: its decision, its own Markdown text, which follows the rule of a comment's `body` and is empty + * without one, and the number of comments it left on lines and files. + */ + | { readonly kind: 'review'; readonly verdict: ReviewVerdict; readonly body: string; readonly comments: number; readonly url: string | null } + /** + * A commit added to the change request: its object name, abbreviated when the host records only an abbreviation, and + * the first line of its message. + */ + | { readonly kind: 'commit'; readonly sha: string; readonly title: string } + | { readonly kind: 'merged' | 'closed' | 'reopened' | 'ready-for-review' | 'converted-to-draft' | 'force-pushed' } + | { readonly kind: 'auto-merge-enabled' | 'auto-merge-disabled' } + /** A review was requested from an account or a team, named as the host spells it; null when the host names neither. */ + | { readonly kind: 'review-requested'; readonly reviewer: string | null } + | { readonly kind: 'renamed'; readonly from: string; readonly to: string } + /** A record with no kind of its own, as plain text in the host's own words. */ + | { readonly kind: 'other'; readonly text: string } +) +``` + +```ts type-equiv +/** The activity of a change request. */ +interface ChangeRequestActivity { + /** Entries oldest first, at most the provider's limit; the latest ones when the change request has more. */ + readonly items: readonly ChangeRequestActivityItem[] + /** Whether the change request has entries older than `items` holds. */ + readonly truncated: boolean + /** Whether the signed-in user can add a comment through `addComment`; false for a provider without it. */ + readonly viewerCanComment: boolean +} +``` + ## Session 绑定 `ctx.forgeSession` 按提供方注册的命令规则,从每个 Session 自己的日志派生其绑定:forge-github 的 `gh` 规则与 forge-gitlab 的 `glab` 规则绑定 `gh pr create` 与 `glab mr create` 结果输出的 URL,以及 `gh pr view`、`glab mr view` 及其同类引用命令所操作的变更请求,`git push` 的结果通过 `ctx.forge` 触发按 head 分支的发现;面板也会报告其检出所跟踪的分支,触发同样的发现。track、dismiss 与发现操作都是 `plugin:forge-session/binding` 插件记录,位于模型可见对话之外。`forgeChangeRequests` 投影的客户端视图随 Session 摘要下发,列出绑定但不含其状态。识别与发现规则见 [Session 绑定 README](../../packages/experimental/forge-session/README.zh.md#use-this-package)。 @@ -1602,7 +1719,7 @@ interface ForgeLocalChanges { ### 代码评审页 -[代码评审页](../../packages/experimental/client-ui-forge/README.zh.md#use-this-package)按 URL 读取变更请求,而不经过会话绑定。它的 `forgePanel` 方法(`reviewLists`、`reviewCount`、`reviewChangeRequest`、`reviewDescription`,以及与会话绑定版本对应的各个 `review*` 读取与操作)用 `ForgeService.changeRequestFromUrl` 解析 URL,没有提供方能处理时以 `forgePanel/unrecognized-url` 失败;它们不指向任何会话资源,因此只有可以使用 Host 代码托管凭据的调用方能访问。一个列表中心只在列表流或计数流存在时读取[登录用户的列表](#viewer-lists-and-descriptions):同一仓库范围的流共用一个读取器,它每隔 `reviewListIntervalMs` 读取每个主机的每个列表,各主机并行、同一主机的列表依次读取;某主机拒绝当前用户或触发限流时,本轮不再读取它的其余列表;连续失败的轮次按 `reviewMaxBackoffMs` 为上限退避。计数每隔 `reviewCountIntervalMs` 读取一次,全部仓库范围的列表读取也会更新它。`reviewLists` 流式返回 `ForgeReviewFrame`,含每个主机的列表、最近一次成功读取的条目以及最近一次读取的失败;`reviewCount` 流式返回 `ForgeReviewCountFrame`;`reviewChangeRequest` 为显示中的变更请求流式返回 `ForgeReviewChangeRequest`,该变更请求在其流存在期间经 `ForgeService.watch` 轮询。 +[代码评审页](../../packages/experimental/client-ui-forge/README.zh.md#use-this-package)按 URL 读取变更请求,而不经过会话绑定。它的 `forgePanel` 方法(`reviewLists`、`reviewCount`、`reviewChangeRequest`、`reviewDescription`、`reviewActivity`、`reviewComment`、`reviewSetAutoMerge`,以及与会话绑定版本对应的各个 `review*` 读取与操作)用 `ForgeService.changeRequestFromUrl` 解析 URL,没有提供方能处理时以 `forgePanel/unrecognized-url` 失败;它们不指向任何会话资源,因此只有可以使用 Host 代码托管凭据的调用方能访问。一个列表中心只在列表流或计数流存在时读取[登录用户的列表](#viewer-lists-and-descriptions):同一仓库范围的流共用一个读取器,它每隔 `reviewListIntervalMs` 读取每个主机的每个列表,各主机并行、同一主机的列表依次读取;某主机拒绝当前用户或触发限流时,本轮不再读取它的其余列表;读取失败的主机每次间隔更久再读,以 `reviewMaxBackoffMs` 为上限,其他主机保持原来的间隔。计数每隔 `reviewCountIntervalMs` 以同样的方式读取,全部仓库范围的列表读取也会更新它。范围是全部主机的全部仓库,或一个 `ForgeReviewRepository`;后者带有主机,只在该主机上读取。`reviewLists` 流式返回 `ForgeReviewFrame`,含每个主机的列表、最近一次成功读取的条目、最近一次读取的失败,以及主机拒绝当前用户时其提供方的 `readiness` 给出的登录命令;`reviewCount` 流式返回 `ForgeReviewCountFrame`;`reviewChangeRequest` 为显示中的变更请求流式返回 `ForgeReviewChangeRequest`,该变更请求在其流存在期间经 `ForgeService.watch` 轮询。 对话标签在 `connectWorkspace` 解析出的空白会话中开始,并用 `reviewStage` 记录该变更请求;Host 只在内存中保存这个选择,等该会话的下一条消息进入收件箱时再绑定,因此未使用的空白会话保持未绑定。 @@ -1741,11 +1858,12 @@ Registry of forge providers. Watchers of one change request share a single polli * registration ends. Unregistering cancels and awaits its in-flight calls; * results from the withdrawn registration are discarded. * @param provider - provider to serve `provider.forge` on `provider.hosts`. - * @returns the disposer that unregisters the provider and waits for its calls to finish. + * @returns the disposer that unregisters the provider and waits for its calls to finish, carrying + * {@link ForgeRegistrationHandle.replace}. * @throws when another provider already serves the same forge or one of the same hosts, compared without case, and * when the provider names a batch size that is not a positive safe integer. */ -register(provider: ForgeProvider): () => Promise +register(provider: ForgeProvider): ForgeRegistrationHandle /** * Name a forge family and its change requests for readers. @@ -1787,13 +1905,13 @@ changeRequestUrl(ref: ChangeRequestRef): string async findByHead(repository: ForgeRepository, branch: string, signal: AbortSignal): Promise /** - * Report whether the provider can reach the repository's host with current credentials. - * @param repository - repository served by a registered provider. + * Report whether a provider can reach one host with current credentials. + * @param repository - forge family of a registered provider and the host to probe; a repository names both. * @param signal - cancellation for the probe. * @returns the provider's readiness for the host. - * @throws when no provider serves the repository's forge. + * @throws when no provider serves the forge. */ -async readiness(repository: ForgeRepository, signal: AbortSignal): Promise +async readiness(repository: Pick, signal: AbortSignal): Promise /** * Mark a draft change request ready for review, then poll it at once when it is watched. @@ -1858,6 +1976,17 @@ async reviewerCandidates( ref: ChangeRequestRef, query: string, signal: AbortSig */ async updateBranch(ref: ChangeRequestRef, request: BranchUpdateRequest, signal: AbortSignal): Promise +/** + * Turn the host's automatic merge of a change request on, while its head is still the request's `headSha`, or off, + * then poll it at once when it is watched. + * @param ref - change request served by a registered provider. + * @param request - on with the merge method and the head commit the user confirmed, or off. + * @param signal - cancellation of the request. + * @returns undefined once the host accepted it, or why it did not; a provider that sets no automatic merge fails. + * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts. + */ +async setAutoMerge( ref: ChangeRequestRef, request: AutoMergeRequest, signal: AbortSignal, ): Promise + /** * Read complete check details independently of periodic polling. * @param ref - change request served by a registered provider. @@ -1999,6 +2128,25 @@ async countForViewer(forge: string, host: string, signal: AbortSignal): Promise< */ async readDescription(ref: ChangeRequestRef, signal: AbortSignal): Promise +/** + * Read the activity of a change request: its comments, submitted reviews, commits, and changes of state. + * @param ref - change request served by a registered provider. + * @param signal - cancellation of the read. + * @returns the activity, or why the host did not provide it; `unsupported` when the provider reads no activity. + * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts. + */ +async readActivity(ref: ChangeRequestRef, signal: AbortSignal): Promise + +/** + * Add a comment to a change request's conversation, then poll it at once when it is watched. + * @param ref - change request served by a registered provider. + * @param body - Markdown source of the comment. + * @param signal - cancellation of the request. + * @returns undefined once the host saved the comment, or why it did not; a provider that adds no comments fails. + * @throws when no provider serves the change request's forge, or with `signal.reason` when it aborts. + */ +async addComment(ref: ChangeRequestRef, body: string, signal: AbortSignal): Promise + /** * Publish one comment or a completed review, then refresh the watched status; a publication the host took is announced * with `forge/review-changed`. @@ -2120,13 +2268,15 @@ Serves the forge panel. Following a Session inspects the checkout of its current /** * Stream the review page's lists of the signed-in user's open change requests on every host a provider lists them on: * the lists read so far first, then a frame after each read settles. Readers of one repository scope share one - * reader, which reads every `reviewListIntervalMs` while some stream lasts and backs off after failed rounds up to - * `reviewMaxBackoffMs`; nothing is read while no stream lasts. The stream ends when `signal` aborts or the Remote stops. - * @param repository - one repository to list in, or null for every repository the user can read. + * reader, which reads each host every `reviewListIntervalMs` while some stream lasts and reads a host whose read failed + * again later each time, up to `reviewMaxBackoffMs`, without delaying the other hosts; nothing is read while no stream + * lasts. The stream ends when `signal` aborts or the Remote stops. + * @param repository - one repository to list in, read on its host only, or null for every repository the user can + * read on every host. * @param signal - ends the stream. * @returns frames, each complete. */ -@Remote({ mode: 'stream' }) async *reviewLists( repository: { readonly owner: string; readonly name: string } | null, signal: AbortSignal, ): AsyncIterable +@Remote({ mode: 'stream' }) async *reviewLists( repository: ForgeReviewRepository | null, signal: AbortSignal, ): AsyncIterable /** * Stream the number of open change requests that ask the signed-in user for a review, summed over the hosts read: @@ -2143,6 +2293,18 @@ Serves the forge panel. Following a Session inspects the checkout of its current */ @Remote // oxlint-disable-next-line typescript/require-await -- async keeps a refused or cancelled request a rejection, as Remote callers expect async reviewRefresh(signal: AbortSignal): Promise +/** + * Report whether a provider reaches one of its hosts with the Host's current credentials, for the host list on the + * Plugins page of that provider's row. The read names no Session, so, like the review page reads, only callers that + * may use the Host's code host credentials reach it. + * @param forge - forge family of a registered provider, such as `gitlab`. + * @param host - host name as the provider's configuration lists it. + * @param signal - request cancellation. + * @returns the provider's readiness for the host; `unavailable` with the reason when no provider serves the family, + * the probe fails, or it runs past `readinessTimeoutMs`. + */ +@Remote async hostReadiness(forge: string, host: string, signal: AbortSignal): Promise + /** * Poll one change request the review page shows at once; its stream reports the result. * @param url - web URL of the change request. @@ -2173,6 +2335,27 @@ Serves the forge panel. Following a Session inspects the checkout of its current */ @Remote async reviewDescription(url: string, signal: AbortSignal): Promise +/** + * Read the activity of a change request for the review page: its comments, submitted reviews, commits, and changes + * of state. + * @param url - web URL of the change request. + * @param signal - request cancellation. + * @returns the activity, or null when the change request's provider reads none. + * @throws `forgePanel/unrecognized-url` when no provider serves the URL; `forgePanel/activity-failed` with the + * host's reason when the host does not provide it. + */ +@Remote async reviewActivity(url: string, signal: AbortSignal): Promise + +/** + * Add a comment to the conversation of a change request the review page shows. + * @param url - web URL of the change request. + * @param body - Markdown source of the comment. + * @param signal - request cancellation. + * @throws `forgePanel/unrecognized-url` when no provider serves the URL; `forgePanel/action-failed` when `body` is + * blank, or with the host's reason; `forgePanel/action-unknown` when the host's answer did not confirm the comment. + */ +@Remote async reviewComment(url: string, body: string, signal: AbortSignal): Promise + /** * Read every check of a change request the review page shows. * @param url - web URL of the change request. @@ -2292,6 +2475,17 @@ Serves the forge panel. Following a Session inspects the checkout of its current */ @Remote async reviewMerge(url: string, method: MergeMethod, headSha: string, signal: AbortSignal): Promise +/** + * Turn the code host's automatic merge of a change request the review page shows on, while its head is still the + * request's `headSha`, or off. + * @param url - web URL of the change request. + * @param request - on with the merge method and the head commit the user confirmed, or off. + * @param signal - request cancellation. + * @throws `forgePanel/unrecognized-url` when no provider serves the URL; `forgePanel/stale-head`, + * `forgePanel/action-failed`, or `forgePanel/action-unknown` with the host's reason. + */ +@Remote async reviewSetAutoMerge(url: string, request: AutoMergeRequest, signal: AbortSignal): Promise + /** * Rerun the failed checks of a change request the review page shows. * @param url - web URL of the change request. @@ -2653,6 +2847,20 @@ registerLens(lens: ForgeLens): () => Promise */ @Remote async merge(session: Session, url: string, method: MergeMethod, headSha: string, signal: AbortSignal): Promise +/** + * Turn the code host's automatic merge of a change request of a Session on, while its head is still the request's + * `headSha`, or off; the change request is polled again once the host answers. + * @param session - Session the change request is bound to. + * @param url - binding URL of the change request. + * @param request - on with the merge method and the head commit the user confirmed, or off. + * @param signal - request cancellation. + * @throws `forgePanel/not-bound` unless the URL is a visible binding of the Session that a provider serves; + * `forgePanel/stale-head` when the head moved past the request's `headSha`; `forgePanel/action-failed` with the + * host's reason when the host refuses otherwise, cannot be reached, or sets no automatic merge; + * `forgePanel/action-unknown` when the host's answer did not confirm the change. + */ +@Remote async setAutoMerge(session: Session, url: string, request: AutoMergeRequest, signal: AbortSignal): Promise + /** * Rerun the failed checks of a change request of a Session while its head is still the commit whose checks the user * saw; the change request is polled again once the host answers. @@ -2885,11 +3093,11 @@ Source: [`packages/experimental/forge-session/src/index.ts`](../../packages/expe #### `forge/providers-changed` — parallel -Announces a provider registration or withdrawal after the registry changes. Listener failures are logged without preventing other listeners from running. +Announces a provider registration, replacement, or withdrawal after the registry changes. Listener failures are logged without preventing other listeners from running. ```ts cordis-catalog /** - * Announces a provider registration or withdrawal after the registry changes. + * Announces a provider registration, replacement, or withdrawal after the registry changes. * Listener failures are logged without preventing other listeners from running. * @param forge - family whose provider changed. * @mode parallel diff --git a/docs/upgrade-guide/v0.2.3-alpha.2/forge-review-lists-host-scope/guide.i18n.yaml b/docs/upgrade-guide/v0.2.3-alpha.2/forge-review-lists-host-scope/guide.i18n.yaml new file mode 100644 index 0000000000..00de40c96e --- /dev/null +++ b/docs/upgrade-guide/v0.2.3-alpha.2/forge-review-lists-host-scope/guide.i18n.yaml @@ -0,0 +1,16 @@ +# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading +# section, a hash of its English and Chinese blocks outside code blocks and generated regions. +# After editing either side, bring the other along and re-record with: +# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.3-alpha.2/forge-review-lists-host-scope/guide.md +/: + en: dddf0693cecf45e8 + zh: 12f61df2a91dde58 +/the-review-page-s-lists-name-a-repository-s-host-and-a-host-s-sign-in-command: + en: ea8d6f4615b0eaf3 + zh: c67ca2a681af12d8 +/the-review-page-s-lists-name-a-repository-s-host-and-a-host-s-sign-in-command/change: + en: 975728115489ced6 + zh: eaebfd3c156c9f3d +/the-review-page-s-lists-name-a-repository-s-host-and-a-host-s-sign-in-command/migration: + en: f7453271954cc5b0 + zh: 3419aced33609310 diff --git a/docs/upgrade-guide/v0.2.3-alpha.2/forge-review-lists-host-scope/guide.md b/docs/upgrade-guide/v0.2.3-alpha.2/forge-review-lists-host-scope/guide.md new file mode 100644 index 0000000000..bb9d1a1195 --- /dev/null +++ b/docs/upgrade-guide/v0.2.3-alpha.2/forge-review-lists-host-scope/guide.md @@ -0,0 +1,22 @@ +--- +kind: upgrade-guide +description: "forgePanel.reviewLists takes the repository's host, and ForgeReviewHost gains the required signIn." +--- + +# The review page's lists name a repository's host and a host's sign-in command + +English | [中文](guide.zh.md) + +## Change + +The `forgePanel.reviewLists` Remote took `{ owner, name } | null` as its repository and read that repository on every host. It now takes `ForgeReviewRepository | null`, which adds the required `host`, and reads the repository on that host only. `owner` holds the whole namespace of a GitLab project, nested groups included. + +`ForgeReviewHost`, one host's entry in each `ForgeReviewFrame` the Remote streams, gains the required `signIn: string | null`: the command that signs the provider's CLI in to the host while its latest read failed for lack of sign-in, and null otherwise. + +This affects code outside `@deepseek-ai/dsh-experimental-client-ui-forge` that calls `forgePanel.reviewLists` with a repository or builds `ForgeReviewHost` values, such as fixtures of the review page's frames. Both types come from that package. Code that only reads frames is unaffected. + +## Migration + +1. In every `forgePanel.reviewLists` call that passes a repository, add `host`: the host name of the provider that lists it, such as `github.com`, as `ForgeReviewHost.host` of a frame names it. Keep passing `null` for every repository on every host. +2. In every `ForgeReviewHost` your code builds, add `signIn: null`, or the sign-in command when the value stands for a host that is not signed in. +3. Run your type check; it passes once every call and value has the new members. diff --git a/docs/upgrade-guide/v0.2.3-alpha.2/forge-review-lists-host-scope/guide.zh.md b/docs/upgrade-guide/v0.2.3-alpha.2/forge-review-lists-host-scope/guide.zh.md new file mode 100644 index 0000000000..e8a6756972 --- /dev/null +++ b/docs/upgrade-guide/v0.2.3-alpha.2/forge-review-lists-host-scope/guide.zh.md @@ -0,0 +1,22 @@ +--- +kind: upgrade-guide +description: "forgePanel.reviewLists 的仓库参数要带主机,ForgeReviewHost 新增必填的 signIn。" +--- + +# 评审页的列表按主机指明仓库,并给出主机的登录命令 + +[English](guide.md) | 中文 + +## 变更 + +`forgePanel.reviewLists` 这个 Remote 原先以 `{ owner, name } | null` 作为仓库参数,并在每个主机上读取该仓库。现在它接受 `ForgeReviewRepository | null`,多了必填的 `host`,只在该主机上读取这个仓库。`owner` 保存 GitLab 项目的整个命名空间,包括嵌套的群组。 + +`ForgeReviewHost` 是该 Remote 流出的每个 `ForgeReviewFrame` 中一个主机的条目,它新增必填的 `signIn: string | null`:最近一次读取因未登录而失败时,是让提供方的 CLI 登录该主机的命令;其他情况为 null。 + +受影响的是 `@deepseek-ai/dsh-experimental-client-ui-forge` 之外、带仓库参数调用 `forgePanel.reviewLists` 的代码,以及构造 `ForgeReviewHost` 的代码,例如评审页帧的测试数据。两个类型都来自该包。只读取帧的代码不受影响。 + +## 迁移 + +1. 在每个带仓库参数的 `forgePanel.reviewLists` 调用中加上 `host`:列出该仓库的提供方的主机名,例如 `github.com`,即帧中 `ForgeReviewHost.host` 给出的名称。要读取每个主机上的所有仓库时,仍传 `null`。 +2. 在代码构造的每个 `ForgeReviewHost` 中加上 `signIn: null`;该值代表未登录的主机时,填登录命令。 +3. 运行类型检查;每处调用和取值都带上新成员后即通过。 diff --git a/docs/upgrade-guide/v0.2.3-alpha.2/forge-viewer-list-rows/guide.i18n.yaml b/docs/upgrade-guide/v0.2.3-alpha.2/forge-viewer-list-rows/guide.i18n.yaml new file mode 100644 index 0000000000..647c1c2a6d --- /dev/null +++ b/docs/upgrade-guide/v0.2.3-alpha.2/forge-viewer-list-rows/guide.i18n.yaml @@ -0,0 +1,16 @@ +# Bilingual-pair consistency record for guide.md (docs/i18n/README.md): per heading +# section, a hash of its English and Chinese blocks outside code blocks and generated regions. +# After editing either side, bring the other along and re-record with: +# pnpm run verify-translation-pairing --write docs/upgrade-guide/v0.2.3-alpha.2/forge-viewer-list-rows/guide.md +/: + en: 91fe2557764d542b + zh: df56ac645185f7ad +/forge-viewer-list-rows-no-longer-carry-closing-issues: + en: 2e75c2907ea9063d + zh: 14d2d12787acbf68 +/forge-viewer-list-rows-no-longer-carry-closing-issues/change: + en: 5af1ffb988831fb8 + zh: e092f9f5b57ac4ec +/forge-viewer-list-rows-no-longer-carry-closing-issues/migration: + en: f7e099958709e74e + zh: faaf41046a4e9b42 diff --git a/docs/upgrade-guide/v0.2.3-alpha.2/forge-viewer-list-rows/guide.md b/docs/upgrade-guide/v0.2.3-alpha.2/forge-viewer-list-rows/guide.md new file mode 100644 index 0000000000..42652cba6d --- /dev/null +++ b/docs/upgrade-guide/v0.2.3-alpha.2/forge-viewer-list-rows/guide.md @@ -0,0 +1,19 @@ +--- +kind: upgrade-guide +description: "ChangeRequestSummary loses closingIssues and closingIssuesTruncated." +--- + +# Forge viewer list rows no longer carry closing issues + +English | [中文](guide.zh.md) + +## Change + +`ChangeRequestSummary`, the row a `ForgeProvider` returns from `listForViewer`, loses `closingIssues` and `closingIssuesTruncated`. The Code review page no longer names the issues a listed change request closes; the change request's own overview still lists them from `ChangeRequestSnapshot.closingIssues`, which is unchanged. The GitHub provider's list search no longer reads closing issues. + +This affects third-party `ForgeProvider` implementations that offer viewer lists and other code that builds or reads `ChangeRequestSummary` values. The type comes from `@deepseek-ai/dsh-experimental-forge`. + +## Migration + +1. In every `ChangeRequestSummary` a provider builds, remove `closingIssues` and `closingIssuesTruncated`, and drop the read that served only them. +2. In code that reads those fields from a list row, read `closingIssues` and `closingIssuesTruncated` of the change request's `ChangeRequestSnapshot` instead, which `ctx.forge.watch` delivers. diff --git a/docs/upgrade-guide/v0.2.3-alpha.2/forge-viewer-list-rows/guide.zh.md b/docs/upgrade-guide/v0.2.3-alpha.2/forge-viewer-list-rows/guide.zh.md new file mode 100644 index 0000000000..d852ad85b9 --- /dev/null +++ b/docs/upgrade-guide/v0.2.3-alpha.2/forge-viewer-list-rows/guide.zh.md @@ -0,0 +1,19 @@ +--- +kind: upgrade-guide +description: "ChangeRequestSummary 去掉 closingIssues 与 closingIssuesTruncated。" +--- + +# Forge 的 viewer 列表项不再带会关闭的 issue + +[English](guide.md) | 中文 + +## 变更 + +`ChangeRequestSummary`(`ForgeProvider` 的 `listForViewer` 返回的列表项)去掉了 `closingIssues` 与 `closingIssuesTruncated`。代码评审页不再显示列表里的变更请求会关闭哪些 issue;变更请求自己的概览仍从未改动的 `ChangeRequestSnapshot.closingIssues` 列出它们。GitHub 提供方的列表搜索不再读取会关闭的 issue。 + +受影响的是提供 viewer 列表的第三方 `ForgeProvider` 实现,以及其他构造或读取 `ChangeRequestSummary` 的代码。该类型来自 `@deepseek-ai/dsh-experimental-forge`。 + +## 迁移 + +1. 在提供方构造的每个 `ChangeRequestSummary` 中去掉 `closingIssues` 与 `closingIssuesTruncated`,并删除只为它们服务的读取。 +2. 原先从列表项读取这两个字段的代码,改为读取该变更请求的 `ChangeRequestSnapshot` 上的 `closingIssues` 与 `closingIssuesTruncated`,它由 `ctx.forge.watch` 送达。 diff --git a/packages/experimental/client-ui-forge/README.i18n.yaml b/packages/experimental/client-ui-forge/README.i18n.yaml index 8850e65186..e2137ae02a 100644 --- a/packages/experimental/client-ui-forge/README.i18n.yaml +++ b/packages/experimental/client-ui-forge/README.i18n.yaml @@ -15,11 +15,11 @@ en: d152484eb41ac6b4 zh: 2f8a621b991260a1 /deepseek-ai-dsh-experimental-client-ui-forge/use-this-package: - en: 44e46809de624c40 - zh: 934dd10fbc7b7b14 + en: 92328ca9c025aa42 + zh: cef5a98969e1e68d /deepseek-ai-dsh-experimental-client-ui-forge/understand-the-implementation: - en: ea018cbd4c2357cb - zh: 1a73b620bf7ad1a0 + en: e20276738f193646 + zh: 79f2fa0e734f8f93 /deepseek-ai-dsh-experimental-client-ui-forge/further-exploration: en: fa4d8c579ffc49ff zh: 5856ed7469e4585b @@ -30,8 +30,8 @@ en: c1b5bfb0e5a1801e zh: 2bbe1a2845aa5d20 /deepseek-ai-dsh-experimental-client-ui-forge/known-limitations-and-deferred-work: - en: bd19347052d20055 - zh: b9fe5cb782d2d534 + en: 9363a5a012479e48 + zh: be0984691356324f /deepseek-ai-dsh-experimental-client-ui-forge/known-limitations-and-deferred-work/dev-note: en: e67f633dc6fe7773 zh: 3bb0c20c93f16f98 diff --git a/packages/experimental/client-ui-forge/README.md b/packages/experimental/client-ui-forge/README.md index 72ab0366ba..e541df04a1 100644 --- a/packages/experimental/client-ui-forge/README.md +++ b/packages/experimental/client-ui-forge/README.md @@ -31,16 +31,18 @@ Panel text follows the application language: Chinese, English, Japanese, Spanish - **Worktree option** — on the New Session screen, New worktree sits beside the current branch at the right end of the row with the workspace and mode pickers. Both stay hidden outside a Git checkout. The branch is read-only until New worktree is checked, when it becomes the base branch selector. The selector's searchable menu lists, most recently committed first, the current branch, then each remote's default branch, then local branches, then one group per remote headed by its name and its repository, `owner/name` for a recognized code host or else its fetch URL without the user name and password a URL can carry; typing filters the rows at once and lists the branches whose names contain the text after a short pause, and Enter chooses the first row. A remote branch is fetched, only that branch and without tags, when the worktree is created. The menu's last row, Name the new branch, opens a dialog whose field starts with the `worktreePrefix` and checks Git's branch-name rules while the name is typed; Save asks the Host, which also refuses a name the checkout already uses as a branch, and keeps the dialog open with the reason. With a chosen name, the selector shows the name before the base, and the dialog offers to use a generated name again. If permissions block an existing request, its selected base stays visible without a selector and the request can still be withdrawn. Hovering, focusing, or tapping the read-only branch or base shows its full description. The option is disabled, with the reason in its tooltip, in a read-only Session and when the checkout or its Git directory lies outside the Session's writable root, as for a project that is itself a linked worktree. Sending the first message hands it to the Session at once, and it waits there while the chosen branch, or else `dsh--<4 random hexadecimal digits>`, is created from the base under the repository's `.agents/worktrees/` and its checkout becomes the Session's working directory; the message's turn starts once the worktree exists. - **Archive cleanup** — archiving a Session lets the [worktree service](../worktree/README.md) reclaim the clean, unreferenced worktree it created, whether through the New Session option or the model's `enter_worktree` tool, while retaining the branch and its commits. A scheduled cleanup uses the archive notice “Archived; the worktree will be cleaned up”; one that ends retained returns to the ordinary notice, and one that fails replaces it with a warning while the Session stays archived. Undo cancels deletion before admission or waits for an admitted deletion; a removed checkout uses the existing Restore worktree flow. The bundle's worktree row on the Plugins page offers Keep worktrees when archiving: once saved, archiving keeps every worktree and shows the ordinary archive notice; the switch is read at each archive, so it does not affect a cleanup already scheduled. +- **Provider hosts** — the bundle's GitHub and GitLab rows on the Plugins page each open a page that lists the hosts the provider serves. Add, or Enter, stages the typed host name, or the host and port of a pasted URL, and refuses below the field a name that is malformed, already listed, or served by the other provider; a row's remove button stages its removal, except for the last host. Save writes the whole list to the profile patch, and the provider serves it without a restart. Each saved host shows Signed in, Not signed in with the provider's sign-in command and Copy, or Can't check with the reason; the page reads these when it shows, after a save, when the window regains focus, and from the button beside the list's title. A deployment that stores settings read-only shows the list without the edits. - **Creation card** — while the worktree is created, a card above the composer shows the new branch and its steps: fetching a remote base branch, creating the branch, and checking out files; More details adds the branch and base. Cancel stops the attempt. After a stopped or failed attempt the message keeps waiting, and the card shows the reason of a failure: Retry tries again, on the chosen name or a new generated one, and Continue without a worktree withdraws the request so the message goes on in the current checkout. A failed fetch also offers Use the last fetched version, which starts from the remote branch as last fetched. When the chosen branch or its directory already exists, Rename opens the naming dialog, whose Retry saves the new name and tries again. - **Removed worktree** — when the worktree the Session works in has been removed outside the Session, a card above the composer says so, and a message sent meanwhile waits without starting its turn until the worktree is restored or left; the card then says that the message goes on afterwards. Restore worktree, also offered as Restore in the Session panel's checkout row, checks the branch out again at the same directory, or creates the branch again at the commit it started from when the branch is gone too; while it runs, the card follows its two steps, preparing the worktree and checking out files, and the checkout row's Restore turns into a spinner. Continue in the project moves the Session to the source checkout. Meanwhile the checkout row shows a warning glyph. -- **Code review page** — the Code review row in the left navigation counts the open change requests that ask the signed-in user for a review and opens a page with three lists: Review requested, Created by me, and Involving me, each most recently updated first across every host a provider lists them on, read only while the page or the count shows. While a list is read, skeleton rows laid out as the chosen view stand in for its items. A list item names the repository when the lists span more than one, the author, the update time, the issues it closes, and at most one hint, such as You requested changes · Requested again or a team request; the search box filters the lists by title, number, repository, and author under the [client search rule](../../client/AGENTS.md#search-and-filter) and opens a pasted change request link with Enter. The view menu, laid out like the Session list's, switches between the Detailed view and a Compact view of one line per change request, whose title scrolls into view on hover and whose hover card lists the details, reads one repository, and leaves out team requests. The repository submenu keeps offering every repository the lists named while they were read in all, with the chosen one marked, so another repository is one choice away. The detail shows the state, repository and number, labels on one line that fold into +N, the title, author, times, and branches, the ready-for-review or merge action, and a More menu; Summary shows the description beside a status column of blocks: the merge state with the branch update, the failed, running, and cancelled checks with the rerun of the failed ones, each reviewer with their outcome and the review request, and the changed lines with the linked issues, where the checks and reviewers blocks fold after five lines and list everything on request, and a finished change request shows how it ended, its changed lines, and its reviewers, Changes shows the changes view with review threads, viewed files, and review submission, where Add to chat and Quote in chat put a comment or thread into the change request's conversation draft and count it on the Chat tab, and Chat starts a conversation in a blank Session of the Workspace whose folder has the repository's name, quoting the change request and offering three prompts, and binds the change request at the first message; New conversation starts another, and Open in main view shows it in the main view. Below 880 px of page width one column shows; signing in, rate limits, and unrecognized links show where they apply. +- **Code review page** — the Code review row in the left navigation counts the open change requests that ask the signed-in user for a review and opens a page with three lists: Review requested, Created by me, and Involving me, each most recently updated first across every host a provider lists them on, read only while the page or the count shows. While a host's first read of a list runs, skeleton rows laid out as the chosen view stand in for its items, below the items of the hosts that answered, and the list's count and its empty text wait for that host. A list item shows its title on at most two lines and its small text on at most two: the repository when the lists span more than one, the number, and the author, with the short update time at the end of that line, then at most one hint, such as Re-review requested or a team request, which shares that line where both fit and takes the second where they do not; the search box filters the lists by title, number, repository, author, and host under the [client search rule](../../client/AGENTS.md#search-and-filter) and opens a pasted change request link with Enter. The view menu, laid out like the Session list's, switches between the Detailed view and a Compact view of one line per change request, whose title scrolls into view on hover and whose hover card lists the details, reads one repository, and leaves out team requests. The repository submenu keeps offering every repository the lists named while they were read in all, with the chosen one marked, so another repository is one choice away. Once the lists name repositories on more than one host, the submenu lists each host with its repositories below it: choosing a host shows only its change requests, and choosing a repository reads the lists in it on its host only. A host whose lists could not be read shows one notice after the lists, with the sign-in command its provider names and Copy, or else the reason, and Open settings, which opens the bundle's page on the Plugins page while that page is available; when no host listed anything, the notices are all the column shows. A host whose read failed is read again later each time, up to `reviewMaxBackoffMs`, while the other hosts keep their cadence. The detail shows the state, repository and number, labels on one line that fold into +N, the title, author, times, and branches, and at the end of its first row the ready-for-review or merge action before three icon buttons: Open on the code host, which carries that host's mark, Copy link, and Refresh status. The merge action merges now, turns the code host's automatic merge on with a chosen method, or shows that it is on with its cancellation, and a merge the host would refuse shows unavailable and names why. A detail under 760 px wide folds the three buttons into a More menu, and where the row is tight the labels fold into +N first and the repository name is cut before the actions move to a second row. While the change request is read, a skeleton of the same layout stands in for it, with the three buttons already working; Summary shows the description, with the activity under it, beside a status column of blocks: the merge state with the branch update, the failed, running, and cancelled checks with the rerun of the failed ones, each reviewer with their outcome and the review request, and the changed lines with the linked issues, where the checks and reviewers blocks fold after five lines and list everything on request, and a finished change request shows how it ended, its changed lines, and its reviewers, Changes shows the changes view with review threads, viewed files, and review submission, where Add to chat and Quote in chat put a comment or thread into the change request's conversation draft and count it on the Chat tab, and Chat starts a conversation in a blank Session of the Workspace whose folder has the repository's name, quoting the change request and offering three prompts, and binds the change request at the first message; New conversation starts another, and Open in main view shows it in the main view. Below 880 px of page width one column shows; signing in, rate limits, and links whose host no provider serves show where they apply; such a link shows Unknown code host with Add host…, which opens the bundle's page on the Plugins page while that page is available. +- **Review page activity** — under the description, the Summary tab lists what happened on the change request, oldest first: each comment as a card with its author and Markdown text, each submitted review with its decision, each commit, and each change of state, such as a review request, a title change, or the merge. Consecutive commits show as one line that unfolds them, a review that left comments on lines or files opens the Changes tab, and a long comment starts cut short with Expand. The field under the list is three lines tall and grows with its text; the row under it names the code host the comment goes to and holds the Comment button, and Command or Control with Enter sends too. While the comment is sent the field is read-only, and when the code host did not save the comment, the field keeps its text and says why. While the activity is first read, skeleton rows stand in for it. The list is read again after a comment and whenever the change request's update time or its reviews change. A provider that reads no activity shows no such section, and the field shows only where the signed-in user can comment. - **Session panel** — the Environment section of the Session panel gains the checkout and local changes rows after the project row, and the connection row at its end while the panel stream is lost, and a Change requests section follows it. The panel has no refresh control: when it opens and when the window regains focus, it inspects the checkout again, checks sign-in, and polls every change request, at most once every 10 seconds per Session, so changes made outside the Session appear on return. A yellow dot on the panel toggle in the Session header marks an open change request with failed checks, requested changes, or conflicts, also while the panel is hidden. - **Checkout row** — names the checked-out branch, or Not on a branch with the abbreviated commit on a detached HEAD, and the kind of checkout, which is the worktree the Session created with its base, another worktree, or the project directory; its tooltip, shown after 500ms of hover, adds the path with the Host home shortened to `~`, and a branch name the row clips crawls into view while the pointer rests on the row. The row and its More button open the directory menu of the checkout root. For a removed worktree it shows a warning glyph and offers Restore. When Git cannot be read, the row says so, and its info button shows the failure after 500ms of hover, at once on keyboard focus, or on a press; outside a Git checkout there is no row. - **Connection row** — when the Session's panel stream ends, also before it delivered a first state, a status row at the end of the Environment section says the status stopped updating and that the Git and change request details may be out of date; Retry opens the stream again and the row goes away. - **Session list** — after a Session row's time, a branch glyph shows while the Session works in the worktree the panel created for it, and a glyph shows the state of its most urgent change request: one needing attention first, then open, draft, not yet polled, merged, and closed. The glyph of an open change request keeps the row's subdued color, with its head branch end filled in the color of running, passed, or failed checks; merged and closed ones keep their state colors. The row's hover card names the worktree branch and what it started from, then up to three change requests with their number, title, state, and checks, and how many more there are. A restart shows the states known before it until the next poll. -- **Change requests section** — shows while the Session has bound change requests or the repository's host needs sign-in. Its title carries their count. A status row above the cards asks to sign in to the host: with the sign-in command the provider names, such as `gh auth login --hostname github.com`, which crawls into view on hover, and Copy; when the provider names none, and when the sign-in check fails, with the host's reason behind an info button, as the checkout row shows its failure. The section shows with this row alone while the Session binds no change request. Each change request is a compact card, a filled block on the panel's row columns: one line with a glyph for its state, its title, its number, and a glyph for the outcome of its checks. A press on the line opens the change request's changes in the right sidebar; with Cmd or Ctrl held, with the middle button, and for a change request no provider serves or has read yet, it opens the host's page. The state glyph tells open, draft, merged, and closed apart, and marks an open one that is not a draft with failed checks, requested changes, or conflicts as needing attention, as the toggle's yellow dot does. The card's More menu, which shows on hover or focus as on the panel's other rows, offers View changes for a change request a provider serves, Open in browser, Copy change request link, Ready for review for an open draft, and Remove from this Session, whose toast offers Undo. While collapsed, the line reads its status in words to assistive technology, and the card's hover card shows the full title, the number with draft state and the head and base branches, and that status: the checks of an open change request and the most urgent of requested changes, conflicts, or draft, or when a merged or closed one ended; a failed read or an unserved URL stands there instead. Cancelled checks have a separate count, which the status names when no listed check failed. The checks glyphs share one ring: a check for passed, a cross for failed, a half fill while they run, and a dash otherwise. An expanded card shows one row per fact below its line, each a glyph and its value. For an open change request, the rows are the checks, whose menu groups the failed, running, and cancelled checks with their durations and links, lists the passed and skipped ones on request, and offers Rerun failed when the user may rerun checks and a failed check names a rerun none of whose checks is still running; the review decision with the first three reviewers' avatars and how many more, whose menu lists each reviewer with their kind and latest outcome, notes an outcome given before the latest commit, and, when the user may request reviews, re-requests a review from a reviewer or requests one from someone else through a search that lists the host's suggestions first; the merge state, which names a head behind its base and, when the user may update it, offers Update branch, whose menu chooses merge or rebase, pins the displayed head when opened, and disables Confirm update once a poll names another head; the changed lines, formatted in the selected UI language, with the unresolved threads, whose count ends in `+` when the provider counted only some threads, in a row that opens the changes view; and the linked issues the host closes when the change request merges, each linking to its page. The thread count and an issue's title show in a tooltip after 500ms of hover. A merged or closed one shows when it ended and the changed lines. Rerun failed, a review request, Update branch, Ready for review, and Merge report their outcome in a toast, which asks to check the change request in the browser when the host did not confirm the outcome, and new commits since the displayed head stop a rerun or an update. A change request the host would merge now offers Merge below its rows, whose menu lists the methods the repository allows with the user's usual one chosen and pins the displayed head when opened. Confirm merge uses that head; a polled head change disables confirmation until the menu is reopened after review. A toast reports each outcome, and new commits since that head stop the merge. The list shows three cards; with more, the panel's fold control after them shows the rest and folds them again, and the Session keeps that choice while it stays open. When the Session binds exactly one change request, its card starts expanded whatever its state; with several, every card starts collapsed. A card the user expands or collapses keeps that choice across updates and while the panel is hidden, for as long as the Session stays open; a card the user never toggled follows the default. +- **Change requests section** — shows while the Session has bound change requests or the repository's host needs sign-in. Its title carries their count. A status row above the cards asks to sign in to the host: with the sign-in command the provider names, such as `gh auth login --hostname github.com`, which crawls into view on hover, and Copy; when the provider names none, and when the sign-in check fails, with the host's reason behind an info button, as the checkout row shows its failure. The section shows with this row alone while the Session binds no change request. Each change request is a compact card, a filled block on the panel's row columns: one line with a glyph for its state, its title, its number, and a glyph for the outcome of its checks. A press on the line opens the change request's changes in the right sidebar; with Cmd or Ctrl held, with the middle button, and for a change request no provider serves or has read yet, it opens the host's page. The state glyph tells open, draft, merged, and closed apart, and marks an open one that is not a draft with failed checks, requested changes, or conflicts as needing attention, as the toggle's yellow dot does. The card's More menu, which shows on hover or focus as on the panel's other rows, offers View changes for a change request a provider serves, Open on the code host with that host's mark, Copy change request link, Ready for review for an open draft, and Remove from this Session, whose toast offers Undo. While collapsed, the line reads its status in words to assistive technology, and the card's hover card shows the full title, the number with draft state and the head and base branches, and that status: the checks of an open change request and the most urgent of requested changes, conflicts, or draft, or when a merged or closed one ended; a failed read or an unserved URL stands there instead. Cancelled checks have a separate count, which the status names when no listed check failed. The checks glyphs share one ring: a check for passed, a cross for failed, a half fill while they run, and a dash otherwise. An expanded card shows one row per fact below its line, each a glyph and its value. For an open change request, the rows are the checks, whose menu groups the failed, running, and cancelled checks with their durations and links, lists the passed and skipped ones on request, and offers Rerun failed when the user may rerun checks and a failed check names a rerun none of whose checks is still running; the review decision with the first three reviewers' avatars and how many more, whose menu lists each reviewer with their kind and latest outcome, notes an outcome given before the latest commit, and, when the user may request reviews, re-requests a review from a reviewer or requests one from someone else through a search that lists the host's suggestions first; the merge state, which names a head behind its base and, when the user may update it, offers Update branch, whose menu chooses merge or rebase, pins the displayed head when opened, and disables Confirm update once a poll names another head; the changed lines, formatted in the selected UI language, with the unresolved threads, whose count ends in `+` when the provider counted only some threads, in a row that opens the changes view; and the linked issues the host closes when the change request merges, each linking to its page. The thread count and an issue's title show in a tooltip after 500ms of hover. A merged or closed one shows when it ended and the changed lines. Rerun failed, a review request, Update branch, Ready for review, and Merge report their outcome in a toast, which asks to check the change request in the browser when the host did not confirm the outcome, and new commits since the displayed head stop a rerun or an update. A change request the host would merge now offers Merge below its rows, whose menu lists the methods the repository allows with the user's usual one chosen and pins the displayed head when opened. Confirm merge uses that head; a polled head change disables confirmation until the menu is reopened after review. A toast reports each outcome, and new commits since that head stop the merge. A change request the host would not merge yet offers Auto-merge there instead where the user can turn the code host's automatic merge on: the same menu, whose confirmation turns it on for the displayed head. Once it is on, the button reads Auto-merge enabled and its menu names the method and the account that turned it on, when the host names them, and offers Cancel auto-merge where the user may cancel. The list shows three cards; with more, the panel's fold control after them shows the rest and folds them again, and the Session keeps that choice while it stays open. When the Session binds exactly one change request, its card starts expanded whatever its state; with several, every card starts collapsed. A card the user expands or collapses keeps that choice across updates and while the panel is hidden, for as long as the Session stays open; a card the user never toggled follows the default. - **Local changes row** — whenever the `branch` scope changes files, independently of bound change requests, the row names the number of changed files with the added and deleted lines and opens the changes view. Its More menu offers View changes and, when the code host repository is recognized and no open change request (including drafts) has the checked-out branch as its head, Create change request, which sends the Session a user message in the UI language that asks the Agent to create a change request for these changes; a toast reports whether it was sent. -- **Changes view** — The Changes row and View changes item of a change request card and the local changes row open a right-sidebar tab that lists the changed files, closing the Session panel while it floats over the conversation. The local tab is named Local changes and shows Branch by default: the working tree and untracked files against the fork point. Its header names the checked-out branch, or the abbreviated commit on a detached HEAD, and the base branch, which opens a searchable menu: first Default, the base commit of the worktree the Session created, else the merge base of HEAD with the default branch of the code host remote, then remote-tracking and then local branches, each most recently committed first, without the checked-out branch and, outside a created worktree, without the remote-tracking branch Default already names. Typing filters the listed rows at once and lists the branches whose names contain the text, ignoring case, after a short pause; Enter chooses the first row. Choosing another branch compares with the merge base of HEAD and that branch. The tab keeps the choice while other scopes show; closing the tab or reloading the application returns it to Default. When the chosen branch is gone, its name is struck through, and when it shares no history with HEAD, the view says so as well; both offer Use the default base branch instead of Retry. A narrow view hides the note that uncommitted changes count, then the checked-out branch. Uncommitted compares them with HEAD, Unstaged with the index, and Staged compares the index with HEAD. A change request view shows the host's diff at its head and says how many commits the checked-out branch has beyond that head when it is the change request's head branch. The toolbar jumps to a file, totals the changed lines, refreshes, and switches between two columns and one and between wrapped and cut long lines. Its icon buttons and the header's Open in browser name their action after 500ms of hover or at once on keyboard focus. The toolbar and the header each keep one line: as the toolbar narrows, the line totals, expanding all files, two columns, and wrapping move into a More menu first, then the test file switch, with the viewed progress label shortened to a bare count beside its ring, and then refresh, while header buttons keep their labels on one line and the menus and title shorten. Visited changes tabs stay mounted across tab and Session switches, hiding the sidebar, and docking changes, preserving file folds, revealed large files, expanded context, layout, and scroll position while the diff is unchanged. Hidden changes views release their panel subscription and defer diff reads; returning reads again only when the latest head or local summary differs. A refresh that replaces the diff discards expanded context, and changed content may move the reading position. Temporary menus close when the view is hidden. Closing the tab or reloading the application discards this progress. Each file is a separate card, with a tinted header that stays at the top while its lines scroll. Files are named before their directories, which use smaller subdued type and shorten first; hovering one for 500ms shows its complete path, and both paths for a renamed file. Each file shows badges for a new, deleted, or renamed file, the last naming the old file name, or the old path when only the directory changed, and, in the Branch scope, an untracked one, and a menu that copies its path and opens the whole file in the sidebar for local changes or its page at the head in the browser for a change request. When the header is narrow, the path, the badges, and Changed since viewed shorten, so the line counts, Viewed, and the menu stay whole. Unchanged lines between hunks collapse into rows that expand from the file's new side: the working tree, the index for Staged, or the head commit through the code host; a file that changed after the diff was read stays collapsed until the view reads again. A row of at most 20 lines expands with one click. A longer row expands 20 lines at a time, down from the hunk above it or up from the hunk below it, the row before the first hunk only up and the row after the last hunk only down, and shows how many lines it still hides; the first click on the unknown lines after the last hunk reads the file and shows their first 20. A binary file and an untracked file over `maxDiffBytes` show a note instead of their lines, a file whose hunks draw more than 1,000 lines starts as one collapsed strip that names its changed lines and draws them when opened, and a file below files that change more than 5,000 lines starts collapsed. While the view reads changes it has not shown yet, it says Reading changes above file cards drawn as pulsing placeholders, one changed file in two columns when sides are split, and the files menu names no count; reduced motion keeps the placeholders still. The view reads again on Refresh and the page refresh shortcut, on each navigation, when the change request's head moves, and when the Branch scope's summary changes; a change request's view first waits for the status that names its head, unless no provider serves it or that poll failed. When the head moved past the latest status, the view keeps loading and reads again at the head of a status later than the one the read started with, at once when that status arrived during the read. While a read replaces changes already shown, the Refresh icon turns. A change request whose diff the code host or its provider refuses over a size limit, such as a GitHub diff whose output exceeds the provider's `maxOutputBytes`, says its changes are too large to show here and offers View in browser; another failed read offers Retry and, for a change request, View in browser. A change request's diff is downloaded once per head commit and base branch while it stays cached, so reopening, refreshing, and navigating at the same head read nothing from the host. Expanded unchanged lines and pending file reads survive a refresh of review marks for the same commit range, head, and patches. +- **Changes view** — The Changes row and View changes item of a change request card and the local changes row open a right-sidebar tab that lists the changed files, closing the Session panel while it floats over the conversation. The local tab is named Local changes and shows Branch by default: the working tree and untracked files against the fork point. Its header names the checked-out branch, or the abbreviated commit on a detached HEAD, and the base branch, which opens a searchable menu: first Default, the base commit of the worktree the Session created, else the merge base of HEAD with the default branch of the code host remote, then remote-tracking and then local branches, each most recently committed first, without the checked-out branch and, outside a created worktree, without the remote-tracking branch Default already names. Typing filters the listed rows at once and lists the branches whose names contain the text, ignoring case, after a short pause; Enter chooses the first row. Choosing another branch compares with the merge base of HEAD and that branch. The tab keeps the choice while other scopes show; closing the tab or reloading the application returns it to Default. When the chosen branch is gone, its name is struck through, and when it shares no history with HEAD, the view says so as well; both offer Use the default base branch instead of Retry. A narrow view hides the note that uncommitted changes count, then the checked-out branch. Uncommitted compares them with HEAD, Unstaged with the index, and Staged compares the index with HEAD. A change request view shows the host's diff at its head and says how many commits the checked-out branch has beyond that head when it is the change request's head branch. The toolbar jumps to a file, totals the changed lines, refreshes, and switches between two columns and one and between wrapped and cut long lines. Its icon buttons and the header's Open on the code host, which carries that host's mark, name their action after 500ms of hover or at once on keyboard focus. The toolbar and the header each keep one line: as the toolbar narrows, the line totals, expanding all files, two columns, and wrapping move into a More menu first, then the test file switch, with the viewed progress label shortened to a bare count beside its ring, and then refresh, while header buttons keep their labels on one line and the menus and title shorten. Visited changes tabs stay mounted across tab and Session switches, hiding the sidebar, and docking changes, preserving file folds, revealed large files, expanded context, layout, and scroll position while the diff is unchanged. Hidden changes views release their panel subscription and defer diff reads; returning reads again only when the latest head or local summary differs. A refresh that replaces the diff discards expanded context, and changed content may move the reading position. Temporary menus close when the view is hidden. Closing the tab or reloading the application discards this progress. Each file is a separate card, with a tinted header that stays at the top while its lines scroll. Files are named before their directories, which use smaller subdued type and shorten first; hovering one for 500ms shows its complete path, and both paths for a renamed file. Each file shows badges for a new, deleted, or renamed file, the last naming the old file name, or the old path when only the directory changed, and, in the Branch scope, an untracked one, and a menu that copies its path and opens the whole file in the sidebar for local changes or its page at the head on the code host for a change request. When the header is narrow, the path, the badges, and Changed since viewed shorten, so the line counts, Viewed, and the menu stay whole. Unchanged lines between hunks collapse into rows that expand from the file's new side: the working tree, the index for Staged, or the head commit through the code host; a file that changed after the diff was read stays collapsed until the view reads again. A row of at most 20 lines expands with one click. A longer row expands 20 lines at a time, down from the hunk above it or up from the hunk below it, the row before the first hunk only up and the row after the last hunk only down, and shows how many lines it still hides; the first click on the unknown lines after the last hunk reads the file and shows their first 20. A binary file and an untracked file over `maxDiffBytes` show a note instead of their lines, a file whose hunks draw more than 1,000 lines starts as one collapsed strip that names its changed lines and draws them when opened, and a file below files that change more than 5,000 lines starts collapsed. While the view reads changes it has not shown yet, it says Reading changes above file cards drawn as pulsing placeholders, one changed file in two columns when sides are split, and the files menu names no count; reduced motion keeps the placeholders still. The view reads again on Refresh and the page refresh shortcut, on each navigation, when the change request's head moves, and when the Branch scope's summary changes; a change request's view first waits for the status that names its head, unless no provider serves it or that poll failed. When the head moved past the latest status, the view keeps loading and reads again at the head of a status later than the one the read started with, at once when that status arrived during the read. While a read replaces changes already shown, the Refresh icon turns. A change request whose diff the code host or its provider refuses over a size limit, such as a GitHub diff whose output exceeds the provider's `maxOutputBytes`, says its changes are too large to show here and offers View on the code host; another failed read offers Retry and, for a change request, View on the code host. A change request's diff is downloaded once per head commit and base branch while it stays cached, so reopening, refreshing, and navigating at the same head read nothing from the host. Expanded unchanged lines and pending file reads survive a refresh of review marks for the same commit range, head, and patches. - **Review layers, test files, viewed files, and commits** — Above the file tree, the lens keeps All files or the files of one layer, Interface, Implementation, or Tests, each with its count; when the counts do not fit the tree's width, it shows the layer names alone and each count in the hover text of its layer. Where no tree shows, the toolbar offers the lens as a menu. The repository decides first: a file whose root `.gitattributes` sets `dsh-review-layer=test`, `interface`, or `implementation` is in that layer, and one it marks `linguist-generated` is in Tests. Next come the optional `testPaths` and `interfacePaths` globs, which add to the built-in rules and are empty by default. The built-in rules then follow common conventions: test directories and files of Jest, Vitest, `go test`, pytest, RSpec, XCTest, and .NET, snapshots, locale catalogs, and lockfiles are Tests; package manifests, type declarations, headers, stubs, and interface definitions such as Protocol Buffers, GraphQL, and OpenAPI are Interface. Every other file is in Implementation. For example, `*_test.go dsh-review-layer=test` or `api/**/*.yaml dsh-review-layer=interface` in `.gitattributes` records a repository's own convention. Hide test files leaves Tests out of the file tree and the diff without listing them, and disables the Tests lens. Viewed on a file header marks that change of the file viewed and collapses it; the toolbar shows how many of the shown files are viewed, as a ring filled to the viewed share and a label such as 2 / 3 viewed, and `V` marks or clears the file being read: the file holding the focus or the text cursor, else the file at the top of the view. A file whose change differs from the change it was marked at shows Changed since viewed and expands again. The file tree draws a viewed file subdued, and a directory once every file in it is viewed, so the files left to review stand out; a file changed since it was viewed draws as unviewed, and assistive technology reads the state as each row's description. A change of the file mode alone, such as `chmod +x`, also counts as a new change. A change request's view of all its commits uses the viewed marks its provider keeps on the code host, as the GitHub provider does: the view reads them with the diff, shows a mark at once, and saves it at the displayed head, keeping that file's checkbox disabled until the host answers; a file GitHub reports as changed since it was viewed shows Changed since viewed. A mark the host refuses, or one that new commits made stale, returns to its previous state, and a toast says why; a mark the host may have saved without confirming it stays, and a toast says to refresh to see where it stands. When the marks cannot be read, a notice says so and offers Retry, and no file can be marked. Hovering a checkbox tells where its mark is kept. Other marks are kept in this browser per Session, source, path, and change digest, so they survive closing the tab and reloading, and the tabs of one Session share them: a mark in one tab appears in the others and keeps their marks. All commits beside Submit review, and beside the base branch in the Branch scope, lists the commits oldest first, read once until the head, the local branch or base, or a refresh changes them; a click shows one commit and a Shift click the commits from the last one clicked, which must follow each other as first parents: a run that leaves that line, such as one across a merged branch, keeps the menu open and says why; the view then shows those commits' changes, reads unchanged lines at the last of them, and offers Add to input but no GitHub comment or review. Branch commits exclude uncommitted and untracked files. Another base or scope returns to all commits, and chosen commits that are gone or no longer one run offer Show all commits. - **Review threads** — A change request view overlays the review threads its code host read at the shown head. A thread on lines follows the row of its last line, on the side it was written on, or the collapsed unchanged lines that hold it; it shows the place it was written, each comment's avatar, author, time, and Markdown with raw HTML left out, and tags for the change request's author, bots, and comments still pending in the signed-in user's review. A resolved thread folds into one row that unfolds on request. Threads on a whole file open the file, and threads later commits made outdated gather after its lines in a section that shows the end of the hunk they were written on and offers View file at that commit, which reads the file at the commit they were written on with their lines marked. Chosen commits show only new-side threads whose lines number the last chosen commit. The file tree and each file header count unresolved threads. Each click on the count in a header goes to the file's next unresolved thread in the order the file shows them, threads the chosen commits do not hold last, and from the last back to the first; the Threads toolbar button opens the thread list, which groups the threads by file in file tree order and orders each file's threads the same way, shows the Unresolved, Resolved, or All threads, Unresolved first, and opens each thread at its place, choosing all commits for one the chosen commits do not hold. The list docks beside the files in a view at least 1,040px wide, floats over them in a narrower one and closes before it opens a thread there, and takes their whole width below 480px. The list names a truncated read. A thread offers Add to input, which quotes the whole thread, View on GitHub, and the writes the signed-in user may make. Without a pending review, its reply field replies at once, and its menu starts a pending review with the reply; with one, the field adds the reply to it, as GitHub adds every reply of the user to the pending review. Resolve thread and Unresolve thread change its state, and the menu of the user's own comment edits or deletes it after asking, saying when deleting the only comment deletes the thread. A resolved thread stays open while the user writes a reply or an edit in it. A write the code host refuses keeps the text and says why; a write whose outcome is unknown reads the threads again and asks the user to check them before trying again. Every write reads the threads again, since resolving a thread does not change a GitHub pull request's update time. Threads are read again at each status while the view shows, and from the code host after Refresh even while the panel keeps an earlier read; a failed read keeps the last threads and offers Retry, and a provider that does not read reviews shows none. @@ -77,6 +79,8 @@ Each inspection also decides whether the worktree is missing: the Session's dire `changeRequestViewed`, `setFileViewed`, `rerunChecks`, `requestReviews`, `reviewerCandidates`, and `updateBranch` act only on a visible binding a provider serves, else they refuse with `forgePanel/not-bound`. `changeRequestViewed` reads the provider's `viewedFiles` at the head commit of the shown diff and returns null when the provider keeps no viewed marks; a moved head refuses with `forgePanel/stale-head` and another failure with `forgePanel/viewed-failed`. It keeps one read per change request, keyed by head commit, under the same `maxCachedReviewBytes` and `reviewRefreshMs` bounds as the threads, and a mark saved through `ctx.forge` at that head replaces the kept state of its file, so saving a mark costs the provider's write and no further read; the reader's refresh passes `fresh` and reads the host again. `setFileViewed` saves one file's mark at that head through `setViewed`, and `rerunChecks` and `updateBranch` pass the head commit the card showed; a moved head refuses each of them with `forgePanel/stale-head`, another refusal with `forgePanel/action-failed` and the host's reason, and an outcome the host did not confirm with `forgePanel/action-unknown`. `requestReviews` asks one or more reviewers at once, refusing an empty list or an empty login, and `reviewerCandidates` lists the accounts that match a search, refusing with `forgePanel/reviewers-failed` when the host does not list them. The changes view reads a change request's viewed marks beside its diff, refuses marks read at another head as it refuses such a diff, and lets [`src/client/host-viewed.ts`](src/client/host-viewed.ts) keep each mark the reader sets per change request and head: a read at the same head keeps the marks whose writes are in flight, a mark whose write settled stays until the next read, and a write that settles after a diff at another head loaded changes nothing in it. +`hostReadiness(forge, host)` names no Session. It asks the provider of the forge family whether it reaches the host with the Host's credentials, within `readinessTimeoutMs`, and answers `unavailable` with the reason when no provider serves the family, the probe fails, or the time runs out; a cancelled call rejects. The provider rows' host pages read it once per saved host. + `changeRequestStates` streams, for the Session list, the last known number, title, state, draft flag, checks rollup, review decision, and mergeability of every change request that a listed Session the caller may read binds: a `baseline` frame, then `changed` frames. One run serves every stream. Cancellation is observed before initialization and between frames; the last stream and plugin disposal await initialization and accepted writes, then close the run’s storage domain. A later run waits for that closure before reopening the domain and reading its stored states. Binding updates received during listing override its initial snapshot. It lists Sessions through `sessionQuery` without loading them, takes the visible bindings of a loaded Session from `ctx.forgeSession` and of another from its cached `forgeChangeRequests` summary, follows binding changes of loaded Sessions, and watches the brief of each bound change request through `ctx.forge.watchBrief`, naming the state it holds for it: a merged change request is not read again, one that an earlier run of this process read waits for its interval, and any other stored one is read at once. Closed requests use the idle polling cadence, and merged requests remain watched for explicit refresh and for a snapshot read by a panel. It stores every changed state in the `forge_panel_change_requests` storage domain under the SHA-256 digest of its URL and drops unbound stored states only when every listed Session has known bindings; a failed write is logged and the state stays in memory. The stream fails when the Host lacks the Session query, projection cache, storage, or Session store service. `follow` and `reviewChangeRequest` watch the snapshot of each change request they show and ask `ctx.forge` for a status no older than `statusMaxAgeMs` (default 10 seconds). A Session's panel or a review page stream that starts while the latest snapshot result is older reads the status at once; one that starts with a newer result, or with none yet read by another snapshot watcher, follows the regular poll. @@ -165,7 +169,7 @@ None for a new worktree, as its notice belongs to the first request of the Sessi - **Linked-worktree projects** — the option is unavailable when the project is itself a linked worktree, unless the sandbox policy grants its Git directory: under workspace-write that directory lies outside the writable root, so neither the new branch nor later commits could be written. A grant registered while the panel shows takes effect at the next inspection. Windows processes ignore such grants, so there the option is offered and creation fails. Commits inside a created worktree need the grant too, as the [worktree service](../worktree/README.md#known-limitations-and-deferred-work) describes. - **Changes scopes** — deferred: a scope for the last turn. The Branch scope's Default needs a remote whose default branch HEAD shares history with, or a worktree the Session created; otherwise a base branch must be chosen. - **Very many branches** — the base branch menu reads every ref before it filters, so a search can reach any branch. Refs over `maxDiffBytes`, about 165,000 at the default, or a listing over `gitTimeoutMs`, leave the menu saying that branches could not be read; Default keeps working. -- **Large changes** — a local patch over `maxDiffBytes` shows no files, and a change request diff over the size limit of the host or its provider shows no files and offers only View in browser. Without wrapping, the side-by-side view cuts long lines at the column edge. +- **Large changes** — a local patch over `maxDiffBytes` shows no files, and a change request diff over the size limit of the host or its provider shows no files and offers only View on the code host. Without wrapping, the side-by-side view cuts long lines at the column edge. - **Highlighting across collapsed lines** — rows after collapsed unchanged lines take the colors of the lines before them only once the file is read: local files when they draw, change request files after one of their gaps expands. A code block, comment, or string that opens more than 120 lines before a run still leaves the run colored as if it started there. - **Undrawn files** — until the reader scrolls near an expanded file, it holds 22 px per drawn line, which leaves out side-by-side pairing, wrapped lines, unchanged-line rows, and review cards, so the scroll range shifts a little as files draw; its saved review comments also appear only once it draws. - **Find in page over long diffs** — an expanded file draws its lines only once the reader scrolls near it, so the browser's find in page does not match lines of files further down until they are drawn; a page-wide search of the diff needs a find control of the view's own. @@ -174,7 +178,8 @@ None for a new worktree, as its notice belongs to the first request of the Sessi - **Extensions** — a lens runs only once it is chosen, and its result applies to the files the view showed when it asked; reading the old side of a whole change request needs a provider that names merge bases. Line annotations stay out of the thread list, the unresolved counts, and thread navigation. - **Review layers** — the built-in rules cover common conventions only, so a repository records others in `.gitattributes`; a path cannot show Rust's inline `#[cfg(test)]` modules or which declarations a language exports, and the Interface layer keeps whole files, so finding changed exports needs a language analyzer that a later lens extension point can supply. `linguist-generated` is read only from the root `.gitattributes`, without nested `.gitattributes` files or attribute macros. - **Chosen commits** — a change request lists at most `maxCommits` commits of the provider, the oldest 250 for GitHub, while the Branch scope lists its newest `maxCommits`; a run must follow first parents, so commits of a merged branch can be shown one at a time but not together with the branch's own; a commit range is read from the host on every view; comments on chosen commits can only be added to the input, as a GitHub review addresses the head. -- **Review page** — only the GitHub provider lists change requests and reads descriptions, so the lists hold GitHub hosts, each provider's configured hosts together; a GitLab merge request opened from a pasted link shows its status, changes, and chat, with a read failure in place of its description. Choosing among hosts and accounts waits for a second provider that lists change requests. The changes tab shows no plugin lenses, annotations, toolbar, file-menu, or comment-form entries, whose extension points name a Session, and its quotes go to the chat's draft instead of the Session's input. The chat starts in the Workspace's shared blank Session, which New Session also shows, and does not check that the Workspace is a checkout of the repository; the change request to bind waits in Host memory until the first message, so a Host restart forgets it. Pending review comments last while the page shows their change request. +- **Review page** — the lists hold every configured host of every provider that lists change requests, the GitHub and GitLab providers today, and what a list holds on a host is its provider's to define: the GitLab provider's lists and their differences from GitHub's are in [its limitations](../forge-gitlab/README.md#known-limitations-and-deferred-work). A list row names no host; the repository submenu and the search box tell hosts apart. The left navigation's count does not follow the host or repository the lists are narrowed to. Choosing among accounts of one host is not offered. The changes tab shows no plugin lenses, annotations, toolbar, file-menu, or comment-form entries, whose extension points name a Session, and its quotes go to the chat's draft instead of the Session's input. The chat starts in the Workspace's shared blank Session, which New Session also shows, and does not check that the Workspace is a checkout of the repository; the change request to bind waits in Host memory until the first message, so a Host restart forgets it. Pending review comments last while the page shows their change request. +- **Review page activity** — the list holds the latest entries up to the provider's limit and links to the code host for earlier ones. Comments cannot be edited, deleted, or answered with a reaction, `@` names are not completed, a comment's images that need the user's host session do not load, and the comments a review left on lines or files are read and answered on the Changes tab only. ### Dev Note diff --git a/packages/experimental/client-ui-forge/README.zh.md b/packages/experimental/client-ui-forge/README.zh.md index e22f21a69e..5795d2cc3c 100644 --- a/packages/experimental/client-ui-forge/README.zh.md +++ b/packages/experimental/client-ui-forge/README.zh.md @@ -31,16 +31,18 @@ kind: "package-reference" - **工作树选项**——在新会话页面上,“新建工作树”与当前分支一起位于工作区与模式选择器那一行的右端。不在 Git 检出中时,两者均隐藏。分支默认为只读展示;勾选“新建工作树”后,它变为基准分支选择器。选择器的菜单可搜索,按最近提交排序依次列出:当前分支、每个远程的默认分支、本地分支,然后每个远程一组,组名旁显示该远程对应的仓库(识别出代码托管仓库时为 `owner/name`,否则为去掉用户名和密码后的获取地址);输入时已列出的行立即过滤,短暂停顿后列出名称包含所输入文字的分支,按 Enter 选择第一行。远程分支在创建 worktree 时获取,只获取这一个分支,不获取标签。菜单最后一行“指定新分支名称…”打开对话框:输入框以 `worktreePrefix` 开头,输入时检查 Git 的分支名规则;“确定”交给 Host,Host 还会拒绝检出中已有的分支名,拒绝时对话框保持打开并显示原因。指定名称后,选择器在基准前显示该名称,对话框也提供“改回自动命名”。权限阻止已有请求时,仍只读显示已选基准,并允许取消请求。悬停、聚焦或轻点只读分支或基准会显示完整说明。Session 为只读,或检出及其 Git 目录不在 Session 的可写根内(例如项目本身就是链接 worktree)时,该选项不可用,提示中说明原因。发送第一条消息后,消息立即交给 Session 并在那里等待,同时从基准分支在仓库的 `.agents/worktrees/` 下创建指定的分支,未指定时为 `dsh--<4 位随机十六进制数>`,并把它的检出设为 Session 的工作目录;worktree 建好后这条消息的这一轮才开始。 - **归档清理**——归档一个会话后,由[工作树服务](../worktree/README.zh.md)回收它创建的干净且无人引用的工作树,无论来自新会话选项还是模型的 `enter_worktree` 工具,分支及其提交保留。清理排队后,归档提示为“已归档,工作树将被清理”;最终保留时恢复为普通归档提示,失败时替换为警告而会话仍保持归档。撤销归档会取消尚未获准的删除,或等待已获准的删除结束;已移除的工作树使用现有的“恢复工作树”流程。插件页上该套件的 worktree 行提供“归档时不删除工作树”开关:保存后,归档会保留所有工作树并显示普通归档提示;开关在每次归档时读取,不影响已排队的清理。 +- **提供方主机**——插件页上该套件的 GitHub 行与 GitLab 行各打开一个页面,列出该提供方服务的主机。“添加”或 Enter 把输入的主机名(粘贴 URL 时取其中的主机与端口)加入待保存的列表;格式不对、已在列表中或已由另一个提供方服务的主机名不会加入,原因显示在输入框下方。行尾的移除按钮把该主机从待保存的列表中去掉,最后一个主机不能移除。“保存”把整个列表写入 profile patch,提供方无需重启即服务新列表。每个已保存的主机显示“已登录”、“未登录”(附提供方给出的登录命令与“复制”)或“无法检查”(附原因);页面在显示时、保存后、窗口重新获得焦点时以及点击列表标题旁的按钮时读取这些状态。以只读方式保存设置的部署只显示列表,不能修改。 - **创建卡片**——创建 worktree 期间,输入框上方的卡片显示新分支及其步骤:获取远程基准分支、创建分支、检出文件;“更多详情”会列出分支与基准。“取消”停止这次尝试。尝试被停止或失败后,消息继续等待,失败时卡片显示原因:“重试”再试一次,使用指定的名称或新的自动名称;“不使用工作树”撤回请求,消息在当前检出中继续发送。获取失败时还提供“使用上次获取的版本”,从上次获取的远程分支开始。指定的分支或其目录已存在时,“更改名称”打开命名对话框,其中的“重试”保存新名称并再试一次。 - **工作树已被删除**——Session 所在的 worktree 在 Session 之外被删除后,输入框上方的卡片会说明这一点;此期间发送的消息会等待、不开始这一轮,直到该 worktree 被恢复或离开,卡片也会说明消息之后会接着发送。“恢复工作树”(会话面板检出行中的“恢复”与之相同)在原目录重新检出该分支;分支也已删除时,从它开始时的提交重新创建分支;恢复期间卡片显示“准备工作树”“检出文件”两个步骤,检出行中的“恢复”变为加载状态。“在项目目录继续”把 Session 移回源检出。此期间检出行显示警示图标。 -- **代码评审页**——左侧导航的“代码评审”一行显示请登录用户评审的未关闭变更请求数,点开是包含“待我评审”“我创建的”“与我有关”三个列表的页面;每个列表合并提供方能列出的全部主机,按更新时间倒序,只在页面或计数显示时读取。列表读取期间,按所选视图排布的骨架行占据列表项的位置。列表项在列表跨多个仓库时写出仓库名,并显示作者、更新时间、会关闭的 issue 和至多一条提示,如“你请求过修改 · 已再次请求”或团队请求;搜索框按[客户端搜索规则](../../client/AGENTS.md#search-and-filter)以标题、编号、仓库和作者筛选列表,粘贴变更请求链接后按 Enter 打开。视图菜单与会话列表的一致:可在“详细”与“紧凑”之间切换(紧凑为每个变更请求一行,悬停时标题滚动显示完整内容,悬停卡列出详情),可只读一个仓库,也可排除团队请求。仓库子菜单始终列出在读取全部仓库时列表里出现过的仓库,并标出当前所选的那个,因此可以直接换到另一个仓库。详情显示状态、仓库与编号、单行标签(放不下时收进 +N)、标题、作者、时间和分支,以及标记为可评审或合并操作和“更多”菜单;“概要”在描述旁显示由若干区块组成的状态栏:合并状态与更新分支,失败、进行中、已取消的检查与重跑失败项,每位评审者及其结论与请求评审,变更行数与关联 issue;检查和评审者区块超过五行时折叠,可展开查看全部,已结束的变更请求则显示结束方式、变更行数和评审者,“变更”显示变更视图,含评审讨论、已审阅文件和提交评审,其中“添加到对话”“引用到对话”把评论或讨论放进该变更请求对话的草稿,并在“对话”标签上计数;“对话”在文件夹名与仓库同名的工作区的空白会话中开始对话,引用该变更请求并提供三个提示,首条消息时绑定该变更请求;“新对话”另开一个,“在主界面打开”在主界面显示它。页面宽度不足 880 px 时只显示一栏;需要登录、触发限流或链接无法识别时在对应位置提示。 +- **代码评审页**——左侧导航的“代码评审”一行显示请登录用户评审的未关闭变更请求数,点开是包含“待我评审”“我创建的”“与我有关”三个列表的页面;每个列表合并提供方能列出的全部主机,按更新时间倒序,只在页面或计数显示时读取。某个主机首次读取列表期间,按所选视图排布的骨架行占据它的列表项的位置,排在已返回的主机的列表项之后,列表的计数与空列表文字等它返回后再显示。列表项的标题至多两行,小字至多两行:列表跨多个仓库时写出仓库名,然后是编号和作者,简短的更新时间在这一行末尾,之后是至多一条提示,如“待你复审”或团队请求,放得下时与它们同一行,放不下时换到第二行;搜索框按[客户端搜索规则](../../client/AGENTS.md#search-and-filter)以标题、编号、仓库、作者和主机筛选列表,粘贴变更请求链接后按 Enter 打开。视图菜单与会话列表的一致:可在“详细”与“紧凑”之间切换(紧凑为每个变更请求一行,悬停时标题滚动显示完整内容,悬停卡列出详情),可只读一个仓库,也可排除团队请求。仓库子菜单始终列出在读取全部仓库时列表里出现过的仓库,并标出当前所选的那个,因此可以直接换到另一个仓库。列表里的仓库来自多个主机时,子菜单列出每个主机,主机的仓库列在它下面:选主机只显示该主机的变更请求,选仓库只在它所在的主机上读取列表。读取失败的主机在列表之后各显示一条提示:提供方给出登录命令时显示该命令与“复制”,否则显示原因;另有“前往配置”,在插件页可用时打开该套件的页面;没有主机列出任何内容时,这一栏只显示这些提示。读取失败的主机每次间隔更久再读,上限为 `reviewMaxBackoffMs`,其他主机保持原来的间隔。详情显示状态、仓库与编号、单行标签(放不下时收进 +N)、标题、作者、时间和分支,第一行末尾是标记为可评审或合并操作,之后是三个图标按钮:带平台图标的“在代码托管平台中打开”、“复制链接”和“刷新状态”。合并操作可以立即合并、选定方式后启用平台的自动合并,或显示自动合并已启用并可取消;平台会拒绝的合并显示为不可用并说明原因。详情不足 760 px 宽时三个按钮收进“更多”菜单;一行放不下时标签先收成 +N,再截断仓库名,最后才把操作换到第二行。变更请求读取期间,同样布局的骨架占位,三个按钮已可使用;“概要”在描述及其下方的动态旁显示由若干区块组成的状态栏:合并状态与更新分支,失败、进行中、已取消的检查与重跑失败项,每位评审者及其结论与请求评审,变更行数与关联 issue;检查和评审者区块超过五行时折叠,可展开查看全部,已结束的变更请求则显示结束方式、变更行数和评审者,“变更”显示变更视图,含评审讨论、已审阅文件和提交评审,其中“添加到对话”“引用到对话”把评论或讨论放进该变更请求对话的草稿,并在“对话”标签上计数;“对话”在文件夹名与仓库同名的工作区的空白会话中开始对话,引用该变更请求并提供三个提示,首条消息时绑定该变更请求;“新对话”另开一个,“在主界面打开”在主界面显示它。页面宽度不足 880 px 时只显示一栏;需要登录、触发限流或链接的主机没有提供方服务时在对应位置提示;后一种情况显示“未知的代码托管平台”与“添加主机…”,在插件页可用时打开该套件的页面。 +- **评审页动态**——“概要”标签页在描述下方按时间从旧到新列出变更请求上发生过的事:每条评论是一张带作者和 Markdown 正文的卡片,每次已提交的评审带它的结论,每个提交,以及每次状态变化,如请求评审、修改标题或合并。连续的提交合成一行,可展开;在行或文件上留了评论的评审会打开“变更”标签页;长评论先截短显示,可“展开”。列表下方的输入框高三行,随文字增高;它下面一行写明评论发布到哪个代码托管平台,并放着“评论”按钮,Command / Control 加 Enter 也可发送。发送期间输入框只读;代码托管平台没有保存评论时,输入框保留文字并说明原因。动态首次读取期间由骨架行占位。添加评论之后,以及变更请求的更新时间或评审发生变化时,列表会重新读取。提供方不读取动态时不显示这一区域,输入框只在当前用户可以评论时显示。 - **会话面板**——会话面板的“环境”分栏在项目行之后增加检出行与本地变更行,面板流断开时末尾再加连接行,其后是“变更请求”分栏。面板没有刷新控件:打开时以及窗口重新获得焦点时,它会重新检查检出与登录状态,并轮询每个变更请求,每个会话每 10 秒最多一次,因此在 Session 之外做的改动在切回来时就会出现。打开中的变更请求存在检查失败、被要求修改或冲突时,会话标题栏中的面板开关带黄点,面板隐藏时也会显示。 - **检出行**——显示当前检出的分支(分离 HEAD 时为“不在分支上”与缩写提交),并说明检出的类型(Session 创建的 worktree 及其基准、其他 worktree 或项目目录);悬停 500ms 后出现的提示给出路径,宿主主目录缩写为 `~`;分支名放不下时,指针停在这一行上会滚动显示全文。这一行及其“更多”按钮打开检出根目录的目录菜单。worktree 已被删除时显示警示图标并提供“恢复”。无法读取 Git 时,这一行说明这一点,行尾的信息按钮在悬停 500ms、键盘聚焦或按下时给出失败原因;不在 Git 检出中时不显示这一行。 - **连接行**——Session 的面板流结束时(包括还没收到第一份状态就结束),环境分栏末尾的状态行说明状态已停止更新,Git 与变更请求信息可能已过时;「重试」重新打开流,这一行随即消失。 - **会话列表**——Session 在面板为它创建的 worktree 中工作时,会话行的时间之后显示分支图标;另有一个图标显示它最需要关注的变更请求的状态,依次为需要处理、打开、草稿、尚未轮询、已合并、已关闭。打开中的变更请求图标保持会话行的浅色,head 分支端点填充为检查进行中、已通过或失败对应的颜色;已合并与已关闭的保留各自的状态颜色。会话行的悬浮卡片写出 worktree 分支及其起点,再列出最多三个变更请求的编号、标题、状态与检查,并说明还有多少个。重启后,下次轮询之前显示重启前已知的状态。 -- **变更请求分栏**——Session 有已绑定的变更请求,或仓库所在托管平台需要登录时显示。分栏标题旁显示数量。卡片上方的状态行请用户登录托管平台:显示提供方给出的登录命令(例如 `gh auth login --hostname github.com`,悬停时滚动显示全文)和「复制」;提供方没有给出命令以及登录检查失败时,平台给出的原因收在信息按钮里,与检出行显示失败的方式相同。Session 没有绑定变更请求时,分栏只显示这一行。每个变更请求是一张紧凑卡片,即面板行列上的一块底色:一行内依次是状态图标、标题、编号和检查结果图标。点击这一行在右侧边栏打开该变更请求的变更;按住 Cmd 或 Ctrl 点击、用中键点击,以及没有提供方服务或尚未读取的变更请求,则打开托管平台上的页面。状态图标区分打开、草稿、已合并与已关闭,打开中的变更请求(草稿除外)检查失败、被要求修改或有冲突时显示为“需要处理”,与面板开关的黄点一致。卡片的“更多”菜单与面板其他行一样在悬停或聚焦时出现,提供由提供方服务的变更请求的“查看变更”、“在浏览器中打开”“复制变更请求链接”、打开中草稿的“标记为可评审”,以及“从本会话移除”,移除后的 toast 提供“撤销”。收起时,这一行把状态以文字读给辅助技术,卡片的悬停卡片显示完整标题、编号(带草稿状态与源分支、目标分支)和这段状态:打开的变更请求的检查,以及被要求修改、冲突、草稿中最需要注意的一项;已合并或已关闭的则是结束时间;读取失败或没有提供方服务的 URL 则显示相应说明。已取消的检查单独计数,列出的检查没有失败项时状态显示取消数量。检查结果图标共用同一个圆环:通过为勾,失败为叉,进行中为半填充,其余为短横。展开的卡片在这一行下面每项一行,由图标与取值组成。打开的变更请求依次是:检查,其菜单按失败、运行中、已取消分组列出检查及其耗时与链接,按需列出通过与跳过的检查,用户可以重跑检查、且有失败检查指向一个其中没有检查仍在进行的重跑时提供“重跑失败项”;评审结论,带前三位评审者的头像与其余人数,其菜单列出每位评审者的类型与最近结论,注明早于最新提交的结论,用户可以请求评审时还能重新请求某位评审者,或通过先列出托管平台建议的搜索向其他人请求评审;合并状态,会注明 head 落后于基线,用户可以更新时提供“更新分支”,其菜单在 merge 与 rebase 之间选择,打开时固定卡片显示的 head,轮询发现 head 变化后禁用“确认更新”;按所选界面语言格式化的变更行数与未解决讨论数(提供方只统计了部分讨论时数字后带 `+`),点击该行打开变更视图;以及合并时托管平台会关闭的关联 issue,各自链接到其页面。讨论数和 issue 标题在悬停 500ms 后以提示显示。已合并或已关闭的显示结束时间与变更行数。“重跑失败项”、评审请求、“更新分支”、“标记为可评审”与“合并”的结果都以 toast 报告,托管平台未确认结果时提示到浏览器中查看变更请求;显示的 head 之后有新提交时不会重跑或更新。主机现在就会合并的变更请求在各行下方提供“合并”,其菜单列出仓库允许的合并方式并选中用户常用的一种,打开时固定卡片显示的 head。“确认合并”使用这个 head;轮询发现 head 变化后禁用确认,需重新检查并打开菜单。每次操作的结果都以 toast 报告;该 head 之后有新提交时不会合并。列表显示三张卡片;更多时,卡片之后是面板的折叠控件,用来显示其余卡片或再次收起,Session 保持打开期间保留这一选择。Session 只绑定了一个变更请求时,无论其状态如何,它的卡片默认展开;绑定多个时,所有卡片默认收起。用户展开或收起某张卡片后,在 Session 保持打开期间,更新和隐藏面板都不会改变这一选择;用户没有动过的卡片仍按默认规则。 +- **变更请求分栏**——Session 有已绑定的变更请求,或仓库所在托管平台需要登录时显示。分栏标题旁显示数量。卡片上方的状态行请用户登录托管平台:显示提供方给出的登录命令(例如 `gh auth login --hostname github.com`,悬停时滚动显示全文)和「复制」;提供方没有给出命令以及登录检查失败时,平台给出的原因收在信息按钮里,与检出行显示失败的方式相同。Session 没有绑定变更请求时,分栏只显示这一行。每个变更请求是一张紧凑卡片,即面板行列上的一块底色:一行内依次是状态图标、标题、编号和检查结果图标。点击这一行在右侧边栏打开该变更请求的变更;按住 Cmd 或 Ctrl 点击、用中键点击,以及没有提供方服务或尚未读取的变更请求,则打开托管平台上的页面。状态图标区分打开、草稿、已合并与已关闭,打开中的变更请求(草稿除外)检查失败、被要求修改或有冲突时显示为“需要处理”,与面板开关的黄点一致。卡片的“更多”菜单与面板其他行一样在悬停或聚焦时出现,提供由提供方服务的变更请求的“查看变更”、带平台图标的“在代码托管平台中打开”、“复制变更请求链接”、打开中草稿的“标记为可评审”,以及“从本会话移除”,移除后的 toast 提供“撤销”。收起时,这一行把状态以文字读给辅助技术,卡片的悬停卡片显示完整标题、编号(带草稿状态与源分支、目标分支)和这段状态:打开的变更请求的检查,以及被要求修改、冲突、草稿中最需要注意的一项;已合并或已关闭的则是结束时间;读取失败或没有提供方服务的 URL 则显示相应说明。已取消的检查单独计数,列出的检查没有失败项时状态显示取消数量。检查结果图标共用同一个圆环:通过为勾,失败为叉,进行中为半填充,其余为短横。展开的卡片在这一行下面每项一行,由图标与取值组成。打开的变更请求依次是:检查,其菜单按失败、运行中、已取消分组列出检查及其耗时与链接,按需列出通过与跳过的检查,用户可以重跑检查、且有失败检查指向一个其中没有检查仍在进行的重跑时提供“重跑失败项”;评审结论,带前三位评审者的头像与其余人数,其菜单列出每位评审者的类型与最近结论,注明早于最新提交的结论,用户可以请求评审时还能重新请求某位评审者,或通过先列出托管平台建议的搜索向其他人请求评审;合并状态,会注明 head 落后于基线,用户可以更新时提供“更新分支”,其菜单在 merge 与 rebase 之间选择,打开时固定卡片显示的 head,轮询发现 head 变化后禁用“确认更新”;按所选界面语言格式化的变更行数与未解决讨论数(提供方只统计了部分讨论时数字后带 `+`),点击该行打开变更视图;以及合并时托管平台会关闭的关联 issue,各自链接到其页面。讨论数和 issue 标题在悬停 500ms 后以提示显示。已合并或已关闭的显示结束时间与变更行数。“重跑失败项”、评审请求、“更新分支”、“标记为可评审”与“合并”的结果都以 toast 报告,托管平台未确认结果时提示到浏览器中查看变更请求;显示的 head 之后有新提交时不会重跑或更新。主机现在就会合并的变更请求在各行下方提供“合并”,其菜单列出仓库允许的合并方式并选中用户常用的一种,打开时固定卡片显示的 head。“确认合并”使用这个 head;轮询发现 head 变化后禁用确认,需重新检查并打开菜单。每次操作的结果都以 toast 报告;该 head 之后有新提交时不会合并。主机暂时不会合并、但用户可以启用平台自动合并的变更请求,在同一位置改为提供“自动合并”:菜单相同,确认后为显示的 head 启用。启用后按钮显示“已启用自动合并”,菜单写出平台给出的合并方式和启用人,用户可以取消时提供“取消自动合并”。列表显示三张卡片;更多时,卡片之后是面板的折叠控件,用来显示其余卡片或再次收起,Session 保持打开期间保留这一选择。Session 只绑定了一个变更请求时,无论其状态如何,它的卡片默认展开;绑定多个时,所有卡片默认收起。用户展开或收起某张卡片后,在 Session 保持打开期间,更新和隐藏面板都不会改变这一选择;用户没有动过的卡片仍按默认规则。 - **本地变更行**——`branch` 范围有文件变更时始终显示,不受已关联变更请求影响。这一行显示变更的文件数以及新增、删除行数,点击打开变更视图。它的“更多”菜单提供“查看变更”;识别出代码托管仓库、且没有以当前检出分支为源分支的打开中变更请求(含草稿)时,还提供“创建变更请求”:它以界面语言向 Session 发送一条用户消息,请 Agent 为这些变更创建变更请求,并以 toast 报告是否已发送。 -- **变更视图**——变更请求卡片上的“变更”一行与“查看变更”菜单项、以及本地变更行会打开一个右侧边栏标签页,列出所有变更的文件;会话面板浮在对话上方时随之关闭。本地标签页名为“本地变更”,默认显示“分支”:工作树与未跟踪文件相对于分叉点的变更。它的标题栏写出当前检出的分支(分离 HEAD 时为缩写提交)与基准分支;点击基准分支打开可搜索的菜单:最前面是“默认”,即 Session 创建的 worktree 的基准提交,否则是 HEAD 与代码托管远端默认分支的合并基准;其后依次是远程跟踪分支与本地分支,各按最近提交排序,不含当前检出的分支,不在所创建的 worktree 中时也不含“默认”已经指向的远程跟踪分支。输入文字会立即筛选已列出的行,短暂停顿后列出名称包含该文字(不区分大小写)的分支;按 Enter 选择第一行。选择其他分支后,与 HEAD 和该分支的合并基准比较。标签页切换到其他范围时仍保留这个选择;关闭标签页或重新加载应用后回到“默认”。所选分支已不存在时,它的名称显示删除线;它与 HEAD 没有共同历史时,视图同样给出说明;两种情况都提供“使用默认基准分支”而不是“重试”。视图较窄时,先隐藏“包含未提交的修改”,再隐藏当前分支。“未提交”与 HEAD 比较,“未暂存”与暂存区比较,“已暂存”比较暂存区与 HEAD。变更请求的视图显示托管平台在其 head 处的 diff;当前检出分支就是该变更请求的源分支时,还会说明本地分支比该 head 多出几个提交。工具栏可以跳到某个文件、汇总变更行数、刷新,并在左右对比与单栏对比、自动换行与截断长行之间切换。工具栏的图标按钮和标题栏的“在浏览器中打开”悬停 500ms 后显示操作说明,键盘聚焦时立即显示。工具栏和标题栏各自保持一行:工具栏变窄时,先把变更行数、全部展开、左右对比与自动换行收进“更多视图选项”菜单,再收起“隐藏测试文件”开关,已审阅进度的文字缩短为圆环旁的计数,最后收起刷新;标题栏的按钮文字不换行,菜单和标题先缩短。访问过的变更标签页会在切换标签页与 Session、隐藏侧边栏及调整停靠位置时保持挂载,在 diff 未改变时保留文件折叠、大文件展开、上下文展开、布局与滚动位置。隐藏的变更视图释放面板订阅并推迟 diff 读取;返回时仅在最新 head 或本地摘要不同时重新读取。刷新替换 diff 后会丢弃展开的上下文,内容变化也可能移动阅读位置。视图隐藏时关闭临时菜单。关闭标签页或重新加载应用后不保留这些进度。每个文件是一张独立的卡片,带浅色底的标题在滚动时停在顶部。文件名在前,目录在后,用更小的浅色字显示,空间不够时目录先缩短;悬停 500ms 后显示完整路径,重命名的文件显示新旧两条路径。每个文件带有新文件、已删除、重命名的标记(重命名标记写出原文件名,只换了目录时写出原路径),“分支”范围下的未跟踪文件还标“未提交”;文件菜单可以复制路径,本地变更可在侧边栏打开整个文件,变更请求可在浏览器中查看该文件在 head 处的页面。标题变窄时,路径、标记和“有新改动”会缩短,行数、“已审阅”和文件菜单始终完整显示。hunk 之间未变更的行折叠成一行,点击后从文件的新版本展开:工作树、“已暂存”时为暂存区,或经托管平台读取的 head 提交;读取 diff 之后文件又有修改时不会展开,直到视图重新读取。不超过 20 行的折叠行点一次全部展开。更长的折叠行每次展开 20 行,可以从上方 hunk 向下展开,也可以从下方 hunk 向上展开;第一个 hunk 之前的折叠行只能向上展开,最后一个 hunk 之后的只能向下展开;折叠行上显示还隐藏的行数。最后一个 hunk 之后行数未知的折叠行,第一次点击时读取文件并显示前 20 行。二进制文件与超过 `maxDiffBytes` 的未跟踪文件只显示一条说明;hunk 超过 1,000 行的文件先显示为一条写出变更行数的折叠条,点击后才绘制;前面的文件累计变更超过 5,000 行后,其后的文件默认收起。视图读取尚未显示过的变更时,会在显示为脉动占位的文件卡片上方写出“正在读取变更…”,并排视图下其中一个已修改文件画成两栏,文件菜单不显示数量;开启“减少动态效果”时占位不动。刷新与页面刷新快捷键、每次导航、变更请求的 head 变化,以及“分支”范围的摘要变化时,视图都会重新读取;变更请求的视图会先等到给出 head 的状态再读取,除非没有提供方服务它或那次轮询失败。head 已越过最新状态时,视图保持加载,等到比读取开始时更新的状态后按其 head 重新读取;该状态在读取期间已到达时立即重读。重新读取已显示的变更时,刷新图标会旋转。托管平台或其提供方因超过大小上限拒绝给出 diff 的变更请求(例如 GitHub 上输出超过提供方 `maxOutputBytes` 的 diff)显示“变更太大,无法在这里显示”并提供“在浏览器中查看”;其他读取失败提供“重试”,变更请求还提供“在浏览器中查看”。变更请求的 diff 在缓存期间对每个 head 提交与目标分支只下载一次,因此在同一 head 下重新打开、刷新与导航都不会再从托管平台读取。刷新评审标记时,如果比较的提交范围、末端提交和补丁都相同,已经展开的未变更行和正在读取的文件内容会保留。 +- **变更视图**——变更请求卡片上的“变更”一行与“查看变更”菜单项、以及本地变更行会打开一个右侧边栏标签页,列出所有变更的文件;会话面板浮在对话上方时随之关闭。本地标签页名为“本地变更”,默认显示“分支”:工作树与未跟踪文件相对于分叉点的变更。它的标题栏写出当前检出的分支(分离 HEAD 时为缩写提交)与基准分支;点击基准分支打开可搜索的菜单:最前面是“默认”,即 Session 创建的 worktree 的基准提交,否则是 HEAD 与代码托管远端默认分支的合并基准;其后依次是远程跟踪分支与本地分支,各按最近提交排序,不含当前检出的分支,不在所创建的 worktree 中时也不含“默认”已经指向的远程跟踪分支。输入文字会立即筛选已列出的行,短暂停顿后列出名称包含该文字(不区分大小写)的分支;按 Enter 选择第一行。选择其他分支后,与 HEAD 和该分支的合并基准比较。标签页切换到其他范围时仍保留这个选择;关闭标签页或重新加载应用后回到“默认”。所选分支已不存在时,它的名称显示删除线;它与 HEAD 没有共同历史时,视图同样给出说明;两种情况都提供“使用默认基准分支”而不是“重试”。视图较窄时,先隐藏“包含未提交的修改”,再隐藏当前分支。“未提交”与 HEAD 比较,“未暂存”与暂存区比较,“已暂存”比较暂存区与 HEAD。变更请求的视图显示托管平台在其 head 处的 diff;当前检出分支就是该变更请求的源分支时,还会说明本地分支比该 head 多出几个提交。工具栏可以跳到某个文件、汇总变更行数、刷新,并在左右对比与单栏对比、自动换行与截断长行之间切换。工具栏的图标按钮和标题栏带平台图标的“在代码托管平台中打开”悬停 500ms 后显示操作说明,键盘聚焦时立即显示。工具栏和标题栏各自保持一行:工具栏变窄时,先把变更行数、全部展开、左右对比与自动换行收进“更多视图选项”菜单,再收起“隐藏测试文件”开关,已审阅进度的文字缩短为圆环旁的计数,最后收起刷新;标题栏的按钮文字不换行,菜单和标题先缩短。访问过的变更标签页会在切换标签页与 Session、隐藏侧边栏及调整停靠位置时保持挂载,在 diff 未改变时保留文件折叠、大文件展开、上下文展开、布局与滚动位置。隐藏的变更视图释放面板订阅并推迟 diff 读取;返回时仅在最新 head 或本地摘要不同时重新读取。刷新替换 diff 后会丢弃展开的上下文,内容变化也可能移动阅读位置。视图隐藏时关闭临时菜单。关闭标签页或重新加载应用后不保留这些进度。每个文件是一张独立的卡片,带浅色底的标题在滚动时停在顶部。文件名在前,目录在后,用更小的浅色字显示,空间不够时目录先缩短;悬停 500ms 后显示完整路径,重命名的文件显示新旧两条路径。每个文件带有新文件、已删除、重命名的标记(重命名标记写出原文件名,只换了目录时写出原路径),“分支”范围下的未跟踪文件还标“未提交”;文件菜单可以复制路径,本地变更可在侧边栏打开整个文件,变更请求可在代码托管平台上查看该文件在 head 处的页面。标题变窄时,路径、标记和“有新改动”会缩短,行数、“已审阅”和文件菜单始终完整显示。hunk 之间未变更的行折叠成一行,点击后从文件的新版本展开:工作树、“已暂存”时为暂存区,或经托管平台读取的 head 提交;读取 diff 之后文件又有修改时不会展开,直到视图重新读取。不超过 20 行的折叠行点一次全部展开。更长的折叠行每次展开 20 行,可以从上方 hunk 向下展开,也可以从下方 hunk 向上展开;第一个 hunk 之前的折叠行只能向上展开,最后一个 hunk 之后的只能向下展开;折叠行上显示还隐藏的行数。最后一个 hunk 之后行数未知的折叠行,第一次点击时读取文件并显示前 20 行。二进制文件与超过 `maxDiffBytes` 的未跟踪文件只显示一条说明;hunk 超过 1,000 行的文件先显示为一条写出变更行数的折叠条,点击后才绘制;前面的文件累计变更超过 5,000 行后,其后的文件默认收起。视图读取尚未显示过的变更时,会在显示为脉动占位的文件卡片上方写出“正在读取变更…”,并排视图下其中一个已修改文件画成两栏,文件菜单不显示数量;开启“减少动态效果”时占位不动。刷新与页面刷新快捷键、每次导航、变更请求的 head 变化,以及“分支”范围的摘要变化时,视图都会重新读取;变更请求的视图会先等到给出 head 的状态再读取,除非没有提供方服务它或那次轮询失败。head 已越过最新状态时,视图保持加载,等到比读取开始时更新的状态后按其 head 重新读取;该状态在读取期间已到达时立即重读。重新读取已显示的变更时,刷新图标会旋转。托管平台或其提供方因超过大小上限拒绝给出 diff 的变更请求(例如 GitHub 上输出超过提供方 `maxOutputBytes` 的 diff)显示“变更太大,无法在这里显示”并提供“在代码托管平台中查看”;其他读取失败提供“重试”,变更请求还提供“在代码托管平台中查看”。变更请求的 diff 在缓存期间对每个 head 提交与目标分支只下载一次,因此在同一 head 下重新打开、刷新与导航都不会再从托管平台读取。刷新评审标记时,如果比较的提交范围、末端提交和补丁都相同,已经展开的未变更行和正在读取的文件内容会保留。 - **分层、测试文件、已审阅与提交**——文件树上方的分层透镜保留全部文件,或“接口”“实现”“测试”中一层的文件,并显示各自的数量;文件树宽度放不下数量时,只显示各层名称,数量在悬停提示里。不显示文件树时,工具栏以菜单提供透镜。仓库的声明优先:根目录 `.gitattributes` 把文件设为 `dsh-review-layer=test`、`interface` 或 `implementation` 时,文件属于对应的层;标为 `linguist-generated` 的文件属于“测试”。其次是可选的 `testPaths` 与 `interfacePaths`,它们追加在内置规则之前,默认为空。最后是按常见约定写的内置规则:Jest、Vitest、`go test`、pytest、RSpec、XCTest 与 .NET 的测试目录和文件、快照、本地化目录与 lockfile 属于“测试”;包清单、类型声明、头文件、类型存根与 Protocol Buffers、GraphQL、OpenAPI 等接口定义属于“接口”。其余文件属于“实现”。例如在 `.gitattributes` 中写 `*_test.go dsh-review-layer=test` 或 `api/**/*.yaml dsh-review-layer=interface`,即可记录仓库自己的约定。“隐藏测试文件”让文件树与 diff 都不显示“测试”层,也不列出被隐藏的文件,同时停用“测试”透镜。文件标题上的“已审阅”把该文件的这次改动标为已审阅并折叠它;工具栏以按已审阅比例填充的圆环和“已审阅 2 / 3”这样的文字显示已显示文件中已审阅的数量,按 `V` 标记或取消当前阅读的文件:焦点或文本光标所在的文件,否则是视图顶部的文件。改动与标记时不同的文件显示“有新改动”并重新展开。文件树把已审阅的文件置灰,目录下的文件全部已审阅时目录也置灰,以便看出还没审阅的文件;有新改动的文件按未审阅显示,辅助技术把这一状态读作每行的描述。只改文件模式(例如 `chmod +x`)也算新改动。变更请求的全部提交视图使用提供方保存在代码托管平台上的已审阅标记(GitHub 提供方即如此):视图随 diff 一起读取这些标记,勾选后立即显示,并在显示的 head 上保存,平台答复前该文件的复选框保持禁用;GitHub 报告为标记后又有改动的文件显示“有新改动”。平台拒绝或因新提交而过期的标记恢复原状,并以 toast 说明原因;平台可能已保存但未确认的标记保持不变,toast 提示刷新查看实际状态。无法读取标记时,提示条说明原因并提供“重试”,此时不能标记任何文件。悬停复选框会说明标记保存在哪里。其他标记按 Session、变更来源、路径与改动摘要保存在本浏览器中,关闭标签页或重新加载后仍在;同一 Session 的多个标签页共用这些标记:在一个标签页中标记,其他标签页随之更新,且不会覆盖它们的标记。“提交评审”左侧,以及“分支”范围中基准分支右侧的“全部提交”按从旧到新列出提交,读取一次后保留到 head、本地分支或基准变化或刷新为止;单击只看一个提交,按住 Shift 单击看从上次单击的提交到这个提交的连续多个提交,这些提交必须依次是后一个的第一父提交:离开这条链的范围(例如跨越已合并分支的范围)会让菜单保持打开并说明原因;此时视图显示这些提交的改动,在最后一个提交读取未变更的行,提供“添加到输入框”,但不提供 GitHub 评论或评审。“分支”的提交不含未提交与未跟踪的文件。换基准分支或范围后回到全部提交;所选提交已不存在或不再是一条链时提供“查看全部提交”。 - **评审讨论**——变更请求视图会叠加代码托管平台在所显示 head 处读到的评审讨论。行级讨论显示在它最后一行所在的行之后,位于写下时所在的那一侧;若该行折叠在未变更的行中,则显示在折叠行之后。讨论标明写下时的位置,每条评论显示头像、作者、时间和 Markdown 正文(不显示原始 HTML),并用标签标出变更请求作者、机器人账号,以及当前登录用户尚未提交的评审中的评论。已解决的讨论折叠成一行,可以展开。针对整个文件的讨论显示在文件开头;被后续提交改到而过期的讨论集中在文件的行之后,显示写下时那段 hunk 的末尾,并提供“查看当时的文件”,读取写下讨论时那个提交上的文件并标出相应的行。选择了部分提交时,只显示行号对应最后一个所选提交的新版本侧讨论。文件树和每个文件标题都显示未解决讨论数。每点击一次文件标题上的计数,就按文件中的显示顺序跳到该文件的下一条未解决讨论(所选提交中没有的讨论排在最后),到最后一条后回到第一条;工具栏的“讨论”按钮打开讨论列表。列表按文件树顺序分组,组内讨论的顺序与文件中相同,可显示未解决、已解决或全部讨论,默认显示未解决的讨论;点击讨论会跳到它的位置,若所选提交中没有该讨论,会先切换到全部提交。视图宽度不小于 1,040px 时列表停靠在文件旁;更窄时浮在文件之上,并在跳到讨论前先关闭;窄于 480px 时占满文件区的宽度。读取被截断时,列表会注明。讨论上提供“添加到输入框”(把整个讨论作为引用插入)、“在 GitHub 中查看”,以及当前登录用户可以执行的写操作。没有待提交评审时,回复框立即回复,其下拉菜单可以带着这条回复开始待提交评审;有待提交评审时,回复框把回复加入其中,因为 GitHub 会把用户的每条回复都加入待提交评审。“解决讨论”和“取消解决”切换讨论状态;用户自己评论的菜单可以编辑或删除该评论,删除前会先确认,删除讨论中唯一的评论会一并删除讨论,确认时会说明这一点。用户正在讨论中写回复或编辑评论时,即使讨论已被解决,也保持展开。代码托管平台拒绝写操作时保留输入的文字并说明原因;结果不明时会重新读取讨论,并请用户核对后再重试。每次写操作后都会重新读取讨论,因为解决讨论不会改变 GitHub pull request 的更新时间。视图显示期间,每收到一次状态就重新读取讨论;点击刷新后,即使面板还保留着之前的读取结果,也会从代码托管平台重新读取;读取失败时保留上次的讨论并提供重试,提供方不支持读取讨论时不显示讨论。 @@ -77,6 +79,8 @@ Session 在所创建的 worktree 中工作时,`localDiff` 以它的 `baseCommi `changeRequestViewed`、`setFileViewed`、`rerunChecks`、`requestReviews`、`reviewerCandidates` 与 `updateBranch` 只作用于 Session 可见且有提供方服务的绑定,否则以 `forgePanel/not-bound` 拒绝。`changeRequestViewed` 在所示 diff 的 head 提交上读取提供方的 `viewedFiles`,提供方不保存已审阅标记时返回 null;head 已移动时以 `forgePanel/stale-head` 拒绝,其他失败以 `forgePanel/viewed-failed` 拒绝。每个变更请求保留一次读取结果,以 head 提交为键,受与讨论相同的 `maxCachedReviewBytes` 和 `reviewRefreshMs` 限制;经 `ctx.forge` 在该 head 上保存的标记会替换所保留的对应文件状态,所以保存一个标记只需要提供方的那次写入,不再读取;读者刷新时传入 `fresh`,重新从托管平台读取。`setFileViewed` 经 `setViewed` 在该 head 上保存一个文件的标记,`rerunChecks` 与 `updateBranch` 传入卡片显示的 head 提交;head 已移动时它们都以 `forgePanel/stale-head` 拒绝,其他拒绝以 `forgePanel/action-failed` 并附托管平台的原因,托管平台未确认的结果以 `forgePanel/action-unknown` 拒绝。`requestReviews` 一次向一位或多位评审者请求评审,拒绝空列表与空登录名;`reviewerCandidates` 列出与搜索匹配的账号,托管平台未列出时以 `forgePanel/reviewers-failed` 拒绝。变更视图随变更请求的 diff 一起读取其已审阅标记,像拒绝在其他 head 上读取的 diff 一样拒绝这类标记,并由 [`src/client/host-viewed.ts`](src/client/host-viewed.ts) 按变更请求与 head 保存读者设置的每个标记:同一 head 重新读取时保留仍在写入的标记,写入已结束的标记保留到下次读取,另一个 head 的 diff 加载后才结束的写入不会改动它。 +`hostReadiness(forge, host)` 不指定 Session。它在 `readinessTimeoutMs` 内询问该 forge 家族的提供方能否用 Host 的凭据访问该主机;没有提供方服务该家族、探测失败或超时时,返回 `unavailable` 及原因;调用被取消时拒绝。提供方行的主机页面对每个已保存的主机读取一次。 + `changeRequestStates` 为会话列表推送调用方可读的、已列出的 Session 所绑定的每个变更请求的最近编号、标题、状态、草稿标记、检查汇总、评审结论与可合并性:先是一个 `baseline` 帧,之后是 `changed` 帧。所有流共用一次运行。初始化之前和帧之间均响应取消;最后一条流结束及插件卸载会等待初始化与已接受的写入完成,再关闭本次运行的存储域。后续运行会等待该域关闭后重新打开,并读取已存状态。列举期间收到的绑定更新优先于初始快照。它经 `sessionQuery` 列出 Session 而不加载它们,已加载 Session 的可见绑定取自 `ctx.forgeSession`,其他 Session 的取自缓存的 `forgeChangeRequests` 摘要;它跟随已加载 Session 的绑定变化,并经 `ctx.forge.watchBrief` 监听每个已绑定变更请求的简报,同时告知自己持有的状态:已合并的不再读取,本进程此前的运行读过的等到间隔到期,其他已存的立即读取。已关闭的按空闲间隔轮询,已合并的保留监听,以接收显式刷新和面板的快照读取结果。每个变化了的状态以其 URL 的 SHA-256 摘要为键存入 `forge_panel_change_requests` 存储域,仅在所有已列出 Session 的绑定均已知时删除无人绑定的已存状态;写入失败时记录日志,状态仍保留在内存中。宿主缺少 Session 查询、投影缓存、存储或 Session 存储服务时,流以失败结束。 `follow` 与 `reviewChangeRequest` 监听所显示的每个变更请求的快照,并要求 `ctx.forge` 提供不早于 `statusMaxAgeMs`(默认 10 秒)的状态。Session 的面板或评审页的流开始时,如果最近一次快照结果更旧,就立即读取状态;如果结果更新,或者还没有其他快照监听方读过,就跟随常规轮询。 @@ -165,7 +169,7 @@ Session 在所创建的 worktree 中工作时,`localDiff` 以它的 `baseCommi - **链接 worktree 项目**——项目本身是链接 worktree 时该选项不可用,除非沙箱策略授权了它的 Git 目录:在 workspace-write 下该目录位于可写根之外,新分支与之后的提交都无法写入。面板显示期间注册的授权在下一次检查时生效。Windows 的进程忽略这类授权,因此在 Windows 上该选项可用但创建会失败。在创建出的 worktree 内提交同样需要该授权,见 [worktree 服务](../worktree/README.zh.md#known-limitations-and-deferred-work)的说明。 - **变更范围**——待办:上一轮的范围。“分支”范围的“默认”需要一个默认分支与 HEAD 有共同历史的远端,或 Session 创建的 worktree;否则必须选择基准分支。 - **分支极多**——基准分支菜单在筛选前读取全部引用,这样搜索才能找到任意分支。引用超过 `maxDiffBytes`(默认约 165,000 个)或列出时间超过 `gitTimeoutMs` 时,菜单提示无法读取分支;“默认”仍可使用。 -- **大型变更**——本地补丁超过 `maxDiffBytes` 时不显示任何文件;超过托管平台或其提供方大小上限的变更请求 diff 不显示任何文件,只提供“在浏览器中查看”。不自动换行时,左右对比会在栏边截断长行。 +- **大型变更**——本地补丁超过 `maxDiffBytes` 时不显示任何文件;超过托管平台或其提供方大小上限的变更请求 diff 不显示任何文件,只提供“在代码托管平台中查看”。不自动换行时,左右对比会在栏边截断长行。 - **跨折叠行的高亮**——折叠的未变更行之后的行,要等文件被读取后才按它之前的内容着色:本地文件在绘制时读取,变更请求的文件要等它的某处折叠行展开后。在一段行之前超过 120 行处开始的代码块、注释或字符串,这段行仍按从段首开始着色。 - **尚未绘制的文件**——读者滚动到展开的文件附近之前,它按每个绘制行 22 px 占位,没有计入左右对比的配对、自动换行、未变更行按钮和评审卡片,所以文件绘制时滚动范围会略有变化;它已保存的评审评论也要等它绘制后才显示。 - **长 diff 中的页内查找**——展开的文件要等读者滚动到附近才绘制各行,所以浏览器的页内查找在更靠后的文件绘制之前匹配不到它们的行;要在整个 diff 中查找,需要视图自己的查找控件。 @@ -174,7 +178,8 @@ Session 在所创建的 worktree 中工作时,`localDiff` 以它的 `baseCommi - **扩展**——透镜只在被选中后运行,结果作用于发出请求时视图所显示的文件;读取整个变更请求的旧侧需要能给出合并基准的提供方。行注解不进入讨论列表、未解决数和讨论导航。 - **分层**——内置规则只覆盖常见约定,其他约定由仓库写在 `.gitattributes` 中;按路径无法识别 Rust 的内联 `#[cfg(test)]` 模块,也无法判断一种语言导出了哪些声明,“接口”层保留整个文件,找出变更的导出需要语言分析器,可由之后的透镜扩展点提供。`linguist-generated` 只读取根目录的 `.gitattributes`,不读子目录中的 `.gitattributes`,也不展开属性宏。 - **所选提交**——变更请求最多列出提供方的 `maxCommits` 个提交(GitHub 为最早的 250 个),“分支”范围则列出最新的 `maxCommits` 个;范围必须沿第一父提交相连,因此已合并分支的提交只能逐个查看,不能与本分支的提交一起查看;每次查看提交范围都从托管平台读取;所选提交上的评论只能添加到输入框,因为 GitHub 评审针对 head。 -- **代码评审页**——只有 GitHub 提供方能列出变更请求并读取描述,因此列表中只有 GitHub 主机,每个提供方配置的主机合并列出;通过粘贴链接打开的 GitLab 合并请求显示状态、变更与对话,描述处显示读取失败。在主机与账号之间选择要等到第二个能列出变更请求的提供方。“变更”标签不显示插件的透镜、行注释、工具栏、文件菜单和评论表单入口(这些扩展点以会话为对象),引用放进对话草稿而不是会话输入框。对话在工作区共享的空白会话中开始,“新会话”也显示这个会话,且不检查该工作区是否是此仓库的检出;待绑定的变更请求在首条消息前只保存在 Host 内存中,Host 重启会丢失。未提交的评审评论只在页面显示该变更请求期间保留。 +- **代码评审页**——列表合并列出每个能列出变更请求的提供方(目前是 GitHub 与 GitLab 提供方)的全部已配置主机,某个列表在一个主机上包含什么由该主机的提供方决定:GitLab 提供方的列表及其与 GitHub 的差别见[它的限制](../forge-gitlab/README.zh.md#known-limitations-and-deferred-work)。列表行不写主机,主机通过仓库子菜单和搜索框区分。左侧导航上的计数不随列表所限定的主机或仓库变化。同一主机的多个账号之间不提供选择。“变更”标签不显示插件的透镜、行注释、工具栏、文件菜单和评论表单入口(这些扩展点以会话为对象),引用放进对话草稿而不是会话输入框。对话在工作区共享的空白会话中开始,“新会话”也显示这个会话,且不检查该工作区是否是此仓库的检出;待绑定的变更请求在首条消息前只保存在 Host 内存中,Host 重启会丢失。未提交的评审评论只在页面显示该变更请求期间保留。 +- **评审页动态**——列表保留最新的条目,数量不超过提供方的上限,更早的条目给出到代码托管平台查看的链接。评论不能编辑、删除或用表情回应,`@` 名字没有补全,评论中需要用户托管平台会话的图片无法加载;评审在行或文件上留下的评论只能在“变更”标签页查看和回复。 ### 开发备注 diff --git a/packages/experimental/client-ui-forge/src/client/ChangeRequestCard.tsx b/packages/experimental/client-ui-forge/src/client/ChangeRequestCard.tsx index bf3f49b313..bc00837f7e 100644 --- a/packages/experimental/client-ui-forge/src/client/ChangeRequestCard.tsx +++ b/packages/experimental/client-ui-forge/src/client/ChangeRequestCard.tsx @@ -3,7 +3,8 @@ * the state glyph, the title, the number, and the checks outcome, which opens * the changes view, and, while expanded, one row per fact (checks, review, * merge state, the changed lines, which open its changes too, and the linked - * issues) above the merge action. Opening on the host, copying, viewing + * issues) above the merge action, which merges now, turns the host's automatic + * merge on, or shows that it is on. Opening on the host, copying, viewing * changes, marking a draft ready, and removing live in the card's actions * menu, which shows on hover or focus as on the panel's other rows. */ @@ -11,44 +12,49 @@ import { useId, useState, type MouseEvent, type ReactNode } from 'react' import clsx from 'clsx' import { - Button, HoverCard, IconCheckCircleOutlineRegular, IconChevronDownOutlineRegular, IconCloseOutlineRegular, IconCopyOutlineRegular, - IconEllipsisOutlineRegular, IconFilesDiffOutlineRegular, IconRightUpOutlineRegular, IconTriangleRightFillRegular, Menu, + Button, HoverCard, IconCheckCircleOutlineRegular, IconChevronDownOutlineRegular, IconClockOutlineRegular, IconCloseOutlineRegular, + IconCopyOutlineRegular, IconEllipsisOutlineRegular, IconFilesDiffOutlineRegular, IconTriangleRightFillRegular, Menu, MenuItemButton, StateDot, Tooltip, type MenuEntry, type MenuItem, type StateDotState, } from '@deepseek-ai/dsh-client-ui-primitives' import type { PanelDetailsProps } from '@deepseek-ai/dsh-client-ui-session-panel/client' import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots' import type { - ChangeRequestSnapshot, CheckState, ChecksRollup, ForgeFailure, MergeMethod, MergeRequest, + AutoMergeRequest, ChangeRequestAutoMerge, ChangeRequestSnapshot, CheckState, ChecksRollup, ForgeFailure, MergeMethod, MergeRequest, } from '@deepseek-ai/dsh-experimental-forge/types' import type { ForgePanelChangeRequest } from '../types.ts' import { ChecksRow, IssuesRow, MergeRow, ReviewRow, RowParts, ThreadGlyph, type OverviewActions } from './ChangeRequestOverview.tsx' +import { openOnLabel } from './forge-copy.ts' import { formatAgo } from './format.ts' -import { ChangeRequestGlyph, CheckGlyph } from './glyphs.tsx' +import { ChangeRequestGlyph, CheckGlyph, ForgeGlyph } from './glyphs.tsx' import type { ForgePanelKey, NS } from './locales.ts' import type { ForgeChangeRequestCardActionsProps } from './slots.ts' -import { ciSummary, flagOf, numberOf, TONE_LABEL, toneOf, type ChangeRequestEntry, type ChangeRequestTone } from './status.ts' +import { + ciSummary, flagOf, mergeBlockers, numberOf, TONE_LABEL, toneOf, type ChangeRequestEntry, type ChangeRequestTone, +} from './status.ts' import css from './Forge.module.css' type Translate = PropsLocale['t'] /** - * What a card can do; a surface without a Session binding omits `remove`, `markReady`, `merge`, `viewChanges`, and the - * overview actions. + * What a card can do; a surface without a Session binding omits `remove`, `markReady`, `merge`, `autoMerge`, + * `viewChanges`, and the overview actions. */ export interface ChangeRequestActions extends OverviewActions { /** Open a URL outside the app. */ readonly openLink: (url: string) => void /** Copy a URL to the clipboard. */ readonly copyLink: (url: string) => void - /** Read the status again after a failed read. */ - readonly retry: () => void + /** Read the status again; a surface that knows when the read ends returns a promise that settles then. */ + readonly retry: () => void | Promise /** Remove the change request from its Session. */ readonly remove?: ((entry: ChangeRequestEntry) => void) | undefined /** Mark a draft ready for review; settles once the outcome is reported. */ readonly markReady?: ((entry: ChangeRequestEntry) => Promise) | undefined /** Merge the change request as `request` describes; settles once the outcome is reported. */ readonly merge?: ((entry: ChangeRequestEntry, request: MergeRequest) => Promise) | undefined + /** Turn the code host's automatic merge on or off as `request` describes; settles once the outcome is reported. */ + readonly autoMerge?: ((entry: ChangeRequestEntry, request: AutoMergeRequest) => Promise) | undefined /** Load complete check details independently of polling; cancellation follows the open list. */ readonly readChecks?: ((url: string, headSha: string, signal: AbortSignal) => Promise) | undefined /** Open the changes view of the change request. */ @@ -226,12 +232,16 @@ function identity(number: number | null, snapshot: ChangeRequestSnapshot | null, return parts.length === 0 ? [] : [parts.join(' · ')] } -/** The merge button and its menu: a title row, one row per method with the chosen one checked, and the confirmation. */ -function MergeMenu({ snapshot, name, usual, busy, onMerge, t }: { +/** + * The merge button and its menu: a title row, one row per method with the chosen one checked, and the confirmation. + * With `auto` it is the button that turns the host's automatic merge on instead, which asks for the same two things. + */ +function MergeMenu({ snapshot, name, usual, busy, auto = false, onMerge, t }: { readonly snapshot: ChangeRequestSnapshot readonly name: string readonly usual: MergeMethod readonly busy: boolean + readonly auto?: boolean readonly onMerge: (method: MergeMethod, headSha: string) => void readonly t: Translate }): ReactNode { @@ -244,7 +254,7 @@ function MergeMenu({ snapshot, name, usual, busy, onMerge, t }: { const close = (): void => { setOpen(false) } const base = snapshot.baseBranch const items: MenuEntry[] = [ - { type: 'label', id: 'title', text: t('change.mergeTitle', { name, base }) }, + { type: 'label', id: 'title', text: t(auto ? 'change.autoMergeTitle' : 'change.mergeTitle', { name, base }) }, ...snapshot.mergeMethods.map(entry => ({ id: entry, label: ( @@ -264,8 +274,8 @@ function MergeMenu({ snapshot, name, usual, busy, onMerge, t }: { anchor={( )} @@ -290,28 +301,90 @@ function MergeMenu({ snapshot, name, usual, busy, onMerge, t }: { onMerge(method, confirmedHead) }} > - {t(stale ? 'change.mergeChanged' : 'change.mergeConfirm')} + {t(stale ? 'change.mergeChanged' : auto ? 'change.autoMergeConfirm' : 'change.mergeConfirm')} ) } /** - * Render the merge action of an open change request the host would merge now. + * The button of a change request whose automatic merge is on, and its menu: where it merges, how and by whom when the + * host names them, and the cancellation when the signed-in user may cancel. + */ +function AutoMergeStatus({ snapshot, autoMerge, busy, onCancel, t }: { + readonly snapshot: ChangeRequestSnapshot + readonly autoMerge: ChangeRequestAutoMerge + readonly busy: boolean + readonly onCancel: (() => void) | undefined + readonly t: Translate +}): ReactNode { + const [open, setOpen] = useState(false) + const facts = [ + ...autoMerge.method === null ? [] : [t('change.autoMergeMethod', { method: t(`change.mergeMethod.${autoMerge.method}`) })], + ...autoMerge.enabledBy === null ? [] : [t('change.autoMergeBy', { login: autoMerge.enabledBy })], + ] + const items: MenuEntry[] = [ + { type: 'label', id: 'title', text: t('change.autoMergeOnTitle', { base: snapshot.baseBranch }) }, + ...facts.length === 0 ? [] : [{ type: 'label' as const, id: 'facts', text: facts.join(' · ') }], + ] + const close = (): void => { setOpen(false) } + return ( + { setOpen(!open) }}> + + {t('change.autoMergeOn')} + + + )} + items={items} + onSelect={close} + > + {onCancel !== undefined && ( + { close(); onCancel() }}>{t('change.autoMergeCancel')} + )} + + ) +} + +/** The merge button of a change request its host would not merge now: it names why on hover and focus, and does nothing. */ +function BlockedMerge({ snapshot, t }: { readonly snapshot: ChangeRequestSnapshot; readonly t: Translate }): ReactNode { + const reason = mergeBlockers(snapshot).map(key => t(key)).join(t('issues.separator')) + return ( + + + + ) +} + +/** + * Render the merge action of an open change request that is not a draft: the merge when the host would merge now; the + * state of its automatic merge with the cancellation when that is on; the button that turns the automatic merge on + * when the signed-in user can; and, with `blocked`, a merge button that names why the host would not merge. * @param props.entry - the change request. * @param props.snapshot - its latest snapshot. * @param props.name - how menus name it. * @param props.actions - the actions the surface offers. * @param props.className - class of the wrapper, the card footer's by default. + * @param props.blocked - whether a change request with none of the other actions shows the merge it cannot run. * @param props.t - forge panel copy. - * @returns the action, or null when the host would not merge now or the surface does not offer it. + * @returns the action, or null for a change request with none. */ -export function ChangeRequestPrimary({ entry, snapshot, name, actions, className = css.footer, t }: { +export function ChangeRequestPrimary({ entry, snapshot, name, actions, className = css.footer, blocked = false, t }: { readonly entry: ChangeRequestEntry readonly snapshot: ChangeRequestSnapshot readonly name: string readonly actions: ChangeRequestActions readonly className?: string | undefined + readonly blocked?: boolean | undefined readonly t: Translate }): ReactNode { // One request at a time: the action stays disabled until the previous one settles. @@ -320,22 +393,30 @@ export function ChangeRequestPrimary({ entry, snapshot, name, actions, className setBusy(true) void action().finally(() => { setBusy(false) }) } - const { merge } = actions + const { merge, autoMerge: setAutoMerge } = actions if (snapshot.state !== 'open' || snapshot.draft) return null const [usual] = snapshot.mergeMethods - if (!snapshot.mergeReady || usual === undefined || merge === undefined) return null - return ( -
- { run(() => merge(entry, { method, headSha })) }} - t={t} - /> -
- ) + const auto = snapshot.autoMerge + let action: ReactNode + if (snapshot.mergeReady && usual !== undefined && merge !== undefined) { + action = ( + { run(() => merge(entry, { method, headSha })) }} /> + ) + } else if (auto?.enabled === true) { + const cancel = auto.canDisable && setAutoMerge !== undefined ? () => { run(() => setAutoMerge(entry, { enabled: false })) } : undefined + action = + } else if (auto?.canEnable === true && usual !== undefined && setAutoMerge !== undefined) { + action = ( + { run(() => setAutoMerge(entry, { enabled: true, method, headSha })) }} /> + ) + } else if (blocked) { + action = + } else { + return null + } + return
{action}
} /** @@ -366,7 +447,10 @@ function CardMenu({ entry, snapshot, name, url, actions, t }: { item: { id: 'changes', label: t('change.viewChanges'), icon: }, run: () => { viewChanges(entry) }, }] : [], - { item: { id: 'open', label: t('change.view'), icon: }, run: () => { actions.openLink(url) } }, + { + item: { id: 'open', label: openOnLabel(t, entry.forge?.label ?? null), icon: }, + run: () => { actions.openLink(url) }, + }, { item: { id: 'copy', label: t('change.copy'), icon: }, run: () => { actions.copyLink(url) } }, ...ready === undefined ? [] : [{ item: { id: 'ready', label: t('change.markReady'), icon: , disabled: busy }, @@ -571,8 +655,12 @@ export function ChangeRequestCard({ entry, expanded, onToggle, now, actions, loc
{t(notice)} {entry.ref === null - ? - : } + ? ( + + ) + : }
)} {expanded && snapshot !== null && ( diff --git a/packages/experimental/client-ui-forge/src/client/ChangeRequestsSection.tsx b/packages/experimental/client-ui-forge/src/client/ChangeRequestsSection.tsx index 583be68686..989312e44f 100644 --- a/packages/experimental/client-ui-forge/src/client/ChangeRequestsSection.tsx +++ b/packages/experimental/client-ui-forge/src/client/ChangeRequestsSection.tsx @@ -37,6 +37,8 @@ export interface ChangeRequestsSectionInjected { readonly markReady: (entry: ChangeRequestEntry) => Promise /** Merge a change request as `request` describes; settles once the outcome is reported. */ readonly merge: (entry: ChangeRequestEntry, request: MergeRequest) => Promise + /** Turn a change request's automatic merge on or off; settles once the outcome is reported. */ + readonly autoMerge: NonNullable /** Read the complete checks of an opened change request. */ readonly readChecks: NonNullable /** Rerun the failed checks or one check; settles once the outcome is reported. */ @@ -158,7 +160,7 @@ function SignInRow({ need, copyText, t }: { * @returns the cards, or null with neither bound change requests nor a sign-in to complete. */ export function ChangeRequestsSection({ - usePanel, useLocale, dismissOverlay, refresh, remove, markReady, merge, readChecks, + usePanel, useLocale, dismissOverlay, refresh, remove, markReady, merge, autoMerge, readChecks, rerunChecks, requestReviews, reviewerCandidates, updateBranch, openLink, copyText, viewChanges, useStore, actions: store, renderSlot, renderFactorySlot, t, }: ChangeRequestsSectionProps): ReactNode { @@ -174,7 +176,7 @@ export function ChangeRequestsSection({ const signIn = signInNeedOf(state) if (signIn === null && state.changeRequests.length === 0) return null const actions: ChangeRequestActions = { - openLink, copyLink: copyText, retry: () => { void refresh() }, remove, markReady, merge, readChecks, + openLink, copyLink: copyText, retry: () => { void refresh() }, remove, markReady, merge, autoMerge, readChecks, rerunChecks, requestReviews, reviewerCandidates, updateBranch, viewChanges: (entry) => { viewChanges(entry) diff --git a/packages/experimental/client-ui-forge/src/client/ChangesTab.tsx b/packages/experimental/client-ui-forge/src/client/ChangesTab.tsx index b40b249669..b24f51c27b 100644 --- a/packages/experimental/client-ui-forge/src/client/ChangesTab.tsx +++ b/packages/experimental/client-ui-forge/src/client/ChangesTab.tsx @@ -17,7 +17,7 @@ import { import clsx from 'clsx' import { Button, IconBranchOutlineRegular, IconChevronDownOutlineRegular, IconChevronsUpDownOutlineRegular, IconCompareSplitOutlineRegular, - IconInfoOutlineRegular, IconFilesDiffOutlineRegular, IconNowrapFillRegular, IconRightUpOutlineRegular, IconWorkspaceTreeOutlineRegular, + IconInfoOutlineRegular, IconFilesDiffOutlineRegular, IconNowrapFillRegular, IconWorkspaceTreeOutlineRegular, IconWrapFillRegular, Menu, Tooltip, type MenuEntry, @@ -55,7 +55,7 @@ import { changedFileTree, filesInTreeOrder } from './file-tree.ts' import { ChangedFilesMenu, type ChangedFilesProps, type ChangedFilesState } from './ChangedFiles.tsx' import { ChangesLoading } from './ChangesLoading.tsx' import { drawnLines, matchesHunks, revealGap, textLines, type GapExpansion, type GapReveal } from './diff-rows.ts' -import { ChangeRequestGlyph } from './glyphs.tsx' +import { ChangeRequestGlyph, ForgeGlyph } from './glyphs.tsx' import type { ForgePanelKey, NS } from './locales.ts' import { useForgeCopy } from './forge-copy.ts' import { RefreshGlyph } from './RefreshGlyph.tsx' @@ -428,9 +428,9 @@ function ChangeHeader({ url, entry, openLink, commitMenu, reviewCount, reviewDis {t('review.submit')}{reviewCount > 0 ? ` (${reviewCount})` : ''} - - @@ -1070,11 +1070,13 @@ export function ChangesView({ // Thread groups keep their identity across renders that change neither the threads nor what their cards share, so // only the sections whose threads changed redraw. const url = data?.kind === 'change' ? data.url : null + const family = entry?.forge?.forge ?? null const threadActions = useMemo((): ThreadActions | null => review === null || url === null ? null : { author: prAuthor, addToInput: (thread, range) => addThreadToInput(thread, url, range), quoteCopy, openLink, + forge: family, readText: (commit, path) => changeRequestText(url, commit, path), inputFailed: () => { live.current.report(quoteCopy?.failed ?? 'thread.inputFailed') }, focused: focus, @@ -1083,7 +1085,7 @@ export function ChangesView({ reviewStarted: review.pendingReview !== null, canReview: review.viewerCanReview, }, - }, [review, url, prAuthor, addThreadToInput, quoteCopy, openLink, changeRequestText, focus]) + }, [review, url, prAuthor, addThreadToInput, quoteCopy, openLink, family, changeRequestText, focus]) const fileThreads = useMemo(() => new Map(threadActions === null ? [] : [...placed.files].map(([path, group]) => [path, { ...group, actions: threadActions }])), [placed.files, threadActions]) /** Show a file's next unresolved thread in display order after the one last shown, or its first. */ @@ -1511,7 +1513,7 @@ export function ChangesView({ if (covering) setThreadList(value => ({ ...value, open: false })) openThread(entry, covering) }} - openLink={openLink} close={closeThreadList} t={t} /> + openLink={openLink} forge={family} close={closeThreadList} t={t} /> )} diff --git a/packages/experimental/client-ui-forge/src/client/Forge.module.css b/packages/experimental/client-ui-forge/src/client/Forge.module.css index 6e2d849597..a8fe133785 100644 --- a/packages/experimental/client-ui-forge/src/client/Forge.module.css +++ b/packages/experimental/client-ui-forge/src/client/Forge.module.css @@ -343,6 +343,29 @@ } } +/* The automatic merge button: outlined and as tall as the merge button; its glyph takes the accent once it is on. */ +.primaryAction.autoMergeAction { + gap: 6px; + padding: 0 10px 0 12px; +} + +.autoMergeAction[data-forge-auto-merge='on'] > svg:first-child { + color: var(--dsw-alias-state-business-primary); +} + +/* A merge the host would refuse now: the button stays reachable so it can say why, and looks and acts disabled. */ +.primaryAction.mergeAction.unavailable { + background: color-mix(in srgb, var(--dsw-alias-button-info-fill) 92%, var(--dsw-alias-label-primary)); + opacity: 0.4; + cursor: not-allowed; +} + +@media (hover: hover) { + .primaryAction.mergeAction.unavailable:hover:not(:disabled) { + background: color-mix(in srgb, var(--dsw-alias-button-info-fill) 92%, var(--dsw-alias-label-primary)); + } +} + /* A solid caret that points down, and up while the menu is open. */ .mergeCaret { flex: none; diff --git a/packages/experimental/client-ui-forge/src/client/HostSettings.module.css b/packages/experimental/client-ui-forge/src/client/HostSettings.module.css new file mode 100644 index 0000000000..57767453fd --- /dev/null +++ b/packages/experimental/client-ui-forge/src/client/HostSettings.module.css @@ -0,0 +1,194 @@ +/* A provider row page: the host list under the Plugins form's tokens. */ +.field { + display: flex; + flex-direction: column; + gap: 6px; + padding: 12px 0; +} + +/* The recheck button stands in the column of the rows' removal buttons. */ +.head { + display: flex; + align-items: center; + gap: 8px; + padding-right: 8px; +} + +.label { + flex: 1; + min-width: 0; + font-size: 13px; + font-weight: 500; + line-height: 1.5; + color: var(--dsw-alias-label-primary); +} + +.iconButton { + display: inline-flex; + align-items: center; + justify-content: center; + flex: none; + width: 24px; + height: 24px; + padding: 0; + border: 0; + border-radius: var(--dsw-radius-sm); + background: none; + color: var(--dsw-alias-label-tertiary); + cursor: pointer; +} + +.iconButton:disabled, +.iconButton[aria-disabled='true'] { + opacity: 0.4; + cursor: default; +} + +@media (hover: hover) { + .iconButton:hover:not(:disabled, [aria-disabled='true']) { + background: var(--dsw-alias-interactive-bg-hover); + color: var(--dsw-alias-label-secondary); + } +} + +.iconButton:focus-visible { + outline: var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); + outline-offset: 1px; +} + +/* The list is a group of read values, so it has the fields' edge without their fill. */ +.hosts { + margin: 0; + padding: 0; + border: 0.5px solid var(--dsw-alias-border-l4); + border-radius: var(--dsw-radius-md); + list-style: none; +} + +.host { + padding: 8px 8px 8px 12px; +} + +.host + .host { + border-top: 0.5px solid var(--dsw-alias-border-l2); +} + +.row { + display: flex; + align-items: center; + gap: 10px; + min-height: 24px; +} + +/* A host name wraps instead of being cut, so a long one stays readable where no pointer can hover it. */ +.name { + flex: 1; + min-width: 0; + overflow-wrap: anywhere; + font-size: 13px; + line-height: 18px; + color: var(--dsw-alias-label-primary); +} + +.state, +.unsaved { + display: inline-flex; + flex: none; + align-items: center; + gap: 6px; + font-size: 12.5px; + line-height: 18px; + color: var(--dsw-alias-label-secondary); + white-space: nowrap; +} + +.unsaved { + color: var(--dsw-alias-label-tertiary); +} + +/* The command and the reason end where the state text ends, short of the removal button's column. */ +.command { + display: flex; + align-items: flex-start; + gap: 8px; + margin: 6px 34px 2px 0; + padding: 4px 4px 4px 10px; + border-radius: var(--dsw-radius-sm); + background: var(--dsw-alias-bg-module-platform); +} + +.commandText { + flex: 1; + min-width: 0; + padding: 5px 0; + font-family: var(--ds-font-family-code); + font-size: 12px; + line-height: 18px; + color: var(--dsw-alias-label-primary); + overflow-wrap: anywhere; +} + +.reason { + margin: 4px 34px 2px 0; + font-size: 12px; + line-height: 18px; + color: var(--dsw-alias-label-tertiary); + overflow-wrap: anywhere; +} + +.addRow { + display: flex; + gap: 8px; + margin-top: 2px; +} + +.input { + flex: 1; + min-width: 0; + height: 34px; + padding: 0 12px; + border: 0.5px solid var(--dsw-alias-border-l4); + border-radius: var(--dsw-radius-md); + background: var(--dsw-alias-bg-layer-3); + font: inherit; + font-size: 13px; + line-height: 1.5; + color: var(--dsw-alias-label-primary); +} + +.input::placeholder { + color: var(--dsw-alias-label-tertiary); +} + +.input:focus-visible { + outline: none; + border-color: var(--dsw-alias-state-business-primary); +} + +.input:disabled { + color: var(--dsw-alias-label-tertiary); + cursor: default; +} + +.input[aria-invalid='true'] { + border-color: var(--dsw-alias-state-error-primary); +} + +.add { + flex: none; + height: 34px; + padding: 0 14px; + font-size: 13px; +} + +.hint, +.invalid { + margin: 0; + font-size: 12px; + line-height: 1.5; + color: var(--dsw-alias-label-tertiary); +} + +.invalid { + color: var(--dsw-alias-state-error-primary); +} diff --git a/packages/experimental/client-ui-forge/src/client/HostSettings.tsx b/packages/experimental/client-ui-forge/src/client/HostSettings.tsx new file mode 100644 index 0000000000..4c42e431e3 --- /dev/null +++ b/packages/experimental/client-ui-forge/src/client/HostSettings.tsx @@ -0,0 +1,192 @@ +/** A provider row's page on the Plugins page: the hosts the provider serves, each with its sign-in state. */ +import { useEffect, useId, useRef, useState, type ReactNode } from 'react' +import { + Button, IconRefreshOutlineRegular, IconTrashOutlineRegular, SettingsForm, StateDot, Tooltip, type StateDotState, +} from '@deepseek-ai/dsh-client-ui-primitives' +import type { SnapshotStore } from '@deepseek-ai/dsh-client-store' +import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots' +import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' +import { assertNever } from '@deepseek-ai/dsh-util-values' +import type { ForgePanelKey, NS } from './locales.ts' +import type { HostFormActions, HostFormState, HostProblem } from './host-settings-form.ts' +import type { HostSignIn } from './host-sign-in.ts' +import { rowFormLabels } from './row-form-labels.ts' +import css from './HostSettings.module.css' + +/** The forge family of a provider row that has a host page. */ +export type HostForge = 'github' | 'gitlab' + +/** Registration-side face of a provider row's host page. */ +export interface HostSettingsInjected extends HostFormActions { + readonly hooks: { + /** The saved and staged host lists. */ + readonly hostForm: SnapshotStore + /** Sign-in state by saved host. */ + readonly signIn: SnapshotStore> + } + /** Which provider the row mounts. */ + readonly forge: HostForge + /** Read the sign-in state of the saved hosts; `visibly` shows each host as being checked until its read answers. */ + readonly checkSignIn: (hosts: readonly string[], visibly: boolean) => void + /** Copy a sign-in command and report the outcome. */ + readonly copyCommand: (command: string) => void +} + +export type HostSettingsProps = PropsRuntime<'plugins.row.config'> & PropsLocale & InjectFace + +type Translate = HostSettingsProps['t'] + +/** What differs between the two rows' pages. */ +interface ForgeCopy { + /** Key of what the provider's hosts call a change request. */ + readonly noun: ForgePanelKey + /** The CLI the provider signs in with. */ + readonly cli: string + /** A host name the field shows as its placeholder and a refusal names as an example. */ + readonly example: string + /** Key of the refusal of a host the other provider serves. */ + readonly taken: ForgePanelKey +} + +const FORGES: Record = { + github: { noun: 'noun.pullRequest', cli: 'gh', example: 'github.example.com', taken: 'hosts.taken.gitlab' }, + gitlab: { noun: 'noun.mergeRequest', cli: 'glab', example: 'gitlab.example.com', taken: 'hosts.taken.github' }, +} + +const STATES: Record = { + ready: { dot: 'done', key: 'hosts.state.ready' }, + unauthenticated: { dot: 'warning', key: 'hosts.state.unauthenticated' }, + unavailable: { dot: 'error', key: 'hosts.state.unavailable' }, + checking: { dot: 'ongoing', key: 'hosts.state.checking' }, +} + +const CHECKING: HostSignIn = { state: 'checking' } + +function problemText(problem: HostProblem, forge: HostForge, t: Translate): string { + switch (problem.kind) { + case 'invalid': return t('hosts.invalid', { example: FORGES[forge].example }) + case 'duplicate': return t('hosts.duplicate', { host: problem.host }) + case 'taken': return t(FORGES[forge].taken, { host: problem.host }) + /* v8 ignore next -- closed union. */ + default: return assertNever(problem, 'HostProblem') + } +} + +/** + * One host of the list: its name, its sign-in state once saved, and its removal. A host that needs sign-in shows the + * provider's command to copy; a host that could not be checked shows why. + */ +function HostRow({ host, signIn, removable, disabled, onRemove, onCopy, t }: { + readonly host: string + /** The sign-in state of a saved host, or undefined for a host a save would add. */ + readonly signIn: HostSignIn | undefined + /** Whether another host would remain. */ + readonly removable: boolean + readonly disabled: boolean + readonly onRemove: (host: string) => void + readonly onCopy: (command: string) => void + readonly t: Translate +}): ReactNode { + const command = signIn?.state === 'unauthenticated' ? signIn.signIn?.command : undefined + const reason = signIn !== undefined && signIn.state !== 'checking' && signIn.state !== 'ready' && command === undefined ? signIn.message : null + return ( +
  • +
    + {host} + {signIn === undefined + ? {t('hosts.state.unsaved')} + : ( + + + {t(STATES[signIn.state].key)} + + )} + + + +
    + {command !== undefined && ( +
    + {command} + +
    + )} + {reason !== null && reason !== '' &&

    {reason}

    } +
  • + ) +} + +/** + * Render a provider row's configuration: the hosts it serves, staged until one save, and the sign-in state of each + * saved host, read when the page shows, after a save, and when the window regains focus. The summary view names the list. + * @param props - the Plugins page view, the staged list with its actions, the sign-in states, and copy. + * @returns the row page's form, or the summary line. + */ +export function HostSettings(props: HostSettingsProps): ReactNode { + const { t, forge, view } = props + const labelId = useId() + const messageId = useId() + const state = props.useHostForm(value => value) + const signIn = props.useSignIn(value => value) + const [text, setText] = useState('') + const [problem, setProblem] = useState() + // The effect reads the latest list and check through refs, so it runs again only when the saved hosts change. + const saved = useRef(state.saved) + saved.current = state.saved + const checkSignIn = useRef(props.checkSignIn) + checkSignIn.current = props.checkSignIn + const shown = view === 'page' && state.available + const savedKey = state.saved.join('\n') + useEffect(() => { + if (!shown) return + const again = (): void => { checkSignIn.current(saved.current, false) } + again() + window.addEventListener('focus', again) + return () => { window.removeEventListener('focus', again) } + }, [shown, savedKey]) + if (view === 'summary') return t('hosts.title') + const disabled = !state.writable || state.saving + const add = (): void => { + const refused = props.add(text) + setProblem(refused) + if (refused === undefined) setText('') + } + return ( + +
    +
    + {t('hosts.title')} + + + +
    +
      + {state.draft.map(host => ( + 1} disabled={disabled} onRemove={props.remove} onCopy={props.copyCommand} t={t} /> + ))} +
    +
    + { setText(event.target.value); setProblem(undefined) }} + onKeyDown={(event) => { + if (event.key !== 'Enter' || event.nativeEvent.isComposing) return + event.preventDefault() + add() + }} /> + +
    + {problem === undefined + ?

    {t('hosts.hint', { noun: t(FORGES[forge].noun), cli: FORGES[forge].cli })}

    + : } +
    +
    + ) +} diff --git a/packages/experimental/client-ui-forge/src/client/ReviewThreads.tsx b/packages/experimental/client-ui-forge/src/client/ReviewThreads.tsx index 3f2dc8169d..2d3edfe72f 100644 --- a/packages/experimental/client-ui-forge/src/client/ReviewThreads.tsx +++ b/packages/experimental/client-ui-forge/src/client/ReviewThreads.tsx @@ -8,13 +8,14 @@ import { useCallback, useEffect, useMemo, useRef, useState, type ReactNode } from 'react' import clsx from 'clsx' import { - Button, IconCheckOutlineRegular, IconChevronDownOutlineRegular, IconEllipsisOutlineRegular, IconRightUpOutlineRegular, MarkdownText, + Button, IconCheckOutlineRegular, IconChevronDownOutlineRegular, IconEllipsisOutlineRegular, MarkdownText, Menu, Tag, Tooltip, type MarkdownLabels, } from '@deepseek-ai/dsh-client-ui-primitives' import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots' import type { ForgeReviewComment, ForgeReviewThread, ForgeReviewWrite, ForgeThreadId } from '@deepseek-ai/dsh-experimental-forge/types' import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol' import { formatAgo } from './format.ts' +import { ForgeGlyph } from './glyphs.tsx' import { anchorRange, hunkExcerpt, type ThreadPlace } from './review-threads.ts' import { SplitAction } from './ReviewComposer.tsx' import { INPUT_QUOTE_COPY, settleQuote, type QuoteCopy } from './review.ts' @@ -50,6 +51,8 @@ export interface ThreadActions { readonly quoteCopy?: QuoteCopy | undefined /** Open a URL outside the app. */ readonly openLink: (url: string) => void + /** Forge family of the change request's provider, whose mark the opening action carries; null without a provider. */ + readonly forge: string | null /** Read a file of the change request's repository at a commit. */ readonly readText: (commit: string, path: string) => Promise> /** Report that the input refused a thread. */ @@ -393,7 +396,7 @@ export function ThreadCard({ thread, place, actions, t }: PropsLocale {t((actions.quoteCopy ?? INPUT_QUOTE_COPY).add)} {url !== null && } {writes !== null && thread.viewerCanResolve && } diff --git a/packages/experimental/client-ui-forge/src/client/ThreadList.tsx b/packages/experimental/client-ui-forge/src/client/ThreadList.tsx index 4ee9aa3da2..fd3873ef44 100644 --- a/packages/experimental/client-ui-forge/src/client/ThreadList.tsx +++ b/packages/experimental/client-ui-forge/src/client/ThreadList.tsx @@ -5,11 +5,12 @@ */ import { useLayoutEffect, useMemo, useRef, type KeyboardEvent, type ReactNode } from 'react' -import { IconChevronLeftOutlineRegular, IconCloseOutlineRegular, IconRightUpOutlineRegular, Tag, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives' +import { IconChevronLeftOutlineRegular, IconCloseOutlineRegular, Tag, Tooltip } from '@deepseek-ai/dsh-client-ui-primitives' import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots' import type { ForgeReviewThread } from '@deepseek-ai/dsh-experimental-forge/types' import type { ForgeDiffFile } from '../types.ts' import { FileLabel } from './FileLabel.tsx' +import { ForgeGlyph } from './glyphs.tsx' import { SegmentedChoice } from './ReviewControls.tsx' import { Avatar } from './ReviewThreads.tsx' import { anchorRange, inFileOrder, passesFilter, THREAD_FILTERS, type ThreadFilter, type ThreadPlace } from './review-threads.ts' @@ -41,6 +42,8 @@ export interface ThreadListProps extends PropsLocale { readonly open: (entry: PlacedThread, covering: boolean) => void /** Open a URL outside the app. */ readonly openLink: (url: string) => void + /** Forge family of the change request's provider, whose mark the opening action carries; null without a provider. */ + readonly forge: string | null /** Close the list at the reader's request. */ readonly close: () => void } @@ -157,7 +160,7 @@ export function ThreadList(props: ThreadListProps): ReactNode {
    {props.truncated && <>{t('thread.truncated', { count: threads.length })}{' · '}}
    diff --git a/packages/experimental/client-ui-forge/src/client/WorktreeSettings.tsx b/packages/experimental/client-ui-forge/src/client/WorktreeSettings.tsx index 2fbc6f97b2..68d3406c24 100644 --- a/packages/experimental/client-ui-forge/src/client/WorktreeSettings.tsx +++ b/packages/experimental/client-ui-forge/src/client/WorktreeSettings.tsx @@ -1,22 +1,15 @@ /** The worktree service's row page on the Plugins page: the archive cleanup switch. */ import { useId } from 'react' import { SettingsForm, Switch } from '@deepseek-ai/dsh-client-ui-primitives' -import type { SettingsFormLabels } from '@deepseek-ai/dsh-client-ui-primitives' import type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots' import type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client' import type { NS } from './locales.ts' +import { rowFormLabels } from './row-form-labels.ts' import type { WorktreeSettingsInjected } from './worktree-settings-form.ts' import css from './WorktreeSettings.module.css' export type WorktreeSettingsProps = PropsRuntime<'plugins.row.config'> & PropsLocale & InjectFace -function formLabels(t: WorktreeSettingsProps['t']): SettingsFormLabels { - return { - unavailable: t('settings.unavailable'), readOnly: t('settings.readOnly'), saveFailed: t('settings.saveFailed'), - save: t('settings.save'), saving: t('settings.saving'), - } -} - /** * Render the worktree row's configuration: one switch that keeps every * checkout when its Session is archived. The summary view names the switch. @@ -29,7 +22,7 @@ export function WorktreeSettings(props: WorktreeSettingsProps) { const state = props.useWorktreeForm(value => value) if (props.view === 'summary') return t('settings.retainOnArchive.title') const disabled = !state.writable || state.saving - return + return
    diff --git a/packages/experimental/client-ui-forge/src/client/forge-copy.ts b/packages/experimental/client-ui-forge/src/client/forge-copy.ts index ad9b1d957b..72860d1c8e 100644 --- a/packages/experimental/client-ui-forge/src/client/forge-copy.ts +++ b/packages/experimental/client-ui-forge/src/client/forge-copy.ts @@ -47,3 +47,13 @@ export function useForgeCopy(translate: TranslateNS, url: string | nu function hostOf(url: string): string { return /^[a-z][a-z\d+.-]*:\/\/([^/?#]+)/i.exec(url)?.[1] ?? url } + +/** + * Name the action that opens a change request on its code host. + * @param translate - forge panel copy. + * @param forge - product name of the code host, or null when no provider names one. + * @returns the label that names the code host, or the one that names the browser without a name. + */ +export function openOnLabel(translate: TranslateNS, forge: string | null): string { + return forge === null ? translate('change.view') : translate('change.viewOn', { forge }) +} diff --git a/packages/experimental/client-ui-forge/src/client/glyphs.tsx b/packages/experimental/client-ui-forge/src/client/glyphs.tsx index d86ef4f429..2bde0cc8b8 100644 --- a/packages/experimental/client-ui-forge/src/client/glyphs.tsx +++ b/packages/experimental/client-ui-forge/src/client/glyphs.tsx @@ -1,8 +1,8 @@ -/** Lifecycle glyphs of change requests and outcome glyphs of their checks. */ +/** Lifecycle glyphs of change requests, outcome glyphs of their checks, and the marks of their code hosts. */ import type { ReactNode } from 'react' import clsx from 'clsx' -import { IconCheckCircleFillRegular } from '@deepseek-ai/dsh-client-ui-primitives' +import { IconCheckCircleFillRegular, IconRightUpOutlineRegular, LinkIconRegular } from '@deepseek-ai/dsh-client-ui-primitives' import type { CheckState, ChecksRollup } from '@deepseek-ai/dsh-experimental-forge/types' import type { ChangeRequestTone } from './status.ts' import css from './Forge.module.css' @@ -148,3 +148,18 @@ export function CheckGlyph({ state, size = 16 }: { readonly state: CheckState; r ) } + +/** The public host whose site mark stands for each forge family, self-hosted instances included. */ +const FORGE_SITE: Readonly> = { github: 'https://github.com', gitlab: 'https://gitlab.com' } + +/** + * Draw the mark of a code host on an action that opens it: the site mark of the provider's forge family, whatever the + * host name, or the leaving arrow for a family without a mark and for no provider. + * @param props.forge - forge family of the change request's provider, such as `github`, or null without one. + * @param props.size - width and height in pixels, 14 by default. + * @returns the decorative glyph. + */ +export function ForgeGlyph({ forge, size = 14 }: { readonly forge: string | null; readonly size?: number | undefined }): ReactNode { + const site = forge === null ? undefined : FORGE_SITE[forge] + return site === undefined ? : +} diff --git a/packages/experimental/client-ui-forge/src/client/host-settings-form.ts b/packages/experimental/client-ui-forge/src/client/host-settings-form.ts new file mode 100644 index 0000000000..31dcb8966d --- /dev/null +++ b/packages/experimental/client-ui-forge/src/client/host-settings-form.ts @@ -0,0 +1,115 @@ +/** Staged host list of a provider row, using the shared Plugins form model. */ +import { SettingsFormModel, type SettingsFormScope, type SettingsFormShell } from '@deepseek-ai/dsh-client-ui-primitives' +import type { SnapshotStore } from '@deepseek-ai/dsh-client-store' + +/** The live-editable field of a forge provider's Config. */ +export interface HostSettings { + hosts: string[] +} + +/** The saved and staged host lists with the shared form status. */ +export interface HostFormState extends SettingsFormShell { + /** Hosts the provider serves, as its configuration lists them. */ + readonly saved: readonly string[] + /** Hosts a save would store: `saved` while nothing is staged. */ + readonly draft: readonly string[] +} + +/** Why a typed host was not staged. */ +export type HostProblem = + | { readonly kind: 'invalid' } + | { readonly kind: 'duplicate'; readonly host: string } + | { readonly kind: 'taken'; readonly host: string } + +/** What a provider row's host list offers its page. */ +export interface HostFormActions { + /** + * Stage one more host. The text is a host name with an optional port, or a URL, of which only the host is taken. + * @param text - what the reader typed. + * @returns undefined once staged or for blank text, else why the host was refused. + */ + readonly add: (text: string) => HostProblem | undefined + /** Stage the removal of a host; the last host stays. */ + readonly remove: (host: string) => void + /** Write the staged list, then read back what the Host accepted. */ + readonly save: () => void + /** Drop the staged list. */ + readonly discard: () => void +} + +/** + * A host name with an optional port. The providers' Config holds the same rule and decides what a save stores; this + * copy only answers before a save. + */ +const HOST = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*(:\d+)?$/i + +/** A URL with a scheme, of which a typed host keeps only the authority. */ +const URL_FORM = /^[a-z][a-z0-9+.-]*:\/\//i + +/** + * Read the host a reader typed: a URL gives its host and port, any other text is taken as written, in lowercase. + * @param text - what the reader typed. + * @returns the lowercase host, which may still be malformed. + */ +export function typedHost(text: string): string { + const trimmed = text.trim() + const host = URL_FORM.test(trimmed) && URL.canParse(trimmed) ? new URL(trimmed).host : trimmed + return host.toLowerCase() +} + +function listed(text: string): string[] { + return text.split('\n').filter(host => host !== '') +} + +/** Stages additions and removals of a provider's hosts until the reader saves them as one list. */ +export class HostSettingsForm { + private readonly form: SettingsFormModel + private readonly state: SnapshotStore + + /** + * @param scope - Host-backed configuration form of the provider row. + * @param taken - hosts the other providers serve now, which this row cannot add. + */ + constructor(private readonly scope: SettingsFormScope, private readonly taken: () => readonly string[]) { + this.form = new SettingsFormModel(scope, [{ + field: 'hosts', + format: value => (value as readonly string[] | undefined ?? []).join('\n'), + // `remove` keeps the last host, so every staged text lists at least one. + parse: text => ({ kind: 'set', value: listed(text) }), + }]) + this.state = this.form.bind(() => ({ + ...this.form.shell(), saved: this.scope.getSnapshot().value?.hosts ?? [], draft: listed(this.form.field('hosts').text), + })) + } + + /** + * Build the registration face for the row page. + * @returns the list observable with the add, remove, save, and discard actions. + */ + inject(): { hooks: { hostForm: SnapshotStore } } & HostFormActions { + const { edit, save, discard } = this.form.actions() + const stage = (hosts: readonly string[]): void => { edit('hosts', hosts.join('\n')) } + return { + hooks: { hostForm: this.state }, + add: (text) => { + const host = typedHost(text) + if (host === '') return undefined + if (!HOST.test(host)) return { kind: 'invalid' } + const { draft } = this.state.getSnapshot() + if (draft.some(other => other.toLowerCase() === host)) return { kind: 'duplicate', host } + if (this.taken().some(other => other.toLowerCase() === host)) return { kind: 'taken', host } + stage([...draft, host]) + return undefined + }, + remove: (host) => { + const { draft } = this.state.getSnapshot() + if (draft.length > 1) stage(draft.filter(other => other !== host)) + }, + save, + discard, + } + } + + /** Release the accepted-value subscription. */ + dispose(): void { this.form.dispose() } +} diff --git a/packages/experimental/client-ui-forge/src/client/host-sign-in.ts b/packages/experimental/client-ui-forge/src/client/host-sign-in.ts new file mode 100644 index 0000000000..52fe280c38 --- /dev/null +++ b/packages/experimental/client-ui-forge/src/client/host-sign-in.ts @@ -0,0 +1,46 @@ +/** Sign-in state of the hosts a provider row serves, read through `forgePanel.hostReadiness`. */ +import { createSnapshotStore, type SnapshotStore } from '@deepseek-ai/dsh-client-store' +import type { ForgeReadiness } from '@deepseek-ai/dsh-experimental-forge/types' +import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol' + +/** What the page knows of one host: its readiness once read, or that the first read is under way. */ +export type HostSignIn = ForgeReadiness | { readonly state: 'checking' } + +/** Reads one host's readiness; the signal ends the read. */ +export type HostReadinessRead = (host: string, signal: AbortSignal) => Promise> + +/** + * Keeps the last read sign-in state of each host of one provider. A check reads every named host at once and forgets + * the hosts it does not name; a later check ends the reads of an earlier one. + */ +export class HostSignInStates { + /** Sign-in state by host as the provider's configuration lists it. */ + readonly states: SnapshotStore> = createSnapshotStore>(new Map()) + private reads = new AbortController() + + /** @param read - one host's readiness read. */ + constructor(private readonly read: HostReadinessRead) {} + + /** + * Read the sign-in state of `hosts`. + * @param hosts - every host to keep a state for. + * @param visibly - show each host as being checked until its read answers; otherwise a host keeps the state it has. + */ + check(hosts: readonly string[], visibly: boolean): void { + this.reads.abort() + const reads = new AbortController() + this.reads = reads + const known = this.states.getSnapshot() + this.states.set(new Map(hosts.map(host => [host, visibly ? { state: 'checking' } : known.get(host) ?? { state: 'checking' }]))) + for (const host of hosts) { + void this.read(host, reads.signal).then((result) => { + if (reads.signal.aborted) return + const readiness: ForgeReadiness = result.ok ? result.value : { state: 'unavailable', message: result.error.message, signIn: null } + this.states.set(new Map(this.states.getSnapshot()).set(host, readiness)) + }) + } + } + + /** End the reads under way; their answers are dropped. */ + dispose(): void { this.reads.abort() } +} diff --git a/packages/experimental/client-ui-forge/src/client/locales.ts b/packages/experimental/client-ui-forge/src/client/locales.ts index cd5f252402..a4bad29150 100644 --- a/packages/experimental/client-ui-forge/src/client/locales.ts +++ b/packages/experimental/client-ui-forge/src/client/locales.ts @@ -12,6 +12,23 @@ export const zh = { 'settings.saveFailed': '此部署未接受这些值,已保留以便修改。', 'settings.save': '保存', 'settings.saving': '保存中…', + 'hosts.title': '主机', + 'hosts.hint': '这些主机上的 {noun} 链接和 Git 远端会被识别。添加主机后,在终端用 {cli} 登录。', + 'hosts.unavailable': '主机设置不可用。', + 'hosts.add': '添加', + 'hosts.addLabel': '要添加的主机', + 'hosts.remove': '移除 {host}', + 'hosts.keepOne': '至少保留一个主机', + 'hosts.recheck': '重新检查登录状态', + 'hosts.state.ready': '已登录', + 'hosts.state.unauthenticated': '未登录', + 'hosts.state.unavailable': '无法检查', + 'hosts.state.checking': '检查中…', + 'hosts.state.unsaved': '未保存', + 'hosts.invalid': '主机名格式不对,例如 {example}', + 'hosts.duplicate': '{host} 已在列表中', + 'hosts.taken.github': '{host} 已由 GitHub 组件使用', + 'hosts.taken.gitlab': '{host} 已由 GitLab 组件使用', 'toast.archiveCleanupScheduled': '已归档,工作树将被清理', 'toast.archiveCleanupFailed': '已归档,工作树清理失败。分支已保留,请检查工作树。', 'review.startReview': '开始评审', @@ -130,6 +147,7 @@ export const zh = { 'change.failure.rateLimited': '代码托管平台暂时限制了请求,稍后会自动重试', 'change.unserved': '暂不支持读取该平台的变更请求状态', 'change.view': '在浏览器中打开', + 'change.viewOn': '在 {forge} 中打开', 'change.copy': '复制变更请求链接', 'change.viewChanges': '查看变更', 'change.actions': '{name} 的操作', @@ -157,6 +175,20 @@ export const zh = { 'change.mergeNote.merge': '保留全部提交,并新增一个合并提交', 'change.mergeNote.rebase': '把提交逐个变基到 {base}', 'change.mergeConfirm': '确认合并', + 'change.autoMerge': '自动合并', + 'change.autoMergeTitle': '满足合并条件后,将 {name} 合并到 {base}', + 'change.autoMergeConfirm': '启用自动合并', + 'change.autoMergeOn': '已启用自动合并', + 'change.autoMergeOnTitle': '满足合并条件后自动合并到 {base}', + 'change.autoMergeMethod': '方式:{method}', + 'change.autoMergeBy': '由 {login} 启用', + 'change.autoMergeCancel': '取消自动合并', + 'change.blocked.conflict': '有合并冲突', + 'change.blocked.changesRequested': '评审者要求修改', + 'change.blocked.reviewRequired': '需要通过评审', + 'change.blocked.checksFailed': '检查未通过', + 'change.blocked.checksPending': '检查还在进行', + 'change.blocked.other': '代码托管平台现在不允许合并', 'change.mergeChanged': '提交已更新,请重新检查后再打开合并菜单', 'checks.allPassed': '{count} 项检查全部通过', 'checks.showQuiet': '显示其余 {count} 项(通过、跳过)', @@ -311,14 +343,14 @@ export const zh = { 'diff.error': '无法读取变更', 'diff.tooLarge': '变更太大,无法在这里显示', 'diff.filterConfigFailed': '无法完整读取 Git 过滤器配置,尚未执行比较。请检查 Git 配置和读取上限后重试', - 'diff.viewInBrowser': '在浏览器中查看', + 'diff.viewInBrowser': '在 {forge} 中查看', 'diff.noForkPoint': '找不到本分支的分叉点,请选择基准分支或其他范围', 'diff.empty': '没有变更', 'diff.omitted': '另有 {count} 个未跟踪的文件没有列出', 'diff.stale': '本地有 {count} 个提交尚未推送,这里显示的是变更请求上的变更', 'diff.moreActions': '{name} 的更多操作', 'diff.copyPath': '复制路径', - 'diff.openFileInBrowser': '在浏览器中查看文件', + 'diff.openFileInBrowser': '在 {forge} 中查看文件', 'diff.openFileInSidebar': '在侧边栏打开整个文件', 'time.now': '刚刚', 'time.minutes': '{n} 分钟前', @@ -423,7 +455,12 @@ export const zh = { 'toast.merged': '已合并 {name}', 'toast.mergeFailed': '合并失败:{message}', 'toast.mergeStale': '{name} 有新的提交,确认后再合并', + 'toast.autoMergeEnabled': '已为 {name} 启用自动合并', + 'toast.autoMergeCancelled': '已取消 {name} 的自动合并', + 'toast.autoMergeStale': '{name} 有新的提交,确认后再启用自动合并', + 'toast.autoMergeFailed': '自动合并没有更改:{message}', 'toast.pathCopied': '已复制路径', + 'toast.commandCopied': '已复制命令', 'toast.expandFailed': '无法显示未变更的行:{message}', 'toast.expandStale': '文件在读取变更后又有修改,刷新后再展开', 'toast.prompted': '已发送:{text}', @@ -497,6 +534,9 @@ export const zh = { 'reviewPage.search': '搜索,或粘贴变更请求链接', 'reviewPage.loading': '正在读取列表', 'reviewPage.refresh': '刷新状态', + 'reviewPage.copyLink': '复制链接', + 'reviewPage.copied': '已复制', + 'reviewPage.detailLoading': '正在读取变更请求', 'reviewPage.filter': '筛选', 'reviewPage.filter.repository': '仓库', 'reviewPage.filter.allRepositories': '全部仓库', @@ -508,18 +548,16 @@ export const zh = { 'reviewPage.empty.search': '没有匹配的变更请求', 'reviewPage.truncated': '还有 {count} 个未列出', 'reviewPage.noHosts': '没有能列出变更请求的代码托管平台', - 'reviewPage.noHostsHint': '启用 GitHub 组件后,这里会列出请你评审、你创建和与你有关的变更请求。', + 'reviewPage.noHostsHint': '启用 GitHub 或 GitLab 组件后,这里会列出请你评审、你创建和与你有关的变更请求。', 'reviewPage.signIn': '登录 {host} 后才能列出你的变更请求', 'reviewPage.listFailed': '读取 {host} 的列表失败:{message}', 'reviewPage.streamFailed': '列表连接已中断', 'reviewPage.openUrl': '打开 {url}', - 'reviewPage.hint.rerequested': '你请求过修改 · 已再次请求', + 'reviewPage.hint.rerequested': '待你复审', 'reviewPage.hint.team': '团队 {team}', 'reviewPage.hint.approvedByYou': '你已批准', 'reviewPage.hint.changesRequested': '要求修改', 'reviewPage.hint.approved': '已批准', - 'reviewPage.issuesMore': '等 {count} 个', - 'reviewPage.issuesMoreTruncated': '等 {count}+ 个', 'reviewPage.countAria': '{count} 个变更请求等你评审', 'reviewPage.select': '选择一个变更请求', 'reviewPage.selectHint': '从左侧列表选择,或在搜索框粘贴变更请求链接。', @@ -540,12 +578,42 @@ export const zh = { 'reviewPage.description': '描述', 'reviewPage.descriptionEmpty': '没有描述', 'reviewPage.descriptionFailed': '描述读取失败:{message}', + 'reviewPage.activity': '动态', + 'reviewPage.activity.empty': '还没有动态', + 'reviewPage.activity.failed': '动态读取失败:{message}', + 'reviewPage.activity.older': '更早的动态没有列出', + 'reviewPage.activity.commits': '{count} 次提交', + 'reviewPage.activity.inline': '{count} 条行内评论', + 'reviewPage.activity.viewInChanges': '在变更中查看', + 'reviewPage.activity.approved': '{actor} 批准了这些更改', + 'reviewPage.activity.changesRequested': '{actor} 要求修改', + 'reviewPage.activity.commented': '{actor} 评审了', + 'reviewPage.activity.dismissed': '{actor} 的评审被撤销', + 'reviewPage.activity.merged': '{actor} 合并了这个变更请求', + 'reviewPage.activity.closed': '{actor} 关闭了这个变更请求', + 'reviewPage.activity.reopened': '{actor} 重新打开了这个变更请求', + 'reviewPage.activity.readyForReview': '{actor} 标记为可以评审', + 'reviewPage.activity.convertedToDraft': '{actor} 转为草稿', + 'reviewPage.activity.forcePushed': '{actor} 强制推送了分支', + 'reviewPage.activity.autoMergeEnabled': '{actor} 启用了自动合并', + 'reviewPage.activity.autoMergeDisabled': '{actor} 取消了自动合并', + 'reviewPage.activity.reviewRequested': '{actor} 请求 {reviewer} 评审', + 'reviewPage.activity.reviewRequestedUnnamed': '{actor} 请求了评审', + 'reviewPage.activity.renamed': '{actor} 把标题由“{from}”改为“{to}”', + 'reviewPage.activity.commentPlaceholder': '留下评论', + 'reviewPage.activity.comment': '评论', + 'reviewPage.activity.commentHint': '将发布到 {forge} · 支持 Markdown', + 'reviewPage.activity.commentHintPlain': '支持 Markdown', + 'reviewPage.activity.commenting': '发布中…', + 'reviewPage.activity.commentFailed': '评论没有发布:{message}', 'reviewPage.status': '状态', 'reviewPage.requestReview': '请求评审', 'reviewPage.showAll': '显示全部 {count} 项', 'reviewPage.notFound': '变更请求不存在或没有访问权限', - 'reviewPage.unrecognized': 'DSH 不认识这个链接的主机', - 'reviewPage.unrecognizedHint': '只有已启用的代码托管组件所服务的主机能在这里打开。', + 'reviewPage.unrecognized': '未知的代码托管平台', + 'reviewPage.unrecognizedHint': '此链接的主机尚未添加到代码托管组件', + 'reviewPage.addHost': '添加主机…', + 'reviewPage.hostSettings': '前往配置', 'reviewPage.loadFailed': '变更请求读取失败', 'reviewPage.markdown.copy': '复制', 'reviewPage.markdown.copied': '已复制', @@ -596,6 +664,23 @@ export const en: Record = { 'settings.saveFailed': 'The deployment did not accept these values; they were left for you to correct.', 'settings.save': 'Save', 'settings.saving': 'Saving…', + 'hosts.title': 'Hosts', + 'hosts.hint': '{noun} links and Git remotes on these hosts are recognized. After adding a host, sign in to it with {cli} in a terminal.', + 'hosts.unavailable': 'Host settings are unavailable.', + 'hosts.add': 'Add', + 'hosts.addLabel': 'Host to add', + 'hosts.remove': 'Remove {host}', + 'hosts.keepOne': 'Keep at least one host', + 'hosts.recheck': 'Check sign-in again', + 'hosts.state.ready': 'Signed in', + 'hosts.state.unauthenticated': 'Not signed in', + 'hosts.state.unavailable': 'Can\'t check', + 'hosts.state.checking': 'Checking…', + 'hosts.state.unsaved': 'Not saved', + 'hosts.invalid': 'Enter a host name such as {example}', + 'hosts.duplicate': '{host} is already in the list', + 'hosts.taken.github': 'The GitHub component already uses {host}', + 'hosts.taken.gitlab': 'The GitLab component already uses {host}', 'toast.archiveCleanupScheduled': 'Archived; the worktree will be cleaned up', 'toast.archiveCleanupFailed': 'Archived; worktree cleanup failed. The branch is retained. Check the worktree.', 'review.startReview': 'Start review', @@ -714,6 +799,7 @@ export const en: Record = { 'change.failure.rateLimited': 'The code host is limiting requests; reading again shortly', 'change.unserved': 'Change request status is not supported for this code host yet', 'change.view': 'Open in browser', + 'change.viewOn': 'Open on {forge}', 'change.copy': 'Copy change request link', 'change.viewChanges': 'View changes', 'change.actions': 'Actions for {name}', @@ -741,6 +827,20 @@ export const en: Record = { 'change.mergeNote.merge': 'Keep every commit and add a merge commit', 'change.mergeNote.rebase': 'Replay each commit onto {base}', 'change.mergeConfirm': 'Confirm merge', + 'change.autoMerge': 'Auto-merge', + 'change.autoMergeTitle': 'Merge {name} into {base} once its requirements are met', + 'change.autoMergeConfirm': 'Enable auto-merge', + 'change.autoMergeOn': 'Auto-merge enabled', + 'change.autoMergeOnTitle': 'Merges into {base} once its requirements are met', + 'change.autoMergeMethod': 'Method: {method}', + 'change.autoMergeBy': 'Enabled by {login}', + 'change.autoMergeCancel': 'Cancel auto-merge', + 'change.blocked.conflict': 'Has merge conflicts', + 'change.blocked.changesRequested': 'Changes were requested', + 'change.blocked.reviewRequired': 'A review is required', + 'change.blocked.checksFailed': 'Checks failed', + 'change.blocked.checksPending': 'Checks are running', + 'change.blocked.other': 'The code host does not allow a merge now', 'change.mergeChanged': 'New commits arrived. Review them before reopening the merge menu.', 'checks.allPassed': 'All {count} checks passed', 'checks.showQuiet': 'Show {count} more (passed, skipped)', @@ -895,14 +995,14 @@ export const en: Record = { 'diff.error': 'The changes could not be read', 'diff.tooLarge': 'These changes are too large to show here', 'diff.filterConfigFailed': 'No comparison was run because Git filter settings could not be read completely. Check the Git settings and output limit, then retry.', - 'diff.viewInBrowser': 'View in browser', + 'diff.viewInBrowser': 'View on {forge}', 'diff.noForkPoint': 'No fork point was found for this branch; choose a base branch or another scope', 'diff.empty': 'No changes', 'diff.omitted': '{count} more untracked files are not listed', 'diff.stale': 'The local branch has {count} unpushed commits; these are the changes on the change request', 'diff.moreActions': 'More actions for {name}', 'diff.copyPath': 'Copy path', - 'diff.openFileInBrowser': 'View file in browser', + 'diff.openFileInBrowser': 'View file on {forge}', 'diff.openFileInSidebar': 'Open the whole file in the sidebar', 'time.now': 'just now', 'time.minutes': '{n} min ago', @@ -1007,7 +1107,12 @@ export const en: Record = { 'toast.merged': 'Merged {name}', 'toast.mergeFailed': 'Could not merge: {message}', 'toast.mergeStale': '{name} has new commits; review them before merging', + 'toast.autoMergeEnabled': 'Auto-merge enabled for {name}', + 'toast.autoMergeCancelled': 'Auto-merge cancelled for {name}', + 'toast.autoMergeStale': '{name} has new commits; review them before enabling auto-merge', + 'toast.autoMergeFailed': 'Auto-merge was not changed: {message}', 'toast.pathCopied': 'Path copied', + 'toast.commandCopied': 'Command copied', 'toast.expandFailed': 'Unchanged lines could not be shown: {message}', 'toast.expandStale': 'The file changed after its changes were read; refresh before expanding', 'toast.prompted': 'Sent: {text}', @@ -1081,6 +1186,9 @@ export const en: Record = { 'reviewPage.search': 'Search, or paste a change request link', 'reviewPage.loading': 'Reading the lists', 'reviewPage.refresh': 'Refresh status', + 'reviewPage.copyLink': 'Copy link', + 'reviewPage.copied': 'Copied', + 'reviewPage.detailLoading': 'Reading the change request', 'reviewPage.filter': 'Filter', 'reviewPage.filter.repository': 'Repository', 'reviewPage.filter.allRepositories': 'All repositories', @@ -1092,18 +1200,16 @@ export const en: Record = { 'reviewPage.empty.search': 'No matching change requests', 'reviewPage.truncated': '{count} more not listed', 'reviewPage.noHosts': 'No code host lists change requests', - 'reviewPage.noHostsHint': 'Enable the GitHub component to list the change requests that ask for your review, that you created, and that involve you.', + 'reviewPage.noHostsHint': 'Enable the GitHub or GitLab component to list the change requests that ask for your review, that you created, and that involve you.', 'reviewPage.signIn': 'Sign in to {host} to list your change requests', 'reviewPage.listFailed': 'Couldn\'t read the list on {host}: {message}', 'reviewPage.streamFailed': 'The list connection ended', 'reviewPage.openUrl': 'Open {url}', - 'reviewPage.hint.rerequested': 'You requested changes · Requested again', + 'reviewPage.hint.rerequested': 'Re-review requested', 'reviewPage.hint.team': 'Team {team}', 'reviewPage.hint.approvedByYou': 'You approved', 'reviewPage.hint.changesRequested': 'Changes requested', 'reviewPage.hint.approved': 'Approved', - 'reviewPage.issuesMore': 'and {count} more', - 'reviewPage.issuesMoreTruncated': 'and {count}+ more', 'reviewPage.countAria': '{count} change requests await your review', 'reviewPage.select': 'Select a change request', 'reviewPage.selectHint': 'Choose one from the list, or paste a change request link into the search box.', @@ -1124,12 +1230,42 @@ export const en: Record = { 'reviewPage.description': 'Description', 'reviewPage.descriptionEmpty': 'No description', 'reviewPage.descriptionFailed': 'Couldn\'t read the description: {message}', + 'reviewPage.activity': 'Activity', + 'reviewPage.activity.empty': 'No activity yet', + 'reviewPage.activity.failed': 'Couldn\'t read the activity: {message}', + 'reviewPage.activity.older': 'Earlier activity is not listed', + 'reviewPage.activity.commits': 'Commits: {count}', + 'reviewPage.activity.inline': 'Inline comments: {count}', + 'reviewPage.activity.viewInChanges': 'View in Changes', + 'reviewPage.activity.approved': '{actor} approved these changes', + 'reviewPage.activity.changesRequested': '{actor} requested changes', + 'reviewPage.activity.commented': '{actor} reviewed', + 'reviewPage.activity.dismissed': '{actor}\'s review was dismissed', + 'reviewPage.activity.merged': '{actor} merged this', + 'reviewPage.activity.closed': '{actor} closed this', + 'reviewPage.activity.reopened': '{actor} reopened this', + 'reviewPage.activity.readyForReview': '{actor} marked this ready for review', + 'reviewPage.activity.convertedToDraft': '{actor} converted this to a draft', + 'reviewPage.activity.forcePushed': '{actor} force-pushed the branch', + 'reviewPage.activity.autoMergeEnabled': '{actor} enabled auto-merge', + 'reviewPage.activity.autoMergeDisabled': '{actor} disabled auto-merge', + 'reviewPage.activity.reviewRequested': '{actor} requested a review from {reviewer}', + 'reviewPage.activity.reviewRequestedUnnamed': '{actor} requested a review', + 'reviewPage.activity.renamed': '{actor} changed the title from “{from}” to “{to}”', + 'reviewPage.activity.commentPlaceholder': 'Leave a comment', + 'reviewPage.activity.comment': 'Comment', + 'reviewPage.activity.commentHint': 'Posts to {forge} · Markdown supported', + 'reviewPage.activity.commentHintPlain': 'Markdown supported', + 'reviewPage.activity.commenting': 'Posting…', + 'reviewPage.activity.commentFailed': 'The comment was not posted: {message}', 'reviewPage.status': 'Status', 'reviewPage.requestReview': 'Request a review', 'reviewPage.showAll': 'Show all {count}', 'reviewPage.notFound': 'The change request does not exist or you cannot access it', - 'reviewPage.unrecognized': 'DSH does not recognize this link\'s host', - 'reviewPage.unrecognizedHint': 'Only hosts that an enabled code host component serves open here.', + 'reviewPage.unrecognized': 'Unknown code host', + 'reviewPage.unrecognizedHint': 'This link\'s host has not been added to a code host component.', + 'reviewPage.addHost': 'Add host…', + 'reviewPage.hostSettings': 'Open settings', 'reviewPage.loadFailed': 'Couldn\'t read the change request', 'reviewPage.markdown.copy': 'Copy', 'reviewPage.markdown.copied': 'Copied', @@ -1184,6 +1320,23 @@ export const ja: Record = { 'settings.saveFailed': 'このデプロイでは値が受け入れられませんでした。修正のために値はそのまま残されています。', 'settings.save': '保存', 'settings.saving': '保存中…', + 'hosts.title': 'ホスト', + 'hosts.hint': 'これらのホストの {noun} リンクと Git リモートを認識します。ホストを追加したら、ターミナルで {cli} を使ってログインしてください。', + 'hosts.unavailable': 'ホスト設定を利用できません。', + 'hosts.add': '追加', + 'hosts.addLabel': '追加するホスト', + 'hosts.remove': '{host} を削除', + 'hosts.keepOne': 'ホストを少なくとも 1 つ残してください', + 'hosts.recheck': 'ログイン状態を再確認', + 'hosts.state.ready': 'ログイン済み', + 'hosts.state.unauthenticated': '未ログイン', + 'hosts.state.unavailable': '確認できません', + 'hosts.state.checking': '確認中…', + 'hosts.state.unsaved': '未保存', + 'hosts.invalid': 'ホスト名の形式が正しくありません(例: {example})', + 'hosts.duplicate': '{host} はすでに一覧にあります', + 'hosts.taken.github': '{host} は GitHub コンポーネントが使用しています', + 'hosts.taken.gitlab': '{host} は GitLab コンポーネントが使用しています', 'toast.archiveCleanupScheduled': 'アーカイブしました。ワークツリーを削除します', 'toast.archiveCleanupFailed': 'アーカイブしましたが、ワークツリーの削除に失敗しました。ブランチは保持されています。ワークツリーを確認してください。', 'review.startReview': 'レビューを開始', @@ -1302,6 +1455,7 @@ export const ja: Record = { 'change.failure.rateLimited': 'コードホストがリクエストを制限しています。しばらくすると自動で再試行します', 'change.unserved': 'このコードホストの変更リクエストの状態はまだサポートされていません', 'change.view': 'ブラウザーで開く', + 'change.viewOn': '{forge} で開く', 'change.copy': '変更リクエストのリンクをコピー', 'change.viewChanges': '変更を表示', 'change.actions': '{name} の操作', @@ -1329,6 +1483,20 @@ export const ja: Record = { 'change.mergeNote.merge': 'すべてのコミットを保持し、マージコミットを追加', 'change.mergeNote.rebase': '各コミットを {base} 上にリベース', 'change.mergeConfirm': 'マージを確認', + 'change.autoMerge': '自動マージ', + 'change.autoMergeTitle': '条件を満たしたら {name} を {base} にマージ', + 'change.autoMergeConfirm': '自動マージを有効にする', + 'change.autoMergeOn': '自動マージ有効', + 'change.autoMergeOnTitle': '条件を満たすと {base} に自動でマージされます', + 'change.autoMergeMethod': '方法:{method}', + 'change.autoMergeBy': '{login} が有効化', + 'change.autoMergeCancel': '自動マージを取り消す', + 'change.blocked.conflict': 'マージの競合があります', + 'change.blocked.changesRequested': '修正が依頼されています', + 'change.blocked.reviewRequired': 'レビューが必要です', + 'change.blocked.checksFailed': 'チェックが失敗しています', + 'change.blocked.checksPending': 'チェックを実行中です', + 'change.blocked.other': 'コードホストは現在マージを許可していません', 'change.mergeChanged': '新しいコミットがあります。確認してからマージメニューを開き直してください', 'checks.allPassed': '{count} 件のチェックがすべて成功', 'checks.showQuiet': '残り {count} 件を表示(成功・スキップ)', @@ -1483,14 +1651,14 @@ export const ja: Record = { 'diff.error': '変更を読み取れませんでした', 'diff.tooLarge': '変更が大きすぎるため、ここには表示できません', 'diff.filterConfigFailed': 'Git フィルター設定を完全に読み取れないため、比較を実行していません。Git の設定と出力上限を確認して再試行してください。', - 'diff.viewInBrowser': 'ブラウザーで表示', + 'diff.viewInBrowser': '{forge} で表示', 'diff.noForkPoint': 'このブランチの分岐点が見つかりません。基準ブランチか別の範囲を選んでください', 'diff.empty': '変更なし', 'diff.omitted': 'ほかに {count} 個の未追跡ファイルがあります', 'diff.stale': 'ローカルブランチに未プッシュのコミットが {count} 件あります。ここには変更リクエストの変更を表示しています', 'diff.moreActions': '{name} のその他の操作', 'diff.copyPath': 'パスをコピー', - 'diff.openFileInBrowser': 'ブラウザーでファイルを表示', + 'diff.openFileInBrowser': '{forge} でファイルを表示', 'diff.openFileInSidebar': 'サイドバーでファイル全体を開く', 'time.now': 'たった今', 'time.minutes': '{n} 分前', @@ -1595,7 +1763,12 @@ export const ja: Record = { 'toast.merged': '{name} をマージしました', 'toast.mergeFailed': 'マージできませんでした:{message}', 'toast.mergeStale': '{name} に新しいコミットがあります。確認してからマージしてください', + 'toast.autoMergeEnabled': '{name} の自動マージを有効にしました', + 'toast.autoMergeCancelled': '{name} の自動マージを取り消しました', + 'toast.autoMergeStale': '{name} に新しいコミットがあります。確認してから自動マージを有効にしてください', + 'toast.autoMergeFailed': '自動マージを変更できませんでした:{message}', 'toast.pathCopied': 'パスをコピーしました', + 'toast.commandCopied': 'コマンドをコピーしました', 'toast.expandFailed': '未変更の行を表示できませんでした:{message}', 'toast.expandStale': '変更の読み取り後にファイルが更新されています。更新してから展開してください', 'toast.prompted': '送信しました:{text}', @@ -1669,6 +1842,9 @@ export const ja: Record = { 'reviewPage.search': '検索、または変更リクエストのリンクを貼り付け', 'reviewPage.loading': 'リストを読み込み中', 'reviewPage.refresh': '状態を更新', + 'reviewPage.copyLink': 'リンクをコピー', + 'reviewPage.copied': 'コピーしました', + 'reviewPage.detailLoading': '変更リクエストを読み込み中', 'reviewPage.filter': '絞り込み', 'reviewPage.filter.repository': 'リポジトリ', 'reviewPage.filter.allRepositories': 'すべてのリポジトリ', @@ -1680,18 +1856,16 @@ export const ja: Record = { 'reviewPage.empty.search': '一致する変更リクエストはありません', 'reviewPage.truncated': 'ほか {count} 件は未表示', 'reviewPage.noHosts': '変更リクエストを一覧できるコードホストがありません', - 'reviewPage.noHostsHint': 'GitHub コンポーネントを有効にすると、レビュー依頼、自分が作成したもの、自分に関係するものがここに一覧されます。', + 'reviewPage.noHostsHint': 'GitHub または GitLab コンポーネントを有効にすると、レビュー依頼、自分が作成したもの、自分に関係するものがここに一覧されます。', 'reviewPage.signIn': '{host} にサインインすると変更リクエストを一覧できます', 'reviewPage.listFailed': '{host} のリストを読み込めませんでした:{message}', 'reviewPage.streamFailed': 'リストの接続が切れました', 'reviewPage.openUrl': '{url} を開く', - 'reviewPage.hint.rerequested': '変更を要求済み · 再依頼あり', + 'reviewPage.hint.rerequested': '再レビュー依頼', 'reviewPage.hint.team': 'チーム {team}', 'reviewPage.hint.approvedByYou': '承認済み(自分)', 'reviewPage.hint.changesRequested': '変更が要求されています', 'reviewPage.hint.approved': '承認済み', - 'reviewPage.issuesMore': 'ほか {count} 件', - 'reviewPage.issuesMoreTruncated': 'ほか {count}+ 件', 'reviewPage.countAria': 'レビュー待ちの変更リクエスト {count} 件', 'reviewPage.select': '変更リクエストを選択', 'reviewPage.selectHint': 'リストから選ぶか、検索欄に変更リクエストのリンクを貼り付けてください。', @@ -1712,12 +1886,42 @@ export const ja: Record = { 'reviewPage.description': '説明', 'reviewPage.descriptionEmpty': '説明はありません', 'reviewPage.descriptionFailed': '説明を読み込めませんでした:{message}', + 'reviewPage.activity': 'アクティビティ', + 'reviewPage.activity.empty': 'まだアクティビティはありません', + 'reviewPage.activity.failed': 'アクティビティを読み込めませんでした:{message}', + 'reviewPage.activity.older': 'これより前のアクティビティは表示されていません', + 'reviewPage.activity.commits': 'コミット {count} 件', + 'reviewPage.activity.inline': '行コメント {count} 件', + 'reviewPage.activity.viewInChanges': '変更で表示', + 'reviewPage.activity.approved': '{actor} が変更を承認しました', + 'reviewPage.activity.changesRequested': '{actor} が修正を依頼しました', + 'reviewPage.activity.commented': '{actor} がレビューしました', + 'reviewPage.activity.dismissed': '{actor} のレビューは却下されました', + 'reviewPage.activity.merged': '{actor} がマージしました', + 'reviewPage.activity.closed': '{actor} がクローズしました', + 'reviewPage.activity.reopened': '{actor} が再オープンしました', + 'reviewPage.activity.readyForReview': '{actor} がレビュー可能にしました', + 'reviewPage.activity.convertedToDraft': '{actor} が下書きに戻しました', + 'reviewPage.activity.forcePushed': '{actor} がブランチを強制プッシュしました', + 'reviewPage.activity.autoMergeEnabled': '{actor} が自動マージを有効にしました', + 'reviewPage.activity.autoMergeDisabled': '{actor} が自動マージを無効にしました', + 'reviewPage.activity.reviewRequested': '{actor} が {reviewer} にレビューを依頼しました', + 'reviewPage.activity.reviewRequestedUnnamed': '{actor} がレビューを依頼しました', + 'reviewPage.activity.renamed': '{actor} がタイトルを「{from}」から「{to}」に変更しました', + 'reviewPage.activity.commentPlaceholder': 'コメントを書く', + 'reviewPage.activity.comment': 'コメント', + 'reviewPage.activity.commentHint': '{forge} に投稿されます · Markdown 対応', + 'reviewPage.activity.commentHintPlain': 'Markdown 対応', + 'reviewPage.activity.commenting': '投稿中…', + 'reviewPage.activity.commentFailed': 'コメントを投稿できませんでした:{message}', 'reviewPage.status': '状態', 'reviewPage.requestReview': 'レビューを依頼', 'reviewPage.showAll': '{count}件すべて表示', 'reviewPage.notFound': '変更リクエストが存在しないか、アクセス権がありません', - 'reviewPage.unrecognized': 'DSH はこのリンクのホストを認識できません', - 'reviewPage.unrecognizedHint': '有効なコードホストコンポーネントが扱うホストだけをここで開けます。', + 'reviewPage.unrecognized': '不明なコードホスト', + 'reviewPage.unrecognizedHint': 'このリンクのホストはコードホストコンポーネントに追加されていません。', + 'reviewPage.addHost': 'ホストを追加…', + 'reviewPage.hostSettings': '設定を開く', 'reviewPage.loadFailed': '変更リクエストを読み込めませんでした', 'reviewPage.markdown.copy': 'コピー', 'reviewPage.markdown.copied': 'コピーしました', @@ -1765,6 +1969,23 @@ export const es: Record = { 'settings.saveFailed': 'La implementación no aceptó estos valores; se dejaron para que los corrijas.', 'settings.save': 'Guardar', 'settings.saving': 'Guardando…', + 'hosts.title': 'Hosts', + 'hosts.hint': 'Se reconocen los enlaces de {noun} y los remotos de Git de estos hosts. Después de añadir un host, inicia sesión en él con {cli} en una terminal.', + 'hosts.unavailable': 'La configuración de hosts no está disponible.', + 'hosts.add': 'Añadir', + 'hosts.addLabel': 'Host que se va a añadir', + 'hosts.remove': 'Quitar {host}', + 'hosts.keepOne': 'Conserva al menos un host', + 'hosts.recheck': 'Comprobar de nuevo el inicio de sesión', + 'hosts.state.ready': 'Sesión iniciada', + 'hosts.state.unauthenticated': 'Sin iniciar sesión', + 'hosts.state.unavailable': 'No se puede comprobar', + 'hosts.state.checking': 'Comprobando…', + 'hosts.state.unsaved': 'Sin guardar', + 'hosts.invalid': 'Escribe un nombre de host, por ejemplo {example}', + 'hosts.duplicate': '{host} ya está en la lista', + 'hosts.taken.github': 'El componente de GitHub ya usa {host}', + 'hosts.taken.gitlab': 'El componente de GitLab ya usa {host}', 'toast.archiveCleanupScheduled': 'Archivado; se eliminará el árbol de trabajo', 'toast.archiveCleanupFailed': 'Archivado; no se pudo eliminar el árbol de trabajo. La rama se conserva. Revisa el árbol de trabajo.', 'review.startReview': 'Iniciar revisión', @@ -1883,6 +2104,7 @@ export const es: Record = { 'change.failure.rateLimited': 'El servidor de código está limitando las solicitudes; se reintentará en breve', 'change.unserved': 'Este servicio de código aún no permite consultar el estado de las solicitudes', 'change.view': 'Abrir en el navegador', + 'change.viewOn': 'Abrir en {forge}', 'change.copy': 'Copiar enlace de la solicitud', 'change.viewChanges': 'Ver cambios', 'change.actions': 'Acciones de {name}', @@ -1910,6 +2132,20 @@ export const es: Record = { 'change.mergeNote.merge': 'Conservar todos los commits y añadir uno de fusión', 'change.mergeNote.rebase': 'Aplicar cada commit sobre {base}', 'change.mergeConfirm': 'Confirmar fusión', + 'change.autoMerge': 'Fusión automática', + 'change.autoMergeTitle': 'Fusionar {name} en {base} cuando se cumplan los requisitos', + 'change.autoMergeConfirm': 'Activar la fusión automática', + 'change.autoMergeOn': 'Fusión automática activada', + 'change.autoMergeOnTitle': 'Se fusionará en {base} cuando se cumplan los requisitos', + 'change.autoMergeMethod': 'Método: {method}', + 'change.autoMergeBy': 'Activada por {login}', + 'change.autoMergeCancel': 'Cancelar la fusión automática', + 'change.blocked.conflict': 'Hay conflictos de fusión', + 'change.blocked.changesRequested': 'Se pidieron cambios', + 'change.blocked.reviewRequired': 'Se requiere una revisión', + 'change.blocked.checksFailed': 'Las comprobaciones fallaron', + 'change.blocked.checksPending': 'Las comprobaciones están en curso', + 'change.blocked.other': 'El host de código no permite fusionar ahora', 'change.mergeChanged': 'Hay nuevos commits. Revísalos antes de volver a abrir el menú de fusión', 'checks.allPassed': 'Las {count} comprobaciones se superaron', 'checks.showQuiet': 'Mostrar {count} más (superadas, omitidas)', @@ -2064,14 +2300,14 @@ export const es: Record = { 'diff.error': 'No se pudieron leer los cambios', 'diff.tooLarge': 'Estos cambios son demasiado grandes para mostrarlos aquí', 'diff.filterConfigFailed': 'No se pudo leer toda la configuración de filtros de Git. No se realizó la comparación. Comprueba la configuración de Git y el límite de salida, y vuelve a intentarlo.', - 'diff.viewInBrowser': 'Ver en el navegador', + 'diff.viewInBrowser': 'Ver en {forge}', 'diff.noForkPoint': 'No se encontró el punto de bifurcación de esta rama; elige una rama base u otro ámbito', 'diff.empty': 'Sin cambios', 'diff.omitted': 'No se muestran otros {count} archivos sin seguimiento', 'diff.stale': 'La rama local tiene {count} commits sin enviar; se muestran los cambios de la solicitud', 'diff.moreActions': 'Más acciones para {name}', 'diff.copyPath': 'Copiar ruta', - 'diff.openFileInBrowser': 'Ver archivo en el navegador', + 'diff.openFileInBrowser': 'Ver archivo en {forge}', 'diff.openFileInSidebar': 'Abrir el archivo completo en la barra lateral', 'time.now': 'ahora mismo', 'time.minutes': 'hace {n} min', @@ -2176,7 +2412,12 @@ export const es: Record = { 'toast.merged': 'Se fusionó {name}', 'toast.mergeFailed': 'No se pudo fusionar: {message}', 'toast.mergeStale': '{name} tiene nuevos commits; revísalos antes de fusionar', + 'toast.autoMergeEnabled': 'Fusión automática activada para {name}', + 'toast.autoMergeCancelled': 'Fusión automática cancelada para {name}', + 'toast.autoMergeStale': '{name} tiene nuevos commits; revísalos antes de activar la fusión automática', + 'toast.autoMergeFailed': 'No se cambió la fusión automática: {message}', 'toast.pathCopied': 'Ruta copiada', + 'toast.commandCopied': 'Comando copiado', 'toast.expandFailed': 'No se pudieron mostrar las líneas sin cambios: {message}', 'toast.expandStale': 'El archivo cambió después de leer sus cambios; actualiza antes de expandir', 'toast.prompted': 'Enviado: {text}', @@ -2250,6 +2491,9 @@ export const es: Record = { 'reviewPage.search': 'Busca o pega un enlace de solicitud de cambio', 'reviewPage.loading': 'Leyendo las listas', 'reviewPage.refresh': 'Actualizar estado', + 'reviewPage.copyLink': 'Copiar enlace', + 'reviewPage.copied': 'Copiado', + 'reviewPage.detailLoading': 'Leyendo la solicitud de cambio', 'reviewPage.filter': 'Filtrar', 'reviewPage.filter.repository': 'Repositorio', 'reviewPage.filter.allRepositories': 'Todos los repositorios', @@ -2261,18 +2505,16 @@ export const es: Record = { 'reviewPage.empty.search': 'Ninguna solicitud de cambio coincide', 'reviewPage.truncated': '{count} más sin listar', 'reviewPage.noHosts': 'Ningún servicio de código lista solicitudes de cambio', - 'reviewPage.noHostsHint': 'Activa el componente de GitHub para listar las solicitudes de cambio que piden tu revisión, las que creaste y las que te involucran.', + 'reviewPage.noHostsHint': 'Activa el componente de GitHub o de GitLab para listar las solicitudes de cambio que piden tu revisión, las que creaste y las que te involucran.', 'reviewPage.signIn': 'Inicia sesión en {host} para listar tus solicitudes de cambio', 'reviewPage.listFailed': 'No se pudo leer la lista de {host}: {message}', 'reviewPage.streamFailed': 'La conexión de la lista terminó', 'reviewPage.openUrl': 'Abrir {url}', - 'reviewPage.hint.rerequested': 'Pediste cambios · Se volvió a solicitar', + 'reviewPage.hint.rerequested': 'Nueva revisión solicitada', 'reviewPage.hint.team': 'Equipo {team}', 'reviewPage.hint.approvedByYou': 'Aprobaste', 'reviewPage.hint.changesRequested': 'Cambios solicitados', 'reviewPage.hint.approved': 'Aprobada', - 'reviewPage.issuesMore': 'y {count} más', - 'reviewPage.issuesMoreTruncated': 'y {count}+ más', 'reviewPage.countAria': '{count} solicitudes de cambio esperan tu revisión', 'reviewPage.select': 'Selecciona una solicitud de cambio', 'reviewPage.selectHint': 'Elige una de la lista o pega un enlace de solicitud de cambio en la búsqueda.', @@ -2293,12 +2535,42 @@ export const es: Record = { 'reviewPage.description': 'Descripción', 'reviewPage.descriptionEmpty': 'Sin descripción', 'reviewPage.descriptionFailed': 'No se pudo leer la descripción: {message}', + 'reviewPage.activity': 'Actividad', + 'reviewPage.activity.empty': 'Aún no hay actividad', + 'reviewPage.activity.failed': 'No se pudo leer la actividad: {message}', + 'reviewPage.activity.older': 'La actividad anterior no se muestra', + 'reviewPage.activity.commits': 'Commits: {count}', + 'reviewPage.activity.inline': 'Comentarios en línea: {count}', + 'reviewPage.activity.viewInChanges': 'Ver en Cambios', + 'reviewPage.activity.approved': '{actor} aprobó estos cambios', + 'reviewPage.activity.changesRequested': '{actor} pidió cambios', + 'reviewPage.activity.commented': '{actor} revisó', + 'reviewPage.activity.dismissed': 'La revisión de {actor} fue descartada', + 'reviewPage.activity.merged': '{actor} fusionó esta solicitud', + 'reviewPage.activity.closed': '{actor} cerró esta solicitud', + 'reviewPage.activity.reopened': '{actor} reabrió esta solicitud', + 'reviewPage.activity.readyForReview': '{actor} la marcó como lista para revisión', + 'reviewPage.activity.convertedToDraft': '{actor} la convirtió en borrador', + 'reviewPage.activity.forcePushed': '{actor} forzó el push de la rama', + 'reviewPage.activity.autoMergeEnabled': '{actor} activó la fusión automática', + 'reviewPage.activity.autoMergeDisabled': '{actor} desactivó la fusión automática', + 'reviewPage.activity.reviewRequested': '{actor} pidió una revisión a {reviewer}', + 'reviewPage.activity.reviewRequestedUnnamed': '{actor} pidió una revisión', + 'reviewPage.activity.renamed': '{actor} cambió el título de «{from}» a «{to}»', + 'reviewPage.activity.commentPlaceholder': 'Deja un comentario', + 'reviewPage.activity.comment': 'Comentar', + 'reviewPage.activity.commentHint': 'Se publicará en {forge} · Admite Markdown', + 'reviewPage.activity.commentHintPlain': 'Admite Markdown', + 'reviewPage.activity.commenting': 'Publicando…', + 'reviewPage.activity.commentFailed': 'El comentario no se publicó: {message}', 'reviewPage.status': 'Estado', 'reviewPage.requestReview': 'Solicitar revisión', 'reviewPage.showAll': 'Mostrar los {count}', 'reviewPage.notFound': 'La solicitud de cambio no existe o no tienes acceso', - 'reviewPage.unrecognized': 'DSH no reconoce el host de este enlace', - 'reviewPage.unrecognizedHint': 'Aquí solo se abren hosts que atiende un componente de servicio de código activado.', + 'reviewPage.unrecognized': 'Servicio de código desconocido', + 'reviewPage.unrecognizedHint': 'El host de este enlace no se ha añadido a ningún componente de servicio de código.', + 'reviewPage.addHost': 'Añadir host…', + 'reviewPage.hostSettings': 'Abrir ajustes', 'reviewPage.loadFailed': 'No se pudo leer la solicitud de cambio', 'reviewPage.markdown.copy': 'Copiar', 'reviewPage.markdown.copied': 'Copiado', @@ -2346,6 +2618,23 @@ export const fr: Record = { 'settings.saveFailed': 'Le déploiement n’a pas accepté ces valeurs ; elles ont été laissées pour correction.', 'settings.save': 'Enregistrer', 'settings.saving': 'Enregistrement…', + 'hosts.title': 'Hôtes', + 'hosts.hint': 'Les liens de {noun} et les dépôts distants Git de ces hôtes sont reconnus. Après avoir ajouté un hôte, connectez-vous-y avec {cli} dans un terminal.', + 'hosts.unavailable': 'Les paramètres des hôtes sont indisponibles.', + 'hosts.add': 'Ajouter', + 'hosts.addLabel': 'Hôte à ajouter', + 'hosts.remove': 'Retirer {host}', + 'hosts.keepOne': 'Conservez au moins un hôte', + 'hosts.recheck': 'Vérifier à nouveau la connexion', + 'hosts.state.ready': 'Connecté', + 'hosts.state.unauthenticated': 'Non connecté', + 'hosts.state.unavailable': 'Vérification impossible', + 'hosts.state.checking': 'Vérification…', + 'hosts.state.unsaved': 'Non enregistré', + 'hosts.invalid': 'Saisissez un nom d’hôte, par exemple {example}', + 'hosts.duplicate': '{host} figure déjà dans la liste', + 'hosts.taken.github': 'Le composant GitHub utilise déjà {host}', + 'hosts.taken.gitlab': 'Le composant GitLab utilise déjà {host}', 'toast.archiveCleanupScheduled': 'Archivé ; l’arbre de travail sera supprimé', 'toast.archiveCleanupFailed': 'Archivé ; échec de la suppression de l’arbre de travail. La branche est conservée. Vérifiez l’arbre de travail.', 'review.startReview': 'Commencer la revue', @@ -2464,6 +2753,7 @@ export const fr: Record = { 'change.failure.rateLimited': 'L’hébergeur de code limite les requêtes ; nouvel essai sous peu', 'change.unserved': 'L’état des demandes n’est pas encore pris en charge pour cet hébergeur de code', 'change.view': 'Ouvrir dans le navigateur', + 'change.viewOn': 'Ouvrir sur {forge}', 'change.copy': 'Copier le lien de la demande', 'change.viewChanges': 'Voir les modifications', 'change.actions': 'Actions pour {name}', @@ -2491,6 +2781,20 @@ export const fr: Record = { 'change.mergeNote.merge': 'Conserver tous les commits et ajouter un commit de fusion', 'change.mergeNote.rebase': 'Rejouer chaque commit sur {base}', 'change.mergeConfirm': 'Confirmer la fusion', + 'change.autoMerge': 'Fusion automatique', + 'change.autoMergeTitle': 'Fusionner {name} dans {base} une fois les conditions remplies', + 'change.autoMergeConfirm': 'Activer la fusion automatique', + 'change.autoMergeOn': 'Fusion automatique activée', + 'change.autoMergeOnTitle': 'Sera fusionnée dans {base} une fois les conditions remplies', + 'change.autoMergeMethod': 'Méthode : {method}', + 'change.autoMergeBy': 'Activée par {login}', + 'change.autoMergeCancel': 'Annuler la fusion automatique', + 'change.blocked.conflict': 'Conflits de fusion', + 'change.blocked.changesRequested': 'Des modifications ont été demandées', + 'change.blocked.reviewRequired': 'Une revue est requise', + 'change.blocked.checksFailed': 'Des vérifications ont échoué', + 'change.blocked.checksPending': 'Vérifications en cours', + 'change.blocked.other': 'L’hébergeur de code n’autorise pas la fusion pour l’instant', 'change.mergeChanged': 'De nouveaux commits sont arrivés. Vérifiez-les avant de rouvrir le menu de fusion', 'checks.allPassed': 'Les {count} vérifications ont réussi', 'checks.showQuiet': 'Afficher {count} de plus (réussies, ignorées)', @@ -2645,14 +2949,14 @@ export const fr: Record = { 'diff.error': 'Impossible de lire les modifications', 'diff.tooLarge': 'Ces modifications sont trop volumineuses pour être affichées ici', 'diff.filterConfigFailed': 'Impossible de lire toute la configuration des filtres Git. Aucune comparaison effectuée. Vérifiez la configuration Git et la limite de sortie, puis réessayez.', - 'diff.viewInBrowser': 'Voir dans le navigateur', + 'diff.viewInBrowser': 'Voir sur {forge}', 'diff.noForkPoint': 'Le point de divergence de cette branche est introuvable ; choisissez une branche de base ou une autre portée', 'diff.empty': 'Aucune modification', 'diff.omitted': '{count} autres fichiers non suivis ne sont pas affichés', 'diff.stale': 'La branche locale contient {count} commits non envoyés ; les modifications de la demande sont affichées', 'diff.moreActions': 'Autres actions pour {name}', 'diff.copyPath': 'Copier le chemin', - 'diff.openFileInBrowser': 'Voir le fichier dans le navigateur', + 'diff.openFileInBrowser': 'Voir le fichier sur {forge}', 'diff.openFileInSidebar': 'Ouvrir le fichier entier dans la barre latérale', 'time.now': 'à l’instant', 'time.minutes': 'il y a {n} min', @@ -2757,7 +3061,12 @@ export const fr: Record = { 'toast.merged': '{name} a été fusionné', 'toast.mergeFailed': 'Impossible de fusionner : {message}', 'toast.mergeStale': '{name} contient de nouveaux commits ; vérifiez-les avant de fusionner', + 'toast.autoMergeEnabled': 'Fusion automatique activée pour {name}', + 'toast.autoMergeCancelled': 'Fusion automatique annulée pour {name}', + 'toast.autoMergeStale': '{name} contient de nouveaux commits ; vérifiez-les avant d’activer la fusion automatique', + 'toast.autoMergeFailed': 'La fusion automatique n’a pas été modifiée : {message}', 'toast.pathCopied': 'Chemin copié', + 'toast.commandCopied': 'Commande copiée', 'toast.expandFailed': 'Impossible d’afficher les lignes inchangées : {message}', 'toast.expandStale': 'Le fichier a changé depuis la lecture des modifications ; actualisez avant de développer', 'toast.prompted': 'Envoyé : {text}', @@ -2831,6 +3140,9 @@ export const fr: Record = { 'reviewPage.search': 'Rechercher ou coller un lien de demande de modification', 'reviewPage.loading': 'Lecture des listes', 'reviewPage.refresh': 'Actualiser l’état', + 'reviewPage.copyLink': 'Copier le lien', + 'reviewPage.copied': 'Copié', + 'reviewPage.detailLoading': 'Lecture de la demande de modification', 'reviewPage.filter': 'Filtrer', 'reviewPage.filter.repository': 'Dépôt', 'reviewPage.filter.allRepositories': 'Tous les dépôts', @@ -2842,18 +3154,16 @@ export const fr: Record = { 'reviewPage.empty.search': 'Aucune demande de modification correspondante', 'reviewPage.truncated': '{count} autres non listées', 'reviewPage.noHosts': 'Aucun hébergeur de code ne liste de demandes de modification', - 'reviewPage.noHostsHint': 'Activez le composant GitHub pour lister les demandes de modification qui attendent votre revue, que vous avez créées et qui vous concernent.', + 'reviewPage.noHostsHint': 'Activez le composant GitHub ou GitLab pour lister les demandes de modification qui attendent votre revue, que vous avez créées et qui vous concernent.', 'reviewPage.signIn': 'Connectez-vous à {host} pour lister vos demandes de modification', 'reviewPage.listFailed': 'Impossible de lire la liste de {host} : {message}', 'reviewPage.streamFailed': 'La connexion de la liste a pris fin', 'reviewPage.openUrl': 'Ouvrir {url}', - 'reviewPage.hint.rerequested': 'Vous avez demandé des modifications · Revue redemandée', + 'reviewPage.hint.rerequested': 'Nouvelle revue demandée', 'reviewPage.hint.team': 'Équipe {team}', 'reviewPage.hint.approvedByYou': 'Vous avez approuvé', 'reviewPage.hint.changesRequested': 'Modifications demandées', 'reviewPage.hint.approved': 'Approuvée', - 'reviewPage.issuesMore': 'et {count} autres', - 'reviewPage.issuesMoreTruncated': 'et {count}+ autres', 'reviewPage.countAria': '{count} demandes de modification attendent votre revue', 'reviewPage.select': 'Sélectionnez une demande de modification', 'reviewPage.selectHint': 'Choisissez-en une dans la liste ou collez un lien de demande de modification dans la recherche.', @@ -2874,12 +3184,42 @@ export const fr: Record = { 'reviewPage.description': 'Description', 'reviewPage.descriptionEmpty': 'Aucune description', 'reviewPage.descriptionFailed': 'Impossible de lire la description : {message}', + 'reviewPage.activity': 'Activité', + 'reviewPage.activity.empty': 'Aucune activité pour le moment', + 'reviewPage.activity.failed': 'Impossible de lire l’activité : {message}', + 'reviewPage.activity.older': 'L’activité plus ancienne n’est pas affichée', + 'reviewPage.activity.commits': 'Commits : {count}', + 'reviewPage.activity.inline': 'Commentaires en ligne : {count}', + 'reviewPage.activity.viewInChanges': 'Voir dans Modifications', + 'reviewPage.activity.approved': '{actor} a approuvé ces modifications', + 'reviewPage.activity.changesRequested': '{actor} a demandé des modifications', + 'reviewPage.activity.commented': '{actor} a fait une revue', + 'reviewPage.activity.dismissed': 'La revue de {actor} a été rejetée', + 'reviewPage.activity.merged': '{actor} a fusionné cette demande', + 'reviewPage.activity.closed': '{actor} a fermé cette demande', + 'reviewPage.activity.reopened': '{actor} a rouvert cette demande', + 'reviewPage.activity.readyForReview': '{actor} l’a marquée comme prête pour la revue', + 'reviewPage.activity.convertedToDraft': '{actor} l’a convertie en brouillon', + 'reviewPage.activity.forcePushed': '{actor} a forcé le push de la branche', + 'reviewPage.activity.autoMergeEnabled': '{actor} a activé la fusion automatique', + 'reviewPage.activity.autoMergeDisabled': '{actor} a désactivé la fusion automatique', + 'reviewPage.activity.reviewRequested': '{actor} a demandé une revue à {reviewer}', + 'reviewPage.activity.reviewRequestedUnnamed': '{actor} a demandé une revue', + 'reviewPage.activity.renamed': '{actor} a changé le titre de « {from} » en « {to} »', + 'reviewPage.activity.commentPlaceholder': 'Laisser un commentaire', + 'reviewPage.activity.comment': 'Commenter', + 'reviewPage.activity.commentHint': 'Sera publié sur {forge} · Markdown pris en charge', + 'reviewPage.activity.commentHintPlain': 'Markdown pris en charge', + 'reviewPage.activity.commenting': 'Publication…', + 'reviewPage.activity.commentFailed': 'Le commentaire n’a pas été publié : {message}', 'reviewPage.status': 'État', 'reviewPage.requestReview': 'Demander une revue', 'reviewPage.showAll': 'Afficher les {count}', 'reviewPage.notFound': 'La demande de modification n\'existe pas ou vous n\'y avez pas accès', - 'reviewPage.unrecognized': 'DSH ne reconnaît pas l\'hôte de ce lien', - 'reviewPage.unrecognizedHint': 'Seuls les hôtes servis par un composant d\'hébergement de code activé s\'ouvrent ici.', + 'reviewPage.unrecognized': 'Hébergement de code inconnu', + 'reviewPage.unrecognizedHint': 'L’hôte de ce lien n’a été ajouté à aucun composant d’hébergement de code.', + 'reviewPage.addHost': 'Ajouter un hôte…', + 'reviewPage.hostSettings': 'Ouvrir les réglages', 'reviewPage.loadFailed': 'Impossible de lire la demande de modification', 'reviewPage.markdown.copy': 'Copier', 'reviewPage.markdown.copied': 'Copié', @@ -2927,6 +3267,23 @@ export const de: Record = { 'settings.saveFailed': 'Die Bereitstellung hat diese Werte nicht übernommen; sie wurden zur Korrektur belassen.', 'settings.save': 'Speichern', 'settings.saving': 'Wird gespeichert…', + 'hosts.title': 'Hosts', + 'hosts.hint': '{noun}-Links und Git-Remotes auf diesen Hosts werden erkannt. Melden Sie sich nach dem Hinzufügen eines Hosts im Terminal mit {cli} dort an.', + 'hosts.unavailable': 'Die Host-Einstellungen sind nicht verfügbar.', + 'hosts.add': 'Hinzufügen', + 'hosts.addLabel': 'Hinzuzufügender Host', + 'hosts.remove': '{host} entfernen', + 'hosts.keepOne': 'Mindestens ein Host muss bleiben', + 'hosts.recheck': 'Anmeldung erneut prüfen', + 'hosts.state.ready': 'Angemeldet', + 'hosts.state.unauthenticated': 'Nicht angemeldet', + 'hosts.state.unavailable': 'Prüfung nicht möglich', + 'hosts.state.checking': 'Wird geprüft…', + 'hosts.state.unsaved': 'Nicht gespeichert', + 'hosts.invalid': 'Geben Sie einen Hostnamen ein, zum Beispiel {example}', + 'hosts.duplicate': '{host} steht bereits in der Liste', + 'hosts.taken.github': 'Die GitHub-Komponente verwendet {host} bereits', + 'hosts.taken.gitlab': 'Die GitLab-Komponente verwendet {host} bereits', 'toast.archiveCleanupScheduled': 'Archiviert; der Arbeitsbaum wird entfernt', 'toast.archiveCleanupFailed': 'Archiviert; der Arbeitsbaum konnte nicht entfernt werden. Der Branch bleibt erhalten. Prüfe den Arbeitsbaum.', 'review.startReview': 'Review starten', @@ -3045,6 +3402,7 @@ export const de: Record = { 'change.failure.rateLimited': 'Der Code-Host begrenzt Anfragen; neuer Versuch in Kürze', 'change.unserved': 'Der Status von Änderungsanfragen wird für diesen Code-Host noch nicht unterstützt', 'change.view': 'Im Browser öffnen', + 'change.viewOn': 'Auf {forge} öffnen', 'change.copy': 'Link zur Änderungsanfrage kopieren', 'change.viewChanges': 'Änderungen anzeigen', 'change.actions': 'Aktionen für {name}', @@ -3072,6 +3430,20 @@ export const de: Record = { 'change.mergeNote.merge': 'Alle Commits beibehalten und einen Merge-Commit hinzufügen', 'change.mergeNote.rebase': 'Jeden Commit auf {base} neu anwenden', 'change.mergeConfirm': 'Zusammenführung bestätigen', + 'change.autoMerge': 'Automatisch zusammenführen', + 'change.autoMergeTitle': '{name} in {base} zusammenführen, sobald die Anforderungen erfüllt sind', + 'change.autoMergeConfirm': 'Automatisches Zusammenführen aktivieren', + 'change.autoMergeOn': 'Automatisches Zusammenführen aktiv', + 'change.autoMergeOnTitle': 'Wird mit {base} zusammengeführt, sobald die Anforderungen erfüllt sind', + 'change.autoMergeMethod': 'Methode: {method}', + 'change.autoMergeBy': 'Aktiviert von {login}', + 'change.autoMergeCancel': 'Automatisches Zusammenführen abbrechen', + 'change.blocked.conflict': 'Es gibt Merge-Konflikte', + 'change.blocked.changesRequested': 'Änderungen wurden angefordert', + 'change.blocked.reviewRequired': 'Ein Review ist erforderlich', + 'change.blocked.checksFailed': 'Checks sind fehlgeschlagen', + 'change.blocked.checksPending': 'Checks laufen noch', + 'change.blocked.other': 'Der Code-Host erlaubt derzeit kein Zusammenführen', 'change.mergeChanged': 'Neue Commits sind eingetroffen. Vor dem erneuten Öffnen des Merge-Menüs prüfen', 'checks.allPassed': 'Alle {count} Prüfungen bestanden', 'checks.showQuiet': '{count} weitere anzeigen (bestanden, übersprungen)', @@ -3226,14 +3598,14 @@ export const de: Record = { 'diff.error': 'Änderungen konnten nicht gelesen werden', 'diff.tooLarge': 'Diese Änderungen sind zu groß, um sie hier anzuzeigen', 'diff.filterConfigFailed': 'Die Git-Filtereinstellungen konnten nicht vollständig gelesen werden. Es wurde kein Vergleich ausgeführt. Prüfe die Git-Einstellungen und das Ausgabelimit und versuche es erneut.', - 'diff.viewInBrowser': 'Im Browser ansehen', + 'diff.viewInBrowser': 'Auf {forge} ansehen', 'diff.noForkPoint': 'Kein Verzweigungspunkt für diesen Branch gefunden; einen Basis-Branch oder einen anderen Bereich wählen', 'diff.empty': 'Keine Änderungen', 'diff.omitted': '{count} weitere nicht verfolgte Dateien werden nicht angezeigt', 'diff.stale': 'Der lokale Branch hat {count} nicht gepushte Commits; angezeigt werden die Änderungen der Änderungsanfrage', 'diff.moreActions': 'Weitere Aktionen für {name}', 'diff.copyPath': 'Pfad kopieren', - 'diff.openFileInBrowser': 'Datei im Browser ansehen', + 'diff.openFileInBrowser': 'Datei auf {forge} ansehen', 'diff.openFileInSidebar': 'Die gesamte Datei in der Seitenleiste öffnen', 'time.now': 'gerade eben', 'time.minutes': 'vor {n} Min.', @@ -3338,7 +3710,12 @@ export const de: Record = { 'toast.merged': '{name} wurde zusammengeführt', 'toast.mergeFailed': 'Zusammenführung fehlgeschlagen: {message}', 'toast.mergeStale': '{name} enthält neue Commits; vor dem Zusammenführen prüfen', + 'toast.autoMergeEnabled': 'Automatisches Zusammenführen für {name} aktiviert', + 'toast.autoMergeCancelled': 'Automatisches Zusammenführen für {name} abgebrochen', + 'toast.autoMergeStale': '{name} enthält neue Commits; vor dem Aktivieren des automatischen Zusammenführens prüfen', + 'toast.autoMergeFailed': 'Automatisches Zusammenführen wurde nicht geändert: {message}', 'toast.pathCopied': 'Pfad kopiert', + 'toast.commandCopied': 'Befehl kopiert', 'toast.expandFailed': 'Unveränderte Zeilen konnten nicht angezeigt werden: {message}', 'toast.expandStale': 'Die Datei wurde nach dem Lesen der Änderungen verändert; vor dem Aufklappen aktualisieren', 'toast.prompted': 'Gesendet: {text}', @@ -3412,6 +3789,9 @@ export const de: Record = { 'reviewPage.search': 'Suchen oder Link einer Änderungsanfrage einfügen', 'reviewPage.loading': 'Listen werden gelesen', 'reviewPage.refresh': 'Status aktualisieren', + 'reviewPage.copyLink': 'Link kopieren', + 'reviewPage.copied': 'Kopiert', + 'reviewPage.detailLoading': 'Änderungsanfrage wird gelesen', 'reviewPage.filter': 'Filtern', 'reviewPage.filter.repository': 'Repository', 'reviewPage.filter.allRepositories': 'Alle Repositorys', @@ -3423,18 +3803,16 @@ export const de: Record = { 'reviewPage.empty.search': 'Keine passenden Änderungsanfragen', 'reviewPage.truncated': '{count} weitere nicht aufgeführt', 'reviewPage.noHosts': 'Kein Code-Host listet Änderungsanfragen', - 'reviewPage.noHostsHint': 'Aktivieren Sie die GitHub-Komponente, um Änderungsanfragen aufzulisten, die Ihr Review anfragen, die Sie erstellt haben und an denen Sie beteiligt sind.', + 'reviewPage.noHostsHint': 'Aktivieren Sie die GitHub- oder GitLab-Komponente, um Änderungsanfragen aufzulisten, die Ihr Review anfragen, die Sie erstellt haben und an denen Sie beteiligt sind.', 'reviewPage.signIn': 'Melden Sie sich bei {host} an, um Ihre Änderungsanfragen aufzulisten', 'reviewPage.listFailed': 'Liste von {host} konnte nicht gelesen werden: {message}', 'reviewPage.streamFailed': 'Die Verbindung der Liste wurde beendet', 'reviewPage.openUrl': '{url} öffnen', - 'reviewPage.hint.rerequested': 'Sie haben Änderungen angefordert · Erneut angefragt', + 'reviewPage.hint.rerequested': 'Erneutes Review angefragt', 'reviewPage.hint.team': 'Team {team}', 'reviewPage.hint.approvedByYou': 'Von Ihnen genehmigt', 'reviewPage.hint.changesRequested': 'Änderungen angefordert', 'reviewPage.hint.approved': 'Genehmigt', - 'reviewPage.issuesMore': 'und {count} weitere', - 'reviewPage.issuesMoreTruncated': 'und {count}+ weitere', 'reviewPage.countAria': '{count} Änderungsanfragen warten auf Ihr Review', 'reviewPage.select': 'Änderungsanfrage auswählen', 'reviewPage.selectHint': 'Wählen Sie eine aus der Liste oder fügen Sie einen Link in die Suche ein.', @@ -3455,12 +3833,42 @@ export const de: Record = { 'reviewPage.description': 'Beschreibung', 'reviewPage.descriptionEmpty': 'Keine Beschreibung', 'reviewPage.descriptionFailed': 'Beschreibung konnte nicht gelesen werden: {message}', + 'reviewPage.activity': 'Aktivität', + 'reviewPage.activity.empty': 'Noch keine Aktivität', + 'reviewPage.activity.failed': 'Aktivität konnte nicht gelesen werden: {message}', + 'reviewPage.activity.older': 'Ältere Aktivität wird nicht aufgeführt', + 'reviewPage.activity.commits': 'Commits: {count}', + 'reviewPage.activity.inline': 'Zeilenkommentare: {count}', + 'reviewPage.activity.viewInChanges': 'In Änderungen ansehen', + 'reviewPage.activity.approved': '{actor} hat diese Änderungen genehmigt', + 'reviewPage.activity.changesRequested': '{actor} hat Änderungen angefordert', + 'reviewPage.activity.commented': '{actor} hat ein Review abgegeben', + 'reviewPage.activity.dismissed': 'Das Review von {actor} wurde verworfen', + 'reviewPage.activity.merged': '{actor} hat diesen Request gemergt', + 'reviewPage.activity.closed': '{actor} hat diesen Request geschlossen', + 'reviewPage.activity.reopened': '{actor} hat diesen Request wieder geöffnet', + 'reviewPage.activity.readyForReview': '{actor} hat ihn als bereit zum Review markiert', + 'reviewPage.activity.convertedToDraft': '{actor} hat ihn in einen Entwurf umgewandelt', + 'reviewPage.activity.forcePushed': '{actor} hat den Branch per Force-Push aktualisiert', + 'reviewPage.activity.autoMergeEnabled': '{actor} hat das automatische Zusammenführen aktiviert', + 'reviewPage.activity.autoMergeDisabled': '{actor} hat das automatische Zusammenführen deaktiviert', + 'reviewPage.activity.reviewRequested': '{actor} hat ein Review von {reviewer} angefragt', + 'reviewPage.activity.reviewRequestedUnnamed': '{actor} hat ein Review angefragt', + 'reviewPage.activity.renamed': '{actor} hat den Titel von „{from}“ in „{to}“ geändert', + 'reviewPage.activity.commentPlaceholder': 'Kommentar schreiben', + 'reviewPage.activity.comment': 'Kommentieren', + 'reviewPage.activity.commentHint': 'Wird auf {forge} veröffentlicht · Markdown unterstützt', + 'reviewPage.activity.commentHintPlain': 'Markdown unterstützt', + 'reviewPage.activity.commenting': 'Wird veröffentlicht…', + 'reviewPage.activity.commentFailed': 'Der Kommentar wurde nicht veröffentlicht: {message}', 'reviewPage.status': 'Status', 'reviewPage.requestReview': 'Review anfordern', 'reviewPage.showAll': 'Alle {count} anzeigen', 'reviewPage.notFound': 'Die Änderungsanfrage existiert nicht oder Sie haben keinen Zugriff', - 'reviewPage.unrecognized': 'DSH erkennt den Host dieses Links nicht', - 'reviewPage.unrecognizedHint': 'Hier öffnen sich nur Hosts, die eine aktivierte Code-Host-Komponente bedient.', + 'reviewPage.unrecognized': 'Unbekannter Code-Host', + 'reviewPage.unrecognizedHint': 'Der Host dieses Links wurde keiner Code-Host-Komponente hinzugefügt.', + 'reviewPage.addHost': 'Host hinzufügen…', + 'reviewPage.hostSettings': 'Einstellungen öffnen', 'reviewPage.loadFailed': 'Änderungsanfrage konnte nicht gelesen werden', 'reviewPage.markdown.copy': 'Kopieren', 'reviewPage.markdown.copied': 'Kopiert', @@ -3508,6 +3916,23 @@ export const ru: Record = { 'settings.saveFailed': 'Развёртывание не приняло эти значения; они оставлены для исправления.', 'settings.save': 'Сохранить', 'settings.saving': 'Сохранение…', + 'hosts.title': 'Хосты', + 'hosts.hint': 'Ссылки на {noun} и удалённые репозитории Git на этих хостах распознаются. Добавив хост, войдите на него через {cli} в терминале.', + 'hosts.unavailable': 'Настройки хостов недоступны.', + 'hosts.add': 'Добавить', + 'hosts.addLabel': 'Добавляемый хост', + 'hosts.remove': 'Убрать {host}', + 'hosts.keepOne': 'Оставьте хотя бы один хост', + 'hosts.recheck': 'Проверить вход ещё раз', + 'hosts.state.ready': 'Вход выполнен', + 'hosts.state.unauthenticated': 'Вход не выполнен', + 'hosts.state.unavailable': 'Не удаётся проверить', + 'hosts.state.checking': 'Проверка…', + 'hosts.state.unsaved': 'Не сохранено', + 'hosts.invalid': 'Введите имя хоста, например {example}', + 'hosts.duplicate': '{host} уже есть в списке', + 'hosts.taken.github': 'Компонент GitHub уже использует {host}', + 'hosts.taken.gitlab': 'Компонент GitLab уже использует {host}', 'toast.archiveCleanupScheduled': 'Архивировано; рабочее дерево будет удалено', 'toast.archiveCleanupFailed': 'Архивировано; не удалось удалить рабочее дерево. Ветка сохранена. Проверьте рабочее дерево.', 'review.startReview': 'Начать проверку', @@ -3626,6 +4051,7 @@ export const ru: Record = { 'change.failure.rateLimited': 'Хостинг кода ограничивает запросы; скоро будет повторная попытка', 'change.unserved': 'Состояние запросов этого хостинга кода пока не поддерживается', 'change.view': 'Открыть в браузере', + 'change.viewOn': 'Открыть на {forge}', 'change.copy': 'Копировать ссылку на запрос', 'change.viewChanges': 'Показать изменения', 'change.actions': 'Действия для {name}', @@ -3653,6 +4079,20 @@ export const ru: Record = { 'change.mergeNote.merge': 'Сохранить все коммиты и добавить коммит слияния', 'change.mergeNote.rebase': 'Перенести каждый коммит на {base}', 'change.mergeConfirm': 'Подтвердить слияние', + 'change.autoMerge': 'Автослияние', + 'change.autoMergeTitle': 'Объединить {name} с {base}, когда требования будут выполнены', + 'change.autoMergeConfirm': 'Включить автослияние', + 'change.autoMergeOn': 'Автослияние включено', + 'change.autoMergeOnTitle': 'Будет объединён с {base}, когда требования будут выполнены', + 'change.autoMergeMethod': 'Способ: {method}', + 'change.autoMergeBy': 'Включено: {login}', + 'change.autoMergeCancel': 'Отменить автослияние', + 'change.blocked.conflict': 'Есть конфликты слияния', + 'change.blocked.changesRequested': 'Запрошены правки', + 'change.blocked.reviewRequired': 'Требуется ревью', + 'change.blocked.checksFailed': 'Проверки не пройдены', + 'change.blocked.checksPending': 'Проверки выполняются', + 'change.blocked.other': 'Хост кода сейчас не разрешает слияние', 'change.mergeChanged': 'Появились новые коммиты. Проверьте их перед повторным открытием меню слияния', 'checks.allPassed': 'Все проверки пройдены: {count}', 'checks.showQuiet': 'Показать ещё {count} (пройдены, пропущены)', @@ -3807,14 +4247,14 @@ export const ru: Record = { 'diff.error': 'Не удалось прочитать изменения', 'diff.tooLarge': 'Изменения слишком велики для отображения здесь', 'diff.filterConfigFailed': 'Не удалось полностью прочитать настройки фильтров Git. Сравнение не выполнено. Проверьте настройки Git и ограничение вывода, затем повторите попытку.', - 'diff.viewInBrowser': 'Посмотреть в браузере', + 'diff.viewInBrowser': 'Открыть на {forge}', 'diff.noForkPoint': 'Не найдена точка ответвления этой ветки; выберите базовую ветку или другую область', 'diff.empty': 'Нет изменений', 'diff.omitted': 'Не показано ещё неотслеживаемых файлов: {count}', 'diff.stale': 'В локальной ветке {count} неотправленных коммитов; показаны изменения из запроса', 'diff.moreActions': 'Другие действия для {name}', 'diff.copyPath': 'Копировать путь', - 'diff.openFileInBrowser': 'Посмотреть файл в браузере', + 'diff.openFileInBrowser': 'Открыть файл на {forge}', 'diff.openFileInSidebar': 'Открыть весь файл в боковой панели', 'time.now': 'только что', 'time.minutes': '{n} мин назад', @@ -3919,7 +4359,12 @@ export const ru: Record = { 'toast.merged': '{name} объединён', 'toast.mergeFailed': 'Не удалось объединить: {message}', 'toast.mergeStale': 'В {name} есть новые коммиты; проверьте их перед слиянием', + 'toast.autoMergeEnabled': 'Автослияние для {name} включено', + 'toast.autoMergeCancelled': 'Автослияние для {name} отменено', + 'toast.autoMergeStale': 'В {name} есть новые коммиты; проверьте их перед включением автослияния', + 'toast.autoMergeFailed': 'Автослияние не изменено: {message}', 'toast.pathCopied': 'Путь скопирован', + 'toast.commandCopied': 'Команда скопирована', 'toast.expandFailed': 'Не удалось показать неизменённые строки: {message}', 'toast.expandStale': 'Файл изменился после чтения изменений; обновите перед разворачиванием', 'toast.prompted': 'Отправлено: {text}', @@ -3993,6 +4438,9 @@ export const ru: Record = { 'reviewPage.search': 'Поиск или ссылка на запрос на изменение', 'reviewPage.loading': 'Чтение списков', 'reviewPage.refresh': 'Обновить состояние', + 'reviewPage.copyLink': 'Копировать ссылку', + 'reviewPage.copied': 'Скопировано', + 'reviewPage.detailLoading': 'Чтение запроса на изменение', 'reviewPage.filter': 'Фильтр', 'reviewPage.filter.repository': 'Репозиторий', 'reviewPage.filter.allRepositories': 'Все репозитории', @@ -4004,18 +4452,16 @@ export const ru: Record = { 'reviewPage.empty.search': 'Нет подходящих запросов на изменение', 'reviewPage.truncated': 'Ещё {count} не показаны', 'reviewPage.noHosts': 'Ни один хостинг кода не выводит запросы на изменение', - 'reviewPage.noHostsHint': 'Включите компонент GitHub, чтобы видеть запросы на изменение, ожидающие вашего ревью, созданные вами и с вашим участием.', + 'reviewPage.noHostsHint': 'Включите компонент GitHub или GitLab, чтобы видеть запросы на изменение, ожидающие вашего ревью, созданные вами и с вашим участием.', 'reviewPage.signIn': 'Войдите в {host}, чтобы увидеть свои запросы на изменение', 'reviewPage.listFailed': 'Не удалось прочитать список {host}: {message}', 'reviewPage.streamFailed': 'Соединение списка прервано', 'reviewPage.openUrl': 'Открыть {url}', - 'reviewPage.hint.rerequested': 'Вы запросили изменения · Ревью запрошено снова', + 'reviewPage.hint.rerequested': 'Запрошено повторное ревью', 'reviewPage.hint.team': 'Команда {team}', 'reviewPage.hint.approvedByYou': 'Вы одобрили', 'reviewPage.hint.changesRequested': 'Запрошены изменения', 'reviewPage.hint.approved': 'Одобрено', - 'reviewPage.issuesMore': 'и ещё {count}', - 'reviewPage.issuesMoreTruncated': 'и ещё {count}+', 'reviewPage.countAria': 'Запросов на изменение, ожидающих вашего ревью: {count}', 'reviewPage.select': 'Выберите запрос на изменение', 'reviewPage.selectHint': 'Выберите его в списке или вставьте ссылку на запрос в поле поиска.', @@ -4036,12 +4482,42 @@ export const ru: Record = { 'reviewPage.description': 'Описание', 'reviewPage.descriptionEmpty': 'Нет описания', 'reviewPage.descriptionFailed': 'Не удалось прочитать описание: {message}', + 'reviewPage.activity': 'Активность', + 'reviewPage.activity.empty': 'Активности пока нет', + 'reviewPage.activity.failed': 'Не удалось прочитать активность: {message}', + 'reviewPage.activity.older': 'Более ранняя активность не показана', + 'reviewPage.activity.commits': 'Коммиты: {count}', + 'reviewPage.activity.inline': 'Комментарии к строкам: {count}', + 'reviewPage.activity.viewInChanges': 'Смотреть в изменениях', + 'reviewPage.activity.approved': '{actor}: изменения одобрены', + 'reviewPage.activity.changesRequested': '{actor}: запрошены правки', + 'reviewPage.activity.commented': '{actor}: проведено ревью', + 'reviewPage.activity.dismissed': '{actor}: ревью отклонено', + 'reviewPage.activity.merged': '{actor}: запрос слит', + 'reviewPage.activity.closed': '{actor}: запрос закрыт', + 'reviewPage.activity.reopened': '{actor}: запрос открыт заново', + 'reviewPage.activity.readyForReview': '{actor}: отмечено как готовое к ревью', + 'reviewPage.activity.convertedToDraft': '{actor}: переведено в черновик', + 'reviewPage.activity.forcePushed': '{actor}: ветка обновлена принудительной отправкой', + 'reviewPage.activity.autoMergeEnabled': '{actor}: включено автослияние', + 'reviewPage.activity.autoMergeDisabled': '{actor}: отключено автослияние', + 'reviewPage.activity.reviewRequested': '{actor}: запрошено ревью у {reviewer}', + 'reviewPage.activity.reviewRequestedUnnamed': '{actor}: запрошено ревью', + 'reviewPage.activity.renamed': '{actor}: заголовок изменён с «{from}» на «{to}»', + 'reviewPage.activity.commentPlaceholder': 'Оставьте комментарий', + 'reviewPage.activity.comment': 'Комментировать', + 'reviewPage.activity.commentHint': 'Будет опубликовано на {forge} · Поддерживается Markdown', + 'reviewPage.activity.commentHintPlain': 'Поддерживается Markdown', + 'reviewPage.activity.commenting': 'Публикация…', + 'reviewPage.activity.commentFailed': 'Комментарий не опубликован: {message}', 'reviewPage.status': 'Состояние', 'reviewPage.requestReview': 'Запросить ревью', 'reviewPage.showAll': 'Показать все {count}', 'reviewPage.notFound': 'Запрос на изменение не существует или у вас нет доступа', - 'reviewPage.unrecognized': 'DSH не распознаёт хост этой ссылки', - 'reviewPage.unrecognizedHint': 'Здесь открываются только хосты, которые обслуживает включённый компонент хостинга кода.', + 'reviewPage.unrecognized': 'Неизвестный хостинг кода', + 'reviewPage.unrecognizedHint': 'Хост этой ссылки не добавлен ни в один компонент хостинга кода.', + 'reviewPage.addHost': 'Добавить хост…', + 'reviewPage.hostSettings': 'Открыть настройки', 'reviewPage.loadFailed': 'Не удалось прочитать запрос на изменение', 'reviewPage.markdown.copy': 'Копировать', 'reviewPage.markdown.copied': 'Скопировано', @@ -4089,6 +4565,23 @@ export const pt: Record = { 'settings.saveFailed': 'A implantação não aceitou estes valores; eles foram mantidos para correção.', 'settings.save': 'Salvar', 'settings.saving': 'Salvando…', + 'hosts.title': 'Hosts', + 'hosts.hint': 'Os links de {noun} e os remotos do Git nestes hosts são reconhecidos. Depois de adicionar um host, entre nele com {cli} em um terminal.', + 'hosts.unavailable': 'As configurações de hosts não estão disponíveis.', + 'hosts.add': 'Adicionar', + 'hosts.addLabel': 'Host a adicionar', + 'hosts.remove': 'Remover {host}', + 'hosts.keepOne': 'Mantenha pelo menos um host', + 'hosts.recheck': 'Verificar o login novamente', + 'hosts.state.ready': 'Conectado', + 'hosts.state.unauthenticated': 'Não conectado', + 'hosts.state.unavailable': 'Não é possível verificar', + 'hosts.state.checking': 'Verificando…', + 'hosts.state.unsaved': 'Não salvo', + 'hosts.invalid': 'Digite um nome de host, por exemplo {example}', + 'hosts.duplicate': '{host} já está na lista', + 'hosts.taken.github': 'O componente do GitHub já usa {host}', + 'hosts.taken.gitlab': 'O componente do GitLab já usa {host}', 'toast.archiveCleanupScheduled': 'Arquivado; a árvore de trabalho será removida', 'toast.archiveCleanupFailed': 'Arquivado; a remoção da árvore de trabalho falhou. O ramo foi mantido. Verifique a árvore de trabalho.', 'review.startReview': 'Iniciar revisão', @@ -4207,6 +4700,7 @@ export const pt: Record = { 'change.failure.rateLimited': 'O host de código está limitando as solicitações; nova tentativa em breve', 'change.unserved': 'O status de solicitações deste serviço de código ainda não é compatível', 'change.view': 'Abrir no navegador', + 'change.viewOn': 'Abrir no {forge}', 'change.copy': 'Copiar link da solicitação', 'change.viewChanges': 'Ver alterações', 'change.actions': 'Ações de {name}', @@ -4234,6 +4728,20 @@ export const pt: Record = { 'change.mergeNote.merge': 'Manter todos os commits e adicionar um commit de merge', 'change.mergeNote.rebase': 'Reaplicar cada commit sobre {base}', 'change.mergeConfirm': 'Confirmar merge', + 'change.autoMerge': 'Mesclagem automática', + 'change.autoMergeTitle': 'Mesclar {name} em {base} quando os requisitos forem atendidos', + 'change.autoMergeConfirm': 'Ativar a mesclagem automática', + 'change.autoMergeOn': 'Mesclagem automática ativada', + 'change.autoMergeOnTitle': 'Será mesclado em {base} quando os requisitos forem atendidos', + 'change.autoMergeMethod': 'Método: {method}', + 'change.autoMergeBy': 'Ativada por {login}', + 'change.autoMergeCancel': 'Cancelar a mesclagem automática', + 'change.blocked.conflict': 'Há conflitos de mesclagem', + 'change.blocked.changesRequested': 'Foram pedidas alterações', + 'change.blocked.reviewRequired': 'É necessária uma revisão', + 'change.blocked.checksFailed': 'As verificações falharam', + 'change.blocked.checksPending': 'As verificações estão em andamento', + 'change.blocked.other': 'O host de código não permite mesclar agora', 'change.mergeChanged': 'Há novos commits. Revise-os antes de reabrir o menu de merge', 'checks.allPassed': 'Todas as {count} verificações passaram', 'checks.showQuiet': 'Mostrar mais {count} (aprovadas, ignoradas)', @@ -4388,14 +4896,14 @@ export const pt: Record = { 'diff.error': 'Não foi possível ler as alterações', 'diff.tooLarge': 'Estas alterações são grandes demais para serem exibidas aqui', 'diff.filterConfigFailed': 'Não foi possível ler todas as configurações de filtros do Git. A comparação não foi executada. Verifique as configurações do Git e o limite de saída e tente novamente.', - 'diff.viewInBrowser': 'Ver no navegador', + 'diff.viewInBrowser': 'Ver no {forge}', 'diff.noForkPoint': 'Não foi encontrado o ponto de ramificação desta branch; escolha uma branch base ou outro escopo', 'diff.empty': 'Sem alterações', 'diff.omitted': 'Outros {count} arquivos não rastreados não são exibidos', 'diff.stale': 'A branch local tem {count} commits não enviados; são exibidas as alterações da solicitação', 'diff.moreActions': 'Mais ações para {name}', 'diff.copyPath': 'Copiar caminho', - 'diff.openFileInBrowser': 'Ver arquivo no navegador', + 'diff.openFileInBrowser': 'Ver arquivo no {forge}', 'diff.openFileInSidebar': 'Abrir o arquivo inteiro na barra lateral', 'time.now': 'agora mesmo', 'time.minutes': 'há {n} min', @@ -4500,7 +5008,12 @@ export const pt: Record = { 'toast.merged': '{name} foi mesclada', 'toast.mergeFailed': 'Não foi possível mesclar: {message}', 'toast.mergeStale': '{name} tem novos commits; revise-os antes de mesclar', + 'toast.autoMergeEnabled': 'Mesclagem automática ativada para {name}', + 'toast.autoMergeCancelled': 'Mesclagem automática cancelada para {name}', + 'toast.autoMergeStale': '{name} tem novos commits; revise-os antes de ativar a mesclagem automática', + 'toast.autoMergeFailed': 'A mesclagem automática não foi alterada: {message}', 'toast.pathCopied': 'Caminho copiado', + 'toast.commandCopied': 'Comando copiado', 'toast.expandFailed': 'Não foi possível mostrar as linhas sem alterações: {message}', 'toast.expandStale': 'O arquivo mudou após a leitura das alterações; atualize antes de expandir', 'toast.prompted': 'Enviado: {text}', @@ -4574,6 +5087,9 @@ export const pt: Record = { 'reviewPage.search': 'Pesquise ou cole um link de solicitação de alteração', 'reviewPage.loading': 'Lendo as listas', 'reviewPage.refresh': 'Atualizar status', + 'reviewPage.copyLink': 'Copiar link', + 'reviewPage.copied': 'Copiado', + 'reviewPage.detailLoading': 'Lendo a solicitação de alteração', 'reviewPage.filter': 'Filtrar', 'reviewPage.filter.repository': 'Repositório', 'reviewPage.filter.allRepositories': 'Todos os repositórios', @@ -4585,18 +5101,16 @@ export const pt: Record = { 'reviewPage.empty.search': 'Nenhuma solicitação de alteração corresponde', 'reviewPage.truncated': 'Mais {count} não listadas', 'reviewPage.noHosts': 'Nenhum serviço de código lista solicitações de alteração', - 'reviewPage.noHostsHint': 'Ative o componente do GitHub para listar as solicitações de alteração que pedem sua revisão, que você criou e que envolvem você.', + 'reviewPage.noHostsHint': 'Ative o componente do GitHub ou do GitLab para listar as solicitações de alteração que pedem sua revisão, que você criou e que envolvem você.', 'reviewPage.signIn': 'Entre em {host} para listar suas solicitações de alteração', 'reviewPage.listFailed': 'Não foi possível ler a lista de {host}: {message}', 'reviewPage.streamFailed': 'A conexão da lista terminou', 'reviewPage.openUrl': 'Abrir {url}', - 'reviewPage.hint.rerequested': 'Você pediu alterações · Solicitado novamente', + 'reviewPage.hint.rerequested': 'Nova revisão solicitada', 'reviewPage.hint.team': 'Equipe {team}', 'reviewPage.hint.approvedByYou': 'Você aprovou', 'reviewPage.hint.changesRequested': 'Alterações solicitadas', 'reviewPage.hint.approved': 'Aprovada', - 'reviewPage.issuesMore': 'e mais {count}', - 'reviewPage.issuesMoreTruncated': 'e mais {count}+', 'reviewPage.countAria': '{count} solicitações de alteração aguardam sua revisão', 'reviewPage.select': 'Selecione uma solicitação de alteração', 'reviewPage.selectHint': 'Escolha uma na lista ou cole um link de solicitação de alteração na pesquisa.', @@ -4617,12 +5131,42 @@ export const pt: Record = { 'reviewPage.description': 'Descrição', 'reviewPage.descriptionEmpty': 'Sem descrição', 'reviewPage.descriptionFailed': 'Não foi possível ler a descrição: {message}', + 'reviewPage.activity': 'Atividade', + 'reviewPage.activity.empty': 'Ainda não há atividade', + 'reviewPage.activity.failed': 'Não foi possível ler a atividade: {message}', + 'reviewPage.activity.older': 'A atividade anterior não é exibida', + 'reviewPage.activity.commits': 'Commits: {count}', + 'reviewPage.activity.inline': 'Comentários em linha: {count}', + 'reviewPage.activity.viewInChanges': 'Ver em Alterações', + 'reviewPage.activity.approved': '{actor} aprovou estas alterações', + 'reviewPage.activity.changesRequested': '{actor} pediu alterações', + 'reviewPage.activity.commented': '{actor} revisou', + 'reviewPage.activity.dismissed': 'A revisão de {actor} foi descartada', + 'reviewPage.activity.merged': '{actor} fez o merge desta solicitação', + 'reviewPage.activity.closed': '{actor} fechou esta solicitação', + 'reviewPage.activity.reopened': '{actor} reabriu esta solicitação', + 'reviewPage.activity.readyForReview': '{actor} marcou como pronta para revisão', + 'reviewPage.activity.convertedToDraft': '{actor} converteu em rascunho', + 'reviewPage.activity.forcePushed': '{actor} forçou o push do branch', + 'reviewPage.activity.autoMergeEnabled': '{actor} ativou a mesclagem automática', + 'reviewPage.activity.autoMergeDisabled': '{actor} desativou a mesclagem automática', + 'reviewPage.activity.reviewRequested': '{actor} pediu uma revisão a {reviewer}', + 'reviewPage.activity.reviewRequestedUnnamed': '{actor} pediu uma revisão', + 'reviewPage.activity.renamed': '{actor} alterou o título de “{from}” para “{to}”', + 'reviewPage.activity.commentPlaceholder': 'Deixe um comentário', + 'reviewPage.activity.comment': 'Comentar', + 'reviewPage.activity.commentHint': 'Será publicado no {forge} · Suporta Markdown', + 'reviewPage.activity.commentHintPlain': 'Suporta Markdown', + 'reviewPage.activity.commenting': 'Publicando…', + 'reviewPage.activity.commentFailed': 'O comentário não foi publicado: {message}', 'reviewPage.status': 'Estado', 'reviewPage.requestReview': 'Solicitar revisão', 'reviewPage.showAll': 'Mostrar todos os {count}', 'reviewPage.notFound': 'A solicitação de alteração não existe ou você não tem acesso', - 'reviewPage.unrecognized': 'O DSH não reconhece o host deste link', - 'reviewPage.unrecognizedHint': 'Aqui só abrem hosts atendidos por um componente de serviço de código ativado.', + 'reviewPage.unrecognized': 'Serviço de código desconhecido', + 'reviewPage.unrecognizedHint': 'O host deste link não foi adicionado a nenhum componente de serviço de código.', + 'reviewPage.addHost': 'Adicionar host…', + 'reviewPage.hostSettings': 'Abrir configurações', 'reviewPage.loadFailed': 'Não foi possível ler a solicitação de alteração', 'reviewPage.markdown.copy': 'Copiar', 'reviewPage.markdown.copied': 'Copiado', diff --git a/packages/experimental/client-ui-forge/src/client/mount.ts b/packages/experimental/client-ui-forge/src/client/mount.ts index e75f34081d..ee1ec551a4 100644 --- a/packages/experimental/client-ui-forge/src/client/mount.ts +++ b/packages/experimental/client-ui-forge/src/client/mount.ts @@ -43,6 +43,9 @@ import { ChangesTabTitle } from './ChangesTabTitle.tsx' import { CheckoutRow, ConnectionRow, LocalChangesRow, type CheckoutRowInjected, type ConnectionRowInjected, type LocalChangesRowInjected, } from './EnvironmentRows.tsx' +import { HostSettings, type HostForge, type HostSettingsInjected } from './HostSettings.tsx' +import { HostSettingsForm, type HostSettings as HostSettingsFields } from './host-settings-form.ts' +import { HostSignInStates } from './host-sign-in.ts' import { de, en, es, fr, ja, NS, pt, ru, zh, type ForgePanelKey } from './locales.ts' import type { SessionListInjected } from './session-list.ts' import { SessionHoverForge } from './SessionHoverForge.tsx' @@ -60,12 +63,24 @@ import { WorktreeToggle, type WorktreeToggleInjected } from './WorktreeToggle.ts /** Services required before the Remote contribution mounts. */ export const inject = ['remote', 'slots', 'locale', 'sidebarRightTabs', 'sidebarRight', 'sessions', 'configForms', 'remoteAccess', 'workspaces', 'uiWorkspace'] +/** The Forge bundle, whose page on the Plugins page lists the rows below. */ +export const FORGE_BUNDLE = '@deepseek-ai/dsh-experimental-forge-bundle' + /** The worktree row of the Forge bundle, whose Plugins page carries the archive cleanup switch. */ -export const WORKTREE_ROW_KEY = '@deepseek-ai/dsh-experimental-forge-bundle#worktree' +export const WORKTREE_ROW_KEY = `${FORGE_BUNDLE}#worktree` /** The Loader entry id the worktree service's settings namespace follows. */ export const WORKTREE_NS = 'worktree' +/** + * The provider rows of the Forge bundle whose Plugins pages carry a host list. A row's id is also the Loader entry id + * its settings namespace follows. + */ +export const HOST_ROWS: readonly { readonly forge: HostForge; readonly row: string }[] = [ + { forge: 'github', row: 'forge-github' }, + { forge: 'gitlab', row: 'forge-gitlab' }, +] + /** * Open a URL in a new browsing context without giving it access to this page. * @param url - change request web URL. @@ -314,6 +329,10 @@ function registerUi(ctx: Context): void { reportAction(entry, await ctx.remote.forgePanel.merge(sessionId, entry.url, request.method, request.headSha), { done: 'toast.merged', stale: 'toast.mergeStale', failed: 'toast.mergeFailed' }) }, + autoMerge: async (entry, request) => { + reportAction(entry, await ctx.remote.forgePanel.setAutoMerge(sessionId, entry.url, request), + { done: request.enabled ? 'toast.autoMergeEnabled' : 'toast.autoMergeCancelled', stale: 'toast.autoMergeStale', failed: 'toast.autoMergeFailed' }) + }, rerunChecks: async (entry, request) => { reportAction(entry, await ctx.remote.forgePanel.rerunChecks(sessionId, entry.url, request), { done: 'toast.rerunRequested', stale: 'toast.rerunStale', failed: 'toast.rerunFailed' }) @@ -527,12 +546,35 @@ function registerUi(ctx: Context): void { }, SessionHoverForge)) registerReviewPage(ctx, { notices, settled, nameOf, openLink, copyText, copyPath, locale, quoteReview: addReviewToInput, quoteThread: addThreadToInput, + hostSettings: FORGE_BUNDLE, }) const worktreeSettings = new WorktreeSettingsForm(ctx.configForms.get(WORKTREE_NS)) ctx.effect(() => () => { worktreeSettings.dispose() }, 'forge-panel: worktree settings form') ctx.slots.inject('plugins.row.config', () => ctx.slots.register({ name: 'plugins.row.config', key: WORKTREE_ROW_KEY, locale: NS, inject: () => worktreeSettings.inject(), }, WorktreeSettings)) + const hostRows = HOST_ROWS.map(row => ({ ...row, scope: ctx.configForms.get(row.row) })) + for (const { forge, row, scope } of hostRows) { + // A host has one provider, so a row refuses the hosts the other rows serve now. + const taken = (): string[] => hostRows.flatMap(other => other.row === row ? [] : other.scope.getSnapshot().value?.hosts ?? []) + const form = new HostSettingsForm(scope, taken) + const signIn = new HostSignInStates((host, signal) => ctx.remote.forgePanel.hostReadiness(forge, host, signal)) + ctx.effect(() => () => { + form.dispose() + signIn.dispose() + }, `forge-panel: ${row} host settings`) + const { hooks, ...actions } = form.inject() + const face: HostSettingsInjected = { + ...actions, + hooks: { ...hooks, signIn: signIn.states }, + forge, + checkSignIn: (hosts, visibly) => { signIn.check(hosts, visibly) }, + copyCommand: (command) => { copy(command, 'toast.commandCopied') }, + } + ctx.slots.inject('plugins.row.config', () => ctx.slots.register({ + name: 'plugins.row.config', key: `${FORGE_BUNDLE}#${row}`, locale: NS, inject: () => face, + }, HostSettings)) + } } /** diff --git a/packages/experimental/client-ui-forge/src/client/review-page/ReviewActivity.tsx b/packages/experimental/client-ui-forge/src/client/review-page/ReviewActivity.tsx new file mode 100644 index 0000000000..3383ab73e0 --- /dev/null +++ b/packages/experimental/client-ui-forge/src/client/review-page/ReviewActivity.tsx @@ -0,0 +1,400 @@ +/** + * The summary tab's activity of one change request: its comments, submitted reviews, commits, and changes of state, + * oldest first, and the field that adds a comment. + */ + +import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react' +import clsx from 'clsx' +import { + Button, IconBranchOutlineRegular, IconCheckCircleOutlineRegular, IconChevronDownOutlineRegular, IconClockOutlineRegular, + IconCloseCircleFillRegular, IconEditOutlineRegular, IconEyeOutlineRegular, IconUserOutlineRegular, MarkdownText, ShortcutKeys, + type MarkdownLabels, +} from '@deepseek-ai/dsh-client-ui-primitives' +import type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots' +import type { ChangeRequestActivity, ForgeCommentAuthor, ReviewVerdict } from '@deepseek-ai/dsh-experimental-forge/types' +import type { RemoteResult } from '@deepseek-ai/dsh-typert-protocol' +import { assertNever } from '@deepseek-ai/dsh-util-values' +import { openOnLabel } from '../forge-copy.ts' +import { formatAgo } from '../format.ts' +import { ChangeRequestGlyph } from '../glyphs.tsx' +import type { NS } from '../locales.ts' +import { Avatar } from '../ReviewThreads.tsx' +import { activityEntries, longBody, type ActivityCommit, type ActivityEvent } from './review-activity.ts' +import { descriptionMarkdown } from './review-lists.ts' +import { ActivitySkeleton } from './ReviewSkeleton.tsx' +import css from './ReviewPage.module.css' + +type Translate = PropsLocale['t'] + +/** Stands for the actor's name in a translated sentence, so each locale keeps its word order around the name. */ +const ACTOR = '\u0000' + +/** Characters of a commit's object name a row shows. */ +const SHORT_SHA = 7 + +/** Props of the activity. */ +export interface ReviewActivityProps { + /** URL of the change request. */ + readonly url: string + /** A value that differs once the change request changed, after which the activity is read again. */ + readonly revision: string + /** Product name of the change request's code host, or null once its provider left. */ + readonly forge: string | null + /** Read the activity; null for a provider that reads none. */ + readonly read: (url: string, signal: AbortSignal) => Promise> + /** Add a comment to the conversation. */ + readonly comment: (url: string, body: string) => Promise> + /** Show the changes tab. */ + readonly onOpenChanges: () => void + /** Open a web page in the browser. */ + readonly openLink: (url: string) => void + /** Current epoch milliseconds for relative times. */ + readonly now: number + /** Localized labels of rendered Markdown. */ + readonly markdown: MarkdownLabels + /** Forge panel copy. */ + readonly t: Translate +} + +/** The latest read of one change request's activity. */ +interface ActivityRead { + readonly url: string + /** The activity, null for a provider that reads none, or undefined while no read of this URL succeeded. */ + readonly activity: ChangeRequestActivity | null | undefined + readonly failure: string | null +} + +/** + * The activity of one change request, read again when the change request changes; + * an earlier read stays while a later one fails. + */ +function useActivity(url: string, revision: string, read: ReviewActivityProps['read']): { + readonly activity: ChangeRequestActivity | null | undefined + readonly failure: string | null + readonly reload: () => void +} { + const [attempt, setAttempt] = useState(0) + const [state, setState] = useState(null) + useEffect(() => { + const controller = new AbortController() + void read(url, controller.signal).then((result) => { + if (controller.signal.aborted) return + setState(previous => result.ok + ? { url, activity: result.value, failure: null } + : { url, activity: previous?.url === url ? previous.activity : undefined, failure: result.error.message }) + }) + return () => { controller.abort() } + }, [url, revision, attempt, read]) + const current = state?.url === url ? state : null + return { activity: current?.activity, failure: current?.failure ?? null, reload: () => { setAttempt(value => value + 1) } } +} + +/** The glyph of a commit. */ +function CommitGlyph(): ReactNode { + return ( + + ) +} + +/** + * One line of the activity: a glyph, what happened, when, and what stands at its end. With `act` it is a button of that + * accessible name. + */ +function Line({ glyph, tone, text, at, end, nested = false, expanded, act, now, t }: { + readonly glyph: ReactNode + readonly tone?: 'success' | 'error' | undefined + readonly text: ReactNode + readonly at: string + readonly end?: ReactNode + readonly nested?: boolean + readonly expanded?: boolean | undefined + readonly act?: { readonly label: string; readonly run: () => void } | undefined + readonly now: number + readonly t: Translate +}): ReactNode { + const content = ( + <> + {glyph} + {text} + {formatAgo(at, now, t)} + {end !== undefined && {end}} + + ) + const className = clsx(css.activityLine, nested && css.activityNested) + return act === undefined + ?
    {content}
    + : ( + + ) +} + +/** A translated sentence with the actor's name set apart from the rest. */ +function sentence(text: string, actor: ForgeCommentAuthor | null, t: Translate): ReactNode { + const [before, ...after] = text.split(ACTOR) + const name = actor?.login ?? t('thread.deletedAuthor') + return <>{before}{name}{after.join('')} +} + +/** One commit: its title, its time, and the start of its object name. */ +function CommitLine({ commit, nested, now, t }: { + readonly commit: ActivityCommit + readonly nested: boolean + readonly now: number + readonly t: Translate +}): ReactNode { + return ( + } text={nested ? commit.title : {commit.title}} at={commit.at} + nested={nested} end={{commit.sha.slice(0, SHORT_SHA)}} now={now} t={t} /> + ) +} + +/** A run of commits: one commit as its own line, several as a line that unfolds them. */ +function Commits({ commits, now, t }: { + readonly commits: readonly [ActivityCommit, ...ActivityCommit[]] + readonly now: number + readonly t: Translate +}): ReactNode { + const [open, setOpen] = useState(false) + const [first, ...later] = commits + const last = later.at(-1) + if (last === undefined) return + const count = t('reviewPage.activity.commits', { count: commits.length }) + return ( + <> + } text={{count}} + at={last.at} expanded={open} act={{ label: count, run: () => { setOpen(!open) } }} now={now} t={t} + end={} /> + {open && commits.map(commit => )} + + ) +} + +/** A comment's author, time, and text; a long text starts cut short. */ +function CommentCard({ actor, at, body, now, markdown, t }: { + readonly actor: ForgeCommentAuthor | null + readonly at: string + readonly body: string + readonly now: number + readonly markdown: MarkdownLabels + readonly t: Translate +}): ReactNode { + const long = longBody(body) + const [open, setOpen] = useState(false) + const text = useMemo(() => descriptionMarkdown(body, {}), [body]) + return ( +
    +
    + + {actor?.login ?? t('thread.deletedAuthor')} + {actor?.bot === true && {t('thread.bot')}} + {formatAgo(at, now, t)} +
    +
    + +
    + {long && ( + + )} +
    + ) +} + +/** The glyph, tone, and sentence of a submitted review's decision. */ +function verdictLine(verdict: ReviewVerdict, t: Translate): { + readonly glyph: ReactNode + readonly tone: 'success' | 'error' | undefined + readonly text: string +} { + const actor = { actor: ACTOR } + switch (verdict) { + case 'approved': + return { glyph: , tone: 'success', text: t('reviewPage.activity.approved', actor) } + case 'changes-requested': + return { glyph: , tone: 'error', text: t('reviewPage.activity.changesRequested', actor) } + case 'commented': + return { glyph: , tone: undefined, text: t('reviewPage.activity.commented', actor) } + case 'dismissed': + return { glyph: , tone: undefined, text: t('reviewPage.activity.dismissed', actor) } + /* v8 ignore next -- closed ReviewVerdict union exhaustiveness guard */ + default: return assertNever(verdict, 'ReviewVerdict') + } +} + +/** One activity item other than a commit. */ +function Event({ item, onOpenChanges, now, markdown, t }: { + readonly item: ActivityEvent + readonly onOpenChanges: () => void + readonly now: number + readonly markdown: MarkdownLabels + readonly t: Translate +}): ReactNode { + const line = (glyph: ReactNode, text: string): ReactNode => ( + + ) + switch (item.kind) { + case 'comment': + return + case 'review': { + const { glyph, tone, text } = verdictLine(item.verdict, t) + // A review that left comments on lines or files opens the changes tab, where they show. + const inline = item.comments === 0 ? undefined : { + text: `${text} · ${t('reviewPage.activity.inline', { count: item.comments })}`, open: t('reviewPage.activity.viewInChanges'), + } + const name = item.actor?.login ?? t('thread.deletedAuthor') + return ( + <> + + {item.body.trim() !== '' && } + + ) + } + case 'merged': return line(, t('reviewPage.activity.merged', { actor: ACTOR })) + case 'closed': return line(, t('reviewPage.activity.closed', { actor: ACTOR })) + case 'reopened': return line(, t('reviewPage.activity.reopened', { actor: ACTOR })) + case 'ready-for-review': return line(, t('reviewPage.activity.readyForReview', { actor: ACTOR })) + case 'converted-to-draft': + return line(, t('reviewPage.activity.convertedToDraft', { actor: ACTOR })) + case 'force-pushed': return line(, t('reviewPage.activity.forcePushed', { actor: ACTOR })) + case 'auto-merge-enabled': + return line(, t('reviewPage.activity.autoMergeEnabled', { actor: ACTOR })) + case 'auto-merge-disabled': + return line(, t('reviewPage.activity.autoMergeDisabled', { actor: ACTOR })) + case 'review-requested': + return line(, item.reviewer === null + ? t('reviewPage.activity.reviewRequestedUnnamed', { actor: ACTOR }) + : t('reviewPage.activity.reviewRequested', { actor: ACTOR, reviewer: item.reviewer })) + case 'renamed': + return line(, t('reviewPage.activity.renamed', { actor: ACTOR, from: item.from, to: item.to })) + case 'other': return line(, `${ACTOR} ${item.text}`) + /* v8 ignore next -- closed ChangeRequestActivityItem kind union exhaustiveness guard */ + default: return assertNever(item, 'ChangeRequestActivityItem.kind') + } +} + +/** + * The keys that send a comment, as the shortcut reference labels them: Command with Enter on Apple platforms, Control + * with Enter elsewhere. The desktop shell names the platform on the document; a browser names it itself. + */ +function sendKeys(): readonly string[] { + const platform = document.documentElement.dataset['platform'] ?? navigator.platform + return /darwin|mac|iphone|ipad/iu.test(platform) ? ['⌘', 'Enter'] : ['Ctrl', '+', 'Enter'] +} + +/** + * The field that adds a comment: three lines that grow with the text, over a row that says where the comment goes and + * holds the button that sends it. It keeps its text until the host saved the comment, and says why one was not saved. + */ +function Composer({ url, forge, comment, onPosted, t }: { + readonly url: string + readonly forge: string | null + readonly comment: ReviewActivityProps['comment'] + readonly onPosted: () => void + readonly t: Translate +}): ReactNode { + const [text, setText] = useState('') + const [busy, setBusy] = useState(false) + const [error, setError] = useState(null) + const field = useRef(null) + const keys = useMemo(sendKeys, []) + // The field is as tall as its text, between the heights its style allows. + useEffect(() => { + const element = field.current + element?.style.setProperty('height', 'auto') + element?.style.setProperty('height', `${element.scrollHeight}px`) + }, [text]) + // One comment is sent at a time; the field stays focused and read-only meanwhile. + const post = async (): Promise => { + if (busy || text.trim() === '') return + setBusy(true) + setError(null) + const result = await comment(url, text) + setBusy(false) + if (result.ok) { + setText('') + onPosted() + } else if (result.error.code === 'forgePanel/action-unknown' && forge !== null) { + setError(t('review.unknown', { forge })) + } else { + setError(t('reviewPage.activity.commentFailed', { message: result.error.message })) + } + } + return ( +
    +
    +