# Debug Report Template

Use this exact structure for consistency:

````markdown
# Tauri Debug Report - [YYYY-MM-DD HH:MM]

## Screenshot

![Screenshot](/tmp/tauri_debug_TIMESTAMP.png)

## Process Status

- Status: [Running/Not Running]
- PID: [pid]
- Memory (RSS): [MB]
- CPU: [percentage]%
- Command: [command line]

## Console Logs

### Error Count: [N]

### Warning Count: [N]

### Recent Errors

```
[error logs from last 5 entries]
```

### Recent Warnings

```
[warning logs from last 5 entries]
```

### Log Statistics

- Total logs: [N]
- Errors: [N]
- Warnings: [N]
- Info: [N]
- Debug: [N]

## WebView State

```json
{
  "url": "...",
  "title": "...",
  "user_agent": "...",
  "viewport": {
    "width": ...,
    "height": ...
  }
}
```

## Visual Analysis

### UI State

[Description of visible UI elements, current screen, navigation state]

### Identified Issues

- [ ] Issue 1: [description with location/screenshot reference]
- [ ] Issue 2: [description with location/screenshot reference]
- [ ] Issue 3: [description with location/screenshot reference]

### Layout Problems

[Any layout issues, misalignments, overflow, or rendering problems]

### Error Indicators

[Visible error messages, banners, toast notifications, console output]

## Performance Analysis

### Memory Usage

- RSS: [MB]
- VSZ: [MB]
- Trend: [increasing/stable/decreasing]

### CPU Usage

- Current: [%]
- Average: [%]
- Spikes: [yes/no, describe if yes]

### Rendering

- FPS: [if available]
- Frame drops: [yes/no]
- GPU usage: [if available]

## Root Cause Analysis

### Primary Cause

[Analysis based on collected evidence from logs, screenshots, and state]

### Contributing Factors

1. [Factor 1]
2. [Factor 2]
3. [Factor 3]

### Evidence

- Log evidence: [specific errors/warnings]
- Visual evidence: [screenshot observations]
- State evidence: [WebView state anomalies]

## Recommendations

### Immediate Actions

1. **[Action 1]**
   - Implementation: [specific code changes or commands]
   - Expected outcome: [what should change]
   - Risk: [low/medium/high]

2. **[Action 2]**
   - Implementation: [specific code changes or commands]
   - Expected outcome: [what should change]
   - Risk: [low/medium/high]

### Long-term Improvements

1. [Improvement 1 with rationale]
2. [Improvement 2 with rationale]
3. [Improvement 3 with rationale]

## Next Steps

- [ ] Implement fix for [specific issue]
- [ ] Test in [environment/scenario]
- [ ] Monitor [specific metric/behavior]
- [ ] Document changes in [location]
- [ ] Verify fix with [validation method]

## Additional Notes

[Any other observations, edge cases, or relevant context]

---

**Report generated by**: [Your name/automated tool]
**Review status**: [Pending/Reviewed/Implemented]
````

## Usage Tips

1. **Fill sections progressively** as you complete each debug workflow step
2. **Be specific** in root cause analysis - avoid vague statements
3. **Include evidence** - reference specific log lines, screenshot areas
4. **Actionable recommendations** - provide exact commands or code changes
5. **Track progress** - check off items as you implement fixes

## Example Report

See `examples/sample_debug_report.md` (if created) for a filled example.
