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

821: Manual create #1093

Merged
merged 11 commits into from
Jan 3, 2020
Merged

821: Manual create #1093

merged 11 commits into from
Jan 3, 2020

Conversation

eliserichards
Copy link
Contributor

@eliserichards eliserichards commented Nov 26, 2019

Fixes #821

Testing and Review Notes

Designs: https://app.zeplin.io/project/5b6895bfe4af825140aa8dbc?seid=5c5490093af38330875be09c

Routes back to the item list after a successful save. Might do the routing to the newly created item on #822.

Screenshots or Videos

create_new_entry

image image

To Do

eng todo

  • + button
  • new login fragment
  • routes to/from itemlist, locked screen, item detail
  • feature flag
  • unit tests
  • hook up toggle password button
  • ripple on + button click

other

  • add “WIP” to the PR title if pushing up but not complete nor ready for review
  • double check the original issue to confirm it is fully satisfied
  • add testing notes and screenshots in PR description to help guide reviewers
  • add unit tests
  • request the "UX" team perform a design review (if/when applicable)
  • make sure CI builds are passing (e.g.: fix lint and other errors)
  • check on the accessibility of any added UI

@eliserichards eliserichards requested a review from a team as a code owner November 26, 2019 23:46
Copy link
Contributor

@jhugman jhugman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚚 🚌 🚗 Drive-by 🚏 🛑

Some things that come out of this:

  1. Naming conventions: can we work out a combination of words to show that there's some relationship between Create, Edit, Show, Item, View, Fragment and Presenter, and then rename all classes to fit that scheme. e.g.

CreateItem + View, Fragment, Presenter.
EditItem + View, Fragment, Presenter.
DisplayItem + View, Fragment, Presenter.

  1. There seems to be a massive similarity between CreateItem and EditItem, all the way up to the discard changes dialog. Can we re-factor EditItem fragment and presenter to allow some re-use? The answer to this may be "I tried, but it wasn't worth it".

  2. Could we start moving things into the ItemDetailStore. I have a feeling we'll get quite a long way by injecting the DataStore into the ItemDetailStore. e.g. how might we do duplicate username detection with the same code path as DisplayItemPresenter (née ItemDetailPresenter).

@@ -142,13 +143,15 @@ class AppRoutePresenter(

R.id.fragment_locked to R.id.fragment_item_list -> R.id.action_locked_to_itemList
R.id.fragment_locked to R.id.fragment_welcome -> R.id.action_locked_to_welcome
R.id.fragment_locked to R.id.fragment_create -> R.id.action_locked_to_manualCreate
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're able to create from the locked screen?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the app autolocks in the middle of create, do we want to discard everything? My assumption is that we would want to continue where we left off and continue from the create screen until we intentionally ❌ or ✅

@eliserichards
Copy link
Contributor Author

eliserichards commented Dec 5, 2019

I found the Item in EditItemFragment to be redundant. My preference would be to remove Item from the names altogether and stick with:

Create + View, Fragment, Presenter.
Edit + View, Fragment, Presenter.
ItemList + View, Fragment, Presenter
ItemDetail + View, Fragment, Presenter

That being said, I'm more than willing to be convinced 😌

@eliserichards eliserichards changed the title [WIP] 821: Manual create 821: Manual create Dec 6, 2019
@eliserichards
Copy link
Contributor Author

We arrived on the following for naming conventions:

CreateItem + View, Fragment, Presenter.
EditItem + View, Fragment, Presenter.
DisplayItem + View, Fragment, Presenter
ItemList + View, Fragment, Presenter

@eliserichards
Copy link
Contributor Author

@jhugman this needs some styling work. Looks like the view isn't applying the correct styles or managing the closeKeyboard functions the way that it should after I refactored the presenters. I would like a pair of eyes on this, or maybe an hour or so to ✨ pair ✨ on Monday if you have some bandwidth 😄

@jhugman
Copy link
Contributor

jhugman commented Dec 9, 2019

I would like a pair of eyes on this, or maybe an hour or so to ✨ pair ✨ on Monday if you have some bandwidth 😄

We can do both. :)

Copy link
Contributor

@jhugman jhugman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The closeKeyboard problem.

