Add moz-card to setting-group
Categories
(Firefox :: Settings UI, enhancement, P3)
Tracking
()
People
(Reporter: tgiles, Assigned: mstriemer)
References
(Blocks 1 open bug)
Details
(Whiteboard: [recomp] [srdbb])
Attachments
(5 files)
|
49.69 KB,
image/png
|
Details | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
The new Settings design feature a card container for each setting group. We should add moz-card to setting-group in order to achieve this. There are some open questions though:
- Should we convert the
<groupbox> -> <label> -> <h2|h1>elements into the<moz-card>heading or the<moz-fieldset>label?startup-headerpreferences-web-appearance-headerupdate-application-allow-description, not an<h2>, simply a<label>performance-title,<h1>browsing-title,<h1>network-proxy-connection-description, a<span>within a<description>sitedata-headerautofill-payment-methods-titleautofill-addresses-titlesecurity-browsing-protectionhttpsonly-header- There may be others but these were the ones I easily noticed
- Should we address the "headings, labels, etc" as a follow-up task or tasks?
- It would allow us to deliver an improvement to the current UI, as far as I can tell
Attaching a screenshot showing the "Startup" setting group with a moz-card wrapper. The following is a WIP patch that can be used to see what this change would bring:
diff --git a/browser/components/preferences/widgets/setting-group/setting-group.mjs b/browser/components/preferences/widgets/setting-group/setting-group.mjs
index 34d1374120b7..7a2552e9bc9a 100644
--- a/browser/components/preferences/widgets/setting-group/setting-group.mjs
+++ b/browser/components/preferences/widgets/setting-group/setting-group.mjs
@@ -112,15 +112,26 @@ export class SettingGroup extends MozLitElement {
if (!this.config) {
return "";
}
- return html`<moz-fieldset
- data-l10n-id=${ifDefined(this.config.l10nId)}
- .headingLevel=${this.config.headingLevel}
- .supportPage=${ifDefined(this.config.supportPage)}
- @change=${this.onChange}
- @click=${this.onClick}
- @visibility-change=${this.handleVisibilityChange}
- >${this.config.items.map(item => this.itemTemplate(item))}</moz-fieldset
+ return html`<moz-card
+ ><moz-fieldset
+ data-l10n-id=${ifDefined(this.config.l10nId)}
+ .headingLevel=${this.config.headingLevel}
+ .supportPage=${ifDefined(this.config.supportPage)}
+ @change=${this.onChange}
+ @click=${this.onClick}
+ @visibility-change=${this.handleVisibilityChange}
+ >${this.config.items.map(item => this.itemTemplate(item))}</moz-fieldset
+ ></moz-card
>`;
+ // return html`<moz-fieldset
+ // data-l10n-id=${ifDefined(this.config.l10nId)}
+ // .headingLevel=${this.config.headingLevel}
+ // .supportPage=${ifDefined(this.config.supportPage)}
+ // @change=${this.onChange}
+ // @click=${this.onClick}
+ // @visibility-change=${this.handleVisibilityChange}
+ // >${this.config.items.map(item => this.itemTemplate(item))}</moz-fieldset
+ // >`;
}
}
customElements.define("setting-group", SettingGroup);
Updated•7 months ago
|
| Assignee | ||
Updated•7 months ago
|
| Assignee | ||
Comment 1•6 months ago
|
||
Bug 1994888 is on file to convert the headings of the areas that are still relying on groupbox. If that's done then we shouldn't need to worry about headings here
One thing we should consider is that updating setting-group to use a card could lead to inconsistent UI when they're mixed with groupbox elements since those aren't using cards.
We do already have sub-panes being generated by setting-pane though, which could be a good candidate for when to enable the cards since they're on their own page and we only allow setting-group elements in there, we won't hit any inconsistency within that area.
| Assignee | ||
Comment 2•6 months ago
|
||
This should be done behind the browser.settings-redesign.enabled pref for the main panes and right away for sub-panes
| Assignee | ||
Updated•5 months ago
|
| Assignee | ||
Comment 3•5 months ago
|
||
| Assignee | ||
Comment 4•5 months ago
|
||
Comment 7•4 months ago
•
|
||
Backed out for causing several failures.
Failure logs:
- TEST-UNEXPECTED-FAIL | browser/components/preferences/tests/chrome/test_setting_group.html | First child is a fieldset - got "moz-card", expected "moz-fieldset" - https://treeherder.mozilla.org/logviewer?job_id=542674205&repo=autoland&task=To9pfs9nTsOQevagssX5sw.0
- TEST-UNEXPECTED-FAIL | browser/tools/mozscreenshots/preferences/browser_preferences.js | capture - Unexpected exception in [ prefsGeneral-browsingGroup ]: TypeError: can't access property "scrollIntoView" - https://treeherder.mozilla.org/logviewer?job_id=542680506&repo=autoland&task=AyRFsgu6ShSZTBMZWs7AjA.0
- TEST-UNEXPECTED-FAIL | browser/base/content/test/general/browser_storagePressure_notification.js - Element should not be null, when checking visibility - https://treeherder.mozilla.org/logviewer?job_id=542675018&repo=autoland&task=dh94aMWxTN6FT9KELcXTVA.0
- also this TV - https://treeherder.mozilla.org/logviewer?job_id=542674169&repo=autoland&task=XkhzfCiHSC-Nm6J33QWSjg.0
Comment 10•4 months ago
•
|
||
Backed out for causing ESlint failure and bc failures
Comment 11•4 months ago
|
||
Comment 12•4 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/b31ebb86cb87
https://hg.mozilla.org/mozilla-central/rev/13d496847602
| Assignee | ||
Comment 13•4 months ago
|
||
[Tracking Requested - why for this release]: This is used in bug 2005804 to create the cards on the AI Controls page
I rebased this onto beta locally and it had a minor merge conflict but worked fine (doesn't automatically add cards since the patch that tells it to use cards isn't on beta, but that's fine, manually setting it worked). I'll rebase the stack from bug 2005804 (and others) onto this on beta when they hit central and put up a revision to uplift. There shouldn't be any issue with landing them separately though, so we could do that too
Updated•4 months ago
|
| Assignee | ||
Comment 14•4 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D275335
Updated•4 months ago
|
| Assignee | ||
Comment 15•4 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D275336
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Updated•4 months ago
|
Comment 16•4 months ago
|
||
| uplift | ||
Description
•