Skip to content

Make the tab bar scrollable to allow accessing tabs on narrow page widths (mobile layout) - #5463

Merged
kala-moz merged 10 commits into
firefox-devtools:mainfrom
kala-moz:mobile-sidebar-ui-fix-clean
May 21, 2025
Merged

kala-moz merged 10 commits into
firefox-devtools:mainfrom
kala-moz:mobile-sidebar-ui-fix-clean

Conversation

@kala-moz

@kala-moz kala-moz commented May 20, 2025 •

Copy link
Copy Markdown
Contributor

A duplicate of the closed Mobile View Fix for bottom sidebar #5428. Please see the former for relevant history and notes.

Please open the profile and set your screen to mobile view: Deploy Preview

Offered solution:

  • Make the tab bar and stack menu scroll horizontally within the defined width.
Screenshot 2025-05-21 at 15 18 11

@kala-moz
kala-moz requested a review from mstange May 20, 2025 00:26
@kala-moz kala-moz self-assigned this May 20, 2025
@kala-moz kala-moz changed the title Added media queries to tab bar menu and stack settings for horizontal scrolling Mobile fix for bottom Sidebar and Menus: Part 1 May 20, 2025
@codecov

codecov Bot commented May 20, 2025 •

Copy link
Copy Markdown

Codecov Report

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

Project coverage is 86.04%. Comparing base (223a11c) to head (d907c10).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/components/app/Details.js 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5463      +/-   ##
==========================================
- Coverage   86.04%   86.04%   -0.01%     
==========================================
  Files         312      312              
  Lines       30367    30362       -5     
  Branches     8300     8295       -5     
==========================================
- Hits        26130    26124       -6     
  Misses       3643     3643              
- Partials      594      595       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kala-moz
kala-moz force-pushed the mobile-sidebar-ui-fix-clean branch from ecb2145 to b130e8d Compare May 20, 2025 00:53
lint fix

move media query to correct class in stacksettings
@kala-moz
kala-moz force-pushed the mobile-sidebar-ui-fix-clean branch from 0deb7fc to 4a372eb Compare May 20, 2025 01:07

@mstange mstange left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I would prefer to do this in a way where we don't have to hardcode a width at which we transition to a "mobile layout". Let's find a way to express this so that the layout works on all widths. Having a specific transition point means that there will be some widths where the layout doesn't work. For example, if I resize my browser window in the deploy preview, I can still get into a state where the sidebar button overlaps the last tab, or a state where the "x" button in the search field is occluded by the sidebar and the bar is not scrollable.

Instead, I think we should:

  • Use overflow-x: auto so that the box becomes scrollable when necessary
  • Do the work that's needed to make the right elements grow/shrink in the right ways when the window is resized. This may require properties such as overflow: hidden and min-width: 0 on various elements, or changes to flex-shrink and flex-grow.

@mstange

mstange commented May 20, 2025 •

Copy link
Copy Markdown
Contributor

Another problem with using a fixed pixel value as the transition point is that, in many cases, you can't actually pick a value that works reliably. That's because many of the elements involved here are sized based text content, and text can have different sizes based on the language, platform font rendering, and font size accessibility settings. So finding a way to express the behavior we want dynamically will make the layout more robust to those variations.

@mstange mstange changed the title Mobile fix for bottom Sidebar and Menus: Part 1 Make the tab bar scrollable to allow accessing tabs on narrow page widths (mobile layout) May 20, 2025
@kala-moz

Copy link
Copy Markdown
Contributor Author

Hi @mstange, I reviewed your comments and removed the media queries and relied more on flexbox. However, adding overflow: hidden or overflow-x: auto to the classes will break the selected tab styles. There is now no overlap of the selected tab over the settings bar to create that "selected appearance". We can adjust the media query to the breakpoint you mentioned above where it breaks. It wouldn't be the worst thing in the world. Please review.

Example of broken selected tab appearance:

Screenshot 2025-05-20 at 17 16 14

@mstange

mstange commented May 21, 2025

Copy link
Copy Markdown
Contributor

I was able to fix the tab styling by applying the following changes in the devtools:

