feat: ✨ Add ErrorBoundary on mobile#61
Open
wapec wants to merge 2 commits into
Open
Conversation
0910e18 to
a2e0758
Compare
- Wrap each mobile editor's React root in a shared ErrorBoundary - Show a framework7 dialog with the error and a single OK button that closes the editor (Common.Gateway.requestClose with a redirect fallback) Signed-off-by: Bohdan Baranov <wapec@icloud.com>
a2e0758 to
20f6fa1
Compare
Author
|
Found a way to set a few style properties with global variables. Will update the code soon |
- Add .error-dialog__code with monospace font and red text - Clamp long stack traces to 7 lines (max-height 120px) with ellipsis Signed-off-by: Bohdan Baranov <wapec@icloud.com>
20f6fa1 to
e9ce65f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In editors display a framework7 dialog when ErrorBoundary catches a render error
How to test
Triggering a render error manually
Real render crashes are not deterministic, so use DevTools to invoke the
boundary's
componentDidCatchdirectly.Open DevTools.
In the Console tab, click the top dropdown at the top-left and
switch context to the iframe whose URL ends in
/web-apps/apps/<editor>/mobile/index.html.Paste and run:
The dialog should appear immediately. To test different error lengths,
replace the message string — e.g.
new Error('Line1\nLine2\n…\nLine9')to verify the multi-line truncation.
Test plan
Dialog appearance
Dialog behaviour
Common.Gateway.requestClose(), so the parent app — e.g. Nextcloud —receives the close signal; outside that, it falls back to
/)Cross-editor coverage
.docx): dialog appears + single OK button works.xlsx): same.pptx): same.vsdx): sameCross-theme rendering (Framework7
theme: 'auto')centred below the body with a thin divider above it
title, OK right-aligned in the dialog footer
Color / contrast (light vs dark mode)
#9b1c1c(deep red) — passes WCAG AAA against white
body.theme-type-darkis set; dialog body isdark, error text switches to
#ff6b6b— passes WCAG AA against thedark dialog background
the text color matches the active theme
Long error handling
…ellipsis(max-height 120 px)
Sanity
Tested on
Screenshots
Dialog by platform — medium / long error in documenteditor
Dialog across editor types