fix(settings): restore image tab scrolling and dev websocket routing

- route dashboard WebSocket traffic through /ws to avoid Vite HMR collisions

- run the dev entrypoint with node so bun run dev stays stable in this repo

- restore the Image settings scroll container contract and add regression coverage
This commit is contained in:
Tam Nhu Tran committed 2026-04-01 16:57:30 -04:00
1 parent 36acf9f190
commit 7a783d0714
6 files changed
+132 -188

No files matched your search

+6 -1
View File
@@ -36,6 +36,7 @@ export async function startServer(options: ServerOptions): Promise<ServerInstanc
const server = http.createServer(app);
const wss = new WebSocketServer({
server,
path: '/ws',
maxPayload: 1024 * 1024, // 1MB hard limit to prevent DoS
perMessageDeflate: false, // Prevent zip bomb attacks
});
@@ -88,7 +89,11 @@ export async function startServer(options: ServerOptions): Promise<ServerInstanc
const { createServer: createViteServer } = await import('vite');
const vite = await createViteServer({
root: path.join(__dirname, '../../ui'),
server: { middlewareMode: true },
server: {
middlewareMode: true,
// Reuse the dashboard HTTP server for HMR in middleware mode.
hmr: { server },
},
appType: 'spa',
});
app.use(vite.middlewares);