Skip to content

feat(ui): prefill MCP instructions default + Reset-to-default button (MCP-2484)#686

Closed
Dumbris wants to merge 1 commit into
mainfrom
fix/mcp-2484-instructions-prefill
Closed

feat(ui): prefill MCP instructions default + Reset-to-default button (MCP-2484)#686
Dumbris wants to merge 1 commit into
mainfrom
fix/mcp-2484-instructions-prefill

Conversation

@Dumbris

@Dumbris Dumbris commented Jun 15, 2026

Copy link
Copy Markdown
Member

Summary

Frontend-only UX fix for Settings → "MCP server instructions" (MCP-2484).

Previously the textarea's editable VALUE was the config instructions field (empty on a fresh install) and the built-in default was shown only as a placeholder — a user wanting to tweak/append the default had to retype the whole thing.

Changes

  1. Prefill the editable value with the live default_instructions (from /api/v1/status) when the saved instructions is empty. Handles either load order (config vs. default request) plus a watch so a late-arriving default still prefills. Never overwrites a non-empty saved value.
  2. Compact "Reset to default" button next to the instructions textarea (shown only once the default has loaded) that repopulates the field from the live default. It flows through the normal change path, so the section marks it dirty and Save persists it as instructions.

Prefilling-then-saving "freezes" the current default into config.instructions (intended per the request); the Reset button is the re-sync path. No backend change — the backend already exposes the resolved default.

Verification

  • npx vitest run175 passed (incl. 4 new SettingField reset-button tests + existing instructions tests).
  • npm run type-check (vue-tsc) → clean.
  • make build → frontend embed + Go binaries green.

Test plan (added unit coverage)

  • Reset button renders only when resetDefault is injected (async default loaded); hidden otherwise.
  • Clicking Reset emits the default text through the change path.
  • Existing empty-means-default / whitespace-collapse behavior preserved.

⚠️ Note for reviewers/CEO: a concurrent stuck agent run (session 443647fa, no Paperclip checkout) was re-saving the same implementation into the original mcp-2484-instructions-prefill worktree without ever committing. This PR was produced in an isolated clean worktree by the legitimate Paperclip checkout owner to avoid the race. If that run later opens a duplicate PR, close one.

Related #MCP-2484

…(MCP-2484)

The Settings "MCP server instructions" textarea previously showed the
built-in default only as a placeholder; its editable VALUE was the (empty
on a fresh install) config `instructions` field, forcing users who just
want to tweak the default to retype the whole thing.

- Prefill the editable value with the live `default_instructions` (from
  /api/v1/status) when the saved `instructions` is empty. Handles either
  load order (config vs default) and a `watch` so a late default still
  prefills. Never overwrites a non-empty saved value.
- Add a compact "Reset to default" button next to the instructions
  textarea (shown only once the default has loaded) that repopulates the
  field from the live default; it flows through the normal change path so
  Save persists it as `instructions`.

Frontend-only — the backend already exposes the resolved default.

Related #MCP-2484
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mcpproxy-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: eef91ce
Status: ✅  Deploy successful!
Preview URL: https://475cbf69.mcpproxy-docs.pages.dev
Branch Preview URL: https://fix-mcp-2484-instructions-pr.mcpproxy-docs.pages.dev

View logs

@Dumbris

Dumbris commented Jun 15, 2026

Copy link
Copy Markdown
Member Author

Closing as a duplicate of #685 (same MCP-2484 frontend change, created ~5 min earlier and board-announced). #685 is the canonical PR: fuller implementation (whitespace-aware isBlankInstructions(), dual-trigger prefill + watcher) with CI nearly all green. This branch (fix/mcp-2484-instructions-prefill) was opened by a sibling run on the same issue; consolidating on #685 to avoid divergence.

@Dumbris Dumbris closed this Jun 15, 2026
@Dumbris Dumbris deleted the fix/mcp-2484-instructions-prefill branch June 15, 2026 11:52
@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

2 participants