-
Notifications
You must be signed in to change notification settings - Fork 5
add shared shockers page #153
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
base: develop
Are you sure you want to change the base?
Conversation
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a new "Shared Shockers" page that allows users to view and control shockers that have been shared with them by other users. The implementation separates owned shockers from shared ones by updating the navigation structure and adding a dedicated view for shared devices.
Changes:
- Added navigation menu item and route for viewing shared shockers
- Created store and API integration for fetching shared shocker data
- Implemented UI components for displaying and controlling shared shockers with owner context
- Added redirect handler to maintain backward compatibility with the original
/shockersroute
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/routes/Sidebar.svelte | Updated navigation to separate owned and shared shockers with new menu items |
| src/routes/+layout.svelte | Changed overflow behavior to prevent horizontal scrolling |
| src/routes/(authenticated)/shockers/shared/+page.svelte | New page displaying shared shockers grouped by owner with device hierarchy |
| src/routes/(authenticated)/shockers/+server.ts | Added redirect handler from /shockers to /shockers/own |
| src/lib/stores/SharedHubsStore.ts | New store for managing shared shocker data with refresh functionality |
| src/lib/components/ControlModules/SharedShockerControlModule.svelte | New component for controlling shared shockers with permission-based limits |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85dacc4abe
ℹ️ 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".
| id: shocker.id, | ||
| type, | ||
| intensity: clampedIntensity, | ||
| duration: clampedDuration * 1000, | ||
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pass duration in seconds to serializer
The shared control module multiplies duration by 1000 before calling serializeControlMessages, but that serializer already multiplies control.duration by 1000 (see src/lib/signalr/serializers/Control.ts). As a result, any control sent from the shared shockers page uses a duration 1000× longer than intended (seconds → ms in this component, then ms → μs in the serializer). Users will experience shock/vibrate/sound actions that last far longer than the slider indicates; this only occurs when triggering controls from the shared shockers page. Pass clampedDuration in seconds (like the other control modules) and let the serializer handle conversion.
Useful? React with 👍 / 👎.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
No description provided.