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: use basename for document title (#1630) (#1647)

Eric Jantoc70784924b56
diff --git a/frontend/src/core/edit-app.tsx b/frontend/src/core/edit-app.tsx
index eb1016704c..1669af8118 100644
--- a/frontend/src/core/edit-app.tsx
+++ b/frontend/src/core/edit-app.tsx
@@ -57,6 +57,7 @@ import { getSessionId } from "./kernel/session";
import { updateQueryParams } from "@/utils/urls";
import { AppHeader } from "@/components/editor/header/app-header";
import { AppContainer } from "../components/editor/app-container";
+import { Paths } from "@/utils/paths";
interface AppProps {
userConfig: UserConfig;
@@ -119,7 +120,8 @@ export const EditApp: React.FC<AppProps> = ({ userConfig, appConfig }) => {
.then(() => {
setFilename(name);
// Set document title: app_title takes precedence, then filename, then default
- document.title = appConfig.app_title || name || "Untitled Notebook";
+ document.title =
+ appConfig.app_title || Paths.basename(name) || "Untitled Notebook";
return name;
})
.catch((error) => {
@@ -131,7 +133,10 @@ export const EditApp: React.FC<AppProps> = ({ userConfig, appConfig }) => {
// Update document title whenever filename or app_title changes
useEffect(() => {
// Set document title: app_title takes precedence, then filename, then default
- document.title = appConfig.app_title || filename || "Untitled Notebook";
+ document.title =
+ appConfig.app_title ||
+ Paths.basename(filename ?? "") ||
+ "Untitled Notebook";
}, [appConfig.app_title, filename]);
const cells = notebookCells(notebook);