Closed
Bug 914115
Opened 11 years ago
Closed 11 years ago
[e.me][feature] Homescreen will expose an API to rename icons
Categories
(Firefox OS Graveyard :: Gaia::Homescreen, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: crdlc, Assigned: crdlc)
References
Details
Attachments
(1 file)
Collections can be renamed so we need to support it in homescreen part
Assignee | ||
Updated•11 years ago
|
Assignee | ||
Comment 1•11 years ago
|
||
The first version could be something like this
https://github.com/crdlc/gaia/commit/ee9537eb30cb56a81b554e050760ba5053b16428#L1L121
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #809884 -
Flags: review?(evyatar)
Comment 3•11 years ago
|
||
Evyatar, notice the API suggested expects Collection origin as an identifier.
Do we hold this parameter for Collections?
Flags: needinfo?(evyatar)
Comment 4•11 years ago
|
||
I'm pretty sure we save this in our index, our ID should be the origin URL.
Amir can give a definitive answer.
Flags: needinfo?(evyatar) → needinfo?(amirn)
Comment 5•11 years ago
|
||
It seems we generate an id instead.
Assignee | ||
Comment 6•11 years ago
|
||
I am sure because it is working fine
https://github.com/mozilla-b2g/gaia/pull/12442/files#L1R180
Comment 7•11 years ago
|
||
There are two cases:
1. "pre-cooked" collections have an id created by homescreen (which is the origin, if I'm not mistaken)
https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/everything.me/js/Core.js#L113
2. any collection later created by the user has a generated id
https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/everything.me/modules/Collection/Collection.js#L389
Flags: needinfo?(amirn)
Assignee | ||
Comment 8•11 years ago
|
||
(In reply to Amir Nissim (Everything.me) from comment #7)
> There are two cases:
>
> 1. "pre-cooked" collections have an id created by homescreen (which is the
> origin, if I'm not mistaken)
> https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/everything.
> me/js/Core.js#L113
>
Right
> 2. any collection later created by the user has a generated id
> https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/everything.
> me/modules/Collection/Collection.js#L389
In this case when you create a collection you can pass the id as bookmarkURL as well in the descriptor
https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/everything.me/js/etmmanager.js#L14
Comment 9•11 years ago
|
||
the 'id' is used to create a new gridItem with identical origin and id
https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/everything.me/modules/Collection/Collection.js#L459-L460
the originURL is then passed as the bookmarkURL
https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/everything.me/js/etmmanager.js#L17
and finally saved as origin
https://github.com/mozilla-b2g/gaia/blob/master/apps/homescreen/js/grid_components.js#L29-L30
this is all very confusing.. we have started talking about using a single unique 'id' field to reference grid items. maybe it's time..
Comment 10•11 years ago
|
||
but, yes, as Cristian said, it will work.
Assignee | ||
Comment 11•11 years ago
|
||
you can fill a bug for that although not for v1.2
Comment 12•11 years ago
|
||
Cristian, I'm checking the patch - it seems like if I call setIconName on a collection, and then getIconName (after a few seconds) I still get the old name. Also after re-building the homescreen the name reverts to the old one.
Flags: needinfo?(crdlc)
Assignee | ||
Comment 13•11 years ago
|
||
https://github.com/mozilla-b2g/gaia/pull/12442/files#L0R229
Are you retrieving here the icon? Is the name changed on the grid?
Flags: needinfo?(crdlc)
Comment 14•11 years ago
|
||
1. call setIconName
2. The name changes on the grid
3. call getIconName
4. I get the OLD name
1. call setIconName
2. The name changes on the grid
3. Build the homescreen app again
4. The name is now the OLD one
Assignee | ||
Comment 15•11 years ago
|
||
Please take a look to this code https://github.com/mozilla-b2g/gaia/pull/12442/files#L3R456 because I cannot test it on my device and you are working on rename collections bug
Comment 16•11 years ago
|
||
Comment on attachment 809884 [details]
Patch v1
Tested, and the issue I had came from OUR code, not this PR. So this is working and can be landed.
Attachment #809884 -
Flags: review?(evyatar) → review+
Assignee | ||
Comment 17•11 years ago
|
||
ok thanks, waiting for Travis
Comment 18•11 years ago
|
||
All is well from Travis!
Assignee | ||
Comment 19•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•