Closed Bug 991835 Opened 6 years ago Closed 3 years ago

[Messages] Pressing "backspace" in a composer should not remove an attachment without a confirmation


(Firefox OS Graveyard :: Gaia::SMS, defect)

Gonk (Firefox OS)
Not set


(Not tracked)



(Reporter: julienw, Unassigned)



(Keywords: feature, Whiteboard: [priority])


(2 files)

1. open the Messages app, press new message
2. attach something (image or other)
3. input to add some text
4. press backspace to remove the text, and then once more

* we have a confirmation dialog before removing the attachment

* we have no confirmation dialog

This is happening since 1.1 and this is awkward since 1.1.
Needinfo to Omega for taking advice.
Flags: needinfo?(ofeng)
IMO a confirmation dialog here might be too strong.
I tried to play with it for a while, and describe the details here:
1) When user attaches an image and types something, it looks like:
2) Press Backspace 5 times to delete "hello", it looks like:
3) Press Backspace 1 more time, the image is deleted:

What we can improve is 2), just move the insert point to the end of line 1 like:
That will improve the experience and feel more like "OK, the next Backspace is deleting the image".
Flags: needinfo?(ofeng)
I'll check how we can do what you suggest in comment 1, I don't really remember how it works ;)

Omega, how about that we do a "undo" function ? It's more long-term of course but we could start here? Maybe for another bug?
Flags: needinfo?(ofeng)
(In reply to Julien Wajsberg [:julienw] from comment #2)
> Omega, how about that we do a "undo" function ? It's more long-term of
> course but we could start here? Maybe for another bug?

Undo is a good idea if possible. We can use a toast with Undo action like p.6 of the attachment of bug 940365.
Could you file that bug?
Flags: needinfo?(ofeng)
Flags: needinfo?(felash)
Filed Bug 994039 for an undo mechanism.

Here let's focus on the suggestion in comment 1.
Flags: needinfo?(felash)
blocking-b2g: --- → 2.1?
This is an improvement on UX but won't be a blocker.
Let's put in TopX list.
blocking-b2g: 2.1? → backlog
Whiteboard: [priority]
It's not really easy to put the cursor on the previous line, but it's quite easy to add a class. I still need to find when to remove the class though.
See Also: → 1137686
Comment on attachment 8570478 [details] [review]
[gaia] julienw:991835-delete-attachment-3 > mozilla-b2g:master

This is another try that tries to do what Omega proposed. However I stumbled on bug 1137686 while implementing it.

Still this works not bad, because we need 2 "delete" to delete an attachment. But we have no visual cues.

I tested only on Firefox for now, not on device.
And none of the patches work on the device :/ Maybe preventDefault() doesn't work?
I tested a simple patch and preventDefault does work. So something else is happening.
blocking-b2g: backlog → ---
Mass closing of Gaia::SMS bugs. End of an era :(
Closed: 3 years ago
Resolution: --- → WONTFIX
Mass closing of Gaia::SMS bugs. End of an era :(
You need to log in before you can comment on or make changes to this bug.