Add support for double-clicking to rename document tabs (#4072)

This commit is contained in:
Keavon Chambers
2026-04-28 17:54:58 -07:00
committed by GitHub
parent fc7348d08a
commit b152f46380
4 changed files with 81 additions and 4 deletions
@@ -180,6 +180,11 @@
clickAction={(tabIndex) => editor.selectDocument($portfolio.documents[tabIndex].id)}
closeAction={(tabIndex) => editor.closeDocumentWithConfirmation($portfolio.documents[tabIndex].id)}
reorderAction={(oldIndex, newIndex) => editor.reorderDocument($portfolio.documents[oldIndex].id, newIndex)}
renameAction={(tabIndex, newName) => {
// Ensure the target document is the active one before renaming, since `RenameDocument` operates on the active document
editor.selectDocument($portfolio.documents[tabIndex].id);
editor.renameDocument(newName);
}}
tabActiveIndex={$portfolio.activeDocumentIndex}
groupDropAction={groupDrop}
splitDropAction={splitDrop}