-
Notifications
You must be signed in to change notification settings - Fork 37
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
Bug 726560 - Add support of Panorama group name (FF10+) for titlebar customization #19
Conversation
Rebased to top of reorg merge. |
@@ -52,5 +52,6 @@ variable.Processor.description=Compilation Processor | |||
variable.Compiler.description=Compiler | |||
variable.DefaultTitle.description=Default Application Title | |||
variable.TabTitle.description=Current Tab's Title | |||
variable.ActiveTabGroupName.description=Active TabView group name - may be empty in rare cases |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please reduce the variable to 'TabGroup' so we stay in sync with 'TabTitle' and others. Also please kill the last part of the description content and use 'Tab Group' instead of 'TabView', e.g. 'Current Tab Group'.
Assigned some of @whimboo's review comments. Unaddressed:
Nothing special.
If we thinking about it strictly, then yes, we would carry that forever. But as I said above, if As I see, in FF11, there will be always a TabGroup. Could somebody provide it's Bugzilla number? In FF4.2a1pre user is able to close all the groups and leave tabs alone. The tab bar would contain only one tab in that case, if user exits from the TabView.
I don't know sessionStore. IMHO if we don't save the value at shutdown, it wouldn't be saved, which is an implicit delete.
I introduced some other Please consider that I would like to fold these commits before pull! |
I know it's a bit harder for you but I would love it if we could keep up with the conversation at the right places and don't combine all in a single reply. It's hard to follow-up on changes and questions. Here some answers and questions:
|
extension/chrome/content/browser.js
Outdated
.getService(Ci.nsIObserverService).addObserver({ | ||
observe: function NightlyTT_Restore() { | ||
Cc["@mozilla.org/observer-service;1"] | ||
.getService(Ci.nsIObserverService).removeObserver(this, "sessionstore-windows-restored"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't call getService twice here but cache it locally right before:
var obs = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService)
obs.addObserver(...);
Same applies to the SessionStore service below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Have you tested that we correctly handle the TabGroup name across windows? Each window has its own set of groups
Not tested before, but a quick test shows something: only the registering window's TabGroup title is restored.
Because I don't iterate through all the windows. :)
But I don't sure about the need of removeObserver. And related: how to take care Private Browsing...?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any observer we register we have to remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any observer we register we have to remove.
Yes, this is obvious. But when to remove?
On startup of the observer code? On application shutdown? On entering PB mode .... :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It depends on when the code gets called. If it's during the startup phase then we can do it on shutdown. Otherwise it has to be done before possible references get invalid.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi!
Please review the v3 commits, not the v2! :)
#19 (commits)
By the way, thank you for being "r?"!
Szabolcs
2012/3/19 Henrik Skupin
reply@reply.github.com:
It depends on when the code gets called. If it's during the startup phase then we can do it on shutdown. Otherwise it has to be done before possible references get invalid.
Reply to this email directly or view it on GitHub:
https://github.com/mozilla/nightlytt/pull/19/files#r573457
Thank You for the answers and the questions! |
extension/chrome/content/browser.js
Outdated
@@ -66,6 +95,37 @@ init: function() | |||
|
|||
tabbrowser.updateTitlebar = nightly.updateTitlebar; | |||
tabbrowser.addEventListener("DOMTitleChanged", nightly.updateTitlebar, false); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Re: sessionstore. It should already have the name of the group included per default. Can't we simply retrieve it?
If I move these lines some line below, into the if ... else
then getting and setting of tabGroupTitle would be in sync.
After that I wouldn't understand Your question.
Would You mind to write some details about Your question? Because I don't really know why are You asking that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The question was about our own sessionstore entry for NTT. Per default the sessionstore.js file will contain the list of all the windows, tabs, and groups. So if we would query the session store service we probably could retrieve the last active group on startup, whereby we wouldn't have to store our own property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not clear. :)
Are You talking about L#44, LAST_SESSION_GROUP_NAME_IDENTIFIER: "nightlytt-last-session-group-name",
?
I wouldn't like to collide TabView
's property if we are before Bug 682996. In that case I plan simply use TabView
's stuff, and do not save / restore ours.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that we should care about code before bug 682996 has been fixed. It was fixed for Firefox 10 which we still support on the ESR branch. Releases before we do not support anymore. 3.6.x is an exception but will also be dropped soon.
I don't think this enhancement its worth delaying 3.2.2. Lets push it to 3.2.3. |
Sorry @whimboo, but I couldn't keep this status update in the diffs. Updated pull (with a debug "build"):
Could somebody help me?
I'm going to investigate the "simple retrive". (See comment: #19 (comment) ) |
Reason seems to be: SessionStore likes only startup and shutdown. |
In summary: EDIT: |
Re: private browsing, we could observe the transition events and react accordingly. Those are independent from the session restore notifications. |
Is this going to land? It would be really nice to have! |
jwir3: all the reviewer guys are busy, so not really. :( |
xabolcs: In the meantime, then, have you considered developing your own plugin for this and distributing it separately? If we can't get it into NTT, then there doesn't seem to be any reason not to push it from a 3rd party perspective. |
jwir: So I will update that soon, and would pack another one which has got this feature too. |
jwir3: see comment on MozillaZine! I made it for You! :) |
FWIW: on 26 Sep. three's been an update on https://github.com/mozilla/nightlytt Nothing yet at AMO since 2 May. |
In https://bugzilla.mozilla.org/show_bug.cgi?id=836758 the panorama feature will be removed from Firefox. It will become an extension. So I don't believe that this pull is helpful anymore. |
You are wrong, IMHO. Do you use tab groups? I believe it could be very useful. Of course, you are right, this pull needs update if Bug 836758 lands. |
Btw try build + addon + this pull works as expected. So I really don't know why did you think that this pull isn't helpful anymore. |
Please run the current version of this pull without the panorama ad-on installed. Does it break NTT? Also how many people will still use panorama when it has been removed from Firefox core? There is a real low number as given on bug 836758, and this would also apply to users of NTT. You might want to start a survey on mozillazine if you want to figure that out. If there are only a few people why should we maintain such a feature in NTT which also relies on another add-on? Please keep that in mind. |
It works like you run with Fx 3.6. See below:
It will show "Undefined".
I happily do the maintenance work. |
In this case I'm fine with it. But shouldn't we move out this code into its own sub module? Given that it's not supported by default it's distracting to see when we are working on the code around it. |
Sad but true: this is still open :( |
{ | ||
return nightlyApp.getTabGroupTitle(window); | ||
} | ||
catch (e) { } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see where ´getTabGroupTitle´ throws an exception. Can you please explain that? If we silently catch that, we might already want to do that in that method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is getTabGroupTitle defined in SeaMonkey? AFAIK, there are no tab groups there at all (yet). Or do we never come here in SeaMonkey (however braindead the user's actions)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you can see, nightlyApp.getTabGroupTitle()
is only defined in browser.js
=== Firefox.
Therefore the current implementation needs the try ... catch
. (Of course it could be improved, to avoid try ... catch
)
BTW, only Firefox supports TabGroups (but the dev guys are going to extract it to an addon).
With the updates made, can we get a new XPI so users (on mozillazine?) could test it? |
Hi! Sadly, I don't have enough time on this, so I'm unable to address your comments soon. :( |
@@ -52,5 +52,6 @@ variable.Processor.description=Compilation Processor | |||
variable.Compiler.description=Compiler | |||
variable.DefaultTitle.description=Default Application Title | |||
variable.TabTitle.description=Current Tab's Title | |||
variable.TabGroup.description=Current Tab Group |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As you know, we have zh-CN
locale too. Please merge from master
!
Missing translation entity
Warning: Localizations must include a translated copy of each entity from each file in the reference locale. The required files may vary from target application to target application.
Missing Entities: variable.PlatformChangeset.description, variable.TabGroup.description
chrome/locale/zh-CN//chrome/locale/zh-CN/variables.properties
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do the merge yourself and ensure that all is included. Thanks.
This needs a rework, definitely. As Tab Groups was removed from Firefox but continues as addons! 👍 I hope they expose some API to achive this feature: |
|
||
// TabView isn't implemented | ||
if (!("TabView" in win)) | ||
return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
("TabView" in win)
is false for Simplified Tab Groups
This PR is fully outdated now. Closing. Group name in the titlebar is still a good feature IMHO. (#152 is related in some degree) |
Hi!
This is the pull request that contains the patch from Bug 726560.
Before reviewing the diff, please read Comment 4 and 5 in Bugzilla!