Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Rework alert/confirm to be tab-modal (instead of application-modal) #7107

Merged
merged 6 commits into from
Feb 28, 2017
Merged

Rework alert/confirm to be tab-modal (instead of application-modal) #7107

merged 6 commits into from
Feb 28, 2017

Commits on Feb 28, 2017

  1. Rework alert/confirm to be tab-modal (instead of application-modal).

    Message box:
    - shows an on/off switch for "Prevent this page from creating additional dialogs". Fixes #3794
    - does not include Brave logo; shows origin; does not need to show "switch to tab" because it's already bound to tab. Fixes #2755
    - is shown BELOW tabs now. Fixes #6901
    - Fixes #7213
    
    Other changes include:
    - Removed "An embedded page at " from source message (shown on every message)
    - Rename showMessageBox/hideMessageBox/clearMessageBoxes actions to showNotification/hideNotification/clearNotification
    - Converted most styles to Aphrodite
    
    When active tab has an alert:
    - URL bar puts itself in title mode
    - disable / gray out lion icon
    - back/forward buttons are disabled
    - URL bar icon (lock, etc) is no longer clickable/draggable
    
    Includes first round of fixes (post-feedback)
    - renamed actions
    - unit tests for messageBoxState
    - component tests for MessageBox
    - update to state.md
    - MessageBox control responds properly to keyboard (escape / enter)
    - webdriver tests for alert/confirm
    
    TODO / WIP:
    - call callback if navigating away (click link, close tab, etc)
    - tests which ensure callback is cleaned up on crash/close of tab
    bsclifton committed Feb 28, 2017
    Configuration menu
    Copy the full SHA
    d19ce04 View commit details
    Browse the repository at this point in the history
  2. Reworked code (huge thanks to @bridiver)

    - Added webdriver tests for opening new tab / navigating when alert is open
    - created tests for the `app/browser/messageBox` code
    - created new tabMessageBoxReducer
    - renamed msgbox actions to be declarative
    - updated onDestroy/onCrashed to call callback and remove callback
    - added test to ensure on() handler is registered for webcontents
    - Moved `process.on` handlers for message box into the new reducer (`window-alert`, `window-confirm`, `window-prompt`)
    
    Includes some renaming to make things consistent
    
    Auditors: @bbondy, @bridiver
    bsclifton committed Feb 28, 2017
    Configuration menu
    Copy the full SHA
    70d86f8 View commit details
    Browse the repository at this point in the history
  3. Final touches for tab-modal alert/confirm:

    - Main.js component now properly disables shields button and hides extensions when active tab is showing an alert/confirm.
    - Message box for tab is now cleared (callback called + removed) when tab showing alert navigates
    - Removed destroy/crash handlers for webcontents in favor of APP_TAB_CLOSED action
    - Removed session test; replaced with a proper tab-specific session test
    bsclifton committed Feb 28, 2017
    Configuration menu
    Copy the full SHA
    f553910 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9118cf5 View commit details
    Browse the repository at this point in the history
  5. Fixes per peer review :)

    - "ok"/"cancel" are now localized
    - tests for notificationBar work great now (miss on my part after rebase)
    - aphrodite the dialog / drop the less change
    - const over let
    - no quotes on keys
    - alphabetize state.md
    
    Auditors: @NejcZdovc, @diracdeltas, @cezaraugusto
    bsclifton committed Feb 28, 2017
    Configuration menu
    Copy the full SHA
    8e67c8a View commit details
    Browse the repository at this point in the history
  6. Updated importer to use new tab-modal alert

    Auditors: @darkdh, @NejcZdovc
    
    I was easily able to test the happy path (showImportSuccess), but I am
    not sure how to test the other (showImportWarning).
    
    Also (per the comments in place), I don't anticipate any issues with
    the menu, but would like your input @darkdh :)
    bsclifton committed Feb 28, 2017
    Configuration menu
    Copy the full SHA
    b0a8f28 View commit details
    Browse the repository at this point in the history