Skip to content

Discussing Create PR #620

Closed
Closed

Description

@kieferrm

We just looked again Ashi Krishnan (@queerviolet)'s PR. It's a viable path since it's close to the web UI experience. But it made us think again about how to keep the PR creation experience as close as possible to the VS Code UX. Below is an attempt to capture our discussions starting with restating some goals.

Goal

  • Ensure users don't have to leave the editor to create a PR. (There are steps users have to take today in order to create a PR such as creating a branch, pushing commits to the branch, ensuring that the branch is in a good shape. All of this can be done in the editor today. So, we can start with assuming the same.)
  • Integrate tightly with the markdown editing experience. This is actually not limited to "Create PR" since this is also a challenge for comments in general.
  • Fit in the overall VS Code experience; i.e. maintain the perceived lightweight nature of VS Code.

Proposed Flow for first iteration

  1. User is reponsible creating branch, push branch, nesure branch is in good shape. Just as they are if they use the web UI.

  2. User chooses Create Pull Request from command palette. Same as PR.

  3. This opens the QuickPick with 3 steps and a Create button, and the user fills in the data

    1. Title of the PR
    2. Target repository (dropdown list)
    3. Target branch (dropdown list)

→ This creates the PR on GH.
→ VS Code switches to the same mode as if the user would have checked out a PR, and it opens the Overview page of the PR.

  1. User hits the edit button next to the description of the PR

→ Description switches into edit mode.
→ Text field has an affordance to "maximize/flyout".

  1. User hits the Maximize button.

→ Markdown editor opens on synthesized document (extension is the document provider). Extension listens to all document changes and live updates the draft of the description (same for comments).

  1. User uses the markdown text editor to write the description, they can use the markdown preview to see what the markdown would be rendered.

  2. User closes the markdown editor (or switches back to the Overview page)

→ Description is the same as it was/is on the markdown editor.

  1. User submits/saves draft.

What we need

  • Ensure draft comments are maintained when switching away from the Overview Page. Peng Lyu (@rebornix) is working on this.
  • Ensure we can edit. Rachel Macfarlane (@RMacfarlane) is working on this.
  • QuickPick: The steps show the same information as the current PRs (see below) just in a linear fashion. The same data is needed to create the QuickPick items.
  • Have the "maximize". Not yet taken. Close to what Ashi Krishnan (@queerviolet) experimented with.

image 1

Activity

  1. queerviolet commented on Oct 25, 2018

    @queerviolet
    Contributor

    A previous version of #554 used input boxes; going back to that and making them a quick pick would be straightforward.

    Kai Maetzel (@kieferrm), I liked your idea of leveraging Markdown editing inside VS Code.

    What if the create PR button opened two panels? The first one would just be$repo/.git/PULL_REQUEST.md:

    screen shot 2018-10-25 at 11 58 38 am

    The second would be a pull request preview pane. This should be similar to, but different from, the standard Markdown preview pane. It should look more like a PR, and should render markdown closer to how it appears on GitHub.com. For example, when we add support for cross-referencing PRs, issues, and @-ing users, all those links should appear in the preview as well.

    We can auto-populate PULL_REQUEST.md if it doesn't exist using the heuristics we currently do, and we can use Intellisense to suggest valid branches, repos, and forks.

    I don't love starting the flow with a bunch of modals, mostly because I think it's unnecessary. In the typical case, we can look at the remotes and infer what you want to pull from where. It's two extra keystrokes to accept these defaults, but I think we just don't need those at all. If we guess wrong, the user can still easily edit the markdown frontmatter. Intellisense completions in that space feel better to my coderly mind and fingers.

    Also, having the draft pull request be a file lends a nice solidity to it—we don't have to do anything special to avoid losing a user's work. It's also nicely parallel with how git itself manages commit messages.

    The worst part of this whole experience is having to open up two panels, one for PULL_REQUEST.md and one for the preview, but I suppose this is close enough to the Markdown preview workflow that it's acceptable? I can't really see a way around it, either. I'm down with having an affordance to activate and deactivate the editor panel (and similar affordances on comments), but I think in this case it should start activated. Why make the user click another button to start editing the PR, which they are definitely going to want to do?

  2. queerviolet commented on Oct 25, 2018

    @queerviolet
    Contributor

    Something like this (from exp/create-pr-preview):

    create-pr-markdown-preview-buffer

  3. drguthals commented on Oct 25, 2018

    @drguthals

    👋 We have some thoughts about including the entire Create PR experience in one MD file. I really love the demo that Ashi Krishnan (@queerviolet) created in the comment above this.

    There are some things coming down the GitHub pipeline that I would love to include in PR creation that would be made more difficult if we first created the PR with only a title and the branch/remote set then added the rest. I would prefer adding it all at once, with the description still being optional and editable later.

    💭 ?

  4. kieferrm commented on Oct 26, 2018

    @kieferrm
    MemberAuthor

    Here is a demo Peng Lyu (@rebornix) put together of the flow I described above. It still misses the edit buttons (WIP) and the max/fly out. After the user pressed the flyout, the experience would be quite similar to what @queerviolet shows above. The quick pick right now only shows locally defined remotes and local branches but with the code that the PR already contains it seems we could easily extend this. If the PR does not need a description, we could also provide a short-cut exit, i.e. something that creates the PR but instead of staying on the branch returns to master right away while still informing the user about whether or not the PR creation was successful.

    create-pull-request

  5. kieferrm commented on Oct 26, 2018

    @kieferrm
    MemberAuthor

    Comparing both approaches, I can see pros and cons for both. The one thing that appeals the most to me with the approach I described is uniformity. I.e. when it comes to editing descriptions or long comments I can always use the maximize/fly-out to matter whether I create a PR or review a PR, or respond to a reviewer's comments. I can see us testing both approaches with users.

  6. rebornix commented on Oct 26, 2018

    @rebornix
    Contributor

    Similarly to Ashi Krishnan (@queerviolet) 's demo in #620 (comment), here is what the commenting editor max/flyout looks like

    create-pull-request-md-editor

    Once we have the edit button for description/comment, we can edit them in a normal markdown editor and the content change in the markdown editor is saved to the description page when save (auto save is even better).

  7. drguthals commented on Oct 27, 2018

    @drguthals

    It would be great to test out both with users, I love that idea! We can setup some UXR for early November with these two approaches.

    Thanks for the two gifs 🎉

  8. Ghostbird commented on Jan 22, 2019

    @Ghostbird

    I don't like one thing about #661: It defaults the PR title to the last commit message. However, whenever I make a PR, my last commit is generally not the main commit of the branch, but a clean-up or maintenance commit. Which means that my PRs are almost always created with nonsensical titles.

  9. kieferrm commented on Feb 1, 2019

    @kieferrm
    MemberAuthor

    Gijsbert ter Horst (@Ghostbird) can you pls create a new issue. Thanks!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    under-discussionIssue is under discussion for relevance, priority, approach

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions