[web-console] Improve error popups by including error context#5868
[web-console] Improve error popups by including error context#5868Karakatiza666 merged 1 commit intomainfrom
Conversation
| console.log('Original error: ', error) | ||
| } | ||
| } | ||
| const toastError = (scope: string) => (error: Error, durationMs?: number) => { |
There was a problem hiding this comment.
This changes the toastError public API from (error, durationMs?) => void to a curried (scope) => (error, durationMs?) => void — a behavioral change touching every call site. No tests.
Please add Vitest unit tests for at minimum:
toastError(scope)(error)prependsscope:to the messagetoastError('')(error)falls back to bare message (thescope ? ... : ...branch at line 6)catchError(scope, f)surfaces the scoped message whenfthrows
Pure functions, no DOM needed. Setup: npm install -D vitest jsdom.
| {@render start({ | ||
| text: 'Start', | ||
| getAction: (alt) => (alt ? 'start_paused' : 'start'), | ||
| action: 'start_paused', |
There was a problem hiding this comment.
Behavior change: the old getAction: (alt) => (alt ? 'start_paused' : 'start') let users Ctrl/Shift/Meta-click to launch without pausing. That shortcut is gone now — _start_paused always fires start_paused. Intentional?
There was a problem hiding this comment.
That's intended simplification
There was a problem hiding this comment.
Fair enough — intentional removal noted. The test gap is still the open blocker though (the curried toastError and the simplified start action need coverage).
This helps when the error itself is obscure Signed-off-by: Karakatiza666 <bulakh.96@gmail.com>
8c6e0f0 to
6f9b431
Compare
This helps when the error itself is obscure
Testing: manual