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

SUL23-605: fine tuning the sul people page. #204

Merged
merged 7 commits into from
Aug 28, 2024
Merged

Conversation

jenbreese
Copy link
Contributor

@jenbreese jenbreese commented Aug 15, 2024

READY FOR REVIEW

Summary

  • The toggle functionality redone. "Toggle should only allow for one selection (like radio button group behavior)"
  • Made the search box full width on mobile.
  • Updated the font sizes for the toggles. SM is 14px. Medium and up is 16px
  • Updated the padding on the toggles.
  • Put a nowrap on the toggles

Review By (Date)

  • 8/19

Criticality

  • Normal

Urgency

  • Normal

Review Tasks

Setup tasks and/or behavior to test

  1. Navigate to https://su-library-git-sul23-605-specialists-stanford-libraries.vercel.app/test-list-page
  2. Verify the changes above.

Site Configuration Sync

  • Is there a config:export in this PR that changes the config sync directory?

Front End Validation

Backend / Functional Validation

Code

  • Are the naming conventions following our standards?
  • Does the code have sufficient inline comments?
  • Is there anything in this code that would be hidden or hard to discover through the UI?
  • Are there any code smells?
  • Are tests provided? eg (unit, behat, or codeception)

Code security

General

  • Is there anything included in this PR that is not related to the problem it is trying to solve?
  • Is the approach to the problem appropriate?

Affected Projects or Products

  • Does this PR impact any particular projects, products, or modules?

Associated Issues and/or People

- SUL23-601
- SUL23-605

Resources

Copy link

vercel bot commented Aug 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
su-library ✅ Ready (Inspect) Visit Preview Aug 28, 2024 5:58pm

@@ -53,8 +53,10 @@ const SulPeopleTableView = ({items, hasHeading}: Props) => {
const existingIndex = newState.indexOf(type)
if (existingIndex >= 0) {
newState.splice(existingIndex, 1)
console.log("newState splice line")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @pookmish I want to change the toggle behavior for the specialist. The ticket says "Toggle should only allow for one selection (like radio button group behavior)". I changed the buttons from checkboxes to radio and removed the group hover because it seemed to confuse thing. I added console logs and it doesn't seem to go to the splice part of the if. and the link 59 logs out two comments per click.

Can you point me in the correct direction?

Copy link
Contributor

@pookmish pookmish Aug 16, 2024

Choose a reason for hiding this comment

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

You are going to have to refactor a lot of the onClick and state setup to get such a thing to work.

Copy link
Contributor

Choose a reason for hiding this comment

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

Keep in mind that if we change them to radio buttons, we will have to show the "All Specialists" on mobile as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, they want to have the All there now too. They changed it to just All.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. Would you like me to update this PR using radios?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was reading an article and trying to get it to work. Let me see if I figure it out.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, can you update the PR with radios?

Copy link
Contributor

Choose a reason for hiding this comment

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

I've updated the PR. See the last commit to familiarize yourself with this approach. It's more simple than the checkboxes.
Note that you will need to have some "checked" states. Use peer-checked:.... on the <span> tags immediately after the <input> tags.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was helpful to see. It is a lot simpler.

Copy link
Contributor

@pookmish pookmish left a comment

Choose a reason for hiding this comment

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

I'm not sure if you intended to assign to me already. It still requires active states for each of the 3 options. I'll remove myself as assigned until you are ready.

@pookmish pookmish removed their assignment Aug 16, 2024
@jenbreese
Copy link
Contributor Author

That was a mistake. I added the background color/opacity on the hover and active state. Only the selected or focus toggle radio button needs to have the additional border. (I double checked the designs)

@jenbreese
Copy link
Contributor Author

When you are back, this is ready for your review.

@jenbreese jenbreese changed the title SUL23-605: fine tuning SUL23-605: fine tuning the sul people page. Aug 22, 2024
/>
<span className="block items-center rounded-l-full border border-r-0 border-black-80 p-9 pr-20 text-18 no-underline group-hover:border-cardinal-red-dark group-hover:text-cardinal-red-dark group-hover:underline peer-checked:bg-[#979694] peer-checked:bg-opacity-20 peer-focus:border-2 peer-focus:border-black-80 peer-focus:bg-[#979694] peer-focus:bg-opacity-10 md:rounded-l-none">
<span className="block items-center whitespace-nowrap border border-r-0 border-black-80 p-4 px-16 text-14 leading-[30px] no-underline group-hover:border-cardinal-red-dark group-hover:text-cardinal-red-dark group-hover:underline peer-checked:bg-[#979694] peer-checked:bg-opacity-20 peer-hover:bg-[#979694] peer-hover:bg-opacity-10 peer-focus:border-2 peer-focus:border-black-80 peer-focus:bg-[#979694] peer-focus:bg-opacity-10 peer-active:bg-[#979694] peer-active:bg-opacity-10 md:rounded-l-none md:text-16">
Copy link
Contributor

Choose a reason for hiding this comment

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

As I mentioned, you need peer-checked. peer-active is only when the user is actively engaged on the element. as soon as they click/focus off the element, those styles are lost. Also, to my knowledge, a simple background color indicator as this is not sufficient for accessibility. The gray does not have a high enough contrast with the white to indicate its selected state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you. I see what you mean. They are going to make some changes to these toggles so I'll bring up the accessibility part and make those changes in this PR, unless you have concerns about that.

Copy link
Contributor

Choose a reason for hiding this comment

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

No concerns other than what I mentioned. If it helps anything, this is what we did on Press: https://stanford-university-press.vercel.app/books/award-winners

Copy link
Contributor

Choose a reason for hiding this comment

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

Also FWIW, the contrast needs to be 3:1

@github-actions github-actions bot added size/l and removed size/xs labels Aug 28, 2024
@pookmish pookmish merged commit 703ae1d into 1.x Aug 28, 2024
4 of 5 checks passed
@pookmish pookmish deleted the SUL23-605-specialists branch August 28, 2024 17:56
imonroe added a commit that referenced this pull request Sep 11, 2024
* SUL23-540: Updated robots.txt to disallow /all/ (#166)

* Better automated tests & Gitpod by building a cloned site (#165)

* Remove node cache to improve cache invalidation for config pages (#168)

* SUL23-515 SUL23-541: Colors, fonts, word fixes to the toggles. (#169)

* SUL23-515 SUL23-541: Colors, fonts, word fixes to the toggles.

* Keyword search filter stubbed out (#156)

* Keyword search filter stubbed out

* SUL23-503: fixup to search box styles

* fixup to styles

* moved over the search cursor

* Fix label

* fixup to the button toggles

---------

Co-authored-by: Jen Breese-Kauth <[email protected]>

* SUL23-525: Updates to the display for Med breakpoint on Branches and Centers (#170)

* SUL23-525: stashing work.

* SUL23-525: using grid to get alignment and display for md view

* Changed three tabular layouts to use the grid at the md breakpoint

* fixup to comment

* SUL23-438: Moved the location link and changed to Open or Closed until (#163)

Co-authored-by: Mike Decker <[email protected]>

* SUL23-479: added space (#176)

* SUL23-549: places to study alignment (#172)

* SUL23-549: places to study alignment

* SUL23-570: adding the corrected times to the places to study table (#175)

* SUL23-550: Move the condition so the td element remained even when empty (#171)

* SUL23-550: Move the condition so the td elmement remained even when empty

* fixup

* SUL23-548 SUL23-553 SUL23-554 SUL23-555 SUL23-556 SUL23-547 (#173)

* SUL23-548 SUL23-553 SUL23-554 SUL23-555 SUL23-556 SUL23-547

* fixup

* fixup

* fixup

* SUL23-543: rounded corner

* SUL23-557: adding aria-hidden and tabindex for a11y to photos on tabular data tables (#177)

* SUL23-557: stashing work to ask about tomorrow

* SUL23-557: fixup for the tabindex

* fixup to branch  page

* SUL23-557: removed the link on the image in the study places

* Adjust how library hours data is cached to reduce cache writes/reads (#178)

* SUL23-503: search label font size (#180)

* SUL23-570: changed address to size 16 (#179)

* SUL23-580: nav fixup (#184)

* SUL23-556: normal font and leading (#186)

* SUL23-503 Add text reset button and no results display (#185)

* SUL23-503 Add text reset button and no results display

* SUL23-503: changed size, added padding and color

* fixup after merge

---------

Co-authored-by: Jen Breese-Kauth <[email protected]>
Co-authored-by: Ian Monroe <[email protected]>

* SUL23-577 SUL23-586: buttons and vertical centering on tables (#183)

* SUL23-577 SUL23-586: buttons and vertical centering on tables

* fixed the col spacing

---------

Co-authored-by: Ian Monroe <[email protected]>

* SUL23-576 SUL23-575 SUL23-574: fixed height of toggle and filters (#182)

* SUL23-576 SUL23-575 SUL23-574: fixed height of toggle and filters

* fixup to corner

* SUL23-576: fixup

* removed rounded idea

* SUL23-591: added the th row=scope for a11y (#187)

Co-authored-by: Ian Monroe <[email protected]>

* Fix date formatting when the input is UTC

* SUL23-551: sentence case for branches and places to study (#188)

* SUL23-551: sentence case for branches and places to study

* Sentence case for all locations

* SUL23-482: set Todays hours title to h2 (#189)

* SUL23-482: set Todays hours title to h2

* "Hours" needed to be sentence case

* SUL23-587 SUL23-589 SUL23-590 (#190)

* SUL23-587 SUL23-589 SUL23-590

* adding the correct padding after cell

* SUL23-588: make the hover hug the phone and email

* Moved to just lg for inline flex

* fixup

* SUL23-578: fixup to the margin-bottom and casing (#191)

* SUL23-578: fixup to the margin-bottom and casing

* adding the flex change from the parent branch

* Fix date formatting when the input is UTC

* SUL23-578: added the 2 digits to the closed until time and lowercase of until

* fixup to the AM PM

---------

Co-authored-by: Mike Decker <[email protected]>

---------

Co-authored-by: Mike Decker <[email protected]>

* SUL23-577: fixed button height. removed include not used (#192)

* SUL23-587: updates to the people table (#193)

* SUL23-587: updates to the people table

* SUL23-440 Add "Load More" button on news lists over 30 items

* Added missing fields for people teasers

* SUL23-440 Adjusted "Load More" to "Load more"

* SUL23-597 Fix "today" vs "tomorrow" vs "friday" next opening day

* SUL23-597 Fix hour displays for next open date/time (#194)

* Removed "Hours this week" text

* SUL23-598: fixup up hover on branch name (#195)

* SUL23-598: fixup up hover on branch name

* fixup

* SUL23-574: setting exact height (#196)

* SUL23-580 SUL23-538: Added in the at to the time string (#197)

* Handle empty response from api/library-hours if something fails

* SUL23-585: Adding Donate now button to header (#198)

* SUL23-585: Adding Donate now button to header

* SUL23-585: button in header

* fixup

* changed Links to links

* SUL23-585: Back to digital red (#201)

* SUL23-571 Sort library options by title

* SUL23-600 show closing minutes if they are not 00 (#202)

* SUL-23-570: adding Hours this week for default (#203)

* SUL23-603: removed padding-left on branch name (#205)

* SUL23-604: tweaking the toggle spacing (#206)

* SUL23-573: tightening up spacing (#199)

* SUL23-573: tightening up spacing

* fixup

* fixup for the hover on email and phone

* fixup

* adjusting the top and bottom spacing and removed empty spacers

* fixup

* SUL23-608: changed the padding-left when the browser size is smaller (#207)

* fixup for the extra space

* fixup

* SUL23-605: fine tuning the sul people page. (#204)

* SUL23-605: fine tuning

* src/

* asking for feedback

* Fix on click handlers

* fixup to the group classes

* adding hover and active

* Added checkmark visual indicator

---------

Co-authored-by: Mike Decker <[email protected]>

* SUL23-601: changed when focused to not be red with red underline (#208)

* SUL23-601: changed when focused to not be red with red underline

* fixup

* SUL23-601: fixed the All to All specialists per slack rquest.

* SUL23-609: fix to text in hours card on homepage (#209)

* SUL23-609: fix to text in hours card on homepage

* fixup

* Sul23 611  Improve and simplify toggles (#210)

* Add a clear cache button for preview environments

* SUL23-610 add SDR as an oembed provider in the wysiwyg

* Sul23 611  tweaks (#211)

* SUL23-611: draft work for spacing on small screens

* adjustments to the focus and toggles

* tweaks

* tweaks

* fixup

* fixup

* fixup

* fixup

* Removed old eslint file

* SUL23-614 SUL23-615: fixes for html validation (#213)

* SUL23-615: footer link size (#212)

* SUL23-617: changed to Expertise (#214)

* Updated changelog

---------

Co-authored-by: pookmish <[email protected]>
Co-authored-by: Jen Breese <[email protected]>
Co-authored-by: Mike Decker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants