Conversation
…ifications (fixes #871)
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.
Fixes #871
New
Adds an opt-in mode where
errorandfatallog messages are also shown as on-screen push notifications, not only written to the browser console. This gives non-developer authors visibility of problems they would otherwise miss, so they can report them to a developer. The console output is unchanged.The consumer lives in the notify view and subscribes to logging's existing
log:error/log:fatalevents, so logging.js is untouched and no new module dependencies are introduced. Notifications are deduplicated by message, show only the logged message (no stack trace), and use a generous, manually dismissable timeout. They are styled with fixed system colours to echo the browser console's error styling.Behaviour is gated by a new
_logging._notifyconfig block, disabled by default so published courses do not surface errors to learners. Authors enable it when previewing. Added to both the modern (config.schema.json) and legacy (config.model.schema) schemas.Config:
_isEnabled(defaultfalse): off unless the author opts in._level(errororfatal, defaulterror): minimum level to notify._timeout(default15000): how long each notification stays before fading; can also be dismissed manually.Testing
config.json, set_logging._notify._isEnabledtotrue.require('core/js/logging').error('Test error')in the browser console, or by loading a course with a known misconfiguration._isEnabledback tofalseand confirm no notification appears.Posted via collaboration with Claude Code