Skip to content

Make discard actually discard, and stop the delete dialog over-promising - #59

Merged
Seungpyo1007 merged 1 commit into
developfrom
fix/discard-and-delete-truth
Aug 5, 2026
Merged

Make discard actually discard, and stop the delete dialog over-promising#59
Seungpyo1007 merged 1 commit into
developfrom
fix/discard-and-delete-truth

Conversation

@Seungpyo1007

Copy link
Copy Markdown
Member

Discard threw away half of what it said

git discard reverts the file on disk to HEAD and leaves the open buffer alone. The panel then shows no changes while the editor still displays them, and saving brings back exactly what was just discarded.

Discarding a file means removing that file's changes, and unsaved edits are that file's changes. They now go too — and because that is not reversible, the confirmation says so first.

The delete dialog promised something it could not keep

It asks whether to move to the trash. What goes to the trash is the content that was on disk. Unsaved edits live only in the buffer: they are gone, with nothing to recover from. A dialog that promises reversibility has to say where that promise stops, so it now names the files whose unsaved work will not be in the trash.

Verification

Against a real git repository, with a file carrying both a committed-to-disk change and an unsaved edit on top — 6 of 6:

  • the warning appears before anything is discarded
  • disk returns to HEAD
  • the editor returns with it — no leftover edit to silently resurrect on the next save

And with the buffer revert removed: exp// 저장한 변경 | // 저장안한 변경 still sitting in the editor after the discard, which is the original bug reproduced exactly.

954 tests, npm run typecheck clean.

**git 변경 취소.** 디스크는 HEAD 로 되돌리면서 열린 버퍼는 안 건드렸다. 그래서
패널은 "변경 없음" 인데 편집기엔 그 변경이 그대로 남고, 저장하면 방금 버린 것이
되살아난다. 절반만 버린 셈이다.

버리기가 뜻하는 것은 "이 파일의 변경을 전부 없앤다" 이고 저장 안 한 편집도 그
파일의 변경이다. 그래서 함께 버린다 — 다만 되돌릴 수 없으니 확인창에서 미리 말한다.

**삭제 확인창.** "휴지통으로 옮길까요?" 라고 묻는데, 휴지통에 들어가는 것은 디스크에
있던 내용뿐이다. 저장 안 한 편집은 버퍼에만 있어서 그대로 사라지고 되돌릴 방법이
없다. 확인창이 되돌릴 수 있다고 약속하는 이상, 그 약속이 닿지 않는 부분은 말해야
한다. 무엇이 함께 사라지는지 파일 이름으로 적는다.
@Seungpyo1007 Seungpyo1007 added this to the v0.3 (2026-09-30) milestone Aug 5, 2026
@Seungpyo1007 Seungpyo1007 added the bug Something isn't working label Aug 5, 2026
@Seungpyo1007 Seungpyo1007 self-assigned this Aug 5, 2026
@Seungpyo1007
Seungpyo1007 merged commit 4de210a into develop Aug 5, 2026
1 check passed
@Seungpyo1007
Seungpyo1007 deleted the fix/discard-and-delete-truth branch August 5, 2026 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant