|
| 1 | +# Panel Naming Convention |
| 2 | + |
| 3 | +## Panel ID Guidelines |
| 4 | + |
| 5 | +Panel IDs (`PanelId` property) should describe the panel's **content**, not its implementation. |
| 6 | + |
| 7 | +### Do NOT use generic terms: |
| 8 | +- `widget` (e.g., ~~cpu-widget~~, ~~network-widget~~) |
| 9 | +- `panel` (e.g., ~~cpu-panel~~, ~~info-panel~~) |
| 10 | +- `card` (e.g., ~~stat-card~~, ~~data-card~~) |
| 11 | +- `display` (e.g., ~~cpu-display~~) |
| 12 | +- `view` (e.g., ~~cpu-view~~) |
| 13 | + |
| 14 | +### DO use content-descriptive names: |
| 15 | + |
| 16 | +| Good | Bad | |
| 17 | +|------|-----| |
| 18 | +| `cpu-info` | `cpu-widget` | |
| 19 | +| `cpu-usage` | `cpu-panel` | |
| 20 | +| `cpu-usage-graphic` | `cpu-usage-widget` | |
| 21 | +| `network-status` | `network-widget` | |
| 22 | +| `ram-usage-text` | `ram-panel` | |
| 23 | +| `system-thermal` | `thermal-widget` | |
| 24 | + |
| 25 | +### Naming Pattern |
| 26 | + |
| 27 | +``` |
| 28 | +{subject}-{content-type}[-{variant}] |
| 29 | +``` |
| 30 | + |
| 31 | +- **subject**: What the panel shows (cpu, gpu, ram, network, system, proxmox) |
| 32 | +- **content-type**: Type of information (info, usage, status, thermal, summary) |
| 33 | +- **variant** (optional): Presentation style (text, graphic, list) |
| 34 | + |
| 35 | +### Variant Suffix Must Match Content |
| 36 | + |
| 37 | +The variant suffix indicates what visual elements the panel contains. **Content must match the suffix:** |
| 38 | + |
| 39 | +| Suffix | Allowed Content | NOT Allowed | |
| 40 | +|--------|-----------------|-------------| |
| 41 | +| `-text` | Text only (stat cards, labels, values) | Gauges, charts, progress arcs, sparklines | |
| 42 | +| `-graphic` | Text + graphical elements (gauges, charts, bars, donuts) | N/A - anything allowed | |
| 43 | +| `-info` | General information, typically text-focused | N/A - flexible | |
| 44 | + |
| 45 | +**Violation example:** `cpu-usage-text` panel containing a gauge arc - the "-text" suffix promises text-only but delivers graphics. |
| 46 | + |
| 47 | +**Why this matters:** |
| 48 | +- Users selecting "-text" variants expect minimal visual complexity |
| 49 | +- Consistent naming helps users predict panel appearance |
| 50 | +- Enables filtering panels by visual style |
| 51 | + |
| 52 | +### Examples |
| 53 | + |
| 54 | +```csharp |
| 55 | +// Good - describes content |
| 56 | +public override string PanelId => "cpu-info"; |
| 57 | +public override string PanelId => "cpu-usage-graphic"; |
| 58 | +public override string PanelId => "network-status"; |
| 59 | +public override string PanelId => "system-thermal-graphic"; |
| 60 | + |
| 61 | +// Bad - uses generic terms |
| 62 | +public override string PanelId => "cpu-widget"; // Don't use 'widget' |
| 63 | +public override string PanelId => "network-panel"; // Don't use 'panel' |
| 64 | +``` |
| 65 | + |
| 66 | +### Rationale |
| 67 | + |
| 68 | +1. **User-facing**: Panel IDs appear in CLI commands and config files |
| 69 | +2. **Self-documenting**: `cpu-usage-graphic` tells you what to expect |
| 70 | +3. **Consistent**: Matches existing panels (cpu-info, ram-usage-text, etc.) |
| 71 | +4. **Searchable**: Users can find panels by content type |
0 commit comments