Cmd+← / back navigation in Directory Preview discards unsaved file edits without prompt
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 68/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 领域
- frontend
调研方向
Start at the Directory Preview back-navigation handler used by Cmd+← and the toolbar back arrow, then trace how the current file editor exposes unsaved state. Reproduce the edit-and-navigate sequence and verify that dirty files show Save, Discard, and Cancel choices before leaving, while clean files still navigate immediately.
由索引模型根据 Issue 内容生成。
描述
Problem
When browsing files in Directory Preview mode and editing a file (e.g., a markdown file), pressing Cmd+← (or clicking the back arrow) navigates back to the directory listing and silently discards all unsaved edits — no confirmation, no prompt.
Steps to Reproduce
- Open a directory in Wave Terminal (Directory Preview)
- Click a
.mdfile to open it for inline editing - Type some content but do not press
Cmd+S - Press
Cmd+←or click the back arrow in the toolbar
Expected: A dialog appears: "You have unsaved changes. Save before leaving?" with options to Save / Discard / Cancel.
Actual: Navigation back happens immediately, all unsaved edits are lost.
Context
- There is no shortcut or gesture that currently closes the editor with a save prompt — the dirty-state check simply doesn't exist on the Directory Preview back-navigation path
- This is a data-loss risk for anyone using the built-in file editing in directory preview
Suggested Fix
Add a dirty-state check to the Directory Preview back-navigation handler. When there are unsaved edits in the current file preview/edit view, prompt the user before navigating back.
Related
- Existing "confirm close" settings (
tab:confirmclose,window:confirmclose,app:confirmquit) only cover tab/window/app-level close, not intra-widget navigation back ~/.waveterm/config/keybindings.jsonallows remapping keys but can't add conditional logic (e.g., "check dirty state before executing back command")
- 主要语言
- Go
- 星标
- 22.4k
- 派生
- 1.1k
- 平均合并
- 3 天 13 小时
- 30 天内合并 PR
- 13
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
wavetermdev/waveterm 的其他 Issue
-
pwsh: encodeEnvVarsForPowerShell rejects Windows-standard env var names like ProgramFiles(x86), breaking wsh token on every pwsh block可能已有人在做 @vortsghost2025 于 26 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
wavetermdev/waveterm#3481 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
wavetermdev/waveterm#3435 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 85/100
wavetermdev/waveterm#3432 ·
维护者通常 1 天内回复
-
enhancement triage
难度 2/5 1-3 小时 新手友好度 82/100
wavetermdev/waveterm#3431 ·
维护者通常 1 天内回复
-
[Bug]: web blocks become unresponsive when switching focus between two of them可能已有人在做 @jameswolensky 于 84 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 86/100
wavetermdev/waveterm#3428 ·
维护者通常 1 天内回复
查看 wavetermdev/waveterm 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
AOSSIE-Org/DebateAI#611 ·
维护者通常 3 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
terraform-provider
难度 2/5 1-3 小时 新手友好度 73/100
ClickHouse/terraform-provider-clickhousedbops#281 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
open-telemetry/opentelemetry-go-compile-instrumentation#1450 ·
维护者通常 2 天内回复