I'm fairly sure we just want to closeKeyboard when we move away from this screen, in which case we can call it from the fragment onPause method or call it from RoutePresenter when there is a change in route action.

@eliserichards
Copy link
Contributor Author

eliserichards commented Dec 9, 2019

  • Rename route actions to match new naming scheme for display/edit/create
  • Rename styles to match " "
  • order of calling super.x on new presenters
  • styles not set correctly
    • background on edit
    • background on create
    • title, colors, buttons on create
  • close keyboard from onPause onDestroyView not working anymore
  • can't click on side menu on item list after I put the floating + button on there
  • two sets of RouteAction.ItemList and RouteAction.DisplayItem(id) are being returned in edit presenter test.
    • Should only be one set.
    • Where is the other coming from? Setting isEditing = false twice somewhere?
  • Not setting sort order title on item list anymore after wrapping DrawerLayout in a ConstraintLayout -
    label.text = context.resources.getString(values[position].titleId)

@eliserichards
Copy link
Contributor Author

@jhugman I fixed the FAB issue, but I still have two outstanding issues (see my checklist in the last comment). Other than that the functionalities seem to be working as expected.

Copy link
Contributor Author

@eliserichards eliserichards left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When initially opening the create screen, hostname and password fields default to the error state

image

**Moved to new issue: ** #1120

@changecourse
Copy link
Contributor

Moving a conversation I had with @jhugman in slack to this PR:

essentially, in almost all use cases, a user shouldn't see these inline errors until they've actually made a misstep. I think the error messages should only be visible once someone leaves focus, and we've checked that they hadn't met the requirements.

So as a use case, someone comes to this screen after hitting the + button...

  1. no errors yet present, field focused on web address, keyboard expanded
  2. upon entering a web address and navigating to the next field (username) we do a client-side check on the web address. if it is not meeting requirements we then throw the client-side error to the web address field
  3. same sort of logic for other fields... we assume that someone is not going to type a duplicate or leave a field blank, so we don't show any errors until they've actively demonstrated that they have ignored requirements, by navigating into AND out of a given field

@jhugman
Copy link
Contributor

jhugman commented Jan 2, 2020

@changecourse I'd like to move this into a follow up issue. This PR is big enough and long running enough to get this landed before more work goes into it.

Elise Richards and others added 5 commits January 2, 2020 11:15
Add click route for item list create button. Add icon on create button.

Tests for item list and create presenter

Update credentials to save

Cleanup and passing tests

Ripple click on + button

Password visibility tests

Field titles instead of hints

Rename edit view. Cleanup presenters and tests

Lint and datastore add test
…esenter for create and edit shared functionality.

First pass on mutation presenter

Refactoring presenters
…ounds and styles correctly for edit and create. Close keyboard onpause and ondestroy.

Item list button and drawer working.

Rebase and set cursor color on create hostname field

Restore sort spinner

Fixup EditItemPresenterTest

Fixup DisplayItemStoreTest

ktlintFormat

Refactor error observation.

WIP pairing. Moving credentialToSave to an Observable

Manual create refactored

This brings a lot of the logic from gathering data about the edit session in to the `ItemDetailStore`.

 * `availableUsernames`
 * `isDirty`
 * `isEditing`.

This allows us to have a much heavier `ItemMutationPresenter`, which is only lightly specialized by `EditItemPresenter` and `CreateItemPresenter`.

With this store, we introduce the concepts of an edit/create session, which the store manages for us.

Finish refactoring presenters

Begin to unify fragments

Trying to get create and edit fragments working together, with separate XML files.
Both create and edit working as expected, with errors

Making save more consistent and safer

Fixup the correct field to be editing

ktlintFormat
Moved tests to use the more heavy weight item detail store, and lighter presenters.

We're still not testing the mutate item presenters explicitly, but test coverage seems fairly sane.
Copy link
Contributor

@jhugman jhugman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elise says it's ok. I say it's ok. Bitrise it's ok. BGB.

@jhugman jhugman merged commit 0dfe1a1 into master Jan 3, 2020
@jhugman jhugman deleted the 821-manual-create branch January 3, 2020 17:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create entry view and routing
3 participants