OpenBugReportCommandHandler
A command handler that opens the plugin’s bug-report issue form on GitHub, prefilled with the environment and any diagnostics the user agreed to include. See getBugReportIssueFormUrl for the field ids the form must use, and buildBugReportIssueFormLink for what happens to a report too long for a link.
Import:
import { OpenBugReportCommandHandler } from '@mnaoumov/obsidian-lib/command-handlers/open-bug-report-command-handler';Signature:
export class OpenBugReportCommandHandler extends OpenGitHubCommandHandlerExtends: OpenGitHubCommandHandler
Constructor
new OpenBugReportCommandHandler(params: OpenBugReportCommandHandlerConstructorParams)Constructs a new instance.
Properties
| Property | Type | Description |
|---|---|---|
| app | App | The Obsidian app instance. |
| getDiagnostics | (() => Promisable<readonly BugReportDiagnosticSection[]>) | undefined | Gets the optional diagnostics the report can carry. |
| gitHubRepo | string | The plugin's repository, as owner/name.(Inherited from OpenGitHubCommandHandler) |
| icon | IconName | The icon for the command. (Inherited from OpenGitHubCommandHandler) |
| id | string | The ID of the command. (Inherited from OpenGitHubCommandHandler) |
| maxUrlLength | number | undefined | The most characters the encoded link may have before the report moves to the clipboard. |
| name | string | The display name of the command. (Inherited from OpenGitHubCommandHandler) |
| pluginId | string | The id of the reporting plugin. |
Methods
| Method | Returns | Description |
|---|---|---|
| buildCommand() | Command | Builds a plain Obsidian Command object with a checkCallback.(Inherited from OpenGitHubCommandHandler) |
| canExecute() | boolean | Checks whether the command can currently execute. (Inherited from OpenGitHubCommandHandler) |
| execute() | Promise<void> | Lets the user review the diagnostics, if any, then opens the issue form. When the report is too long for a link, it is copied to the clipboard first, or shown for copying by hand when the clipboard refuses it. |
| getUrl() | Promise<string> | Builds the prefilled bug-report URL, with the environment only. |
| onRegistered(context) | Promise<void> | Called after the command has been registered with Obsidian. Subclasses use the provided context to register menu event handlers. Throws when the same instance is registered twice. A handler stores per-registration state — the plugin name here, the active-file provider and the submenu override in AbstractFileCommandHandler, plus whatever a subclass records — and the menu closures registered here read that state lazily, at menu-render time. So a second registration silently rewrites what the first registration's closures will see. CommandHandlerComponent registers a handler set once per menu surface, which is why CommandHandlerFactory must build FRESH instances on every call; this guard turns a factory that hands out shared instances into a loud failure instead of a wrong context menu.(Inherited from OpenGitHubCommandHandler) |
Links to this page: