Fix bad title bar path when viewing files not in a project folder #13475

Merged
merged 3 commits into from Dec 20, 2016

Projects

None yet

3 participants

@BinaryMuse
Member
BinaryMuse commented Dec 20, 2016 edited

In cases where the active pane item has a path that is not inside a current project folder, we display the first project folder in the title bar. This can be misleading. For instance, with a project setup like this:

project
└ folder1
  └ package.json
└ folder2
  └ package.json

If we open ~/random/path/package.json, the title bar will show package.json — folder1, which is incorrect. This made more sense previously, when the project only contained a single folder, but now the behavior seems misleading.

In order to provide the most pertinent information, this PR changes the behavior to the following:

  • If the active pane item has a path that is included in a project folder, we show item title — project folder (as is the current behavior)
  • If the active pane item has a path that is NOT included in a project folder, we show item title — path to file (where the path does not include the filename — in the example above, it'd be ~/random/path)
  • If there is no active pane item (i.e., the pane is empty), we simply show untitled

Fixes #5058
Fixes #5585
Fixes #10710

/cc @atom/feedback

BinaryMuse added some commits Dec 20, 2016
@BinaryMuse BinaryMuse Add failing test for incorrect title bar behavior c8865c2
@BinaryMuse BinaryMuse Show full dir to item in title bar if item not in a project folder
e788a19
@BinaryMuse BinaryMuse Fix title bar tests on non-macOS systems
96b7f7f
@maxbrunsfeld
Contributor

Awesome. Thanks for fixing this!

@lee-dohm
Member

Looks good to me! 👍

@BinaryMuse BinaryMuse merged commit 9fb2f45 into master Dec 20, 2016

5 checks passed

ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/appveyor/branch AppVeyor build succeeded
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@BinaryMuse BinaryMuse deleted the mkt-fix-incorrect-title-on-non-project-files branch Dec 20, 2016
@50Wliu 50Wliu referenced this pull request Jan 8, 2017
Closed

Incorrect File Path Displayed in Title Bar #13566

1 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment