Skip to content

Update: JSDoc documentation for notification system (fixes #810)#811

Merged
oliverfoster merged 9 commits intomasterfrom
issue/810
Apr 13, 2026
Merged

Update: JSDoc documentation for notification system (fixes #810)#811
oliverfoster merged 9 commits intomasterfrom
issue/810

Conversation

@joe-replin
Copy link
Copy Markdown
Contributor

@joe-replin joe-replin commented Jan 5, 2026

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 examples
  • notifyView.js - Fixed @example block in read() method; documented all public methods with parameters and working code examples
  • notifyPopupView.js - Added modal documentation and event handler details
  • notifyPushView.js - Documented push notification display behavior, positioning, and public methods
  • notifyModel.js - Documented side effects, idempotency, and async API for onClosed()
  • notifyPushCollection.js - Added queue management documentation with focus on side effects

Documentation Standards Applied

What Gets Documented:

  • Functions and methods - With @param, @returns, @example
  • Classes and modules - With @class, @classdesc, @module, @file
  • Singletons - As services with clear APIs
  • File-level descriptions - Purpose, responsibility, integration points
  • Public APIs - Everything plugins can safely use
  • Complex algorithms - With explanatory comments and examples

What Gets Skipped:

  • Configuration methods - defaults(), className(), attributes(), tagName(), events()
  • Obvious helper methods - preRender(), postRender(), render(), etc. where name + code are self-explanatory
  • Variables and constants - Simple assignments, magic numbers
  • Private properties - Internal state like this._stack, this.hasOpened
  • Enums - Individual enum values (document the file, not each constant)
  • Event listeners - No @listens tags (wiring is obvious from code)
  • Event definitions - No @event tags (redundant with @fires)
  • Internal/private events - Only document public API events
  • Framework events - Backbone's change, sync, etc.
  • Implementation details - How it works internally (use inline comments instead)
  • Abstract "extension points" - Don't list WHAT can be customized; show HOW in examples

Testing

  1. Verify all 6 files are valid JSDoc:

    npm run build  # Ensures JSDoc parsing succeeds
  2. Check style guide compliance:

    • Verify all code examples contain executable code
    • Check that framework methods are not over-documented
  3. Validate documentation structure:

    • Open each notify file and confirm:
      • File-level documentation is present
      • "Known Issues & Improvements" section exists
      • All public methods are documented with working examples
      • Private methods are marked as private
      • Public events are documented
  4. Test specific changes:

    • notify.js: Verify examples work with Adapt API
    • notifyView.js: Confirm read() method is properly documented
    • notifyPopupView.js: Check modal lifecycle documentation
    • notifyPushView.js: Verify positioning behavior is clear
    • notifyModel.js: Check async API is documented
    • notifyPushCollection.js: Confirm queue behavior is clear
  5. Clarity Check:

    • Review documentation for clarity and completeness
    • Verify code examples are clear and work as intended
    • Confirm integration points are easy to understand

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.
Comment thread js/collections/notifyPushCollection.js Outdated
Comment thread js/collections/notifyPushCollection.js Outdated
Comment thread js/models/notifyModel.js Outdated
Comment thread js/views/notifyPopupView.js Outdated
Comment thread js/views/notifyPopupView.js Outdated
Comment thread js/views/notifyPushView.js Outdated
Copy link
Copy Markdown
Member

@oliverfoster oliverfoster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lovely

Comment thread js/views/notifyPopupView.js Outdated
Comment thread js/views/notifyView.js Outdated
@oliverfoster
Copy link
Copy Markdown
Member

Can you remove the "Improvements" and "Known Issues" sections, please? We can do those as separate issues after a further analysis phase.

@joe-replin joe-replin linked an issue Feb 4, 2026 that may be closed by this pull request
12 tasks
Comment thread js/views/notifyView.js
Comment thread js/views/notifyView.js
@oliverfoster oliverfoster merged commit 7d97a8c into master Apr 13, 2026
@github-project-automation github-project-automation Bot moved this from Needs Reviewing to Recently Released in adapt_framework: The TODO Board Apr 13, 2026
@oliverfoster oliverfoster deleted the issue/810 branch April 13, 2026 10:08
github-actions Bot pushed a commit that referenced this pull request Apr 13, 2026
# [6.76.0](v6.75.2...v6.76.0) (2026-04-13)

### Fix

* Logic for detecting removed elements (fixed #819) (#820) ([7a21597](7a21597)), closes [#819](#819) [#820](#820)

### Update

* JSDoc documentation for drawer system (fixes #812) (#813) ([40e5aaf](40e5aaf)), closes [#812](#812) [#813](#813)
* JSDoc documentation for notification system (fixes #810) (#811) ([7d97a8c](7d97a8c)), closes [#810](#810) [#811](#811)
@oliverfoster
Copy link
Copy Markdown
Member

🎉 This PR is included in version 6.76.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Recently Released

Development

Successfully merging this pull request may close these issues.

JSDocs - Core Notification System Add JSDoc Documentation to Core Framework

2 participants