文件最后提交记录最后更新时间
fix(editor): never let a failed load overwrite the real file on save Previously, when /api/projects/:projectName/file returned a non-2xx (e.g. during a transient race right after a dev-stack restart), the useCodeEditorDocument hook caught the error and called setContent(// Error loading file: ${message}\n// File: ...) That placeholder text quietly became the editor's authoritative buffer. A subsequent Ctrl+S — or any other save trigger — then PUT the placeholder through to fsPromises.writeFile, destroying the real file on disk. Because writeFile follows symlinks, this also wiped out the target of any symlinked entry the user happened to be viewing. The fix decouples error state from buffer state: - useCodeEditorDocument now tracks loadError separately and leaves content empty on failure; it also exposes a reload() callback and cancels stale loads on unmount via a captured cancelled flag. - handleSave refuses to run while loading or loadError != null, surfacing the reason via saveError instead of writing stale buffer contents. - New CodeEditorLoadError subcomponent renders an error panel with Retry / Close — it intentionally does not mount a CodeMirror surface or a Save button, so the failure mode has no path to disk. - CodeEditor branches on loadError before isBinary; locale strings added for en + zh-CN. Co-authored-by: Cursor <cursoragent@cursor.com> 19 天前
fix(editor): never let a failed load overwrite the real file on save Previously, when /api/projects/:projectName/file returned a non-2xx (e.g. during a transient race right after a dev-stack restart), the useCodeEditorDocument hook caught the error and called setContent(// Error loading file: ${message}\n// File: ...) That placeholder text quietly became the editor's authoritative buffer. A subsequent Ctrl+S — or any other save trigger — then PUT the placeholder through to fsPromises.writeFile, destroying the real file on disk. Because writeFile follows symlinks, this also wiped out the target of any symlinked entry the user happened to be viewing. The fix decouples error state from buffer state: - useCodeEditorDocument now tracks loadError separately and leaves content empty on failure; it also exposes a reload() callback and cancels stale loads on unmount via a captured cancelled flag. - handleSave refuses to run while loading or loadError != null, surfacing the reason via saveError instead of writing stale buffer contents. - New CodeEditorLoadError subcomponent renders an error panel with Retry / Close — it intentionally does not mount a CodeMirror surface or a Save button, so the failure mode has no path to disk. - CodeEditor branches on loadError before isBinary; locale strings added for en + zh-CN. Co-authored-by: Cursor <cursoragent@cursor.com> 19 天前
fix(webui): stabilize markdown editor split layout Constrain the Files tab editor pane so CodeMirror content cannot resize the split layout during scroll, keeping chat, file tree, and editor controls visible. Co-authored-by: Cursor <cursoragent@cursor.com> 20 天前