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

Cleaner fix for #2761 (Project tree selection incorrect after opening file by means other than sidebar) #3398

Merged
merged 1 commit into from
Apr 10, 2013

Conversation

peterflynn
Copy link
Member

Cleaner fix for #2761 -- Clear selection in project tree if current document not exposed in tree anywhere.

Backs out pull #2869, which made the behavior of Find in Files inconsistent with other means of opening files and didn't fix other cases of the bug.

Adds unit tests for several of these edge cases.

… file

by means other than sidebar) - Clear selection in project tree if current
document not exposed in tree anywhere.

Backs out pull #2869, which made the behavior of Find in Files inconsistent
with other means of opening and didn't fix other cases of the bug.

Adds unit tests for several of these edge cases.
@peterflynn
Copy link
Member Author

@redmunds since you were the reviewer of the original #2869 would you be able to review this one too?

_lastSelected = null;
_projectTree.jstree("select_node", $node);
_lastSelected = $node;
_redraw(true, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be better to leave those changes in because extension for example may want to use this function?

Copy link
Contributor

Choose a reason for hiding this comment

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

We're trying to finish Sprint 23 today, so I think it's best to minimize the amount of change.

I, personally, think a more useful interaction would be that a double-click on a Find in Files result would also open the file in the Working Set, but that's just me :)

Copy link
Contributor

Choose a reason for hiding this comment

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

actually i agree with you^

Copy link
Member Author

Choose a reason for hiding this comment

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

For the explicit 'Show in File Tree' use case, the original code worked fine as far as I'm aware... so if we're not using this for some other purpose I think leaving the original code is safest.

I do agree that double-click on a Find in Files result should add it to the working set. Looks like this is being tracked by the main Find in Files user story. (And the in-progress pull request #3151 implements it).

@redmunds
Copy link
Contributor

I guess I misinterpreted your "Ideally, file B would become selected in the project tree if it's exposed" comment in the bug report, but you're right that none of the other tools do that. Reviewing...

_projectTree.jstree("select_node", $node);
_lastSelected = $node;
_redraw(true, true);
// jsTree will automatically expand parent nodes to ensure visible
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand this comment: "jsTree will automatically expand parent nodes to ensure visible". Isn't that what your fix is trying to avoid ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, that's restoring the previous code. Maybe that comment is incorrect?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, that's correct -- that is what this code does, but this code is no longer invoked when you click a Find in Files result (see deletion in FindInFiles.js). This is now only invoked by the 'Show in File Tree' command.

@redmunds
Copy link
Contributor

Done with initial review.

@ghost ghost assigned redmunds Apr 10, 2013
@peterflynn
Copy link
Member Author

@redmunds added a bunch of responses. Let me know if anything more is needed.

Thanks for the review!

@redmunds
Copy link
Contributor

Looks good. Merging.

redmunds added a commit that referenced this pull request Apr 10, 2013
Cleaner fix for #2761 (Project tree selection incorrect after opening file by means other than sidebar)
@redmunds redmunds merged commit 54a89b9 into master Apr 10, 2013
@redmunds redmunds deleted the pflynn/fix-2761 branch April 10, 2013 18:09
@redmunds
Copy link
Contributor

Opened issue #3404

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.

3 participants