Closed Bug 311110 Opened 19 years ago Closed 19 years ago

Dragging behaviour of bookmarks into empty area in tab bar is inconsistent

Categories

(Camino Graveyard :: Tabbed Browsing, defect)

PowerPC
macOS
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Camino1.0

People

(Reporter: bugzilla-graveyard, Assigned: bugzilla-graveyard)

Details

(Keywords: fixed1.8)

Attachments

(1 file, 3 obsolete files)

When a single bookmark is dragged from the bookmarks bar to an empty area of the
tab bar, it opens a new tab in the background with the contents of that bookmark.

When a single bookmark is dragged from the bookmarks bar to an already-open tab,
it replaces the contents of that tab with the contents of the bookmark.

However, when a tab group is dragged into the empty area of the tab bar, it
destroys all open tabs in that window and opens only the tabs in the tab group
(like you had simply clicked on it in the bookmark bar).

Dragging something to the empty space on the tab bar seems to imply "open this
in addition to what I've already got open." Therefore, our behaviour with tab
groups is inconsistent and counterintuitive here, and should be amended to open
tab groups in new (background) tabs.

(I haven't looked into whether the drag behaviour obeys the preference to always
open new links in the background, but it seems logical that it should.)
Also contains some stylistic fixes to BrowserTabView.mm for spurious spaces and
the like.
Assignee: mikepinkerton → bugzilla
Status: NEW → ASSIGNED
Oops. This one's better. :)

cl
Attachment #198515 - Attachment is obsolete: true
>if (!overTabViewItem) // if not over a tabViewItem, append rather than replace
(bug 311110)
>     [[[self window] windowController] openURLArray:[aBookmark childURLs]
tabOpenPolicy:eAppendTabs allowPopups:NO];
>   else // user dropped a tab group on an existing tab, so replace instead of
append
>     [[[self window] windowController] openURLArray:[aBookmark childURLs]
tabOpenPolicy:eReplaceTabs allowPopups:NO];

The difference is more clear with just
[[[self window] windowController] openURLArray:[aBookmark childURLs]
tabOpenPolicy:(overTabViewItem ? eReplaceTabs : eAppendTabs) allowPopups:NO];
Yeah, I was thinking I could do that somehow, but I didn't make the leap to
nesting inside the method call. Man, I love Obj-C.

cl
Attachment #198521 - Attachment is obsolete: true
Attachment #198541 - Flags: review?
Comment on attachment 198541 [details] [diff] [review]
New version incorporating LH's suggestion

asking for r from pink, add pink to cc list (was never on it as I created and
assigned myself this one in a single step)
Attachment #198541 - Flags: review? → review?(mikepinkerton)
Comment on attachment 198541 [details] [diff] [review]
New version incorporating LH's suggestion

sr=pink. smfr, you agree here?
Attachment #198541 - Flags: superreview+
Attachment #198541 - Flags: review?(sfraser_bugs)
Attachment #198541 - Flags: review?(mikepinkerton)
Simon, will you be able to get to this review before 1.0?  (Do we want this fix for 1.0?)  The current behavior is kind-of nasty.
Target Milestone: --- → Camino1.1
Comment on attachment 198541 [details] [diff] [review]
New version incorporating LH's suggestion

>Index: BrowserTabView.mm
>===================================================================

>         if ([aBookmark isKindOfClass:[Bookmark class]])
>           return [self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:[aBookmark url]];
>+          
>         else if ([aBookmark isKindOfClass:[BookmarkFolder class]]) {

Remove the 'else', or remove the blank line, but don't have both.

>-          [[[self window] windowController] openURLArray:[aBookmark childURLs] tabOpenPolicy:eReplaceTabs allowPopups:NO];
>-          return YES;
>+          // if the drag terminates over a TabViewItem, replace. Otherwise, user dragged to empty space in tab bar and we should append as new tabs (bug 311110).
>+          [[[self window] windowController] openURLArray:[aBookmark childURLs] tabOpenPolicy:(overTabViewItem ? eReplaceTabs : eAppendTabs) allowPopups:NO];
>+        return YES;

I don't think the comment is necessary, and please fix the indentation.
Attachment #198541 - Flags: review?(sfraser_bugs) → review+
That should fix it; not sure how that whitespace mixup got in there to begin with.

cl
Attachment #198541 - Attachment is obsolete: true
Attachment #201282 - Flags: superreview?(sfraser_bugs)
Attachment #201282 - Flags: review?(sfraser_bugs)
Comment on attachment 201282 [details] [diff] [review]
Fixed per Simon's suggestions

I checked this in. I also fixed the > 1 drag item clause too.
Attachment #201282 - Flags: superreview?(sfraser_bugs)
Attachment #201282 - Flags: superreview+
Attachment #201282 - Flags: review?(sfraser_bugs)
Attachment #201282 - Flags: review+
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Keywords: fixed1.8
Resolution: --- → FIXED
Target Milestone: Camino1.1 → Camino1.0
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: