Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorporate Label UI changes from ceo_ebike_project_stage into master #794

Merged
merged 38 commits into from
Aug 20, 2021

Commits on Aug 19, 2021

  1. Merge branch 'master' of https://github.com/e-mission/e-mission-phone

    …into ceo_ebike_project_stage
    GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    37865e5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6f90217 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7486606 View commit details
    Browse the repository at this point in the history
  4. Merge pull request e-mission#767 from GabrielKS/ceo_ebike_project_stage

    Add new label UI
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    b2daad2 View commit details
    Browse the repository at this point in the history
  5. Reverse scrolling direction of Label screen

     + As requested by Shankari, the Label screen now loads the most recent
       trips at the bottom and one scrolls up to load more (like a chat app)
     - The implementation is a bit hacky because the ion-infinite-scroll
       element cannot implement this behavior for us in this old version of
       Ionic
     - Does not yet reverse the direction of the trip start/end time markers
    
    Tested on both iOS and Android, but would appreciate it if someone else
    tested it as well before it gets merged.
    GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    479e330 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    a9d03e5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    1ac175b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    106647f View commit details
    Browse the repository at this point in the history
  9. Track when the verify button is pressed + robustness fixes

    - Add the ClientStats module to infinite scroll
    - Add a new kind of client stat
    - Mark the stat when the button is pressed
    
    Testing done:
    - Hacked the code to ensure that verifiability is always set to "can-verify"
    - Verified the trip
    - "End trip and force sync"
    - Confirmed that the value was pushed
    ```
    2021-08-04 15:37:25,004:DEBUG:123145498861568:Updated result for user = 113aef67-400e-4e21-a29f-d04e50fc42ea, key = stats/client_nav_event, write_ts = 1628116460.869 = {'n': 1, 'nModified': 0, 'upserted': ObjectId('610b16a53906cf6a2964f11b'), 'ok': 1.0, 'updatedExisting': False}
    2021-08-04 15:37:25,005:DEBUG:123145498861568:Updated result for user = 113aef67-400e-4e21-a29f-d04e50fc42ea, key = stats/client_nav_event, write_ts = 1628116560.485 = {'n': 1, 'nModified': 0, 'upserted': ObjectId('610b16a53906cf6a2964f11d'), 'ok': 1.0, 'updatedExisting': False}
    2021-08-04 15:37:25,007:DEBUG:123145498861568:Updated result for user = 113aef67-400e-4e21-a29f-d04e50fc42ea, key = stats/client_time, write_ts = 1628116588.745 = {'n': 1, 'nModified': 0, 'upserted': ObjectId('610b16a53906cf6a2964f11f'), 'ok': 1.0, 'updatedExisting': False}
    ```
    - Confirmed that the value was in the usercache at the end
    
    ```
    edb.get_usercache_db().find({"metadata.key": "stats/client_nav_event"}).distinct("data.name")
    ['app_launched',
     'checked_diary',
     'checked_inf_scroll',
     'expanded_trip',
     'notification_open',
     'opened_app',
     'sync_launched',
     'verify_trip']
    ```
    
    + two robustness fixes where we check for the inferred labels and the
    expectation before using them. These should not occur but it is good to avoid
    crashing if they do!
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    ad02145 View commit details
    Browse the repository at this point in the history
  10. Merge pull request e-mission#770 from shankari/ceo_ebike_project_stage

    Track when the verify button is pressed + robustness fixes
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    0564477 View commit details
    Browse the repository at this point in the history
  11. Set the default tab on startup to "label"

    So people can access `to_label` as the first thing.
    Requested by one of the 4CORE admins
    
    Testing done:
    - launched the app
    - label screen was shown first
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    bc88af9 View commit details
    Browse the repository at this point in the history
  12. Merge pull request e-mission#769 from GabrielKS/labels_chron

    Reverse Label screen scrolling direction
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    91fe1c7 View commit details
    Browse the repository at this point in the history
  13. Add further Label screen instrumentation

     + Track when the user switches between filter tabs
     + Track existing green and yellow labels present when trips are verified
     + Track existing green and yellow labels present when labels are selected
    
    Tested by verifying that the desired messages appear in the backend database
    GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    26fc305 View commit details
    Browse the repository at this point in the history
  14. Verify trip instrumentation bugfix

     + Log existing information before we change it!
    GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    94dbf2b View commit details
    Browse the repository at this point in the history
  15. Merge pull request e-mission#772 from GabrielKS/ceo_ebike_project_stage

    Add further Label screen instrumentation
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    c460eba View commit details
    Browse the repository at this point in the history
  16. Merge branch 'master' of https://github.com/e-mission/e-mission-phone

    …into ceo_ebike_project_stage
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    6df4eea View commit details
    Browse the repository at this point in the history
  17. Enable zoom on the label screens as well

    **This is a test**
    It can address some of the feedback about figuring out which trip is being
    displayed.
    
    Testing done:
    - Displayed in the emulator
    - Experimented with zooming
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    e136b62 View commit details
    Browse the repository at this point in the history
  18. Switch the infinite scroll from auto-load on scroll to a button

    The auto-load on scroll feature, so common to messaging and chat apps is
    actually fairly complicated to implement correctly in the case in which
    we display a filtered list. In particular:
    - the additional scrolling required to maintain "place" in the list triggers
      multiple "scroll" calls even when the user is not doing anything, which leads
      to multiple calls to the server.
    - if new entries are not added to the list after the server call, then the
      condition that triggered the server call (top < threshold) persists, leading
      to multiple calls again.
    
    See e-mission/e-mission-docs#662
    
    This is an inherent limitation of using auto-load on scroll for a
    filtered list and also happens with the standard ionic component,
    e-mission/e-mission-docs#662 (comment)
    
    So instead of butting my head against the wall getting auto-load to work, I
    switched to manual load, similar to the diary screen.
    e-mission#769
    
    As a bonus, this also helps with e-mission/e-mission-docs#659
    It indicates how many of the trips are displayed in **this filter**, should
    help to clarify questions around "missing trips" and allow users to explore
    other tabs as necessary.
    
    Testing done:
    - loaded data for a user with a single trip
    - labeled that trip so the user had no trips
    - loaded data for a user with multiple trips
    
    In all cases, used the button to scroll all the way to the oldest trip.
    Did not encounter any issues.
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    94a0ba6 View commit details
    Browse the repository at this point in the history
  19. Scroll to the bottom when switching to different filters

    This fixes one of the minor fit-and-finish issues
    "If you go to "All Trips", you are at the top, showing the oldest trips, and have to scroll all the way to the bottom"
    from e-mission/e-mission-docs#662
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    4afbad1 View commit details
    Browse the repository at this point in the history
  20. Fix minor issues from review

    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    bbce82c View commit details
    Browse the repository at this point in the history
  21. Merge pull request e-mission#785 from shankari/fix_long_load_when_no_…

    …to_label
    
    Switch the infinite scroll from auto-load on scroll to a button
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    2492217 View commit details
    Browse the repository at this point in the history
  22. Display the start date **and end date** for the processed trips

    So users can figure out whether the trips are delayed or just in the other
    filters.
    
    Testing done:
    - Loaded data, confirmed that the start and the end were displayed
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    9d9612f View commit details
    Browse the repository at this point in the history
  23. Display the time as well

    Because as the long day wears on, it is increasingly likely that we would have
    processed some trips but not others.
    
    Testing done:
    Checked that the time was updated
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    42e88de View commit details
    Browse the repository at this point in the history
  24. Merge pull request e-mission#786 from shankari/fix_long_load_when_no_…

    …to_label
    
    Display the start date **and end date** for the processed trips
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    dcf2a32 View commit details
    Browse the repository at this point in the history
  25. Delay the deletion of entries from the To Label screen

    to give users a chance to correct the trip.
    
    The implementation is fairly straightforward.
    - as a trip is modified, set its `waiting for modification` flag to true
    - ensure that trips that are waiting for modification are not filtered out
    - create a timeout to set the flag to false and recompute
    - cancel any existing timeouts to avoid recomputations
    
    Testing done:
    - Set all three labels for a trip
    - Saw the logs:
    
    Open first popover, create new timeout promise, nothing to cancel
    
    ```
    DEBUG:in openPopover, setting draftInput = {"start_ts":1628366684.0019567,"end_ts":1628367280.652}
    DEBUG:in storeInput, after setting input.value = walk, draftInput = {"start_ts":1628366684.0019567,"end_ts":1628367280.652,"label":"walk"}
    DEBUG:trip starting at 2021-08-07T13:04:44.001957-07:00: creating new timeout
    DEBUG:trip starting at 2021-08-07T13:04:44.001957-07:00: cancelling existing timeout undefined
    ```
    
    Open second popover, create new timeout promise, cancel previous
    
    ```
    DEBUG:in openPopover, setting draftInput = {"start_ts":1628366684.0019567,"end_ts":1628367280.652}
    DEBUG:in storeInput, after setting input.value = home, draftInput = {"start_ts":1628366684.0019567,"end_ts":1628367280.652,"label":"home"}
    ionic.bundle.js:3063 [Violation] 'touchend' handler took 150ms
    DEBUG:trip starting at 2021-08-07T13:04:44.001957-07:00: creating new timeout
    DEBUG:trip starting at 2021-08-07T13:04:44.001957-07:00: cancelling existing timeout [object Object]
    ionic.bundle.js:5301 [Intervention] Ignored attempt to cancel a touchstart event with cancelable=false, for example because scrolling is in progress and cannot be interrupted.
    self.touchStart @ ionic.bundle.js:5301
    ```
    
    Open third popover, create new timeout promise, cancel previous
    
    ```
    DEBUG:in openPopover, setting draftInput = {"start_ts":1628366684.0019567,"end_ts":1628367280.652}
    DEBUG:in storeInput, after setting input.value = bike, draftInput = {"start_ts":1628366684.0019567,"end_ts":1628367280.652,"label":"bike"}
    DEBUG:trip starting at 2021-08-07T13:04:44.001957-07:00: creating new timeout
    DEBUG:trip starting at 2021-08-07T13:04:44.001957-07:00: cancelling existing timeout [object Object]
    ```
    
    After a significant time, recompute
    
    ```
    DevTools failed to load SourceMap: Could not load content for http://10.0.2.2:3000/socket.io/socket.io.js.map: Connection error: net::ERR_CONNECTION_TIMED_OUT
    DEBUG:trip starting at 2021-08-07T13:04:44.001957-07:00: executing recompute
    ```
    
    - Set two labels for a trip and then the third
    
    Set first two labels
    
    ```
    DEBUG:in openPopover, setting draftInput = {"start_ts":1628294651.152,"end_ts":1628297929.551}
    DEBUG:in storeInput, after setting input.value = walk, draftInput = {"start_ts":1628294651.152,"end_ts":1628297929.551,"label":"walk"}
    DEBUG:trip starting at 2021-08-06T17:04:11.152000-07:00: creating new timeout
    DEBUG:trip starting at 2021-08-06T17:04:11.152000-07:00: cancelling existing timeout undefined
    DEBUG:in openPopover, setting draftInput = {"start_ts":1628294651.152,"end_ts":1628297929.551}
    DEBUG:in storeInput, after setting input.value = work, draftInput = {"start_ts":1628294651.152,"end_ts":1628297929.551,"label":"work"}
    DEBUG:trip starting at 2021-08-06T17:04:11.152000-07:00: creating new timeout
    DEBUG:trip starting at 2021-08-06T17:04:11.152000-07:00: cancelling existing timeout [object Object]
    ```
    
    Recompute is run, but the trip is not filtered because only two labels are filled out
    
    ```
    DEBUG:trip starting at 2021-08-06T17:04:11.152000-07:00: executing recompute
    ```
    
    Third label is filled out
    
    ```
    DEBUG:in openPopover, setting draftInput = {"start_ts":1628294651.152,"end_ts":1628297929.551}
    DEBUG:in storeInput, after setting input.value = no_travel, draftInput = {"start_ts":1628294651.152,"end_ts":1628297929.551,"label":"no_travel"}
    DEBUG:trip starting at 2021-08-06T17:04:11.152000-07:00: creating new timeout
    DEBUG:trip starting at 2021-08-06T17:04:11.152000-07:00: cancelling existing timeout undefined
    ```
    
    Final recompute is called and trip is filtered
    
    ```
    DEBUG:trip starting at 2021-08-06T17:04:11.152000-07:00: executing recompute
    ```
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    6c2c05e View commit details
    Browse the repository at this point in the history
  26. Merge pull request e-mission#787 from shankari/fix_long_load_when_no_…

    …to_label
    
    Delay the deletion of entries from the To Label screen
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    7fb2be2 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    5cc956d View commit details
    Browse the repository at this point in the history
  28. Merge pull request e-mission#790 from shankari/fix_long_load_when_no_…

    …to_label
    
    Change the delete delay to 30 sec + add day of the week for clarity
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    4229a24 View commit details
    Browse the repository at this point in the history
  29. Create walkthrough for new label UI

     + Make room for walkthrough button on Label navbar
     + Add walkthrough tour targets and content
    GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    8113fcc View commit details
    Browse the repository at this point in the history
  30. Automatically launch walkthrough on first viewing new label UI

     + That plus a few final tweaks to the walkthrough itself
    GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    45ba2d0 View commit details
    Browse the repository at this point in the history
  31. Minor fine-tuning

     + Go back to using col-XX for width
     + Use Promise instead of $q
    GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    5d66146 View commit details
    Browse the repository at this point in the history
  32. Merge pull request e-mission#791 from GabrielKS/new_label_walkthrough

    Walkthrough for new label UI
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    90eb584 View commit details
    Browse the repository at this point in the history
  33. Configuration menu
    Copy the full SHA
    1e81261 View commit details
    Browse the repository at this point in the history
  34. Merge pull request e-mission#792 from GabrielKS/new_label_walkthrough

    Temporarily disable auto loading of walkthrough
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    3d6f274 View commit details
    Browse the repository at this point in the history
  35. Minor fix for localization

    GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    38be14d View commit details
    Browse the repository at this point in the history
  36. Merge pull request e-mission#793 from GabrielKS/ceo_ebike_project_stage

    Minor fix for localization
    shankari authored and GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    048c34f View commit details
    Browse the repository at this point in the history
  37. Apply trip_confirm_options change from ceo_ebike_project_stage

     + Replays e-mission@9a56787
       (which is included in e-mission@86cd8f3)
     - Note that there remain older differences between the CanBikeCO trip_confirm_options.json and this sample
    GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    de00dbb View commit details
    Browse the repository at this point in the history
  38. Revert "Hack to fix label card spacing"

    This reverts commit 12ac1d2.
    GabrielKS committed Aug 19, 2021
    Configuration menu
    Copy the full SHA
    9112d4b View commit details
    Browse the repository at this point in the history