Add collapsible Batch Connect app sidebar menus#5321
Open
iliketocode2 wants to merge 4 commits intoOSC:masterfrom
Open
Add collapsible Batch Connect app sidebar menus#5321iliketocode2 wants to merge 4 commits intoOSC:masterfrom
iliketocode2 wants to merge 4 commits intoOSC:masterfrom
Conversation
Contributor
|
I'm pretty sure you can implement this a lot easier with bootstrap collapse. I.e., you don't have to write your own javascript event handlers and so on. |
Author
|
Yes, this is an excellent call. Thank you for the feedback! I've implemented the bootstrap changes instead. |
Contributor
|
Thanks for the update. I have 2 things in mind:
|
Author
|
Made both changes-- The menus start expanded and the css is simplified further. I wasn't able to remove that much css as I need to ensure the chevron remains in the proper location, but let me know if you had an even more significant code reduction in mind and I can try a more serious rework. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is a proposed frontend change to the Batch Connect pages' left sidebar which lists many apps grouped in cards. On sites with large catalogs, that sidebar forces long vertical scrolling. This PR makes each app-group card collapsible: the header acts as a toggle; the list starts collapsed on every page load so users expand only what they need. This could later be expanded to also allow each subheader/subsection to collapse as well.
Implementation
Files:
_app_list.html.erb: The card header is a<button>with aria-expanded/aria-controls. The list region has an id built from a slug of the card title(parameterize(separator: "_"))to match the OODCONTRIBUTINGHTML id conventionssidebar_collapsible.js: Initializes cards collapsed onDOMContentLoadedandturbo:load;with a single click listener ondocument.sessions.scss: Added the relevant styles for the closed/open states (.is-open) and the chevronsapplication.js: Imports the sidebar module once with the main bundle.Tests:
batch_connect_sessions_test.rbasserting that the toggle behavior is correct viaaria-expandedandis-open.Results:
Collapsed menu when first navigating to an app page:

One manually opened section in the Interactive Apps page:
