fix(desktop): add instruction-file create action in memory settings#3969
fix(desktop): add instruction-file create action in memory settings#3969GTC2080 wants to merge 1 commit into
Conversation
|
Reviewed — well-scoped, the SaveDoc/allowedDocPaths boundary is respected, locales + regression test included. The only blocker is mechanical: #3962 (yours!) appended its test to the same package.json test-script lines, so this now conflicts there. Rebase onto current main-v2 — should be a one-line resolution — and I'll merge. |
SivanCola
left a comment
There was a problem hiding this comment.
Requesting changes for two blockers:
-
The new docs-tab "Add instruction file" flow can overwrite an existing instruction file. The button is rendered regardless of whether docs already exist, defaults to the project scope, and
activeDocTargetcomes fromview.scopes. For a scope that already has a REASONIX/AGENTS/CLAUDE doc,DocPathreturns that existing file, thensubmitDoccallsapp.SaveDoc(activeDocTarget.path, trimmed).SaveDocis overwrite semantics, so a user can click Add and replace an existing project or global instruction file with the new draft. Please only expose true creation targets for scopes without an existing doc, or make this an explicit edit/replace flow with the existing body prefilled or confirmed, and add behavior coverage for the existing-doc case. -
The branch is stale against current
main-v2and cannot merge cleanly.merge-treereports conflicts indesktop/frontend/package.json,MemoryPanel.tsx,en.ts,zh.ts, andstyles.css. Currentmain-v2has the newer Memory settings structure with saved/archived/docs/suggestions tabs, storage controls, and additional frontend tests, so this fix needs to be replayed onto that UI rather than keeping the old two-tab page/test list.
Verification run locally on PR head: pnpm install --frozen-lockfile, wails generate module, pnpm exec tsx src/__tests__/memory-settings-docs.test.ts, and pnpm exec tsc --noEmit -p tsconfig.test.json. The added string-based test passes, but it does not exercise the overwrite path above.
fb157ed to
06a978b
Compare
|
Updated in 06a978b. Changes:
Verification:
|
Repro (#3901): open Settings → Memory → Instruction files with no REASONIX/AGENTS doc. The empty state pointed users toward adding something above, but the docs tab did not render any add/create action, so there was no obvious way to create the instruction file from that screen.
Cause: the quick-add form only lived on the memory entries tab and writes a note through Remember. The instruction-files tab could edit discovered docs through SaveDoc, but did not expose a create path for one of the canonical scope docs.
Fix:
Tests:
Closes #3901