Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Feature/openfiles #1252

Merged
merged 58 commits into from

6 participants

@javruben
Owner

@gjtorikian @linh81 @mattpardee @davidvb

Adds a realtime searching gotofile feature to cloud9.

Todo:

  • Check for memory leaks
  • Server update scheduling

This is accompanied by:
ajaxorg/apf#60

@javruben
Owner

Here is a screencast showing the feature: http://screencast.com/t/AE3eXgeP

@mattpardee

This is absolutely fantastic to use. The only thing I'd like to see is a hover state on the list items

@mattpardee

The cursor should stay the "default" icon when hovering over text elements

@mattpardee

Pressing escape to close the dialog clears the input but maintains a highlighted list item:

http://screencast.com/t/ocMaK5vt9V

[Edit by Ruben] This is not a bug, it highlights an item you already have open

@mattpardee

I would love to see a shadow with greater distance from the dialog. What do you think @davidvb? @chrissywelsh?

@mattpardee

This is a very strange bug which I assume has to do with the refactored viewport:

http://screencast.com/t/iJcmdHfj4VIx

Basically, if you close the dialog with the search X, and then scroll in the tree, then open the dialog again, the results box doesn't fill up its parent

@mattpardee

I'm conflicted on the UX of the dropdown. It resembles the OS X "Save As..." visor in its position attached to the editor page.

I suggest that since the operation of opening a file doesn't specifically apply to the active page; it isn't modal; and it doesn't close on losing focus, that it's maintained as the dialog it once was.

I'm not a fan of dialogs, but I think this UX is confusing.

@mattpardee

When the list has focus there should be an easy way to get back to the input (tab or otherwise)

[Edit by Ruben] There is: Just start typing.

@mattpardee

I believe the updated APF has modified the height of "combo" menu items such as in the statusbar preferences menu. See this video for the difference between master and then this branch:

http://screencast.com/t/1mWazNeB

@gjtorikian

My comments are also minor UX/UI issues.

I want to emphasize, above all, to not make it back into a dialog. Dialogs are so 1990. Besides the fact that there's precedence for the current format (Sublime), let's be a little bold and try out new methods of development. A live search dialog offers nothing new, besides which, it actively blocks the editor content in a more obtrusive manner than this. (In general I agree with everything else: ESC should close the dialog, hover states would be nice)

On to comments:

  • The scroll bar should be below the search box:
  • With this UI open, it's still possible to pop open quick search, which creates a confusing overlay. We should consider blocking that second UI. Optionally, consider shifting "go to file" to the upper right corner.
  • Consider alternative colors for easier visibility (e.g. light blue and white odds and even rows)
  • UI should close when all files are closed:
  • Preferring currently open files is an awesome improvement! I would also suggest putting an indicator in the list (can be something simple like an asterisk) so that the user knows why their list selection jumped. It can be a bit jarring at first, but can be easily made friendlier
  • Optionally show/hide hidden files; this can be controlled from the Project Files tree
  • Consider changing the keyboard shortcut. I don't know any app that doesn't use CMD/CTRL O to open files. More accurately, I don't know any other app that uses Alt-Shift-R to open files.
@mattpardee

