-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
This is fixed in Working Set as requested in #8973, but I'm seeing "main.js" on both pane headers. Should the name be qualified there, too? |
Fix for #9019 looks good. |
@redmunds I'll amend the PR with a fix for that. Good Catch! |
@@ -200,6 +200,9 @@ define(function (require, exports, module) { | |||
// image file, we get a null doc here but we still want to keep _fileSelectionFocus | |||
// as PROJECT_MANAGER. Regardless of doc is null or not, call _activatePane | |||
// to trigger documentSelectionFocusChange event. | |||
_fileSelectionFocus = WORKING_SET_VIEW; | |||
_activatePane(paneId); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
calling _activatePane
here after setting _fileSelectionFocus
to WORKING_SET_VIEW
will trigger a documentSelectionFocusChange
event which will tell the working set view to show the file in the selected state which fixes #9032.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is what the old master did, btw.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix for #9032 looks good except for 1 quirk with single select in project tree.
-
Split View, Open 4 files -- 2 in each working set
-
In project tree, single-click file that is open in current working set, but not displayed in editor.
Results:
File is selected in project tree. File is displayed in editor. This is same as 0.43 -
In project tree, single-click file in the other working set that is not displayed in editor.
Results:
File is selected in project tree. File is displayed in editor. This is same as 0.43 -
In project tree, single-click file in the other working set that is displayed in editor.
Results:
File is selected in working set.Expected:
File is selected in project tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be fixed now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm seeing that case 4 is fixed, but case 3 is now broken.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmmmm. this worked fine for me last night on the mac and it's working fine for me today on Windows.
#4 - single click file in other working set that IS displayed in editor
-> File is selected in project tree.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JeffryBooher Yes, 4 is now working for me, but 3 is no longer working.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry, I was drawn to the "bold". The problem with #3 is the issue I fixed last night which is still working today for me. LMK after syncing to the latest branch jeff/wsv-fixes
and we can look at it over connect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's fixed. I guess I didn't pull latest change.
*/ | ||
WorkingSetView.prototype._updateViewState = function () { | ||
var paneId = MainViewManager.getActivePaneId(); | ||
if ((FileViewController.getFileSelectionFocus() === FileViewController.WORKING_SET_VIEW) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the focus is in the project tree then remove the active class so the blue highlight goes away
@JeffryBooher Can you merge in the latest master so I can test #9142 against latest code? |
@@ -690,6 +706,8 @@ define(function (require, exports, module) { | |||
} | |||
|
|||
this._redraw(); | |||
} else { | |||
this._checkForDuplicatesInWorkingTree(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suppressRedraw
param here is a bit weird. Before this change, if suppressRedraw
is true
, then method does nothing. Seems like caller should detect that and not even call it?
I'm wondering if _checkForDuplicatesInWorkingTree()
needs to be called when suppressRedraw
is true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we want to ignore suppressRedraw
and just check paneId
:
if (paneId === this.paneId) {
if (!suppressRedraw) {
// snip...
}
} else {
this._checkForDuplicatesInWorkingTree();
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep in mind that there are 2 working set views...
The suppress redraw flag is only affecting the one that's being updated which won't check for duplicates when the suppressRedraw
flag is true.
This is used in 2 cases:
- When an untitled document is being saved.
- When a file is saved with a new name.
The pane that isn't affected by the change, however, is free to draw when it needs to with check for duplicates.
The other thing to keep in mind is that when using the suppressRedraw
flag, it's just to prevent removing list items when they are being removed from the working set and a new one is being added in a new place. Check for duplicates doesn't remove anything so we would still be able to check for duplicates when suppressRedraw
is passed on the affected view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a great explanation that belongs in the code somewhere!
Done with review. |
…igorously wrt _suppressRedraw
color: @open-working-file-ext-highlight; | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it's related to this change, but I wanted to make this comment in code to start a discussion thread (as opposed to main comments which are no threaded).
This may be as designed or FOL, but this behavior is unexpected:
-
Open Split View with 1 file in each Working Set
Results: text color of both Working Set files is blue when either is selected as expected. -
Single-click on some other file in Project Tree
Results: text color of file in Project Tree is blue. Text color of file in other Working Set is blue. Expected. -
Select Working Set file in other pane as file in Project Tree
Results: text of file in current Working Set is the only file in blue.
Expected: text of file displayed in other pane (i.e. file in Project Tree) is blue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WRT #3, I think this is correct
- Open 2 files (editor.js in one pane, mainviewmanager.js in another)
- Click on a file that isn't open anywhere (pane.js)
--> pane.js and editor.js are both blue and both visible in panes. mvm is hidden. - Click editor.js in file tree
--> editor.js is the only file that is blue (it's blue in both the project tree and workingsetview)
This is because pane.js is open in the other pane which isn't in the working set.
I can see how that may lead to some confusion as pane.js isn't blue anywhere because file tree doesn't allow for more than one selected item.
I wonder if @dangoor's new file tree would allow for this and if it would even make sense. I guess it could be blue and not "selected" but when we allow for the same document to be open in 2 different panes would that even make sense?
Fixes #9019
Fixes #8973
Fixes #9032