Skip to content

feat(desktop): streamline preset creation, prompt modes and custom icons - #142

Merged
SivanCola merged 5 commits into
mainfrom
codex/preset-create-custom-icons
Nov 2, 2026
Merged

SivanCola merged 5 commits into
mainfrom
codex/preset-create-custom-icons

Conversation

@SivanCola

@SivanCola SivanCola commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Add a separated New agent preset… action to the composer menu, opening the existing form directly with keyboard support.
  • Suggest valid IDs from names, avoiding reserved IDs and collisions in the selected scope. Manual edits stop name tracking; existing IDs stay fixed. Non-Latin names receive a deterministic preset-… fallback.
  • Present built-in icons in a grid with a color palette and Random / Upload actions. Upload PNG/JPEG/WebP, preview and adjust a square crop, replace the image or restore defaults. Embed the 128 × 128 PNG in the preset so copies do not depend on the original file.
  • Use the same icon and color in the editor, list, picker and composer; fall back to a glyph on image failure. Bound and validate image/color data, cancel stale uploads safely, and exclude display metadata from runtime fingerprints.
  • Replace overlapping prompt controls with three mutually exclusive modes: extend default instructions, replace coding instructions, or supply the complete system prompt. Body labels and required validation follow the mode while preserving the existing YAML semantics.
  • Move runtime context into collapsed Advanced settings. Use accessible switches for runtime context and tool restrictions; retain selected tools and prompt text across toggles. Rename description to Summary (optional) and keep one concise save-effect notice.

Verification

  • CI follow-up: route upload failures through ErrorMessage, close replacement controllers before the hot-rebuild fixture removes its temporary store, and guard icon lookup against inherited object keys (including constructor).
  • Full frontend CI runner passed all 505 commands. The hot-rebuild fixture passed 20 consecutive runs; browser preset flows, frontend typecheck, root lint and Desktop lint passed. After syncing main, preset UI, error-display and provider catalog/model-switcher regression checks plus the production build passed.
  • Frontend production build passed: hook lint, CSS/theme contracts, TypeScript and bundle budgets.
  • Preset serialization/mock and UI tests passed, including ID generation/manual edits, creation navigation, mode validation, legacy/edit/copy persistence and image fallback.
  • Chromium bench/agent-presets.mjs passed: keyboard creation and switches, all prompt modes, dynamic body requirements, advanced disclosure, crop/save/list/picker readback, upload validation, cancel/reset, stale decode, color save/copy and random selection. Inspected standard and 800px layouts.
  • composer-menu-viewport (4 checks), ci-contract (2 checks), and test TypeScript check passed.
  • go test ./internal/agentpreset and focused agent preset tests in ./internal/boot, ./internal/control and the separate Desktop module passed.
  • make lint passed: zero golangci-lint issues and clean repolint.
  • Regenerated the Desktop contract and checked a fresh generation for drift.
  • Updated native Electron smoke locators for the new controls; native smoke execution was not part of this validation.

Documentation and compatibility

Updated both preset guides and Chinese/English copy. Adds optional icon-image / icon-color YAML fields and iconImage / iconColor DTO fields. Existing glyph-only presets and prompt/tool flags retain their format. Older hosts/CLIs reject unfamiliar YAML fields and must be updated before sharing image/color presets.

Input images: PNG/JPEG/WebP, up to 5 MB and 8192 × 8192 pixels. Stored images: square PNG, up to 128 KiB and 128 × 128 pixels. Colors: validated six-digit hex values.

Cache-impact: none; icon/image/color metadata is display-only and stripped from runtime fingerprints. The prompt-mode UI maps to the existing prompt/tool fields.
Cache-guard: TestAgentPresetIconsDoNotChangeRuntimeFingerprintOrPrompt; focused agent preset boot/control tests.
System-prompt-review: no provider-visible prompt construction changes.

Related issues

None.

@SivanCola SivanCola changed the title feat(desktop): add preset creation shortcut, custom icons and suggested IDs feat(desktop): streamline preset creation, prompt modes and custom icons Nov 2, 2026
@SivanCola
SivanCola merged commit f1c0977 into main Nov 2, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant