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

fix some working set view issues #9134

Closed
wants to merge 11 commits into from
Closed

fix some working set view issues #9134

wants to merge 11 commits into from

Conversation

JeffryBooher
Copy link
Contributor

Fixes #9019
Fixes #8973
Fixes #9032

@redmunds
Copy link
Contributor

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?

@redmunds
Copy link
Contributor

Fix for #9019 looks good.

@JeffryBooher
Copy link
Contributor Author

@redmunds I'll amend the PR with a fix for that. Good Catch!

@JeffryBooher JeffryBooher changed the title fix two working set view issues fix some working set view issues Sep 17, 2014
@JeffryBooher
Copy link
Contributor Author

@redmunds pr amended with showing the relative path of files in the headers when there are duplicates. Also added a fix for #9032

@@ -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);
Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

  1. Split View, Open 4 files -- 2 in each working set

  2. 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

  3. 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

  4. 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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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) &&
Copy link
Contributor Author

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

@redmunds
Copy link
Contributor

@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();
Copy link
Contributor

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?

Copy link
Contributor

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();
        }

Copy link
Contributor Author

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:

  1. When an untitled document is being saved.
  2. 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.

Copy link
Contributor

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!

@redmunds
Copy link
Contributor

Done with review.

@JeffryBooher
Copy link
Contributor Author

@redmunds I reverted the change that undid @larz0 styling issue but by using a variable and removed #9142 from the list of issues fixed with this pr. @larz0 do you want to review that change?

color: @open-working-file-ext-highlight;
}
}
}
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 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:

  1. 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.

  2. 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.

  3. 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

Copy link
Contributor Author

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

  1. Open 2 files (editor.js in one pane, mainviewmanager.js in another)
  2. 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.
  3. 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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants