tenseleyflow/shithub / 7a33fd5

Browse files

Wire global navbar shortcuts

Authored by mfwolffe <wolffemf@dukes.jmu.edu>
SHA
7a33fd55e6bfd10841d507f4d00e564eaabd1f71
Parents
949c68a
Tree
a91bcb1

3 changed files

StatusFile+-
A docs/internal/global-navigation.md 33 0
M internal/web/templates/_nav.html 19 2
M internal/web/templates/_nav_offcanvas.html 3 3
docs/internal/global-navigation.mdadded
@@ -0,0 +1,33 @@
1
+# Global Navigation And Dashboard Lists
2
+
3
+The authenticated global navigation mirrors GitHub's non-Copilot dashboard
4
+shortcuts:
5
+
6
+| Surface | Route | Notes |
7
+| --- | --- | --- |
8
+| All issues | `/issues/assigned` | Left-rail views for assigned, created, mentioned, and recent activity. |
9
+| All pull requests | `/pulls` | Tabs for created, assigned, mentioned, and review requests. |
10
+| All repositories | `/repos` | Left-rail views for contributions, owned repositories, forks, and admin access. |
11
+| Notifications | `/notifications?filter=unread` | Uses the S29 notification inbox. |
12
+| New issue | `/issues/new` | Repository chooser that links into the existing repo-scoped issue form. |
13
+
14
+These pages are authenticated browser surfaces. They reuse the canonical
15
+repository visibility predicate from `internal/auth/policy` for list queries.
16
+Issue and pull-request relationship filters use existing relational state:
17
+
18
+- `issue_assignees` for assigned items.
19
+- `issues.author_user_id` for created items.
20
+- `notifications` / `notification_threads` reason rows for mentions and review
21
+  requests.
22
+- `notification_threads.subscribed` plus author/assignee state for recent
23
+  activity.
24
+
25
+The dashboard query inputs intentionally display GitHub-style search strings
26
+(`is:issue state:open assignee:@me ...`) while the first implementation parses
27
+only enough to preserve state and free-text filtering. Rich GitHub search
28
+operators for these dashboard lists should move into the search parser before
29
+being advertised as complete syntax support.
30
+
31
+The global create menu excludes Copilot/agent actions by project policy. Entries
32
+without a backing shithub feature, such as import repository and projects, render
33
+disabled until their owning sprints ship.
internal/web/templates/_nav.htmlmodified
@@ -34,8 +34,25 @@
3434
     {{ end }}
3535
     <div class="shithub-nav-actions">
3636
   {{- if .Viewer.ID }}
37
-    <a href="/notifications" class="shithub-button shithub-button-ghost" title="Notifications" aria-label="Notifications">{{ octicon "bell" }}</a>
38
-    <a href="/new" class="shithub-button shithub-button-ghost shithub-nav-new" title="New repository">{{ octicon "plus" }} <span class="shithub-nav-new-label">New</span></a>
37
+    <a href="/settings/organizations" class="shithub-button shithub-button-ghost shithub-button-icon shithub-nav-icon" title="Your organizations" aria-label="Your organizations">{{ octicon "people" }}</a>
38
+    <span class="shithub-nav-actions-divider" aria-hidden="true"></span>
39
+    <details class="shithub-nav-action-menu shithub-create-menu">
40
+      <summary class="shithub-button shithub-button-ghost shithub-nav-create" aria-label="Create new" title="Create new">
41
+        {{ octicon "plus" }} {{ octicon "triangle-down" }}
42
+      </summary>
43
+      <div class="shithub-nav-action-panel" role="menu">
44
+        <a role="menuitem" class="shithub-nav-action-item" href="/issues/new">{{ octicon "issue-opened" }} <span>New issue</span></a>
45
+        <a role="menuitem" class="shithub-nav-action-item" href="/new">{{ octicon "repo" }} <span>New repository</span></a>
46
+        <span role="menuitem" aria-disabled="true" class="shithub-nav-action-item is-disabled">{{ octicon "upload" }} <span>Import repository</span></span>
47
+        <div class="shithub-nav-action-divider" role="separator"></div>
48
+        <a role="menuitem" class="shithub-nav-action-item" href="/organizations/new">{{ octicon "organization" }} <span>New organization</span></a>
49
+        <span role="menuitem" aria-disabled="true" class="shithub-nav-action-item is-disabled">{{ octicon "table" }} <span>New project</span></span>
50
+      </div>
51
+    </details>
52
+    <a href="/issues/assigned" class="shithub-button shithub-button-ghost shithub-button-icon shithub-nav-icon" title="All issues" aria-label="All issues">{{ octicon "issue-opened" }}</a>
53
+    <a href="/pulls" class="shithub-button shithub-button-ghost shithub-button-icon shithub-nav-icon" title="All pull requests" aria-label="All pull requests">{{ octicon "git-pull-request" }}</a>
54
+    <a href="/repos" class="shithub-button shithub-button-ghost shithub-button-icon shithub-nav-icon" title="All repositories" aria-label="All repositories">{{ octicon "repo" }}</a>
55
+    <a href="/notifications?filter=unread" class="shithub-button shithub-button-ghost shithub-button-icon shithub-nav-icon" title="Notifications" aria-label="Notifications">{{ octicon "bell" }}</a>
3956
     <details class="shithub-user-menu">
4057
       <summary aria-label="User menu" aria-haspopup="menu">
4158
         <img src="/avatars/{{ .Viewer.Username }}" alt="" class="shithub-user-menu-avatar" width="24" height="24">
internal/web/templates/_nav_offcanvas.htmlmodified
@@ -13,9 +13,9 @@
1313
       {{ else }}
1414
       <a href="/" class="shithub-offcanvas-link">{{ octicon "home" }} <span>Home</span></a>
1515
       {{ end }}
16
-      <a href="/search?type=issues" class="shithub-offcanvas-link">{{ octicon "issue-opened" }} <span>All issues</span></a>
17
-      <a href="/search?type=pullrequests" class="shithub-offcanvas-link">{{ octicon "git-pull-request" }} <span>All pull requests</span></a>
18
-      <a href="/search?type=repositories" class="shithub-offcanvas-link">{{ octicon "repo" }} <span>All repositories</span></a>
16
+      <a href="{{ if .Viewer.ID }}/issues/assigned{{ else }}/search?type=issues{{ end }}" class="shithub-offcanvas-link">{{ octicon "issue-opened" }} <span>All issues</span></a>
17
+      <a href="{{ if .Viewer.ID }}/pulls{{ else }}/search?type=pullrequests{{ end }}" class="shithub-offcanvas-link">{{ octicon "git-pull-request" }} <span>All pull requests</span></a>
18
+      <a href="{{ if .Viewer.ID }}/repos{{ else }}/search?type=repositories{{ end }}" class="shithub-offcanvas-link">{{ octicon "repo" }} <span>All repositories</span></a>
1919
       <a href="/projects" class="shithub-offcanvas-link">{{ octicon "table" }} <span>Projects</span></a>
2020
       <a href="/discussions" class="shithub-offcanvas-link">{{ octicon "comment-discussion" }} <span>Discussions</span></a>
2121
       <a href="/codespaces" class="shithub-offcanvas-link">{{ octicon "code-square" }} <span>Codespaces</span></a>