Closed Bug 1764897 Opened 3 years ago Closed 1 years ago

Switch to Data view when JSON is broken

Categories

(DevTools :: JSON Viewer, enhancement)

enhancement

Tracking

(firefox119 fixed)

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: mte90net, Assigned: zacnomore)

References

Details

(Whiteboard: [devtools:relnote])

Attachments

(1 file, 2 obsolete files)

Right now if you open a json or rest api and this has a broken JSON you get a tiny message in red.
So I have to manually switch to the other tab to see what is happening and I have to do it everytime, a refresh and switch.
It isn't better to switch to that tab in that case and show an error if this is the case?

Note that there were discussions around providing a better UX for invalid/broken JSON in Bug 1198558, but it seems that defaulting to the Data tab in case there is an error (and showing a generic error notification eg "Invalid JSON could not be parsed" or something similar) sounds like a good first step.

See Also: → 1198558
Assignee: nobody → cczac1
Status: NEW → ASSIGNED

Julian, would you be able to review this one?

Flags: needinfo?(jdescottes)

Sure, I'll take a look.

I've also flagged the whole group for review.
Will be easier to get eyes on it this way (the devtools-reviewers group is a recent addition, don't think it existed when you initially submitted this)

Flags: needinfo?(jdescottes)
Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/53760c91a685 Switch to raw data view when JSON is invalid r=jdescottes,devtools-reviewers

As noticed by Oriol on https://phabricator.services.mozilla.com/D187740#inline-1040771, there is a small issue with the propTypes. Can you provide an additional patch to fix this? Feel free to file another bug or just to upload it here.

Flags: needinfo?(cczac1)

Thank you for the review! I have submitted that patch. I am having an issues using devtools-reviewers, I get this error:

(New) 754864:b0865c68cd59 Bug 1764897 - Correct TextPanel errorMessage prop type r=jdescottes,devtools-reviewers
Unable to submit commits:

754864:b0865c68cd59 Bug 1764897 - Correct TextPanel errorMessage prop type r=jdescottes,devtools-reviewers

  • devtools-reviewers is not a valid reviewer's name

Any idea what I'm doing wrong? I'm attempting to submit with moz-phab submit

Flags: needinfo?(cczac1)
Attachment #9314029 - Attachment is obsolete: true
Status: ASSIGNED → RESOLVED
Closed: 1 years ago
Resolution: --- → FIXED
Target Milestone: --- → 119 Branch

(In reply to Zac Svoboda :zacnomore from comment #10)

Thank you for the review! I have submitted that patch. I am having an issues using devtools-reviewers, I get this error:

For reviewer groups, we need to prefix them with #, so #devtools-reviewers here (yes, nothing tells you about that :) )

Anyway I this bug is closed now, so I will file a different one for your new patch.

Attachment #9352209 - Attachment is obsolete: true
Whiteboard: [devtools:relnote]
Duplicate of this bug: 1740504
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: