Skip to content

Use the whole list item as the click target#3963

Merged
julienw merged 1 commit into
firefox-devtools:mainfrom
julienw:fix-filter-navigator-bar-hit-zone
Mar 30, 2022
Merged

Use the whole list item as the click target#3963
julienw merged 1 commit into
firefox-devtools:mainfrom
julienw:fix-filter-navigator-bar-hit-zone

Conversation

@julienw

@julienw julienw commented Mar 30, 2022

Copy link
Copy Markdown
Contributor

This was caused by my previous patch #3901. Indeed I moved the onClick handler from the <li> to the <button>. This patch reverts this changes but still keeps the behavior that #3901 fixed.

Fixes #3962

production
deploy preview

Things to try:

  • behavior when clicking on the last item in the navigator, or other items.
  • behavior when there's a preview selection

@julienw julienw requested a review from canova March 30, 2022 13:01
<li
className={classNames('filterNavigatorBarItem', {
filterNavigatorBarRootItem: i === 0,
filterNavigatorBarBeforeSelectedItem: i === selectedItem - 1,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed this class as it was clearly not used.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for removing!

@codecov

codecov Bot commented Mar 30, 2022

Copy link
Copy Markdown

Codecov Report

Merging #3963 (cfb97c6) into main (4ed28e4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #3963   +/-   ##
=======================================
  Coverage   87.26%   87.26%           
=======================================
  Files         279      279           
  Lines       23921    23924    +3     
  Branches     6315     6317    +2     
=======================================
+ Hits        20874    20877    +3     
  Misses       2807     2807           
  Partials      240      240           
Impacted Files Coverage Δ
src/components/shared/FilterNavigatorBar.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ed28e4...cfb97c6. Read the comment docs.

className={classNames('filterNavigatorBarItem', {
filterNavigatorBarRootItem: i === 0,
filterNavigatorBarBeforeSelectedItem: i === selectedItem - 1,
filterNavigatorBarSelectedItem: i === selectedItem,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I considered removing this idea of selectedItem as currently it's always the last item. But finally I decided to keep it just in case we were using it in the future.

@canova canova left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the fix!

<li
className={classNames('filterNavigatorBarItem', {
filterNavigatorBarRootItem: i === 0,
filterNavigatorBarBeforeSelectedItem: i === selectedItem - 1,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for removing!

'filterNavigatorBarItem',
'filterNavigatorBarLeafItem',
'filterNavigatorBarUncommittedItem'
)}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good idea to move that inside the FilterNavigatorBarListItem component!

isLastItem={true}
isSelectedItem={false}
additionalClassName="filterNavigatorBarUncommittedItem"
title={uncommittedItem}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Huh, interesting that we are putting a title only for uncommited items, and this is exactly the same text we put inside the button as well 🤔 I feel like this is redundant (but not a blocker for this PR since this was a preexisting issue).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah I wondered about that too...

I believe we don't do it for other items directly currently because they're <Localized> React nodes, so they're not pure strings that we can reuse. I believe we had titles for everything in the past, and it could be useful in the transform navigator (not so much for the range navigator). Indeed in the transform navigator the text can be cut with an ellipsis sometimes.
If we want to do them in a localizable way, then this would need some more work, I believe that's why it hasn't been done earlier.

@julienw julienw merged commit 9a16911 into firefox-devtools:main Mar 30, 2022
@canova canova mentioned this pull request Apr 5, 2022
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.

Clicking "filter navigator bar items" does not work outside their text label

2 participants