Screenshot 2025-05-21 at 11 57 12 AM
/* Inline | https://deploy-preview-5463--perf-html.netlify.app/public/rxabzrr1e4fcb8f05aavnbm7vsgcp4cn2hg7mtr/calltree/?globalTrackOrder=a0w9&hiddenGlobalTracks=1w8&hiddenLocalTracksByPid=4612-0w4~4636-0~4617-0&implementation=js&search=activity-s&thread=f&timelineType=category&v=10 */

.Details-top-bar {
  /* overflow: hidden; */
}

/* Inline | https://deploy-preview-5463--perf-html.netlify.app/public/rxabzrr1e4fcb8f05aavnbm7vsgcp4cn2hg7mtr/calltree/?globalTrackOrder=a0w9&hiddenGlobalTracks=1w8&hiddenLocalTracksByPid=4612-0w4~4636-0~4617-0&implementation=js&search=activity-s&thread=f&timelineType=category&v=10 */

.tabBarTabWrapper {
  /* margin: 0 -.5px; */
  /* overflow-x: auto; */
  margin: 0 -.5px -1px;
  overflow: auto hidden;
}

.tabBarTab {
  /* margin: 0 -.5px; */
  /* padding: 6px 4px; */
  margin: 0 -.5px 1px;
  padding: 6px 4px 5px;
}

.tabBarTab.selected {
  /* margin-bottom: -1px; */
  margin: 0 -.5px;
  padding: 6px 4px;
}

Comment thread src/components/app/TabBar.css Resolved
Comment thread src/components/shared/StackSettings.css Resolved
@kala-moz

Copy link
Copy Markdown
Contributor Author

I was able to fix the tab styling by applying the following changes in the devtools:
Screenshot 2025-05-21 at 11 57 12 AM

/* Inline | https://deploy-preview-5463--perf-html.netlify.app/public/rxabzrr1e4fcb8f05aavnbm7vsgcp4cn2hg7mtr/calltree/?globalTrackOrder=a0w9&hiddenGlobalTracks=1w8&hiddenLocalTracksByPid=4612-0w4~4636-0~4617-0&implementation=js&search=activity-s&thread=f&timelineType=category&v=10 */

.Details-top-bar {
  /* overflow: hidden; */
}

/* Inline | https://deploy-preview-5463--perf-html.netlify.app/public/rxabzrr1e4fcb8f05aavnbm7vsgcp4cn2hg7mtr/calltree/?globalTrackOrder=a0w9&hiddenGlobalTracks=1w8&hiddenLocalTracksByPid=4612-0w4~4636-0~4617-0&implementation=js&search=activity-s&thread=f&timelineType=category&v=10 */

.tabBarTabWrapper {
  /* margin: 0 -.5px; */
  /* overflow-x: auto; */
  margin: 0 -.5px -1px;
  overflow: auto hidden;
}

.tabBarTab {
  /* margin: 0 -.5px; */
  /* padding: 6px 4px; */
  margin: 0 -.5px 1px;
  padding: 6px 4px 5px;
}

.tabBarTab.selected {
  /* margin-bottom: -1px; */
  margin: 0 -.5px;
  padding: 6px 4px;
}

Nice, thank you!

@kala-moz

Copy link
Copy Markdown
Contributor Author

@mstange, thanks for your review. I think this should be ready to check in. Let me know.

@mstange mstange left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Need to tweak the comments in the CSS so that they make sense with the new styles. Once that's addressed, this is good to go!

Comment thread src/components/app/TabBar.css Resolved
Comment thread src/components/app/TabBar.css Resolved
Comment thread src/components/app/TabBar.css Resolved
@kala-moz
kala-moz merged commit 0d5fd94 into firefox-devtools:main May 21, 2025
@mstange mstange mentioned this pull request May 22, 2025
2 tasks done
@canova canova mentioned this pull request May 22, 2025
canova added a commit that referenced this pull request May 22, 2025
[Carla Severe] Make the sidebar start out closed on mobile screens
(#5464)
[Carla Severe] Make the tab bar scrollable to allow accessing tabs on
narrow page widths (mobile layout) (#5463)
[depfu[bot]] Update all Yarn dependencies (2025-05-21) (#5466)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants