A recent change removed the --gr-button-color mixin, but did not set the
proper button color in the context expander.
Change-Id: I92393097fb4c3cc8b7b024ea90bac9d63610e81d
Usage of the --header-background-color constant in place of #eee was a
bit aggressive. This change modifies the styling to use constants that
have a more consistent usage (table-header-background-color, for
instance) and also introduces another new color,
--chip-background-color, for styling chips.
Bug: Issue 8809
Change-Id: Ie3acbfa4d221acc4f210f76bbb425a21e7f8b63e
Declares several CSS variables for styling buttons throughout the app
and uses them.
Removes the concept of a 'tertiary' button -- primary and secondary have
the exact same styling, so all tertiary buttons are changed to secondary
buttons and the existing secondary button (only replyBtn) is changed to
a primary button.
Also removes some of the many ways to modify a button color and
background -- there is no need for mixins to specifically style various
attributes of the paper-button when the ability to apply any styles
directly to it (via @apply --gr-button) is already supported.
Change-Id: I19a4114764df80b06175032b228a6ec63b414089
Introduces and standardizes the various shades of medium dark gray used
throughout the app to #616161, or Material Gray 600.
Change-Id: I311155cfdba4381643451233dfafbfbdacd55e90
Puts the palette into variables set by the app theme.
TODO: Refactor the app theme into app theme and syntax theme, but keep
the variable usage added in this change.
Change-Id: I4fe0789af3f7bbc1b8b0568f62bc58814a0d571d
With this change, all CSS border declarations that specify some shade of
gray are modified to use the one unified --border-color declaration in
app-theme.html.
Further followup with UX is required to ensure that the shade of gray
chosen is the correct one -- for now, the most-used one is used.
Change-Id: I2134ebf4a459ba040e01856c11389780307d8648
Previously, when gr-diff-builder generated context buttons, it reset the
textContent after gr-button was created. This ended up removing the
paper-button from inside gr-button, and hence lost all button like
qualities.
This change replaces with the appropriate Polymer DOM API, and modifies
the gr-button styles accordingly.
Bug: Issue 8626
Change-Id: Ic9a33c6bc74d676b21a039dd8714e4001bcda207
These tags are preserved by the Closure compiler and vulcanize in order
to serve the license notices embedded in the outputs. In a standalone
Gerrit server, these license are also covered in the LICENSES.txt served
with the documentation. When serving PG assets from a CDN, it's less
obvious what the corresponding LICENSES.txt file is, since the CDN is
not directly linked to a running Gerrit server. Safer to embed the
licenses in the assets themselves.
Change-Id: Id1add1451fad1baa7916882a6bda02c326ccc988
Change background: to background-image as background:
will overide any background-* vars.
Bug: Issue 8612
Change-Id: Ibc6632d09a0f258e852d21b13ff05bb68dd00ad0
When the width of the screen is larger than the line limit, a line will
be visible to indicate the line limit. When the screen is narrower than
the line limit, the indicator is not visible.
Bug: Issue 4813
Change-Id: I06cd97c10c33c4eb9e73340752b9254f10239ddb
This reverts commit 368641eb4f91f8dbb2fbb2f3e958aa2797fba93b.
Reason for revert: This introduced a bug which causes horizontal
scrolling on pages with a vertical scroll bar, due to 100vw hot taking
into account the width of the scroll bar. This is not an easy fix, so
reverting this change, at least for now.
Change-Id: Iff02ec60e02c85593dafdb3f9c5f99cf6cfac2ab
Line numbers in diffs had been specified in data-attributes and CSS to
avoid including them in pasteboard selections. However, we have since
moved to a different system that avoids including non diff content in
selections, and this CSS needlessly complicates style application.
With this change, diff line numbers show content, and the relevant CSS
is simplified. This provides a small, but measurable diff render
performance improvement.
Change-Id: Iad062553be533ead1dd29eaaacd5af8867249a16
We encountered an issue where PolyGerrit was not respecting browser
font preferences. Browser font preferences include both a default font
size and a minimum font size.
In the event that a font declared in px is smaller than the minimum font
size, the size is increased to equal the minimum font size. However,
if the font is declared in px and greater than the minimum, the
preferred font size is not taken into account.
Browsers' default font size is 16px [1], So instead of declaring the
base font in px (previously 13px), this change makes it a percentage
of the default font size. If the user has changed their default, this
is taken into account.
From this point, all other fonts will be declared in rems, which makes
it easier to base the new size off of the base font size of the <html>
tag, rather than ems which bases it on the container[2]. This allows us
to declare font sizes in a way more similar to pixels, yet relative.
A follow-up change will change all font size declaration to use rem from
em for consistency.
[1] https://stackoverflow.com/questions/29511983/is-the-default-font-size-of-every-browser-16px-why
[2] https://webdesign.tutsplus.com/tutorials/comprehensive-guide-when-to-use-em-vs-rem--cms-23984
Bug: Issue 8157
Change-Id: I04ec2c861b2fb288ec7556dfb655d7feea9c9157
Commit d5d9a13ec8fa62f0c36df7b75a2231663056668f fixed Issue 5091 by
adding a newline to the end of each diff line. In files with CRLF line
endings, this causes spurious newlines as described in Issue 7164.
This tweaks the aforementioned fix to specifically target empty lines
thereby still ensuring that (empty) diff lines don't collapse to 0px
height while avoiding inserting spurious newlines elsewhere.
Bug: Issue 7164
Change-Id: Iafbbf004cfb588fc123988674bbce8dfabf4d2b8
When users navigate to the diff view with a line number specified at the
end, depending on their context preference, the line might be in a
shared region that gets collapsed when the diff renders. With this
change, the location specified in the URL is prevented from being
collapsed by marking it as a "key" location.
Bug: Issue 5247
Change-Id: Ifd5827cd922b022cddb1601911a9ecea6a054f35
Gerrit.Nav.setup() now takes a weblinks generator function as a third
parameter. Here's the function signature:
``` js
Gerrit.Nav.setup(navigate, generateUrl, generateWeblinks)
```
Weblinks generator function takes single payload parameter with
`type` property that determines which part of the UI is the consumer of
the weblinks. `type` property can be one of `file`, `change`, or
`patchset`.
For `file` type, payload will also contain string properties:
`repo`, `commit`, `file`.
For `pachset` type, payload will also contain string properties:
`repo`, `commit`.
For `change` type, payload will also contain string properties:
`repo`, `commit`.
If server provides weblinks, those will be passed as `options.weblinks`
property on the main payload object.
Change-Id: I0d9de3a295435304e2b6aad551112440075cf098
Highlights:
* Adds a new getDiffLayers function to gr-js-api-interface.js. This is
invoked by gr-diff-builder.html when gathering annotation layers.
* New annotationApi function in gr-public-js-api.js for plugins to call.
* The annotationApi function returns an instance of the new
GrAnnotationActionsInterface in gr-annotation-actions-js-api.js
* GrAnnotationActionsInterface has an API for the plugin to register an
addLayerFunction and an optional method to call to get a notify callback.
* The new samples/coverage-plugin.html is an end-to-end example of how
to invoke the new APIs to annotate lines.
Bug: Issue 7339
Change-Id: Ie51845e0b3564953aba5d7d41986cedce0337073
Binary files cannot be diffed like text, but for some binary changes,
the diff algorithm does yield binary differences as text. With this
change, the diff builder and processor are taught to render a special
message for (non-image) binary diffs, and will ignore the text
representation of the delta.
Bug: Issue 4031
Change-Id: I2dcdbe9def006de827a37c35c42606bc1c9cf4fc
In embedded scenario, Gerrit.Weblinks.setup may be called to set a
weblinks generator function.
Weblinks generator function takes single payload parameter with
`type` property that determines which part of the UI is the consumer of
the weblinks. `type` property can be one of `file`, `change`, or
`patchset`.
For `file` type, payload will also contain string properties:
`repo`, `commit`, `file`.
For `pachset` type, payload will also contain string properties:
`repo`, `commit`.
For `change` type, payload will also contain string properties:
`repo`, `commit`.
If server provides weblinks, those will be passed as `options.weblinks`
property on the main payload object.
Change-Id: Ie0f9edf959365869aa6eac6413d1efe29b61c9cb
With this change a blame column is added to the left side of diff
tables. The column is empty and hidden until blame is loaded. A button
is added to the change view to trigger a load of the blame for that
diff, as well as a unload it if already loaded. In this stage, the blame
information is non-interactive and only displays the SHA, date and
commit author.
Feature: Issue 6075
Change-Id: Ifcb951265d0e6339094e6b7c9574ec9c69e60b51
Formerly, if a formatted text component tried to render without the
project config (used by inner linked text components) it would
temporarily fall-back to rendering the unformatted (and un-linkified)
text via `.textContent` -- mirroring the behavior of gr-linked-text.
The result is formatted text elements (when rendered without a project
config) appear as one long line of text. Unlike linkification, however,
text can be accurately formatted with or without the project config --
so this disruptive, poor UX is unnecessary.
The formatted text component is updated to format text when the project
config has not provided, and to re-render when the config has been
provided.
In order to propagate project config loads to the formatted text
components hosted by diff comments, the REST calls must be made by the
diff thread component. To make this call, the thread must have the
project's name, so gr-diff-builder is updated to provide this name to
thread components.
Bug: Issue 6686
Change-Id: I8d09c740930500e99cb5f87b92f4d72f3f50a9ce
Formerly, gr-diff would make its own REST calls for diff comments in the
patch range and path being viewed. However, these calls by the diff view
were redundant to the more general comment requests made by either
gr-diff-view (which requests all comments to support skipping to the
next file with comments) or gr-change-view (which requests comments
individually for each inline diff).
With this change, the diff component no longer loads comments for
itself, but is rather provided the comments from its host view via a
public property. In this way the host view can load the more-general
comment data, and filter it down for the diff view's params.
Introduces the gr-comment-api component to simplify loading and
filtering diff comments for use by diff views. By using this new
component:
* The diff view makes only one request for comments (including drafts
and robot comments) to support skipping to the next comment and
displaying comments in the diff view.
* The change view makes only one request for comments for all inline
diffs.
Bug: Issue 5299
Change-Id: Ia14a01619f1f9881aa0d253fd3f49af9a17f3dce
This reverts commit e048852365d1c7fc92bea2f597f117c13140f9a0.
Reason for revert: Highlighting which hunks were introduced by a rebase
is done as best-effort and will be clearly stated as such when we
announce this feature. Hence, we expect at least some false-negatives
at the moment (which we intend to get rid off over time). There aren't
any false-positives which we know of at the moment.
Change-Id: I103dbe8bea98d0bb7a417c02d371c2864dca015d
Previiously, when pressing j/k on a change view and a horizontal line
appeared, in firefox, the rows jumped around a bit, as the bottom
border added an additional pixel of height.
Instead, this change uses a box shadow to simulate a bottom border.
The box shadow approach did not work on the table row, but instead had
to be applied to the table cell itself (in the target row)
Bug: Issue 6079
Change-Id: I7b80ef119f5ef0c8ad6cad51858edf2ac9c325da
While the due_to_rebase signal gives false-positives and false-negatives
(Issue 6583) do not style the marked chunks differently.
Change-Id: Ic716dcf259c4f4f0ef09510e37ce744c1d4082e0
If the user views a very large diff while "Whole file" is enabled in
their preferences, rendering may lock up their browser. With this
change, instead of rendering, users are warned and allowed to bypass the
warning (risking browser lock up) or render with a context that is less
than whole file.
Bug: Issue 6402
Change-Id: I6e97c06598fb5f6900c925127ab6a99693b8aa7f
* changes:
Highlight hunks which are due to rebase on PolyGerrit
Copy due_to_rebase to subgroups in gr-diff-processor
Move diff tests from RevisionIT to RevisionDiffIT
Mark hunks which are present due to a rebase when diffing patch sets