Closed Bug 1168962 Opened 5 years ago Closed 5 years ago

[User Story] Expand/Collapse Browser Chrome on Navigation

Categories

(Firefox OS Graveyard :: Gaia::System::Browser Chrome, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(feature-b2g:2.5+)

RESOLVED FIXED
FxOS-S6 (04Sep)
feature-b2g 2.5+

People

(Reporter: benfrancis, Assigned: apastor)

References

Details

(Keywords: feature, Whiteboard: [systemsfe])

User Story

As a user I want the browser chrome to collapse when I navigate to a pinned site or page, to create more room for the content, and expand again when I exit a pinned site/page.

Attachments

(2 files)

As a user I want the browser chrome to collapse when I navigate to a pinned site or page, to create more room for the content, and expand again when I exit a pinned site/page.
A Pivotal Tracker story has been created for this Bug: https://www.pivotaltracker.com/story/show/95560452
feature-b2g: --- → 2.5+
Assignee: nobody → apastor
Assignee: apastor → nobody
Assignee: nobody → bfrancis
Target Milestone: --- → FxOS-S6 (04Sep)
I am probably not going to have time to finish this before I go on PTO.

My idea for implementing this was to keep a map/tree of pinned site scopes in memory indexed by hostname, populated from the pinned sites (bookmarks) store, and kept up to date, so:

scopes = {
  'foo.com': {
    'foo.com/bar': 'http://foo.com/bar/index.html',
    'foo.com/baz': 'http://foo.com/baz/index.html'
   },
  'bar.com': {
    'bar.com': 'http://bar.com/index.html'
  }
}

On every locationchange event we can do a quick lookup of the hostname of the new URL in the map to find out if there are any pinned sites for that hostname.

if (scopes[hostname]) { ... }

If there are then we can do longest-prefix matching on the pinned scopes under that hostname to determine which pinned site (if any) the URL belongs to, identified by the site's start URL. If it belongs to a pinned site then we should collapse and pin the browser chrome, otherwise we should expand and unpin it.

This will then also allow us to look up the pinned site in the pinned sites (bookmarks) store to retrieve any manifest metadata which needs applying to the browser chrome (e.g. name, theme_color, display_mode).
Assignee: bfrancis → nobody
Taking back :)
Assignee: nobody → apastor
Comment on attachment 8664908 [details] [review]
[gaia] albertopq:1168962-expand-collapse > mozilla-b2g:master

This patch uses the Bookmarks database to keep an object that will help to know if a site is pinned, when navigating to an specific URL. Etienne, could you please take a look? Thanks!
Attachment #8664908 - Flags: review?(etienne)
Comment on attachment 8664908 [details] [review]
[gaia] albertopq:1168962-expand-collapse > mozilla-b2g:master

Great work!
Made a tiny comment on github, but r+!
Attachment #8664908 - Flags: review?(etienne) → review+
Duplicate of this bug: 1202566
Duplicate of this bug: 1202562
master: https://github.com/mozilla-b2g/gaia/commit/c1cccd5e74373c9f93f9505386a70daf3f566ae0
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Depends on: 1209600
You need to log in before you can comment on or make changes to this bug.