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

Improve usability mobile/tablet #664

Merged
merged 9 commits into from
Jul 26, 2022
Merged

Improve usability mobile/tablet #664

merged 9 commits into from
Jul 26, 2022

Conversation

caseyhans
Copy link
Collaborator

Removes the authentication check for hiding the sidebar. This lets users (especially on mobile) hide the sidebar without needing to be logged in.

Copy link
Owner

@shapiromatron shapiromatron left a comment

Choose a reason for hiding this comment

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

I took this a little further now. We still need to make sure it renders ok depending on the PRIME/EPA flavor, as well as just general cleanup of the code where appropriate.

I think this could work well, what do you think?

@shapiromatron shapiromatron marked this pull request as draft July 21, 2022 19:17
@shapiromatron shapiromatron changed the title Removes sidebar authentication Improve usability mobile/tablet Jul 21, 2022
@shapiromatron
Copy link
Owner

One other thought. We could also set an indeterminate state for the request session; if the browser width its less than 500 or something small, set to collapsed mode by default:

@shapiromatron
Copy link
Owner

@casey1173 is this one ready?

@caseyhans
Copy link
Collaborator Author

caseyhans commented Jul 25, 2022

@casey1173 is this one ready?

yeah, but I had trouble recreating that bug we saw this morning

@shapiromatron
Copy link
Owner

shapiromatron commented Jul 25, 2022 via email

@caseyhans
Copy link
Collaborator Author

caseyhans commented Jul 25, 2022

Ok, would you mind describing the bug and I'll keep on the lookout for it during my review?

Sure! When the sidebar was minimized the hamburger popup button disappeared, but there were still invisible links. This was on an assessment page (aka from the assessment_rooted page; the crumbless menu popup is meant to disappear when there are not any options to display).

@shapiromatron shapiromatron marked this pull request as ready for review July 25, 2022 22:33
Copy link
Owner

@shapiromatron shapiromatron left a comment

Choose a reason for hiding this comment

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

LGTM - made a few minor comments, but please merge if you're happy w/ my changes!

@@ -16,6 +17,11 @@ const toggleSidebarCollapse = function(isCollapsed, submit) {
if (document.getElementById("sidebar-container") === null) {
return;
}
if ($("#sidebar-container").data("collapsed") == "empty") {
if ($(document).width() < 500) {
Copy link
Owner

Choose a reason for hiding this comment

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

changed to 576 and left a comment to why

Copy link
Owner

Choose a reason for hiding this comment

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

also changed word to unset

@@ -54,8 +54,8 @@ const setupAjax = document => {
};

$(document).ready(() => {
sidebarStartup();
tryWebAppStartup();
setupAjax(document);
Copy link
Owner

Choose a reason for hiding this comment

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

i moved setupAjax to the beginning; should have been that way from the beginning...

@@ -6,6 +6,7 @@ const toggleSidebarCollapse = function(isCollapsed, submit) {
.data("collapsed", isCollapsed)
.toggleClass("sidebar-collapsed", isCollapsed);
$("#toggle-sidebar").html(toggleText);
$(".sidebar-link-holder").toggleClass("hidden");
Copy link
Owner

Choose a reason for hiding this comment

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

renamed to sidebar-link-dropdown

Copy link
Owner

Choose a reason for hiding this comment

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

also added the expected class value since we know it; makes it more deterministic

@shapiromatron
Copy link
Owner

@casey1173 the JS got me thinking that we were replicating some CSS features - an alternative approach to this is ready for review in #672

@shapiromatron shapiromatron merged commit 4f0fa32 into main Jul 26, 2022
@shapiromatron shapiromatron deleted the sidebar-authentication branch July 26, 2022 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants