Skip to content

Conversation

@joe-replin
Copy link
Contributor

Fix

Update

Added comprehensive JSDoc documentation to the drawer system (3 files):

  • drawer.js - Singleton service documentation with complete API reference

    • File/module headers with architecture overview
    • Public events section listing all triggered events
    • All public API methods documented: isOpen, open(), openCustomView(), addItem(), hasItem(), close(), toggle(), remove()
    • Usage examples for menu item registration and custom view patterns
    • Known Issues section documenting DrawerCollection accessibility and missing update methods
  • drawerView.js - Main controller view documentation

    • File/module headers explaining dual-mode operation (menu/custom view)
    • Configuration options and position logic documented
    • Public events section
    • Key methods documented: setDrawerPosition(), openCustomView(), showDrawer(), hideDrawer(), remove()
    • Known Issues section identifying single-item toggle workaround, force close hack, and tight coupling to navigation
    • Skipped Backbone config methods per JSDoc style guide
  • drawerItemView.js - Menu item view documentation

    • File/module headers with lifecycle and model structure
    • Class documentation with usage notes
    • onDrawerItemClicked() method documented with callback pattern example
    • Noted internal creation pattern (not for direct instantiation)

All documentation follows the established JSDoc style guide patterns established in the notify system work.

Testing

  1. JSDoc generates correctly for all three files
  2. Cross-references ({@link}) resolve properly
  3. Examples are syntactically valid
  4. No JSDoc syntax errors or warnings

Copy link
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.

Really good.

Comment on lines +2 to +6
* @file Drawer Service - Sidebar navigation system with menu items and custom views
* @module core/js/drawer
* @description Singleton service managing the drawer sidebar navigation system. Provides API
* for registering menu items and displaying custom views. Handles drawer lifecycle, state management,
* and integration with navigation toolbar.
Copy link
Member

Choose a reason for hiding this comment

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

The description and terminology aren't quite right throughout.

Replace 'menu items' with 'drawer items' and the word 'menu' for 'sidebar/drawer' as the word menu is used for menu plugins.
Remove 'navigation system' as the word navigation is used for a core module called 'navigation' which is the horizontal navigation bar, not the vertical sidebar.

* Toggles drawer open/closed based on current state.
* Convenience method for open/close logic.
* @example
* Adapt.trigger('navigation:toggleDrawer');
Copy link
Member

Choose a reason for hiding this comment

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

   * Adapt.trigger('navigation:toggleDrawer');

Consider as deprecated.

As a general principle for Adapt, any event triggered on a subject as if it were a function call that is not a triggered by the subject as notification of a state change should be replaced with a function API. Where a function alternative to an event trigger already exists, consider the event trigger to be deprecated.

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

Projects

Status: Needs Reviewing

Development

Successfully merging this pull request may close these issues.

JSDocs - Drawer

3 participants