From 85b184c3493998a87dd07f4fa259b0cb22652fc8 Mon Sep 17 00:00:00 2001 From: Tony Ngo Date: Wed, 23 Sep 2026 01:59:04 +0200 Subject: [PATCH 1/2] fix: change frontend url and fix localhost --- app/routes/index.ts | 7 ++++--- vite.client.ts | 11 +++++++++-- vite.config.ts | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/app/routes/index.ts b/app/routes/index.ts index f0f6889c..0bfb60a3 100644 --- a/app/routes/index.ts +++ b/app/routes/index.ts @@ -73,10 +73,11 @@ router.get('*', (req, res, next) => { if (env.NODE_ENV === 'development') { // Prevent proxy recursion (req.query as any).devproxy = true; + const frontendUrl = `http://${req.hostname}:5173`; return res.redirect( - env.FRONTEND_URL + - req.path + - QueryString.stringify(req.query, { addQueryPrefix: true }) + frontendUrl + + req.path + + QueryString.stringify(req.query, { addQueryPrefix: true }) ); } next(); diff --git a/vite.client.ts b/vite.client.ts index 36ae81ba..74fb086a 100644 --- a/vite.client.ts +++ b/vite.client.ts @@ -19,11 +19,18 @@ const config = { allow: ['app', 'build', 'usage.yml'], }, proxy: { - '^/$': `http://${env.HOST}:${env.PORT}/`, - '/api': `http://${env.HOST}:${env.PORT}`, + '^/$': { + target: `http://${env.HOST}:${env.PORT}/`, + changeOrigin: false, + }, + '/api': { + target: `http://${env.HOST}:${env.PORT}`, + changeOrigin: false, + }, '/socket.io': { target: `ws://${env.HOST}:${env.PORT}`, ws: true, + changeOrigin: false, }, }, }, diff --git a/vite.config.ts b/vite.config.ts index a767c6c0..d1cd91a9 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -36,6 +36,6 @@ export default defineConfig({ }), ], optimizeDeps: { - exclude: ['nib'], + exclude: ['nib', 'webpack', 'webpack-dev-middleware'], }, }); From 170156836d9f5a13cd37fbe7de9454dfc76d5f53 Mon Sep 17 00:00:00 2001 From: Tony Ngo Date: Wed, 23 Sep 2026 02:48:34 +0200 Subject: [PATCH 2/2] fix: fix styling on priority list item --- app/routes/index.ts | 4 ++-- .../(election)/STVAlternativesList.svelte | 3 ++- .../(election)/STVPriorityListItem.svelte | 21 ++++++++++--------- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/app/routes/index.ts b/app/routes/index.ts index 0bfb60a3..c3afe75d 100644 --- a/app/routes/index.ts +++ b/app/routes/index.ts @@ -76,8 +76,8 @@ router.get('*', (req, res, next) => { const frontendUrl = `http://${req.hostname}:5173`; return res.redirect( frontendUrl + - req.path + - QueryString.stringify(req.query, { addQueryPrefix: true }) + req.path + + QueryString.stringify(req.query, { addQueryPrefix: true }) ); } next(); diff --git a/src/routes/(election)/STVAlternativesList.svelte b/src/routes/(election)/STVAlternativesList.svelte index 5fb5384c..4839814a 100644 --- a/src/routes/(election)/STVAlternativesList.svelte +++ b/src/routes/(election)/STVAlternativesList.svelte @@ -71,11 +71,12 @@ .icon { display: flex; + flex-shrink: 0; align-items: center; justify-content: center; border-radius: 2px; height: 100%; - width: 15%; + width: 50px; transition: box-shadow 0.2s ease-in-out; &:hover { diff --git a/src/routes/(election)/STVPriorityListItem.svelte b/src/routes/(election)/STVPriorityListItem.svelte index c63232ae..75be31cf 100644 --- a/src/routes/(election)/STVPriorityListItem.svelte +++ b/src/routes/(election)/STVPriorityListItem.svelte @@ -9,7 +9,7 @@
-
+

{alternative.description}

@@ -21,9 +21,15 @@ @import '../../variables.scss'; .content { - line-height: 60px; + display: flex; + align-items: center; + flex: 1; + min-width: 0; text-align: center; - flex-grow: 1; + + .text-wrapper { + flex: 1; + } p { color: darken($font-gray, 20%); @@ -52,7 +58,7 @@ justify-content: center; border-radius: 2px; height: 100%; - width: 15%; + width: 50px; transition: box-shadow 0.2s ease-in-out; &:hover { @@ -86,11 +92,6 @@ } } .drag { - position: absolute; - height: 100%; - line-height: 60px; - width: 10%; - height: 100%; - vertical-align: middle; + margin-left: 10px; }