Repository navigation
feat(scm): add generate commit message action to the Source Control view #2306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
473e0af
ce2e38c
c03fcdd
fef189b
b1d43b3
2c957db
0b58879
9c6b0ae
7a778b3
d5928a8
35c09ab
9f22164
9b5825a
8d16bd3
0ff66cd
775623e
81511ac
cbbe298
bcb3008
0c1a8bb
366d15c
cf0002c
116596d
d7d0649
fcdd857
e2bed66
ba62e5c
0521c56
437392b
b0c62a5
d44cdc8
dbeefd2
21ad363
5313531
9475ceb
edd0cd8
6f4a42b
4d99c33
183e3cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,9 @@ | ||
| import { execFile } from "child_process" | ||
| import fs from "fs/promises" | ||
| import { readFileSync } from "fs" | ||
| import os from "os" | ||
| import path from "path" | ||
| import { promisify } from "util" | ||
|
|
||
| import { LLMock } from "@copilotkit/aimock" | ||
| import { _electron, expect, type ElectronApplication, type Page, type TestInfo } from "@playwright/test" | ||
|
|
@@ -18,10 +20,26 @@ export const vscodeVersion = packageJson.devDependencies["@types/vscode"] | |
|
|
||
| const CHAT_PROMPT = "electron-visual-smoke: render a deterministic completion" | ||
| export const CHAT_RESULT = "Electron visual smoke response rendered inside the real VS Code webview." | ||
| export const SCM_ACTION_TITLE = "Generate Commit Message (Zoo Code)" | ||
|
|
||
| const execFileAsync = promisify(execFile) | ||
|
|
||
| /** | ||
| * Makes the workspace a Git repository with one staged file, so the Source Control view shows the | ||
| * Git provider and its title actions. The branch name, author, and file are fixed for a stable scene. | ||
| */ | ||
| async function initGitWorkspace(workspacePath: string) { | ||
| const git = (...args: string[]) => execFileAsync("git", args, { cwd: workspacePath }) | ||
| await git("init", "--initial-branch=main") | ||
| await git("config", "user.name", "Zoo Code Visual") | ||
| await git("config", "user.email", "[email protected]") | ||
| await fs.writeFile(path.join(workspacePath, "notes.md"), "# Notes\n", "utf8") | ||
| await git("add", "notes.md") | ||
| } | ||
|
|
||
| export interface VisualScenario { | ||
| name: string | ||
| scene: "welcome" | "chat" | ||
| scene: "welcome" | "chat" | "scm" | ||
| themeId: "Default Dark Modern" | "Default High Contrast" | ||
| landmark: string | ||
| webviewSnapshot?: string | ||
|
|
@@ -105,6 +123,9 @@ export async function startScene( | |
| for (const result of directories) { | ||
| if (result.status === "rejected") throw result.reason | ||
| } | ||
| if (scenario.scene === "scm") { | ||
| await initGitWorkspace(workspacePath) | ||
| } | ||
| if (scenario.startMock) { | ||
| mock = new LLMock({ port: 0 }) | ||
| mock.addFixture({ | ||
|
|
@@ -147,6 +168,7 @@ export async function startScene( | |
| ROO_CODE_VISUAL_READY_PATH: readyPath, | ||
| ROO_CODE_VISUAL_SCENE: scenario.scene, | ||
| ROO_CODE_VISUAL_THEME: scenario.themeId, | ||
| ROO_CODE_VISUAL_SCM_ACTION_TITLE: SCM_ACTION_TITLE, | ||
| ROO_CODE_THEME_FIXTURE_PROBE: "1", | ||
| }, | ||
| locale: "en-US", | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.