Great suggestions from @gjtorikian. Garen I know you have very strong opinions about dialogs in C9 and I totally respect those (some may remember my manifesto which railed hard on their excessive use in C9). That being said, here are my 0.02:

  • On showing that the preferred selection is already open, I would like to see the gradient blue selection background be made green, and its corresponding tab also made green
  • Dialogs are not bad UX. The major difference between the visor and the dialog is you can move a dialog around. That would be useful if the Open Files visor is blocking the editor text which contains the path to the file you're trying to open
  • If the visor mode is kept, I would suggest the following:
    • Make it animate down/up when toggled
    • Make it close when it loses focus (this would solve the Search in Files issue Garen ref'd)
  • Do we support multiple keybindings? If so I like Garen's suggestion. But I also like Alt-Shift-R because R could stand for reference, which would be useful later when language analysis is incorporated
  • I don't think it should be closed when all files are closed - whether or not files are closed is irrelevant to the reason for it existing in the first place
@zefhemel

This feature is amazing, I want it now!

@javruben javruben * Optimization making search 3 times as fast (full dataset search fro…
…m 150ms to 50ms) by switching to an array instead of xml for searching.
abf4529
@zefhemel

I'm trying this locally on the cloud9infra repository and it doesn't work at all (while it works just great on the cloud9 repo). I get this while typing:

Uncaught TypeError: Cannot read property 'firstChild' of undefined

in gotofile.js line 123.

Also, after, my chrome tab completely freezes up and uses 100% of the CPU and I cannot even close it.

@zefhemel

Alright, so it does in fact work, it just takes a loooooooooong time to load. I should note that I have a number of copies in my cloud9infra directory of all static files (to be uploaded to cloudfront). a find . | wc -l tells me there's 110k files in my directory. Apparently that's a bit much for this extension to handle.

I also noticed that the cloud9 node process was busy for 100% for quite a while, which may be a bit worrying. We don't want this to put extreme load on the server for huge projects.

@javruben
Owner

Fixed todo item: Server update scheduling

@javruben
Owner

@zefhemel it seems childNodes[i] is O(n^2) working on a fix.

@javruben
Owner

@zefhemel Tested it with 65000 files. Could you retest?

@gjtorikian

Ruben don't kill me I made a few changes:

  1. Alternating row colors ever so slightly
  2. On blur away from gotofile, the dialog closes. This is the same behavior as quicksearch
  3. I noticed that after you select a file the selection in the listremains, so on toggleDialog(-1) the selection clears

I tried to add a tween similar to quicksearch but it was proving difficult. The problem is that the list is large; and as I was tweening there was some z-index hijinks between the tab bar and the editor.

@zefhemel

@javruben retested, the node-darwin process still uses 100% CPU for about 20s, on the browser side it seems pretty speedy.

Also, now that this is bound to Cmd-R, I can no longer reload the IDE using that key which I find very annoying.

@javruben
Owner

@gjtorikian I did most of those changes, please let me know how you like them. Sadly the alternating colors don't work because of the virtual viewport, thus when scrolling, the colors change per row. I reverted that.

@zefhemel I implemented a fix for the node.js 100% CPU problem. I also made the client startup time an order of magnitude faster with it. I refactored the filelist plugin in jsdav here: mikedeboer/jsDAV#37. Please note that we're fine up to 100k files. I tried it with 440k files and that breaks. I'm looking into this for a next release. We need that for the local use-case. For the online use-case I believe we'll be fine. Our largest repo has 28k files.

I fixed the last todo item, the client side memory leaks when searching.

I believe this thing is now ready to be put on a staging server.

@javruben
Owner

@zefhemel To refresh please use Command-Shift-R.

@javruben
Owner

@mattpardee I addressed most of your issues. I haven't yet added the tab coloring, but I think that is a great idea.

@gjtorikian

The feature is awesome.

My one and only qualm is the keybindings (still). We should swap CMD-R for CMD-O. The reason for this is that it may be disruptive for users expecting one action (refreshing the page) and getting something completely different. It's bad usability.

However...as I'm typing this out I realize I am being a complete hypocrite. Because I would like to see also, for example, CMD-W close tabs in the editor, instead of closing the browser window (a mistake I have made countless times). This one seems different, though. If I refresh, I'm not prompted with a dialog that says "You have unsaved changes," so I have really a threat of something being lost.

This quandary is solved by convincing myself that the current keybinding of CMD-O opens files, which has really no relevance for the IDE whatsover; therefore, overriding it is okay. You may, as a user, actually want to refresh the IDE (in case of error), and we want to keep that action the same as every other webpage.

@javruben
Owner

@gjtorikian Here are my reasons. This is going to be the single most used interaction after typing, saving, undo, cut, copy, paste and search, and perhaps closing files. Lets review those key combos: Free range, Cmd- S, Z, F, G, X, C, V, Option-W. Now that last one is really annoying. Everyone including you and me wants to do Cmd-W but can't. I've accepted that. For this feature I would like to have Cmd-T. Why? It's what TextMate and Sublime have. Moreover, It can be used by one hand (my left one). Sadly Cmd-T is used to open new tabs in the browser. Looking at the palette of keys, there are not really any left. Cmd-E is used for Zen Mode, D for deleting lines. So what remains is R.

The thing with Cmd-R is, no user should ever want to refresh Cloud9. It's not that kind of app. Everything is realtime. If a user, god-forbid, wants to refresh because of a bug, he can use the refresh button, but lets not design an app for that. I personally actually like Cmd-R to not be reload. Often I accidently press that key combo because it looked like another combo.

So, my arguments are: Easy to use with one hand, often used so needs simple combo and refreshing is not something our users want to do.

I can't wait until someone will pull this :)

@gjtorikian

Ruben's answer makes sense. We should never get to a state where the user needs to refresh.

I had to throw in a quick fix for quicksearch; it's only present on this branch, perhaps as a result of other changes made to the file.

@mattpardee
@gjtorikian

There's also CMD-B. (Just sayin'.) B could stand for BOOM new file.

