Add error component
Categories
(Firefox :: Widgets, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox162 | --- | fixed |
People
(Reporter: fchasen, Assigned: nina-py)
References
(Blocks 1 open bug)
Details
(Whiteboard: [hnt][hnt-wattle])
Attachments
(3 external files)
The widget needs and error component to show an error screen and a reportError method and error property to trigger it.
Updated•2 months ago
|
| Reporter | ||
Updated•2 months ago
|
| Reporter | ||
Comment 1•28 days ago
|
||
This should be the same screen as https://www.figma.com/design/i8wWurQ8yn9y5hCjnf8BYu/HNT---Nova?node-id=17363-110293&m=dev
That one says: Crossword unavailable. Check back later.
We will have the widget name available, but that would be like Daily Crossword so not sure it will grammatically make sense as is using the full name?
| Reporter | ||
Comment 2•26 days ago
|
||
Should also include telemetry on New Tab
| Assignee | ||
Updated•22 days ago
|
| Assignee | ||
Comment 3•22 days ago
|
||
The error state has moved into moz-widget, since it owns the frame.
The frame reports its own failure over postMessage on a moz_widget
channel: widget_error sets the state and widget_ready clears it,
each re-emitted as a widget-error or widget-ready DOM event.
reportError() and clearError() drive the same state from a host
that detects a failure some other way. Both message names come from the
Particle (Crossword) widget, which already posts them.
The error content covers the frame rather than replacing it, so a
widget whose data source comes back can say so and get its own view
back. The frame keeps running behind an opaque overlay and goes inert.
New Tab supplies the message, and WidgetError records the error on
first visibility so a preloaded tab the user never saw records nothing.
The wording names no widget, since the header above already does. But
role="alert" announces the message and nothing else, so the name goes
inside it as well, visually hidden. A screen reader reads the widget
name, then the message. Where a widget draws no header of its own, it
passes headerless and the name shows.
Storybook has a ReportedError story that runs the cycle against a
real document, served through a new staticDirs entry in
.storybook/main.js.
Updated•20 days ago
|
Updated•12 days ago
|
| Assignee | ||
Comment 4•12 days ago
|
||
A New Tab widget that fails now shows a message in place of its
content. MozWidgetCard listens for the widget-error and
widget-ready events from moz-widget, and draws WidgetError in the
error slot while the widget is in the error state. A widget in
WIDGET_REGISTRY can set errorL10nId for wording of its own.
WidgetError records widgets_error once the message is on screen, so
a preloaded tab the user never saw records nothing. The error_type is
the reason the widget reported, or load_error when the card noticed
the failure itself. The widget name goes inside the role="alert", and
is visually hidden when a header already shows it.
MozWidgetCard takes a readyOnLoad prop, true by default for
extension pages, and sets the ready-on-load attribute from it.
| Assignee | ||
Comment 5•12 days ago
|
||
A hosted widget page reports its state with postMessage, following
the protocol in docs/host-integration.md of mozilla/framed-widgets.
FramedWidgetCard listens on the <telemetryName>_widget channel and
accepts only messages from the window of its frame and the origin of
its document.
A widget_error with terminal: true and a reason that matches the
protocol's token rule calls reportError(reason) on moz-widget, so
the reason reaches widgets_error as error_type. Other errors are
ignored for now. A widget_ready calls reportReady(), unless the
card is already in the error state, since a widget sends widget_ready
when its page loads even after an early crash.
The card passes readyOnLoad={false}, because the page reports for
itself. reportError() and reportReady() don't exist before Firefox
161, so the optional calls do nothing there.
Comment 7•12 days ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/406a38df7f5f
https://hg.mozilla.org/mozilla-central/rev/8a57dbfb1507
https://hg.mozilla.org/mozilla-central/rev/d5efa95513fb
Description
•