feat: Add hub-wide live toggle and real-time intensity graph#201
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 10f4a10230
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
When registerHubShockers removed a shocker that was still live (e.g. the hub list refreshed without it, or shared permissions.live flipped off), its isLive flag was dropped without going through disconnect. The tick loop and WebSocket stayed open with nothing to send until the hub itself unmounted. Clear the removed entry's runtime state and disconnect when no live shockers remain.
- Drop the SUBSTEPS=1 smoothstep loop in LiveSlider: with one substep the eased curve collapsed to a straight lineTo, so the inner loop was dead work. Use a direct lineTo per sample. - Initialise the smoothing accumulator from the current intensity on mount so the line does not ramp up from zero when the component appears mid-session. - Re-read the stroke color from computed style each frame so the graph follows theme changes without remounting. - Spell out the ctrl-click action in the LiveButton tooltip so users see whether it will start or stop the hub from the current state.
There was a problem hiding this comment.
Pull request overview
This PR refactors and extends the “live control” UI/state flow by centralizing hub/shocker registration in the live-control store, simplifying LiveButton usage, and enhancing the live intensity slider visualization.
Changes:
- Introduces hub-level shocker registration (
registerHubShockers) and pause-state tracking in the live-control state store. - Simplifies
LiveButtoncall sites by deriving connection/shocker state internally and adds hub-wide start/stop via ctrl/meta click. - Updates UI: adds a global tooltip provider wrapper and replaces the live slider “fill” with a canvas-based intensity history graph.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/routes/shares/public/[shareId=guid]/ControlView.svelte | Uses registerHubShockers and simplifies LiveButton props; tooltip markup adjusted. |
| src/routes/+layout.svelte | Wraps app layout in a Tooltip.Provider with delayDuration. |
| src/routes/(app)/shockers/shared/+page.svelte | Registers live-capable shockers via registerHubShockers; simplifies LiveButton props. |
| src/routes/(app)/shockers/own/+page.svelte | Registers hub shockers via registerHubShockers; simplifies LiveButton props. |
| src/lib/state/live-control-state.svelte.ts | Adds per-shocker pause state, hub shocker registration, and hub-wide live toggling API. |
| src/lib/components/ControlModules/LiveButton.svelte | Derives connection/state internally; adds tooltip and ctrl/meta hub toggle behavior. |
| src/lib/components/ControlModules/impl/LiveSlider.svelte | Adds canvas-rendered intensity history graph driven by an animation loop. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.