Luxar Viewer API Documentation - v2026.9.22
    Preparing search index...

    Class DebugConsole

    Debug console UI component with console message capture and display.

    Integrates with the global consoleInterceptor to show all browser console output in a styled panel. Messages are buffered globally, so opening the console shows full history from app startup.

    Index
    • Create and initialize debug console panel.

      Builds UI, registers with global console interceptor, and adds to DOM. Starts hidden - use toggle() or show() to display.

      The console captures ALL messages logged since app startup, including those before this constructor was called (via global interceptor).

      Returns DebugConsole

      const debugConsole = new DebugConsole();
      // Panel created but hidden

      // Later, user presses Ctrl+L to show
      debugConsole.toggle();
    panel: HTMLElement
    contentArea: HTMLElement
    isVisible: boolean = false
    autoScroll: boolean = true
    filter: string = ''
    messageListenerCallback: ((message: BufferedMessage) => void) | null = null
    events: EventGroup = ...

    Cleanup group covering every DOM listener attached by this panel: the toolbar buttons, drag/resize global listeners, and the blur/visibilitychange watchers that stop in-flight drag/resize when the window loses focus (otherwise the state stays "active" indefinitely — if the user releases the mouse off-window, we never see the mouseup and the next mousemove would resume dragging).

    • Setup event handlers for the panel

      Parameters

      • panel: HTMLElement

      Returns void

    • Make the panel draggable

      Parameters

      • panel: HTMLElement

      Returns void

    • Make the panel resizable

      Parameters

      • panel: HTMLElement

      Returns void

    • Format arguments for display

      Parameters

      • args: unknown[]

      Returns string

    • Format an argument as a DOM element (safe, no XSS)

      Parameters

      • arg: unknown

      Returns HTMLElement

    • Clear all console messages from display and buffer.

      Clears both the UI and the global console interceptor buffer. This is a destructive operation - messages cannot be recovered. The message count resets to 0.

      Returns void

      // User clicks "Clear" button
      debugConsole.clear();
      // All messages removed, fresh start
    • Show debug console with complete message history.

      Displays all buffered messages from app startup, not just messages since last show(). This is key behavior - you can see what happened during initialization, data loading, etc. even if you open console later.

      Triggered by Ctrl+L keyboard shortcut when console is hidden.

      Returns void

      // Open console after app has been running
      debugConsole.show();
      // See ALL messages since startup, not just recent ones
    • Hide debug console panel.

      Messages continue to be buffered by the global interceptor while hidden. Next show() will display complete history.

      Triggered by Ctrl+L when console is visible, close button, or Escape key.

      Returns void

    • Toggle debug console visibility (show ↔ hide).

      Primary method for Ctrl+L keyboard binding.

      Returns void

      // User presses Ctrl+L
      debugConsole.toggle();
    • Check if debug console is currently visible.

      Returns boolean

      true if console panel is shown, false if hidden

    • Clean up debug console resources and remove from DOM.

      Unregisters from global console interceptor, removes panel from DOM, and cleans up styles. Should be called during application teardown.

      After calling dispose(), the DebugConsole instance cannot be reused.

      Returns void