tenseleyflow/shithub / 30664c2

Browse files

Disable deferred org tabs

Authored by espadonne
SHA
30664c29d7c162d6a152a0e53930df00ffba18cf
Parents
d882795
Tree
334f971

3 changed files

StatusFile+-
M docs/internal/orgs.md 35 15
M internal/web/static/css/shithub.css 13 0
M internal/web/templates/orgs/profile.html 8 9
docs/internal/orgs.mdmodified
@@ -32,6 +32,35 @@ POST /invitations/{token}/accept
3232
 POST /invitations/{token}/decline
3333
 ```
3434
 
35
+## Organization profile
36
+
37
+`GET /{slug}` renders a GitHub-style organization overview when
38
+`principals.Resolve` returns `kind='org'`.
39
+
40
+The overview data is built in `internal/web/handlers/profile`:
41
+
42
+* org identity header with slug, display name, description, location,
43
+  website, avatar fallback, and owner/member view state.
44
+* org underline nav with Overview active, repository and member counts,
45
+  links to the shipped people/teams surfaces, and disabled parity tabs
46
+  for deferred GitHub org sections.
47
+* pinned repo cards derived from the viewer-visible org repos, sorted
48
+  by stars and recent update time until a first-class pin table ships.
49
+* recent visible repositories, sorted by `updated_at`, with visibility
50
+  badges, language, license, star/fork counts, topics, and update time.
51
+* right rail aggregates for people, top primary languages, and most
52
+  used topics.
53
+
54
+Repo visibility is filtered through `policy.IsVisibleTo` using an actor
55
+constructed from `middleware.CurrentUser`, including suspension,
56
+site-admin, and impersonation write-mode fields. Anonymous viewers only
57
+see public repositories; members and owners see whatever the policy
58
+layer grants them.
59
+
60
+There is no dedicated `/orgs/{org}/repositories` page yet. The Overview
61
+nav's Repositories item anchors to the homepage repository list until a
62
+full org repositories tab lands.
63
+
3564
 `/{slug}` resolution flow inside `internal/web/handlers/profile/profile.go`:
3665
 
3766
 1. Reserved-name check (defense in depth — chi already matches static
@@ -43,8 +72,8 @@ POST /invitations/{token}/decline
4372
 
4473
 ## Member roles
4574
 
46
-* `owner` → implicit `admin` on every org-owned repo (policy hook
47
-  forthcoming).
75
+* `owner` → implicit `admin` on every org-owned repo through
76
+  `policy.Can`.
4877
 * `member` → org-membership badge; no implicit access to private repos.
4978
   Repo-level access is granted via direct collaboration (S15) or
5079
   teams (S31).
@@ -88,19 +117,10 @@ old slug for 301s during the rename cooldown.
88117
   (each one gets a regenerated model). Org renames aren't in the
89118
   S30 DoD; deferred to a follow-up sprint that owns the rename
90119
   refactor end to end.
91
-* **Owner-implicit-admin in policy.Can**. The `org_members.role`
92
-  shape is in place; wiring it into `policy.Can` so org owners
93
-  automatically get `admin` on org-owned repos lands when the
94
-  policy refactor next touches the repo-permission resolver.
95
-* **Repo creation owner picker**. Repo create form still defaults
96
-  to user-owner; extending the picker to list orgs the viewer is a
97
-  member of (and honoring `allow_member_repo_create`) is one
98
-  follow-up handler change.
99
-* **Org-level audit log surface**, **suspension UI**, **soft-delete
100
-  + grace + `org:hard_delete` worker**, **org settings page**,
101
-  **avatar upload**, **email notifications for invite / role-change
102
-  / remove**. Schema columns are present; UI + worker land in
103
-  follow-ups.
120
+* **Org-level audit log surface**, **suspension UI**, **org settings
121
+  page**, **avatar upload**, **email notifications for role-change /
122
+  remove / suspension / deletion**. Schema columns are present; UI and
123
+  notification fan-out land in follow-ups.
104124
 * **Org renaming via `principal_redirects`** — depends on the
105125
   rename refactor.
106126
 * **Daily digest / billing / SAML** — post-MVP per spec.
internal/web/static/css/shithub.cssmodified
@@ -215,6 +215,10 @@ code {
215215
   border: 1px solid transparent;
216216
   cursor: pointer;
217217
 }
218
+.shithub-button:disabled {
219
+  cursor: default;
220
+  opacity: 0.65;
221
+}
218222
 .shithub-button-small {
219223
   padding: 0.25rem 0.7rem;
220224
   font-size: 0.75rem;
@@ -1243,6 +1247,14 @@ code {
12431247
   border-bottom-color: #fd8c73;
12441248
   font-weight: 600;
12451249
 }
1250
+.shithub-org-nav-item.is-disabled {
1251
+  color: var(--fg-muted);
1252
+  cursor: default;
1253
+}
1254
+.shithub-org-nav-item.is-disabled:hover {
1255
+  background: transparent;
1256
+  border-radius: 0;
1257
+}
12461258
 .shithub-org-layout {
12471259
   display: grid;
12481260
   grid-template-columns: minmax(0, 2fr) minmax(260px, 0.72fr);
@@ -1452,6 +1464,7 @@ code {
14521464
 .shithub-org-viewas {
14531465
   width: 100%;
14541466
   justify-content: center;
1467
+  cursor: default;
14551468
 }
14561469
 .shithub-org-people-strip {
14571470
   display: flex;
internal/web/templates/orgs/profile.htmlmodified
@@ -13,7 +13,7 @@
1313
         </ul>
1414
       </div>
1515
       <div class="shithub-org-hero-actions">
16
-        {{ if .IsOwner }}<a href="/{{ .Org.Slug }}/settings/profile" class="shithub-button">Settings</a>{{ else }}<button type="button" class="shithub-button">Follow</button>{{ end }}
16
+        {{ if .IsOwner }}<button type="button" class="shithub-button" disabled>Settings</button>{{ else }}<button type="button" class="shithub-button" disabled>Follow</button>{{ end }}
1717
       </div>
1818
     </div>
1919
   </header>
@@ -21,13 +21,13 @@
2121
   <nav class="shithub-org-nav" aria-label="Organization">
2222
     <a href="/{{ .Org.Slug }}" class="shithub-org-nav-item is-active">{{ octicon "home" }} Overview</a>
2323
     <a href="#org-repositories" class="shithub-org-nav-item">{{ octicon "repo" }} Repositories <span class="shithub-tab-count">{{ .RepoCount }}</span></a>
24
-    <a href="/{{ .Org.Slug }}/projects" class="shithub-org-nav-item">{{ octicon "table" }} Projects</a>
25
-    <a href="/{{ .Org.Slug }}/packages" class="shithub-org-nav-item">{{ octicon "package" }} Packages</a>
24
+    <span class="shithub-org-nav-item is-disabled" aria-disabled="true">{{ octicon "table" }} Projects</span>
25
+    <span class="shithub-org-nav-item is-disabled" aria-disabled="true">{{ octicon "package" }} Packages</span>
2626
     <a href="/{{ .Org.Slug }}/teams" class="shithub-org-nav-item">{{ octicon "people" }} Teams</a>
2727
     <a href="/{{ .Org.Slug }}/people" class="shithub-org-nav-item">{{ octicon "person" }} People <span class="shithub-tab-count">{{ .MemberCount }}</span></a>
28
-    <a href="/{{ .Org.Slug }}/security" class="shithub-org-nav-item">{{ octicon "shield-check" }} Security and quality</a>
29
-    <a href="/{{ .Org.Slug }}/insights" class="shithub-org-nav-item">{{ octicon "pulse" }} Insights</a>
30
-    {{ if .IsOwner }}<a href="/{{ .Org.Slug }}/settings/profile" class="shithub-org-nav-item">{{ octicon "gear" }} Settings</a>{{ end }}
28
+    <span class="shithub-org-nav-item is-disabled" aria-disabled="true">{{ octicon "shield-check" }} Security and quality</span>
29
+    <span class="shithub-org-nav-item is-disabled" aria-disabled="true">{{ octicon "pulse" }} Insights</span>
30
+    {{ if .IsOwner }}<span class="shithub-org-nav-item is-disabled" aria-disabled="true">{{ octicon "gear" }} Settings</span>{{ end }}
3131
   </nav>
3232
 
3333
   {{ if .Org.SuspendedAt.Valid }}
@@ -40,7 +40,7 @@
4040
       <section class="shithub-org-pinned" aria-labelledby="org-pinned-heading">
4141
         <div class="shithub-org-section-head">
4242
           <h2 id="org-pinned-heading">Pinned</h2>
43
-          {{ if .IsOwner }}<a href="/{{ .Org.Slug }}/settings/profile">Customize pins</a>{{ end }}
43
+          {{ if .IsOwner }}<span class="shithub-muted">Customize pins</span>{{ end }}
4444
         </div>
4545
         <ol class="shithub-org-pinned-grid">
4646
         {{ range .PinnedRepos }}
@@ -125,14 +125,13 @@
125125
 
126126
     <aside class="shithub-org-sidebar" aria-label="Organization sidebar">
127127
       <section class="shithub-org-sidebox">
128
-        <button type="button" class="shithub-button shithub-org-viewas">{{ octicon "eye" }} View as: {{ .ViewAs }}</button>
128
+        <span class="shithub-button shithub-org-viewas" aria-label="View mode">{{ octicon "eye" }} View as: {{ .ViewAs }}</span>
129129
         <p>You are viewing the public profile, README, and visible repositories for this organization.</p>
130130
       </section>
131131
 
132132
       <section class="shithub-org-sidebox">
133133
         <h2>Discussions</h2>
134134
         <p>Set up discussions to engage with your community.</p>
135
-        {{ if .IsOwner }}<a href="/{{ .Org.Slug }}/settings/profile">Turn on discussions</a>{{ end }}
136135
       </section>
137136
 
138137
       <section class="shithub-org-sidebox">