-
-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Tab renaming #4979
base: dev
Are you sure you want to change the base?
[Feature] Tab renaming #4979
Conversation
What about this?
|
That feels like it's a complete overhauling of the tabs system.... which is a bit beyond my skill level, familiarity with the code, or what I should be doing. |
I personally thought that would only apply to pinned tabs, but I can understand that that could still be crazy hard to make. |
If this and the bookmark menu is in direct conflict, would it not be better to wait and see how the tab system will work going forward? Folders are coming for sure, so there's bound to be some change |
Instead of overflowing the context menu, how about double clicking on pinned tabs only? |
Thank you so much for this PR! I was going to make it but I cannot get the browser to build. |
By just changing |
@mauro-balades by And either way, this wouldn't stop the page title changing from changing the renamed title. I feel like this renaming should override any reloads, page navigation, etc. |
I found a good solution for persisting tab renames in the same session. Still not sure about persisting them across sessions. Here's an example with some dummy values. let newName = "asdf";
let tab = gBrowser.tabs[5];
let observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
if (tab.label !== newName) {
tab.label = newName;
}
})
})
observer.observe(tab, {attributeFilter: ["label"]}) I think you would want to add an attribute to each tab that is |
…l persist functionality, rewrote tab reset to use DOM
@mauro-balades implemented your suggested changes. Now uses I realized we never discussed what we should do to not only persist the fact that a tab is renamed, but also persist the renamed title (which currently doesn't restore on restart, as you'll see when you test the PR). Should I add something to the session store to store that? |
@jso8910, add a patch here to simply return if we have the attribute. And make sure to do a |
Signed-off-by: mr. m <[email protected]>
Have fun! |
Will the custom tab name be matched in url bar suggestions? |
Last thing remaning @jso8910 is that they shoudnt be able to be renamed if:
|
That's not quite the last thing remaining. The renamed tab name still isn't saved after restart. Currently, if a tab is renamed and then the initial focused tab after restart, it'll be named "New tab" and if it's renamed but not the initial focused tab after restart, its name is blank |
That's due to the pinned tab manager, I already told u I can handle that part |
… css files, changed listener to blur, refactored code
Please do let me know when it's ready for review. Also, there seems to be some git conflicts |
This is a pull request to implement tab renaming. It isn't yet complete. It works by adding a button to the right click context menu which then replaces the tab name with an input field to rename the tab. It requires one string to be added in the l10n repo (I haven't made that PR yet).
This pull request is not yet complete, as the tab name does not persist when the page reloads, loads another URL, or the browser restarts. I'm willing to take suggestions for how to do that (or contributions from other maintainers). I see files like ZenPinnedTabsStorage.mjs and wonder if that's a way to do it? Not quite sure. Or modifying the part of the browser engine that changes the title of a tab and stopping it from changing it if some attribute indicating the tab has been renamed is set as well as changing the part of the tab title which is saved to persist a session.
Also, I created a new file in the zen-components folder. I figured there wasn't any other place for this code to fit, but if I'm wrong, I'll refactor.
Pinging @mauro-balades to get feedback/help on the rest of this.