name: Bug Report
description: Report a bug or unexpected behavior
title: "[Bug]: "
labels: ["bug", "triage"]
body:
  - type: markdown
    attributes:
      value: |
        Thanks for taking the time to report a bug!

        **Before you submit, please:**
        1. Search [existing issues](https://github.com/maziggy/bambuddy/issues?q=is%3Aissue) — your problem may already be reported or resolved.
        2. Skim the [Troubleshooting wiki](https://wiki.bambuddy.cool/reference/troubleshooting/) — roughly 1 in 5 closed bug reports turn out to be setup or configuration issues already documented there.
        3. If your printer won't connect / won't print / camera won't load, run the in-app **Connection Diagnostic** (printer card or System → Diagnostics) FIRST. Most connection bugs are diagnosed in 30 seconds by the diagnostic and need no GitHub issue.
        4. Generate a **Support Package** from System → Download Support Package — without it, most bugs cannot be investigated.

  - type: dropdown
    id: product
    attributes:
      label: Product
      description: Which product is affected?
      options:
        - Bambuddy
        - SpoolBuddy
    validations:
      required: true

  - type: dropdown
    id: area
    attributes:
      label: Area
      description: Which part of the product is affected? Pick the closest match — picking "Other" makes triage slower.
      options:
        - Printer connection / setup
        - Print start / dispatch
        - Filament / AMS / Spoolman
        - Slicer integration (Bambu Studio / OrcaSlicer)
        - Virtual Printer (VP)
        - Camera / live view / timelapse
        - Archives / library / files
        - Statistics
        - Print Queue / scheduling
        - Notifications
        - Authentication / users / permissions
        - Updates / firmware check
        - UI / display / theme / i18n
        - API / integrations (Home Assistant, MQTT export, Obico, ...)
        - SpoolBuddy kiosk / display
        - Other / not sure
    validations:
      required: true

  - type: textarea
    id: description
    attributes:
      label: Bug Description
      description: A clear and concise description of what the bug is.
      placeholder: Describe what happened...
    validations:
      required: true

  - type: textarea
    id: expected
    attributes:
      label: Expected Behavior
      description: What did you expect to happen?
      placeholder: Describe what you expected...
    validations:
      required: true

  - type: textarea
    id: steps
    attributes:
      label: Steps to Reproduce
      description: How can we reproduce this issue?
      placeholder: |
        1. Go to '...'
        2. Click on '...'
        3. See error
    validations:
      required: true

  - type: textarea
    id: troubleshooting_tried
    attributes:
      label: Troubleshooting steps already taken
      description: |
        What did you try BEFORE opening this issue? Which wiki pages did you check? Which in-app diagnostics did you run?

        This is required because roughly 1 in 5 issues opened turn out to be already-documented setup problems. A meaningful answer here saves a round-trip and helps everyone.
      placeholder: |
        - Ran the in-app Connection Diagnostic — result: ...
        - Checked wiki page: <paste URL or page name>
        - Tried restarting / re-adding the printer
        - Searched closed issues for: "<keywords>"
    validations:
      required: true

  - type: dropdown
    id: printer
    attributes:
      label: Printer Model
      description: Which printer model are you using?
      options:
        - X1 Carbon
        - X1
        - X1E
        - X2D
        - P1S
        - P1P
        - P2S
        - A1
        - A1 Mini
        - H2D
        - H2D Pro
        - H2C
        - H2S
        - Multiple printers
        - Not printer-related
    validations:
      required: false

  - type: input
    id: version
    attributes:
      label: Bambuddy Version
      description: Which version of Bambuddy are you running? (Check Settings page)
      placeholder: e.g., 0.2.5
    validations:
      required: true

  - type: input
    id: spoolbuddy_version
    attributes:
      label: SpoolBuddy Version
      description: If SpoolBuddy-related, which version is running? (Check SpoolBuddy Settings → Updates)
      placeholder: e.g., 0.1.0

  - type: input
    id: firmware
    attributes:
      label: Printer Firmware Version
      description: Which firmware version is your printer running? (Check printer screen or Bambu Handy app). Leave blank if not printer-related.
      placeholder: e.g., 01.08.00.00

  - type: dropdown
    id: installation
    attributes:
      label: Installation Method
      description: How did you install Bambuddy?
      options:
        - Manual (git clone)
        - Docker
        - Other
    validations:
      required: true

  - type: dropdown
    id: os
    attributes:
      label: Operating System
      description: What OS is Bambuddy running on?
      options:
        - Linux (Ubuntu/Debian)
        - Linux (Other)
        - macOS
        - Windows
        - Docker
        - Other
    validations:
      required: true

  - type: markdown
    attributes:
      value: |
        ---
        ### 📦 Support Package — REQUIRED

        Create and attach a **Support Package** from **System → Download Support Package**.
        It bundles logs, system info, and configuration (sensitive data redacted) — without it, most bugs cannot be reproduced or investigated.

        Detailed instructions: [Debug Logging Guide](https://wiki.bambuddy.cool/features/system-info/?h=debug#enable-debug-logging)

  - type: textarea
    id: logs
    attributes:
      label: Support Package (.zip) and / or relevant logs
      description: |
        Drag and drop your support package .zip here, or paste relevant logs. Enable DEBUG mode for verbose logging.

        Reports without a Support Package or logs almost always go back-and-forth for a week before any progress is made. If you genuinely cannot generate one (e.g. Bambuddy itself won't start), write WHY here.
      placeholder: |
        Drag and drop your support package .zip file here, or paste logs / explain why you cannot attach one...
    validations:
      required: true

  - type: textarea
    id: screenshots
    attributes:
      label: Screenshots
      description: |
        If applicable, add screenshots to help explain your problem.
        💡 Tip: You can drag and drop images directly into this text box.

  - type: textarea
    id: additional
    attributes:
      label: Additional Context
      description: Add any other context about the problem here.

  - type: checkboxes
    id: checklist
    attributes:
      label: Final checks
      options:
        - label: I searched existing (open AND closed) issues and this bug hasn't already been reported or resolved
          required: true
        - label: I checked the [Troubleshooting wiki](https://wiki.bambuddy.cool/reference/troubleshooting/) and the relevant feature page for my issue
          required: true
        - label: I am using the latest version of Bambuddy (or the latest daily build)
          required: true
        - label: My printer is set to LAN Only mode
          required: true
        - label: My printer has Developer Mode enabled
          required: true
        - label: For any connection / printing / camera issue, I ran the in-app Connection Diagnostic and included the result above
          required: true
