From c388059f68ebc2399ebdc96d8bf603cc0432da30 Mon Sep 17 00:00:00 2001 From: Andras Schmelczer Date: Tue, 3 Feb 2026 19:26:34 +0000 Subject: [PATCH] Various changes --- Taskfile.yml | 12 + frontend/src/App.tsx | 1 + frontend/src/components/PropertiesPane.tsx | 10 +- frontend/src/index.html | 10 +- server-rs/Cargo.lock | 854 ++++++++++++++++++++- server-rs/Cargo.toml | 5 +- server-rs/src/features.rs | 122 ++- server-rs/src/filter.rs | 11 +- server-rs/src/main.rs | 118 ++- server-rs/src/og_middleware.rs | 65 ++ server-rs/src/routes/features.rs | 7 +- server-rs/src/routes/hexagon_stats.rs | 27 +- server-rs/src/routes/hexagons.rs | 94 ++- server-rs/src/routes/mod.rs | 4 +- server-rs/src/routes/og_image.rs | 80 ++ server-rs/src/routes/pois.rs | 6 +- server-rs/src/routes/properties.rs | 15 +- server-rs/src/state.rs | 8 + uv.lock | 11 + 19 files changed, 1373 insertions(+), 87 deletions(-) create mode 100644 server-rs/src/og_middleware.rs create mode 100644 server-rs/src/routes/og_image.rs diff --git a/Taskfile.yml b/Taskfile.yml index fceba56..fbbb156 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -41,6 +41,18 @@ tasks: cmds: - cargo run --release -- --data {{.WIDE_OUTPUT}} --pois {{.POIS_FILTERED_OUTPUT}} + dev:og: + desc: Run OG screenshot sidecar on port 8002 + dir: og-screenshot + env: + CACHE_DIR: /tmp/og-cache + NARROWIT_URL: http://localhost:3030 + cmds: + - npm install + - npx playwright install --with-deps chromium + - npm run build + - npm start + dev:frontend: desc: Run frontend dev server on port 3030 (proxies /api to :8001) dir: frontend diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 39efee0..0d320cd 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -607,6 +607,7 @@ export default function App() { onHexagonHover={() => {}} initialViewState={initialViewState} theme={theme} + screenshotMode /> ); diff --git a/frontend/src/components/PropertiesPane.tsx b/frontend/src/components/PropertiesPane.tsx index 0be7a01..83e9a31 100644 --- a/frontend/src/components/PropertiesPane.tsx +++ b/frontend/src/components/PropertiesPane.tsx @@ -239,6 +239,7 @@ function PropertyCard({ property }: { property: Property }) { 'number_habitable_rooms' ); const age = getNum(property, 'Approximate construction age', 'construction_age_band'); + const councilTax = getNum(property, 'Council tax (£/yr)'); const councilTaxD = getNum(property, 'Council tax Band D (£/yr)'); return ( @@ -306,12 +307,17 @@ function PropertyCard({ property }: { property: Property }) { {property.potential_energy_rating} )} - {councilTaxD !== undefined && ( + {councilTax !== undefined ? ( +
+ Council tax: £ + {fmt(councilTax)}/yr +
+ ) : councilTaxD !== undefined ? (
Council tax (D): £ {fmt(councilTaxD)}/yr
- )} + ) : null} ); diff --git a/frontend/src/index.html b/frontend/src/index.html index 01a7132..3db1b79 100644 --- a/frontend/src/index.html +++ b/frontend/src/index.html @@ -3,7 +3,15 @@ - Narrowit + Narrowit — Every neighbourhood in England & Wales + + + + + + + +