Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: allow for null app_title (#1272)

Myles Scolnickee0ee043c364
diff --git a/frontend/src/components/app-config/app-config-form.tsx b/frontend/src/components/app-config/app-config-form.tsx
index 70ebf759c7..e3cb58214c 100644
--- a/frontend/src/components/app-config/app-config-form.tsx
+++ b/frontend/src/components/app-config/app-config-form.tsx
@@ -94,7 +94,7 @@ export const AppConfigForm: React.FC = () => {
<FormControl>
<Input
{...field}
- value={field.value}
+ value={field.value ?? ""}
onChange={(e) => {
field.onChange(e.target.value);
if (AppTitleSchema.safeParse(e.target.value).success) {
diff --git a/frontend/src/core/config/__tests__/config-schema.test.ts b/frontend/src/core/config/__tests__/config-schema.test.ts
index 7e027dfa1d..5010551801 100644
--- a/frontend/src/core/config/__tests__/config-schema.test.ts
+++ b/frontend/src/core/config/__tests__/config-schema.test.ts
@@ -5,8 +5,21 @@ import { AppConfigSchema, UserConfigSchema } from "../config-schema";
test("default AppConfig", () => {
const defaultConfig = AppConfigSchema.parse({});
expect(defaultConfig).toMatchInlineSnapshot(`
+ {
+ "width": "normal",
+ }
+ `);
+});
+
+test("another AppConfig", () => {
+ const config = AppConfigSchema.parse({
+ width: "medium",
+ app_title: null,
+ });
+ expect(config).toMatchInlineSnapshot(`
{
- "width": "normal",
+ "app_title": null,
+ "width": "medium",
}
`);
});
diff --git a/frontend/src/core/config/config-schema.ts b/frontend/src/core/config/config-schema.ts
index 1311ce1309..5f87be7fa5 100644
--- a/frontend/src/core/config/config-schema.ts
+++ b/frontend/src/core/config/config-schema.ts
@@ -107,7 +107,7 @@ export const AppTitleSchema = z
export const AppConfigSchema = z
.object({
width: z.enum(APP_WIDTHS).default("normal"),
- app_title: AppTitleSchema.optional(),
+ app_title: AppTitleSchema.nullish(),
})
.default({ width: "normal" });
export type AppConfig = z.infer<typeof AppConfigSchema>;