fix(schema-viewer): drop empty schema panel for image-less BOM overviews
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled

PL24's bomOverviewlist widget (PR-code-filtered overview tables like
"Alternatöre genel bakış · Start-Stop modu bulunan araçlar için
[PR:7L6,7L8]") returns parts but no illustration — upstream genuinely
has no schema for these. Previously the 60% left panel rendered the
text "Sema goruntusu bulunamadi", which reads like a failure and
wastes most of the layout for what is actually a complete result.

When schemaPic is null, skip the schema panel entirely and let the
parts list take the full container width. The parts panel already
handles its own header/empty state, so no other adjustment needed.
This commit is contained in:
Semih
2026-05-14 20:47:43 +00:00
parent 7ffff32cac
commit de84d8d267

View File

@@ -85,6 +85,28 @@ export function SchemaViewer({
);
}
// PL24 "bomOverviewlist" widget pages (PR-code-filtered overviews) return
// parts but no illustration. Drop the schema panel entirely in that case
// so the parts list takes full width instead of staring at a sad fallback.
if (!schemaPic) {
return (
<div
ref={containerRef}
className={cn(
"rounded-lg border border-border bg-background",
isFullscreen ? "fixed inset-0 z-50 rounded-none" : "md:h-[700px]",
)}
>
<PartsPanel
parts={parts}
vehicleId={vehicleId}
categoryId={categoryId}
isLoading={isLoading}
/>
</div>
);
}
return (
<div
ref={containerRef}
@@ -112,38 +134,32 @@ export function SchemaViewer({
onTouchMove={interaction.onTouchMove}
onTouchEnd={interaction.onTouchEnd}
>
{schemaPic ? (
<div
className="absolute inset-0 flex items-center justify-center"
style={{
transform: `scale(${zoom}) translate(${panX / zoom}px, ${panY / zoom}px)`,
transformOrigin: "center center",
willChange: "transform",
}}
>
<div className="relative">
<img
src={schemaPic.url}
alt={schemaPic.label || "Şema görüntüsü"}
width={schemaPic.width > 0 ? schemaPic.width : undefined}
height={schemaPic.height > 0 ? schemaPic.height : undefined}
className="max-h-full max-w-full select-none object-contain"
draggable={false}
<div
className="absolute inset-0 flex items-center justify-center"
style={{
transform: `scale(${zoom}) translate(${panX / zoom}px, ${panY / zoom}px)`,
transformOrigin: "center center",
willChange: "transform",
}}
>
<div className="relative">
<img
src={schemaPic.url}
alt={schemaPic.label || "Şema görüntüsü"}
width={schemaPic.width > 0 ? schemaPic.width : undefined}
height={schemaPic.height > 0 ? schemaPic.height : undefined}
className="max-h-full max-w-full select-none object-contain"
draggable={false}
/>
{schemaPic.width > 0 && schemaPic.height > 0 && (
<HotspotOverlay
hotspots={hotspots}
imageWidth={schemaPic.width}
imageHeight={schemaPic.height}
/>
{schemaPic.width > 0 && schemaPic.height > 0 && (
<HotspotOverlay
hotspots={hotspots}
imageWidth={schemaPic.width}
imageHeight={schemaPic.height}
/>
)}
</div>
)}
</div>
) : (
<div className="flex h-full items-center justify-center text-sm text-muted-foreground">
Sema goruntusu bulunamadi
</div>
)}
</div>
</div>
</div>