Conversation
saeedvaziry
commented
Mar 23, 2026
- fix realtime for server and site installation
- fix console error on server creation form
- fix combobox and command scroll
There was a problem hiding this comment.
Pull request overview
UI-focused fixes to improve realtime installation status updates for servers/sites, eliminate a console warning on the server creation form, and resolve scrolling behavior issues in command/combobox components.
Changes:
- Add a
useRealtimeRecordhook and use it in the server header to react toserver.updated/site.updatedsocket events, reloading on install completion. - Improve install progress reporting for multiple site types and broadcast progress updates for sites/servers.
- Adjust Command/Combobox wheel handling and mark the public key textarea as read-only to prevent React warnings.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| resources/js/pages/servers/components/header.tsx | Subscribe to realtime server/site updates and reload when installation completes; fix site progress rendering. |
| resources/js/pages/servers/components/create-server.tsx | Mark public key textarea as readOnly to prevent editing/warnings. |
| resources/js/hooks/use-socket-events.ts | Introduce useRealtimeRecord for syncing a single record via socket events. |
| resources/js/components/ui/command.tsx | Stop wheel event propagation from Command list to improve nested scroll behavior. |
| resources/js/components/ui/combobox.tsx | Remove redundant wheel handler now handled inside CommandList. |
| package-lock.json | Lockfile metadata change. |
| app/SiteTypes/Wordpress.php | Adjust installation progress milestones. |
| app/SiteTypes/PHPSite.php | Adjust installation progress milestones. |
| app/SiteTypes/PHPMyAdmin.php | Adjust installation progress milestones. |
| app/SiteTypes/PHPBlank.php | Adjust installation progress milestones. |
| app/SiteTypes/NodeJS.php | Adjust installation progress milestones. |
| app/SiteTypes/AbstractSiteType.php | Broadcast site.updated events on progress updates. |
| app/Actions/Server/InstallServer.php | Broadcast server.updated events on progress updates. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| SocketEvent::dispatch(new SocketEventDTO( | ||
| projectId: $this->site->server->project_id, | ||
| type: 'site.updated', | ||
| data: new SiteResource($this->site), |
There was a problem hiding this comment.
progress() now dispatches site.updated using SiteResource, which includes type_data. For some site types (e.g. WordPress) type_data contains plaintext credentials (admin password, database password), so this will broadcast sensitive data repeatedly during installs. Consider broadcasting a minimal payload for progress updates (e.g. id/status/status_color/progress) or introduce a dedicated resource that omits secrets, and reserve the full SiteResource for places where the UI actually needs it.
| SocketEvent::dispatch(new SocketEventDTO( | |
| projectId: $this->site->server->project_id, | |
| type: 'site.updated', | |
| data: new SiteResource($this->site), | |
| $sanitizedSite = clone $this->site; | |
| $sanitizedSite->setAttribute('type_data', null); | |
| SocketEvent::dispatch(new SocketEventDTO( | |
| projectId: $this->site->server->project_id, | |
| type: 'site.updated', | |
| data: new SiteResource($sanitizedSite), |
| SocketEvent::dispatch(new SocketEventDTO( | ||
| projectId: $this->server->project_id, | ||
| type: 'server.updated', | ||
| data: new ServerResource($this->server), | ||
| )); |
There was a problem hiding this comment.
progress() now dispatches a full ServerResource on every progress tick. ServerResource::toArray() performs a services()->pluck(...) query, so frequent progress updates can add avoidable DB load during installation. Consider emitting a lightweight progress payload (id/status/status_color/progress/progress_step) or adjust ServerResource to avoid querying services when not needed / use already-loaded relations.
| /** | ||
| * Keeps a single resource in sync with socket events. | ||
| * | ||
| * Returns the live resource (initially from Inertia props, updated via socket). | ||
| * Pass `null` to skip listening (safe to call unconditionally). | ||
| */ |
There was a problem hiding this comment.
The docstring says “Pass null to skip listening”, but the hook still registers a socket listener and simply ignores events when initial is null. Consider rewording to clarify that it skips handling/updates (or add an early-return path that avoids subscribing when initial is null if you truly want to skip listening).