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

#8868: slice 4: re-write EllipsisMenu using the react menu library #8887

Conversation

grahamlangford
Copy link
Collaborator

@grahamlangford grahamlangford commented Jul 19, 2024

What does this PR do?

Discussion

  • Longer loom to go over the slight styling differences between the old and new menu
  • I've decided not to pursue further tweaking of the styles as I don't think the differences are enough to warrant the effort

Remaining Work

  • Repin App to latest Extension release to resolve TS errors
  • Confirm functionality/styling in App

Demo

Extension

App

Future Work

  • After merge, repin App to use the latest version of Extension in this branch:

Checklist

  • This PR introduces a new library: double check it's MIT/Apache2/permissively licensed
    • @szhsin/react-menu: MIT

For more information on our expectations for the PR process, see the
code review principles doc

@grahamlangford grahamlangford linked an issue Jul 19, 2024 that may be closed by this pull request
Copy link

codecov bot commented Jul 19, 2024

Codecov Report

Attention: Patch coverage is 95.23810% with 1 line in your changes missing coverage. Please review.

Project coverage is 74.47%. Comparing base (8318d74) to head (0d4d50c).
Report is 115 commits behind head on main.

Files Patch % Lines
src/components/ellipsisMenu/EllipsisMenu.tsx 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8887      +/-   ##
==========================================
+ Coverage   74.24%   74.47%   +0.22%     
==========================================
  Files        1332     1339       +7     
  Lines       40817    41205     +388     
  Branches     7634     7702      +68     
==========================================
+ Hits        30306    30688     +382     
- Misses      10511    10517       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Jul 19, 2024

Playwright test results

passed  125 passed
flaky  1 flaky
skipped  4 skipped

Details

report  Open report ↗︎
stats  130 tests across 40 suites
duration  8 minutes, 59 seconds
commit  0d4d50c
info  For more information on how to debug and view this report, see our readme

Flaky tests

edge › tests/regressions/welcomeStarterBricks.spec.ts › #8740: can view the starter mods on the pixiebrix.com/welcome page

Skipped tests

chrome › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
edge › tests/regressions/doNotCloseSidebarOnPageEditorSave.spec.ts › #8104: Do not automatically close the sidebar when saving in the Page Editor
chrome › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options
edge › tests/runtime/googleSheetsIntegration.spec.ts › can activate a google spreadsheet mod with config options

.toggle:global(.dropdown-toggle)::after {
display: none;
}
.button {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the most widely used styling (Integration Card, active mods)

@@ -85,104 +68,64 @@ type EllipsisMenuProps = {
* The boundary element for the dropdown menu popup
* @see DropdownMenuProps.popperConfig
*/
menuBoundary?: Element;
boundingBoxRef?: MutableRefObject<HTMLElement | null>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same behavior as the menuBoundary, but different implementation

@grahamlangford grahamlangford marked this pull request as draft July 19, 2024 14:08
<Tab.Content className={dataPanelStyles.tabContent}>
<Tab.Content
className={dataPanelStyles.tabContent}
ref={(element: HTMLElement) => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nice refactor using ref.

Comment on lines +56 to +59
const [activeElement, setActiveElement] = useReduxState(
selectActiveBuilderPreviewElement,
actions.setActiveBuilderPreviewElement,
);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

There's at least one hook that gets activeElement from redux using useSelector. Using useState here was causing the store not to be updated, leading to an NPE when running one of the tests,

I understand why the test was failing, I don't understand how it ever passed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe the tests just aren't covering behavior relevant to those hooks? 🤷‍♂️

…8868-slice-4-re-write-actionmenutsx-using-the-react-menu-library
@grahamlangford grahamlangford added this to the 2.0.6 milestone Jul 23, 2024
…8868-slice-4-re-write-actionmenutsx-using-the-react-menu-library
Copy link

When the PR is merged, the first loom link found on this PR will be posted to #sprint-demo on Slack. Do not edit this comment manually.

@grahamlangford grahamlangford merged commit ee9627f into main Jul 23, 2024
29 checks passed
@grahamlangford grahamlangford deleted the 8868-slice-4-re-write-actionmenutsx-using-the-react-menu-library branch July 23, 2024 18:09
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.

Slice 4: Re-write ActionMenu.tsx using the react-menu library
3 participants