-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix: Make spec row clickable across entire width #22105
fix: Make spec row clickable across entire width #22105
Conversation
* Move click-sensitive row action wrapper to surround entire row * Add styles to highlight spec icon on hocus to match Figma * Small text highlight style change to match Figma
Thanks for taking the time to open a PR!
|
Test summaryRun details
View run in Cypress Dashboard ➡️ FlakinessThis comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard |
<component | ||
:is="isLeaf ? 'RouterLink' : 'div'" | ||
class="h-full outline-none border-gray-50 ring-inset grid group focus:outline-transparent focus-within:ring-indigo-300 focus-within:ring-1 children:cursor-pointer" | ||
:class="[isLeaf ? 'grid-cols-2' : 'grid-cols-1']" |
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.
I noticed that the directory rows render a little off-center:
I think that's because we flex this class to grid-cols-1
when it's not a leaf, but we continue to render the git info div on line 17 regardless.
That kinda has me thinking why we need the git-info slot here at all? Could we instead make git-info (and thus the grid classes) a concern of the SpecItem
component and consolidate all the 'leaf'-related logic in one place?
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.
I'm not sure if this is still the case but we used to have multiple views for this table, and I think some code was shared with the spec list on the runner page. That might explain some slots that don't seem to do much.
It's possible some old code is still hanging around from when we were still figuring the UI for this page out. Don't be afraid to delete code that seems weird/incorrect/not useful.
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.
I don't think this is a dead/legacy code issue, rather just that we currently don't display anything in the "Last Updated" slot for directories from the newly-added Git Info data in this table. Since there's a non-zero chance we may decide to put something in that column for directories in the future I reverted the style change so the directory renders as expected and just has an empty second column
<div data-cy="specs-list-row"> | ||
<component | ||
:is="isLeaf ? 'RouterLink' : 'div'" | ||
class="h-full outline-none border-gray-50 ring-inset grid group focus:outline-transparent focus-within:ring-indigo-300 focus-within:ring-1 children:cursor-pointer" |
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.
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.
focus:outline-none
works like a charm 💯
@@ -96,7 +90,7 @@ | |||
:style="{ paddingLeft: `${(row.data.depth - 2) * 10}px` }" | |||
:indexes="getDirIndexes(row.data)" | |||
:aria-controls="getIdIfDirectory(row)" | |||
@click="row.data.toggle" | |||
@click.stop="row.data.toggle" |
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.
Do we need both the click handler here and the one that emits the @toggleRow
event from SpecsListRowItem? Seems like the SpecsListRowItem handler should catch clicks on the RowDirectory at this point.
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.
Updates look good 👍 👍
* fix: Make spec row clickable across entire width * Move click-sensitive row action wrapper to surround entire row * Add styles to highlight spec icon on hocus to match Figma * Small text highlight style change to match Figma * Add missing data-cy selector * Add tests for row expansion behaviors * Fix directory row styling issues
User facing changelog
Additional details
Figma design
According to #21783 this was brought up a lot during v10 feedback testing. Current behavior only performs the row's action (toggle expansion for directories or navigate to spec for Spec rows) if you click directly on the row title item. This makes the entire row actionable by default.
Theoretically we may introduce row items that themselves want to respond to click events (opening a tooltip permanently, for example) - in that case the child can ensure the click event is not propagated upwards thus preventing the row from actioning.
Steps to test
enter
triggers navigationenter
toggles expansionHow has the user experience changed?
Current
21783-current.mov
Updated
21783-new.mov
PR Tasks
cypress-documentation
?type definitions
?