Closed Bug 359662 Opened 18 years ago Closed 18 years ago

Single-page bookmarking broken in recent nightlies

Categories

(Camino Graveyard :: Bookmarks, defect)

PowerPC
macOS
defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.5

People

(Reporter: thbarnes, Assigned: froodian)

References

Details

(Keywords: fixed1.8.1.1, regression)

Attachments

(2 files, 4 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1) Gecko/20061105 Camino/1.1a1+
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1) Gecko/20061105 Camino/1.1a1+

With more than one tab open, the option to "Bookmark Current Page" is shaded out in recent nightly builds. I hope this is a bug and not a feature. The option to "Bookmark Current Tabs as Tab Group" still works.

Reproducible: Always

Steps to Reproduce:
1. Open more than one tab


Expected Results:  
User should be able to bookmark current page regardless of how many tabs are open.
Regressed between
Version 2006102622 (1.1a1+) OK 
Version 2006102822 (1.1a1+) NO
Status: UNCONFIRMED → NEW
Ever confirmed: true
As a workaround, you can still Cmd-D, or change focus to the finder and change back to Camino.  The item will then be enabled for that tab (for as long as it's open, AFAICS).

At first glance, I have no idea what caused this (there are some other bugs in that query that could well be the culprit too).  Then again, maybe after I've been awake for more than 15 minutes it'll all be clear.  I'll look deeper, but eyeballs on the problem would be a good thing.
Keywords: regression
Target Milestone: --- → Camino1.1
This was broken by the patch portion of bug 159337.  I'll try to track down more as I go.  Stuart, any ideas?
IIRC the bookmark menu doesn't auto-validate, and this looks like we just aren't triggering the validation at the right times (you'll see the same thing if you open several tabs then close all but one; the multi-bookmark stays enabled).  I think it's only appearing to be a regression because there was never any validation of that menu item; before the consolidation only the toolbar item was being validated.
(In reply to comment #5)
> (you'll see the same thing
> if you open several tabs then close all but one; the multi-bookmark stays
> enabled).

FWIW, this didn't happen before the consolidation either.
Just a reference;

1) Open a new tab.
2) Go back to the previous tab or close the new tab.
3) Then it works.
Assignee: nobody → stridey
Attached patch Patch (obsolete) — Splinter Review
Properly validates bookmark menu items.  Note that I had to factor out the heart of addBookmark and create |addTabGroup| so that I could validate the "add tab group" menu item using the central method.
Attachment #244867 - Flags: review?(stuart.morgan)
Attached file New MainMenu.nib (obsolete) —
This just changes the target of the "add tab group" menu items to the new method.
Comment on attachment 244867 [details] [diff] [review]
Patch

This leaves bookmark menu validation in a weird half-and-half scheme, where some of the non-bookmark items are updated when it's shown and some are updated on window changes (and some are validated both, which is definitely not what we want).

I think we need to either decide that the whole menu is going to be validated when it's shown, in which case we call doBookmarksMenuEnabling from the menu event handler and remove all calls to delayedAdjustBookmarksMenuItemsEnabling, or we make sure that delayedAdjustBookmarksMenuItemsEnabling is called everywhere we need it to be.

My feeling is that the former is better.  The calls to delayedAdjustBookmarksMenuItemsEnabling from the various tab handlers seems uglier and more error prone, and I can't imagine there's more than negligible added cost for validating a few more items when it's shown.
Attachment #244867 - Flags: review?(stuart.morgan) → review-
(In reply to comment #10)

> I think we need to either decide that the whole menu is going to be validated
> when it's shown,

Does this also cover the appropriate enabling of keyboard shortcuts?
(In reply to comment #11)
> Does this also cover the appropriate enabling of keyboard shortcuts?

Sigh. I knew there must be a reason it wasn't that easy.

So we'll need to add more calls to update the menu when the number of tabs changes.
Attached patch Patch (obsolete) — Splinter Review
We don't just need it to update when the number of tabs changes, but at every page load (so addBookmark and addBookmarkWithoutPrompt can validate properly).  So, this patch:

- Still creates addTabGroup
- Adds a delayedAdjustBookmarksMenuItemsEnabling call every time we finish loading a page (BrowserWrapper portion is in |onLoadingCompleted|)
- Consolidates tab-closing code
- Validates Cmd-D too
- Removes the custom enabling calls |doBookmarksMenuEnabling| - they're redundant.
Attachment #244867 - Attachment is obsolete: true
Attachment #247630 - Flags: review?(stuart.morgan)
Attachment #244868 - Attachment is obsolete: true
Comment on attachment 247630 [details] [diff] [review]
Patch

>Index: src/browser/BrowserWrapper.mm
>... 
>+  // Validate the bookmark menu items
>+  [[NSApp delegate] delayedAdjustBookmarksMenuItemsEnabling];

I haven't had time to do a full review yet, but shouldn't this be done in BWC?
Attached patch Patch (obsolete) — Splinter Review
Yeah.
Attachment #247630 - Attachment is obsolete: true
Attachment #248364 - Flags: review?(stuart.morgan)
Attachment #247630 - Flags: review?(stuart.morgan)
Comment on attachment 248364 [details] [diff] [review]
Patch

Looks good, r=me with the minor changes below.

>+  else if (!mClosingWindow) {
>       [[self window] close];
>+      [[NSApp delegate] delayedAdjustBookmarksMenuItemsEnabling];
>   }

Indentiation is off here.

>+    if (tabViewItem) {
>+      [self closeTab:tabViewItem];
>     }

Remove the braces.

Lastly, please update the comment on doBookmarksMenuEnabling, since the part about when it needs to be called is now inaccurate.

I am concerned with how fragile this system is. Did we get all the places we needed to? Will we forget something later? We should file a bug for post-1.1 to see if we can come up with a new scheme for bookmark menu maintenance.
Attachment #248364 - Flags: superreview?(mikepinkerton)
Attachment #248364 - Flags: review?(stuart.morgan)
Attachment #248364 - Flags: review+
Attached patch r=smorgan patchSplinter Review
Attachment #248364 - Attachment is obsolete: true
Attachment #248740 - Flags: superreview?(mikepinkerton)
Attachment #248364 - Flags: superreview?(mikepinkerton)
*** Bug 364185 has been marked as a duplicate of this bug. ***
Comment on attachment 248740 [details] [diff] [review]
r=smorgan patch

sr=pink
Attachment #248740 - Flags: superreview?(mikepinkerton) → superreview+
Checked in on trunk and MOZILLA_1_8_BRANCH.  Followup is bug 364252.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Flags: camino1.1a2? → camino1.1a2+
Keywords: fixed1.8.1.1
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: