Fix/collapsed toolbar rename#14101
Conversation
| return; | ||
| } | ||
| // Expanded sidebar: use the existing inline rename flow | ||
| gZenVerticalTabsManager.renameTabStart({ |
There was a problem hiding this comment.
I think we should move this prompt functionality into renameTabStart so it also works for renaming spaces, tabs, etc.
| const confirmed = Services.prompt.prompt( | ||
| window, | ||
| null, // title (null = use default window title) | ||
| gBrowser.ownerDocument.l10n.getValueSync("zen-folder-rename-prompt", { |
There was a problem hiding this comment.
Sync value fetching doesn't work in this context. Have you tested this?
Also, why use gBrowser.ownerDocument instead of the document object?
There was a problem hiding this comment.
Actually I am new to open source contributions. If you can guide me how do I test and anything which I need to know other than just coding and development. The codebase is very large.
There was a problem hiding this comment.
Nope this is the first time I working on open source contributions.
|
@mr-cheffy If you can guide me here, I will be really grateful to you! |
|
@sukritgoyal You can read this for guidance https://docs.zen-browser.app/contribute/desktop |
Fix: "Rename Folder" now works in Collapsed Toolbar layout
Closes #14082
Problem
When the sidebar is in Collapsed Toolbar mode (compact icon-only view), right-clicking a tab folder and selecting "Rename Folder" did nothing. The option was visible in the context menu but completely unresponsive.
The root cause was an early-return guard in
nsZenFolder.rename():In collapsed mode the sidebar has no visible label input, so the inline rename flow (
gZenVerticalTabsManager.renameTabStart) can't work — but instead of falling back gracefully, it just returned without any feedback to the user.Solution
When the sidebar is collapsed, fall back to a native
Services.prompt.prompt()dialog pre-filled with the folder's current name. On confirmation, the result is passed to the existinglabelElement.onRenameFinished()callback, which handles saving and firing theZenFolderRenamedevent — so all downstream persistence logic is unchanged.When the sidebar is expanded, the existing inline rename flow is used as before.
Changes
src/zen/folders/ZenFolder.mjs— Modifiedrename()to show a prompt dialog instead of silently returning whenzen-sidebar-expandedis absent.locales/en-US/browser/browser/zen-folders.ftl— Addedzen-folder-rename-promptFluent string for the prompt message.Before / After