Skip to content

Unified Sidebar UI & Configurable Keyboard Shortcuts

Choose a tag to compare

@Nano112 Nano112 released this 19 Jan 12:38
· 22 commits to master since this release

Overview

This release introduces a unified sidebar UI system that consolidates all 6 floating panels into a single tabbed interface, along with fully configurable keyboard shortcuts that use modifier keys to prevent conflicts with normal typing.


New Features

Unified Sidebar UI

All UI panels are now consolidated into a single tabbed sidebar:

  • Controls - Camera controls and interaction settings
  • Render Settings - Visual quality and rendering options
  • Capture - Screenshot functionality
  • Export - Model export options
  • Resource Packs - Texture pack management
  • Performance - FPS counter and performance metrics

The sidebar can be positioned on the left or right side of the viewport and supports collapse/expand functionality.

Configurable Keyboard Shortcuts (Fixes #8)

All keyboard shortcuts now use modifier keys by default and are fully customizable:

Action Default Shortcut
Toggle Sidebar Ctrl+U
Toggle Visibility Ctrl+\
Controls Tab Ctrl+Shift+1
Render Settings Tab Ctrl+Shift+2
Capture Tab Ctrl+Shift+3
Export Tab Ctrl+Shift+4
Resource Packs Tab Ctrl+Shift+5
Performance Tab Ctrl+Shift+6
Close Sidebar Escape

Shortcuts can be:

  • Completely disabled globally
  • Disabled per-action by setting to null
  • Rebound to custom key combinations
  • Configured with activation/deactivation callbacks per tab

First-Person Fly Controls

New fly control mode for first-person navigation:

  • WASD movement with Space/Shift for vertical
  • Mouse look with pointer lock
  • Configurable movement speed and sensitivity
  • Toggle with F key (when enabled)

Breaking Changes

This release removes the legacy floating panel system:

Removed

  • Individual floating panel classes (ControlsUI, RenderSettingsUI, CaptureUI, ExportUI, ResourcePackUI, PerformanceDashboard)
  • Single-key shortcuts (K, R, C, E, P) that conflicted with typing
  • Per-panel position options (uiPosition: "top-right")

Changed

  • renderer.controlsUI is now renderer.sidebar.panels.controls
  • Individual UI options are consolidated into sidebarOptions

Migration Guide

Before (v1.1.22)

const renderer = new SchematicRenderer(canvas, {}, {}, {
  resourcePackOptions: {
    enableUI: true,
    uiPosition: "top-right",
    toggleUIShortcut: "KeyP"
  }
});
renderer.controlsUI.show();

After (v1.1.23)

const renderer = new SchematicRenderer(canvas, {}, {}, {
  sidebarOptions: {
    enabled: true,
    position: "right",
    shortcuts: {
      showResourcePacks: { key: "Digit5", ctrl: true, shift: true }
    }
  }
});
renderer.showSidebar("resourcePacks");

Configuration Example

const renderer = new SchematicRenderer(canvas, {}, {}, {
  sidebarOptions: {
    enabled: true,
    position: "right",
    width: 360,
    hiddenByDefault: true,
    collapsedByDefault: false,
    enableKeyboardShortcuts: true,
    shortcuts: {
      toggleSidebar: { key: "KeyU", ctrl: true },
      showControls: { key: "Digit1", ctrl: true, shift: true },
      // Set to null to disable a shortcut
      showPerformance: null
    },
    disabledTabs: ["export"], // Hide specific tabs
    defaultTab: "controls"
  }
});

Runtime API

// Sidebar visibility
renderer.showSidebar("controls");
renderer.hideSidebar();
renderer.toggleSidebar();

// Keyboard shortcuts
renderer.enableKeyboardShortcuts();
renderer.disableKeyboardShortcuts();
renderer.setKeyboardShortcut("toggleSidebar", { key: "KeyS", ctrl: true });

// Tab management
renderer.enableSidebarTab("performance");
renderer.disableSidebarTab("export");

Technical Details

  • Sidebar z-index: 1000
  • Fly controls overlay z-index: 900
  • Shortcuts automatically skip when input elements are focused
  • Ctrl key maps to Cmd on macOS