docs(quick-261006-s0v): remove ML copy-from locale UI

This commit is contained in:
Jakub Zych
2026-10-06 20:13:20 +02:00
parent 2f03128a58
commit 8e22e5f25b
3 changed files with 171 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ status: executing
stopped_at: Completed 15-04-PLAN.md
last_updated: "2026-10-06T17:22:19Z"
last_activity: 2026-10-06
last_activity_desc: Completed 15-04 journal tests, phase gate, and ASVS review
last_activity_desc: Completed quick task 261006-s0v (remove ML copy-from locale UI)
state_head: 7307b36baaad660c84b5b365f2dac17ca7313941
progress:
total_phases: 26
@@ -31,7 +31,7 @@ See: .planning/PROJECT.md (updated 2026-09-16)
Phase: 15 (Journal plugin) — EXECUTING
Plan: 4 of 4
Status: Ready for phase verification
Last activity: 2026-10-06 — Completed 15-04 journal tests, phase gate, and ASVS review
Last activity: 2026-10-06 — Completed quick task 261006-s0v: Remove copy-from locale UI from ML text and markdown admin fields
Progress: [██████████] 100%
@@ -644,6 +644,7 @@ Recent decisions affecting current work:
| 261004-rou | Move API-token ownership from Fonoteka to sm-user-plugin | 2026-10-04 | d1abcab | [261004-rou-move-user-api-tokens-from-fonoteka-plugi](./quick/261004-rou-move-user-api-tokens-from-fonoteka-plugi/) |
| 261005-qvk | Map Winter icon-* navigation names onto lucide so BM Studies and Quizzes icons render | 2026-10-05 | a00dafa | [261005-qvk-fix-icons-sm-bm-plugin-tried-to-apply-ic](./quick/261005-qvk-fix-icons-sm-bm-plugin-tried-to-apply-ic/) |
| 261006-eyj | Widget form field payload request and structured data response channel | 2026-10-06 | e723c39 | [261006-eyj-widget-field-payload-and-data-channel](./quick/261006-eyj-widget-field-payload-and-data-channel/) |
| 261006-s0v | Remove copy-from locale UI from ML text and markdown admin fields | 2026-10-06 | 2f03128 | [261006-s0v-remove-copy-from-locale-ui-from-ml-text-](./quick/261006-s0v-remove-copy-from-locale-ui-from-ml-text-/) |
## Deferred Items

View File

@@ -0,0 +1,94 @@
---
phase: quick-261006-s0v
plan: 01
type: execute
wave: 1
depends_on: []
files_modified:
- admin/src/components/form/fields/MLTextField.vue
- admin/src/components/form/fields/MLMarkdownField.vue
- admin/tests/form/MLFields.test.ts
- docs/backend/forms.md
- modules/boardwalk/dist/
autonomous: true
requirements: [QUICK-261006-s0v]
estimate:
tokens: 25000
raw_tokens: 25000
tasks: 1
confidence: high
---
<objective>
Remove copy-from-locale from admin `mltext` and `mlmarkdown` fields. Keep one locale selector per field, synchronized across ML controls, and nested `Record<string,string>` save bodies. Copy currently overwrites the active locale with the other locale's (often empty) string, so the editor appears to go blank.
Purpose: Journal UAT — the operator does not want Copy, and the control is lossy.
Output: SPA components and tests, forms.md sentence, rebuilt `modules/boardwalk/dist`, one code commit.
</objective>
<execution_context>
@~/.claude/gsd-core/workflows/execute-plan.md
@~/.claude/gsd-core/templates/summary.md
</execution_context>
<context>
@.planning/STATE.md
@CLAUDE.md
@admin/src/components/form/fields/MLTextField.vue
@admin/src/components/form/fields/MLMarkdownField.vue
@admin/tests/form/MLFields.test.ts
@docs/backend/forms.md
@scripts/check-admin-dist.sh
Facts:
- Both ML components have a visible locale `<select data-ml-locale>`, a second unlabeled `<select data-ml-copy-from>` (other locales), and a Copy button that runs `copyLocale()`: `values[active] = values[copyFrom] ?? ''`. On create, the other locale is `""`, so Copy blanks the field the operator is editing.
- `otherLocales` and `copyFrom` exist only for that chrome. Locale broadcast (`broadcastMLLocale` / `ML_LOCALE_CHANGE`) stays.
- `docs/backend/forms.md` "Markdown and multilingual fields" currently says "Copy-from-locale fills the active locale from another code already in the value." Delete that sentence. Historical Phase 14.2.1 PLAN/VERIFICATION files stay as-written.
- Embedded SPA: after Vue edits, `npm --prefix admin run build` then commit `modules/boardwalk/dist`. `scripts/check-admin-dist.sh` is the drift gate.
- Commit rules: one logical change, planning docs not in the code commit, no co-author trailers.
</context>
<tasks>
<task type="auto">
<name>Task 1: Drop copy-from chrome; keep locale picker and broadcast</name>
<files>admin/src/components/form/fields/MLTextField.vue, admin/src/components/form/fields/MLMarkdownField.vue, admin/tests/form/MLFields.test.ts, docs/backend/forms.md, modules/boardwalk/dist/</files>
<read_first>admin/src/components/form/fields/MLTextField.vue, admin/src/components/form/fields/MLMarkdownField.vue, admin/tests/form/MLFields.test.ts, docs/backend/forms.md (Markdown and multilingual fields)</read_first>
<action>
In MLTextField.vue and MLMarkdownField.vue, delete copyFrom, otherLocales, copyLocale, the copy-from select, and the Copy button. setLocale only assigns activeLocale. Keep data-ml-locale, broadcastMLLocale, and the editor.
In MLFields.test.ts, rewrite `edits the active locale and copies from another` to switch locale and type into the active field without `[data-ml-copy-from]` / `[data-ml-copy]`. In the existing "one locale selector" case, also assert those copy selectors and buttons are absent on both components.
In docs/backend/forms.md, remove the Copy-from-locale sentence; leave the rest of the paragraph.
Rebuild with `npm --prefix admin run build` and include modules/boardwalk/dist.
Commit: `fix(admin): drop ML copy-from locale chrome` (or equivalent). No .planning files, no trailers.
</action>
<verify>
<automated>cd /media/nvme/dev/golem15/summercms.io/summercms/summercms.go && npm --prefix admin test -- tests/form/MLFields.test.ts && npm --prefix admin run typecheck && scripts/check-admin-dist.sh && go test ./cmd/summer -run TestDocsTree && ! grep -R -n 'data-ml-copy' admin/src admin/tests docs/backend/forms.md</automated>
</verify>
<done>ML fields expose only the locale selector; Copy is gone; tests and docs match; dist is rebuilt; one code commit.</done>
</task>
</tasks>
<verification>
- npm --prefix admin test -- tests/form/MLFields.test.ts
- npm --prefix admin run typecheck
- scripts/check-admin-dist.sh
- go test ./cmd/summer -run TestDocsTree
- No data-ml-copy / copyLocale remaining in admin/src, admin/tests, or docs/backend/forms.md
</verification>
<success_criteria>
- Clicking around an mltext/mlmarkdown field cannot blank the active locale via Copy, because Copy is not there.
- Switching en/pl still switches every ML control on the form.
- Nested locale maps still round-trip.
</success_criteria>
<output>
Create `.planning/quick/261006-s0v-remove-copy-from-locale-ui-from-ml-text-/261006-s0v-SUMMARY.md` when done
</output>

