Repository navigation
Drop the wrapper and layout classes from sidebar folder toggles #4955
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
Changes from all commits
e92a875
a8cff2c
62f5139
92e139e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -215,6 +215,23 @@ body { | |
| @apply hover:bg-grey-20 cursor-pointer rounded-sm p-1; | ||
| } | ||
|
|
||
| /* On folder and heading rows the label fills the row height, so a click below the chevron of a wrapped title still | ||
| toggles; the chevron carries the button box the inner div used to. Island rows keep the div. */ | ||
| .nav-folder > .peer > label { | ||
| @apply cursor-pointer; | ||
|
|
||
| & > .nav-chevron { | ||
| @apply box-content rounded-sm p-1; | ||
| } | ||
|
|
||
| /* As Tailwind's hover: does, so a tap on a touch screen leaves no grey chevron behind. */ | ||
| @media (hover: hover) { | ||
| &:hover > .nav-chevron { | ||
| @apply bg-grey-20; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| .nav-chevron { | ||
| @apply w-3.5 shrink-0 -rotate-90 group-has-checked/label:rotate-0; | ||
|
|
||
|
|
@@ -223,6 +240,11 @@ body { | |
| stroke: none; | ||
| } | ||
|
|
||
| /* An open folder points its chevron down; the label no longer carries the group/label class this used. */ | ||
| .nav-folder > .peer > label:has(:checked) .nav-chevron { | ||
| @apply rotate-0; | ||
| } | ||
|
|
||
| .nav-subtree { | ||
| @apply relative ml-4 hidden; | ||
|
|
||
|
|
@@ -602,4 +624,13 @@ h1:has(.cli-badge-ns, .cli-badge-cmd) { | |
| :where([id^='nav-tree-']) li.nav-top { | ||
| @apply mt-6 flex pr-8 font-semibold; | ||
| } | ||
|
|
||
| /* A folder or heading row's title and toggle, and the toggle's place in it: the classes the row used to carry. */ | ||
| :where(.nav-folder > .peer) { | ||
| @apply grid w-full grid-cols-[1fr_auto]; | ||
| } | ||
|
|
||
| :where(.nav-folder > .peer > label) { | ||
| @apply mr-2 flex items-start; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Severity: P3 (Low) Add a browser regression test that clicks below the chevron on a wrapped folder row and checks that the subtree opens and closes. The HTML snapshots cannot detect a return to a chevron-height hit area, and a test that clicks the chevron itself would pass either way. Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Leaving this one. I checked it in a browser when making the change: on a wrapped folder title the label measures 22×34 as on |
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,22 +1,18 @@ | ||
| <a href="/api/test/group/endpoint-mixed" class="sidebar-link nav-folder-link font-semibold"> | ||
| <span>Mixed</span> | ||
| </a> | ||
| <label for="3F8FEE62" class="group/label flex mr-2 items-start"> | ||
| <div class="nav-toggle-btn"> | ||
| <svg class="nav-chevron" viewBox="0 0 24 24"> | ||
| <use href="#icon-chevron-down"></use> | ||
| </svg> | ||
| </div> | ||
| <label for="3F8FEE62"> | ||
| <svg class="nav-chevron" viewBox="0 0 24 24"> | ||
| <use href="#icon-chevron-down"></use> | ||
| </svg> | ||
| <input id="3F8FEE62" type="checkbox" class="hidden" aria-hidden="true"> | ||
| </label> | ||
| <a href="/api/test/group/endpoint-retired" class="sidebar-link nav-folder-link font-semibold"> | ||
| <span>Retired</span> | ||
| </a> | ||
| <label for="5B720147" class="group/label flex mr-2 items-start"> | ||
| <div class="nav-toggle-btn"> | ||
| <svg class="nav-chevron" viewBox="0 0 24 24"> | ||
| <use href="#icon-chevron-down"></use> | ||
| </svg> | ||
| </div> | ||
| <label for="5B720147"> | ||
| <svg class="nav-chevron" viewBox="0 0 24 24"> | ||
| <use href="#icon-chevron-down"></use> | ||
| </svg> | ||
| <input id="5B720147" type="checkbox" class="hidden" aria-hidden="true"> | ||
| </label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Severity: P3 (Low)
Add a browser regression check that clicks a legacy folder toggle and verifies subtree visibility and chevron rotation on both open and close. The updated HTML snapshots would still pass if the new checked-state selector stopped matching and the chevron stayed sideways.
Generated by Libra. React with 👍 or 👎 to give feedback on this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Leaving this one. I checked open and close in a browser against the previous markup (checkbox state, subtree visibility and chevron rotation all match), and the sidebar screenshots, with folders open, match pixel for pixel. A dedicated browser test for the toggle is more than this markup change needs.