Repository navigation
Ask before q or a screen switch drops a new-task draft - #1092
Merged
Merged
Conversation
q and every screen switch away from a touched new-task form now ask "discard the task draft and quit/leave? y/n" in the status line; a form whose create is in flight does not ask, and ctrl+c never does. esc on a project form whose request would differ from what it opened with asks "discard these changes? y/n", as the new-task form does. The project form already captured q and survived a switch. Closes #1051
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1051. Merges into
tui-audit.New-task form
qand every screen switch now ask before dropping a touched new-task form: a tab, the palette,!, an open from elsewhere. The question sits in the status line:discard the task draft and quit? y/nor… and leave? y/n.ygoes ahead,n/esckeeps the form.leaveGuardthat the root consults inswitchTo(switchNowis the unguarded path, used ony) and on the quit key.ctrl+cnever asks, so the TUI stays killable.nreopens it pristine. The existingswitchGuardonly covered project switches.Project form
escon a touched form now asksdiscard these changes? y/n, as the new-task form does. "Touched" means the request a save would send differs from the one it opened with, so typing a field back to its value is not a draft.qincluded), and the form survives a screen switch. It needed no leave guard, and a test now holds that.Checks
qasks,nkeeps the draft,yquits; a switch asks,esckeeps the form,yswitches; no question for an untouched or submitting form; the project form'sescquestion and its dirty rule; the project form survivingqand a switch.go test ./internal/tuipasses andmage lintallis clean.