Commit Graph

126 Commits

Author SHA1 Message Date
Aleksei Stepanov 9846bcacf3 Drop prehistoric hack for urwid.GridFlow
1. Mentioned PR was merged > 8 years ago.
2. Issue with widget focusing on keypress is invalid:
   arrow keys should point on widgets as it positioned
   (if button at the next row - "right" button is ignored).

Change-Id: I6fecae34576196b63074a4b0db438aab3da3fd65
2024-02-26 11:04:21 +01:00
Jeremy Stanley cba4bb4098 Start cursor at Change-Id on entering ChangeView
In order to avoid having urwid warp the cursor to a non-selectable
widget when moving to a new ChangeView, set focus to the first item
we know will be selectable at the top of the screen, the Change-Id.

Change-Id: Ibd502eb18496eec37383370bb15a4f4cd8b3e5d7
2021-10-09 12:40:34 +00:00
Jeremy Stanley 3555a0d211 Make related change entries selectable
The default for _selectable in the Pile class was switched to False
with https://github.com/urwid/urwid/pull/367 commit 018509d, so
explicitly declare change entries are selectable in order to allow
them to be navigated by keyboard with urwid 2.1.0 and later.

Change-Id: I31f3d62475ec2e8a10e7a553426412ad6aa43f8f
2021-10-04 14:33:24 +00:00
Zuul 550df25397 Merge "Make commit and patchset comments nicer" 2021-08-24 16:47:39 +00:00
James E. Blair 07827fcae7 Make commit and patchset comments nicer
Rather than display the /PATCHSET_LEVEL and /COMMIT_MSG fake
filenames, translate those to nice strings like the web ui does.

Change-Id: I225c8e2ea9763f9dadbefc4a23329efe0f97d899
2021-08-24 09:43:45 -07:00
Dmitry Tantsur e96a663f1e Suggest a 'cherry-picked from' line when cherry picking
Emulates the behavior of "git cherry-pick -x" and the web UI.

