Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.

Project manager revamp #9015

Merged
merged 55 commits into from
Sep 22, 2014
Merged

Project manager revamp #9015

merged 55 commits into from
Sep 22, 2014

Conversation

dangoor
Copy link
Contributor

@dangoor dangoor commented Sep 8, 2014

This is an updated/rebased ProjectManager revamp for #8788. This replaces #8885.

cc @ingorichter

Here's my current list of issues/things to test that I'm looking into:

  • Failing ProjectManager tests
  • Switching project not updating the tree?
    • when opening brackets-git (which has a src folder) src is not getting updated. A merge algorithm problem?
  • Selected directory is missing trailing slash in ProjectModel._selections
  • brackets-git won't refresh on filesystem changes
    • need to ensure that when an item has to refresh its object is replaced
  • Test project base URL functionality
  • Right clicking on another node while the context menu is up does not move the context to that other node
  • Clear TODOs in new code
  • Rather than selectIfVisible the old code looks at whether the current doc has become visible. curDoc = DocumentManager.getCurrentDocument(); and then if (_hasFileSelectionFocus() && curDoc && data)
  • Error cases for create and rename
  • Creation errors are not visible (that window timeout thing)
  • Check for invalid filenames on rename
  • The double click to rename shouldn't take effect if it's been too long since the first click
  • Control-double click toggles siblings
  • Alt-double click is supposed to collapse subtree but does not seem to do anything for me.
  • Improve _fileSystemChange handler?
  • ProjectManager.showInTree needs to expand nodes and not do anything if the path is outside the project or doesn't exist
  • Don't select directories
  • ProjectManager.refreshFileTree needs to make sure it doesn't run multiple times and has the 1 second delay between runs if there's one pending. Also double check that it's returning a promise that's resolved when it's done.
  • Run all tests
  • Positioning is wrong when node is scrolled into view (too far left)
  • Verify ProjectManager events
    • projectRefresh doesn't seem likely to be fired!
  • Can ViewUtils.getFileEntryDisplay go away?
  • Close dropdowns on scroll (Menus.closeAll())
  • ProjectManager._fileSystemRename may not be used currently, but should be.
  • Make the actionCreator private in ProjectManager
  • Make treeData private in FTVM
  • Delete jstree
  • The old JSTree code would not select a directory if you click the disclosure triangle, but would select it if you click on the name. Do we care about that? That was probably because there was no differentiation between context and selection.
  • Find In not working on directory [Project Manager Revamp] Search in Folder doesn't work #8944
  • make (allow?) iconProviders to pass in a string

@ingorichter
Copy link
Contributor

okay, I'm going to make my changes in this PR now. Thanks for going through all this pain merging master with your branch.

dangoor and others added 5 commits September 8, 2014 14:50
The DOM structure has changed a little in the tree.
This was very hard to track down because our promises and event handlers swallowed
an exception thrown in FileTreeViewModel.
The project files cache was not being cleared on every file system change, as it had
been previously. Also removed duplicate projectClose event.
@marcelgerber
Copy link
Contributor

@dangoor Apparently, we need to set devel: true in .jshintrc in order to get the Travis build fixed.

@dangoor
Copy link
Contributor Author

dangoor commented Sep 18, 2014

I'm seeing this error when I launch Brackets:

