-
Notifications
You must be signed in to change notification settings - Fork 21
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
Responsive Design Mode - Media Query Visualizer #135
Comments
Hi, thanks for filing this! Just for reference, here's a mockup I worked on last year. The goal was to try and make this more understandable at first glance than Chrome's version - thus the labels, only outlining half, and making it look more like the edge of a page. (figma file - feel free to clone) I also did a survey to ask: "If Firefox were to have a media query tool, what would be the most important features?" Results: |
@violasong Thank you for providing the mockups and information! Can you also share the link to the survey results? And can you explain what the rank distribution means? And just for reference, the Media Queries side panel within the Style Editor already covers listing all media queries (of the selected style sheet), resizing the viewport to match a certain breakpoint, highlighting breakpoints that match current viewport width, and jumping to breakpoint code in CSS source. And the RDM already allows to select between pre-determined viewport sizes. That doesn't mean, though, that those features shouldn't be part of the media query visualizer. Having some more visual way for those features would definitely make them more discoverable and useful. Sebastian |
It was a card sort question where users could choose up to 5 options and sort them in order of most useful. The bars on the right show higher rankings and the bars on the left show lower rankings. (For example, N/A was always the #1 ranking of those who chose that, so it only has a dark bar on the right) I'm not sure about sharing the full results at the moment 🤔 (in the past, when DevTools had active PM/UX, sometimes we would want to be a bit careful about this) but here was the one other pertinent data point about this feature: Do you currently use Chrome's Media Query tool? |
Just a bit of UI input regarding the different points of the survey and the feature list from Discourse: Viewport resizingAs mentioned by several people on Discourse, it should be possible to quickly test edge cases. I.e. there should be an easy way to resize not just to the exact media query value but also one or a few pixels beyond it. This could be done by allowing the author to click on different sides of the lines drawn within the bars. And, of course, there should be some indication on what will happen when hovering the sides. Example: You have a media query of List of all media queriesIt can be quite hard to visually display all media queries. As mentioned in my previous comment, this is already done within the Media Queries side bar (which also includes media queries other than size queries like Chrome's DevTools do this via a context menu option. This might be an option though isn't very discoverable. A better way to do that would probably be a button that shown when hovering the media query area. And clicking that button would open a sticky tooltip with all the related media queries. Breakpoints visulizationVictoria's mockup already does a good job in visualizing the different breakpoints and areas covered by the media queries. There obviously need to be three bars for min, min-max, and max constraints. And authors should immediately understand what each of them means (which is covered in the mockups by the "min", "min-max", and "max" keywords). And hovering the areas should show the constraints. There's one UX issue in regard of breakpoints that are close together. In those cases the areas on the bar are very small. One way to make it easier to inspect those breakpoints would be an option to display all breakpoints separately, meaning one bar would be displayed for each breakpoint. Also, the bars should be high enough to make it easy to click on them. The height in the mockups might be a little bit to small. Highlight matching breakpointsNot much to say about this other than that the whole areas they enclose should be highlighted and be distinguishable enough from the ones that don't match, of course. Jump to source codeAs mentioned above, this could be done via a tooltip listing the media queries within the style sheets. Each link should consist of the URL, line number, and row number of the media query. Clicking an entry jumps its definition within the Style Editor. Cycle through breakpointsI'm not sure whether "cycling through" breakpoints means to switch from one breakpoint to the next. If so, one way to do that would be to display two toggle buttons besides each bar, one for resizing the viewport to the next breakpoint, one to the previous breakpoint. Question then is, whether they should also cycle through the edge cases as mentioned in "Viewport resizing" or if there should be an extra option for that. Cycle through pre-determined widthsAgain the question about "cycling through". Though I guess here it rather means allowing to switch between mobile, tablet, and desktop sizes like Chrome's DevTools do it. The possibility to actually cycle through those different sizes could still be provided, of course. Link with Media Queries sidebarAs mentioned earlier, the Style Editor already has a Media Queries side panel. The Media Query Visualizer is not meant to replace this feature but to complement it, as that panel lists also media queries unrelated to the viewport width. It just needs to be ensured that both work together nicely. Sebastian |
Thanks you for the explanation, @violasong! And I can understand the hesitation of sharing the full data. Regarding Chrome's Media Query tool, I guess the large number of people not using it is mainly due to the feature being disabled by default and also because its UI is quite hard to understand. Of course it's hard to say how many authors would actually use this feature if implemented in the Firefox DevTools (and whether the cost-benefit calculation is worth it). Though there is obviously a need for it, as the different requests over the years show. And with a good UX (and being enabled by default), I believe many website authors would use this feature frequently. Sebastian |
I discovered more goodies from the archives!
CCing @tigleym and @martinbalfanz in case they have any extra info to add :) |
Yes of course, this feature would be absolutely useful! |
I would love to see this feature in Firefox, it is really difficult to toggle between different media queries. Is there any plugin at least for the time being to add this functionality? |
Yeah, I mean this is an absolute deal breaker for me. Being able to quickly resize over both sides of a breakpoint is essential |
How are things going with this feature? Any updates? |
This project isn't in active development, but if there are any further activities they'll be posted on bugzilla. |
appreciate the feedback, but feel that's a mistake. this feature is single handedly why i won't develop with firefox. |
Goal
Add a media query visualizer on firefox dev tools
summary from the discourse link
Bug / Request Documentation
Discourse
Show media queries in Responsive Design View
BugZilla
Media Query Visualizer in Responsive Design Mode
Visualize the vertical lines of media queries in the viewport when on the inspector
Implementation Plan from @nchevobbe
Add a new component (e.g. MediaQueryVisualizer) rendered below the Toolbar component
check how the style editor retrieves the list of media query (and react to any changes in media queries)
https://searchfox.org/mozilla-central/rev/cc4a17cea338fe236626d838ca96e9bf6a775675/devtools/client/styleeditor/StyleEditorUI.jsm#1244-1248the function is called when media queries changed (and I think we also get an initial call with the existing media queries)
this function is called because we do this
: https://searchfox.org/mozilla-central/rev/cc4a17cea338fe236626d838ca96e9bf6a775675/devtools/client/styleeditor/StyleEditorUI.jsm#152-158so we would have to do something similar in
https://searchfox.org/mozilla-central/rev/cc4a17cea338fe236626d838ca96e9bf6a775675/devtools/client/responsive/ui.js#406-409one thing we might do early is add a preference that would be set to false so we can start adding work without making it visible until we have something we're happy with (i.e. something like
https://searchfox.org/mozilla-central/rev/368607c4cd5be547021945e4ae60e8eb4365b3c4/browser/app/profile/firefox.js#2461)we'd need to create a decicated bug for that, that would block
https://bugzilla.mozilla.org/show_bug.cgi?id=1031585References
we're using React to build the RDM UI, and things are defined here
https://searchfox.org/mozilla-central/rev/cc4a17cea338fe236626d838ca96e9bf6a775675/devtools/client/responsive/components/App.js#398-435Note
hi, let me know if this is the wrong place for documenting the current discussions and initial implementation plan for this feature. just wanted to put it in one place and make the conversation going. as suggested by @nchevobbe i will try checking the points under Implementation Plan and see how to work through it. thanks! -@maurusrv
The text was updated successfully, but these errors were encountered: