{# Execute task form partial #}
<form hx-post="/self-coding/execute" hx-target="#execute-result" hx-indicator="#execute-loading">
  <div class="mb-3">
    <label for="task-description" class="form-label">Task Description</label>
    <textarea 
      class="form-control form-control-sm bg-dark text-light border-secondary" 
      id="task-description" 
      name="task_description" 
      rows="4" 
      placeholder="Describe what you want Timmy to do...

Example: Add error handling to the /health endpoint that returns 503 when Ollama is unreachable."
      required
    ></textarea>
    <div class="form-text">
      Be specific. Include what to change and what the expected behavior should be.
    </div>
  </div>
  
  <div class="alert alert-warning d-flex align-items-start gap-2 py-2">
    <span>⚠️</span>
    <small>
      <strong>Warning:</strong> This will modify source code. Changes will be tested and committed.
      Safety constraints: max 3 files, only files with tests, protected files cannot be modified.
    </small>
  </div>
  
  <div class="d-flex justify-content-end gap-2">
    <button type="button" class="btn btn-sm btn-outline-secondary" onclick="document.getElementById('execute-modal').close()">
      Cancel
    </button>
    <button type="submit" class="btn btn-sm btn-primary" onclick="document.getElementById('execute-modal').close()">
      Execute Task
    </button>
  </div>
</form>

<div id="execute-loading" class="htmx-indicator mt-3">
  <div class="d-flex align-items-center gap-2 text-muted">
    <div class="spinner-border spinner-border-sm" role="status"></div>
    <small>Executing self-edit task... This may take a few minutes.</small>
  </div>
</div>

<div id="execute-result" class="mt-3"></div>