Exception when calling a 'brackets done loading' handler: AppInit.js:95
TypeError: Cannot call method 'innerHeight' of undefined
    at Object._updateLayout (file:///Applications/Brackets.app/Contents/dev/src/view/MainViewManager.js:896:30)
    at Object.o.event.dispatch (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:3:6055)
    at Object.r.handle (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:3:2830)
    at Object.o.event.trigger (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:3:5163)
    at Object.<anonymous> (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:3:11000)
    at Function.o.extend.each (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:2877)
    at o.fn.o.each (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:2:818)
    at o.fn.extend.trigger (file:///Applications/Brackets.app/Contents/dev/src/thirdparty/jquery-2.1.0.min.js:3:10976)
    at triggerUpdateLayout (file:///Applications/Brackets.app/Contents/dev/src/view/WorkspaceManager.js:111:20)
    at Object.recomputeLayout (file:///Applications/Brackets.app/Contents/dev/src/view/WorkspaceManager.js:233:9) AppInit.js:96

Not sure if that happens on master.

* @param {Array.<File>=} additionalFiles Additional files to include (for example, the WorkingSet)
* Only adds files that are *not* under the project root or untitled documents.
*
* @return {$.Promise} Promise that is resolved with an Array of File objects.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: everywhere in this file we are referring to jQuery.Promise instead of $.Promise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are in use in the code... $.Promise seems to be in the lead with 180 matches vs. 70 matches for jQuery.Promise. Maybe I'll just switch them all to $.Promise.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By which I mean switch all of them in the new ProjectManager files

@ingorichter
Copy link
Contributor

@dangoor yes, I see this error too. And yes, I still can't comment on ProjectManager.js.

@ingorichter
Copy link
Contributor

Hey @dangoor, here is my list of comments for ProjectManager.js

  • L159 it seems that e is not used anymore or docs are missing
  • L413 to create the context we could call _getProjectViewStateContext() (like in _savePreferences
  • L476 wouldn't it be better to wait for the promise that is returned from model.reopenNodes before d will be resolved?
  • L585 is forceRender still required?
  • L593 can we remove this line and the comment above when this is no longer required?
  • L593 we should include the err in the rejected promise
  • L1216 where is shouldShow() defined? Or is this outdated information?
  • L1250 I think the comment is not quite right anymore. We should mention that we accept a React.DOM.ins instance or a jQuery object

General:

  • use $.Promise or jQuery.Promise

@dangoor
Copy link
Contributor Author

dangoor commented Sep 18, 2014

I tried replacing the forceRender property with a call to forceUpdate and ultimately came to the conclusion that forceUpdate wasn't working the way it says it should. I've posted a message in the React group about this.

@ingorichter
Copy link
Contributor

I'm eager to see their answer.

@dangoor
Copy link
Contributor Author

dangoor commented Sep 19, 2014

No word from the React people, so I've gone ahead and documented forceRender, since it works...

@dangoor
Copy link
Contributor Author

dangoor commented Sep 19, 2014

@ingorichter Are you fine with my proposed behavior for control-alt-click?

  • if the node is open, close it and all of its children
  • if the node is closed, open it and its immediate children

I think this is more consistent than the old behavior, even if it's not 100% consistent. (Opening all children could potentially freeze up Brackets if you've got a lot of files...)

@dangoor
Copy link
Contributor Author

dangoor commented Sep 19, 2014

Regarding your comments about ProjectManager.js:

  • L159 it seems that e is not used anymore or docs are missing
    • It's the jQuery event object. I've updated the docs.
  • L413 to create the context we could call _getProjectViewStateContext() (like in _savePreferences
    • Good call. Fixed
  • L476 wouldn't it be better to wait for the promise that is returned from model.reopenNodes before d will be resolved?
    • Not really because that can be done asynchronously and is not required to get the UI in front of the user. I agree this doesn't seem ideal, but I think the time to fix it (especially since this is private API) is when someone tackles turning _loadProject into something more reasonable).
  • L585 is forceRender still required?
    • Yes. I updated the docs.
  • L593 can we remove this line and the comment above when this is no longer required?
    • Removed. It no longer works this way
  • L593 we should include the err in the rejected promise
  • L1216 where is shouldShow() defined? Or is this outdated information?
    • updated to reflect that this is now in ProjectModel
  • L1250 I think the comment is not quite right anymore. We should mention that we accept a React.DOM.ins instance or a jQuery object
    • updated

@dangoor
Copy link
Contributor Author

dangoor commented Sep 19, 2014

Changes pushed.

Also turn on es5 mode for JSLint and JSHint so we can call .delete directly.
We wouldn't support any non-es5 browsers anyhow.
@ingorichter
Copy link
Contributor

@dangoor I'm okay with your changes to the control+alt+click behavior.
Yes, I meant 693. Sorry for the confusion.

@ingorichter
Copy link
Contributor

I think the travis failure needs to be fixed before we can merge it into master.

@dangoor
Copy link
Contributor Author

dangoor commented Sep 20, 2014

Grr... that's really annoying. JSHint is complaining about a JSLint option.

@dangoor
Copy link
Contributor Author

dangoor commented Sep 20, 2014

OK, found a combo that makes both JSHint and JSLint happy.

@dangoor
Copy link
Contributor Author

dangoor commented Sep 22, 2014

@ingorichter since it sounds like you're ready to merge into master, I won't make any more changes on the branch. I'll target additional bug fixes from this point against master.

ingorichter added a commit that referenced this pull request Sep 22, 2014
@ingorichter ingorichter merged commit d094245 into master Sep 22, 2014
@ingorichter
Copy link
Contributor

Thanks @dangoor. Merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants