blob: aeeb8429a7ee0bf3ddae6a6d7d02a3a66b7d9a03 [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+
492This tab is only available for open changes.
493+
494image::images/user-review-ui-change-screen-related-changes.png[width=800, link="images/user-review-ui-change-screen-related-changes.png"]
495+
496Related changes may be decorated with an icon to signify dependencies
497on outdated patch sets, or commits that are not associated to changes
498under review:
499+
500** Orange Dot:
501+
502The selected patch set of the change is outdated; it is not the current
503patch set of the change.
504+
505If an ancestor change is marked with an orange dot it means that the
506currently viewed patch set depends on a outdated patch set of the
507ancestor change. This is because a new patch set for the ancestor
508change was uploaded in the meantime and as result the currently viewed
509patch set now needs to be rebased.
510+
511If a descendant change is marked with an orange dot it means that an
512old patch set of the descendant change depends on the currently viewed
513patch set. It may be that the descendant was rebased in the meantime
514and with the new patch set this dependency was removed.
515
516** Green Tilde:
517+
518The selected patch set of the change is an indirect descendant of the
519currently viewed patch set; it has a dependency to another patch set of
520this change. E.g. this could mean that a new patch set was uploaded for
521this change and the descendant change now needs to be rebased. Please
522note that following the link to an indirect descendant change may
523result in a completely different related changes listing.
524
525** Black Dot:
526+
527Indicates a merged ancestor, e.g. the commit was directly pushed into
528the repository bypassing code review, or the ancestor change was
529reviewed and submitted on another branch. The latter may indicate that
530the user has accidentally pushed the commit to the wrong branch, e.g.
531the commit was done on `branch-a`, but was then pushed to
532`refs/for/branch-b`.
533
534+
535image::images/user-review-ui-change-screen-related-changes-indicators.png[width=800, link="images/user-review-ui-change-screen-related-changes-indicators.png"]
536
537- `Conflicts With`:
538+
539This tab page shows changes that conflict with the current change.
540Non-mergeable changes are filtered out; only conflicting changes that
541are mergeable are shown.
542+
543If this change is merged, its conflicting changes will have merge
544conflicts and must be rebased. The rebase of the other changes with the
545conflict resolution must then be done manually.
546+
547image::images/user-review-ui-change-screen-conflicts-with.png[width=800, link="images/user-review-ui-change-screen-conflicts-with.png"]
548
549- `Same Topic`:
550+
551This tab page shows changes that have the same topic as the current
552change. Only open changes are included in the list.
553+
554image::images/user-review-ui-change-screen-same-topic.png[width=800, link="images/user-review-ui-change-screen-same-topic.png"]
555
556- `Cherry-Picks`:
557+
558This tab page shows changes with the same link:user-changeid.html[
559Change-Id] for the current project.
560+
561Abandoned changes are filtered out.
562+
563For each change in this list the destination branch is shown as a
564prefix in front of the change subject.
565+
566image::images/user-review-ui-change-screen-cherry-picks.png[width=800, link="images/user-review-ui-change-screen-cherry-picks.png"]
567
568If there are no related changes for a tab, the tab is not displayed.
569
Edwin Kempinc6cab612014-05-06 11:09:05 +0200570[[reply]]
571=== Reply
572
573The `Reply...` button in the change header allows to reply to the
574currently viewed patch set; one can add a summary comment, publish
575inline draft comments, and vote on the labels.
576
577image::images/user-review-ui-change-screen-reply.png[width=800, link="images/user-review-ui-change-screen-reply.png"]
578
579Clicking on the `Reply...` button opens a popup panel.
580
581A text box allows to type a summary comment for the currently viewed
582patch set.
583
584If the current patch set is viewed, radio buttons are displayed for
585each label on which the user is allowed to vote. Voting on non-current
586patch sets is not possible.
587
588Typing "LGTM" (acronym for 'Looks Good To Me') in the summary comment
589text box automatically selects the highest possible score for the
590'Code-Review' label.
591
592The inline draft comments that will be published are displayed in a
593separate section so that they can be reviewed before publishing. There
594are links to navigate to the inline comments which can be used if a
595comment needs to be edited.
596
597The `Post` button publishes the comments and the votes.
598
599The `send email` checkbox controls whether the reply should trigger
600email notifications for other users. Deselecting the checkbox means
601that there will be no email notification about the change update to the
602change author, the reviewers or any other user.
603
604image::images/user-review-ui-change-screen-replying.png[width=800, link="images/user-review-ui-change-screen-replying.png"]
605
606If a user can approve a label that is still required, a quick approve
607button appears in the change header that allows to add this missing
608approval by a single click. The quick approve button only appears if
609there is a single label that is still required and can be approved by
610the user.
611
612E.g. if a change requires approvals on the 'Code-Review' and the
613'Verified' labels, and there is already a '+1 Verified' vote, then
614if the user is allowed to vote the max score on 'Code-Review', a
615`Code-Review+2` quick approve button appears that approves the
616'Code-Review' label if clicked.
617
618Using the quick approve button also publishes all inline draft
619comments; a summary comment is only added if the reply popup panel is
620open when the quick approve button is clicked.
621
622image::images/user-review-ui-change-screen-quick-approve.png[width=800, link="images/user-review-ui-change-screen-quick-approve.png"]
623
Edwin Kempin7a682812014-05-06 14:45:01 +0200624[[history]]
625=== History
626
627The history of the change can be seen in the lower part of the screen.
628
629The history contains messages for all kinds of change updates, e.g. a
630message is added when a new patch set is uploaded or when a review was
631done.
632
633Messages with new comments from other users, that were published after
634the current user last reviewed this change, are automatically expanded.
635
636image::images/user-review-ui-change-screen-history.png[width=800, link="images/user-review-ui-change-screen-history.png"]
637
638It is possible to directly reply to a change message by clicking on the
639reply icon in the right upper corner of a change message. This opens
640the reply popup panel and prefills the text box with the quoted comment.
641Then the reply can be written below the quoted comment or inserted
642inline. Lines starting with " > " will be rendered as a block quote.
643Please note that for a correct rendering it is important to leave a blank
644line between a quoted block and the reply to it.
645
646image::images/user-review-ui-change-screen-reply-to-comment.png[width=800, link="images/user-review-ui-change-screen-reply-to-comment.png"]
647
648Inline comments are directly displayed in the change history and there
649are links to navigate to the inline comments.
650
651image::images/user-review-ui-change-screen-inline-comments.png[width=800, link="images/user-review-ui-change-screen-inline-comments.png"]
652
653The `Expand All` button expands all messages; the `Collapse All` button
654collapses all messages.
655
Edwin Kempin772418f2014-05-06 15:45:35 +0200656[[update-notification]]
657=== Update Notification
658
659The change screen automatically polls for updates to the currently
660viewed change. If there is an update the user is informed by a popup
661panel in the bottom right corner.
662
663The polling frequency depends on the server configuration; by default
664it is 30 seconds. Polling may also be completely disabled by the
665administrator.
666
667image::images/user-review-ui-change-screen-change-update.png[width=800, link="images/user-review-ui-change-screen-change-update.png"]
668
Edwin Kempin41d9d302014-05-06 16:02:06 +0200669[[plugin-extensions]]
670=== Plugin Extensions
671
672Gerrit plugins may extend the change screen; they can add buttons for
673additional actions to the change info block and display arbitrary UI
674controls below the change info block.
675
676image::images/user-review-ui-change-screen-plugin-extensions.png[width=800, link="images/user-review-ui-change-screen-plugin-extensions.png"]
677
Edwin Kempinae57e182014-04-30 13:38:55 +0200678[[old-change-screen]]
679=== Old Change Screen
680
681In addition to the normal change screen, this Gerrit version still
682includes the old change screen that was used in earlier Gerrit
683versions. Users that want to continue using the old change screen can
684configure it in their preferences under
685`Settings` > `Preferences` > `Change View`:
686
687image::images/user-review-ui-change-view-preference.png[width=800, link="images/user-review-ui-change-view-preference.png"]
688
689[WARNING]
690The old change screen will be removed in a later version of Gerrit.
691
Edwin Kempind38ddf52014-05-07 14:31:42 +0200692[[side-by-side]]
693== Side-by-Side Diff Screen
694
695The side-by-side diff screen shows a single patch; the old file version
696is displayed on the left side of the screen; the new file version is
697displayed on the right side of the screen.
698
699This screen allows to review a patch and to comment on it.
700
701image::images/user-review-ui-side-by-side-diff-screen.png[width=800, link="images/user-review-ui-side-by-side-diff-screen.png"]
702
703In the screen header the project name and the name of the viewed patch
704file are shown.
705
706If a Git web browser is configured on the server, the project name and
707the file path are displayed as links to the project and the folder in
708the Git web browser.
709
710image::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"]
711
712The checkbox in front of the project name and the file name allows the
Edwin Kempinfe8ca4c2014-05-08 16:49:15 +0200713patch to be marked as reviewed. The link:#mark-reviewed[Mark Reviewed]
714diff preference allows to control whether the files should be
715automatically marked as reviewed when they are viewed.
Edwin Kempind38ddf52014-05-07 14:31:42 +0200716
717image::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"]
718
Edwin Kempind38ddf52014-05-07 14:31:42 +0200719The scrollbar shows patch diffs and inline comments as annotations.
720This provides a good overview of the lines in the patch that are
721relevant for reviewing. By clicking on an annotation one can quickly
722navigate to the corresponding line in the patch.
723
724image::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"]
725
Edwin Kempin1266ac8f2014-05-09 09:39:31 +0200726A gap between lines in the file content that is caused by aligning the
727left and right side or by displaying inline comments is shown as a
728vertical red bar in the line number column. This prevents a gap from
729being mistaken for blank lines in the file
730
731image::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"]
732
Edwin Kempind8057e52014-05-08 13:52:32 +0200733[[patch-set-selection]]
734In the header, on each side, the list of patch sets is shown. Clicking
735on a patch set changes the selection for the patch set comparison and
736the screen is refreshed to show the diff between the selected patch
737sets. The currently selected patch set is highlighted by a light blue
738background.
739
740On the left side `Base` can be selected to compare a patch set against
741its base. For merge commits `Auto Merge` is available instead which
742allows to compare the patch against the result of the auto merge. The
743auto merge version may contain Git conflict markers and is useful for
744reviewing how conflicts are resolved by a patch.
745
746Reviewers that are reviewing a patch for the first time look at its
747diff against its base; reviewers that have reviewed an old patch
748version before, may see what has changed since that version by
749comparing the old patch against the current patch.
750
751image::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"]
752
Edwin Kempin01280cc2014-05-09 09:53:30 +0200753If the compared patches are identical, this is highlighted by a red
754`No Differences` label in the screen header.
755
756image::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"]
757
Edwin Kempind8057e52014-05-08 13:52:32 +0200758The download icon next to the patch set list allows to download the
759patch. Unless the mime type of the file is configured as safe, the
760download file is a zip archive that contains the patch file.
761
Edwin Kempind37a1342014-05-08 14:02:35 +0200762For navigating between the patches in a patch set there are navigation
763buttons on the right side of the screen header. The left arrow button
764navigates to the previous patch; the right arrow button navigates to
765the next patch. The arrow up button leads back to the change screen. In
766all cases the selection for the patch set comparison is kept.
767
768image::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"]
769
Edwin Kempin004c3472014-05-07 16:56:59 +0200770[[inline-comments]]
771=== Inline Comments
772
773Inline comments are displayed directly in the patch file under the code
774that is commented. Inline comments can be placed on lines or on code
775blocks.
776
777If an inline comment relates to a code block, this code block is
778highlighted by a yellow background.
779
780Code blocks with comments may overlap. This means it is possible to
781attach several comments to the same code.
782
783The lines of the patch file are linkable. To link to a certain line in
784the patch file, '@<line-number>' must be appended to the patch link,
785e.g. `http://host:8080/#/c/56857/2/Documentation/user-review-ui.txt@665`.
786To link to a line in the old file version, '@a<line-number>' must be
787appended to the patch link. These links can be used to directly link to
788certain inline comments.
789
Edwin Kempinfe8ca4c2014-05-08 16:49:15 +0200790If the diff preference link:#expand-all-comments[Expand All Comments]
791is set to `Expand`, all inline comments will be automatically expanded.
Edwin Kempin004c3472014-05-07 16:56:59 +0200792
793image::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"]
794
795In the header of the comment box, the name of the comment author and
796the timestamp of the comment are shown. If avatars are configured on
797the server, the avatar image of the comment author is displayed in the
798top left corner. Below the actual comment there are buttons to reply to
799the comment.
800
801image::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"]
802
803Clicking on the `Reply` button opens an editor to type the reply.
804
805Quoting is supported, but only by manually copying & pasting the old
806comment that should be quoted and prefixing every line by " > ". Please
807note that for a correct rendering it is important to leave a blank line
808between a quoted block and the reply to it.
809
810Clicking on the `Save` button saves the comment as a draft. To make it
811visible to other users it must be published from the change screen by
812link:#reply[replying] to the change.
813
814The `Cancel` button cancels the editing and discards any changes to the
815draft comment.
816
817Clicking on the `Discard` button deletes the inline draft comment.
818
819image::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"]
820
821Draft comments are marked by the text "Draft" in the header in the
822place of the comment author.
823
824A draft comment can be edited by clicking on the `Edit` button, or
825deleted by clicking on the `Discard` button.
826
827image::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"]
828
829Clicking on the `Done` button is a quick way to reply with "Done" to a
830comment. This is used to mark a comment as addressed by a follow-up
831patch set.
832
Edwin Kempin44606652014-05-09 08:31:05 +0200833image::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 +0200834
835[[add-inline-comment]]
836To add a new inline comment there are several possibilities:
837
838- select a code block and press 'c'
839- select a code block and click on the popup comment icon
Edwin Kempin7feeb952014-05-09 11:16:56 +0200840- go to a line, by clicking on it or by link:#key-navigation[key
841 navigation], and press 'c'
Edwin Kempin004c3472014-05-07 16:56:59 +0200842- click on a line number
843
844There are many ways to select code for commenting on it. The most
845frequently used methods are:
846
847- by mouse:
848** click and drag with the mouse to select a block
849** double-click on a word to select it
850** double-click and drag with the mouse to select a code block word-wise
851** triple-click on a line to select it
852** triple-click and drag with the mouse to select a code block line-wise
853
854- by keys (the same keys that are used for visual selection in Vim):
855** press 'v' + arrow keys (or 'h', 'j', 'k', 'l') to select a block
856** press 'V' + arrow keys (or 'j', 'k') to select a code block line-wise
857** type 'bvw' to select a word
858
Edwin Kempin004c3472014-05-07 16:56:59 +0200859image::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"]
860
861For typing the new comment, a new comment box is shown under the code
862that is commented.
863
864Clicking on the `Save` button saves the new comment as a draft. To make
865it visible to other users it must be published from the change screen
866by link:#reply[replying] to the change.
867
868Clicking on the `Discard` button deletes the new comment.
869
870image::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"]
871
Edwin Kempin9df27ac2014-05-08 13:06:18 +0200872[[file-level-comments]]
873=== File Level Comments
874
875Comments that apply to a whole file can be added on file level.
876
877File level comments are added by clicking on the comment icon in the
878header above the file.
879
880image::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"]
881
882Clicking on the comment icon opens a comment box for typing the file
883level comment.
884
885image::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"]
886
Edwin Kempin6113a1f2014-05-09 10:48:34 +0200887[[search]]
888=== Search
889
890For searching within a patch file, a Vim-like search is supported.
891Typing `/` opens the search box. Typing in the search box immediately
892highlights matches in the patch file with a yellow background. Using
893JavaScript regular expressions in the search term is supported. The
894search is case insensitive. After confirming the search by `ENTER` one
895can navigate between the matches by `n` / `N` to go to the next /
896previous match. Skipped lines are automatically expanded if they
897contain a match and one navigates to it.
898
899For additional possibilities to search please check the
900link:http://www.vim.org/docs.php[Vim documentation]. There are other
901useful ways to search, e.g. while the cursor is on a word, pressing `*`
902or `#` searches for the next or previous occurrence of the word.
903
904Searching by `Ctrl-F` finds matches only in the visible area of the
905screen unless the link:#render[Render] diff preference is set to `Slow`.
906
907image::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"]
908
Edwin Kempin7feeb952014-05-09 11:16:56 +0200909[[key-navigation]]
910=== Key Navigation
911
912Vim-like commands can be used to navigate within a patch file:
913
914- `h` / `j` / `k` / `l` moves the cursor left / down / up / right
915- `0` / `$` moves the cursor to the start / end of the line
916- `gg` / `G` moves to cursor to the start / end of the file
917- `Ctrl-D` / `Ctrl-U` scolls downwards / upwards
918
919Please check the link:http://www.vim.org/docs.php[Vim documentation]
920for further information.
921
Edwin Kempinfe8ca4c2014-05-08 16:49:15 +0200922[[diff-preferences]]
923=== Diff Preferences
924
925There are several options to control how patch diffs should be
926rendered. Users can configure their preferences in the diff
927preferences. The diff preferences can be accessed by clicking on the
928settings icon in the screen header.
929
930image::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"]
931
932The diff preferences popup allows to change the diff preferences.
933By clicking on the `Save` button changes to the diff preferences are
934saved permanently. Clicking on the `Apply` button applies the new
935diff preferences to the current screen, but they are discarded when the
936screen is refreshed. The `Save` button is only available if the user is
937signed in.
938
939image::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"]
940
941The following diff preferences can be configured:
942
943- `Theme`:
944+
945Controls the theme that is used to render the file content.
946+
947E.g. users could choose to work with a dark theme.
948+
949image::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"]
950
951- `Ignore Whitespace`:
952+
953Controls whether differences in whitespace should be ignored or not.
954+
955** `None`:
956+
957All differences in whitespace are highlighted.
958+
959** `At Line End`:
960+
961Whitespace differences at the end of lines are ignored.
962+
963** `Leading, At Line End`:
964+
965Whitespace differences at the beginning and end of lines are ignored.
966+
967** `All`:
968+
969All differences in whitespace are ignored.
970
971- `Tab Width`:
972+
973Controls how many spaces should be displayed for a tab.
974
975- `Columns`:
976+
977Sets the preferred line length. At this position a vertical dashed line
978is displayed so that one can easily detect lines the exceed the
979preferred line length.
980+
981image::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"]
982
983- `Lines Of Context`:
984+
985The number of context lines that should be displayed before and after
986any diff. If the `entire file` checkbox is selected, the full file is
987rendered.
988+
989Skipped common lines can be expanded by clicking on the placeholder for
990the skipped lines.
991+
992Clicking on "... skipped <n> common lines ..." expands the complete
993block of skipped lines.
994+
995If many lines are skipped there are additional links to expand the
996context by ten lines before and after the skipped block.
997+
998image::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"]
999
1000- `Intraline Difference`:
1001+
1002Controls whether intraline differences should be highlighted.
1003+
1004image::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"]
1005
1006- `Syntax Highlighting`:
1007+
1008Controls whether syntax highlighting should be enabled.
1009+
1010The language for the syntax highlighting is automatically detected from
1011the file extension.
1012+
1013image::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"]
1014
1015- `Whitespace Errors`:
1016+
1017Controls whether whitespace errors are highlighted.
1018
1019- `Show Tabs`:
1020+
1021Controls whether tabs are highlighted.
1022
1023- `Line Numbers`:
1024+
1025Controls whether line numbers are shown.
1026
1027- `Top Menu`:
1028+
1029Controls whether the top menu is shown.
1030
1031[[mark-reviewed]]
1032- `Mark Reviewed`:
1033+
1034Controls whether the files of the patch set should be automatically
1035marked as reviewed when they are viewed.
1036
1037[[expand-all-comments]]
1038- `Expand All Comments`:
1039+
1040Controls whether all comments should be automatically expanded.
1041
1042- `Render`:
1043+
1044Controls how patch files that exceed the screen size are rendered.
1045+
1046If `Fast` is selected file contents which are outside of the visible
1047area are not attached to the browser's DOM tree. This makes the
1048rendering fast, but searching by `Ctrl+F` only finds content which is
1049in the visible area.
1050+
1051If `Slow` is selected all file contents are attached to the browser's
1052DOM tree, which makes the rendering slow for large files. The advantage
1053of this setting is that `Ctrl+F` can be used to search in the complete
1054file.
Edwin Kempin9cc22c92014-05-12 08:16:52 +02001055+
1056Large files that exceed 4000 lines will not be fully rendered.
Edwin Kempinfe8ca4c2014-05-08 16:49:15 +02001057
Edwin Kempin7a85f412014-05-09 12:51:51 +02001058[[keyboard-shortcuts]]
1059== Keyboard Shortcuts
1060
1061Navigation within the review UI can be completely done by keys, and
1062most actions can be controlled by keyboard shortcuts. Typing `?` opens
1063a popup that shows a list of available keyboard shortcuts:
1064
1065- Change Screen
1066+
1067image::images/user-review-ui-change-screen-keyboard-shortcuts.png[width=800, link="images/user-review-ui-change-screen-keyboard-shortcuts.png"]
1068
1069- Side-by-Side Diff Screen
1070+
1071image::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"]
1072+
1073In addition, Vim-like commands can be used to link:#key-navigation[
1074navigate] and link:#search[search] within a patch file.
1075
Edwin Kempinb7a1c7c2014-05-09 11:21:18 +02001076[[new-vs-old]]
1077== New Review UI vs. Old Review UI
1078
1079There are some important conceptual differences between the old and
1080new review UIs:
1081
1082- The old change screen directly shows all patch sets of the change.
1083 With the new change screen only a single patch set is displayed;
1084 users can switch between the patch sets by choosing another patch
1085 set from the link:#patch-sets[Patch Sets] drop down panel in the
1086 screen header.
1087- On the old side-by-side diff screen, new comments are inserted by
1088 double-clicking on a line. With the new side-by-side diff screen
1089 double-click is used to select a word for commenting on it; there
1090 are link:#add-inline-comment[several ways to insert new comments],
1091 e.g. by selecting a code block and clicking on the popup comment
1092 icon.
1093
1094Limitations of the new review UI:
1095
1096- The new side-by-side diff screen cannot render images.
1097
1098Users preferring the old review UI can link:#old-change-screen[
1099configure the change view] in their preferences.
1100
Edwin Kempin4fd84c92014-04-30 13:23:15 +02001101GERRIT
1102------
1103Part of link:index.html[Gerrit Code Review]
1104
1105SEARCHBOX
1106---------