New issue
Advanced search Search tips

Issue 900188 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Task



Sign in to add a comment

Ditch paper-tabs from discards WebUI

Project Member Reported by siggi@chromium.org, Oct 30

Issue description

FWIW, we are trying to remove paper-* dependencies as much as possible going forward. Could you explore if cr-view-manager at [1] can be used here instead of <paper-tab>? Again, this is for a separate CL.

[1] https://cs.chromium.org/chromium/src/ui/webui/resources/cr_elements/cr_view_manager/cr_view_manager.html
 
Cc: dpa...@chromium.org
I took a quick look at this, and I can't figure out how to hold cr-view-manager from the sources. There aren't really any docs, and only one example of use-in-anger.
It looks like perhaps this is just a convenience element to provide the switchView() function, and everything else has to be done by the enclosing elements and logic?
Linked to the wrong CL. Here is the correct link https://chromium-review.googlesource.com/c/chromium/src/+/1327420.
> It looks like perhaps this is just a convenience element to provide the switchView() function, and everything else has to be done by the enclosing elements and logic?

Also, cr-view-manager takes care of the transition animations, as well as properly styling the active and non-active views (where by "styling" I mean hiding/showing).

The enclosing element's responsibility is to simply call switchView(viewId) as necessary, where |viewId| should match the ID of an element that has slot="view".
I agree that the cr-view-manager documentation needs improvement (it is basically non-existent).

The other fairly convenient functionality that it provides is to fire the following 4 events on the views that are entered/exited.
view-enter-start (start of animation)
view-enter-finish (end of animation)
view-exit-start
view-exit-finish

These can be very useful, for example if you need to focus a certain UI element once a view becomes active.
Thanks, I can now hold cr-view-manager right. I started looking into replacing the paper-tabs with cr-toolbar, but that seems like overkill. Can you recommend (and point to) some way for making the "one from closed set of views" selection?
> I started looking into replacing the paper-tabs with cr-toolbar, but that seems like overkill. 

cr-toolbar is not equivalent to paper-tabs

> Can you recommend (and point to) some way for making the "one from closed set of views" selection?

I don' think we have our own "cr" equivalent element for this. iron-selector [1] could be an alternative to paper-tabs, but this is still a 3rd party dependency, so probably not worth migrating to.

[1] https://cs.chromium.org/search/?q=%22%3Ciron-selector%22+-file:third_party+-file:infra+-file:out/Debug+-file:out/chromium-android/Debug+-file:out/android-Debug+-file:src/v8+-file:src/native_client-sdk+-file:src/out/&type=cs

Sign in to add a comment