Problem/Motivation
Having verbose error logging on is good for security as we see bad things soon, but screens full of backtraces are a PITA.
Which nudges us developers to develop without warnings and notices, which is bad and kills kittens.
Proposed resolution
Wrap backtraces in a details tag in UI error messages.
Remaining tasks
Make followups
Usability review
Code review
User interface changes
Notices / Warnings are much more compact.
Before
After
API changes
None.
Data model changes
None.
Release notes snippet
If developer chooses to see verbose error messages in the UI, the backtraces are now wrapped in a details element.
Comment | File | Size | Author |
---|---|---|---|
#16 | focus.jpg | 79.06 KB | rkoller |
#16 | voiceover.mp4 | 2.32 MB | rkoller |
#15 | Screen Shot 2023-02-04 at 12.24.08 PM.png | 196.43 KB | smustgrave |
#15 | Screen Shot 2023-02-04 at 12.23.56 PM.png | 467.57 KB | smustgrave |
#11 | reroll_diff_3153567_2-11.txt | 1.62 KB | ankithashetty |
Issue fork drupal-3153567
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
geek-merlinPatch flying in that implements this. And the result is a revelation:
Before
With patch
Comment #3
Chi CreditAttribution: Chi commentedHow will this look in CLI context?
Comment #4
geek-merlin> How will this look in CLI context?
This will only ever go to the HTML UI message area via the messenger service. Even the message going to the logger is a different one, see related issue.
Comment #8
geek-merlin9.3 still applies, 9.4 needs reroll
Comment #9
geek-merlinComment #10
rootworkTagging as novice for the reroll.
Comment #11
ankithashettyRerolled the patch in #2, thanks!
Comment #12
rootworkI think this can still be novice for the review, if someone wants to take this up and confirm that it applies and provide screenshots.
Comment #15
smustgrave CreditAttribution: smustgrave at Mobomo commentedThis issue is being reviewed by the kind folks in Slack, #needs-review-queue-initiative. We are working to keep the size of Needs Review queue [2700+ issues] to around 400 (1 month or less), following Review a patch or merge request as a guide.
Seems like a neat request.
Tagging for tests as we will need coverage for this change.
Tagging for usability review so they can see if there is any issue. Will admit the arrows for the collapsed section just looked like bullets. If I didn't know to looked for collapsed not sure I would of clicked on them.
Adding screenshots
Comment #16
rkolleri've quickly tested the patch in drupal 9.5.3. . in general it is a great idea. i've noticed one or two details.
pre
tag). but instead first the summary of the second warning, then the summary of the third warning, and after that the rest of the content of the first expanded detail element is announced. if i wouldn't been able to follow along visually that would be super confusing and i would be unable or at least have a hard time to distinguish between the content of the different warnings. Edit: And the state change to expanded of the detail element isn't announced somehow./error-test/generate-warnings
)Comment #17
Rishabh Vishwakarma CreditAttribution: Rishabh Vishwakarma at OpenSense Labs for DrupalFit commentedPatch 11 works on 10.1.x as well.
Comment #18
geek-merlin@rkoller Thx for the usability review in #16.
As of your points:
> 2. [colors]
> 3. [line height]
This is undoubtably theme dependent. I'd propose to tacke these optimizations in followup issues per theme.
> 1. [details difficult to navigate via text-to-speech assistive technology]
I'm not into a11y of details elements. I guess adding some kind of aria-foo attribute may help.
Do you have a suggestion what this might be?
EDIT: I misread the post, it's not about aria labels.
Comment #20
geek-merlinAs of a11y, a line of error summary with option to read aloud a backtrace is obviously better than a 50+-lines bob of backtrace.
As of theme optimization, i can open followups.
Now we have the feature and a green test.
Comment #22
smustgrave CreditAttribution: smustgrave at Mobomo commentedLooked at this with @lauriii at DrupalCon Pittsburgh for the usability tag and didn't notice any issues with the change.
Testing out it functions as expected
Used the error_test module
Went to /error-test/generate-warnings
Errors were in a detail tag now.
Comment #23
catchComment #24
longwaveLet's open a followup to deal with the accessibility issues raised in #16 through #20; I don't believe this is any worse than it was previously and so this shouldn't block commit.
Not eligible for backport as this is a UI change in 10.1.x, even if this is developer-facing only.
Committed 87afd2c and pushed to 11.x. Thanks!
Comment #27
quietone CreditAttribution: quietone at PreviousNext commentedThis needs work for the followups, see #24