FN-8755: add undo and redo controls to file editor

Add localized CodeMirror history controls while preserving current editor mode during external content resets.

- Add native undo/redo commands, toolbar controls, keyboard shortcuts, and translations
- Reset history for accepted external replacements while retaining stale self-echo history
- Cover simultaneous content and read-only transitions and document editor shortcuts

Files changed:
 .changeset/fn-8755-file-editor-history.md          |   7 ++
 docs/dashboard-guide.md                            |   2 +-
 packages/dashboard/app/components/FileEditor.tsx   |  96 ++++++++++++------
 .../app/components/__tests__/FileEditor.test.tsx   | 108 +++++++++++++++++++++
 packages/dashboard/package.json                    |   3 +-
 packages/i18n/locales/en/app.json                  |   2 +
 packages/i18n/locales/es/app.json                  |  20 +++-
 packages/i18n/locales/fr/app.json                  |  20 +++-
 packages/i18n/locales/ko/app.json                  |  20 +++-
 packages/i18n/locales/zh-CN/app.json               |  20 +++-
 packages/i18n/locales/zh-TW/app.json               |  20 +++-
 packages/i18n/src/resources.d.ts                   |   2 +
 pnpm-lock.yaml                                     |  45 ++++++---
 13 files changed, 294 insertions(+), 71 deletions(-)

Fusion-Task-Id: FN-8755

Fusion-Task-Lineage: 1c0bdb9b-f866-4e01-8002-afe27f34d670

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
This commit is contained in:
gsxdsm
2026-08-02 23:44:22 -07:00
parent a6d64eba8c
commit af66b382e0
13 changed files with 294 additions and 71 deletions

View File

@@ -1155,7 +1155,7 @@ The Files modal provides a workspace-aware file browser and editor.
## Memory View
Memory view provides a multi-file editor for project and daily memory files. Its file editors share the same highlighted-text **Add comment** affordance as the Files modal, so memory snippets can seed a New Task with file path, snippet, and comment context.
Memory view provides a multi-file editor for project and daily memory files. Its file editors share the same highlighted-text **Add comment** affordance as the Files modal, so memory snippets can seed a New Task with file path, snippet, and comment context. Editable file editors also provide localized **Undo** and **Redo** toolbar controls and the standard platform shortcuts: <kbd>Ctrl</kbd>/<kbd>Cmd</kbd>+<kbd>Z</kbd> to undo, plus <kbd>Ctrl</kbd>+<kbd>Y</kbd> or <kbd>Cmd</kbd>+<kbd>Shift</kbd>+<kbd>Z</kbd> to redo.
> Available when the `experimentalFeatures.memoryView` toggle is enabled.