-
Notifications
You must be signed in to change notification settings - Fork 229
[4/4] feat(settings): add commit message model picker #1230
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
7b5b435
2e6f3a3
5134ec8
a3170c4
c7ecfea
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 |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // npx vitest run src/__tests__/types.test.ts | ||
|
|
||
| import { contributesSchema } from "../types.js" | ||
|
|
||
| describe("contributes commands schema", () => { | ||
| // Reached through `.shape` so this stays focused on the icon field, without needing a whole | ||
| // valid `contributes` object around it. | ||
| const commandsSchema = contributesSchema.shape.commands | ||
|
|
||
| const command = (icon: unknown) => [ | ||
| { command: "zoo-code.generateCommitMessage", title: "%command.generateCommitMessage.title%", icon }, | ||
| ] | ||
|
|
||
| it("accepts a codicon reference", () => { | ||
| expect(commandsSchema.safeParse(command("$(edit)")).success).toBe(true) | ||
| }) | ||
|
|
||
| // The Source Control button ships a PNG per theme rather than a codicon. This field used to | ||
| // allow only a string, which rejected the manifest outright when generating the nightly build. | ||
| it("accepts a pair of theme-specific icon paths", () => { | ||
| const icon = { light: "assets/icons/panel_light.png", dark: "assets/icons/panel_dark.png" } | ||
|
|
||
| expect(commandsSchema.safeParse(command(icon)).success).toBe(true) | ||
| }) | ||
|
|
||
| it("rejects an icon pair that is missing a theme", () => { | ||
| expect(commandsSchema.safeParse(command({ light: "assets/icons/panel_light.png" })).success).toBe(false) | ||
| }) | ||
| }) |
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Expose and test
commitMessageTimeoutin both state paths.Lines 1229-1268 only test
commitMessageApiConfigId. The suppliedClineProvider.getStateToPostToWebview()code destructurescommitMessageApiConfigIdbut notcommitMessageTimeout. A saved value such as120can be lost from webview state, display as60, and be overwritten on the next Settings save.Add
commitMessageTimeoutto the state assembly and test saved and unset values forgetState()andgetStateToPostToWebview().Based on learnings: “Add settings to both the destructuring and returned object in
ClineProvider.getStateToPostToWebview()so saved controls do not revert visually.”🤖 Prompt for AI Agents
Source: Learnings