fix(sf-fe): decode cad param (B5 400) + hide entry sidebar when drawer open (#351)
Some checks failed
Deploy / deploy (push) Blocked by required conditions
Deploy / changes (push) Successful in 5s
Deploy / build-backend (push) Has been skipped
Deploy / build-worker (push) Has been skipped
Deploy / build-frontend (push) Has been cancelled

This commit is contained in:
lekss361 2026-05-17 23:37:46 +00:00
parent f87a352292
commit ac86b75115
2 changed files with 25 additions and 18 deletions

View file

@ -75,8 +75,13 @@ interface PageProps {
}
export default function AnalysisPage({ params }: PageProps) {
// React 19: use() unwraps Promise params (app router pattern)
const { cad } = use(params);
// React 19: use() unwraps Promise params (app router pattern).
// Next.js delivers `cad` URL-encoded (":" -> "%3A"); decode once here so
// downstream hooks/components see the canonical "66:41:0204016:10" and can
// re-encode exactly once when building API URLs / hrefs (prevents double-
// encode that made backend regex reject the cad with HTTP 400).
const { cad: cadRaw } = use(params);
const cad = decodeURIComponent(cadRaw);
return (
<main

View file

@ -167,22 +167,24 @@ export default function SiteFinderPage() {
/>
</div>
{/* Right sidebar */}
<div
style={{
width: 300,
flexShrink: 0,
padding: "16px 16px 16px 0",
display: "flex",
flexDirection: "column",
gap: 12,
overflowY: "auto",
}}
>
<CadInput onSubmit={handleCadSubmit} loading={false} />
<RecentParcels />
<ParcelLegend />
</div>
{/* Right sidebar — hidden when ParcelDrawer is open to avoid overlap */}
{selectedParcel == null && (
<div
style={{
width: 300,
flexShrink: 0,
padding: "16px 16px 16px 0",
display: "flex",
flexDirection: "column",
gap: 12,
overflowY: "auto",
}}
>
<CadInput onSubmit={handleCadSubmit} loading={false} />
<RecentParcels />
<ParcelLegend />
</div>
)}
</div>
{/* Parcel drawer (slide-in from right) */}