feat(gui): show connection-type icon on device cards#310
Conversation
8b87ae5 to
13907b6
Compare
Greptile SummaryThis PR adds a small connection-type glyph (Bolt, Unifying, or Bluetooth) next to the battery indicator on each device card, making it easy to distinguish receiver-paired from direct-connected devices at a glance. Three SVGs are embedded in the asset pipeline and a new
Confidence Score: 5/5Safe to merge — the change is purely additive UI, all three icons are statically embedded at compile time, and the route → icon mapping is fully tested. The logic is straightforward: a pure function maps an enum to a string path, all asset entries are compile-time include_bytes!, and the match is exhaustive. No data mutations, no async paths, no new dependencies. The only acknowledged approximation (None and Direct both resolve to the Bluetooth icon) is explicitly documented in the code comment. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[device_card] --> B[connection_icon_path
route: Option<&DeviceRoute>]
B --> C{match route}
C -->|Some DeviceRoute::Bolt| D[action-icons/bolt.svg]
C -->|Some DeviceRoute::Unifying| E[action-icons/unifying.svg]
C -->|Some DeviceRoute::Direct or None| F[action-icons/bluetooth.svg]
D --> G[svg .size_3 .text_color pal.text_muted]
E --> G
F --> G
G --> H[h_flex: icon + optional battery_view]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[device_card] --> B[connection_icon_path
route: Option<&DeviceRoute>]
B --> C{match route}
C -->|Some DeviceRoute::Bolt| D[action-icons/bolt.svg]
C -->|Some DeviceRoute::Unifying| E[action-icons/unifying.svg]
C -->|Some DeviceRoute::Direct or None| F[action-icons/bluetooth.svg]
D --> G[svg .size_3 .text_color pal.text_muted]
E --> G
F --> G
G --> H[h_flex: icon + optional battery_view]
Reviews (2): Last reviewed commit: "feat(gui): show connection-type icon on ..." | Re-trigger Greptile |
Add a small glyph beside the battery on each gallery card so Bolt, Unifying, and direct Bluetooth connections are distinguishable at a glance. Three embedded action-icons (bolt, unifying, bluetooth) selected from the device's DeviceRoute.
13907b6 to
ccd0968
Compare
|
Made the |
Summary
Hard to tell which device is Bolt, Unifying, or plain Bluetooth when you've
got a few in the list — they look the same. This adds a small glyph next to
the battery, picked from the device's route.
Changes
DeviceRoute: bolt, unifying, or bluetooth.The bluetooth icon is lucide (already vendored). The bolt and unifying ones
are Logitech's marks — happy to swap for generic if you'd rather not.
Testing
Added a unit test mapping each route to its icon. Verified in the gallery
with devices on both a receiver and direct Bluetooth.