harvard-lil / h2o

H2O is a web app for creating and reading open educational resources, primarily in the legal field
https://opencasebook.org
GNU Affero General Public License v3.0
36 stars 30 forks source link

Refactor Quick Add to require fewer clicks and reduce boilerplate #1980

Closed lizadaly closed 1 year ago

lizadaly commented 1 year ago

This is another somewhat monolithic change to the frontend, to rewrite the Quick Add component that appears at the bottom of the table of contents.

Includes the following issues:

Before

Status quo is the user enters a case name in the Quick Add, then a temporary item is added, then they click "Specify Document", then they click "Search", then they pick the results (they have to click directly on the title, not the row), then the item is changed in place.

https://user-images.githubusercontent.com/19571/230987676-05cdcfad-0c69-40e1-b71c-7ac311c07ee4.mov

After

Now the search form is embedded in the Quick Add, so when either automatically (by a matching regular expression) or manually (by pulling the dropdown to Legal Documents), the search happens inline, and the matching item is inserted in place. This reduces the number of clicks from at least 4 to 2.

https://user-images.githubusercontent.com/19571/230987720-74c6b7d3-8395-4bb1-aada-612c0fb38a70.mov

The other functionality is unchanged: users can still paste links from within H2O to auto-clone, paste whole outlines, or add sections or custom content as before.

Under the hood changes

@cath9 and I will probably iterate on this on staging before it gets to prod.

bensteinberg commented 1 year ago

unWait() sounds like it's up Matteo's alley, like unClude()