Skip to content

feat(desktop): customizable code-suggestion output (spec + layout)#197

Merged
huhamhire merged 1 commit into
devfrom
feat/code-suggestion-template
Jul 5, 2026
Merged

feat(desktop): customizable code-suggestion output (spec + layout)#197
huhamhire merged 1 commit into
devfrom
feat/code-suggestion-template

Conversation

@huhamhire

Copy link
Copy Markdown
Owner

What

Two optional settings under Settings → Agent → Strategy that control how AI code suggestions read and how they land in a review-draft comment. Both default to empty and are edited in a shared nested modal.

code_suggestion_spec — LLM soft constraint

Free-text guidance injected as extra_instructions for /improve, /review and /ask (via buildExtraInstructions; /improve & /review through the env key, /ask spliced into the question). Shapes each suggestion's structure (e.g. Problem / Analysis / Suggestion). /describe is excluded. The model generally complies but it is not guaranteed.

code_suggestion_layout — deterministic template

A markdown template applied when a suggestion finding becomes a review-draft comment (exact substitution, no model dependency). Placeholders:

Placeholder Value
<TITLE> Localized "AI suggestion" label
<SUGGESTIONS> The suggestion body
<HOME> Project website
<PR> Current PR link
<MODEL> Current active model name

If the layout contains <SUGGESTIONS> it is the full comment body; otherwise it is prepended as a prefix. Empty falls back to a new default layout[<TITLE>](<HOME>) (<MODEL>) on its own line above the body — replacing the previous plain [AI suggestion] prefix.

Notes

  • Home URL consolidated: introduces a single PRODUCT_HOME_URL constant in @meebox/shared (source of truth for the <HOME> placeholder and the About-page link, which was previously hardcoded). DEFAULT_CODE_SUGGESTION_LAYOUT lives there too, so the settings editor placeholder equals the actual default by construction.
  • Injection points: packages/pr-agent-bridge/src/prompts.ts (spec directive) + run-executor.ts (main); chat/utils/findings.ts renderCodeSuggestionDraft + useChatActions (layout).
  • i18n: all four locales (en-US / zh-CN / ja-JP / de-DE).
  • Docs: config-reference guide (EN canonical + ZH mirror) and CHANGELOG (EN + ZH) updated.

Verification

lint, typecheck, test (packages), and desktop build all pass locally.

🤖 Generated with Claude Code

Add two optional settings under Settings → Agent → Strategy that control
how AI code suggestions are written and how they land in a review-draft
comment:

- code_suggestion_spec: free-text guidance injected as extra_instructions
  for /improve, /review and /ask to shape each suggestion's structure
  (e.g. Problem / Analysis / Suggestion). A soft constraint the model
  generally follows; /describe is excluded.
- code_suggestion_layout: a deterministic markdown template for the draft
  comment, with <TITLE> / <SUGGESTIONS> / <HOME> / <PR> / <MODEL>
  placeholders. If it contains <SUGGESTIONS> it is the full body,
  otherwise it is prepended as a prefix. Empty falls back to a default
  layout (a linked "AI suggestion" label + model name above the body),
  replacing the previous plain "[AI suggestion]" prefix.

Both are edited in a shared nested modal (textarea, placeholder shows the
actual default). The project home URL is consolidated into a single
PRODUCT_HOME_URL constant in @meebox/shared, also used by the About page.
i18n added for all four locales; config-reference guide (EN + ZH) and
CHANGELOG (EN + ZH) updated.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@huhamhire huhamhire added the enhancement New feature or request label Jul 5, 2026
@huhamhire huhamhire merged commit 0aa0703 into dev Jul 5, 2026
3 checks passed
@huhamhire huhamhire deleted the feat/code-suggestion-template branch July 5, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant