qmk_userspace/qmk_flash_tools/UX_IMPROVEMENT.md
2025-10-09 14:45:23 +02:00

190 lines
4.6 KiB
Markdown

# User Experience Comparison
## Old Behavior (Always Ask)
```
Run 1 (First time):
───────────────────
Script: "Which side first? [left/right]:"
You: "left"
[Flash left]
Script: "Flash right? [y/n]:"
You: "y"
[Flash right]
Run 2 (Second time):
────────────────────
Script: "Which side first? [left/right]:" ← Asked again!
You: "left"
[Flash left]
Script: "Flash right? [y/n]:"
You: "y"
[Flash right]
Run 3, 4, 5...
──────────────
Same thing every time - always asking! 😕
```
## New Behavior (Smart Auto-Detect)
```
Run 1 (First time - Empty mapping):
────────────────────────────────────
Script: "Which side first? [left/right]:" ← Only asked first time
You: "left"
[Flash left]
Script: "Flash other side? [y/n]:"
You: "y"
[Flash right]
Run 2 (Subsequent - Complete mapping):
───────────────────────────────────────
Script: "Plug in a keyboard half and enter bootloader..."
You: [Plugs in left half]
Script: "🎯 Auto-detected: left side" ← No asking!
[Flash left]
Script: "Flash other side? [y/n]:"
You: "y"
You: [Plugs in right half]
Script: "🎯 Auto-detected: right side" ← No asking!
[Flash right]
Run 3, 4, 5...
──────────────
Always auto-detects - never asks again! 🎉
```
## Workflow Comparison
### First Time Setup (Empty → Complete)
**Old:**
```
Ask → Flash left → Ask → Flash right
```
**New:**
```
Ask once → Flash left → Flash right (inferred)
```
### Normal Use (Complete mapping)
**Old:**
```
Ask every time → Flash
```
**New:**
```
Auto-detect → Flash ← No asking!
```
## Decision Logic
```
┌─────────────────────┐
│ Check mapping state │
└──────────┬──────────┘
┌─────┴──────┐
│ │
▼ ▼
Empty Partial/Complete
│ │
▼ ▼
📝 ASK 🎯 AUTO-DETECT
```
## User Benefits
### Empty Mapping (First Time)
**Asks** - Needs to learn your devices
**Simple** - Just answer "left" or "right"
**One-time** - Only happens once
### Partial Mapping (Learning Second Device)
**Smart** - Knows which device is which
**Infers** - Unknown must be the unmapped side
**Automatic** - No asking needed
### Complete Mapping (Normal Use)
**Instant** - Recognizes device immediately
**No questions** - Fully automatic
**Protected** - Rejects unknown devices
## Key Insight
**User knows their hardware!**
- If they replaced a controller → They know to clear mappings
- If mapping exists → Trust it and auto-detect
- Only ask when necessary (empty mapping)
## Example Sessions
### Session 1: Brand New Setup
```
$ ./autoflash_modular.sh
📝 First time setup - learning your keyboard halves
Which side will you flash first? [left/right]: left
Plug in left half and enter bootloader...
✅ Saved as left side
✅ left side flashed!
Flash the right side now? [y/n]: y
Plug in right half and enter bootloader...
✅ Saved as right side (completes mapping)
✅ right side flashed!
🎉 Complete! Mapping saved.
```
### Session 2: Normal Reflashing
```
$ ./autoflash_modular.sh
✅ Device mapping exists - auto-detection enabled
Plug in a keyboard half and enter bootloader...
🎯 Auto-detected: left side (known device)
✅ left side flashed!
Flash the other keyboard half now? [y/n]: y
Plug in other half and enter bootloader...
🎯 Auto-detected: right side (known device)
✅ right side flashed!
🎉 Done!
```
### Session 3: One Side Only
```
$ ./autoflash_modular.sh
✅ Device mapping exists - auto-detection enabled
Plug in a keyboard half and enter bootloader...
🎯 Auto-detected: right side (known device)
✅ right side flashed!
Flash the other keyboard half now? [y/n]: n
✅ Done!
```
## Summary
| Scenario | Old Behavior | New Behavior |
|----------|-------------|--------------|
| First time | Ask | Ask (once) |
| Second time | Ask | Auto-detect |
| Every time after | Ask | Auto-detect |
| User input needed | Always | Only first run |
| Speed | Slow | Fast |
| Convenience | Low | High |
**Result:** Ask once, auto-detect forever! 🚀