-
Notifications
You must be signed in to change notification settings - Fork 16
Update: JSDoc documentation for notification system (fixes #810) #811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Added detailed JSDoc documentation to notification-related files, including models, collections, views, and the main notification service. The comments describe module responsibilities, public APIs, integration points, known issues, and usage examples, improving code maintainability and developer onboarding.
| * @example | ||
| * const model = new NotifyModel({ | ||
| * body: 'Delayed message', | ||
| * _delay: 1000 | ||
| * }); | ||
| * collection.add(model); | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only handle to a NotifyPushCollection is at notify.notifyPushes, NotifyPushCollection would not be instantiated by a developer.
We would use notify.push(options) instead of notify.notifyPushes.add(model).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in c675983
oliverfoster
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lovely
| initialize({ notify }) { | ||
| this.notify = notify; | ||
| _.bindAll(this, 'onShadowClicked', 'resetNotifySize', 'onKeyDown'); | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary whitespace addition.
| * _showIcon: true | ||
| * }); | ||
| * | ||
| * Adapt.on('course:save', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue with not detaching handlers. Please correct for all cases where Adapt.on is not followed by Adapt.off clearup.
Comprehensive JSDoc documentation review and enhancement of the notification system (6 files). This PR sets to begin an established style guide with clear, practical examples and identified known issues/improvements for future JSDocs.
Fix
Update
notify.js- Added complete module-level documentation with public API, integration points, known issues, and customization examplesnotifyView.js- Fixed @example block inread()method; documented all public methods with parameters and working code examplesnotifyPopupView.js- Added modal documentation and event handler detailsnotifyPushView.js- Documented push notification display behavior, positioning, and public methodsnotifyModel.js- Documented side effects, idempotency, and async API foronClosed()notifyPushCollection.js- Added queue management documentation with focus on side effectsDocumentation Standards Applied
What Gets Documented:
@param,@returns,@example@class,@classdesc,@module,@fileWhat Gets Skipped:
defaults(),className(),attributes(),tagName(),events()preRender(),postRender(),render(), etc. where name + code are self-explanatorythis._stack,this.hasOpened@listenstags (wiring is obvious from code)@eventtags (redundant with@fires)change,sync, etc.Testing
Verify all 6 files are valid JSDoc:
npm run build # Ensures JSDoc parsing succeedsCheck style guide compliance:
Validate documentation structure:
Test specific changes:
notify.js: Verify examples work with Adapt APInotifyView.js: Confirmread()method is properly documentednotifyPopupView.js: Check modal lifecycle documentationnotifyPushView.js: Verify positioning behavior is clearnotifyModel.js: Check async API is documentednotifyPushCollection.js: Confirm queue behavior is clearClarity Check: