|
| 1 | +**_Part 1 - Required information_** |
| 2 | + |
| 3 | +# Identity and Context Tiles |
| 4 | + |
| 5 | +## :memo: Summary |
| 6 | + |
| 7 | +Add a small tile to the top of the Git and GitHub dock items to display and manage contextual information like the currently authenticated user and the active git repository. |
| 8 | + |
| 9 | +## :checkered_flag: Motivation |
| 10 | + |
| 11 | +All of our Git and GitHub actions and displayed information track a "current repository" that follows the path of your active pane item. Historically, this has been a source of confusion for users: |
| 12 | + |
| 13 | +* If you have no changes and are on the default branch in two repositories, there is no visual indication of which repository is the "active" one. _(This has bitten me personally more than once when I create a new branch in the wrong repository by mistake, and I wrote the damn thing.)_ |
| 14 | +* When adding a new project folder, the current repository remains the previous one until you open a file within the new folder. |
| 15 | +* Opening a new file that isn't within a git repository causes the git panel to revert to its "initialize here?" state, which is jarring when you want to make quick external edits. |
| 16 | + |
| 17 | +We also have a host of long-standing issues related to identity management: |
| 18 | + |
| 19 | +* There is no way to configure your git username and email address on first install. This means that a new user who doesn't have git installed on their machine already still needs to do so, even though we bundle a git binary as part of Atom! _(Okay, technically, you can create a `~/.gitconfig` with the appropriate values by hand. That kind of sucks though.)_ [#932](https://github.com/atom/github/issues/932) |
| 20 | +* Our Git item provides no indication of what identity it's going to use to create a new commit. This can cause friction for users who use different email addresses for work and personal projects or who wish to use masked `@noreply` email addresses. |
| 21 | +* Our GitHub item provides no indication of the current GitHub user. While I don't expect that managing multiple GitHub accounts is a common need, it can arise in situations like shared machines. |
| 22 | +* Our GitHub item gives you no way to log out or re-authenticate as a different user. _(You can do it by running `GitHub: Logout` from the command palette, but this is not discoverable.)_ [#1693](https://github.com/atom/github/issues/1693) |
| 23 | + |
| 24 | +And, finally, the mechanism to refresh the GitHub tab with new data is completely hidden. |
| 25 | + |
| 26 | +## 🤯 Explanation |
| 27 | + |
| 28 | +### Git context and identity tile |
| 29 | + |
| 30 | +The Git tab has a _context and identity tile_ at its top that displays: |
| 31 | + |
| 32 | +* The GitHub avatar corresponding to your current git identification, as read by `git config user.email`. If no GitHub account is associated with the configured email address, a placeholder is shown instead. On hover, your full git identification is shown in a tooltip ( _Real Name <[email protected]>_). Clicking your avatar opens the "introduction" view to allow you to change your configuration. |
| 33 | +* The path to the currently active git repository, shortened in a way [consistent with the way project folders appear in tree-view](https://github.com/atom/tree-view/blob/master/lib/tree-view.coffee#L336). If multiple repositories are available, this is a drop-down menu allowing you to change the active repository. |
| 34 | + |
| 35 | +> "Available" repositories are discovered by taking the set of paths from: |
| 36 | +> * Project root folders |
| 37 | +> * Paths of open pane items |
| 38 | +> * `getWorkingDirectoryPath()` results from open github package pane items |
| 39 | +> Then locating the set of git repositories containing each (if any) using `git rev-parse --show-toplevel` and |
| 40 | +> `git rev-parse --absolute-git-dir`. |
| 41 | +
|
| 42 | +> TODO: Git context and identity tile graphic |
| 43 | +
|
| 44 | +### GitHub context and identity tile |
| 45 | + |
| 46 | +The GitHub tab has a _context and identity tile_ at its top that displays: |
| 47 | + |
| 48 | +* The GitHub avatar corresponding to the currently logged-in GitHub user. On hover, the GitHub username is displayed in a tooltip (_@smashwilson_). Clicking your avatar reveals the `GithubLoginView`. |
| 49 | +* The path to the currently active git repository, as in the Git context tile. |
| 50 | +* A refresh button. On click, the information displayed in the GitHub tab is re-fetched. |
| 51 | + |
| 52 | +> TODO: GitHub context and identity tile graphic |
| 53 | +
|
| 54 | +### Git introduction view |
| 55 | + |
| 56 | +If you haven't configured `user.email` and `user.name`, the Git tab displays the _introduction view_. This view allows you to see and enter your name and email address. |
| 57 | + |
| 58 | +> TODO: introduction view graphic |
| 59 | +
|
| 60 | +### GitHub login view |
| 61 | + |
| 62 | +> TODO: GitHub login view |
| 63 | +
|
| 64 | +**_Part 2 - Additional information_** |
| 65 | + |
| 66 | +## :anchor: Drawbacks |
| 67 | + |
| 68 | +This occupies prime vertical graphical real estate in our already-small dock item display area, which users will likely not need to interact with often. |
| 69 | + |
| 70 | +Not all users have GitHub accounts. Displaying a GitHub avatar on the Git tab item may be off-putting. |
| 71 | + |
| 72 | +## :thinking: Rationale and alternatives |
| 73 | + |
| 74 | +_TBD_ |
| 75 | + |
| 76 | +## :question: Unresolved questions |
| 77 | + |
| 78 | +* If only one git repository is available, should we bother rendering it in the drop-down menus, or omit it to save visual noise? |
| 79 | +* Is the avatar-with-tooltip pattern a reasonable compromise to save space? |
| 80 | +* Should we make an attempt to differentiate between multiple git repository paths that share the same basename? |
| 81 | +* Can we detect when a user has configured GitHub's email anonymity and populate their `git user.email` accordingly? |
| 82 | + |
| 83 | +## :warning: Out of Scope |
| 84 | + |
| 85 | +* Configuring different identities for different git repositories. We should read the git user information with `git config`, but always write with `git config --global`. |
| 86 | + |
| 87 | +## :construction: Implementation phases |
| 88 | + |
| 89 | +_TBD_ |
| 90 | + |
| 91 | +## :white_check_mark: Feature description for Atom release blog post |
| 92 | + |
| 93 | +_TBD_ |
| 94 | + |
| 95 | +<!-- |
| 96 | +- When this feature is shipped, what would we like to say or show in our Atom release blog post (example: http://blog.atom.io/2018/07/31/atom-1-29.html) |
| 97 | +- Feel free to drop ideas and gifs here during development |
| 98 | +- Once development is complete, write a blurb for the release coordinator to copy/paste into the Atom release blog |
| 99 | +--> |
0 commit comments