Closed Bug 995350 Opened 10 years ago Closed 10 years ago

[SMS] - Display Save button for attached image file name having hidden directories '.gallery/'

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(blocking-b2g:1.4+, b2g-v1.4 fixed, b2g-v2.0 fixed)

RESOLVED FIXED
2.0 S1 (9may)
blocking-b2g 1.4+
Tracking Status
b2g-v1.4 --- fixed
b2g-v2.0 --- fixed

People

(Reporter: pdahiya, Assigned: azasypkin)

Details

Attachments

(1 file)

With fix of bug 992426, Gallery app open activity handler will hide save button for file names having hidden directories such as '.gallery/'

Opening the bug for a fix in SMS app to send filename stripped off of any hidden directories so that opened images can be saved.

See Comments
https://bugzilla.mozilla.org/show_bug.cgi?id=992426#c23
Julien, can you please help landing this improvement in SMS app over the existing code of 992426 fix because the user will no longer see a choice to save an image for filename with hidden directories.
Flags: needinfo?(felash)
Needs to be 1.4+ because it's part of the fix to bug 992426.
blocking-b2g: --- → 1.4?
Flags: needinfo?(felash)
Component: Gaia → Gaia::SMS
blocking-b2g: 1.4? → 1.4+
Joe and Wesley, can we find an owner for this bug? Thanks.
Flags: needinfo?(whuang)
Flags: needinfo?(jcheng)
Give to Steve per offline discussion.
Assignee: nobody → schung
Flags: needinfo?(whuang)
Flags: needinfo?(jcheng)
Steve, please reassign back to me if your hands are full, I can take it as well.
(In reply to Julien Wajsberg [:julienw] from comment #5)
> Steve, please reassign back to me if your hands are full, I can take it as
> well.

Sorry I might not have enough time for it this week... :( ,but based on David's suggestion in bug 992426 comment 20, does that mean we should save the attachment into our own folder, or you prefer to just save it in the root?
Assignee: schung → felash
Our own folder makes sense. I even think that we should make it localizable... like Windows and other OS do.
Hey Julien, what type of storage is supposed to be used? 

I see that we at least have:
1. sdcard
2. pictures\video
3. apps

#1 seems too generic, #2 is OK for media files, but not sure what to do with unknown formats, #3 looks like serving for another purpose and I guess may have very limited size.
Flags: needinfo?(felash)
Here we simply provide the correct path as filename to the "view" activity, we don't do the save ourselves. Not sure if it answers your question :)
Flags: needinfo?(felash)
(In reply to Julien Wajsberg [:julienw] from comment #10)
> The code to change is
> https://github.com/mozilla-b2g/gaia/blob/
> a55eb67d0659327a8e4b64099fc76a634823fecd/apps/sms/js/attachment.js#L236

Yep, I know :) Probably I misunderstood you, but you were talking about own folder, what did you mean? Currently we have filename for cropped image that looks like '/sdcard/.gallery/cropped/5375100743818036.jpeg', how should we modify it before we pass it to 'view' activity?
Forgot to ni? Julien :) Adding now.
Flags: needinfo?(felash)
I'd first try 'sms-attachments/54657546544.jpeg' (without any prefix) and look whether the Gallery does the right thing :)

Maybe the 'sms-attachments' part could be localized too. Not sure how the Gallery would handle spaces in the directory name either, so maybe we can just file a bug for the possible localization and ask UX.
Flags: needinfo?(felash)
(In reply to Julien Wajsberg [:julienw] from comment #13)
> I'd first try 'sms-attachments/54657546544.jpeg' (without any prefix) and
> look whether the Gallery does the right thing :)
> 
> Maybe the 'sms-attachments' part could be localized too. Not sure how the
> Gallery would handle spaces in the directory name either, so maybe we can
> just file a bug for the possible localization and ask UX.

Yes, this definitely will work, I'm just wondering that we're polluting root folder with such app-specific folders. If every app decides to create something like this we'll have a mess. So the question is why can't we use something common across the apps like 'appdata/sms/attachments' and 'appdata/any_other_app/....' so that user knows that this is something related to the app (eg. when I see it via FileManager app from MarketPlace) and will not delete it accidentally eg. during sdcard cleanup.

Ideally 'appdata/any_other_app' shouldn't be hardcoded, but rather returned by some common method like 'getAppDataFolderPath' or something similar that will return right path depending on calling app including localized app name.

Just thinking: some of the appdata stuff may be shared across devices with sync. More inspired by http://windows.microsoft.com/en-us/windows-8/what-appdata-folder :)

At the same time it looks like valid case for 'apps' storage type, but I wasn't able to find much info on that.

What do you think about it?
Flags: needinfo?(felash)
The correct "appdata" could be returned by DeviceStorage, but currently DeviceStorage is used by Gallery, so I don't really know.

Here, I'd like to focus on making the save button work again, but we can file a bug for your proposal which definitely makes sense and request UX feedback :)
Flags: needinfo?(felash)
Assignee: felash → azasypkin
(In reply to Julien Wajsberg [:julienw] from comment #15)
> The correct "appdata" could be returned by DeviceStorage, but currently
> DeviceStorage is used by Gallery, so I don't really know.
> 
> Here, I'd like to focus on making the save button work again, but we can
> file a bug for your proposal which definitely makes sense and request UX
> feedback :)

Ok, got it, we just need quick fix for now :) Will do that and file separate bug for 'appdata'.
OS: Mac OS X → Gonk (Firefox OS)
Hardware: x86 → ARM
Hopefully temporal solution to return Save button back :)
Attachment #8413408 - Flags: review?(felash)
Comment on attachment 8413408 [details] [review]
GitHub pull request URL

r=me, thanks !
You know what to do :) (commit log, checkin-needed)
Attachment #8413408 - Flags: review?(felash) → review+
(In reply to Julien Wajsberg [:julienw] from comment #18)
> Comment on attachment 8413408 [details] [review]
> GitHub pull request URL
> 
> r=me, thanks !
> You know what to do :) (commit log, checkin-needed)

Thanks! Done.
Keywords: checkin-needed
Status: NEW → ASSIGNED
master: https://github.com/mozilla-b2g/gaia/commit/17c319282315f5a86b2c31a84fe3e4c68d568fd8
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 2.0 S1 (9may)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: