Adapt tab overflow menu to photon style
Correct style used in toolbar tabs:
Non-photon styling in debugger:
This work might consider re-using the component.
- It would be nice to use the Popup component, which should help us place the triangle.
- Also might be nice to use the browser toolbox to inspect the toolboxes's model and copy some of the gradient and other styles.
Kinda wanna take this one, get myself back in the groove. 😄
/claim
I'd suggest you try to re-use / appropriate as much as possible the components used in DevTools (specifically the MenuItem / MenuButton / MenuList / HTMLTooltip pieces). There are a lot of considerations which they cover (or are in the process of being fixed to cover) such as
- Platform-specific differences (Mac has rounded corners, other platforms do not; Mac uses fixed colors where other platforms use system colors)
- DevTools theme support
- RTL support
- Screen reader support
- Keyboard support (including Home / End key etc.)
- Windows high-contrast support
- Magnification
- Preloading image assets to avoid flicker etc.
Interesting @birtles are those components over on m-c or have they been added to devtools-core or the packages/ here in debugger?
I'm afraid they're in m-c. They have a dependency on HTMLTooltip which, in some configurations, uses XUL. Not sure if that's a problem.
Even if you can't use them directly, I think you can probably copy a fair few chunks of CSS / JS or at least use it as a starting point.
I've got a local branch of this now, been looking over the contents in m-c and copied what could be used. Gonna wrap up this weekend if things go as planned.
Hello @wldcordeiro ! How's it going? Can you push up a WIP PR so we can keep the ball rolling?
/claim
Thanks for claiming the issue! :wave:
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
@wldcordeiro Do you still have your WIP for this?
@darkwing Can I take this issue ?
You can take it @dhyey35
/claim
Thanks for claiming the issue! :wave:
Here are some links for getting setup, contributing, and developing. We're always happy to answer questions in slack! If you become busy, feel free to /unclaim it.
:fox_face: Debugger team!
@birtles As far as I understand MenuButton.js needs an XUL element in doc which is passed like this. As you mentioned in above comment that I should consider taking required parts from MenuButton.js file and use it as starting point ( maybe in Dropdown.js)
So I think maybe we can re-use MenuItem and MenuList and have our own wrapper above it. But I am afraid that it might void us of the benefits you mentioned. Should I proceed with this idea or do you have any suggestions ?
CC: @jasonLaster
I'm not sure I quite follow the question. The XUL element is created by the HTMLTooltip component. The doc is passed in so that HTMLTooltip knows what document to append the various elements to.
It only uses one XUL element, a <xul:panel>, since that can extend pass the boundaries of the window. In future, we will need to find an alternative way to achieve this without XUL.
If the debugger doesn't ever need menus to extend outside the window boundaries then you could do without XUL altogether.
You can still use MenuItem and MenuList as you see fit, and possibly MenuButton too (which just coordinates the opening, focussing, and closing of the menu). You'll likely want to use HTMLTooltip too or something equivalent--it takes care of positioning the drop-down in the right place and resizing accordingly. Perhaps even more importantly, all the "doorhanger" styles defined for that component cover the various platform differences and themes.
(I also have an alternative implementation of these classes based on React hooks and Typescript in another project I work on that might be a useful reference: MenuList, MenuItem, and MenuButton (using an AnchoredSpeechBubble / SpeechBubble pair in place of HTMLTooltip). It's not quite as fully-featured as the one used by MeatballMenu etc. but it might be a useful point of comparison.)
@birtles I think I might be able to re-use all the components as HTMLTooltip allows passing a document instead of a XUL element.
I see that we have devtools-mc-assets in node_modules of debugger which has the files I need
I tried import MenuButton from "devtools-mc-assets/assets/devtools/client/shared/components/menu/MenuButton.js"; in Tab.js
But that throws a few errors
Module not found: Error: Can't resolve 'Services' in '/home/dhyey/Documents/projects/debugger.html/node_modules/devtools-mc-assets/assets/devtools/client/shared/components/menu'
@ ./node_modules/devtools-mc-assets/assets/devtools/client/shared/components/menu/MenuButton.js 10:17-36
@ ./src/components/Editor/Tabs.js
@ ./src/components/App.js
@ ./src/utils/bootstrap.js
@ ./src/client/index.js
@ ./src/main.development.js
@ multi ./src/main.development.js
ERROR in ./node_modules/devtools-mc-assets/assets/devtools/client/shared/components/menu/MenuButton.js
Module not found: Error: Can't resolve 'devtools/client/shared/focus' in '/home/dhyey/Documents/projects/debugger.html/node_modules/devtools-mc-assets/assets/devtools/client/shared/components/menu'
@ ./node_modules/devtools-mc-assets/assets/devtools/client/shared/components/menu/MenuButton.js 17:30-69
@ ./src/components/Editor/Tabs.js
@ ./src/components/App.js
@ ./src/utils/bootstrap.js
@ ./src/client/index.js
@ ./src/main.development.js
@ multi ./src/main.development.js
@jasonLaster Any ideas how can I import and use the files of devtools-mc-assets as in it's package.json it mentions URL to your username ?
Cloned into https://bugzilla.mozilla.org/show_bug.cgi?id=1695206
Firefox Developer Tools (including Debugger tool) development is now entirely happening in Bugzilla and new issues should be reported here: https://bugzilla.mozilla.org/enter_bug.cgi?product=DevTools&component=Debugger
Honza