Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] Fix #9363: Code hints popup dismisses prematurely #8527

Open
core-ai-bot opened this issue Aug 30, 2021 · 11 comments
Open

[CLOSED] Fix #9363: Code hints popup dismisses prematurely #8527

core-ai-bot opened this issue Aug 30, 2021 · 11 comments

Comments

@core-ai-bot
Copy link
Member

Issue by TomMalbran
Tuesday Oct 14, 2014 at 02:09 GMT
Originally opened as adobe/brackets#9548


I moved the logic to restore the collapsed files to the template, so that we don't need to toggle them after the results UI is rendered.


TomMalbran included the following code: https://github.com/adobe/brackets/pull/9548/commits

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Tuesday Oct 14, 2014 at 12:52 GMT


Just to get the linkage: this is for #9363

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Sunday Oct 19, 2014 at 17:03 GMT


@TomMalbran I can only get problem to reproduce in a slightly stricter version of@jasonsanjose's recipe:

  1. When Find In... results are open, collapse the results for at least 1 file
  2. Open code hints by typing (i.e. doesn't happen with Ctrl-space)
  3. Observe hints appear briefly, then disappear

I confirmed that you PR fixes this case.

Is this what you are seeing, or is there another way to reproduce problem?

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Sunday Oct 19, 2014 at 17:43 GMT


Done with review.

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Sunday Oct 19, 2014 at 22:23 GMT


@redmunds Yes. That is the way to reproduce it. The issue here is that the code hints pop up, then the search results list is re-rendered, and all the files are open. So to close them we are triggering a click event on every file which was previously collapsed. That then closes the code hints, since we triggered a click event.

The fix is simply to just render the collapsed items as hidden so that we don't need to hide them later.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Oct 20, 2014 at 00:02 GMT


With latest code, I'm seeing this:

  1. Do a Find in Files
  2. Collapse results for one of the files
  3. Make an edit to current file and Save
    (not sure if it's required, but I edited same file as was collapsed)

Results:
Collapsed file is expanded

Do you still need expanded class to save state?

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Monday Oct 20, 2014 at 00:12 GMT


@redmunds I was able to reproduce that by:

  1. Do a Find in Files for "Copyright"
  2. Collapse the results for the current file
  3. Remove the word "Copyright"
  4. Re-add the word "Copyright"

At step 3 the file is removed from the list, and at step 4 the files is readded, but since the file was removed from the model, we lost the collapsed information so we don't know that is was collapsed before.

If this is the only way to reproduce that bug, then it is a bug in master too and I don't think that is the same bug as #9363. So we should open a new issue for it and I can fix it in another PR, so that we can merge this one earlier.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Oct 20, 2014 at 00:17 GMT


@TomMalbran I'm editing a simple HTML page. I do a Find in Files on just that page for "body". 2 instances found, and I collapse only node. Then I edit a tag other than body tag, Ctrl-S to save, and results are expanded.

UPDATED: I'm seeing the same results in master, so I guess this is not related to this PR

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Monday Oct 20, 2014 at 00:25 GMT


@redmunds I see. I was able to reproduce it now. But it is also a bug in master and it was not created in this PR. I think that the file is searched again and all the results are replaced, removing the state of isCollapsed. Do you think that we still need to fix it here?

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Oct 20, 2014 at 00:37 GMT


@TomMalbran No, that doesn't need to get fixed here.

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Monday Oct 20, 2014 at 00:41 GMT


Thanks. Merging.

@core-ai-bot
Copy link
Member Author

Comment by TomMalbran
Monday Oct 20, 2014 at 01:15 GMT


@redmunds I tried to track the last issue you mentioned and I finally found it. When you save the file, the file system triggers a change event, and it deletes the entry from the search model. After that the file is searched again and readded, but the collapsed information was lost.

I am thinking that maybe we should keep the collapsed state in a different object.

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

No branches or pull requests

1 participant