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 #1428 - Update Browser Tab Title When Notebook is Renamed (#1496)

vrtnis692b777e5c35
diff --git a/frontend/src/core/edit-app.tsx b/frontend/src/core/edit-app.tsx
index c9c5a9a31d..9f3a26d926 100644
--- a/frontend/src/core/edit-app.tsx
+++ b/frontend/src/core/edit-app.tsx
@@ -115,9 +115,11 @@ export const EditApp: React.FC<AppProps> = ({ userConfig, appConfig }) => {
}
});
- return sendRename(name)
+ return sendRename(name)
.then(() => {
setFilename(name);
+ // Set document title: app_title takes precedence, then filename, then default
+ document.title = appConfig.app_title || name || "Untitled Notebook";
return name;
})
.catch((error) => {
@@ -126,6 +128,12 @@ 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";
+ }, [appConfig.app_title, filename]);
+
const cells = notebookCells(notebook);
const cellIds = cells.map((cell) => cell.id);
const codes = cells.map((cell) => cell.code);