Fix: Update pinned tab title in storage on rename

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.
This commit is contained in:
Kristijan Ribarić
2025-02-17 15:56:57 +01:00
parent 08baf5ae87
commit a6e446e5cf
2 changed files with 58 additions and 1 deletions

View File

@@ -665,7 +665,7 @@ var gZenVerticalTabsManager = {
target.appendChild(child);
},
renameTabKeydown(event) {
async renameTabKeydown(event) {
if (event.key === 'Enter') {
let label = this._tabEdited.querySelector('.tab-label-container-editing');
let input = this._tabEdited.querySelector('#tab-label-input');
@@ -681,6 +681,11 @@ var gZenVerticalTabsManager = {
} else {
gBrowser.setTabTitle(this._tabEdited);
}
const pinId = this._tabEdited.getAttribute('zen-pin-id');
if (pinId) {
// Update pin title in storage
await ZenPinnedTabsStorage.updatePinTitle(pinId, this._tabEdited.label);
}
// Maybe add some confetti here?!?
gZenUIManager.motion.animate(