Page MenuHomePhorge

Restore draft after editing
ClosedPublic

Authored by nannanko on Oct 13 2025, 12:02 AM.

Details

Summary

m.replace will replace user's draft, this restore it after editing.

This depends on D296

Type: add

Test Plan

Type some draft in a room, then edit a event, check if old draft is restored when exit editing.

Continuously select multiple events for editing, check if initial draft is restored when exit all editing. Additionally, all drafts that are asked to be saved will be saved and popped up in sequence.

When you have a draft and are ready to edit an event, you will be asked to confirm whether to save the draft. When you edit an event but do not send it, you will be asked to confirm whether to discard the draft.

Try switching rooms or reopening kazv, and verify it wroks fine.

Verify unit tests pass.

Diff Detail

Repository
rK kazv
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

src/tests/quick-tests/tst_SendMessageBoxDrafts.qml
192

I don't know why, the test_saveDraftsOnSwitching() doesn't pass without this line.

nannanko marked an inline comment as not done.Oct 13 2025, 12:11 AM
nannanko edited the summary of this revision. (Show Details)
nannanko edited the summary of this revision. (Show Details)

Currently Kazv cannot remember a room is in the state of editing or replying to an event, which makes restoring a draft difficult to achieve. I think this feture should be divided into several diffs instead of being completed in one diff.

In D245#5654, @nannanko wrote:

Currently Kazv cannot remember a room is in the state of editing or replying to an event, which makes restoring a draft difficult to achieve. I think this feture should be divided into several diffs instead of being completed in one diff.

then you can develop more diffs on top of this. once they are all ready, we can land them together.

Draft can now be restored after switching rooms or reopening kazv.

Add 'Do nothing' button for confirmOverlay, add more unit tests.

Always ask if discard draft in input box.

Add TribleButtonOverlay.qml

Clean up drafts that won't be restored

D245 pushed the wrong branch of libkazv, this fixed it

tusooa requested changes to this revision.Sat, May 9, 7:00 PM
tusooa added inline comments.
src/contents/ui/TribleButtonOverlay.qml
16–21 ↗(On Diff #944)

Use "accept/reject/noop" instead of "left/middle/right." This makes things clearer and developers will not need to worry about where exactly the buttons are, they only need to think about semantics.

This revision now requires changes to proceed.Sat, May 9, 7:00 PM

Rename TribleButtonOverlay.qml to AcceptRejectNoopOverlay.qml

This revision is now accepted and ready to land.Sat, May 9, 8:19 PM
This revision was landed with ongoing or failed builds.Sun, May 10, 10:55 AM
This revision was automatically updated to reflect the committed changes.