Skip to content
This repository has been archived by the owner on Sep 29, 2022. It is now read-only.

Fix SplitButtonComponent #217

Open
4 of 6 tasks
nileshtrivedi opened this issue Oct 27, 2020 · 3 comments
Open
4 of 6 tasks

Fix SplitButtonComponent #217

nileshtrivedi opened this issue Oct 27, 2020 · 3 comments
Labels

Comments

@nileshtrivedi
Copy link
Contributor

nileshtrivedi commented Oct 27, 2020

We're now using view_component to organize UI components. We use TailwindCSS for styling and AlpineJS for dynamic/interactive behaviour (such as dropdowns). There is now a demo page for WIP components.

Here's the SplitButtonComponent that uses AJAX to change user's review status for an item:

image

The following fixes need to be made before this can be called complete:

  • Dropdown should be rendered with isopen=true if user clicked on a collection item in the dropdown, but isopen=false otherwise
  • After choosing a status, on hover, the tick mark should be replaced with a cross mark. As example, see how it works at GoodReads. However, relying on onhover events may not be a good idea for mobiles and touch screen devices.
  • Show some kind of progress indicator ("saving..." or a spinner) while making AJAX calls. Similar to how OpenLibrary does it.
  • In-place form (like GoodReads) or a modal (like OpenLibrary) for creating a new collection rather than reloading the page and losing context.
  • After creating a new collection, all SplitButtonDropdowns on the page should have that collection listed. This is going to be tricky because each instance of SplitButtonComponent is tied to an item and the collection name points to collections#toggle_item action via an AJAX post.
  • Fix styling

The code for this component can be found in https://github.com/learn-awesome/learn/blob/master/app/components/split_button_component.html.erb and https://github.com/learn-awesome/learn/blob/master/app/components/split_button_component.rb

@rajpratyush
Copy link

can i work on this??

@nileshtrivedi
Copy link
Contributor Author

@rajpratyush This is mostly completed. If you want, you can take a stab at: #160

We can have a call tomorrow (Sunday) so I can walk you through the codebase and improvements needed urgently.

@rajpratyush
Copy link

Surely we can have a google meet call by evening

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants