git-reviewer 2.11.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/public/index.html CHANGED
@@ -53,28 +53,51 @@
53
53
  </button>
54
54
  </div>
55
55
  </div>
56
- <div id="status" class="status"></div>
57
-
58
- <div id="scopeBar" class="scope-bar hidden">
59
- <span id="scopeLabel" class="scope-label"></span>
60
- <div class="scope-compare">
61
- <!-- "since", not "from": `base..HEAD` does not include base's own
62
- changes, and a picker that says "compare from x1" invites the
63
- reading that x1 is in the diff. -->
64
- <label for="compareSelect">Changes since</label>
65
- <select id="compareSelect" onchange="compareFromSelection()" aria-label="Review everything after this commit">
66
- <option value="">Pick a commit…</option>
67
- </select>
68
- <input
69
- type="text"
70
- id="compareBase"
71
- placeholder="or a branch, tag or ref"
72
- spellcheck="false"
73
- autocomplete="off"
74
- value="">
75
- <button id="compareBtn" onclick="compareFrom()">Compare</button>
76
- <button id="scopeResetBtn" class="scope-reset hidden" onclick="resetScope()">Back to latest</button>
56
+ <div id="status" class="status hidden" role="status" aria-live="polite"></div>
57
+
58
+ <div id="scopeBar" class="scope-bar hidden" role="region" aria-label="What is being reviewed">
59
+ <div class="scope-summary">
60
+ <div class="scope-text">
61
+ <span id="scopeLabel" class="scope-label"></span>
62
+ <span id="scopeMeta" class="scope-meta"></span>
63
+ </div>
64
+ <div class="scope-actions">
65
+ <div id="commitNav" class="commit-nav hidden" role="group" aria-label="Step through commits">
66
+ <button id="prevCommitBtn" class="scope-action" onclick="stepCommit(-1)"
67
+ title="Older commit ( [ )" aria-label="Older commit">&#8249;</button>
68
+ <span id="commitPosition" class="commit-position"></span>
69
+ <button id="nextCommitBtn" class="scope-action" onclick="stepCommit(1)"
70
+ title="Newer commit ( ] )" aria-label="Newer commit">&#8250;</button>
71
+ </div>
72
+ <button id="allCommitsBtn" class="scope-action hidden" onclick="showAllCommits()">All commits</button>
73
+ <button id="compareToggle" class="scope-action" onclick="openCompare()"
74
+ title="Compare two branches, tags or commits">Compare</button>
75
+ <button id="scopeResetBtn" class="scope-action hidden" onclick="resetScope()">Stop comparing</button>
76
+ </div>
77
77
  </div>
78
+
79
+ <!-- GitHub's vocabulary, deliberately: "base" and "compare" are what
80
+ the people using this already call the two ends of a pull request. -->
81
+ <div id="compareRow" class="compare-row hidden">
82
+ <div class="compare-end">
83
+ <label for="compareBaseSelect">Base</label>
84
+ <select id="compareBaseSelect" onchange="onPickerChange('base')"></select>
85
+ <input id="compareBaseOther" class="compare-other hidden" type="text"
86
+ placeholder="tag, HEAD~5 or sha" spellcheck="false" autocomplete="off"
87
+ aria-label="Base ref">
88
+ </div>
89
+ <button id="compareSwap" class="compare-swap" onclick="swapCompare()"
90
+ title="Swap base and compare" aria-label="Swap base and compare">&#8644;</button>
91
+ <div class="compare-end">
92
+ <label for="compareHeadSelect">Compare</label>
93
+ <select id="compareHeadSelect" onchange="onPickerChange('head')"></select>
94
+ <input id="compareHeadOther" class="compare-other hidden" type="text"
95
+ placeholder="tag, HEAD~5 or sha" spellcheck="false" autocomplete="off"
96
+ aria-label="Compare ref">
97
+ </div>
98
+ </div>
99
+
100
+ <p id="scopeNote" class="scope-note hidden"></p>
78
101
  </div>
79
102
  </header>
80
103
 
@@ -172,7 +195,7 @@
172
195
  <span class="help-keys">
173
196
  <kbd>⌘</kbd><kbd>Enter</kbd> save · <kbd>Esc</kbd> cancel ·
174
197
  <kbd>↑</kbd><kbd>↓</kbd><kbd>j</kbd><kbd>k</kbd> files ·
175
- <kbd>n</kbd><kbd>p</kbd> comments · <kbd>c</kbd> new comment · <kbd>?</kbd> help
198
+ <kbd>n</kbd><kbd>p</kbd> comments · <kbd>[</kbd><kbd>]</kbd> commits · <kbd>c</kbd> new comment · <kbd>?</kbd> help
176
199
  </span>
177
200
  <button class="help-done" onclick="closeHelp()">Got it</button>
178
201
  </div>
@@ -180,6 +203,20 @@
180
203
  </div>
181
204
 
182
205
  <aside id="sidebar" class="sidebar hidden">
206
+ <!-- The commits a review is made of, when it is made of commits. Click
207
+ one to review it on its own; shift-click a second to review the run
208
+ between them -- the same gesture a pull request's commit picker
209
+ uses, so it does not have to be learned twice. -->
210
+ <section id="commitsSection" class="commits-section hidden" aria-labelledby="commitsTitle">
211
+ <div class="sidebar-header">
212
+ <h2 id="commitsTitle">Commits</h2>
213
+ <span id="commitCount" class="file-count"></span>
214
+ </div>
215
+ <p class="commits-hint">Click one · <kbd>Shift</kbd>-click a run · <kbd>[</kbd><kbd>]</kbd> step</p>
216
+ <ol id="commitsList" class="commits-list" role="listbox" aria-label="Commits" aria-multiselectable="true"></ol>
217
+ <p id="commitsTruncated" class="commits-truncated hidden"></p>
218
+ </section>
219
+
183
220
  <div class="sidebar-header">
184
221
  <h2>Changed Files</h2>
185
222
  <span id="fileCount" class="file-count"></span>
package/public/style.css CHANGED
@@ -1878,89 +1878,341 @@ button:disabled {
1878
1878
  text-align: center;
1879
1879
  }
1880
1880
 
1881
- /* What the review is of, and how to change it.
1881
+ /* ---------------------------------------------------------------------------
1882
+ * What the review is of, and how to change it.
1882
1883
  *
1883
- * Its own row under the status line rather than beside the repository
1884
- * controls: choosing a repository and choosing which of its commits to look
1885
- * at are two different decisions, and crowding them made the header read as
1886
- * one long form. */
1884
+ * Its own block under the status line rather than beside the repository
1885
+ * controls: choosing a repository and choosing which two points of it to look
1886
+ * between are different decisions, and crowding them into one row made the
1887
+ * header read as one long form.
1888
+ * ------------------------------------------------------------------------ */
1889
+
1887
1890
  .scope-bar {
1891
+ margin-top: 8px;
1892
+ padding: 10px 12px;
1893
+ border-radius: 6px;
1894
+ background: #f6f8fa;
1895
+ border: 1px solid #e1e4e8;
1896
+ font-size: 13px;
1897
+ color: #24292e;
1898
+ }
1899
+
1900
+ .scope-summary {
1888
1901
  display: flex;
1889
1902
  align-items: center;
1890
1903
  justify-content: space-between;
1891
1904
  flex-wrap: wrap;
1892
1905
  gap: 8px 16px;
1893
- margin-top: 8px;
1894
- padding: 8px 12px;
1895
- border-radius: 6px;
1896
- background: #f3f4f6;
1897
- border-left: 3px solid #6a737d;
1898
- font-size: 13px;
1899
1906
  }
1900
1907
 
1901
- /* The scope reads as a sentence rather than a field label, because the case
1902
- * that matters most is "9 commits, and no net change" — which has to be
1903
- * legible as an explanation, not as a value. */
1904
- .scope-label {
1905
- color: #24292e;
1908
+ /* The scope reads as a sentence -- "main → feature/auth" -- rather than as a
1909
+ * labelled field, because the names are the information. */
1910
+ .scope-text {
1911
+ display: flex;
1912
+ align-items: baseline;
1913
+ flex-wrap: wrap;
1914
+ gap: 4px 12px;
1906
1915
  min-width: 0;
1907
1916
  }
1908
1917
 
1909
- .scope-compare {
1918
+ .scope-label {
1919
+ font-size: 14px;
1920
+ overflow-wrap: anywhere;
1921
+ }
1922
+
1923
+ .scope-label strong {
1924
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
1925
+ font-size: 13px;
1926
+ font-weight: 600;
1927
+ padding: 1px 6px;
1928
+ border-radius: 4px;
1929
+ background: #fff;
1930
+ border: 1px solid #d1d5da;
1931
+ }
1932
+
1933
+ .scope-meta {
1934
+ color: #586069;
1935
+ }
1936
+
1937
+ .scope-actions {
1910
1938
  display: flex;
1911
- align-items: center;
1912
1939
  gap: 8px;
1913
1940
  flex-shrink: 0;
1914
1941
  }
1915
1942
 
1916
- .scope-compare label {
1917
- color: #6a737d;
1918
- white-space: nowrap;
1943
+ /* Secondary buttons. The :hover rule is not optional: `button:hover` sets the
1944
+ * primary blue and outranks a single class on specificity, so a secondary
1945
+ * button without its own hover rule turns into dark text on dark blue the
1946
+ * moment the pointer reaches it. That shipped once, on "Back to latest". */
1947
+ .scope-action,
1948
+ .compare-swap {
1949
+ background: #fff;
1950
+ color: #24292e;
1951
+ border: 1px solid #d1d5da;
1952
+ padding: 5px 12px;
1953
+ font-size: 13px;
1919
1954
  }
1920
1955
 
1921
- .scope-compare input {
1922
- width: 190px;
1923
- font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
1924
- font-size: 12px;
1956
+ .scope-action:hover,
1957
+ .compare-swap:hover {
1958
+ background: #f3f4f6;
1959
+ border-color: #b8bec6;
1925
1960
  }
1926
1961
 
1927
- .scope-reset {
1928
- background: transparent;
1962
+ .scope-action:focus-visible,
1963
+ .compare-swap:focus-visible,
1964
+ .compare-end select:focus-visible,
1965
+ .compare-other:focus-visible {
1966
+ outline: 2px solid #0366d6;
1967
+ outline-offset: 1px;
1968
+ }
1969
+
1970
+ .compare-row {
1971
+ display: flex;
1972
+ align-items: flex-end;
1973
+ flex-wrap: wrap;
1974
+ gap: 8px 10px;
1975
+ margin-top: 10px;
1976
+ padding-top: 10px;
1977
+ border-top: 1px solid #e1e4e8;
1978
+ }
1979
+
1980
+ .compare-end {
1981
+ display: flex;
1982
+ flex-direction: column;
1983
+ gap: 4px;
1984
+ flex: 1 1 240px;
1985
+ min-width: 0;
1986
+ }
1987
+
1988
+ .compare-end label {
1989
+ font-size: 11px;
1990
+ font-weight: 600;
1991
+ text-transform: uppercase;
1992
+ letter-spacing: 0.04em;
1993
+ color: #586069;
1994
+ }
1995
+
1996
+ .compare-end select,
1997
+ .compare-other {
1998
+ width: 100%;
1999
+ min-width: 0;
2000
+ font-size: 13px;
2001
+ padding: 6px 8px;
1929
2002
  border: 1px solid #d1d5da;
2003
+ border-radius: 6px;
2004
+ background: #fff;
1930
2005
  color: #24292e;
1931
2006
  }
1932
2007
 
2008
+ .compare-other {
2009
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
2010
+ font-size: 12px;
2011
+ }
2012
+
2013
+ .compare-swap {
2014
+ flex: 0 0 auto;
2015
+ font-size: 16px;
2016
+ line-height: 1;
2017
+ padding: 7px 10px;
2018
+ }
2019
+
2020
+ /* Why the file list looks the way it does. Its own line, in the same quiet
2021
+ * voice as the meta text: this is explanation, not a warning. An empty
2022
+ * comparison is a real answer, and it must not be dressed as an error. */
2023
+ .scope-note {
2024
+ margin: 10px 0 0;
2025
+ color: #586069;
2026
+ line-height: 1.45;
2027
+ }
2028
+
2029
+ .files-empty {
2030
+ padding: 16px 12px;
2031
+ color: #586069;
2032
+ font-size: 13px;
2033
+ line-height: 1.45;
2034
+ }
2035
+
2036
+ /* Narrow screens: the two ends stack, and the swap button sits between them
2037
+ * rather than overflowing the bar -- which the single-row version did, at
2038
+ * 760px, with the Compare button hanging off the right edge. */
1933
2039
  @media (max-width: 720px) {
1934
- .scope-compare input {
1935
- width: 120px;
2040
+ .compare-row {
2041
+ flex-direction: column;
2042
+ align-items: stretch;
2043
+ }
2044
+
2045
+ .compare-end {
2046
+ flex: 1 1 auto;
2047
+ }
2048
+
2049
+ .compare-swap {
2050
+ align-self: center;
2051
+ transform: rotate(90deg);
2052
+ }
2053
+
2054
+ .scope-actions {
2055
+ width: 100%;
1936
2056
  }
1937
2057
  }
1938
2058
 
1939
- /* The picker carries the common case; the text box beside it carries
1940
- * everything else — a branch, a tag, `HEAD~5`, a sha from somewhere else.
1941
- * Both stay visible rather than one hiding behind a mode, because a control
1942
- * you cannot see is a feature people believe is missing. */
1943
- .scope-compare select {
1944
- max-width: 320px;
1945
- font-size: 12px;
1946
- padding: 4px 6px;
2059
+ /* A comment on a file that is not in the current comparison. Kept, not
2060
+ * lost -- dimmed so it reads as "elsewhere", with a line saying so, because a
2061
+ * sidebar entry that looks attached but goes nowhere when clicked reads as a
2062
+ * bug. */
2063
+ .comment-item-elsewhere {
2064
+ opacity: 0.72;
2065
+ }
2066
+
2067
+ .comment-item-elsewhere-note {
2068
+ margin-top: 6px;
2069
+ font-size: 11px;
2070
+ font-weight: 600;
2071
+ text-transform: uppercase;
2072
+ letter-spacing: 0.04em;
2073
+ color: #6a737d;
2074
+ }
2075
+
2076
+ /* ---------------------------------------------------------------------------
2077
+ * Commits: the ones a review is made of, above the files they touch.
2078
+ * ------------------------------------------------------------------------ */
2079
+
2080
+ .commits-section {
2081
+ border-bottom: 1px solid #e1e4e8;
2082
+ }
2083
+
2084
+ .commits-hint {
2085
+ margin: 0;
2086
+ padding: 0 20px 8px;
2087
+ font-size: 11px;
2088
+ color: #6a737d;
2089
+ }
2090
+
2091
+ .commits-hint kbd {
2092
+ font-size: 10px;
2093
+ padding: 0 4px;
1947
2094
  border: 1px solid #d1d5da;
2095
+ border-bottom-width: 2px;
2096
+ border-radius: 3px;
2097
+ background: #fafbfc;
2098
+ }
2099
+
2100
+ /* A bounded height, so a branch of forty commits does not push the files it
2101
+ * touches off the bottom of the sidebar. */
2102
+ .commits-list {
2103
+ list-style: none;
2104
+ margin: 0;
2105
+ padding: 0 8px 8px;
2106
+ max-height: 34vh;
2107
+ overflow-y: auto;
2108
+ }
2109
+
2110
+ .commit-item {
2111
+ display: flex;
2112
+ align-items: baseline;
2113
+ gap: 8px;
2114
+ padding: 6px 10px;
2115
+ margin: 2px 0;
1948
2116
  border-radius: 6px;
1949
- background: #fff;
2117
+ border-left: 3px solid transparent;
2118
+ font-size: 12px;
2119
+ cursor: pointer;
2120
+ user-select: none;
2121
+ }
2122
+
2123
+ .commit-item:hover {
2124
+ background: #f3f4f6;
2125
+ }
2126
+
2127
+ .commit-item:focus-visible {
2128
+ outline: 2px solid #0366d6;
2129
+ outline-offset: -2px;
2130
+ }
2131
+
2132
+ .commit-item-selected {
2133
+ background: #f1f8ff;
2134
+ border-left-color: #0366d6;
2135
+ }
2136
+
2137
+ .commit-sha {
2138
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
2139
+ font-size: 11px;
2140
+ color: #0366d6;
2141
+ flex-shrink: 0;
2142
+ }
2143
+
2144
+ .commit-subject {
2145
+ flex: 1;
2146
+ min-width: 0;
2147
+ overflow: hidden;
2148
+ text-overflow: ellipsis;
2149
+ white-space: nowrap;
1950
2150
  color: #24292e;
1951
2151
  }
1952
2152
 
1953
- .scope-compare select:disabled {
2153
+ .commit-when {
2154
+ flex-shrink: 0;
2155
+ font-size: 11px;
1954
2156
  color: #6a737d;
1955
- background: #f3f4f6;
1956
2157
  }
1957
2158
 
1958
- @media (max-width: 720px) {
1959
- .scope-compare {
1960
- flex-wrap: wrap;
1961
- }
2159
+ .commit-merge {
2160
+ flex-shrink: 0;
2161
+ font-size: 10px;
2162
+ font-weight: 600;
2163
+ text-transform: uppercase;
2164
+ color: #6f42c1;
2165
+ }
1962
2166
 
1963
- .scope-compare select {
1964
- max-width: 100%;
1965
- }
2167
+ .commits-truncated {
2168
+ margin: 0;
2169
+ padding: 0 20px 8px;
2170
+ font-size: 11px;
2171
+ color: #6a737d;
2172
+ }
2173
+
2174
+ /* Stepping one commit at a time, from the scope bar. */
2175
+ .commit-nav {
2176
+ display: flex;
2177
+ align-items: center;
2178
+ gap: 4px;
2179
+ }
2180
+
2181
+ .commit-nav .scope-action {
2182
+ padding: 5px 10px;
2183
+ font-size: 15px;
2184
+ line-height: 1;
2185
+ }
2186
+
2187
+ .commit-nav .scope-action:disabled {
2188
+ opacity: 0.4;
2189
+ cursor: default;
2190
+ }
2191
+
2192
+ .commit-nav .scope-action:disabled:hover {
2193
+ background: #fff;
2194
+ border-color: #d1d5da;
2195
+ }
2196
+
2197
+ .commit-position {
2198
+ min-width: 0;
2199
+ font-size: 12px;
2200
+ color: #586069;
2201
+ white-space: nowrap;
2202
+ }
2203
+
2204
+ .commit-position:empty {
2205
+ display: none;
2206
+ }
2207
+
2208
+ /* A commit message keeps its own line breaks; it is prose someone wrote in
2209
+ * paragraphs, and reflowing it into one line loses its lists. */
2210
+ .scope-note-message {
2211
+ white-space: pre-line;
2212
+ font-size: 13px;
2213
+ color: #24292e;
2214
+ padding-left: 10px;
2215
+ border-left: 3px solid #d1d5da;
2216
+ max-height: 8.5em;
2217
+ overflow-y: auto;
1966
2218
  }