Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Cmd+← / back navigation in Directory Preview discards unsaved file edits without prompt

未关闭
#3,442 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 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

  1. Open a directory in Wave Terminal (Directory Preview)
  2. Click a .md file to open it for inline editing
  3. Type some content but do not press Cmd+S
  4. 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.json allows 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 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

wavetermdev/waveterm 的其他 Issue

查看 wavetermdev/waveterm 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。