See bug 632294 comment 7 "...When you set a group to be active (i.e. UI.setActive(groupItem)), it should select its "active tab". This will likely change the UI's behavior, but for the better...."
I've checked the code and it seems it's working as described in comment 0. When UI.setActive(groupItem) is called, UI._setActiveTab(tabItem) would be called. http://hg.mozilla.org/mozilla-central/file/eee0bb5dca28/browser/base/content/tabview/ui.js#l438 There are two exceptions:  when an app tab is clicked, the group is set to be active and no active tab item is set.  Set the active group and then create a new tab in that group.  http://hg.mozilla.org/mozilla-central/file/eee0bb5dca28/browser/base/content/tabview/groupitems.js#l1145  http://hg.mozilla.org/mozilla-central/file/eee0bb5dca28/browser/base/content/tabview/groupitems.js#l1785 I think the current implementation covers the requirement in this bug.
Agreed, setting an active group activates the last active tabItem in this group by default. I think that's the behavior we want.
Mozilla/5.0 (X11; Linux i686; rv:7.0a1) Gecko/20110620 Firefox/7.0a1 Verified on Ubuntu 11.04 x86, WinXP, Win7 x86 and Mac OS X 10.6. Changing from one group to another within panorama activates(focuses) the latest focused tab. Setting status to Verified Fixed.