Conversation
Co-authored-by: DHPKE <103928654+DHPKE@users.noreply.github.com>
Co-authored-by: DHPKE <103928654+DHPKE@users.noreply.github.com>
Co-authored-by: DHPKE <103928654+DHPKE@users.noreply.github.com>
|
attempt 1 |
There was a problem hiding this comment.
Pull Request Overview
This PR implements a snapshot feature for the crosspoint router, allowing users to save and recall connection configurations. The feature uses browser localStorage for persistence and provides UI dialogs for managing snapshots.
Key Changes:
- Added a new
SnapshotServiceto handle snapshot persistence and retrieval - Integrated snapshot save/recall functionality into the crosspoint component with UI buttons and modal dialogs
- Enabled users to save current connection states and restore them later
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| ui/src/lib/SnapshotService.ts | New service implementing snapshot CRUD operations with localStorage persistence |
| ui/src/routes/crosspoint.svelte | Added snapshot UI controls, state management, and functions to save/recall/delete snapshots |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let srcString = getDevcieNameString(conn.srcDev, conn.src); | ||
| let dstString = getDevcieNameString(conn.dstDev, conn.dst); |
There was a problem hiding this comment.
Corrected spelling of 'getDevcieNameString' to 'getDeviceNameString'.
| let srcString = getDevcieNameString(conn.srcDev, conn.src); | |
| let dstString = getDevcieNameString(conn.dstDev, conn.dst); | |
| let srcString = getDeviceNameString(conn.srcDev, conn.src); | |
| let dstString = getDeviceNameString(conn.dstDev, conn.dst); |
| export interface SnapshotConnection { | ||
| srcDev: any; | ||
| src: any; | ||
| dstDev: any; | ||
| dst: any; |
There was a problem hiding this comment.
The any type removes type safety. Consider defining more specific types for these connection properties based on the actual data structure used in the application.
| export interface SnapshotConnection { | |
| srcDev: any; | |
| src: any; | |
| dstDev: any; | |
| dst: any; | |
| export interface Device { | |
| id: string; | |
| name: string; | |
| // Add other relevant properties as needed | |
| } | |
| export interface Source { | |
| id: string; | |
| name: string; | |
| // Add other relevant properties as needed | |
| } | |
| export interface SnapshotConnection { | |
| srcDev: Device; | |
| src: Source; | |
| dstDev: Device; | |
| dst: Source; |
| type="text" | ||
| placeholder="Enter snapshot name" | ||
| class="input input-bordered w-full" | ||
| on:keypress={(e)=>{if(e.keyCode == 13) saveCurrentSnapshot()}} |
There was a problem hiding this comment.
The keyCode property is deprecated. Use e.key === 'Enter' instead for better browser compatibility and adherence to modern standards.
| on:keypress={(e)=>{if(e.keyCode == 13) saveCurrentSnapshot()}} | |
| on:keypress={(e)=>{if(e.key === 'Enter') saveCurrentSnapshot()}} |
| preparedConnectList = []; | ||
|
|
||
| // Recall each connection from the snapshot | ||
| let recallPromises: Promise<any>[] = []; |
There was a problem hiding this comment.
The Promise<any> type is too broad. Consider using a more specific type to improve type safety and code maintainability.
|
[https://outlook-1.cdn.office.net/assets/reaction/like.png] Lorenz Kirchner reacted to your message:
…________________________________
From: DHPKE ***@***.***>
Sent: Saturday, November 1, 2025 9:47:15 PM
To: 3dmedium/nmos_crosspoint ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [3dmedium/nmos_crosspoint] Copilot/add snapshot functionality (PR #10)
[https://avatars.githubusercontent.com/u/103928654?s=20&v=4]DHPKE left a comment (3dmedium/nmos_crosspoint#10)<#10 (comment)>
attempt 1
—
Reply to this email directly, view it on GitHub<#10 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BPO4QCIED7T6PT7TLBYQLPD32US6HAVCNFSM6AAAAACK344252VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINZWHA4DMOBXHE>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.***>
|
|
Thanks for the pull request. I will not have time to check everything before end of the year. |
No description provided.