-
Notifications
You must be signed in to change notification settings - Fork 0
Implement live routing feedback with WebSocket and UI enhancements #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4382406
feat: implement live routing feedback with WebSocket support and sign…
ndorin 308bb4a
feat: seed routing feedback state from HTTP response before WebSocket…
ndorin 2804c30
feat: update routing feedback state to handle multiple failed URLs an…
ndorin 479080d
feat: enhance LoginForm with password visibility toggle and add EyeIc…
ndorin a66b451
feat: implement multiview layout panels with draggable functionality …
ndorin 3b1d346
Potential fix for pull request finding
ndorin f58bef9
Potential fix for pull request finding
ndorin 74c915f
Fix Routing.tsx layout effect re-running dagre on every feedback update
Copilot 599dc93
Potential fix for pull request finding
ndorin 30ccdc1
Potential fix for pull request finding
ndorin 73bcc2b
feat: increment minor version
Copilot 98dea90
refactor: remove unused type import for MidpointRoute in Routing.tsx
ndorin fcae28f
Merge remote-tracking branch 'origin/HEAD' into feature/live-routing-…
ndorin 2514c62
fix: Potential fix for pull request finding
ndorin 061dad9
fix: Potential fix for pull request finding
ndorin b836745
fix: Potential fix for pull request finding
ndorin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| .canvas { | ||
| position: relative; | ||
| width: 100%; | ||
| background: #111; | ||
| overflow: hidden; | ||
| } | ||
|
|
||
| .canvasLight { | ||
| background: #ddd; | ||
| } | ||
|
|
||
| .tile { | ||
| position: absolute; | ||
| box-sizing: border-box; | ||
| border: 1px solid rgba(255, 255, 255, 0.35); | ||
| display: flex; | ||
| align-items: flex-end; | ||
| padding: 3px 5px; | ||
| font-size: 0.68rem; | ||
| color: #fff; | ||
| background-color: rgba(13, 110, 253, 0.35); | ||
| cursor: pointer; | ||
| transition: outline-color 0.1s, background-color 0.1s; | ||
| outline: 2px solid transparent; | ||
| outline-offset: -2px; | ||
|
|
||
| &:hover { | ||
| background-color: rgba(13, 110, 253, 0.5); | ||
| } | ||
| } | ||
|
|
||
| .tileEmpty { | ||
| background-color: rgba(120, 120, 120, 0.15); | ||
|
|
||
| &:hover { | ||
| background-color: rgba(120, 120, 120, 0.28); | ||
| } | ||
| } | ||
|
|
||
| .tileSelected { | ||
| outline-color: #ffc107; | ||
| background-color: rgba(255, 193, 7, 0.45); | ||
| } | ||
|
|
||
| .tileLabel { | ||
| overflow: hidden; | ||
| text-overflow: ellipsis; | ||
| white-space: nowrap; | ||
| width: 100%; | ||
| text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); | ||
| } | ||
|
|
||
| .tileNumberBadge { | ||
| position: absolute; | ||
| top: 2px; | ||
| left: 3px; | ||
| font-size: 0.62rem; | ||
| opacity: 0.75; | ||
| text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); | ||
| } | ||
|
|
||
| .canvasMeta { | ||
| font-size: 0.68rem; | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,78 @@ | ||
| import { MultiviewLayoutState, MultiviewTileState } from "../store/apiSlice"; | ||
| import styles from "./MultiviewLayoutCanvas.module.scss"; | ||
|
|
||
| export interface MultiviewLayoutCanvasProps { | ||
| /** Current multiview canvas/tile layout to render. */ | ||
| layout: MultiviewLayoutState; | ||
| /** Resolves a device key (e.g. a tile's sourceDeviceKey) to a display name. */ | ||
| resolveSourceName: (deviceKey: string) => string; | ||
| darkMode?: boolean; | ||
| /** Tile number to render as selected/highlighted, or null/undefined if none. */ | ||
| selectedTileNumber?: number | null; | ||
| /** Called when a tile is clicked, with the full tile state. */ | ||
| onTileClick?: (tile: MultiviewTileState) => void; | ||
| } | ||
|
|
||
| /** | ||
| * Renders a visual mock-up of what is actually displayed on the monitor fed by a single | ||
| * multiview-capable decoder: its canvas at the correct aspect ratio, with every tile | ||
| * positioned/sized/stacked to match and labeled with its routed source. Used inside a per-node | ||
| * popover in RoutingDeviceNode - purely additive, it does not alter the existing tie-line/route | ||
| * graph visualization in Routing.tsx. | ||
| */ | ||
| const MultiviewLayoutCanvas = ({ | ||
| layout, | ||
| resolveSourceName, | ||
| darkMode, | ||
| selectedTileNumber, | ||
| onTileClick, | ||
| }: MultiviewLayoutCanvasProps) => { | ||
| const aspectRatio = layout.canvasWidth / layout.canvasHeight; | ||
|
|
||
| return ( | ||
| <div> | ||
| <div className={`text-muted mb-1 ${styles.canvasMeta}`}> | ||
| {layout.canvasWidth}×{layout.canvasHeight} | ||
| </div> | ||
| <div | ||
| className={`${styles.canvas}${darkMode ? "" : ` ${styles.canvasLight}`}`} | ||
| style={{ aspectRatio: Number.isFinite(aspectRatio) && aspectRatio > 0 ? aspectRatio : 16 / 9 }} | ||
| > | ||
| {[...layout.tiles] | ||
| .sort((a, b) => a.zOrder - b.zOrder) | ||
| .map((tile) => { | ||
| const isEmpty = !tile.sourceDeviceKey; | ||
| const isSelected = selectedTileNumber === tile.tileNumber; | ||
| const sourceName = tile.sourceDeviceKey | ||
| ? resolveSourceName(tile.sourceDeviceKey) | ||
| : "Empty"; | ||
|
|
||
| return ( | ||
| <div | ||
| key={tile.tileNumber} | ||
| className={`${styles.tile}${isEmpty ? ` ${styles.tileEmpty}` : ""}${isSelected ? ` ${styles.tileSelected}` : ""}`} | ||
| style={{ | ||
| left: `${(tile.x / layout.canvasWidth) * 100}%`, | ||
| top: `${(tile.y / layout.canvasHeight) * 100}%`, | ||
| width: `${(tile.width / layout.canvasWidth) * 100}%`, | ||
| height: `${(tile.height / layout.canvasHeight) * 100}%`, | ||
| zIndex: tile.zOrder, | ||
| }} | ||
| title={`Tile ${tile.tileNumber}: ${sourceName}`} | ||
| onClick={(e) => { | ||
| e.stopPropagation(); | ||
| onTileClick?.(tile); | ||
| }} | ||
| > | ||
| <span className={styles.tileNumberBadge}>{tile.tileNumber}</span> | ||
| <span className={styles.tileLabel}>{sourceName}</span> | ||
| </div> | ||
| ); | ||
| })} | ||
| </div> | ||
| </div> | ||
| ); | ||
| }; | ||
|
|
||
| export default MultiviewLayoutCanvas; | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.