blob: 802760baa4d923ab7ba769390de4ceb371eb33e9 [file] [log] [blame]
Edwin Kempin4fd84c92014-04-30 13:23:15 +02001= Review UI
2
3Reviewing changes is an important task and the Gerrit Web UI provides
4many functionalities to make the review process comfortable and
5efficient. This is a guide through the review UI that explains the
6different functions and UI elements.
7
8[[change-screen]]
9== Change Screen
10
11The change screen shows the details of a single change and provides
12various actions on it.
13
14image::images/user-review-ui-change-screen.png[width=800, link="images/user-review-ui-change-screen.png"]
15
16[[commit-message]]
17=== Commit Message Block
18
19The focus of the change screen is on the commit message since this is
20the most important information about a change. The numeric change ID
21and the change status are displayed right above the commit message.
22
23image::images/user-review-ui-change-screen-commit-message.png[width=800, link="images/user-review-ui-change-screen-commit-message.png"]
24
25The commit message can be edited directly in the Web UI by clicking on
26the `Edit Message` button in the change header. This opens a drop-down
27editor box in which the commit message can be edited. Saving
28modifications of the commit message automatically creates a new patch
29set for the change. The commit message may only be edited on the
30current patch set.
31
32image::images/user-review-ui-change-screen-edit-commit-message.png[width=800, link="images/user-review-ui-change-screen-edit-commit-message.png"]
33
34The numeric change ID is a link to the change and clicking on it
35refreshes the change screen. By copying the link location you can get
36the permalink of the change.
37
38image::images/user-review-ui-change-screen-permalink.png[width=800, link="images/user-review-ui-change-screen-permalink.png"]
39
40The change status shows the state of the change:
41
42- `Needs <label>`:
43+
44The change is in review and an approval on the shown label is still
45required to make the change submittable.
46
47- `Not <label>`:
48+
49The change is in review and a veto vote on the shown label is
50preventing the submit.
51
Edwin Kempinb2a8ae32014-05-02 15:03:22 +020052[[not-current]]
Edwin Kempin4fd84c92014-04-30 13:23:15 +020053- `Not Current`:
54+
55The currently viewed patch set is outdated.
56+
57Please note that some operations, like voting, are not available on
58outdated patch sets, but only on the current patch set.
59
60- `Ready to Submit`:
61+
62The change has all necessary approvals and may be submitted.
63
64- `Submitted, Merge Pending`:
65+
66The change was submitted and was added to the merge queue.
67+
68The change stays in the merge queue if it depends on a change that is
69still in review. In this case it will get automatically merged when all
70predecessor changes have been merged.
71+
72This status can also mean that the change depends on an abandoned
73change or on an outdated patch set of another change. In this case you
74may want to rebase the change.
75
76- `Merged`:
77+
78The change was successfully merged into the destination branch.
79
80- `Abandoned`:
81+
82The change was abandoned.
83
84- `Draft`:
85+
86The change is a draft that is only visible to the change owner, the
87reviewers that were explicitly added to the change, and users who have
88the link:access-control.html#category_view_drafts[View Drafts] global
89capability assigned.
90
91[[commit-info]]
92=== Commit Info Block
93
94The commit info block shows information about the commit of the
95currently viewed patch set.
96
97It displays the author and the committer as links to a list of this
98person's changes that have the same status as the currently viewed
99change.
100
101The commit ID and the link:user-changeid.html[Change-Id] are both
102displayed with a copy-to-clipboard icon that allows the ID to be copied
103into the clipboard.
104
105If a Git web browser, such as GitWeb or Gitiles, is configured, there
106is also a link to the commit in the Git web browser.
107
108image::images/user-review-ui-change-screen-commit-info.png[width=800, link="images/user-review-ui-change-screen-commit-info.png"]
109
Edwin Kempinf1a84f92014-04-30 15:37:48 +0200110[[change-info]]
111=== Change Info Block
112
113The change info block contains detailed information about the change
114and offers actions on the change.
115
116image::images/user-review-ui-change-screen-change-info.png[width=800, link="images/user-review-ui-change-screen-change-info.png"]
117
118- Change Owner:
119+
120The owner of the change is displayed as a link to a list of the owner's
121changes that have the same status as the currently viewed change.
122+
123image::images/user-review-ui-change-screen-change-info-owner.png[width=800, link="images/user-review-ui-change-screen-change-info-owner.png"]
124
125- Reviewers:
126+
127The reviewers of the change are displayed as chip tokens.
128+
129For each reviewer there is a tooltip that shows on which labels the
130reviewer is allowed to vote.
131+
132New reviewers can be added by clicking on the `Add...` button. Typing
133into the pop-up text field activates auto completion of user and group
134names.
135+
136Reviewers can be removed from the change by clicking on the `x` icon
137in the reviewer's chip token. Removing a reviewer also removes the
138current votes of the reviewer. The removal of votes is recorded as a
139message on the change.
140+
141Removing reviewers is protected by permissions:
142
143** Users can always remove themselves.
144** The change owner may remove any zero or positive score.
145** Users with the link:access-control.html#category_remove_reviewer[
146 Remove Reviewer] access right, the branch owner, the project owner
147 and Gerrit administrators may remove anyone.
148
149+
150image::images/user-review-ui-change-screen-change-info-reviewers.png[width=800, link="images/user-review-ui-change-screen-change-info-reviewers.png"]
151
152- Project / Branch / Topic:
153+
154The name of the project for which the change was done is displayed as a
155link to the link:user-dashboards.html#project-default-dashboard[default
156dashboard] of the project. If no default dashboard is defined, the link
157opens a list of open changes on the project.
158+
159Clicking on the settings icon on the right side navigates to the
160project administration screen.
161+
162The name of the destination branch is displayed as a link to a list
163with all changes on this branch that have the same status as the
164currently viewed change.
165+
166If a topic was assigned to the change it is displayed below the branch.
167By clicking on the edit icon the topic can be set. This requires the
168link:access-control.html#category_edit_topic_name[Edit Topic Name]
169access right. To be able to set a topic on a closed change, the
170`Edit Topic Name` must be assigned with the `force` flag.
171+
172image::images/user-review-ui-change-screen-change-info-project-branch-topic.png[width=800, link="images/user-review-ui-change-screen-change-info-project-branch-topic.png"]
173
174- Submit Strategy:
175+
176The link:project-setup.html#submit_type[submit strategy] that will be
177used to submit the change. The submit strategy is only displayed for
178open changes.
179+
180image::images/user-review-ui-change-screen-change-info-submit-strategy.png[width=800, link="images/user-review-ui-change-screen-change-info-submit-strategy.png"]
181+
182If a change cannot be merged due to path conflicts this is highlighted
183by a bold red `Cannot Merge` label.
184+
185image::images/user-review-ui-change-screen-change-info-cannot-merge.png[width=800, link="images/user-review-ui-change-screen-change-info-cannot-merge.png"]
186
187- Time of Last Update:
188+
189image::images/user-review-ui-change-screen-change-info-last-update.png[width=800, link="images/user-review-ui-change-screen-change-info-last-update.png"]
190
191- Actions:
192+
193Depending on the change state and the permissions of the user, different
194actions are available on the change:
195
David Pursehouse53b1bd02014-05-09 11:18:08 +0900196** `Submit`:
Edwin Kempinf1a84f92014-04-30 15:37:48 +0200197+
198Submits the change and adds it to the merge queue. If possible the
199change is merged into the destination branch.
200+
David Pursehouse53b1bd02014-05-09 11:18:08 +0900201The `Submit` button is available if the change is submittable and
Edwin Kempinf1a84f92014-04-30 15:37:48 +0200202the link:access-control.html#category_submit[Submit] access right is
203assigned.
204+
205It is also possible to submit changes that have merge conflicts. This
206allows to do the conflict resolution for a change series in a single
207merge commit and submit the changes in reverse order.
208
209** `Abandon`:
210+
211Abandons the change.
212+
213The `Abandon` button is only available if the change is open and the
214link:access-control.html#category_abandon[Abandon] access right is
215assigned.
216+
217When a change is abandoned, a panel appears that allows one to type a
218comment message to explain why the change is being abandoned.
219
220** `Restore`:
221+
222Restores the change.
223+
224The `Restore` button is only available if the change is abandoned and
225the link:access-control.html#category_abandon[Abandon] and the
226link:access-control.html#category_push[Push] access right is
227assigned.
228+
229When a change is restored, a panel appears that allows one to type a
230comment message to explain why the change is being restored.
231
232** `Rebase`:
233+
234Rebases the change. The rebase is always done with content merge
235enabled. If the rebase is successful a new patch set with the rebased
236commit is created. If the rebase fails, there are conflicts that have
237to be resolved manually.
238+
239If the change does not depend on another open change, it is rebased
240onto the tip of the destination branch.
241+
242If the change depends on another open change, it is rebased onto the
243current patch set of that other change.
244+
245The `Rebase` button is only available if the change can be rebased and
246the link:access-control.html#category_rebase[Rebase] access right is
247assigned. Rebasing merge commits is not supported.
248
249** `Cherry-Pick`:
250+
251Allows to cherry-pick the change to another branch. The destination
252branch can be selected from a dialog. Cherry-picking a change creates a
253new open change on the selected destination branch.
254+
255It is also possible to cherry-pick a change to the same branch. This is
256effectively the same as rebasing it to the current tip of the
257destination branch. This can be used to remove dependencies on other
258open changes.
259+
260Users can only cherry-pick changes to branches for which they are
261allowed to upload changes for review.
262
263** `Publish`:
264+
265Publishes the currently viewed draft patch set. If this is the first
266patch set of a change that is published, the change will be published
267as well.
268+
269The `Publish` button is only available if a draft patch set is viewed
270and the user is the change owner or has the
271link:access-control.html#category_publish_drafts[Publish Drafts] access
272right assigned.
273
274** `Delete Change` / `Delete Revision`:
275+
276Deletes the draft change / the currently viewed draft patch set.
277+
278The `Delete Change` / `Delete Revision` buttons are only available if a
279draft patch set is viewed and the user is the change owner or has the
280link:access-control.html#category_delete_drafts[Delete Drafts] access
281right assigned.
282
283** Further actions may be available if plugins are installed.
284
285+
286image::images/user-review-ui-change-screen-change-info-actions.png[width=800, link="images/user-review-ui-change-screen-change-info-actions.png"]
287
288- Labels & Votes:
289+
290Approving votes are colored green; veto votes are colored red.
291+
292image::images/user-review-ui-change-screen-change-info-labels.png[width=800, link="images/user-review-ui-change-screen-change-info-labels.png"]
293
Edwin Kempinab777f12014-05-02 11:47:57 +0200294[[files]]
295=== File List
296
297The file list shows the files that are modified in the currently viewed
298patch set.
299
300image::images/user-review-ui-change-screen-file-list.png[width=800, link="images/user-review-ui-change-screen-file-list.png"]
301
302The checkboxes in front of the file names allow files to be marked as reviewed.
303
304image::images/user-review-ui-change-screen-file-list-mark-as-reviewed.png[width=800, link="images/user-review-ui-change-screen-file-list-mark-as-reviewed.png"]
305
306The type of a file modification is indicated by the character in front
307of the file name:
308
309- 'no character' (Modified):
310+
311The file existed before this change and is modified.
312
313- `A` (Added):
314+
315The file is newly added.
316
317- `D` (Deleted):
318+
319The file is deleted.
320
321- `R` (Renamed):
322+
323The file is renamed.
324
325- `C` (Copied):
326+
327The file is new and is copied from an existing file.
328
329image::images/user-review-ui-change-screen-file-list-modification-type.png[width=800, link="images/user-review-ui-change-screen-file-list-modification-type.png"]
330
331If a file is renamed or copied, the name of the original file is
332displayed in gray below the file name.
333
334image::images/user-review-ui-change-screen-file-list-rename.png[width=800, link="images/user-review-ui-change-screen-file-list-rename.png"]
335
336Repeating path segments are grayed out.
337
338image::images/user-review-ui-change-screen-file-list-repeating-paths.png[width=800, link="images/user-review-ui-change-screen-file-list-repeating-paths.png"]
339
340Inline comments on a file are shown in the `Comments` column.
341
342Draft comments, i.e. comments that have been written by the current
343user but not yet published, are highlighted in red.
344
345New comments from other users, that were published after the current
346user last reviewed this change, are highlighted in bold.
347
348image::images/user-review-ui-change-screen-file-list-comments.png[width=800, link="images/user-review-ui-change-screen-file-list-comments.png"]
349
350The size of the modifications in the files can be seen in the `Size`
351column. The footer row shows the total size of the change.
352
353For files, the `Size` column shows the sum of inserted and deleted
354lines as one number. For the total size, inserted and deleted lines are
355shown separately. In addition, the number of insertions and deletions
356is shown as a bar. The size of the bar indicates the amount of changed
357lines, and its coloring in green and red shows the proportion of
358insertions to deletions.
359
360The size information is useful to easily spot the files that contain
361the most modifications; these files are likely to be the most relevant
362files for this change. The total change size gives an estimate of how
363long a review of this change may take.
364
365image::images/user-review-ui-change-screen-file-list-size.png[width=800, link="images/user-review-ui-change-screen-file-list-size.png"]
366
367In the header of the file list, the `Diff Against` selection can be
368changed. This selection allows one to choose if the currently viewed
369patch set should be compared against its base or against another patch
370set of this change. The file list is updated accordingly.
371
372The file list header also provides an `Open All` button that opens the
373diff views for all files in the file list.
374
375image::images/user-review-ui-change-screen-file-list-header.png[width=800, link="images/user-review-ui-change-screen-file-list-header.png"]
376
Edwin Kempinb2a8ae32014-05-02 15:03:22 +0200377[[patch-sets]]
378=== Patch Sets
379
380The change screen only presents one patch set at a time. Which patch
381set is currently viewed can be seen from the `Patch Sets` drop-down
382panel in the change header. It shows the number of the currently viewed
383patch set and the total number of patch sets, in the form: "current
384patch set/number of patch sets".
385
386If a non-current patch set is viewed this is indicated by the
387link:#not-current[Not Current] change state. Please note that some
388operations are only available on the current patch set.
389
390image::images/user-review-ui-change-screen-patch-sets.png[width=800, link="images/user-review-ui-change-screen-patch-sets.png"]
391
392The patch set drop-down list shows the list of patch sets and allows to
393switch between them. The patch sets are sorted in descending order so
394that the current patch set is always on top.
395
396Patch sets that have unpublished draft comments are marked by a comment
397icon.
398
399Draft patch sets are marked with `DRAFT`.
400
401image::images/user-review-ui-change-screen-patch-set-list.png[width=800, link="images/user-review-ui-change-screen-patch-set-list.png"]
402
Edwin Kempin0cb1ccb2014-05-05 13:22:03 +0200403[[download]]
404=== Download
405
406The `Download` drop-down panel in the change header offers commands and
407links for downloading the currently viewed patch set.
408
409image::images/user-review-ui-change-screen-download-commands.png[width=800, link="images/user-review-ui-change-screen-download-commands.png"]
410
411The available download commands depend on the installed Gerrit plugins.
412The most popular plugin for download commands, the
413link:https://gerrit-review.googlesource.com/#/admin/projects/plugins/download-commands[
414download-commands] plugin, provides commands to checkout, pull and
415cherry-pick a patch set.
416
417Each command has a copy-to-clipboard icon that allows the command to be
418copied into the clipboard. This makes it easy to paste and execute the
419command on a Git command line.
420
421If several download schemes are configured on the server (e.g. SSH and
422HTTP) there is a drop-down list to switch between the download schemes.
423Gerrit automatically remembers the download scheme that was last chosen
424and selects this download scheme the next time the download commands
425drop-down panel is opened.
426
427The `Patch-File` links provide the Git patch file for the currently
428viewed patch set for download. The patch file can be base64 encoded or
429zipped.
430
431The `Archive` links allow one to download an archive with the contents
432of the currently viewed patch set. The archive is offered in several
433formats (e.g. tar and tbz2); which formats are available depends on the
434configuration of the server.
435
436image::images/user-review-ui-change-screen-download-commands-list.png[width=800, link="images/user-review-ui-change-screen-download-commands-list.png"]
437
Edwin Kempin811bd582014-05-05 13:39:24 +0200438[[included-in]]
439=== Included In
440
441For merged changes the `Included In` drop-down panel is available in
442the change header.
443
444image::images/user-review-ui-change-screen-included-in.png[width=800, link="images/user-review-ui-change-screen-included-in.png"]
445
446The `Included In` drop-down panel shows the branches and tags in which
447the change is included. E.g. if a change fixes a bug, this allows to
448quickly see in which released versions the bug-fix is contained
449(assuming that every release is tagged).
450
451image::images/user-review-ui-change-screen-included-in-list.png[width=800, link="images/user-review-ui-change-screen-included-in-list.png"]
452
Edwin Kempin981cc952014-05-05 14:04:08 +0200453[[star]]
454=== Star Change
455
456The star icon in the change header allows to mark the change as a
457favorite. Clicking on the star icon again, unstars the change.
458
459image::images/user-review-ui-change-screen-star.png[width=800, link="images/user-review-ui-change-screen-star.png"]
460
461Starring a change turns on email notifications for this change.
462
463Starred changed are listed under `My` > `Starred Changes`.
464and can be queried by the link:user-search.html#is[is:starred] search
465operator.
466
Edwin Kempin8ab5b532014-05-05 17:10:31 +0200467[[related-changes]]
468=== Related Changes
469
470If there are changes that are related to the currently viewed change
471they are displayed in the third column of the change screen.
472
473There are several lists of related changes and a tab control is used to
474display each list of related changes in its own tab.
475
476The following tabs may be displayed:
477
478[[related-changes-tab]]
479- `Related Changes`:
480+
481This tab page shows changes on which the current change depends
482(ancestors) and open changes that depend on the current change
483(descendants). For merge commits it also shows the closed changes that
484will be merged into the destination branch by submitting the merge
485commit.
486+
487The changes are sorted in the same way as the output of 'git log'. This
488means the relationship between the changes can be inferred from the
489position of the changes in the list. Changes listed above the current
490change are descendants; changes below the current change are ancestors.
491+
Edwin Kempin68cfe472014-05-12 15:10:25 +0200492For merged changes this tab is only shown if there are open
493descendants.
Edwin Kempin8ab5b532014-05-05 17:10:31 +0200494+
495image::images/user-review-ui-change-screen-related-changes.png[width=800, link="images/user-review-ui-change-screen-related-changes.png"]
496+
497Related changes may be decorated with an icon to signify dependencies
498on outdated patch sets, or commits that are not associated to changes
499under review:
500+
501** Orange Dot:
502+
503The selected patch set of the change is outdated; it is not the current
504patch set of the change.
505+
506If an ancestor change is marked with an orange dot it means that the
507currently viewed patch set depends on a outdated patch set of the
508ancestor change. This is because a new patch set for the ancestor
509change was uploaded in the meantime and as result the currently viewed
510patch set now needs to be rebased.
511+
512If a descendant change is marked with an orange dot it means that an
513old patch set of the descendant change depends on the currently viewed
514patch set. It may be that the descendant was rebased in the meantime
515and with the new patch set this dependency was removed.
516
517** Green Tilde:
518+
519The selected patch set of the change is an indirect descendant of the
520currently viewed patch set; it has a dependency to another patch set of
521this change. E.g. this could mean that a new patch set was uploaded for
522this change and the descendant change now needs to be rebased. Please
523note that following the link to an indirect descendant change may
524result in a completely different related changes listing.
525
526** Black Dot:
527+
528Indicates a merged ancestor, e.g. the commit was directly pushed into
529the repository bypassing code review, or the ancestor change was
530reviewed and submitted on another branch. The latter may indicate that
531the user has accidentally pushed the commit to the wrong branch, e.g.
532the commit was done on `branch-a`, but was then pushed to
533`refs/for/branch-b`.
534
535+
536image::images/user-review-ui-change-screen-related-changes-indicators.png[width=800, link="images/user-review-ui-change-screen-related-changes-indicators.png"]
537
538- `Conflicts With`:
539+
540This tab page shows changes that conflict with the current change.
541Non-mergeable changes are filtered out; only conflicting changes that
542are mergeable are shown.
543+
544If this change is merged, its conflicting changes will have merge
545conflicts and must be rebased. The rebase of the other changes with the
546conflict resolution must then be done manually.
547+
548image::images/user-review-ui-change-screen-conflicts-with.png[width=800, link="images/user-review-ui-change-screen-conflicts-with.png"]
549
550- `Same Topic`:
551+
552This tab page shows changes that have the same topic as the current
553change. Only open changes are included in the list.
554+
555image::images/user-review-ui-change-screen-same-topic.png[width=800, link="images/user-review-ui-change-screen-same-topic.png"]
556
557- `Cherry-Picks`:
558+
559This tab page shows changes with the same link:user-changeid.html[
560Change-Id] for the current project.
561+
562Abandoned changes are filtered out.
563+
564For each change in this list the destination branch is shown as a
565prefix in front of the change subject.
566+
567image::images/user-review-ui-change-screen-cherry-picks.png[width=800, link="images/user-review-ui-change-screen-cherry-picks.png"]
568
569If there are no related changes for a tab, the tab is not displayed.
570
Edwin Kempinc6cab612014-05-06 11:09:05 +0200571[[reply]]
572=== Reply
573
574The `Reply...` button in the change header allows to reply to the
575currently viewed patch set; one can add a summary comment, publish
576inline draft comments, and vote on the labels.
577
578image::images/user-review-ui-change-screen-reply.png[width=800, link="images/user-review-ui-change-screen-reply.png"]
579
580Clicking on the `Reply...` button opens a popup panel.
581
582A text box allows to type a summary comment for the currently viewed
583patch set.
584
585If the current patch set is viewed, radio buttons are displayed for
586each label on which the user is allowed to vote. Voting on non-current
587patch sets is not possible.
588
589Typing "LGTM" (acronym for 'Looks Good To Me') in the summary comment
590text box automatically selects the highest possible score for the
591'Code-Review' label.
592
593The inline draft comments that will be published are displayed in a
594separate section so that they can be reviewed before publishing. There
595are links to navigate to the inline comments which can be used if a
596comment needs to be edited.
597
598The `Post` button publishes the comments and the votes.
599
600The `send email` checkbox controls whether the reply should trigger
601email notifications for other users. Deselecting the checkbox means
602that there will be no email notification about the change update to the
603change author, the reviewers or any other user.
604
605image::images/user-review-ui-change-screen-replying.png[width=800, link="images/user-review-ui-change-screen-replying.png"]
606
607If a user can approve a label that is still required, a quick approve
608button appears in the change header that allows to add this missing
609approval by a single click. The quick approve button only appears if
610there is a single label that is still required and can be approved by
611the user.
612
613E.g. if a change requires approvals on the 'Code-Review' and the
614'Verified' labels, and there is already a '+1 Verified' vote, then
615if the user is allowed to vote the max score on 'Code-Review', a
616`Code-Review+2` quick approve button appears that approves the
617'Code-Review' label if clicked.
618
619Using the quick approve button also publishes all inline draft
620comments; a summary comment is only added if the reply popup panel is
621open when the quick approve button is clicked.
622
623image::images/user-review-ui-change-screen-quick-approve.png[width=800, link="images/user-review-ui-change-screen-quick-approve.png"]
624
Edwin Kempin7a682812014-05-06 14:45:01 +0200625[[history]]
626=== History
627
628The history of the change can be seen in the lower part of the screen.
629
630The history contains messages for all kinds of change updates, e.g. a
631message is added when a new patch set is uploaded or when a review was
632done.
633
634Messages with new comments from other users, that were published after
635the current user last reviewed this change, are automatically expanded.
636
637image::images/user-review-ui-change-screen-history.png[width=800, link="images/user-review-ui-change-screen-history.png"]
638
639It is possible to directly reply to a change message by clicking on the
640reply icon in the right upper corner of a change message. This opens
641the reply popup panel and prefills the text box with the quoted comment.
642Then the reply can be written below the quoted comment or inserted
643inline. Lines starting with " > " will be rendered as a block quote.
644Please note that for a correct rendering it is important to leave a blank
645line between a quoted block and the reply to it.
646
647image::images/user-review-ui-change-screen-reply-to-comment.png[width=800, link="images/user-review-ui-change-screen-reply-to-comment.png"]
648
649Inline comments are directly displayed in the change history and there
650are links to navigate to the inline comments.
651
652image::images/user-review-ui-change-screen-inline-comments.png[width=800, link="images/user-review-ui-change-screen-inline-comments.png"]
653
654The `Expand All` button expands all messages; the `Collapse All` button
655collapses all messages.
656
Edwin Kempin772418f2014-05-06 15:45:35 +0200657[[update-notification]]
658=== Update Notification
659
660The change screen automatically polls for updates to the currently
661viewed change. If there is an update the user is informed by a popup
662panel in the bottom right corner.
663
664The polling frequency depends on the server configuration; by default
665it is 30 seconds. Polling may also be completely disabled by the
666administrator.
667
668image::images/user-review-ui-change-screen-change-update.png[width=800, link="images/user-review-ui-change-screen-change-update.png"]
669
Edwin Kempin41d9d302014-05-06 16:02:06 +0200670[[plugin-extensions]]
671=== Plugin Extensions
672
673Gerrit plugins may extend the change screen; they can add buttons for
674additional actions to the change info block and display arbitrary UI
675controls below the change info block.
676
677image::images/user-review-ui-change-screen-plugin-extensions.png[width=800, link="images/user-review-ui-change-screen-plugin-extensions.png"]
678
Edwin Kempinae57e182014-04-30 13:38:55 +0200679[[old-change-screen]]
680=== Old Change Screen
681
682In addition to the normal change screen, this Gerrit version still
683includes the old change screen that was used in earlier Gerrit
684versions. Users that want to continue using the old change screen can
685configure it in their preferences under
686`Settings` > `Preferences` > `Change View`:
687
688image::images/user-review-ui-change-view-preference.png[width=800, link="images/user-review-ui-change-view-preference.png"]
689
690[WARNING]
691The old change screen will be removed in a later version of Gerrit.
692
Edwin Kempind38ddf52014-05-07 14:31:42 +0200693[[side-by-side]]
694== Side-by-Side Diff Screen
695
696The side-by-side diff screen shows a single patch; the old file version
697is displayed on the left side of the screen; the new file version is
698displayed on the right side of the screen.
699
700This screen allows to review a patch and to comment on it.
701
702image::images/user-review-ui-side-by-side-diff-screen.png[width=800, link="images/user-review-ui-side-by-side-diff-screen.png"]
703
704In the screen header the project name and the name of the viewed patch
705file are shown.
706
707If a Git web browser is configured on the server, the project name and
708the file path are displayed as links to the project and the folder in
709the Git web browser.
710
711image::images/user-review-ui-side-by-side-diff-screen-project-and-file.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-project-and-file.png"]
712
713The checkbox in front of the project name and the file name allows the
Edwin Kempinfe8ca4c2014-05-08 16:49:15 +0200714patch to be marked as reviewed. The link:#mark-reviewed[Mark Reviewed]
715diff preference allows to control whether the files should be
716automatically marked as reviewed when they are viewed.
Edwin Kempind38ddf52014-05-07 14:31:42 +0200717
718image::images/user-review-ui-side-by-side-diff-screen-reviewed.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-reviewed.png"]
719
Edwin Kempind38ddf52014-05-07 14:31:42 +0200720The scrollbar shows patch diffs and inline comments as annotations.
721This provides a good overview of the lines in the patch that are
722relevant for reviewing. By clicking on an annotation one can quickly
723navigate to the corresponding line in the patch.
724
725image::images/user-review-ui-side-by-side-diff-screen-scrollbar.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-scrollbar.png"]
726
Edwin Kempin1266ac8f2014-05-09 09:39:31 +0200727A gap between lines in the file content that is caused by aligning the
728left and right side or by displaying inline comments is shown as a
729vertical red bar in the line number column. This prevents a gap from
730being mistaken for blank lines in the file
731
732image::images/user-review-ui-side-by-side-diff-screen-red-bar.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-red-bar.png"]
733
Edwin Kempind8057e52014-05-08 13:52:32 +0200734[[patch-set-selection]]
735In the header, on each side, the list of patch sets is shown. Clicking
736on a patch set changes the selection for the patch set comparison and
737the screen is refreshed to show the diff between the selected patch
738sets. The currently selected patch set is highlighted by a light blue
739background.
740
741On the left side `Base` can be selected to compare a patch set against
742its base. For merge commits `Auto Merge` is available instead which
743allows to compare the patch against the result of the auto merge. The
744auto merge version may contain Git conflict markers and is useful for
745reviewing how conflicts are resolved by a patch.
746
747Reviewers that are reviewing a patch for the first time look at its
748diff against its base; reviewers that have reviewed an old patch
749version before, may see what has changed since that version by
750comparing the old patch against the current patch.
751
752image::images/user-review-ui-side-by-side-diff-screen-patch-sets.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-patch-sets.png"]
753
Edwin Kempin01280cc2014-05-09 09:53:30 +0200754If the compared patches are identical, this is highlighted by a red
755`No Differences` label in the screen header.
756
757image::images/user-review-ui-side-by-side-diff-screen-no-differences.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-no-differences.png"]
758
Edwin Kempind8057e52014-05-08 13:52:32 +0200759The download icon next to the patch set list allows to download the
760patch. Unless the mime type of the file is configured as safe, the
761download file is a zip archive that contains the patch file.
762
Edwin Kempind37a1342014-05-08 14:02:35 +0200763For navigating between the patches in a patch set there are navigation
764buttons on the right side of the screen header. The left arrow button
765navigates to the previous patch; the right arrow button navigates to
766the next patch. The arrow up button leads back to the change screen. In
767all cases the selection for the patch set comparison is kept.
768
769image::images/user-review-ui-side-by-side-diff-screen-navigation.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-navigation.png"]
770
Edwin Kempin004c3472014-05-07 16:56:59 +0200771[[inline-comments]]
772=== Inline Comments
773
774Inline comments are displayed directly in the patch file under the code
775that is commented. Inline comments can be placed on lines or on code
776blocks.
777
778If an inline comment relates to a code block, this code block is
779highlighted by a yellow background.
780
781Code blocks with comments may overlap. This means it is possible to
782attach several comments to the same code.
783
784The lines of the patch file are linkable. To link to a certain line in
785the patch file, '@<line-number>' must be appended to the patch link,
786e.g. `http://host:8080/#/c/56857/2/Documentation/user-review-ui.txt@665`.
787To link to a line in the old file version, '@a<line-number>' must be
788appended to the patch link. These links can be used to directly link to
789certain inline comments.
790
Edwin Kempinfe8ca4c2014-05-08 16:49:15 +0200791If the diff preference link:#expand-all-comments[Expand All Comments]
792is set to `Expand`, all inline comments will be automatically expanded.
Edwin Kempin004c3472014-05-07 16:56:59 +0200793
794image::images/user-review-ui-side-by-side-diff-screen-inline-comments.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-inline-comments.png"]
795
796In the header of the comment box, the name of the comment author and
797the timestamp of the comment are shown. If avatars are configured on
798the server, the avatar image of the comment author is displayed in the
799top left corner. Below the actual comment there are buttons to reply to
800the comment.
801
802image::images/user-review-ui-side-by-side-diff-screen-comment-box.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-comment-box.png"]
803
804Clicking on the `Reply` button opens an editor to type the reply.
805
806Quoting is supported, but only by manually copying & pasting the old
807comment that should be quoted and prefixing every line by " > ". Please
808note that for a correct rendering it is important to leave a blank line
809between a quoted block and the reply to it.
810
811Clicking on the `Save` button saves the comment as a draft. To make it
812visible to other users it must be published from the change screen by
813link:#reply[replying] to the change.
814
815The `Cancel` button cancels the editing and discards any changes to the
816draft comment.
817
818Clicking on the `Discard` button deletes the inline draft comment.
819
820image::images/user-review-ui-side-by-side-diff-screen-comment-reply.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-comment-reply.png"]
821
822Draft comments are marked by the text "Draft" in the header in the
823place of the comment author.
824
825A draft comment can be edited by clicking on the `Edit` button, or
826deleted by clicking on the `Discard` button.
827
828image::images/user-review-ui-side-by-side-diff-screen-comment-edit.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-comment-edit.png"]
829
830Clicking on the `Done` button is a quick way to reply with "Done" to a
831comment. This is used to mark a comment as addressed by a follow-up
832patch set.
833
Edwin Kempin44606652014-05-09 08:31:05 +0200834image::images/user-review-ui-side-by-side-diff-screen-replied-done.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-replied-done.png"]
Edwin Kempin004c3472014-05-07 16:56:59 +0200835
836[[add-inline-comment]]
837To add a new inline comment there are several possibilities:
838
839- select a code block and press 'c'
840- select a code block and click on the popup comment icon
Edwin Kempin7feeb952014-05-09 11:16:56 +0200841- go to a line, by clicking on it or by link:#key-navigation[key
842 navigation], and press 'c'
Edwin Kempin004c3472014-05-07 16:56:59 +0200843- click on a line number
844
845There are many ways to select code for commenting on it. The most
846frequently used methods are:
847
848- by mouse:
849** click and drag with the mouse to select a block
850** double-click on a word to select it
851** double-click and drag with the mouse to select a code block word-wise
852** triple-click on a line to select it
853** triple-click and drag with the mouse to select a code block line-wise
854
855- by keys (the same keys that are used for visual selection in Vim):
856** press 'v' + arrow keys (or 'h', 'j', 'k', 'l') to select a block
857** press 'V' + arrow keys (or 'j', 'k') to select a code block line-wise
858** type 'bvw' to select a word
859
Edwin Kempin004c3472014-05-07 16:56:59 +0200860image::images/user-review-ui-side-by-side-diff-screen-comment.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-comment.png"]
861
862For typing the new comment, a new comment box is shown under the code
863that is commented.
864
865Clicking on the `Save` button saves the new comment as a draft. To make
866it visible to other users it must be published from the change screen
867by link:#reply[replying] to the change.
868
869Clicking on the `Discard` button deletes the new comment.
870
871image::images/user-review-ui-side-by-side-diff-screen-commented.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-commented.png"]
872
Edwin Kempin9df27ac2014-05-08 13:06:18 +0200873[[file-level-comments]]
874=== File Level Comments
875
876Comments that apply to a whole file can be added on file level.
877
878File level comments are added by clicking on the comment icon in the
879header above the file.
880
881image::images/user-review-ui-side-by-side-diff-screen-file-level-comment.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-file-level-comment.png"]
882
883Clicking on the comment icon opens a comment box for typing the file
884level comment.
885
886image::images/user-review-ui-side-by-side-diff-screen-file-level-commented.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-file-level-commented.png"]
887
Edwin Kempin6113a1f2014-05-09 10:48:34 +0200888[[search]]
889=== Search
890
891For searching within a patch file, a Vim-like search is supported.
892Typing `/` opens the search box. Typing in the search box immediately
893highlights matches in the patch file with a yellow background. Using
894JavaScript regular expressions in the search term is supported. The
895search is case insensitive. After confirming the search by `ENTER` one
896can navigate between the matches by `n` / `N` to go to the next /
897previous match. Skipped lines are automatically expanded if they
898contain a match and one navigates to it.
899
900For additional possibilities to search please check the
901link:http://www.vim.org/docs.php[Vim documentation]. There are other
902useful ways to search, e.g. while the cursor is on a word, pressing `*`
903or `#` searches for the next or previous occurrence of the word.
904
905Searching by `Ctrl-F` finds matches only in the visible area of the
906screen unless the link:#render[Render] diff preference is set to `Slow`.
907
908image::images/user-review-ui-side-by-side-diff-screen-search.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-search.png"]
909
Edwin Kempin7feeb952014-05-09 11:16:56 +0200910[[key-navigation]]
911=== Key Navigation
912
913Vim-like commands can be used to navigate within a patch file:
914
915- `h` / `j` / `k` / `l` moves the cursor left / down / up / right
916- `0` / `$` moves the cursor to the start / end of the line
917- `gg` / `G` moves to cursor to the start / end of the file
918- `Ctrl-D` / `Ctrl-U` scolls downwards / upwards
919
920Please check the link:http://www.vim.org/docs.php[Vim documentation]
921for further information.
922
Edwin Kempinfe8ca4c2014-05-08 16:49:15 +0200923[[diff-preferences]]
924=== Diff Preferences
925
926There are several options to control how patch diffs should be
927rendered. Users can configure their preferences in the diff
928preferences. The diff preferences can be accessed by clicking on the
929settings icon in the screen header.
930
931image::images/user-review-ui-side-by-side-diff-screen-preferences.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-preferences.png"]
932
933The diff preferences popup allows to change the diff preferences.
934By clicking on the `Save` button changes to the diff preferences are
935saved permanently. Clicking on the `Apply` button applies the new
936diff preferences to the current screen, but they are discarded when the
937screen is refreshed. The `Save` button is only available if the user is
938signed in.
939
940image::images/user-review-ui-side-by-side-diff-screen-preferences-popup.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-preferences-popup.png"]
941
942The following diff preferences can be configured:
943
944- `Theme`:
945+
946Controls the theme that is used to render the file content.
947+
948E.g. users could choose to work with a dark theme.
949+
950image::images/user-review-ui-side-by-side-diff-screen-dark-theme.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-dark-theme.png"]
951
952- `Ignore Whitespace`:
953+
954Controls whether differences in whitespace should be ignored or not.
955+
956** `None`:
957+
958All differences in whitespace are highlighted.
959+
960** `At Line End`:
961+
962Whitespace differences at the end of lines are ignored.
963+
964** `Leading, At Line End`:
965+
966Whitespace differences at the beginning and end of lines are ignored.
967+
968** `All`:
969+
970All differences in whitespace are ignored.
971
972- `Tab Width`:
973+
974Controls how many spaces should be displayed for a tab.
975
976- `Columns`:
977+
978Sets the preferred line length. At this position a vertical dashed line
979is displayed so that one can easily detect lines the exceed the
980preferred line length.
981+
982image::images/user-review-ui-side-by-side-diff-screen-column.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-column.png"]
983
984- `Lines Of Context`:
985+
986The number of context lines that should be displayed before and after
987any diff. If the `entire file` checkbox is selected, the full file is
988rendered.
989+
990Skipped common lines can be expanded by clicking on the placeholder for
991the skipped lines.
992+
993Clicking on "... skipped <n> common lines ..." expands the complete
994block of skipped lines.
995+
996If many lines are skipped there are additional links to expand the
997context by ten lines before and after the skipped block.
998+
999image::images/user-review-ui-side-by-side-diff-screen-expand-skipped-lines.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-expand-skipped-lines.png"]
1000
1001- `Intraline Difference`:
1002+
1003Controls whether intraline differences should be highlighted.
1004+
1005image::images/user-review-ui-side-by-side-diff-screen-intraline-difference.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-intraline-difference.png"]
1006
1007- `Syntax Highlighting`:
1008+
1009Controls whether syntax highlighting should be enabled.
1010+
1011The language for the syntax highlighting is automatically detected from
Edwin Kempin637db5e2014-05-12 08:25:26 +02001012the file extension. The language can also be set manually by selecting
1013it from the `Language` drop-down list.
Edwin Kempinfe8ca4c2014-05-08 16:49:15 +02001014+
1015image::images/user-review-ui-side-by-side-diff-screen-syntax-coloring.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-syntax-coloring.png"]
1016
1017- `Whitespace Errors`:
1018+
1019Controls whether whitespace errors are highlighted.
1020
1021- `Show Tabs`:
1022+
1023Controls whether tabs are highlighted.
1024
1025- `Line Numbers`:
1026+
1027Controls whether line numbers are shown.
1028
Edwin Kempin91de46f2014-05-12 08:28:32 +02001029- `Left Side`:
1030+
David Ostrovskya000b232014-05-13 07:47:06 +02001031Controls whether the left side is shown. This preference is not
1032persistent and is ignored by the `Save` button. Every time a
1033patch diff is opened, this preference is reset to `Show`.
Edwin Kempin91de46f2014-05-12 08:28:32 +02001034
Edwin Kempinfe8ca4c2014-05-08 16:49:15 +02001035- `Top Menu`:
1036+
1037Controls whether the top menu is shown.
1038
1039[[mark-reviewed]]
1040- `Mark Reviewed`:
1041+
1042Controls whether the files of the patch set should be automatically
1043marked as reviewed when they are viewed.
1044
1045[[expand-all-comments]]
1046- `Expand All Comments`:
1047+
1048Controls whether all comments should be automatically expanded.
1049
1050- `Render`:
1051+
1052Controls how patch files that exceed the screen size are rendered.
1053+
1054If `Fast` is selected file contents which are outside of the visible
1055area are not attached to the browser's DOM tree. This makes the
1056rendering fast, but searching by `Ctrl+F` only finds content which is
1057in the visible area.
1058+
1059If `Slow` is selected all file contents are attached to the browser's
1060DOM tree, which makes the rendering slow for large files. The advantage
1061of this setting is that `Ctrl+F` can be used to search in the complete
1062file.
Edwin Kempin9cc22c92014-05-12 08:16:52 +02001063+
1064Large files that exceed 4000 lines will not be fully rendered.
Edwin Kempinfe8ca4c2014-05-08 16:49:15 +02001065
Edwin Kempin7a85f412014-05-09 12:51:51 +02001066[[keyboard-shortcuts]]
1067== Keyboard Shortcuts
1068
1069Navigation within the review UI can be completely done by keys, and
1070most actions can be controlled by keyboard shortcuts. Typing `?` opens
1071a popup that shows a list of available keyboard shortcuts:
1072
1073- Change Screen
1074+
1075image::images/user-review-ui-change-screen-keyboard-shortcuts.png[width=800, link="images/user-review-ui-change-screen-keyboard-shortcuts.png"]
1076
1077- Side-by-Side Diff Screen
1078+
1079image::images/user-review-ui-side-by-side-diff-screen-keyboard-shortcuts.png[width=800, link="images/user-review-ui-side-by-side-diff-screen-keyboard-shortcuts.png"]
1080+
1081In addition, Vim-like commands can be used to link:#key-navigation[
1082navigate] and link:#search[search] within a patch file.
1083
Edwin Kempinb7a1c7c2014-05-09 11:21:18 +02001084[[new-vs-old]]
1085== New Review UI vs. Old Review UI
1086
1087There are some important conceptual differences between the old and
1088new review UIs:
1089
1090- The old change screen directly shows all patch sets of the change.
1091 With the new change screen only a single patch set is displayed;
1092 users can switch between the patch sets by choosing another patch
1093 set from the link:#patch-sets[Patch Sets] drop down panel in the
1094 screen header.
1095- On the old side-by-side diff screen, new comments are inserted by
1096 double-clicking on a line. With the new side-by-side diff screen
1097 double-click is used to select a word for commenting on it; there
1098 are link:#add-inline-comment[several ways to insert new comments],
1099 e.g. by selecting a code block and clicking on the popup comment
1100 icon.
1101
1102Limitations of the new review UI:
1103
1104- The new side-by-side diff screen cannot render images.
1105
Edwin Kempin1b4c2cac2014-05-12 14:16:29 +02001106- Unified diff view is missing:
1107+
1108By setting `Diff View (New Change Screen)` in the user preferences to
1109`Unified Diff` the new change screen can be configured to open the file
1110diffs in the old unified diff view.
1111
Edwin Kempinb7a1c7c2014-05-09 11:21:18 +02001112Users preferring the old review UI can link:#old-change-screen[
1113configure the change view] in their preferences.
1114
Edwin Kempin4fd84c92014-04-30 13:23:15 +02001115GERRIT
1116------
1117Part of link:index.html[Gerrit Code Review]
1118
1119SEARCHBOX
1120---------