mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-10 05:35:29 +02:00
Fix: Properly update pinned tab titles after edit
This commit addresses an issue where edited pinned tab titles were not consistently updated across all windows and in storage. The following changes were made: - **ZenUIManager.mjs:** Removed redundant `pinId` variable and directly checked `zen-pin-id` attribute. - **ZenPinnedTabsStorage.mjs:** Added `edited_title` column to the `zen_pins` table to track if a pin's title has been manually edited. Also, the `updatePinTitle` function now accepts an `isEdited` flag (defaults to true) and updates the `edited_title` column accordingly. - **ZenPinnedTabManager.mjs:** The `updatePinTitle` function was added to handle the update of pin titles. It updates the title in storage using `ZenPinnedTabsStorage.updatePinTitle`, refreshes the pinned tabs, and then iterates through all browser windows to update the labels of corresponding pinned tabs. Also, a check was added to `_initializePinnedTabs` to set the `zen-has-static-label` attribute on tabs with `editedTitle` set to `true`. - **ZenWorkspaces.mjs:** Added a null check for `activeWorkspaceStrip` to avoid errors when it's not available. These changes ensure that when a pinned tab title is edited, the updated title is correctly persisted in storage and reflected across all open windows. The `edited_title` flag allows distinguishing between default titles and custom ones.
This commit is contained in:
parent
a6e446e5cf
commit
57a33beb81
4 changed files with 60 additions and 13 deletions
|
@ -154,7 +154,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
}
|
||||
|
||||
get tabboxChildren() {
|
||||
return this.activeWorkspaceStrip.children;
|
||||
return this.activeWorkspaceStrip?.children || [];
|
||||
}
|
||||
|
||||
get pinnedTabsContainer() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue