Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(web): scope viewport-fit=cover to human-input pages (#45624)

yyh88a564d20cbc
diff --git a/web/app/(humanInputLayout)/form-v2/[token]/page.tsx b/web/app/(humanInputLayout)/form-v2/[token]/page.tsx
index ca64a5059e7..633be8d9bdf 100644
--- a/web/app/(humanInputLayout)/form-v2/[token]/page.tsx
+++ b/web/app/(humanInputLayout)/form-v2/[token]/page.tsx
@@ -5,7 +5,7 @@ import FormContent from './form'
const FormPage = () => {
if (!ENABLE_HITL_IM) notFound()
return (
- <main className="h-dvh min-w-75 bg-chatbot-bg pb-[env(safe-area-inset-bottom)]">
+ <main className="h-dvh min-w-75 bg-chatbot-bg px-[max(env(safe-area-inset-left),env(safe-area-inset-right))] pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]">
<FormContent />
</main>
)
diff --git a/web/app/(humanInputLayout)/form/[token]/page.tsx b/web/app/(humanInputLayout)/form/[token]/page.tsx
index cefc1b71de2..be01b72841c 100644
--- a/web/app/(humanInputLayout)/form/[token]/page.tsx
+++ b/web/app/(humanInputLayout)/form/[token]/page.tsx
@@ -4,7 +4,7 @@ import FormContent from './form'
const FormPage = () => {
return (
- <div className="h-dvh min-w-75 bg-chatbot-bg pb-[env(safe-area-inset-bottom)]">
+ <div className="h-dvh min-w-75 bg-chatbot-bg px-[max(env(safe-area-inset-left),env(safe-area-inset-right))] pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]">
<FormContent />
</div>
)
diff --git a/web/app/(humanInputLayout)/human-input/[formToken]/page.tsx b/web/app/(humanInputLayout)/human-input/[formToken]/page.tsx
index 13787575ce4..be0b78f4d46 100644
--- a/web/app/(humanInputLayout)/human-input/[formToken]/page.tsx
+++ b/web/app/(humanInputLayout)/human-input/[formToken]/page.tsx
@@ -9,7 +9,7 @@ export default async function Page({ params }: { params: Promise<{ formToken: st
return (
<CommonLayoutHydrationBoundary>
- <main className="h-dvh min-w-75 bg-chatbot-bg pb-[env(safe-area-inset-bottom)]">
+ <main className="h-dvh min-w-75 bg-chatbot-bg px-[max(env(safe-area-inset-left),env(safe-area-inset-right))] pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)]">
<ConsoleHumanInputForm key={formToken} formToken={formToken} />
</main>
</CommonLayoutHydrationBoundary>
diff --git a/web/app/(humanInputLayout)/layout.tsx b/web/app/(humanInputLayout)/layout.tsx
new file mode 100644
index 00000000000..d19209dddd6
--- /dev/null
+++ b/web/app/(humanInputLayout)/layout.tsx
@@ -0,0 +1,10 @@
+import type { ReactNode } from 'react'
+import type { Viewport } from '@/next'
+
+export const viewport: Viewport = {
+ viewportFit: 'cover',
+}
+
+export default function HumanInputLayout({ children }: { children: ReactNode }) {
+ return children
+}
diff --git a/web/app/(shareLayout)/layout.tsx b/web/app/(shareLayout)/layout.tsx
index 8c87a632438..aaf21dfaf91 100644
--- a/web/app/(shareLayout)/layout.tsx
+++ b/web/app/(shareLayout)/layout.tsx
@@ -4,7 +4,7 @@ import Splash from './components/splash'
const Layout: FC<PropsWithChildren> = ({ children }) => {
return (
- <div data-viewport-frame="" className="h-dvh min-w-75 pb-[env(safe-area-inset-bottom)]">
+ <div className="h-dvh min-w-75">
<WebAppStoreProvider>
<Splash>{children}</Splash>
</WebAppStoreProvider>
diff --git a/web/app/components/auth-shell/index.tsx b/web/app/components/auth-shell/index.tsx
index 395e5adbdde..478368dbb30 100644
--- a/web/app/components/auth-shell/index.tsx
+++ b/web/app/components/auth-shell/index.tsx
@@ -17,7 +17,7 @@ export function AuthShell({ children, header = true, wide = false }: AuthShellPr
const { data: systemFeatures } = useSuspenseQuery(systemFeaturesQueryOptions())
return (
- <div className="flex min-h-dvh w-full justify-center bg-background-default-subtle px-[max(env(safe-area-inset-left),env(safe-area-inset-right))] pt-[env(safe-area-inset-top)] pb-[env(safe-area-inset-bottom)] in-data-viewport-frame:min-h-full in-data-viewport-frame:pb-0 sm:bg-background-default-burn sm:px-[max(--spacing(6),env(safe-area-inset-left),env(safe-area-inset-right))] sm:pt-[max(--spacing(6),env(safe-area-inset-top))] sm:pb-[max(--spacing(6),env(safe-area-inset-bottom))] in-data-viewport-frame:sm:pb-6">
+ <div className="flex min-h-dvh w-full justify-center bg-background-default-subtle sm:bg-background-default-burn sm:p-6">
<div className="flex w-full min-w-0 flex-col items-center bg-background-default-subtle sm:rounded-2xl sm:border sm:border-effects-highlight">
{header && <Header />}
<main className="flex w-full grow flex-col items-center justify-center px-4 sm:px-6 md:px-27">
diff --git a/web/app/layout.tsx b/web/app/layout.tsx
index 25bf7141687..99209c6db2f 100644
--- a/web/app/layout.tsx
+++ b/web/app/layout.tsx
@@ -33,7 +33,6 @@ import './styles/markdown.css'
export const viewport: Viewport = {
width: 'device-width',
initialScale: 1,
- viewportFit: 'cover',
}
export async function generateMetadata(): Promise<Metadata> {