Change-Id: I1c3654e39351cd0c6fc84a57b04560877bdf3b31
2021-07-06 13:05:29 +02:00
James E. Blair 363114eb7a Highlight WIP state in change view
To help reviewers notice WIP changes (which can't merge) highlight
that status.

Change-Id: If1a8cb0d6d8f3b29981ac58d6d5900898847e286
2021-03-26 07:44:48 -07:00
James E. Blair c134a8c6f1 Add support for searching for hashtags
Also for setting hashtags in change lists using the process mark.
Editing hashtags on individual change screens was already supported.
Selecting hashtags on a change screen will now perform a search for
that tag.

Change-Id: Icc23e10bbf22fbe9b1d958758ec6ceb3286e795b
2021-03-01 14:45:16 -08:00
James E. Blair 94310529ed Add WIP support
Change-Id: I3b690c3bffdb1ca534e42cef0c3c7d9b797f7e80
2020-12-18 11:02:33 -08:00
James E. Blair f49f27db59 Fix error in message refresh
An extra argument was added recently; this was causing a crash.

Change-Id: I375b7709c28b0bbee265e097d09ea8eecab2ce36
2020-03-05 09:49:05 -08:00
James E. Blair 055b11624b Add support for checks plugin
Change-Id: Iabaf1c928571ff0191e1201f395050f278f19a75
2020-02-20 15:40:30 -08:00
James E. Blair b6ba991215 Display line comments from all patchsets in change view
The change view did not display comments from previous patchsets,
only comments associated with the patchset of the current message.
This displays them from all patchsets, annotating them with the
patchset number when it is different.

Note, the line comments were correctly displayed in the diff view.

Change-Id: Ieda0de0bb24800b9c3f577f339ca1338f2f1cc38
2020-02-20 09:48:52 -08:00
James E. Blair 73a6481835 Use account_id to identify the user's own account
This is necessary on systems where the username may not be present
(e.g., gerrit-review.googlesource.com).

Change-Id: Ia91b1e9b0fb0f98728dca46a488a92a97a301274
2019-08-28 15:10:19 +02:00
James E. Blair 87d0f36c50 Add support for hashtags
Change-Id: Ib05f472be87b84a29157cfb158effb33c49ba458
2019-08-28 15:10:18 +02:00
James E. Blair 0e770f0df6 Fix change view display of inline comments in python3
File comments were causing an exception when displayed on the
change view because python3 does not allow comparing None to int,
and file comments have a line number of None.

To correct this, use 0 as the line number for file comments whin
sorting and displaying them in the change view; there is no line
0 so this minor aliasing shouldn't cause any collisions.

Also, add a newline to the end of file comments, just as regular
inline comments (otherwise if a file comment was followed by a
line comment, they would appear on the same line).

Change-Id: Iedf88cdfd83adbc405e26cb013c9f57481d50c90
2019-03-28 08:03:42 -07:00
Zuul 21a1cda390 Merge "Enable review keys in diffs, and close change on review" 2019-03-19 14:46:53 +00:00
Doug Wiegley 7892a19cb9
Enable review keys in diffs, and close change on review
- Add a config option to enable closing a change after a review
  is saved, and going back to the change list.
- Enable reviewKeys from the change page to also work on the
  diff view.

Change-Id: I37d907132a012d074d38345f15ef83ec7d9f3e6c
2019-03-06 11:08:23 -07:00
Tobias Henkel 56d63841f5
Add inline comments to change overview
The gerrit ui shows the inline comments on the change overview without
having to open the diff screen. This is useful for following
discussions on changes so add this to gertty as well.

Change-Id: I976ec5584e978ce4aee7075bc45394193c104889
2019-01-29 22:22:38 +01:00
James E. Blair 45e8402f31 Show merged parents if outdated
If a change's parent is outdated, show it even if the parent is
merged.

Change-Id: Ifee3980d1f8ca83a88d5c433e790e786815a083f
2018-02-10 17:51:59 -08:00
Emilien Macchi cbe4d9322f reviewkeys: add 'message' parameter
Add 'message' optional parameter to reviewkeys which can be use to have
a shortcut to leave recheck in reviews (example of use case).

reviewkeys:
  - key: 'meta 4'
    approvals: []
    message: 'recheck'

It updates the doc and also the openstack-gertty.yaml since it can be
useful for all OpenStack reviewers.

Change-Id: I81f3cc8374fe1872efb71d4b2bc1c647b118d43f
2017-12-22 10:10:18 -08:00
James E. Blair cb12ada037 Speed up loading change screen
If a change has many revisions, loading the change screen may be
slow because we verify the presence of each commit and its parent
individually.

Instead, do that in a batch to speed things up.

Change-Id: Ib4b1c34500b98b8bb7307a5aaca86802a15e635d
2017-08-24 13:18:33 -07:00
James E. Blair 3b97166127 Handle approvals with no name
Gertty currently handles change owners or review comments from
folks with missing account information (or even missing accounts).
This adds similar logic for approvals.

Change-Id: I368807eac131cdfddb9eaf97efdf217af10ea33b
2017-08-14 09:38:38 -07:00
James E. Blair c466fa6633 Fix crash on long review messages
Hitting 'page down' on a change with a long review message might
produce an error like:

  urwid.listbox.ListBoxError: Invalid offset_inset: -7, only 2 rows in target!

Setting the initial focus of the listbox to the grid rather than
the divider seems to help with that.  It also seems to make more
sense.

Change-Id: Ie8038583250a994851f2570d889112153d2906a3
2017-03-03 14:54:07 -08:00
Jenkins ded4ac5a60 Merge "Display gate results ordered" 2016-07-26 17:40:54 +00:00
James E. Blair 0f0b1b149a Speed up loading a change with eager loading
To display a change screen, we need to access all of the revisions,
files, and comments for the change.  Tell SQLAlchemy in that case
to go ahead and load everything in one query.  In local testing,
this made https://review.openstack.org/223333 load in about 1
second rather than 9 seconds.

Change-Id: I5eb53e2a1ee853f4489e92c4ca719cfb96b4a563
2016-07-18 16:42:13 -07:00
Martin André 913818beb6 Display gate results ordered
The OrderedDict type returned by `commentlink.getTestResults()` was
lost when being passed to `_updateTestResults()`.

This commit restores the order as it is supposed to be.

Change-Id: Ie7fc7afd54a0243e4fe956b32061e98d743f7245
2016-06-27 17:16:09 +02:00
Matthew Treinish 76c8344c8d
Add user email addresses to the change view
This commit adds the email addresses for the patch owner and the
current reviewers to the change view.

Change-Id: I9c6835746d50d6907c490bc62323a07cd8eff789
2016-06-10 10:38:48 -04:00
James E. Blair ce7e391fcc Default to prior approval values when (re-)reviewing
When leaving a message on a review, default the approval values
to those previously left by the user if they exist.  This way
if the user leaves a follow-up comment or reply, they are less
likely to accidentally clear their vote.

Change-Id: Iab9203e35aef9756057a62fed161fe818dd1d680
2016-05-03 11:51:39 -07:00
James E. Blair aac0e232cc Fix unicode in change messages
Urwid encodes the input field according to the encoding of the
label, so setting the label to be u'unicode' causes the text
to be returned as unicode.

Change-Id: Id862bd78e5d505ae071e11a2b0cdf5c174a6efcc
2016-05-03 11:38:23 -07:00
James E. Blair 6641793ff3 Add (quoted) reply button to change messages
Change-Id: I900b719b508bbbf18277ae6156b856a547f73f31
2016-05-03 11:37:13 -07:00
James E. Blair 7a149db6cf Show potential completions
When entering multi-key commands, display potential completions
in the status bar as a reminder to the user.

Change-Id: I498781576a60789b0f810f08cbc9c8c74d52784f
2016-05-02 11:00:40 -05:00
James E. Blair 8f38e54747 Fix rendering error in change screen
This corrects the following error:
  urwid.listbox.ListBoxError: Widget <Pile selectable box/flow widget>
  at position 2 within listbox calculated X rows but rendered Y!

This happened when related changes links were winder than the screen.
They were rendered as FixedButtons, but there is no reason for them
to be.  This changes them to regular urwid Buttons which are flow
widgets and will line-wrap if needed.

Change-Id: Ia91beaffadbb7a3e5341b11c49bb2d6d74df4782
2016-05-02 10:59:22 -05:00
Cody A.W. Somerville c7ed7ab38a Make 'title' attribute available on dialog widgets
Gertty uses WidgetWraps around the LineBox widget for popup widgets. Add
LineBoxTitlePropertyMixin which adds property and setter for title attribute,
accessing the underlying title_widget on the wrapped LineBox widget.

We use the popup method in the controller to display these dialogs. It uses an
Overlay widget to display our dialog widget on top of the current view. If the
widget to be displayed by the Overlay widget has title attribute, copy it to
the Overlay widget.

Change-Id: I4c6ecbc7ed87867cd67cd93c1125384dd5d4b9af
2016-05-02 10:59:22 -05:00
James E. Blair 4a18f6a6f8 Add support for last_seen
Change-Id: I01f2735b9d72d41b99427a39dbb1e31246a1c531
2016-02-10 07:57:01 -08:00
James E. Blair 4eef0452d5 Add support for conflicts-with
This adds a database migration for a new table.

Change-Id: I9d5ea4eec89f706435430b90f563b5a0c0fef9e8
2016-02-10 07:56:58 -08:00
James E. Blair 7fc7d18db4 Improve handling of abandoned related changes
Display [ABANDONED] if the parent is abandoned, and do not display
children if they are abandoned.

Change-Id: I8384cd9df2f3a9310874e62f227963a5f1a9476a
2016-02-10 07:56:56 -08:00
Jay Pipes 74877d2499 Allow gertty to run in Py3K environments
In environments without py27, gertty was unable to run. This patch
addresses all the Py3K issues discovered when getting gertty running in
a py34-only environment.

Change-Id: I32a06f9768bdeaf8e95ddf9a9e54c79059fbaa2f
2016-01-15 09:10:31 -08:00
James E. Blair dc960b0cda Cache counts of project changes
So that the project list page is more responsive, cache counts of
open and unreviewed changes for projects.

Change-Id: I270f4009d6c7cca9d9868a181db94f779662b643
2016-01-06 14:18:55 -08:00
James E. Blair 540c8dd7cc Support multiple key input
Change-Id: I0cd0884e0e1f4f0fa82f93e5f7438ff00c5a992a
2015-12-04 13:08:05 -08:00
James E. Blair c8d81b7693 Add a simple kill ring
Create a global app kill ring and a custom edit widget that can
kill and yank from it.  Also, add Emacs beginning/end of line
keys to the default keymap.

Change-Id: I18d8d47694c89ede4dcec7eaf5d3fb2210ef4438
2015-12-04 13:08:00 -08:00
Alex Schultz 5f680ea6e4 Make permalink clickable
This change allows a user to click the permalink on the review screen
and have it open up in a web browser.

Change-Id: I4c0fe35f062043a47368d68fecbbcdbf8d955267
2015-09-17 13:07:43 -05:00
David Stanek 0b16cbb8c4 Refactor: move getRepo out of the App object
The getRepo method really doesn't have much to do with the application
object. Since it's really a utiltiy method for dealing with git repos
I've moved it to gertty.gitrepo.

Change-Id: Ic3349430c456ee184bbf57b6e5b7de4f940b4cc1
2015-06-09 23:50:43 -04:00
James E. Blair 94bfcd13f4 Add ability to review multiple changes at once
Add a process mark to the change list so that multiple changes may
be selected at once for further operations.  Allow multiple changes
to be reviwed at once by selecting them with the process mark and
then pressing the usual review command key.  The categories are
simply taken from the first change in the list for simplicity.
This should be fine most of the time, but if the changes have
different categories available to them, or the user has different
access levels, this may not behave as intended.

Change-Id: I04a790d91b27b270cf1269c7bcb39c12d857ab32
2015-05-27 08:53:22 -07:00
James E. Blair c0cabc82f6 Attach comments to files
Since each revision now has files, associate comments with the
file relation rather than revisions so that the path is not stored
twice in the database.

Also correct a problem where comments could be left on empty files
or lines that are not in a file in the unified view.

The SQLAlchemy constraints API seems to have changed between
0.9.9 and 1.0.4.  Support both behaviors to be user-friendly even
though we now specify 1.0.4.

Change-Id: If6593d279a432ea8a48f4bd74a157e4978e69eaa
2015-05-27 08:34:04 -07:00
James E. Blair a61c5fdf67 Add files table
In order to support searching for changes by file modified, keep
a local table of files modified in each revision.  In order to
populate the table without needing to re-sync every change, run
a diffstat on every revision during the migration.

Once established, the table will be populated during the normal
change sync.

Add support for the "file:" operator in searching.

Change-Id: Idbd44944405bdbc93af8bc3c513498e4425ba75b
2015-05-27 08:34:04 -07:00
Christoph Gysin f48df0ffdd flake8: Fix F401,F403
This commit fixes the following flake8 issues:

F401 'foo' imported but unused
F403 'from foo import *' used; unable to detect undefined names

Change-Id: I163224c65f54a2e495d6469c1c26a115ad192e23
2015-04-12 16:40:40 -04:00
Christoph Gysin bfeabc58b4 flake8: Fix F821,F841
This commit fixes the following flake8 issues:

F821 undefined name 'name'
F841 local variable 'name' is assigned to but never used

It also silences the false-positives caused by parser.py and
tokenizer.py.

Change-Id: Icdc42f47f5f1f383054d8dfdeed6509fc478637b
2015-04-12 16:36:42 -04:00
James E. Blair dfff0e8fc3 Fix crash on opening a change with missing commits
When on the change screen, if navigating to a change missing
commits, display the error in a dialog rather than crash.

Change-Id: I560e17241bcb43a91093c13fafd18aa54d215e13
2015-04-08 15:36:15 -04:00
James E. Blair a4133c2560 Highlight own name on change screen
Highlight the user's name in the review box and messages so that
when revisiting a review, it is easy to see one's own vote or any
messages that the user has previously left, or in case the user
forgets their own name.

Change-Id: Idf08e98b3d287376b0e2c8a3f0a1c38b3c30f698
2015-04-08 15:36:15 -04:00
James E. Blair d5c8577001 Make change-id a search link in change screen
Change-Id: I8a38e2c5c47d524f485789f2685c8dc0bfd278c8
2015-04-07 08:38:09 -07:00