fix: guard two ways the detail page breaks outside its own route

`listResourceType`'s generated client resolves `undefined` for any response whose
body it cannot read: `getResponseBody` swallows a parse failure and returns
nothing, and `catchErrorCodes` passes that through on a 2xx. The return type
says otherwise, so `formatResourceTypes` mapped over undefined and the editor
died on mount rather than losing its resource-type autocomplete.

`DetailPageLayout`'s `<main>` claimed `h-screen`. The detail page owns the
viewport on its own route, but not in an AI session's preview panel, where it
overflowed the pane — and since every ancestor between is `overflow-visible`,
the bottom of the run form was unreachable rather than merely clipped. `h-full`
lets the scroller that was already there do its job.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Guilhem Lemouel
2026-09-30 02:32:40 -07:00
co-authored by Claude Opus 5
parent fcfffedd85
commit bf31cb38fe
2 changed files with 14 additions and 4 deletions
+9 -3
View File
@@ -1823,9 +1823,15 @@
scriptLang === 'bunnative' ||
scriptLang === 'nativets')
) {
const resourceTypes = await ResourceService.listResourceType({
workspace: $operatingWorkspace ?? ''
})
// The generated client resolves `undefined` for any response whose body it
// cannot read — `getResponseBody` swallows a parse failure and returns
// nothing, which `catchErrorCodes` passes through on a 2xx. Typing says
// otherwise, so without this the editor dies on mount rather than losing
// its resource-type autocomplete.
const resourceTypes =
(await ResourceService.listResourceType({
workspace: $operatingWorkspace ?? ''
})) ?? []
const namespace = formatResourceTypes(
resourceTypes,
@@ -67,7 +67,11 @@
}
</script>
<main class="h-screen w-full" bind:clientWidth>
<!-- `h-full`, not `h-screen`: this page is also rendered inside an AI session's preview
panel, which is shorter than the viewport. Claiming the viewport's height there
overflows the pane, and the ancestors between are `overflow-visible`, so the bottom of
the run form is unreachable rather than merely clipped. -->
<main class="h-full w-full" bind:clientWidth>
{#if useDesktopLayout}
<div class="h-full w-full flex flex-col">
{@render header?.({ wide: useDesktopLayout })}