Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Live project search - #112

Merged
benogle merged 20 commits into
masterfrom
bo-realtime-project-search
Jan 3, 2014
Merged

benogle merged 20 commits into
masterfrom
bo-realtime-project-search

Conversation

@benogle

@benogle benogle commented Dec 20, 2013

Copy link
Copy Markdown
Contributor

Today, when you type in the search box, all the results are cleared until you hit enter to run another search.

After adding the live update of the replacement, the clearing of the results felt really abrupt. This pull changes things to instead live search.

This seems like it would be really painful on large projects, but it really isnt. When you start typing, the old search is cancelled, the results cleared, and a new search is started.

Some notes

  • It will only live search when the results pane is open
  • It only live searches when you type > 2 chars
  • It will not live search during a replacement
  • You can hit core:confirm in the find box with an empty string to cancel the current search

I did some experimentation with not clearing the results before starting a new search to limit ui disruption, but the old results sticking around was really awkward.

I encourage some of you guys to update to this branch and try it out.

Depends on atom/atom#1340, so we should get that merged first.

@benogle benogle mentioned this pull request Dec 20, 2013
@nathansobo

Copy link
Copy Markdown
Contributor

I'm afraid I will feel out of control but I'm totally down to try it for a few weeks.

@ghost ghost assigned benogle Dec 21, 2013
Comment thread lib/project/results-model.coffee Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This could just be if result?.matches?.length then new Result(result) else null

@probablycorey

Copy link
Copy Markdown

Maybe I just need to try this out more. But right now it feels jarring to see the results update as I'm typing. As you mention it is also jarring when you type in the find field and all the results disappear.

Also I ran into this error:

[Q] Unhandled rejection reasons (should be empty): ["(no stack) cancelled"] /Users/corey/github/atom/node_modules/q/q.js:991
Uncaught cancelled /Users/corey/github/atom/node_modules/q/q.js:126
flush /Users/corey/github/atom/node_modules/q/q.js:126
processImmediate

@benogle

benogle commented Jan 3, 2014

Copy link
Copy Markdown
Contributor Author

@probablycorey the unhanded error is that issue we talked about with Q before the break. I'm not sure how to 'handle' an error. It is actually handled, but produces this error when the promise is rejected.

I'm not sure of a better way to make it not jarring. Maybe they just stick around until you run another search?

@benogle

benogle commented Jan 3, 2014

Copy link
Copy Markdown
Contributor Author

Can we merge it, and if people hate it we can turn it off?

@probablycorey

Copy link
Copy Markdown

I'm cool with merging it. If it still feels weird in a week we can tweak it.

benogle added a commit that referenced this pull request Jan 3, 2014
@benogle
benogle merged commit 134511a into master Jan 3, 2014
@kevinsawicki
kevinsawicki deleted the bo-realtime-project-search branch January 10, 2014 17:28
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.

4 participants