diff --git a/README.md b/README.md index 4f84ebb5..c3de4086 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ * Redesigned talk pages, with author and date displayed on top of comments (opt-in) and thin lines denoting threads * Handling "outdent" templates * Collapsible (and autocollapsible) threads -* Navigating sibling threads by holding the middle button +* Navigating sibling threads by holding the middle mouse button * Comment timestamps in local time and arbitrary format, including relative * Highlighting and navigating new comments (via the navigation panel or the table of contents) * Highlighting own comments diff --git a/src/cd.js b/src/cd.js index 337290e7..0ec37e52 100644 --- a/src/cd.js +++ b/src/cd.js @@ -13,4 +13,21 @@ */ self.convenientDiscussions ||= {}; -export default self.convenientDiscussions; +// Idk how do I make VS Code understand that the export of this module maps to the +// convenientDiscussions namespace. JSDoc generates the contents of that namespace correctly, but VS +// Code doesn't infer types from it. So I just manually type (again) the types of a limited number +// of properties here. + +/** + * @typedef ConvenientDiscussions + * @property {import('./pageRegistry').Page} page + * @property {import('./userRegistry').User} user + * @private + */ + +/** + * @type {ConvenientDiscussions} + */ +const convenientDiscussions = self.convenientDiscussions; + +export default convenientDiscussions; diff --git a/src/pageRegistry.js b/src/pageRegistry.js index 4234fb1e..52a43efa 100644 --- a/src/pageRegistry.js +++ b/src/pageRegistry.js @@ -37,11 +37,11 @@ import { findFirstTimestamp, maskDistractingCode } from './utils-wikitext'; /** * Class representing a wiki page (a page for which the * {@link https://www.mediawiki.org/wiki/Manual:Interface/JavaScript#All_pages_(user/page-specific) wgIsArticle} - * config value is `true`) in both of its facets – a rendered instance (for the current page) and - * an entry in the database with data and content. + * config value is `true`) in both of its facets – a rendered instance (for the current page) and an + * entry in the database with data and content. * - * To access the constructor, use {@link module:pageRegistry.get} (it is only exported for means of - * code completion). + * To create an instance, use {@link module:pageRegistry.get} (the constructor is only exported for + * means of code completion). */ export class Page { /** diff --git a/src/updateChecker.js b/src/updateChecker.js index 0f4f4c60..651b1e11 100644 --- a/src/updateChecker.js +++ b/src/updateChecker.js @@ -17,7 +17,7 @@ import { loadUserGenders } from './utils-api'; import { calculateWordOverlap, keepWorkerSafeValues } from './utils-general'; import visits from './visits'; -// FIXME: Make this into a singleton (object) without inner module variables, so that it emits with +// TODO: Make this into a singleton (object) without inner module variables, so that it emits with // this.emit(). Move worker-related stuff to controller. const revisionData = {}; diff --git a/src/worker.js b/src/worker.js index 62784b7d..da7b9d61 100644 --- a/src/worker.js +++ b/src/worker.js @@ -503,7 +503,8 @@ function onMessageFromWindow(e) { } if (message.type === 'parse') { - debug.startTimer('worker'); + const timerLabel = `worker: processing revision ${message.revisionId}`; + debug.startTimer(timerLabel); cd.g = message.g; cd.config = message.config; @@ -528,7 +529,7 @@ function onMessageFromWindow(e) { sections: cd.sections, }); - debug.stopTimer('worker'); + debug.stopTimer(timerLabel); debug.logAndResetEverything(); } }