@mattpardee

To get back to the root of the issue: Command-Shift-R will do a force refresh and ignore the cache. A regular Command-R will issue If-Modified-Since.

So @javruben, this new approach will force all assets to be re-downloaded every single time a user refreshes the IDE. Even with a packaged IDE, I don't think this is appropriate.

@mattpardee

New usability issues discovered:

  • "Opening" a file that's already open results in scrolling to the top instead of keeping the scroll position
  • Selecting an item doesn't close the dialog right away (appears it relies on the "openfile" event to set the focus on the editor?)
  • The list still doesn't catch [tab] to go back to the input area
  • Going in and out of Zen mode will cause the dialog to close (zen mode sets the focus on the editor, suggestion: in zen.js detect if the openfiles dg is visible)
@javruben
Owner

@mattpardee I implemented Cmd-Shift-R in c9, so it will just do a normal refresh.

@zefhemel

In Firefox, holding shift and arrow down to select multiple files results in this:

Screenshot

@zefhemel

One more issue: When clicking the little x in the input box, clears it, but doesn't give the input search box focus again.

@javruben javruben * [Tab] now focussed the txt box in gotofile
* No more scrolling for open files
* Fixed tab menu issues
* Fixed zen mode
88a9e64
@javruben
Owner

@mattpardee I fixed 3 of your 4 issues. The window is actually closed immediately when you select a file.

@janjongboom

It still takes some time to get the results pop up the first time, but there is no hint that there is actually something going on. I thought it was broken at first but just took 10 sec or something.

@janjongboom

