Skip to content

Commit 39f889a

Browse files
committed
Bug 1936656 - Add ability to show multiple content tiles on a single aboutwelcome screen with option to toggle visibility r=emcminn,omc-reviewers,jprickett
**Primary Updates** - Add ability to show multiple content tiles on a single AboutWelcome screen by supporting an array of tile objects and/or sub-arrays of tile objects to be groups together as a value for "tiles" in screen content - Keep compatibility with messages that use a single tile object as the value of "tiles" in screen content - Add updates to `setMultiSelectActions` to ensure we can handle actions across multiple MultiSelect tiles. - Add optional tile headers which can be displayed in place of the tile until clicked, closing any other tile with a header that's currently open - Send click event telemetry when a user clicks a tile header to open the tile - Update aboutwelcome source docs related to content tiles to include this new capability **Additional Updates to Support UX Designs** [[ https://www.figma.com/design/F63Ac1akw2q1fN5D59rgS5/Privacy?node-id=4110-16458&t=kSzPUp4XFLq0dKg8-4 | See Figma designs ]] - Add ability to configure `display`, `padding`, and `width` for aboutwelcome screens (this allows us to support the proposed Spotlight modal designs, which include anchoring the modal towards the top of the screen and expanding it downward when a tile is opened, rather than centering vertically) - Add ability to configure action buttons to show above screen content {F11717546} Differential Revision: https://phabricator.services.mozilla.com/D231856 UltraBlame original commit: f7524feb52aa820a5e877b14b4a0a02815cf3ae8
1 parent f337e84 commit 39f889a

15 files changed

+25643
-8434
lines changed

browser/components/aboutwelcome/content-src/aboutwelcome.scss

+549-59
Large diffs are not rendered by default.

browser/components/aboutwelcome/content-src/components/ContentTiles.jsx

+962
Large diffs are not rendered by default.

browser/components/aboutwelcome/content-src/components/EmbeddedBrowser.jsx

+54-54
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,24 @@ from
6767
react
6868
"
6969
;
70+
import
71+
{
72+
AboutWelcomeUtils
73+
}
74+
from
75+
"
76+
.
77+
.
78+
/
79+
lib
80+
/
81+
aboutwelcome
82+
-
83+
utils
84+
.
85+
mjs
86+
"
87+
;
7088
const
7189
BROWSER_STYLES
7290
=
@@ -81,9 +99,7 @@ width
8199
border
82100
"
83101
"
84-
border
85-
-
86-
radius
102+
borderRadius
87103
"
88104
"
89105
flex
@@ -96,55 +112,6 @@ padding
96112
"
97113
]
98114
;
99-
function
100-
applyValidStyles
101-
(
102-
element
103-
style
104-
validStyles
105-
)
106-
{
107-
Object
108-
.
109-
keys
110-
(
111-
style
112-
)
113-
.
114-
forEach
115-
(
116-
key
117-
=
118-
>
119-
{
120-
if
121-
(
122-
validStyles
123-
.
124-
includes
125-
(
126-
key
127-
)
128-
)
129-
{
130-
element
131-
.
132-
style
133-
.
134-
setProperty
135-
(
136-
key
137-
style
138-
[
139-
key
140-
]
141-
)
142-
;
143-
}
144-
}
145-
)
146-
;
147-
}
148115
export
149116
const
150117
EmbeddedBrowser
@@ -471,13 +438,46 @@ current
471438
style
472439
)
473440
{
474-
applyValidStyles
441+
const
442+
validStyles
443+
=
444+
AboutWelcomeUtils
445+
.
446+
getValidStyle
475447
(
448+
style
449+
BROWSER_STYLES
450+
)
451+
;
452+
Object
453+
.
454+
keys
455+
(
456+
validStyles
457+
)
458+
.
459+
forEach
460+
(
461+
key
462+
=
463+
>
464+
{
476465
browserRef
477466
.
478467
current
468+
.
479469
style
480-
BROWSER_STYLES
470+
.
471+
setProperty
472+
(
473+
key
474+
style
475+
[
476+
key
477+
]
478+
)
479+
;
480+
}
481481
)
482482
;
483483
}

browser/components/aboutwelcome/content-src/components/MultiSelect.jsx

+24-83
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,24 @@ from
8181
MSLocalized
8282
"
8383
;
84+
import
85+
{
86+
AboutWelcomeUtils
87+
}
88+
from
89+
"
90+
.
91+
.
92+
/
93+
lib
94+
/
95+
aboutwelcome
96+
-
97+
utils
98+
.
99+
mjs
100+
"
101+
;
84102
const
85103
MULTI_SELECT_STYLES
86104
=
@@ -179,89 +197,6 @@ boxShadow
179197
"
180198
]
181199
;
182-
function
183-
getValidStyle
184-
(
185-
style
186-
validStyles
187-
allowVars
188-
)
189-
{
190-
if
191-
(
192-
!
193-
style
194-
)
195-
{
196-
return
197-
null
198-
;
199-
}
200-
return
201-
Object
202-
.
203-
keys
204-
(
205-
style
206-
)
207-
.
208-
filter
209-
(
210-
key
211-
=
212-
>
213-
validStyles
214-
.
215-
includes
216-
(
217-
key
218-
)
219-
|
220-
|
221-
(
222-
allowVars
223-
&
224-
&
225-
key
226-
.
227-
startsWith
228-
(
229-
"
230-
-
231-
-
232-
"
233-
)
234-
)
235-
)
236-
.
237-
reduce
238-
(
239-
(
240-
obj
241-
key
242-
)
243-
=
244-
>
245-
{
246-
obj
247-
[
248-
key
249-
]
250-
=
251-
style
252-
[
253-
key
254-
]
255-
;
256-
return
257-
obj
258-
;
259-
}
260-
{
261-
}
262-
)
263-
;
264-
}
265200
export
266201
const
267202
MultiSelect
@@ -513,6 +448,8 @@ useMemo
513448
)
514449
=
515450
>
451+
AboutWelcomeUtils
452+
.
516453
getValidStyle
517454
(
518455
content
@@ -788,6 +725,8 @@ item
788725
style
789726
=
790727
{
728+
AboutWelcomeUtils
729+
.
791730
getValidStyle
792731
(
793732
style
@@ -836,6 +775,8 @@ id
836775
style
837776
=
838777
{
778+
AboutWelcomeUtils
779+
.
839780
getValidStyle
840781
(
841782
icon

0 commit comments

Comments
 (0)