blackberry / bbUI.js

BlackBerry UI look and feel JavaScript toolkit for WebWorks
Apache License 2.0
313 stars 194 forks source link

Desktop browser navigation not supported in bbUI #112

Closed astanley closed 11 years ago

astanley commented 12 years ago

When loading bbUI.js in a desktop browser, it does not handle pressing the back / forward buttons gracefully. Other sites that leverage a single HTML page dynamic model (e.g. Twitter) do make use of hash-bang technique to trick the browser into thinking there is a page history, that users can navigate back & forward by pressing the relevant browser buttons.

It would be nice if bbUI did the same. Given the scope and purpose of bbUI.js in that it is designed exclusively for BlackBerry, this issue may in fact not be relevant. HOWEVER - I wonder if there is an opportunity to easily improve this using the HTML5 History pushstate API?

From Eli:

"but currently bbui doesn't work on desktop browsers. For example, there's no action bar, so you can't go back. Browser back doesn’t work because bbui isn't using history pushstate."

"I believe it should be using HTML5 History pushstate (http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html). I believe it works on BB7 and forward. Perhaps we can shim it further back using https://github.com/balupton/History.js/ ?"

tneil commented 12 years ago

Oh.. Boy.. That is a fundamental change in how the entire framework would function.

The primary goal at the moment is to satisfy a full screen WebWorks app and not a website.

Tim


Sent from my Awesome BlackBerry Smartphone

----- Original Message ----- From: Adam Stanley [mailto:reply@reply.github.com] Sent: Wednesday, May 09, 2012 03:02 PM To: Tim Neil Subject: [bbUI.js] Desktop browser navigation not supported in bbUI (#112)

When loading bbUI.js in a desktop browser, it does not handle pressing the back / forward buttons gracefully. Other sites that leverage a single HTML page dynamic model (e.g. Twitter) do make use of hash-bang technique to trick the browser into thinking there is a page history, that users can navigate back & forward by pressing the relevant browser buttons.

It would be nice if bbUI did the same. Given the scope and purpose of bbUI.js in that it is designed exclusively for BlackBerry, this issue may in fact not be relevant. HOWEVER - I wonder if there is an opportunity to easily improve this using the HTML5 History pushstate API?

From Eli:

"but currently bbui doesn't work on desktop browsers. For example, there's no action bar, so you can't go back. Browser back doesn’t work because bbui isn't using history pushstate."

"I believe it should be using HTML5 History pushstate (http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html). I believe it works on BB7 and forward. Perhaps we can shim it further back using https://github.com/balupton/History.js/ ?"


Reply to this email directly or view it on GitHub: https://github.com/blackberry/bbUI.js/issues/112


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

tneil commented 12 years ago

There is also a fundamental reason why bbUI doesn't do this.. loading all the screens of an app into the DOM is a HUGE memory and performance drain.

It was a conscious decision not allow for this because of the performance impacts.

There currently isn't any intention to try and make bbUI work in a regular desktop browser.. it detects the BlackBerry specific user agent and looks for WebWorks specific functionality to provide a lot of the features.

Trying to keep this framework laser focused.

Bluenoser commented 12 years ago

I'm with Tim on this. The bbUI should be designed for Backberry devices only. A Blackberry app shouldn't be more than a couple pages deep.

astanley commented 12 years ago

Fair enough, but I'm thinking how do you build bbUI powered apps? Using Ripple extension, in a desktop browser.

Understand its a big change, however I do believe the developer experience would benefit from this capability. Thinking about how many times developers click the back/forward button in Ripple+Chrome, rather than the 'back' element within the bbUI content?

A Blackberry app shouldn't be more than a couple pages deep. Isn't that fairly limiting? Why do you say this?

Bluenoser commented 12 years ago

Adam,

I use the stand alone Ripple emulator, but most of my testings in on an actual Playbook. This would be the same for any other Blackberry device.

bbUI should be designed to work on the final product, not targeted for the developer. The toolkit should be as efficient as possible. Using the back button on the browser isn't actually using the product as in its final configuration and no effort should be made to add functionality that doesn't exist on the end device. The target devices have limited memory and apps should be as efficient as possible. This coming from a developer who first wrote software for a computer that had 4K of RAM. ;)

As for the couple of pages deep comment. Looking at where RIM is going with BB10, apps should flow. Going 5 pages in and then going back up 5 pages isn't flow. It takes some thought to organize your apps so it doesn't go deep into pages. The current app I am work on is more horizontal than deep with pages and functionality. It will never go more than 3 pages deep and that would only be in the configuration level, not at the everyday usage level. You need to give the user a simple experience, many pages deep isn't a simple experience.

tneil commented 12 years ago

Hi Adam,

If Ripple is properly emulating BB10 with the correct user agent then all the BB10 styling will work and the back buttons will all show up just like if you were running on a real device.

To interact with the app a developer will have to press the buttons in the app to navigate. When developing bbUI I personally use a PlayBook or Dev Alpha. I know that most people don't have these.. so Ripple is the best alternative.

The experience is the same... reload app and navigate to your screen.. you can do a few different things in your app to make it easier.

tneil commented 11 years ago

I'm going to close this issue for now unless I hear otherwise