Closed Bug 359462 (placescontroller) Opened 19 years ago Closed 19 years ago

Redesign PlacesController interaction with places views (was: context menu delete and keyboard delete (select all, cut, copy, etc) doesn't work in places-based history sidebar)

Categories

(Firefox :: Bookmarks & History, defect, P2)

defect

Tracking

()

RESOLVED FIXED
Firefox 3 alpha2

People

(Reporter: moco, Assigned: asaf)

References

Details

Attachments

(1 file, 14 obsolete files)

227.49 KB, patch
Details | Diff | Splinter Review
context menu delete and keyboard delete doesn't work in places-based history sidebar this will soon be a regression. will work on this as soon as the big patch for bug #356487 lands.
note, other items in the edit menu need to be fixed as well, such as select all. Fx 2 has some bugs (such as copy not doing the right thing) I've got a patch started, which leverage's the existing places controller (controller.js), but it needs some work. I'll attach a rough draft and list the open issues I'm still working on.
Status: NEW → ASSIGNED
Summary: context menu delete and keyboard delete doesn't work in places-based history sidebar → context menu delete and keyboard delete (select all, cut, copy, etc) doesn't work in places-based history sidebar
> and list the open issues I'm still working on. 1) top level delete of date does not work 2) delete of host, when view by host + date, will delete all for that host, not just those in that date! 3) select all 4) copy in fx 2 is enabled, but on paste, it doesn't work (on mac). fix this in trunk 5) make cut work on trunk, too? 6) fix this dnd issue. XXX ex [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIDragSession.isDataFlavorSupported]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/nsDragAndDrop.js :: anonymous :: line 424" data: no] 7) make sure VK_BACK works on the mac I'll attach a new patch, now that bug #356487 has landed.
Attached patch same rough draft, not complete. (obsolete) — Splinter Review
Attachment #245015 - Attachment is obsolete: true
a brain dump on the current patch: 1) not happy with the changes i've made to controller.js (the places controller) and how the history side bar uses it. 2) as for the delete by date code, dmills points out that I could generalize and re-use the nsNavHistoryExpire.cpp code, instead of rewriting the code.
spinning off problems with delete (when grouped by date, or date and site) to bug #363621.
re-assign to mano.
Assignee: sspitzer → mano
Status: ASSIGNED → NEW
Attached patch v1 (obsolete) — Splinter Review
The concept of one controller for all views (and then setting the active view in a focus handlers) doesn't work all that well - automated commands updating is done before the focus event is fired. There's a hack in the places-tree binding (and probably in few more places) to work around that which calls updateCommands for the commandDispatcher of window.docuemnt. This means commands were not updated in the parent/child windows (in the sidebar case, that means edit-commands were not updated for the browser-window's edit menu). So, I got rid of the entire activeView story, meaning views should create and use their owen PlacesController. This works except I didn't yet update views other than the sidebar. Context-menu code changes here are wrong, my plan is to factor this code out of the places controller.
Comment on attachment 248602 [details] [diff] [review] v1 If no one objects, I would like to land this first and fix other views separately (meaning --enable-places-bookmarks will be broken for few days at the very least). Please ignore the changes to buildContextMenu and LOG.
Attachment #248602 - Flags: review?(sspitzer)
Comment on attachment 248602 [details] [diff] [review] v1 Don't review this yet.
Attachment #248602 - Attachment is obsolete: true
Attachment #248602 - Flags: review?(sspitzer)
Attached patch more... (obsolete) — Splinter Review
Attachment #246651 - Attachment is obsolete: true
Attachment #248693 - Flags: review?(sspitzer)
Alias: placescontoller
Priority: -- → P2
Summary: context menu delete and keyboard delete (select all, cut, copy, etc) doesn't work in places-based history sidebar → Redeisgn PlacesController interaction with places views (was: context menu delete and keyboard delete (select all, cut, copy, etc) doesn't work in places-based history sidebar)
Target Milestone: --- → Firefox 3 alpha2
Attached patch more... (obsolete) — Splinter Review
Attachment #248693 - Attachment is obsolete: true
Attachment #248693 - Flags: review?(sspitzer)
Summary: Redeisgn PlacesController interaction with places views (was: context menu delete and keyboard delete (select all, cut, copy, etc) doesn't work in places-based history sidebar) → Redesign PlacesController interaction with places views (was: context menu delete and keyboard delete (select all, cut, copy, etc) doesn't work in places-based history sidebar)
Attached patch more... (obsolete) — Splinter Review
Attachment #248753 - Attachment is obsolete: true
I have some thoughts on this, please ping me sometime on how I think transactions should work. Basically, I think the transactions in the JS "controller" were a bad idea. I think the Nav* services should have functions that return transactions, instead of implementing the function directly, and these transactions should be written in C++ within the service.
Transactions code was (almost) not changed here at all.
Attached patch more... (obsolete) — Splinter Review
Attachment #248786 - Attachment is obsolete: true
Attached patch remotely stable (obsolete) — Splinter Review
Attachment #248821 - Attachment is obsolete: true
Attached patch more... (obsolete) — Splinter Review
Fix busted delete folder and copy transactions;
Attachment #248841 - Attachment is obsolete: true
Attached patch more... (obsolete) — Splinter Review
Attachment #248850 - Attachment is obsolete: true
Attachment #248873 - Flags: review?(sspitzer)
Attachment #248873 - Attachment is obsolete: true
Attachment #248932 - Flags: review?(sspitzer)
Attachment #248873 - Flags: review?(sspitzer)
Alias: placescontoller → placescontroller
Status: NEW → ASSIGNED
asaf, sorry for the delay. looking over (and testing) your patch today.
Excuse me, about trivial coding style. |PlacesUtils._uri| and |PlacesUtils._wrapString| need "_" ? If I understand correctly, by prefix "_" the original authors mean "the property/method is private" and "to be called only by |this| or |self|". That's the difference between |activeView| and |_activeView| etc. So, _uri(...) -> wrapURI(...) and _wrapString(...) -> wrapString(...), as they are public utilities now...?
No longer blocks: 307070
Attached patch applies to trunk (obsolete) — Splinter Review
Attachment #248932 - Attachment is obsolete: true
Attachment #249056 - Flags: review?(sspitzer)
Attachment #248932 - Flags: review?(sspitzer)
Attached patch don't initialize views twice (obsolete) — Splinter Review
This fixes the on-startup JS error I introduced.
Attachment #249056 - Attachment is obsolete: true
Attachment #249062 - Flags: review?(sspitzer)
Attachment #249056 - Flags: review?(sspitzer)
got a little sidetracked with regression bug #364018, but I'm back on the test / review of this patch now.
No longer blocks: 364401
asaf, still working through the patch. when testing, everything looks good. one question so far, which did you move this into a timeout? else { // Set the mode on an existing places window. - organizer.selectPlaceURI(place); - organizer.focus(); + setTimeout(function() { + organizer.selectPlaceURI(place); + organizer.focus(); + }, 0); } },
Ignore it, I forgot to remove this when I realized it fixes nothing.
Comment on attachment 249062 [details] [diff] [review] don't initialize views twice r=sspitzer sorry for the delay. the history sidebar on place tests out fine. I only had a few more questions and requests for spin of bugs.
Attachment #249062 - Flags: review?(sspitzer) → review+
1) + <!-- XXXmano: not yet supported --> <command id="placesCmd_reload" label="&cmd.reload.label;" accesskey="&cmd.reload.accesskey;" oncommand="PlacesController.reloadSelectedLivemarks();" disabled="true"/> - </commandset> -</commandset> + <command id="placesCmd_sortby:name" + label="&cmd.sortby_name.label;"/> + <!-- XXXmano: not implemented? --> + <command id="placesCmd_rename" + label="&cmd.rename.label;" + accesskey="&cmd.rename.accesskey;"/> +#endif +</commandset> Can you log a spin off bug on these XXX items? 2) +#include commands.inc <!-- XXX fix me: context menu delete and cmd_delete are not working yet. see bug #359462 --> I think you can remove my XXX fix me comment, as you have fixed this, right? 3) + /** + * XXXmano: this used to be a hack which allowed using few places commands + * when the search field is focused. Re-implementing it would probably + * require adding a controller to the searchbox which would forward over + * those commands to the places tree controller. + * + * // Initialize the active view so that all commands work properly without + * // the user needing to explicitly click in a view (since the search box is + * // focused by default). + * PlacesController.activeView = this._places; + */ do we need a spin of bug on restoring this hack? 4) + <implementation implements="nsIDOMEventListener"> <constructor><![CDATA[ // Support an asyncinit attribute that causes the view to populate // itself only after the window has been shown. This is to ensure we // do not regress browser window show time (Ts/Txul) +#if 0 if (this.hasAttribute("asyncinit")) { var self = this; //setTimeout(function() { self._init(); }, 0); } else +#endif this._init(); ]]></constructor> Can you explain why you turned this code off?
(In reply to comment #30) > 1) Sure. > 2) > > +#include commands.inc > <!-- XXX fix me: > context menu delete and cmd_delete are not working yet. see bug #359462 > --> > > I think you can remove my XXX fix me comment, as you have fixed this, right? > There's still some work to do here (delete of a anything but folders is not undo-able at the very least). Spin of, I guess. > 3) > do we need a spin of bug on restoring this hack? Maybe, we should investigate this when we implement Fx2-bookmarks-manager functionality. > 4) > Can you explain why you turned this code off? > It's not me, it's Ben (see setTimeout prefixed with //). These hacks were used to improve/fake Ts, we should spin of this as well (and see how much it actually affects Ts either way).
Depends on: 364644
No longer depends on: 364644
Depends on: 364644
Attached patch as checked inSplinter Review
mozilla/browser/base/content/browser-places.js 1.14 mozilla/browser/base/content/browser-sets.inc 1.86 mozilla/browser/base/content/browser.js 1.747 mozilla/browser/base/content/browser.xul 1.331 mozilla/browser/base/content/global-scripts.inc 1.12 mozilla/browser/components/places/jar.mn 1.29 mozilla/browser/components/places/content/bookmarkProperties.js 1.26 mozilla/browser/components/places/content/bookmarkProperties.xul 1.15 mozilla/browser/components/places/content/commands.inc 1.21 mozilla/browser/components/places/content/context.inc 1.12 mozilla/browser/components/places/content/controller.js 1.102 mozilla/browser/components/places/content/history-panel.xul 1.2 mozilla/browser/components/places/content/menu.xml 1.59 mozilla/browser/components/places/content/places.js 1.68 mozilla/browser/components/places/content/places.xul 1.50 mozilla/browser/components/places/content/toolbar.xml 1.65 mozilla/browser/components/places/content/tree.xml 1.44 mozilla/browser/components/places/content/treeHelpers.js 1.4 mozilla/browser/components/places/content/utils.js initial revision: 1.1
Attachment #249062 - Attachment is obsolete: true
@O. Atsushi: I missed comment 23, mind to file a bug?
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
This appears to have broken a couple of extensions: Console2 Gmail Notify Adblock Plus See forum thread: http://forums.mozillazine.org/viewtopic.php?p=2662949#2662949 Posts by Littlemutt, and -fullmetaljacket-
Double check checkins ranges, I doubt any of those extensions rely on the places controller. (And, please, file a bug).
(In reply to comment #36) > Double check checkins ranges, I doubt any of those extensions rely on the > places controller. > > (And, please, file a bug). > Yikes!, your right, missed a check-in, it looks more likely as the culprit. Sorry for the spam
Depends on: 364827
Depends on: 364828
No longer depends on: 364827
Depends on: 364905
Depends on: 365266
Depends on: 507386
Bug 451915 - move Firefox/Places bugs to Firefox/Bookmarks and History. Remove all bugspam from this move by filtering for the string "places-to-b-and-h". In Thunderbird 3.0b, you do that as follows: Tools | Message Filters Make sure the correct account is selected. Click "New" Conditions: Body contains places-to-b-and-h Change the action to "Delete Message". Select "Manually Run" from the dropdown at the top. Click OK. Select the filter in the list, make sure "Inbox" is selected at the bottom, and click "Run Now". This should delete all the bugspam. You can then delete the filter. Gerv
Component: Places → Bookmarks & History
QA Contact: places → bookmarks
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: