Mark private repos with a lock in the sidebar

This commit is contained in:
Rūdolfs Ošiņš
2026-09-09 14:51:14 +02:00
parent 5f86b10f05
commit 4c899537ab
4 changed files with 13 additions and 1 deletions
@@ -1,3 +1,3 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
export type RepoSummary = { rid: string; name: string };
export type RepoSummary = { rid: string; name: string; private: boolean };
+1
View File
@@ -18,6 +18,7 @@ pub struct RepoSummary {
#[ts(as = "String")]
pub rid: identity::RepoId,
pub name: String,
pub private: bool,
}
#[derive(Serialize, TS)]
+1
View File
@@ -408,6 +408,7 @@ pub trait Repo: Profile {
entries.push(repo::RepoSummary {
rid,
name: data.name,
private: doc.is_private(),
});
}
+10
View File
@@ -525,6 +525,11 @@
background-color: var(--color-surface-mid);
}
.private-icon {
display: inline-flex;
flex-shrink: 0;
color: var(--color-text-tertiary);
}
/* Out of flow: hidden, they still reserved a button's width on every row.
They sit over the end of the name instead, on the row's own fill. */
.nav-item .row-actions {
@@ -860,6 +865,11 @@
href={router.routeToPath({ resource: "repo.home", rid: repo.rid })}>
<RepoAvatar name={repo.name} rid={repo.rid} styleWidth="1rem" />
<span class="txt-overflow label">{repo.name}</span>
{#if repo.private}
<span class="private-icon" title="Private repository">
<Icon name="lock" />
</span>
{/if}
<span
class="row-actions"
role="none"