Firefox standalone version

  • Scroll all the way down the list, start typing something that is in your viewport (in my case user-subscription), nothing happens, pressing ESC then COMMAND-R again to retry refreshes the browser. (I saw this at least once, but can't reproduce easily).

Just some general feedback:

In GitHub you can skip folders, f.e. by typing ext/skin.xml you get all the skin files underneath the ext folder. That would be nice.

On the keyboard command, GitHub uses T, ReSharper uses CMD+SHIFT+N, and Visual Studio uses CMD+, for a symbol/file search box. Maybe that is also nice. Here some suggestions on other 'Navigate to' commands we can build.

@javruben javruben * Fixed Mozilla Selection Bug
* Fixed Button Clear Issue
23fdba1
@janjongboom
  • can we add ALT+SHIFT+R as an alternative command for our beloved users who don't know about the new shortcut?
@janjongboom

When using this in conjunction with revisions, I see alot of .c9save files pop up. Can we ignore them? @sergi

@javruben
Owner

@janjongboom I exclude the .c9revisions directory. Are the .c9save files not in there?

@sergi

@javruben @janjongboom Yes, the *.c9save files are all inside .c9revisions folder. If you ignore that folder we should be ok.

@javruben
Owner

@janjongboom I fixed the issues you reported.

@zefhemel

Alright, all looks ok. I'm merging this. Any additional issues can be reported as GitHub issues, assign them to @javruben.

@zefhemel zefhemel merged commit ffd3d3c into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 9, 2012
  1. @javruben
  2. @javruben

    * Better and faster search

    javruben authored
    * Many tweaks
  3. @javruben

    * Better keyboard support

    javruben authored
  4. @javruben
  5. @javruben

    * updated apf

    javruben authored
  6. @javruben

    * updated apf submodule

    javruben authored
Commits on Apr 10, 2012
  1. @javruben

    * Changed goto file keybinding to Cmd-R / Ctrl-R because it is a very…

    javruben authored
    … important keybinding
    
    * Added Cmd-Shift-R for reloading Cloud9 IDE
  2. @javruben

    * Removed icon from search boxes. It felt really distracting while it…

    javruben authored
    … didn't give extra information. (/cc @davidvb)
  3. @javruben
  4. @javruben

    * Optimization making search 3 times as fast (full dataset search fro…

    javruben authored
    …m 150ms to 50ms) by switching to an array instead of xml for searching.
  5. @javruben
  6. @javruben
  7. @javruben

    * Small bugfix

    javruben authored
  8. @javruben

    * Fixed cursor over items

    javruben authored
    * Added hover
  9. @javruben

    * updated apf

    javruben authored
  10. @gjtorikian
  11. @javruben

    * Added animation to gotofile

    javruben authored
    * Make gotofile hide when it loses focus
    * gotofile and quickfind are now mutually exclusively visible
  12. @javruben

    * Build apf

    javruben authored
  13. @javruben

    * Fixed first time show bug

    javruben authored
  14. @javruben

    * small oops fix

    javruben authored
  15. @javruben

    * Fixed small caching issue

    javruben authored
  16. @javruben
  17. @javruben

    * Added cache clear policy

    javruben authored
    * Fixed numerous scrollbar issues
  18. @javruben
  19. @javruben
Commits on Apr 11, 2012
  1. @javruben

    * Updated key bindings

    javruben authored
  2. @javruben

    * Improved client init time by 1 order of magnitude (switching to jso…

    javruben authored
    …n and offloading to server)
  3. @javruben

    merged

    javruben authored
  4. @javruben

    * Reverted alternating colors

    javruben authored
  5. @javruben

    * Build apf

    javruben authored
  6. @javruben

    merged master

    javruben authored
  7. @javruben

    * Updated jsdav and apt

    javruben authored
  8. @javruben
  9. @javruben
  10. @javruben
  11. @javruben
  12. @javruben
  13. @javruben
  14. @javruben
  15. @javruben

    Merged from master

    javruben authored
  16. @javruben

    * Build apf

    javruben authored
  17. @javruben

    * Updated apf

    javruben authored
  18. @javruben
  19. @gjtorikian

    Fix quicksearch bug

    gjtorikian authored
Commits on Apr 12, 2012
  1. @javruben
  2. @javruben

    * Cleanup

    javruben authored
    * Small improvement in tab behaviors menus
  3. @javruben
  4. @javruben

    * Skin update

    javruben authored
  5. @javruben
  6. @javruben

    * [Tab] now focussed the txt box in gotofile

    javruben authored
    * No more scrolling for open files
    * Fixed tab menu issues
    * Fixed zen mode
  7. @javruben

    * Fixed Mozilla Selection Bug

    javruben authored
    * Fixed Button Clear Issue
  8. @javruben
  9. @javruben

    * Added loader for early opening the goto file dialog

    javruben authored
    * Added Alt-Shift-Option keybinding
  10. @javruben

    * Build APF

    javruben authored
  11. @javruben

    * updated apf

    javruben authored
  12. @javruben

    * Build apf fixing gecko issue

    javruben authored
    * Updated comment
  13. @javruben

    * updated apf

    javruben authored
  14. @javruben

    * Fixed stupid mistake

    javruben authored
    * Added duplicate to tree context menu
Something went wrong with that request. Please try again.