Skip to content

feat(settings): edit base instructions with the shared editor - #4144

Draft
tellaho wants to merge 2 commits into
mainfrom
tho/pr-3887-merge
Draft

tellaho wants to merge 2 commits into
mainfrom
tho/pr-3887-merge

Conversation

@tellaho

@tellaho tellaho commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Category improvement

User Impact You can browse the instructions Buzz gives agents, edit a section in place, or restore its built-in text.

Problem Reading a default and editing it are separate steps in Settings. Saving changes across the full form makes it harder to tell which section is being updated.

Solution Show the base prompt in prompt order using the shared popout accordion from #4125. Each editable section has a bounded editor, its own Save and Cancel actions, and an Options menu for Enable, Disable, and Set to default instruction. Reuse the shared Markdown editor and show source when formatting would change the original text.

This follows #3887, which added default text previews.

File changes

docs/buzz-help.md
Describe reading, editing, and restoring a section from Agent setup.

src/app/AgentSettings.test.tsx
Exercise the Base instructions disclosure from Agent setup.

src/features/agents/BaseInstructions.module.css
Style the preview fade, section label transition, and bounded reading area.

src/features/agents/BaseInstructions.test.tsx
Cover draft handling, source fidelity, section choices, and reopening Settings during a save.

src/features/agents/BaseInstructions.tsx
Render the base prompt in order and keep each section’s editing and persistence actions together.

src/features/agents/prompt-sections.test.ts
Verify that a synchronous storage failure clears the pending write.

src/features/agents/prompt-sections.ts
Ensure a synchronous storage failure follows the existing write cleanup path.

src/features/messages/DocumentEditor.module.css
Give the shared editor a bounded field presentation for Settings forms.

src/features/messages/DocumentEditor.tsx
Reuse the editor’s Markdown and draft handling in a compact, labelled field.

src/features/messages/document-editor-markdown.ts
Load nested inline formatting without duplicating editor marks.

src/features/messages/document-editor-markdown.test.ts
Exercise recursive bold, italic, and strikethrough through the shared parser.

tests/browser/settings-layout.spec.mjs
Exercise the shared popout, editor, keyboard focus, formatting, and scroll behavior in Settings.

Try it

  1. Open Settings → Agent setup → Base instructions. Select Show all, then open Etiquette.
  2. Edit the text and select Save. Confirm the first change and check for the Modified status.
  3. Open Options → Set to default instruction. Review the replacement in the editor, then save it. Hover the disabled menu item to see Already set.
  4. Use Options → Disable, then Enable. The text remains visible while the section is disabled.

Preview

Base instructions editor in dark mode

demo.mp4

@tellaho

tellaho commented Nov 20, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Review follow-up

  • Opening an instruction with nested bold, italic, or strikethrough could throw during Markdown parsing. Commit a8dd4e3 builds a deduplicated set of formatting marks before validating the document.
  • Parser tests cover all three formatting cases. A Base Instructions test edits and saves the exact Markdown source, and an independent rerun confirmed the nested cases pass in lists and quotes as well.

tellaho and others added 2 commits November 23, 2026 10:31
Show the base prompt in a browsable list and put text editing and section actions together. Preserve source when the rich editor cannot round-trip it, and keep the last committed choices visible while a save is pending.

Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@feedback.communities.buzz.xyz>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>
Use the editor schema mark set for recursive formatting. Compact fields can then fall back to the exact source when the rich representation normalizes redundant marks.

Co-authored-by: Rizz <302abe414ca6e3134763d2539bfcf145aea2a63fe5f8455204ed602fd40cf381@feedback.communities.buzz.xyz>
Co-authored-by: Carl <acda9e433d19dcd0e6b6840f7f4b98f3a56f1fab98049d444c087019e6d36560@feedback.communities.buzz.xyz>
Signed-off-by: Taylor Ho <taylorkmho@gmail.com>

This branch has not been deployed

No deployments
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