View File

@@ -0,0 +1,74 @@
---
phase: quick-261006-s0v
plan: 01
subsystem: admin-spa
tags: [admin-spa, mltext, mlmarkdown, i18n]
status: complete
requires:
- Phase 14.2.1 ML fields
provides:
- ML text/markdown fields with a single locale selector and no copy-from chrome
affects:
- admin SPA (modules/boardwalk/dist)
tech-stack:
added: []
patterns: []
key-files:
created: []
modified:
- admin/src/components/form/fields/MLTextField.vue
- admin/src/components/form/fields/MLMarkdownField.vue
- admin/tests/form/MLFields.test.ts
- docs/backend/forms.md
- modules/boardwalk/dist/
decisions:
- "Copy-from-locale is removed, not repaired. Copy wrote values[copyFrom] (often empty) over the active locale, which is why the editor went blank."
metrics:
duration: 8 min
completed: 2026-10-06
actuals:
tokens: 2500
tokens_note: chars/4 over Vue, tests, forms.md (excluding rebuilt dist bundle)
tasks: 1
commits: 1
plan_head_after: 2f03128
---
# Quick 261006-s0v: Remove ML copy-from locale UI
`mltext` and `mlmarkdown` now show one locale picker. The second unlabeled dropdown and Copy button are gone, so switching language cannot blank the field you are editing.
## What was built
**Task 1 (commit 2f03128)**
- `MLTextField.vue` and `MLMarkdownField.vue`: dropped `copyFrom`, `otherLocales`, `copyLocale`, the copy-from select, and the Copy button. Locale broadcast and nested `Record<string,string>` values are unchanged.
- `MLFields.test.ts`: asserts copy selectors/buttons are absent; editing Polish keeps English.
- `docs/backend/forms.md`: removed the Copy-from-locale sentence.
- `modules/boardwalk/dist` rebuilt (`index-CRrQr2H1.js`).
## Verification
| Command | Result |
|---|---|
| `npm --prefix admin test -- tests/form/MLFields.test.ts` | 11 passed |
| `npm --prefix admin run typecheck` | pass |
| `scripts/check-admin-dist.sh` | matches a fresh build |
| `go test ./cmd/summer -run TestDocsTree` | pass |
## Deviations from Plan
None. Typed `gsd-planner`/`gsd-executor` are not available in this Cursor session; the orchestrator wrote the plan and executed it inline with `workflow.use_worktrees=false`.
## Known Stubs
None.
## Commits
| Hash | Subject |
|---|---|
| 2f03128 | fix(admin): drop ML copy-from locale chrome (quick-261006-s0v) |
No `.planning` files and no co-author or "Generated with" trailers in the code commit.
## Self-Check: PASSED