Closed Bug 1011089 Opened 10 years ago Closed 8 years ago

[Messages] Set hash when changing panels, and restore panels from hash

Categories

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

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: julienw, Unassigned)

References

Details

The Navigation object has a facility to move to a panel automatically when launching the application with a hash.

However, we don't set the hash when changing panels yet.

Moreover, when launching as an activity, we use a different hash which is not known by the Navigation object, and we need a sensible way to handle this as well (possibly not doing anything as it is now).
I want something similar for email: For each "card" in the email app use an URL fragment ID change with  history.pushState(); to store some simple, JSON-serializable state for the card.

If the email app gets killed, on relaunch, start from the last URL/history entry in that history state, and allow history.back() to work.

One tricky thing may be having a way to reset the history state: in some UI flows for email, we want to reset the history: when a new account is added, we basically start over the card state back to be clear. 

Maybe that can be managed by doing something like history.back(-1 * history.length) then doing a location replace.
(In reply to James Burke [:jrburke] from comment #1)
> I want something similar for email: For each "card" in the email app use an
> URL fragment ID change with  history.pushState(); to store some simple,
> JSON-serializable state for the card.
> 
> If the email app gets killed, on relaunch, start from the last URL/history
> entry in that history state, and allow history.back() to work.
> 
> One tricky thing may be having a way to reset the history state: in some UI
> flows for email, we want to reset the history: when a new account is added,
> we basically start over the card state back to be clear. 
> 
> Maybe that can be managed by doing something like history.back(-1 *
> history.length) then doing a location replace.

I don't know the detail of pushstate too much, but I am afraid it's not supported now and we need gecko love. What's working on is: if any app is changing its url, system app will record it. If the app is killed at background we will remove the whole mozbrowser iframe. Next time the user launches the app from task manager or homescreen, we will set the latest url instead of launch path (index.html). And I believe the newly iframe doesn't have history - unless gecko is really smart to keep and restore it.
I guess we would need gecko love to use the session history db.

Note that this bug is specific for the SMS application. Alive, do we have a bug for your work in the System app?
Mass closing of Gaia::SMS bugs. End of an era :(
Status: NEW → RESOLVED
Closed: 8 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.