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 addresses an issue where renaming a pinned tab wouldn't update the title stored in `ZenPinnedTabsStorage`.
The following changes were made:
- Modified `ZenUIManager.mjs` to asynchronously call `ZenPinnedTabsStorage.updatePinTitle` when a tab is renamed via the keyboard. This ensures the stored title is synchronized with the displayed title.
- Added the `updatePinTitle` function to `ZenPinnedTabsStorage.mjs`. This function updates the title of a zen pin within the database.
This ensures consistency between the tab title displayed in the UI and the title stored for pinned tabs.
- Add nowrap to welcome text for better layout
- Change button attribute to class for primary styling
- Update window centering logic to improve user experience