tenseleyflow/shithub / 01ee51f

Browse files

Restyle code tree toolbar

Authored by espadonne
SHA
01ee51ffc1cd81328d8a9acb00c152aaec0bc258
Parents
01c0c76
Tree
385bf28

2 changed files

StatusFile+-
M internal/web/static/css/shithub.css 43 2
M internal/web/templates/repo/tree.html 6 2
internal/web/static/css/shithub.cssmodified
@@ -1000,9 +1000,49 @@ code {
10001000
 .shithub-code-crumbs { font-size: 1rem; }
10011001
 .shithub-code-crumbs a { color: var(--fg-default); }
10021002
 .shithub-code-sep { color: var(--fg-muted); margin: 0 0.25rem; }
1003
-.shithub-code-actions { display: flex; gap: 0.5rem; align-items: center; }
1003
+.shithub-code-actions {
1004
+  display: flex;
1005
+  gap: 0.5rem;
1006
+  align-items: center;
1007
+  min-width: min(100%, 420px);
1008
+  justify-content: flex-end;
1009
+  flex: 1 1 360px;
1010
+}
10041011
 .shithub-code-primary-actions { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
10051012
 .shithub-code-count { color: var(--fg-muted); display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.9rem; }
1013
+.shithub-go-to-file {
1014
+  display: inline-grid;
1015
+  grid-template-columns: 16px minmax(0, 1fr) auto;
1016
+  align-items: center;
1017
+  gap: 0.45rem;
1018
+  min-width: min(100%, 220px);
1019
+  height: 32px;
1020
+  padding: 0 0.55rem;
1021
+  border: 1px solid var(--border-default);
1022
+  border-radius: 6px;
1023
+  background: var(--canvas-default);
1024
+  color: var(--fg-muted);
1025
+  font-size: 0.875rem;
1026
+}
1027
+.shithub-go-to-file:hover {
1028
+  border-color: var(--accent-fg);
1029
+  text-decoration: none;
1030
+}
1031
+.shithub-go-to-file span {
1032
+  overflow: hidden;
1033
+  text-overflow: ellipsis;
1034
+  white-space: nowrap;
1035
+}
1036
+.shithub-go-to-file kbd {
1037
+  min-width: 1.25rem;
1038
+  padding: 0 0.3rem;
1039
+  border: 1px solid var(--border-default);
1040
+  border-radius: 4px;
1041
+  color: var(--fg-muted);
1042
+  background: var(--canvas-subtle);
1043
+  font: 0.75rem ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
1044
+  text-align: center;
1045
+}
10061046
 
10071047
 .shithub-ref-switcher { position: relative; }
10081048
 .shithub-ref-switcher > summary {
@@ -1040,7 +1080,8 @@ code {
10401080
 .shithub-ref-panel strong { display: block; margin: 0.4rem 0 0.2rem; font-size: 0.75rem; color: var(--fg-muted); text-transform: uppercase; }
10411081
 
10421082
 .shithub-clone-dropdown { position: relative; }
1043
-.shithub-clone-dropdown > summary { list-style: none; display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
1083
+.shithub-clone-dropdown > summary { list-style: none; display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; height: 32px; white-space: nowrap; }
1084
+.shithub-clone-dropdown > summary svg:last-child { width: 12px; height: 12px; }
10441085
 .shithub-clone-dropdown > summary::-webkit-details-marker { display: none; }
10451086
 .shithub-clone-panel {
10461087
   position: absolute;
internal/web/templates/repo/tree.htmlmodified
@@ -28,9 +28,13 @@
2828
             <a href="/{{ .Owner }}/{{ .Repo.Name }}/tags" class="shithub-code-count">{{ octicon "tag" }} {{ len .Tags }} Tags</a>
2929
           </div>
3030
           <div class="shithub-code-actions">
31
-            <a href="/{{ .Owner }}/{{ .Repo.Name }}/find/{{ .Ref }}" class="shithub-button">Go to file</a>
31
+            <a href="/{{ .Owner }}/{{ .Repo.Name }}/find/{{ .Ref }}" class="shithub-go-to-file">
32
+              {{ octicon "search" }}
33
+              <span>Go to file</span>
34
+              <kbd>T</kbd>
35
+            </a>
3236
             <details class="shithub-clone-dropdown">
33
-              <summary class="shithub-button shithub-button-primary">{{ octicon "code" }} Code</summary>
37
+              <summary class="shithub-button shithub-button-primary">{{ octicon "code" }} Code {{ octicon "triangle-down" }}</summary>
3438
               <div class="shithub-clone-panel" role="dialog" aria-label="Clone this repository">
3539
                 <div class="shithub-clone-row">
3640
                   <label for="clone-https">Clone with HTTPS</label>