feat(ui): prefill MCP instructions default + Reset-to-default button (MCP-2484)#685
Conversation
- Export isBlankInstructions() from fields.ts for whitespace-aware blank check - Add resetDefault?: string to SettingField interface - SettingField.vue: render compact Reset button when field.resetDefault is set - Settings.vue: inject resetDefault + updated placeholder from /api/v1/status into the instructions field; maybePrefillInstructions() uses isBlankInstructions so whitespace-only saved values also get prefilled - Dual-trigger prefill: runs from loadConfig() and loadDefaultInstructions() completion + watcher so whichever resolves last wins - 9 new unit tests in instructions-prefill.spec.ts (all passing) - All 186 frontend tests pass Co-Authored-By: Paperclip <noreply@paperclip.ing>
Deploying mcpproxy-docs with
|
| Latest commit: |
e147de8
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://590cbfe1.mcpproxy-docs.pages.dev |
| Branch Preview URL: | https://mcp-2484-instructions-prefil.mcpproxy-docs.pages.dev |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
📦 Build ArtifactsWorkflow Run: View Run Available Artifacts
How to DownloadOption 1: GitHub Web UI (easiest)
Option 2: GitHub CLI gh run download 27546045832 --repo smart-mcp-proxy/mcpproxy-go
|
|
codex review (gpt-5.5, in-checkout) → REQUEST_CHANGES. Async prefill, non-overwrite, and Reset (live default) all look correct — but the core "Save persists the text" requirement is not met:
Fix: when prefilling the default into the textarea, also mark |
…2484) Codex REQUEST_CHANGES on #685: maybePrefillInstructions() writes the built-in default straight onto state.working, but SettingsSection only PATCHed its locally-tracked dirty keys (set via onChange). A user who opened Settings and clicked Save without editing kept nothing. Derive dirtiness in SettingsSection from working != original (union with the explicit onChange-tracked dirty ref), so any value set outside a control — notably the instructions prefill — is treated as dirty and saved. Reset already worked (it goes through onChange); user edits and discard/save semantics are unchanged. - frontend/tests/unit/settings-section-prefill-dirty.spec.ts: prefilled value (working!=original) is dirty, Save PATCHes instructions, clears after save; equal working/original stays non-dirty. - specs/060-settings-page/verification/instructions-prefill-persist.spec.ts: Playwright — fresh install, Save-without-editing persists, survives reload, Reset repopulates. All 185 frontend unit tests pass; vue-tsc clean; Playwright green.
Codex REQUEST_CHANGES addressed — pushed to this branch (e147de8)Finding: Fix (frontend-only, Verification
Acceptance criteria from the review (prefill-then-Save persists; existing edit/Reset/no-overwrite scenarios still pass) are all covered. |
There was a problem hiding this comment.
Claude Code review ACCEPT (codex out of quota until ~4:34 PM → Claude-reviewer fallback). Round-2 fix derives field dirtiness from working!==original in SettingsSection, so the prefilled default is savable on Save-without-editing; non-overwrite + async-arrival hold; Reset works; no spurious dirtiness on other fields. 185 frontend unit tests pass. Windows Unit Tests failure is the known non-required internal/runtime flake.
Conflict from #685 (instructions prefill) + #681 (telemetry serialization) landing on main while this branch was in review. Resolved Settings.vue: - imports: union of watch (prefill) + nextTick/useRoute (banner focus deep-link) - onMounted: keep #685's watch(defaultInstructions) prefill trigger, use this branch's async onMounted for the focus query-param handling, drop the duplicate loadConfig() (body already awaits loadConfig()). Verified: 14 settings unit tests pass (instructions-prefill + prefill-dirty). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The three rapid-based property tests (TestRapidQuarantineStateMachine, TestRapidInvariant_ChangedNeverAutoApproved, TestRapidInvariant_PendingNeverAutoApproved) each create and tear down hundreds of BBolt-backed Runtimes per rapid.Check run. Under -race they take several minutes; on Windows the slower file IO/timers push them past the 5m package timeout of the Unit Tests (windows-latest) job, which runs 'go test -race -timeout 5m ./...' without -short. This produced flaky 'panic: test timed out after 5m0s' reds in internal/runtime unrelated to any PR change (#675, #685, #684). The existing testing.Short() guards never fire because the job omits -short. Add a documented Windows skip (mirroring apply_config_restart_test.go) to the offending tests only. The invariants they assert are platform-independent, so Linux/macOS coverage plus the dedicated heavy-runtime CI job is sufficient. The global timeout is left untouched. Related #MCP-2493
What
instructionstextarea with the built-in default (from/api/v1/status → default_instructions) when the user hasn't saved a custom value yet (fresh install / blank field)Why
Fresh installs showed an empty textarea with no hint of what the built-in instructions look like. Users had no way to restore the default after clearing it.
How
fields.tsresetDefault?: stringto theSettingFieldinterfaceisBlankInstructions(v)helper — treatsnull/undefined/empty/whitespace as blank (eligible for prefill)SettingField.vuetextareacontrol block: render a compact↩ Reset to defaultbutton whenfield.resetDefaultis set; hidden until the async default resolves (noundefinedflash)resetDefaultthrough the normalupdate:modelValuepath so the section tracks it dirty and Save persists itSettings.vueadvancedAccordionscomputed: injectsplaceholderandresetDefaultfromdefaultInstructionsinto the instructions fieldmaybePrefillInstructions(): usesisBlankInstructionsso whitespace-only saved values also get prefilledloadConfig()completion andloadDefaultInstructions()completion + a watcher ondefaultInstructions— whichever resolves last triggers prefillTests
frontend/tests/unit/instructions-prefill.spec.tsGuard: never overwrite saved value
maybePrefillInstructionsonly runs whenisBlankInstructions(state.working.instructions)— a saved custom value is never touched.Closes MCP-2484