Closed miina closed 2 years ago
For each font, we try to retrieve information about it from the server. If the server doesn't return the font information, we know it has been deleted.
Aren't the fonts already loaded "in bulk" beforehand so that we have the information already? Or at least the custom fonts + the default 100 fonts, we'd probably only need a separate request for fonts that are not among the initially loaded fonts?
For each missing font, display a single modal to let the user know about it, offering further instructions.
Somehow it would make sense to me to see right away all the fonts that are missing and perhaps allow dealing with all together as well. Might be a bit confusing to see multiple popups opening up after each other. But I guess that's an unlikely case anyway and UX is confirmed already. Maybe the title should be in singular as well then (Missing Font).
Aren't the fonts already loaded "in bulk" beforehand so that we have the information already? Or at least the custom fonts + the default 100 fonts, we'd probably only need a separate request for fonts that are not among the initially loaded fonts?
No fonts are loaded initially when opening the editor. The curated fonts list is only first loaded when the font picker is rendered for the first time. This was improved recently, see #10643
I imagine this part to be pretty straightforward anyway:
getFonts({ include: 'FontA,FontB,FontC' })
[ (FontA data...), (FontC data...) ]
Somehow it would make sense to me to see right away all the fonts that are missing and perhaps allow dealing with all together as well.
This was also my first impression, but it would make the modal potentially quite long, plus it's an unlikely scenario.
Amy and I agreed that we can revisit this if user feedback indicates otherwise.
Maybe the title should be in singular as well then (Missing Font).
👍
Getting some pieces setup for this ...
Is the font dropdown "z-index" a known issue? If yes can you point me to a workaround.
@timarney The font picker uses the Datalist
component from the design system. The Datalist
component has a zIndex
prop for overriding the popup's default z-index (which I think is 2
).
Tested against https://stories-qa-wordpress-amp.pantheonsite.io/wp-admin/, using PR #10808.
Feature Description
It's possible for custom fonts (and even Google Fonts!) to be deleted.
When the user opens a story that uses a font that no longer exists, we want to notify the user about it.
Here's what this notification should be like:
Figma: View current design
Screenshot:
General flow:
<FontPicker>
dropdown; the same component we use in the design panel.CTAs
TEXT_ELEMENT_DEFAULT_FONT
or fetched via API)When replacing an element's missing font, the font weight should be preserved. If the replacement font is not available in the same weight, we pick the closest possible match
Implementation notes:
FontPicker
needs to be refactored so thathandleFontPickerChange
andfontFamily
are passed via props instead (so there is no dependency onselectedElements
andpushUpdate
font
toELEMENT_PROPS_TO_IGNORE
, so that clicking on "Open anyway" does not cause a history entry<StatusCheck>
worksAlternatives Considered
Additional Context
ELEMENT_PROPS_TO_IGNORE
accordingly)