• Noel Gordon's avatar
    [toast] FilesApp toaster should use cr-element <cr-toast> · 6488736e
    Noel Gordon authored
    Rewrite the toaster in terms of <cr-toast> which supports animating the
    toast on and off the screen using CSS transitions effects, has in-built
    ARIA support, and provides <slot>s for inserting the toast text element
    <div> and action <cr-button>.
    
    Styling this component for ChromeOS files-ng: <cr-toast> mostly does it
    for us with little extra work. We only need to control toast min-height
    and number of lines shown (at most 2), a few margins and one background
    color. Delete all our CSS that <cr-toast> now does for us.
    
    Elevation +2 shadows are the <cr-toast> default internal style and flex
    display too. Users must add justify-content: space-between to keep text
    pinned to the left and the action button pinned to the right.
    
    The default <cr-toast> position is 24px,24px from the lower-left corner
    so CSS move it to the lower-right corner in LTR per FilesApp usage.
    
    The toast duration is controlled by that <cr-toast> attribute: add that
    attribute in markup and use the same value as before: 5000 ms.
    
    Update the externs file definition (it was out-of-date) and add TODO to
    fix <cr-toast> iron-a11y-announcer BUILD.gn deps issue. Remove ES6 lint
    exceptions, add comments, add closure markup.
    
    Fix UI test sharing tests: <cr-toast> fails to work in that system. Add
    <files-toast> mock to workaround that failure.
    
    Test: browser_tests --gtest_filter="FilemanagerJsTest*FilesToast"
    Bug: 1002391, 1033660
    Change-Id: I06113a6bcdc564bc374df559a3830a2a9df031f5
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2208166
    Commit-Queue: Noel Gordon <noel@chromium.org>
    Reviewed-by: default avatarAlex Danilo <adanilo@chromium.org>
    Reviewed-by: default avatarLuciano Pacheco <lucmult@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#770964}
    6488736e
files_elements.js 663 Bytes