Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

docs: Revise docs on presenting screnshots.

Alya Abbottae316717687f
diff --git a/docs/contributing/design-discussions.md b/docs/contributing/design-discussions.md
index 83ffbf1f0ee..578ad54c64d 100644
--- a/docs/contributing/design-discussions.md
+++ b/docs/contributing/design-discussions.md
@@ -102,8 +102,9 @@ questions you are looking for feedback on. Some advice:
- Post screenshots, and perhaps a short video if there is an interaction that
screenshots fail to show.
- - We maintain [an extensive guide to capturing screenshots](../contributing/presenting-visual-changes.md),
- which you should take the time to read through.
+ - Use the [guide on presenting visual
+ changes](../contributing/presenting-visual-changes.md) for guidance on what to
+ show, and how to capture precise Before/After screenshots when appropriate.
- You may want to post a few screenshots of different options you’re
considering.
@@ -114,9 +115,6 @@ questions you are looking for feedback on. Some advice:
- Screen captures should demonstrate the feature with a minimal amount of
extraneous content.
- - See [here](../contributing/presenting-visual-changes.md#screenshot-and-gif-software)
- for some recommended tools.
-
- Post a clear question or set of questions that you need help with. What
specifically are you looking for feedback on?
diff --git a/docs/contributing/presenting-visual-changes.md b/docs/contributing/presenting-visual-changes.md
index 1d863eeba2d..00556460e49 100644
--- a/docs/contributing/presenting-visual-changes.md
+++ b/docs/contributing/presenting-visual-changes.md
@@ -1,36 +1,76 @@
-# Documenting visual changes
+# Presenting visual changes
+
+If your pull request makes visual changes, or includes refactoring that might
+cause visual changes, you must include screenshots demonstrating the impact of
+your changes in the description for your pull request.
+
+**Always make sure the screenshots in the PR description capture the _current_
+state of the PR.** To avoid confusion, delete outdated screenshots from the
+description. If reviewers need to see multiple variants of the UI to make some
+decision, include those variants in the comments.
+
+## What to capture
+
+Always include screenshots of _all_ the UI components and states affected by
+your PR. For example, a PR that adds a new dropwdown setting would need
+screenshots to demonstrate:
+
+- What the setting looks like in the settings UI (with some surrounding context).
+- The open dropdown.
+- The disabled version of the setting with its accompanying tooltip that would
+ be shown to users who aren't allowed to modify the setting.
+- Visual impact of using each value of the setting (if any).
+- Updated help center documentation (if any); see
+ [note](#presenting-documentation-changes) below.
+
+If you're using standard components, there's no need to go overboard with
+screenshots:
+
+- Show the Before state if it provides helpful context (e.g., if you're changing
+ text on a banner), but otherwise you can skip them (e.g., if you're adding a
+ setting).
+- There's usually no need to show light and dark theme screenshots, or
+ screenshots at different font sizes.
+- There's usually no need to show the keyboard selection UI.
+
+However, if your pull request makes any CSS changes, you'll need to thoroughly
+demonstrate its effects. You will need to **capture precise screenshots**
+demonstrating the differences between the Before and After states, as described
+[below](#capturing-precise-screenshots).
-PRs that touch Zulip's user interface must include precise screenshots
-that document the Before and After states associated with the PR's changes.
-Even if your PR doesn't modify Zulip's CSS, it is commonly the case that
-template adjustments and changes to JavaScript that touch the DOM may cause
-visual changes that must be documented as part of a successful PR. That
-includes demonstrating that your PR introduces no changes whatsoever, which
-is typical with refactoring and other code-quality work.
-
-## Capturing precise screenshots
-
-Precise sets of static screenshots take a little bit of effort to capture, but
-are well worth your time to create, and your reviewers' time too.
+Precise screenshots are necessary not only to document your intended
+changes, but also to demonstrate that there are **no unintended side-effects**
+or visual regressions. In fact, PRs that refactor templates or CSS often need to
+include screenshots to explicitly demonstrate that there are no visual changes.
:::{important}
-**You might ask, "Why can't I just make a video showing my changes?"** The answer is
-that static screenshots are much easier to compare than screencast videos. Whenever
-possible, use still screenshots instead of videos. (If you absolutely must include
-a video, you'll find guidance further down this page for doing so appropriately.)
+Wherever possible, use still screenshots rather than videos.
:::
-Git is, of course, your friend for setting up the UI state for Before and After screenshots: typically the Before shot will be of the `main` branch updated from
-upstream, while the After shot will be of your PR's working branch. Take the time
-to rebase your working branch over the latest `main`, too, before capturing your
-screenshots.
+Static screenshots are much easier to review than screencast videos. Use a video
+only when necessary to demonstrate an interaction, and only to supplement still
+screenshots. Always include screenshots for any aspects of your changes which
+can be seen on a still screenshot. See
+[below](#capturing-and-presenting-short-videos) for how to capture reviewable videos.
+
+For updates or changes to CSS class rules, it's a good practice
+to include the results of a [git-grep][git-grep] search for
+the class name(s) to confirm that you've tested and captured screenshots
+of all the impacted areas of the UI or Zulip documentation.
+
+```console
+$ git grep '.example-class-name' web/templates/ templates/
+templates/corporate/...
+templates/zerver/...
+web/templates/...
+```
-Sometimes you may be asked to present alternative looks to your PR in tandem with a
-discussion on CZO in the [#design](https://chat.zulip.org/#topics/channel/101-design)
-channel, in which case you'll need to walk through different commits on your branch—or
-make judicious use of `git stash` and `git stash pop`.
+Never include screenshots of your code or the GitHub UI, which reviewers can
+easily see directly.
-Precise sets of Before/After screenshots have two essential qualities:
+## What are precise Before/After screenshots?
+
+Precise Before/After screenshots have two essential qualities:
1. **The state of the UI should be identical between screenshots.**
For example, a screenshot of the message feed should have messages scrolled to the
@@ -42,12 +82,38 @@ Precise sets of Before/After screenshots have two essential qualities:
to make sure that there's a pixel-to-pixel correspondence of everything
you've captured onscreen.
-The next sections describe different techniques for capturing pixel-precise
+## What bother with precise Before/After screenshots?
+
+Capturing precise screenshots serves two primary purposes:
+
+1. For you as a contributor, **checking your own screenshots** will help you to
+ catch any regressions on your own, prior to submitting your PR. It'll also
+ help you point out changes or shifts for reviewers to consider, which may
+ require some design discussion.
+2. For reviewers, checking screenshots is a quick way to **verify** that a PR
+ does what's expected, and provide **feedback** on visual changes without
+ pulling down the PR.
+
+## Capturing precise screenshots
+
+This section describes different techniques for producing pixel-precise
screen captures. To master these techniques, you'll likely need to spend some time
working with your capture tools of choice, whether they're part of your browser or
-operating system, or a third-party screen capture tool or browser plugin. You should
-also take the time to read about
-[why precise screenshots matter](#why-precise-screenshots-matter).
+operating system, or a third-party screen capture tool or browser plugin.
+
+### Using Git to get required states
+
+Git is, of course, your friend for setting up the UI state for Before and After
+screenshots: the Before shot will typically be of the `main` branch updated from
+upstream, while the After shot will be of your PR's working branch. Take the time
+to rebase your working branch over the latest `main`, too, before capturing your
+screenshots.
+
+Sometimes you may be asked to present alternative looks to your PR in tandem
+with a discussion [#design](https://chat.zulip.org/#topics/channel/101-design)
+channel in the Zulip development community, in which case you'll need to walk
+through different commits on your branch—or make judicious use of `git stash`
+and `git stash pop`.
### Capturing precise screenshots with your browser
@@ -65,7 +131,7 @@ For example, it's easy to capture a mobile-scale viewport in Firefox like this:
| ![Firefox in responsive design mode](/images/firefox-rwd-capture-mobile.png) | ![Mobile-scale capture from Firefox](/images/firefox-mobile-scale-350x600.png) |
For another example, if you're making changes to the left sidebar, you'll want to open
-the viewport even wider, until the left sidebar is showing:
+the viewport wider, until the left sidebar is showing:
![Firefox in opened wider to show sidebar](/images/firefox-rwd-capture-medium.png)
@@ -105,50 +171,6 @@ the screenshots that you need, you might want to explore [third-party software](
in mind the two qualities your screenshots need to maintain: identical UI state, and
pixel-precise dimensions between Before and After shots.
-### Capturing and presenting short videos
-
-Still screenshots are almost always superior to videos. They are easier to compare, and
-enable reviewers to focus more precisely on the changes your PR introduces.
-
-If you absolutely must show off a brief interaction on your PR, see whether your operating
-system will allow you to again set a fixed box for capturing video of a region of your
-screen.
-
-Be sure to edit your video down to the shortest length possible. And rather
-than post the video—whose format may not be suitable for the web or accessible to all
-reviewers—use a video-to-GIF service like [ezgif.com](https://ezgif.com/video-to-gif)
-to create a looping animation showing off the interaction.
-
-Here, for an example, is a short looping animation from [an actual PR](https://github.com/zulip/zulip/pull/35969)
-that modified some interactions on the compose box:
-
-![Animation showing compose box](/images/general-chat-after.gif)
-
-It's worth noting here that [the full PR](https://github.com/zulip/zulip/pull/35969)
-included plenty of static screenshots in addition to the GIFs showing off interactivity.
-
-Finally, make sure a person watching your video can see where on the screen you're
-tapping or clicking. Use the "show touches" or "include the mouse pointer" feature
-if your screen-recording software supports it.
-
-## Why precise screenshots matter
-
-Precise screenshots are necessary not only to document your intended
-changes, but also to demonstrate that there are no unintended side-effects
-or visual regressions. In fact, PRs that refactor templates or CSS often
-include screenshots to explicitly demonstrate that there are no visual changes.
-
-Capturing precise screenshots serves two primary purposes:
-
-1. For you as a contributor, checking your own screenshots will help you
- to catch any regressions on your own, prior to submitting your PR, or
- to point out changes or shifts for reviewers and possibly further design
- discussion.
-2. For reviewers, checking screenshots is a very quick way to verify that
- a PR does what it intends without the reviewer needing to pull down the
- PR and check it more closely in development (though that is a routine
- part of reviewing as well).
-
### Freehand versus fixed screenshots
It may be tempting to freehand your screenshots, perhaps by using your operating
@@ -200,11 +222,101 @@ As with the fixed-box screenshots above, having pixel-precise screenshots
where the UI is in an identical state and there isn't a bunch of unintended movement
or other noise, the browser captures above make catching the space shift much easier.
+## Capturing and presenting short videos
+
+Still screenshots are almost always superior to videos. They are easier to compare, and
+enable reviewers to focus more precisely on the changes your PR introduces.
+
+If you absolutely must show off a brief interaction on your PR, see whether your operating
+system will allow you to again set a fixed box for capturing video of a region of your
+screen.
+
+Be sure to edit your video down to the shortest length possible. And rather
+than post the video—whose format may not be suitable for the web or accessible to all
+reviewers—use a video-to-GIF service like [ezgif.com](https://ezgif.com/video-to-gif)
+to create a looping animation showing off the interaction.
+
+Here, for an example, is a short looping animation from [an actual PR](https://github.com/zulip/zulip/pull/35969)
+that modified some interactions on the compose box:
+
+![Animation showing compose box](/images/general-chat-after.gif)
+
+It's worth noting here that [the full PR](https://github.com/zulip/zulip/pull/35969)
+included plenty of static screenshots in addition to the GIFs showing off interactivity.
+
+Finally, make sure a person watching your video can see where on the screen you're
+tapping or clicking. Use the "show touches" or "include the mouse pointer" feature
+if your screen-recording software supports it.
+
+## Presenting screenshots on your pull request
+
+Now that you've got all these screenshots, how do you present them in the
+description for your PR?
+
+### Using tables for Before/After comparisons
+
+For presenting Before and After states, use GitHub's table syntax to render
+them side-by-side. Reviewers can open the full-size image from GitHub for quick
+and easy comparison:
+
+```
+### Descriptive header for images:
+
+| Before | After |
+| --- | --- |
+| ![image-before](uploaded-file-information) | ![image-after](uploaded-file-information)
+```
+
+To quickly insert these tables, consider
+[creating a GitHub Saved Reply](https://docs.github.com/en/get-started/writing-on-github/working-with-saved-replies/creating-a-saved-reply).
+
+### Making screenshots collapsible
+
+When including numerous screenshots or screencasts, consider grouping them
+in details/summary tags to reduce visual clutter and the scroll length of
+pull-request descriptions and comments. This is especially useful when you
+have several screenshots or screencasts to include in your PR description
+or follow-up comments, as you can put groups of related images in separate
+details/summary tags.
+
+Do think about your reviewers' comfort when using more than one set of
+details/summary tags, as it is generally much easier to scroll past a
+bunch of screenshots than it is to open numerous collapsed details/summary
+tags.
+
+```
+<details>
+<summary>Descriptive summary of image group</summary>
+
+| Before | After |
+| --- | --- |
+| ![image-before](uploaded-file-information) | ![image-after](uploaded-file-information) |
+| ![image-2-before](uploaded-file-information) | ![image-2-after](uploaded-file-information) |
+
+</details>
+```
+
+### Presenting documentation changes
+
+If you've updated existing documentation in your pull request,
+include a link to the current documentation above the screenshot
+of the updates. That way a reviewer can quickly compare the current
+documentation while reviewing your changes.
+
+```
+[Current documentation](link-to-current-documentation-page)
+![image-after](uploaded-file-information)
+```
+
+[git-grep]: https://git-scm.com/docs/git-grep
+[screenshots-gifs]: ../contributing/presenting-visual-changes.md#screenshot-and-gif-software
+[zulip-dev-community]: https://chat.zulip.org
+[link-to-message]: https://zulip.com/help/link-to-a-message-or-conversation#get-a-link-to-a-specific-message
+[dev-community-linkifiers]: https://zulip.com/development-community/#linking-to-github-issues-and-pull-requests
+
## Screenshot and GIF software
-The following list documents different free and open-source screenshot and GIF-making
-software. We encourage you to make use of these when making front-end pull requests,
-and to suggest tools that you use for inclusion here for the benefit of other contributors.
+You can check out the following tools for capturing screenshots and videos/GIFs.
### Screenshot tools by platform
@@ -230,7 +342,7 @@ and to suggest tools that you use for inclusion here for the benefit of other co
#### Linux
-- gnome-screenshot (inbuilt, you can use Ctrl-Shift-PrtScn as a shortcut for its “select an area to grab” feature)
+- [GNOME Screenshots and screencasts](https://help.gnome.org/gnome-help/screen-shot-record.html)
### GIF tools by platform
@@ -238,7 +350,7 @@ and to suggest tools that you use for inclusion here for the benefit of other co
- [GIPHY](https://giphy.com)
- [Chrome Capture](https://chrome.google.com/webstore/detail/chrome-capture/ggaabchcecdbomdcnbahdfddfikjmphe?hl=en)
- (Tip: Use Alt+i to interact with the page while recording)
+ (Tip: Use `Alt`+`I` to interact with the page while recording)
#### macOS
diff --git a/docs/contributing/reviewable-prs.md b/docs/contributing/reviewable-prs.md
index fc76e2547ac..15cd30f9402 100644
--- a/docs/contributing/reviewable-prs.md
+++ b/docs/contributing/reviewable-prs.md
@@ -14,8 +14,8 @@ step is described in detail below, with links to additional resources:
1. [Organize your proposed changes](#organize-your-proposed-changes) into a
series of commits that tell the story of how the codebase will change.
1. [Explain your changes](#explain-your-changes) in the description for your
- pull request, including [screenshots](#presenting-screenshots-on-your-pull-request)
- for visual changes.
+ pull request, including
+ [screenshots](../contributing/presenting-visual-changes.md) for visual changes.
1. Carefully [review your own work](#review-your-own-work).
1. [Submit your pull request](#submit-your-pull-request-for-review) for review.
@@ -83,8 +83,7 @@ description for your pull request, you will:
The review process will go a lot more smoothly if points of uncertainty are
explicitly laid out.
- Include screenshots for all visual changes, so that they can be reviewed
- without running your code. See [below](#presenting-screenshots-on-your-pull-request)
- for detailed instructions.
+ without running your code. Be sure to follow our [guide on presenting visual changes](../contributing/presenting-visual-changes).
If you have a question about a specific part of your code that you expect to be
resolved during the review process, put it in a PR comment attached to a
@@ -93,6 +92,8 @@ relevant part of the changes.
Take advantage of [GitHub's formatting][github-syntax] to make your pull request
description and comments easy to read.
+[github-syntax]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
+
### Discussions in the development community
Any questions for which broader feedback or visibility is helpful are discussed
@@ -155,82 +156,3 @@ review:
PR.
[github-help-draft-pr]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests#draft-pull-requests
-
-## Presenting screenshots on your pull request
-
-Any PRs that impact Zulip's user interface must include precise sets
-of Before/After screenshots. Be sure to read through
-[our extensive screenshot documentation](../contributing/presenting-visual-changes.md)
-to capture appropriate screenshots. And note that with few exceptions,
-static screenshots are preferable to videos.
-
-The following guidance will help you present your precise screenshots
-as part of your pull request:
-
-- For presenting before and after screencaptures of changes, use
- GithHub's table syntax to render them side-by-side. Reviewers can
- open the full-size image from GitHub for quick and easy comparison:
-
- ```
- ### Descriptive header for images:
-
- | Before | After |
- | --- | --- |
- | ![image-before](uploaded-file-information) | ![image-after](uploaded-file-information)
- ```
-
- To quickly insert before/after tables like that, consider
- [creating a GitHub Saved Reply](https://docs.github.com/en/get-started/writing-on-github/working-with-saved-replies/creating-a-saved-reply).
-
-- When including numerous screenshots or screencasts, consider grouping them
- in details/summary tags to reduce visual clutter and the scroll length of
- pull-request descriptions and comments. This is especially useful when you
- have several screenshots or screencasts to include in your PR description
- or follow-up comments, as you can put groups of related images in separate
- details/summary tags.
-
- Do think about your reviewers' comfort when using more than one set of
- details/summary tags, as it is generally much easier to scroll past a
- bunch of screenshots than it is to open numerous collapsed details/summary
- tags.
-
- ```
- <details>
- <summary>Descriptive summary of image group</summary>
-
- | Before | After |
- | --- | --- |
- | ![image-before](uploaded-file-information) | ![image-after](uploaded-file-information) |
- | ![image-2-before](uploaded-file-information) | ![image-2-after](uploaded-file-information) |
-
- </details>
- ```
-
-- If you've updated existing documentation in your pull request,
- include a link to the current documentation above the screenshot
- of the updates. That way a reviewer can quickly compare the current
- documentation while reviewing your changes.
-
- ```
- [Current documentation](link-to-current-documentation-page)
- ![image-after](uploaded-file-information)
- ```
-
-- For updates or changes to CSS class rules, it's a good practice
- to include the results of a [git-grep][git-grep] search for
- the class name(s) to confirm that you've tested and captured screenshots
- of all the impacted areas of the UI or Zulip documentation.
-
- ```console
- $ git grep '.example-class-name' web/templates/ templates/
- templates/corporate/...
- templates/zerver/...
- web/templates/...
- ```
-
-[github-syntax]: https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax
-[git-grep]: https://git-scm.com/docs/git-grep
-[screenshots-gifs]: ../contributing/presenting-visual-changes.md#screenshot-and-gif-software
-[zulip-dev-community]: https://chat.zulip.org
-[link-to-message]: https://zulip.com/help/link-to-a-message-or-conversation#get-a-link-to-a-specific-message
-[dev-community-linkifiers]: https://zulip.com/development-community/#linking-to-github-issues-and-pull-requests