Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses issue #891 by implementing machine disconnection detection on both backend and frontend. The backend fix ensures the serial device detection loop properly handles empty device lists (enabling disconnection detection), while the frontend adds navigation logic to redirect users to the setup page when their active machine disconnects.
However, the PR also includes unrelated changes to the Laser1 interface that modify how roundness values are displayed (converting from ratio to percentage), which appears to be separate functionality bundled into this PR.
Key Changes:
- Backend serial discovery now processes empty device lists to detect disconnections
- Frontend monitors machine list and auto-navigates to setup on disconnection
- Roundness display changed from ratio (0-1) to percentage (0-100) across Laser1 UI
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| server/src/main.rs | Removed conditional check so handle_serial_device_hotplug is called even with empty device lists, enabling disconnection detection |
| electron/src/components/SidebarLayout.tsx | Added useEffect hook to monitor machines and redirect to setup page when active machine disconnects |
| electron/src/machines/laser/laser1/Laser1Graph.tsx | Transformed roundness data from ratio to percentage and updated graph display (unrelated to disconnection fix) |
| electron/src/machines/laser/laser1/Laser1ControlPage.tsx | Updated roundness display to show percentage instead of ratio (unrelated to disconnection fix) |
| electron/src/control/units.tsx | Added "%" as a supported unit type (unrelated to disconnection fix) |
9da242f to
064d43a
Compare
kraemr
left a comment
There was a problem hiding this comment.
Resolve these two issues, then its pretty much mergeable. Btw we usually do one issue --> One pull request not two issues -> One Pull. For smaller tickets this is fine, but just keep it in mind.
9da242f to
db5c63a
Compare
db5c63a to
0586326
Compare
|
@EinsPommes Fix the Ci failure |
19082fc to
51d41c9
Compare
11e6737 to
57a906f
Compare
|
The errors have been fixed. Is there anything else that needs to be fixed? (Can I merge it?) |
The app now detects when a machine disconnects and redirects you to the setup page. Before, it would just stay on the machine page even though the machine was gone. Fixed both backend (USB detection) and frontend (auto-navigation). Added error handling for parseInt and pathMatch array access.
c23d8fd to
9abb762
Compare
This fix includes both backend and frontend changes:
by always checking the device list, even when empty
setup when the active machine disappears