+
{renderFields.map((field) =>
field.type === 'external' ? (
diff --git a/frontend/src/pages/SessionDetail.tsx b/frontend/src/pages/SessionDetail.tsx
index 414b03ad..3f51cb24 100644
--- a/frontend/src/pages/SessionDetail.tsx
+++ b/frontend/src/pages/SessionDetail.tsx
@@ -331,7 +331,8 @@ export function SessionDetail() {
const { getForSession: getFormForSession, reply: replyToForm, cancel: cancelForm, syncForSession: syncFormsForSession } = useForms();
const currentForm = sessionId ? getFormForSession(sessionId) : null;
const minimizedForm = currentForm && currentForm.id === minimizedFormId ? currentForm : null;
- const isFormSheetOpen = isMobile && !!currentForm && !minimizedForm;
+ const isFormOpen = !!currentForm && !minimizedForm;
+ const isFormSheetOpen = isMobile && isFormOpen;
const lastAssistantMessage = messages.filter(m => m.type === 'assistant').at(-1);
const lastAssistantText = getAssistantText(lastAssistantMessage);
@@ -876,18 +877,20 @@ export function SessionDetail() {
{sessionDirectory && !isEditingMessage && (
{!isFormSheetOpen && (
@@ -945,7 +948,7 @@ export function SessionDetail() {
onAskSideQuestion={() => handleAskSideQuestion('')}
/>
)}
-
+
{
expect(screen.getByTestId('prompt-overlay')).toHaveClass('top-0')
})
+ it('bounds the form card by the space above the prompt on desktop so its header stays visible', async () => {
+ mocks.useMobile.mockReturnValue(false)
+ formsState.bySession[VIEWED_SESSION_ID] = viewedSessionForm
+
+ render(renderTree())
+
+ await waitFor(() => expect(screen.getAllByText('Continue A')[0]).toBeInTheDocument())
+ const overlay = screen.getByTestId('prompt-overlay')
+ expect(overlay).toHaveClass('top-0', 'justify-end', 'pointer-events-none')
+ expect(overlay.firstElementChild).toHaveClass('max-h-full', 'min-h-0', 'pointer-events-auto')
+ })
+
it('keeps the prompt overlay anchored without an open form or once the form is minimized', async () => {
mocks.useMobile.mockReturnValue(true)