Skip to content

feat(compat-table): add browser visibility settings - #1880

Merged
caugner merged 11 commits into
mainfrom
configurable-compat-table-browsers
Sep 18, 2026
Merged

caugner merged 11 commits into
mainfrom
configurable-compat-table-browsers

Conversation

@caugner

@caugner caugner commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Description

Add browser visibility controls to compatibility tables.

  • Select visible browsers in the Browser compatibility settings modal with live preview.
  • Save choices locally and sync tables across tabs.
  • Cap browser column widths for smaller selections.

Motivation

Help readers configure compatibility tables for their needs.

  • Show browsers hidden by default.
  • Focus on browsers relevant to their project.

Additional details

  • Group browsers by platform, separating Baseline browsers, WebViews, and others. Explain unavailable columns in a legend.
  • Allow any selection, including none. Save syncs tables across the page and other tabs; Cancel, close, or Escape revert the preview. Outside clicks leave the modal open.
  • Saving the default selection clears browser overrides. Browsers without saved choices follow current defaults.
  • Cap browser column widths and provide fallback icons.
  • Extend mdn-modal with configurable dismissal and width, a forwarded close event, and heading typography.

Screenshot

image

Measurements

New Glean measurements:

  • bcd: browsers -> default or bcd: browsers -> <browser>,<browser>,...: on table view, report default without saved overrides; otherwise list shown columns by BCD key in table order.
  • bcd: settings -> open: on opening the modal.
  • bcd: settings -> show <browser> / bcd: settings -> hide <browser>: on Save, once per changed browser.
  • bcd: settings -> reset: before per-browser events when a changed selection is saved as defaults.

Related issues and pull requests

Fixes mdn/mdn#752.

@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

c729dc4 was deployed to: https://fred-pr1880.review.mdn.allizom.net/

@danielhjacobs

Copy link
Copy Markdown
Contributor

As an end-user I'm likely to click outside of the modal after configuring the browsers without clicking "OK". Right now that undoes my choices. It may be more user-friendly to open a confirmation prompt asking if you wish to save or discard your changes.

@caugner
caugner force-pushed the configurable-compat-table-browsers branch from 6abe6d0 to 5ff1261 Compare September 10, 2026 18:22
@caugner caugner changed the title feat(compat-table): make visible browsers configurable feat(compat-table): show/hide browsers via settings modal Sep 10, 2026
Expose `closedby` and `--modal-max-width` for dialog customization.
Forward `close` across the shadow boundary so callers can revert previews.
Align the title with content and apply heading typography.
@caugner

caugner commented Sep 11, 2026

Copy link
Copy Markdown
Contributor Author

Last commit before the history rewrite: b36dfc1

This commit preserves the original commit chain for recovery.

@caugner
caugner force-pushed the configurable-compat-table-browsers branch from b36dfc1 to 3093964 Compare September 11, 2026 11:42
Persist per-browser visibility under the `compat-table` storage key.
Browsers without saved choices follow defaults; resetting preserves
unrelated settings.

Sync values across tables and tabs via events and `BroadcastChannel`.
Include values in notifications to avoid stale storage reads.

Resolve visible platforms and browsers with explicit exclusion reasons.
Cover defaults, overrides, runtime data, and WebExtensions with unit tests.
Cap browser columns at `4rem` across desktop breakpoints and let the
feature column fill remaining space.

Keep positioned cell content contained and remove the unused pseudo-element.
Add browser toggle pills grouped by platform, with separate rows for
Baseline browsers, WebViews, and remaining browsers.

Preview choices on the current table; persist on Save and revert on
Cancel, close, or Escape. Allow any selection, including none, and clear
saved overrides when the selection matches defaults.

Explain unavailable browser columns with icons and a legend. Include
fallback browser icons, localized labels, and an empty-selection note.
Measure shown browser columns alongside table views, using `default`
when no custom visibility is saved.

Measure dialog opens and actual visibility changes on Save. Emit
`reset` before per-browser changes when restoring the default selection.
@caugner
caugner force-pushed the configurable-compat-table-browsers branch from 3093964 to db4bd43 Compare September 11, 2026 13:26
@caugner
caugner marked this pull request as ready for review September 11, 2026 14:52
@caugner
caugner requested a review from a team as a code owner September 11, 2026 14:52
@caugner
caugner requested a review from LeoMcA September 11, 2026 14:52

@LeoMcA LeoMcA 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.

Really really nice!

I think generally we should aim to elevate things to top level /** @imports after a couple of uses inline, and the readability of most of the files here would benefit from that - but consider those nits.

The modal click-to-dismiss and testing file names are the only real question/concern I have.

Comment thread components/compat-table-settings/element.js
Comment thread components/compat-table-settings/element.js Outdated
Comment thread test/unit/components/compat-table/settings.test.js
Comment thread components/compat-table/browsers.js Outdated
Replace repeated inline type expressions with top-level `@import` declarations to keep annotations concise.
Replace repeated inline type expressions with top-level `@import` declarations to keep the helper annotations concise.
Mirror the component source tree so each test file target is unambiguous.
@caugner caugner changed the title feat(compat-table): show/hide browsers via settings modal feat(compat-table): add browser visibility settings Sep 18, 2026
@caugner
caugner merged commit 01ae668 into main Sep 18, 2026
13 checks passed
@caugner
caugner deleted the configurable-compat-table-browsers branch September 18, 2026 21:03
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.

Allow users to customize browser selection in BCD tables

4 participants