Redesign app with new UI kit

Redesign the entire app with a new UI kit. Typography, colors, icons,
avatars, and border radii have all been updated for a more polished,
consistent appearance that matches our other products like
radicle-explorer.

- Replace blockies-based avatars with a new DID-based avatar system
- Move Settings and Create Issue into fullscreen modals
- Change the default theme to follow the system theme
- Remove window decorations on macOS for a cleaner, more native feel
- Update the app icon
- Fix popovers and tooltips

Navigation:

- Rewrite app navigation and layouts
- Add a sidebar that gives you access to all your repos
- Change the startup screen to open directly to the notification inbox
- Add a getting started guide shown to new users on first launch

Settings:

- Add a setting to disable the notification badge
- Add a code font setting

Bug fixes:

- Fix reactions and edits incorrectly targeting the root comment
  instead of the intended reply
- Restrict issue/patch state, labels and assignees to delegates only
This commit is contained in:
Rūdolfs Ošiņš
2026-03-20 17:48:38 -06:00
parent 656ddd172c
commit 010cac0377
169 changed files with 7419 additions and 10008 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
on:
pull_request:
paths:
- 'arch/**'
- "arch/**"
push:
paths:
- 'arch/**'
- "arch/**"
workflow_dispatch:
jobs:
@@ -15,6 +15,7 @@
"core:tray:default",
"core:webview:default",
"core:window:allow-set-badge-count",
"core:window:allow-start-dragging",
"core:window:default",
"dialog:default",
"log:default",
+3 -1
View File
@@ -14,7 +14,9 @@
{
"title": "Radicle",
"minWidth": 960,
"minHeight": 600
"minHeight": 600,
"titleBarStyle": "Overlay",
"hiddenTitle": true
}
],
"security": {
+3
View File
@@ -3,6 +3,9 @@ name = "radicle-types"
version = "0.1.0"
edition = "2021"
[lib]
doctest = false
[dependencies]
anyhow = { version = "1.0.90" }
axum = { version = "0.8.1", default-features = false, features = ["json"] }
+3
View File
@@ -5,6 +5,9 @@ homepage = "https://radicle.xyz"
version = "0.1.0"
edition = "2021"
[lib]
doctest = false
[dependencies]
anyhow = { version = "1.0.90" }
axum = { version = "0.8.1", default-features = false, features = ["json", "query", "tokio", "http1"] }
+12 -10
View File
@@ -3,9 +3,17 @@
<head>
<script>
// Avoid flickering on app start.
if (localStorage.getItem("theme") === "dark") {
const storedTheme = localStorage.getItem("theme");
if (storedTheme === "dark" || storedTheme === "light") {
document.documentElement.setAttribute("data-theme", storedTheme);
} else if (window.matchMedia("(prefers-color-scheme: dark)").matches) {
document.documentElement.setAttribute("data-theme", "dark");
}
const codefont = localStorage.getItem("codefont");
document.documentElement.setAttribute(
"data-codefont",
codefont === "system" ? "system" : "jetbrains",
);
</script>
<meta charset="UTF-8" />
<link rel="icon" href="/radicle.svg" type="image/svg+xml" />
@@ -13,25 +21,19 @@
<title>Radicle</title>
<link
rel="preload"
href="/fonts/Inter-Regular.woff2"
href="/fonts/Booton-Regular.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
<link
rel="preload"
href="/fonts/Inter-Medium.woff2"
href="/fonts/Booton-Medium.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
<link
rel="preload"
href="/fonts/Inter-SemiBold.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
<link
rel="preload"
href="/fonts/Inter-Bold.woff2"
href="/fonts/Booton-SemiBold.woff2"
as="font"
type="font/woff2"
crossorigin="anonymous" />
+26
View File
@@ -10,6 +10,7 @@
"hasInstallScript": true,
"license": "GPL-3.0-only",
"dependencies": {
"@floating-ui/dom": "^1.7.6",
"@tauri-apps/api": "^2.5.0",
"@tauri-apps/plugin-clipboard-manager": "^2.2.2",
"@tauri-apps/plugin-dialog": "^2.2.1",
@@ -633,6 +634,31 @@
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
},
"node_modules/@floating-ui/core": {
"version": "1.7.5",
"resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.5.tgz",
"integrity": "sha512-1Ih4WTWyw0+lKyFMcBHGbb5U5FtuHJuujoyyr5zTaWS5EYMeT6Jb2AuDeftsCsEuchO+mM2ij5+q9crhydzLhQ==",
"license": "MIT",
"dependencies": {
"@floating-ui/utils": "^0.2.11"
}
},
"node_modules/@floating-ui/dom": {
"version": "1.7.6",
"resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.6.tgz",
"integrity": "sha512-9gZSAI5XM36880PPMm//9dfiEngYoC6Am2izES1FF406YFsjvyBMmeJ2g4SAju3xWwtuynNRFL2s9hgxpLI5SQ==",
"license": "MIT",
"dependencies": {
"@floating-ui/core": "^1.7.5",
"@floating-ui/utils": "^0.2.11"
}
},
"node_modules/@floating-ui/utils": {
"version": "0.2.11",
"resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.11.tgz",
"integrity": "sha512-RiB/yIh78pcIxl6lLMG0CgBXAZ2Y0eVHqMPYugu+9U0AeT6YBeiJpf7lbdJNIugFP5SIjwNRgo4DhR1Qxi26Gg==",
"license": "MIT"
},
"node_modules/@hapi/hoek": {
"version": "9.3.0",
"resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz",
+1
View File
@@ -25,6 +25,7 @@
},
"license": "GPL-3.0-only",
"dependencies": {
"@floating-ui/dom": "^1.7.6",
"@tauri-apps/api": "^2.5.0",
"@tauri-apps/plugin-clipboard-manager": "^2.2.2",
"@tauri-apps/plugin-dialog": "^2.2.1",
+308 -128
View File
@@ -1,133 +1,313 @@
/* Light theme. */
:root {
--color-background-default: #ebebff;
--color-background-float: #f5f5ff;
--color-background-dip: #dbdbff;
--color-foreground-contrast: #232563;
--color-foreground-dim: #5c5c70;
--color-foreground-emphasized: #7070ff;
--color-foreground-emphasized-hover: #7070ff;
--color-foreground-match-background: #ebebff;
--color-foreground-white: #ffffff;
--color-foreground-black: #000000;
--color-foreground-primary: #ff55ff;
--color-foreground-primary-hover: #ff8fff;
--color-foreground-success: #4fa877;
--color-foreground-red: #aa5078;
--color-foreground-yellow: #b29401;
--color-foreground-disabled: #9b9bb1;
--color-border-hint: #dbdbff;
--color-border-default: #ccceff;
--color-border-focus: #7070ff;
--color-border-contrast: #25262d;
--color-border-error: #ce97af;
--color-border-merged: #ffe5ff;
--color-border-match-background: #ebebff;
--color-border-primary: #ff1aff;
--color-border-primary-hover: #ff55ff;
--color-border-selected: #dbdbff;
--color-border-warning: #ffe609;
--color-border-success: #97ceb0;
--color-fill-secondary: #5555ff;
--color-fill-secondary-hover: #7070ff;
--color-fill-ghost: #dbdbff;
--color-fill-ghost-hover: #ebebff;
--color-fill-separator: #dbdbff;
--color-fill-primary: #ff55ff;
--color-fill-primary-hover: #ff70ff;
--color-fill-primary-shade: #ff1aff;
--color-fill-danger-shade: #8b3e5e;
--color-fill-danger: #aa5078;
--color-fill-danger-hover: #be7495;
--color-fill-danger-counter: #ce97af;
--color-fill-yellow: #ffe609;
--color-fill-yellow-iconic: #ffff55;
--color-fill-gray: #9b9bb1;
--color-fill-secondary-shade: #4545ef;
--color-fill-diff-red: #efdce4;
--color-fill-diff-red-light: #f7eef2;
--color-fill-success-counter: #97ceb0;
--color-fill-success-hover: #71bc93;
--color-fill-success: #4fa877;
--color-fill-success-shade: #408760;
--color-fill-diff-green: #badeca;
--color-fill-diff-green-light: #dcefe5;
--color-fill-float: #f5f5ff;
--color-fill-float-hover: #fafaff;
--color-fill-merged: #ffeeff;
--color-fill-selected: #ebebff;
--color-fill-warning: #ffffe5;
--color-fill-counter: #dbdbff;
--color-fill-counter-emphasized: #ebebff;
--color-fill-delegate: #ffe5ff;
--color-fill-private: #fff5d6;
--color-fill-secondary-counter: #b2b5ff;
--color-fill-primary-counter: #ff8fff;
--color-fill-ghost-shade: #ccceff;
--color-surface-base: var(--color-neutrals-opaque-light-50);
--color-surface-canvas: var(--color-neutrals-opaque-light-0);
--color-surface-subtle: var(--color-neutrals-opaque-light-100);
--color-surface-mid: var(--color-neutrals-opaque-light-150);
--color-surface-strong: var(--color-neutrals-opaque-light-200);
--color-surface-alpha-subtle: var(--color-neutrals-alpha-light-50);
--color-surface-alpha-mid: var(--color-neutrals-alpha-light-100);
--color-surface-alpha-strong: var(--color-neutrals-alpha-light-200);
--color-surface-scrim: var(--color-neutrals-alpha-light-500);
--color-surface-open: var(--color-accent-green-200);
--color-surface-merged: var(--color-accent-blue-200);
--color-surface-draft: var(--color-neutrals-opaque-light-150);
--color-surface-closed: var(--color-accent-blue-200);
--color-surface-archived: var(--color-accent-pink-200);
--color-text-primary: var(--color-neutrals-opaque-light-900);
--color-text-secondary: var(--color-neutrals-opaque-light-700);
--color-text-tertiary: var(--color-neutrals-opaque-light-600);
--color-text-quaternary: var(--color-neutrals-opaque-light-500);
--color-text-disabled: var(--color-neutrals-alpha-light-400);
--color-text-open: var(--color-accent-green-800);
--color-text-merged: var(--color-accent-blue-800);
--color-text-draft: var(--color-neutrals-opaque-light-600);
--color-text-closed: var(--color-accent-blue-800);
--color-text-archived: var(--color-accent-pink-800);
--color-border-subtle: var(--color-neutrals-opaque-light-150);
--color-border-mid: var(--color-neutrals-opaque-light-200);
--color-border-strong: var(--color-neutrals-opaque-light-300);
--color-border-alpha-subtle: var(--color-neutrals-alpha-light-100);
--color-border-alpha-mid: var(--color-neutrals-alpha-light-200);
--color-feedback-success-text: var(--color-semantic-green-800);
--color-feedback-success-border: var(--color-semantic-green-600);
--color-feedback-success-bg: var(--color-semantic-green-100);
--color-feedback-success-bg-selected: var(--color-semantic-green-200);
--color-feedback-warning-text: var(--color-semantic-amber-800);
--color-feedback-warning-border: var(--color-semantic-amber-600);
--color-feedback-warning-bg: var(--color-semantic-amber-100);
--color-feedback-error-text: var(--color-semantic-red-800);
--color-feedback-error-border: var(--color-semantic-red-600);
--color-feedback-error-bg: var(--color-semantic-red-100);
--color-feedback-error-bg-selected: var(--color-semantic-red-200);
--color-feedback-success-fill: var(--color-semantic-green-600);
--color-feedback-success-fill-hover: var(--color-semantic-green-500);
--color-feedback-success-fill-active: var(--color-semantic-green-700);
--color-feedback-error-fill: var(--color-semantic-red-600);
--color-feedback-error-fill-hover: var(--color-semantic-red-500);
--color-feedback-error-fill-active: var(--color-semantic-red-700);
--color-code-keywords: var(--color-accent-blue-700);
--color-code-strings: var(--color-accent-green-700);
--color-code-numbers: var(--color-accent-purple-700);
--color-code-comments: var(--color-neutrals-opaque-light-700);
--color-code-error: var(--color-semantic-red-700);
--color-code-functions: var(--color-accent-emerald-700);
/* Brand. */
--color-brand-bg: var(--color-accent-blue-600);
--color-brand-hover: var(--color-accent-blue-500);
--color-brand-text-light: var(--color-accent-blue-600);
--color-brand-text-dark: var(--color-accent-blue-400);
--color-text-on-brand: var(--color-neutrals-opaque-light-0);
--color-surface-brand-primary: var(--color-brand-bg);
--color-surface-brand-secondary: var(--color-brand-hover);
--color-border-brand: var(--color-brand-hover);
--color-text-brand: var(--color-brand-text-light);
}
/* Dark theme. */
:root[data-theme="dark"] {
--color-background-default: #0a0e0f;
--color-background-float: #25262d;
--color-background-dip: #000000;
--color-foreground-contrast: #f9f9fb;
--color-foreground-dim: #9b9bb1;
--color-foreground-emphasized: #7070ff;
--color-foreground-emphasized-hover: #b2b5ff;
--color-foreground-match-background: #0a0e0f;
--color-foreground-white: #ffffff;
--color-foreground-black: #000000;
--color-foreground-primary: #ff55ff;
--color-foreground-primary-hover: #ff8fff;
--color-foreground-success: #4fa877;
--color-foreground-red: #be7495;
--color-foreground-yellow: #e5c001;
--color-foreground-disabled: #5c5c70;
--color-border-hint: #2e2f38;
--color-border-default: #393a46;
--color-border-focus: #7070ff;
--color-border-contrast: #ebebff;
--color-border-error: #6b2b42;
--color-border-merged: #6b006b;
--color-border-match-background: #0a0e0f;
--color-border-primary: #ff1aff;
--color-border-primary-hover: #ff55ff;
--color-border-selected: #232563;
--color-border-warning: #4c4000;
--color-border-success: #2a5a40;
--color-fill-secondary: #7070ff;
--color-fill-secondary-hover: #b2b5ff;
--color-fill-secondary-shade: #5555ff;
--color-fill-ghost: #2e2f38;
--color-fill-ghost-hover: #393a46;
--color-fill-separator: #2e2f38;
--color-fill-primary: #ff1aff;
--color-fill-primary-hover: #ff4dff;
--color-fill-primary-shade: #e500e5;
--color-fill-danger-shade: #8b3e5e;
--color-fill-danger: #aa5078;
--color-fill-danger-hover: #be7495;
--color-fill-danger-counter: #ce97af;
--color-fill-yellow: #ffe609;
--color-fill-yellow-iconic: #ffff55;
--color-fill-gray: #9b9bb1;
--color-fill-diff-red: #4d1929;
--color-fill-diff-red-light: #2d060d;
--color-fill-success-counter: #97ceb0;
--color-fill-success-hover: #71bc93;
--color-fill-success: #4fa877;
--color-fill-success-shade: #408760;
--color-fill-diff-green: #183425;
--color-fill-diff-green-light: #142a1d;
--color-fill-float: #25262d;
--color-fill-float-hover: #2e2f38;
--color-fill-merged: #1a001a;
--color-fill-selected: #16173d;
--color-fill-warning: #191500;
--color-fill-counter: #393a46;
--color-fill-counter-emphasized: #5c5c70;
--color-fill-delegate: #3d003d;
--color-fill-private: #4c4000;
--color-fill-secondary-counter: #ccceff;
--color-fill-primary-counter: #ff8fff;
--color-fill-ghost-shade: #25262d;
--color-surface-base: var(--color-neutrals-opaque-dark-0);
--color-surface-canvas: var(--color-neutrals-opaque-dark-50);
--color-surface-subtle: var(--color-neutrals-opaque-dark-100);
--color-surface-mid: var(--color-neutrals-opaque-dark-150);
--color-surface-strong: var(--color-neutrals-opaque-dark-200);
--color-surface-alpha-subtle: var(--color-neutrals-alpha-dark-50);
--color-surface-alpha-mid: var(--color-neutrals-alpha-dark-100);
--color-surface-alpha-strong: var(--color-neutrals-alpha-dark-200);
--color-surface-scrim: var(--color-neutrals-alpha-light-700);
--color-surface-open: var(--color-accent-green-900);
--color-surface-draft: var(--color-neutrals-opaque-dark-150);
--color-surface-closed: var(--color-accent-blue-900);
--color-surface-merged: var(--color-accent-blue-900);
--color-surface-archived: var(--color-accent-pink-900);
--color-text-primary: var(--color-neutrals-opaque-dark-900);
--color-text-secondary: var(--color-neutrals-opaque-dark-700);
--color-text-tertiary: var(--color-neutrals-opaque-dark-600);
--color-text-quaternary: var(--color-neutrals-opaque-dark-500);
--color-text-disabled: var(--color-neutrals-alpha-dark-400);
--color-text-open: var(--color-accent-green-500);
--color-text-draft: var(--color-neutrals-opaque-dark-600);
--color-text-closed: var(--color-accent-blue-500);
--color-text-merged: var(--color-accent-blue-500);
--color-text-archived: var(--color-accent-pink-500);
--color-border-subtle: var(--color-neutrals-opaque-dark-150);
--color-border-mid: var(--color-neutrals-opaque-dark-200);
--color-border-strong: var(--color-neutrals-opaque-dark-300);
--color-border-alpha-subtle: var(--color-neutrals-alpha-dark-100);
--color-border-alpha-mid: var(--color-neutrals-alpha-dark-200);
--color-feedback-success-text: var(--color-semantic-green-400);
--color-feedback-success-border: var(--color-semantic-green-700);
--color-feedback-success-bg: var(--color-semantic-green-900);
--color-feedback-success-bg-selected: var(--color-semantic-green-800);
--color-feedback-warning-text: var(--color-semantic-amber-400);
--color-feedback-warning-border: var(--color-semantic-amber-700);
--color-feedback-warning-bg: var(--color-semantic-amber-900);
--color-feedback-error-text: var(--color-semantic-red-400);
--color-feedback-error-border: var(--color-semantic-red-700);
--color-feedback-error-bg: var(--color-semantic-red-900);
--color-feedback-error-bg-selected: var(--color-semantic-red-800);
--color-code-keywords: var(--color-accent-blue-400);
--color-code-strings: var(--color-accent-green-400);
--color-code-numbers: var(--color-accent-purple-400);
--color-code-comments: var(--color-neutrals-opaque-dark-700);
--color-code-error: var(--color-semantic-red-400);
--color-code-functions: var(--color-accent-emerald-400);
--color-text-brand: var(--color-brand-text-dark);
}
/* Internal color system, don't use directly! */
:root {
--color-neutrals-opaque-light-0: #ffffff;
--color-neutrals-opaque-light-50: #f8f9fa;
--color-neutrals-opaque-light-100: #f1f3f5;
--color-neutrals-opaque-light-150: #e9ebef;
--color-neutrals-opaque-light-200: #e1e4e8;
--color-neutrals-opaque-light-250: #d6d9e0;
--color-neutrals-opaque-light-300: #c9cdd4;
--color-neutrals-opaque-light-400: #a2a7b1;
--color-neutrals-opaque-light-500: #7a8190;
--color-neutrals-opaque-light-600: #5a5f6b;
--color-neutrals-opaque-light-700: #3a3f49;
--color-neutrals-opaque-light-800: #1f232b;
--color-neutrals-opaque-light-900: #0b0d12;
--color-neutrals-opaque-dark-0: #00060f;
--color-neutrals-opaque-dark-50: #0a1018;
--color-neutrals-opaque-dark-100: #141a22;
--color-neutrals-opaque-dark-150: #1f242c;
--color-neutrals-opaque-dark-200: #29303a;
--color-neutrals-opaque-dark-250: #33383f;
--color-neutrals-opaque-dark-300: #3d4248;
--color-neutrals-opaque-dark-400: #52565c;
--color-neutrals-opaque-dark-500: #666a6f;
--color-neutrals-opaque-dark-600: #8f9296;
--color-neutrals-opaque-dark-700: #b8babc;
--color-neutrals-opaque-dark-800: #e0e1e2;
--color-neutrals-opaque-dark-900: #ffffff;
--color-neutrals-alpha-light-50: #00060f0a;
--color-neutrals-alpha-light-100: #00060f14;
--color-neutrals-alpha-light-200: #00060f1f;
--color-neutrals-alpha-light-300: #00060f29;
--color-neutrals-alpha-light-400: #00060f3d;
--color-neutrals-alpha-light-500: #00060f52;
--color-neutrals-alpha-light-600: #00060f7a;
--color-neutrals-alpha-light-700: #00060fa3;
--color-neutrals-alpha-light-800: #00060fcc;
--color-neutrals-alpha-light-900: #00060feb;
--color-neutrals-alpha-dark-50: #ffffff0a;
--color-neutrals-alpha-dark-100: #ffffff14;
--color-neutrals-alpha-dark-200: #ffffff1f;
--color-neutrals-alpha-dark-300: #ffffff29;
--color-neutrals-alpha-dark-400: #ffffff3d;
--color-neutrals-alpha-dark-500: #ffffff52;
--color-neutrals-alpha-dark-600: #ffffff7a;
--color-neutrals-alpha-dark-700: #ffffffa3;
--color-neutrals-alpha-dark-800: #ffffffcc;
--color-neutrals-alpha-dark-900: #ffffffeb;
--color-accent-blue-0: #f4f9ff;
--color-accent-blue-100: #d6e9ff;
--color-accent-blue-200: #afcfff;
--color-accent-blue-300: #7fb0ff;
--color-accent-blue-400: #4d94ff;
--color-accent-blue-500: #1c77ff;
--color-accent-blue-600: #165fcc;
--color-accent-blue-700: #104799;
--color-accent-blue-800: #0b3266;
--color-accent-blue-900: #061d33;
--color-accent-green-0: #f7fff2;
--color-accent-green-100: #dffcc6;
--color-accent-green-200: #bef98a;
--color-accent-green-300: #99f24c;
--color-accent-green-400: #73e926;
--color-accent-green-500: #58e600;
--color-accent-green-600: #46ba00;
--color-accent-green-700: #358f00;
--color-accent-green-800: #256400;
--color-accent-green-900: #0a1f00;
--color-accent-cyan-0: #f1fefe;
--color-accent-cyan-100: #ccf9fa;
--color-accent-cyan-200: #99eff0;
--color-accent-cyan-300: #66e5e7;
--color-accent-cyan-400: #33dbde;
--color-accent-cyan-500: #00d4da;
--color-accent-cyan-600: #00a8ae;
--color-accent-cyan-700: #007d82;
--color-accent-cyan-800: #005256;
--color-accent-cyan-900: #00292b;
--color-accent-purple-0: #f7f5ff;
--color-accent-purple-100: #e0daff;
--color-accent-purple-200: #c0b5ff;
--color-accent-purple-300: #a08fff;
--color-accent-purple-400: #8a74fa;
--color-accent-purple-500: #886bf2;
--color-accent-purple-600: #6c54c2;
--color-accent-purple-700: #503f91;
--color-accent-purple-800: #352a61;
--color-accent-purple-900: #1b1530;
--color-accent-pink-0: #fff6ff;
--color-accent-pink-100: #ffedff;
--color-accent-pink-200: #ffdbff;
--color-accent-pink-300: #ffc9ff;
--color-accent-pink-400: #ffb7ff;
--color-accent-pink-500: #ffa5ff;
--color-accent-pink-600: #cc84cc;
--color-accent-pink-700: #996399;
--color-accent-pink-800: #664266;
--color-accent-pink-900: #332133;
--color-accent-emerald-0: #f2fcf9;
--color-accent-emerald-100: #ccf4e4;
--color-accent-emerald-200: #99e9ca;
--color-accent-emerald-300: #66ddb0;
--color-accent-emerald-400: #33d196;
--color-accent-emerald-500: #009f67;
--color-accent-emerald-600: #007f52;
--color-accent-emerald-700: #005f3e;
--color-accent-emerald-800: #004029;
--color-accent-emerald-900: #002015;
--color-accent-citrus-0: #fcfff2;
--color-accent-citrus-100: #f1ffbf;
--color-accent-citrus-200: #e4ff80;
--color-accent-citrus-300: #d6ff40;
--color-accent-citrus-400: #caff20;
--color-accent-citrus-500: #ccff38;
--color-accent-citrus-600: #a4cc2d;
--color-accent-citrus-700: #7c991f;
--color-accent-citrus-800: #536613;
--color-accent-citrus-900: #2b3307;
--color-accent-olive-0: #fafaed;
--color-accent-olive-100: #e6e5ba;
--color-accent-olive-200: #d1cf86;
--color-accent-olive-300: #bdb950;
--color-accent-olive-400: #9e9900;
--color-accent-olive-500: #585600;
--color-accent-olive-600: #464400;
--color-accent-olive-700: #343300;
--color-accent-olive-800: #232200;
--color-accent-olive-900: #111100;
--color-semantic-red-0: #fff5f5;
--color-semantic-red-100: #ffd6d6;
--color-semantic-red-200: #ffafaf;
--color-semantic-red-300: #ff8686;
--color-semantic-red-400: #ff5c5c;
--color-semantic-red-500: #ff4d4f;
--color-semantic-red-600: #cc3e3f;
--color-semantic-red-700: #992f2f;
--color-semantic-red-800: #661f20;
--color-semantic-red-900: #330f10;
--color-semantic-amber-0: #fffdf2;
--color-semantic-amber-100: #fff1b8;
--color-semantic-amber-200: #ffe58f;
--color-semantic-amber-300: #ffd666;
--color-semantic-amber-400: #ffc53d;
--color-semantic-amber-500: #faad14;
--color-semantic-amber-600: #d48806;
--color-semantic-amber-700: #ad6800;
--color-semantic-amber-800: #874d00;
--color-semantic-amber-900: #613400;
--color-semantic-green-0: #f6fff1;
--color-semantic-green-100: #d9f7be;
--color-semantic-green-200: #b7eb8f;
--color-semantic-green-300: #95de64;
--color-semantic-green-400: #73d13d;
--color-semantic-green-500: #52c41a;
--color-semantic-green-600: #3d9914;
--color-semantic-green-700: #2e7010;
--color-semantic-green-800: #1e470a;
--color-semantic-green-900: #0f2305;
--color-semantic-blue-0: #f0f9ff;
--color-semantic-blue-100: #c6e4ff;
--color-semantic-blue-200: #91caff;
--color-semantic-blue-300: #5bafff;
--color-semantic-blue-400: #2896ff;
--color-semantic-blue-500: #1890ff;
--color-semantic-blue-600: #1373cc;
--color-semantic-blue-700: #0e5799;
--color-semantic-blue-800: #093c66;
--color-semantic-blue-900: #051f33;
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+35 -197
View File
@@ -2,6 +2,14 @@
box-sizing: border-box;
}
:root {
--border-radius-xs: 0.0625rem;
--border-radius-sm: 0.125rem;
--border-radius-md: 0.25rem;
--border-radius-lg: 0.5rem;
--border-radius-full: 99rem;
}
html {
height: 100%;
width: 100%;
@@ -18,8 +26,8 @@ body {
width: 100%;
margin: 0;
padding: 0;
color: var(--color-foreground-contrast);
background-color: var(--color-background-default);
color: var(--color-text-primary);
background-color: var(--color-surface-base);
}
a,
@@ -44,28 +52,8 @@ a {
}
::selection {
background: var(--color-fill-yellow);
color: var(--color-foreground-black);
}
.global-oid {
color: var(--color-foreground-emphasized);
font-size: var(--font-size-small);
font-family: var(--font-family-monospace);
font-weight: var(--font-weight-regular);
}
.global-commit {
color: var(--color-foreground-dim);
font-size: var(--font-size-small);
font-family: var(--font-family-monospace);
font-weight: var(--font-weight-semibold);
}
.global-none {
color: var(--color-foreground-disabled);
font-weight: var(--font-weight-bold);
font-family: var(--font-family-monospace);
background: var(--color-feedback-warning-border);
color: var(--color-text-primary);
}
.global-flex {
@@ -76,7 +64,7 @@ a {
.global-tab {
padding-left: 0.5rem;
border-left: 1px solid var(--color-fill-ghost-hover);
border-left: 1px solid var(--color-border-mid);
margin-left: 1rem;
flex-direction: column;
justify-content: space-between;
@@ -84,21 +72,35 @@ a {
column-gap: 0.5rem;
}
.global-counter {
.global-chip {
display: flex;
align-items: center;
justify-content: center;
background-color: var(--color-fill-counter);
clip-path: var(--1px-corner-fill);
background-color: var(--color-surface-strong);
border-radius: var(--border-radius-sm);
height: 1.5rem;
padding: 0 0.5rem;
min-width: 1.5rem;
font-weight: var(--font-weight-regular);
font: var(--txt-body-s-regular);
flex-shrink: 0;
}
.global-counter-badge {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.25rem;
min-width: 1.25rem;
padding: 0.125rem 0.25rem;
border-radius: 1px;
background-color: var(--color-surface-alpha-subtle);
color: var(--color-text-secondary);
font: var(--txt-body-s-regular);
flex-shrink: 0;
}
.global-link {
color: var(--color-foreground-default);
color: var(--color-text-secondary);
text-decoration: none;
}
.global-link:hover {
@@ -113,9 +115,9 @@ a {
--os-handle-border-radius: 4px;
--os-padding-perpendicular: 4px;
--os-padding-axis: 2px;
--os-handle-bg: var(--color-border-default);
--os-handle-bg-hover: var(--color-border-default);
--os-handle-bg-active: var(--color-border-default);
--os-handle-bg: var(--color-border-mid);
--os-handle-bg-hover: var(--color-border-mid);
--os-handle-bg-active: var(--color-border-mid);
--os-track-bg: transparent;
}
}
@@ -128,170 +130,6 @@ a {
--elevation-low: 0 0 16px 0 #00000022;
}
:root {
--1px-corner-fill: polygon(
0 2px,
2px 2px,
2px 0,
calc(100% - 2px) 0,
calc(100% - 2px) 2px,
100% 2px,
100% calc(100% - 2px),
calc(100% - 2px) calc(100% - 2px),
calc(100% - 2px) calc(100% - 2px),
calc(100% - 2px) 100%,
2px 100%,
2px calc(100% - 2px),
0 calc(100% - 2px)
);
--1px-top-corner-fill: polygon(
0 2px,
2px 2px,
2px 0,
calc(100% - 2px) 0,
calc(100% - 2px) 2px,
100% 2px,
100% calc(100% - 2px),
100% 4px,
100% 100%,
0 100%
);
--1px-bottom-corner-fill: polygon(
0 0,
100% 0,
100% calc(100% - 2px),
calc(100% - 2px) calc(100% - 2px),
calc(100% - 2px) 100%,
2px 100%,
2px calc(100% - 2px),
0 calc(100% - 2px)
);
--2px-corner-fill: polygon(
0 4px,
2px 4px,
2px 2px,
4px 2px,
4px 0,
calc(100% - 4px) 0,
calc(100% - 4px) 2px,
calc(100% - 2px) 2px,
calc(100% - 2px) 4px,
100% 4px,
100% calc(100% - 4px),
calc(100% - 2px) calc(100% - 4px),
calc(100% - 2px) calc(100% - 2px),
calc(100% - 4px) calc(100% - 2px),
calc(100% - 4px) 100%,
4px 100%,
4px calc(100% - 2px),
2px calc(100% - 2px),
2px calc(100% - 4px),
0 calc(100% - 4px)
);
--2px-top-corner-fill: polygon(
0 4px,
2px 4px,
2px 2px,
4px 2px,
4px 0,
calc(100% - 4px) 0,
calc(100% - 4px) 2px,
calc(100% - 2px) 2px,
calc(100% - 2px) 4px,
100% 4px,
100% 100%,
0 100%
);
--2px-bottom-corner-fill: polygon(
0 0,
100% 0,
100% calc(100% - 4px),
calc(100% - 2px) calc(100% - 4px),
calc(100% - 2px) calc(100% - 2px),
calc(100% - 4px) calc(100% - 2px),
calc(100% - 4px) 100%,
4px 100%,
4px calc(100% - 2px),
2px calc(100% - 2px),
2px calc(100% - 4px),
0 calc(100% - 4px)
);
--3px-corner-fill: polygon(
0 6px,
2px 6px,
2px 4px,
4px 4px,
4px 2px,
6px 2px,
6px 0,
calc(100% - 6px) 0,
calc(100% - 6px) 2px,
calc(100% - 4px) 2px,
calc(100% - 4px) 4px,
calc(100% - 2px) 4px,
calc(100% - 2px) 6px,
100% 6px,
100% calc(100% - 6px),
calc(100% - 2px) calc(100% - 6px),
calc(100% - 2px) calc(100% - 4px),
calc(100% - 4px) calc(100% - 4px),
calc(100% - 4px) calc(100% - 2px),
calc(100% - 6px) calc(100% - 2px),
calc(100% - 6px) 100%,
6px 100%,
6px calc(100% - 2px),
4px calc(100% - 2px),
4px calc(100% - 4px),
2px calc(100% - 4px),
2px calc(100% - 6px),
0 calc(100% - 6px)
);
--3px-top-corner-fill: polygon(
0 6px,
2px 6px,
2px 4px,
4px 4px,
4px 2px,
6px 2px,
6px 0,
calc(100% - 6px) 0,
calc(100% - 6px) 2px,
calc(100% - 4px) 2px,
calc(100% - 4px) 4px,
calc(100% - 2px) 4px,
calc(100% - 2px) 6px,
100% 6px,
100% 100%,
0 100%
);
--3px-bottom-corner-fill: polygon(
0 0,
100% 0,
100% calc(100% - 6px),
calc(100% - 2px) calc(100% - 6px),
calc(100% - 2px) calc(100% - 4px),
calc(100% - 4px) calc(100% - 4px),
calc(100% - 4px) calc(100% - 2px),
calc(100% - 6px) calc(100% - 2px),
calc(100% - 6px) 100%,
6px 100%,
6px calc(100% - 2px),
4px calc(100% - 2px),
4px calc(100% - 4px),
2px calc(100% - 4px),
2px calc(100% - 6px),
0 calc(100% - 6px)
);
}
/*
Breakpoints
===========
+3 -62
View File
@@ -1,63 +1,4 @@
<svg width="44" height="44" viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg">
<g shape-rendering="crispEdges">
<rect x="8" y="0" width="4" height="4" fill="#5555FF"/>
<rect x="32" y="0" width="4" height="4" fill="#5555FF"/>
<rect x="12" y="4" width="4" height="4" fill="#5555FF"/>
<rect x="28" y="4" width="4" height="4" fill="#5555FF"/>
<rect x="12" y="8" width="4" height="4" fill="#5555FF"/>
<rect x="16" y="8" width="4" height="4" fill="#3333DD"/>
<rect x="20" y="8" width="4" height="4" fill="#5555FF"/>
<rect x="24" y="8" width="4" height="4" fill="#3333DD"/>
<rect x="28" y="8" width="4" height="4" fill="#5555FF"/>
<rect x="8" y="12" width="4" height="4" fill="#5555FF"/>
<rect x="12" y="12" width="4" height="4" fill="#5555FF"/>
<rect x="16" y="12" width="4" height="4" fill="#5555FF"/>
<rect x="20" y="12" width="4" height="4" fill="#5555FF"/>
<rect x="24" y="12" width="4" height="4" fill="#5555FF"/>
<rect x="28" y="12" width="4" height="4" fill="#5555FF"/>
<rect x="32" y="12" width="4" height="4" fill="#5555FF"/>
<rect x="4" y="16" width="4" height="4" fill="#5555FF"/>
<rect x="8" y="16" width="4" height="4" fill="#5555FF"/>
<rect x="12" y="16" width="4" height="4" fill="#F4F4F4"/>
<rect x="16" y="16" width="4" height="4" fill="#F4F4F4"/>
<rect x="20" y="16" width="4" height="4" fill="#5555FF"/>
<rect x="24" y="16" width="4" height="4" fill="#5555FF"/>
<rect x="28" y="16" width="4" height="4" fill="#F4F4F4"/>
<rect x="32" y="16" width="4" height="4" fill="#F4F4F4"/>
<rect x="36" y="16" width="4" height="4" fill="#5555FF"/>
<rect x="4" y="20" width="4" height="4" fill="#5555FF"/>
<rect x="8" y="20" width="4" height="4" fill="#5555FF"/>
<rect x="12" y="20" width="4" height="4" fill="#F4F4F4"/>
<rect x="16" y="20" width="4" height="4" fill="#FF55FF"/>
<rect x="20" y="20" width="4" height="4" fill="#5555FF"/>
<rect x="24" y="20" width="4" height="4" fill="#5555FF"/>
<rect x="28" y="20" width="4" height="4" fill="#F4F4F4"/>
<rect x="32" y="20" width="4" height="4" fill="#FF55FF"/>
<rect x="36" y="20" width="4" height="4" fill="#5555FF"/>
<rect x="0" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="4" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="8" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="12" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="16" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="20" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="24" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="28" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="32" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="36" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="40" y="24" width="4" height="4" fill="#3333DD"/>
<rect x="8" y="28" width="4" height="4" fill="#3333DD"/>
<rect x="16" y="28" width="4" height="4" fill="#5555FF"/>
<rect x="24" y="28" width="4" height="4" fill="#5555FF"/>
<rect x="32" y="28" width="4" height="4" fill="#3333DD"/>
<rect x="8" y="32" width="4" height="4" fill="#3333DD"/>
<rect x="16" y="32" width="4" height="4" fill="#5555FF"/>
<rect x="24" y="32" width="4" height="4" fill="#5555FF"/>
<rect x="32" y="32" width="4" height="4" fill="#3333DD"/>
<rect x="16" y="36" width="4" height="4" fill="#5555FF"/>
<rect x="24" y="36" width="4" height="4" fill="#5555FF"/>
<rect x="12" y="40" width="4" height="4" fill="#5555FF"/>
<rect x="16" y="40" width="4" height="4" fill="#5555FF"/>
<rect x="24" y="40" width="4" height="4" fill="#5555FF"/>
<rect x="28" y="40" width="4" height="4" fill="#5555FF"/>
</g>
<svg width="44" height="22" viewBox="0 0 44 22" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M44 22H22V0H44V22ZM32.999 3.75C28.9895 3.75011 25.7393 7.00122 25.7393 11.0107C25.7395 15.0201 28.9897 18.2704 32.999 18.2705C37.0085 18.2705 40.2586 15.0202 40.2588 11.0107C40.2588 7.00116 37.0086 3.75 32.999 3.75Z" fill="black"/>
<path d="M5.17188 10.9966C5.17188 7.77682 7.78204 5.16666 11.0019 5.16666C14.2217 5.16666 16.8318 7.77682 16.8318 10.9966C16.8318 14.2165 14.2217 16.8266 11.0019 16.8266C7.78204 16.8266 5.17188 14.2165 5.17188 10.9966Z" fill="black"/>
</svg>

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 579 B

+108 -65
View File
@@ -1,30 +1,23 @@
@font-face {
font-family: "Inter";
font-family: "Booton";
font-style: normal;
font-weight: 400;
font-display: swap;
src: url("fonts/Inter-Regular.woff2");
src: url("fonts/Booton-Regular.woff2");
}
@font-face {
font-family: "Inter";
font-weight: 500;
font-family: "Booton";
font-weight: 468;
font-display: swap;
src: url("fonts/Inter-Medium.woff2");
src: url("fonts/Booton-Medium.woff2");
}
@font-face {
font-family: "Inter";
font-family: "Booton";
font-weight: 600;
font-display: swap;
src: url("fonts/Inter-SemiBold.woff2");
}
@font-face {
font-family: "Inter";
font-weight: 700;
font-display: swap;
src: url("fonts/Inter-Bold.woff2");
src: url("fonts/Booton-SemiBold.woff2");
}
@font-face {
@@ -59,94 +52,144 @@
:root {
--font-size: 16px;
--font-family-sans-serif: Inter, sans-serif;
--font-family-monospace: monospace;
--font-weight-regular: 400;
--font-weight-medium: 500;
--font-weight-semibold: 600;
--font-weight-bold: 700;
--font-size-tiny: 0.75rem; /* 12px */
--font-size-small: 0.875rem; /* 14px */
--font-size-regular: 1rem; /* 16px */
--font-size-medium: 1.25rem; /* 20px */
--font-size-large: 1.5rem; /* 24px */
--font-size-x-large: 2rem; /* 32px */
--font-size-xx-large: 3rem; /* 48px */
--txt-heading-xxs: 600 0.75rem/1rem Booton, sans-serif;
--txt-heading-xs: 600 0.875rem/1.25rem Booton, sans-serif;
--txt-heading-s: 600 1rem/1.25rem Booton, sans-serif;
--txt-heading-m: 600 1.125rem/1.25rem Booton, sans-serif;
--txt-heading-l: 600 1.375rem/1.75rem Booton, sans-serif;
--txt-heading-xl: 600 1.75rem/2rem Booton, sans-serif;
--txt-heading-xxl: 600 2rem/2.25rem Booton, sans-serif;
--txt-body-s-regular: 400 0.75rem/1rem Booton, sans-serif;
--txt-body-s-medium: 468 0.75rem/1rem Booton, sans-serif;
--txt-body-s-semibold: 600 0.75rem/1rem Booton, sans-serif;
--txt-body-m-regular: 400 0.875rem/1.25rem Booton, sans-serif;
--txt-body-m-medium: 468 0.875rem/1.25rem Booton, sans-serif;
--txt-body-m-semibold: 600 0.875rem/1.25rem Booton, sans-serif;
--txt-body-l-regular: 400 1rem/1.5rem Booton, sans-serif;
--txt-body-l-medium: 468 1rem/1.5rem Booton, sans-serif;
--txt-body-l-semibold: 600 1rem/1.5rem Booton, sans-serif;
}
[data-codefont="system"] {
--font-family-monospace: monospace;
--txt-code-regular: 400 0.875rem/1.25rem monospace;
--txt-code-semibold: 600 0.875rem/1.25rem monospace;
}
[data-codefont="jetbrains"] {
--font-family-monospace: "JetBrains Mono";
--txt-code-regular: 400 0.875rem/1.25rem "JetBrains Mono";
--txt-code-semibold: 600 0.875rem/1.25rem "JetBrains Mono";
}
html {
-ms-text-size-adjust: 100%;
-webkit-font-smoothing: antialiased;
-webkit-text-size-adjust: 100%;
font-family: var(--font-family-sans-serif);
font-feature-settings: "zero";
font-family: Booton, sans-serif;
/* The root element font size has to be set in px,
* otherwise Safari breaks. */
font-size: var(--font-size);
font-weight: var(--font-weight-regular);
font-weight: 400;
line-height: 1.25;
}
body {
/* On Safari this aligns text with different font-faces properly vertically. */
line-height: 1.375rem;
.txt-heading-xxs {
font: var(--txt-heading-xxs);
}
p {
margin: 1rem 0;
}
.txt-tiny {
font-size: var(--font-size-tiny);
}
.txt-small {
font-size: var(--font-size-small);
}
.txt-regular {
font-size: var(--font-size-regular);
}
.txt-medium {
font-size: var(--font-size-medium);
}
.txt-large {
font-size: var(--font-size-large);
}
.txt-huge {
font-size: var(--font-size-x-large);
}
.txt-humongous {
font-size: var(--font-size-xx-large);
.txt-heading-xs {
font: var(--txt-heading-xs);
}
.txt-monospace {
font-family: var(--font-family-monospace);
.txt-heading-s {
font: var(--txt-heading-s);
}
.txt-bold {
font-weight: var(--font-weight-bold) !important;
.txt-heading-m {
font: var(--txt-heading-m);
}
.txt-semibold {
font-weight: var(--font-weight-semibold) !important;
.txt-heading-l {
font: var(--txt-heading-l);
}
.txt-heading-xl {
font: var(--txt-heading-xl);
}
.txt-heading-xxl {
font: var(--txt-heading-xxl);
}
.txt-body-s-regular {
font: var(--txt-body-s-regular);
}
.txt-body-s-medium {
font: var(--txt-body-s-medium);
}
.txt-body-s-semibold {
font: var(--txt-body-s-semibold);
}
.txt-body-m-regular {
font: var(--txt-body-m-regular);
}
.txt-body-m-medium {
font: var(--txt-body-m-medium);
}
.txt-body-m-semibold {
font: var(--txt-body-m-semibold);
}
.txt-body-l-regular {
font: var(--txt-body-l-regular);
}
.txt-body-l-medium {
font: var(--txt-body-l-medium);
}
.txt-body-l-semibold {
font: var(--txt-body-l-semibold);
}
.txt-code-regular {
font: var(--txt-code-regular);
}
.txt-code-semibold {
font: var(--txt-code-semibold);
}
.txt-id {
color: var(--color-text-tertiary);
font: var(--txt-code-regular);
}
.txt-missing {
color: var(--color-foreground-dim);
color: var(--color-text-secondary);
}
.txt-selectable {
-webkit-touch-callout: initial;
-webkit-user-select: text;
user-select: text;
}
.txt-emoji {
height: 1em;
width: 1em;
margin: 0 0.05em 0 0.1em;
vertical-align: -0.1em;
}
.txt-overflow {
overflow: hidden;
text-overflow: ellipsis;
+63 -10
View File
@@ -3,8 +3,10 @@
import type { ErrorWrapper } from "@bindings/error/ErrorWrapper";
import { listen } from "@tauri-apps/api/event";
import { getCurrentWindow } from "@tauri-apps/api/window";
import delay from "lodash/delay";
import { onDestroy, onMount } from "svelte";
import { get } from "svelte/store";
import {
decreaseFontSize,
@@ -16,6 +18,7 @@
import { nodeRunning } from "@app/lib/events";
import { dynamicInterval } from "@app/lib/interval";
import { invoke } from "@app/lib/invoke";
import { hide } from "@app/lib/modal";
import * as router from "@app/lib/router";
import {
setUnlistenNodeEvents,
@@ -23,11 +26,16 @@
} from "@app/lib/startup.svelte";
import { isMac, unreachable } from "@app/lib/utils";
import { theme } from "@app/components/ThemeSwitch.svelte";
import Auth from "@app/views/booting/Auth.svelte";
import CreateIdentity from "@app/views/booting/CreateIdentity.svelte";
import Repos from "@app/views/home/Repos.svelte";
import CreateIssue from "@app/views/repo/CreateIssue.svelte";
import { codeFont } from "@app/components/CodeFontSwitch.svelte";
import {
followSystemTheme,
loadTheme,
theme,
} from "@app/components/ThemeSwitch.svelte";
import GuideView from "@app/modals/Guide.svelte";
import Auth from "@app/views/auth/Auth.svelte";
import CreateIdentity from "@app/views/auth/CreateIdentity.svelte";
import InboxView from "@app/views/Inbox.svelte";
import Issue from "@app/views/repo/Issue.svelte";
import Issues from "@app/views/repo/Issues.svelte";
import Patch from "@app/views/repo/Patch.svelte";
@@ -36,11 +44,45 @@
import Command from "./components/Command.svelte";
import ExternalLink from "./components/ExternalLink.svelte";
import FullscreenModalPortal from "./components/FullscreenModalPortal.svelte";
import FullWindowError from "./components/FullWindowError.svelte";
import Spinner from "./components/Spinner.svelte";
const activeRouteStore = router.activeRouteStore;
const DRAG_REGION_HEIGHT = 32;
const INTERACTIVE_TAGS = new Set([
"a",
"button",
"input",
"select",
"textarea",
]);
function isDraggableArea(e: MouseEvent): boolean {
if (e.clientY > DRAG_REGION_HEIGHT) return false;
let el = e.target as HTMLElement | null;
while (el && el !== document.body) {
if (INTERACTIVE_TAGS.has(el.tagName.toLowerCase())) return false;
if (el.getAttribute("role") === "button") return false;
if (el.classList.contains("txt-selectable")) return false;
el = el.parentElement;
}
return true;
}
window
.matchMedia("(prefers-color-scheme: dark)")
.addEventListener("change", ({ matches }) => {
if (get(followSystemTheme)) {
theme.set(matches ? "dark" : "light");
}
});
if (get(followSystemTheme)) {
theme.set(loadTheme());
}
let profile = $state<Config>();
let showSpinner = $state(false);
@@ -90,6 +132,9 @@
),
);
$effect(() => document.documentElement.setAttribute("data-theme", $theme));
$effect(() =>
document.documentElement.setAttribute("data-codefont", $codeFont),
);
</script>
<style>
@@ -102,11 +147,18 @@
</style>
<svelte:document
onmousedown={e => {
if (window.__TAURI_INTERNALS__ && isDraggableArea(e)) {
void getCurrentWindow().startDragging();
}
}}
onkeydown={e => {
const auxiliarKey = isMac() ? e.metaKey : e.ctrlKey;
// Handles the position of the plus key on different keyboard layouts.
const plusKey = e.key === "1" || e.key === "=";
if (auxiliarKey && (e.key === "+" || plusKey)) {
if (e.key === "Escape") {
hide();
} else if (auxiliarKey && (e.key === "+" || plusKey)) {
increaseFontSize();
} else if (auxiliarKey && e.key === "-") {
decreaseFontSize();
@@ -114,6 +166,7 @@
resetFontSize();
}
}} />
<FullscreenModalPortal />
{#if $activeRouteStore.resource === "booting"}
{#if startup.error?.code === "IdentityError.MissingProfile"}
@@ -141,12 +194,12 @@
{:else if showSpinner}
<div class="spinner"><Spinner /></div>
{/if}
{:else if $activeRouteStore.resource === "home"}
<Repos {...$activeRouteStore.params} />
{:else if $activeRouteStore.resource === "inbox"}
<InboxView {...$activeRouteStore.params} />
{:else if $activeRouteStore.resource === "guide"}
<GuideView {...$activeRouteStore.params} />
{:else if $activeRouteStore.resource === "repo.home"}
<RepoHome {...$activeRouteStore.params} />
{:else if $activeRouteStore.resource === "repo.createIssue"}
<CreateIssue {...$activeRouteStore.params} />
{:else if $activeRouteStore.resource === "repo.issue"}
<Issue {...$activeRouteStore.params} />
{:else if $activeRouteStore.resource === "repo.issues"}
+126 -156
View File
@@ -3,7 +3,7 @@
</script>
<script lang="ts">
import type { RepoInfo } from "@bindings/repo/RepoInfo";
import type { RepoSummary } from "@bindings/repo/RepoSummary";
import { z } from "zod";
@@ -13,20 +13,18 @@
import { parseRepositoryId, twemoji } from "@app/lib/utils";
import { announce } from "@app/components/AnnounceSwitch.svelte";
import Border from "@app/components/Border.svelte";
import Button from "@app/components/Button.svelte";
import Command from "@app/components/Command.svelte";
import ExternalLink from "@app/components/ExternalLink.svelte";
import Icon from "@app/components/Icon.svelte";
import { closeFocused } from "@app/components/Popover.svelte";
import Popover from "@app/components/Popover.svelte";
import Tab from "@app/components/Tab.svelte";
import TextInput from "@app/components/TextInput.svelte";
interface Props {
onOpen: () => void;
reload: () => Promise<void>;
repos: RepoInfo[];
repos: RepoSummary[];
seededNotReplicated: string[];
}
@@ -107,188 +105,160 @@
}
</style>
<Popover
popoverPositionRight="0"
popoverPositionTop="3rem"
bind:expanded={popoverExpanded}>
<Popover placement="bottom-start" bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<Button
variant="naked"
id={addRepoPopoverToggleId}
styleHeight="2.5rem"
variant="secondary"
onclick={() => {
onOpen();
onclick();
}}
active={popoverExpanded}>
<Icon name="add" />Add repo
<Icon name="plus" />
</Button>
{/snippet}
{#snippet popover()}
<Border
stylePosition="relative"
variant="ghost"
flatBottom
styleDisplay="flex"
styleWidth="100%"
styleGap="1rem"
styleMinWidth="27rem"
stylePadding="0 1rem">
<Tab
active={tab.value === "seed"}
onclick={() => {
tab.value = "seed";
}}>
Seed a repo
</Tab>
<Tab
active={tab.value === "publish"}
onclick={() => {
tab.value = "publish";
}}>
Publish existing repo
</Tab>
</Border>
<div
class="txt-body-m-regular"
style:line-height="1.625rem"
style:padding="1rem"
style:border-radius="var(--border-radius-md)"
style:border="1px solid var(--color-border-subtle)"
style:background-color="var(--color-surface-canvas)"
style:width="32rem">
<div class="global-flex" style:margin-bottom="1rem">
<Button
variant="naked"
active={tab.value === "seed"}
onclick={() => {
tab.value = "seed";
}}>
Seed a repo
</Button>
<Button
variant="naked"
active={tab.value === "publish"}
onclick={() => {
tab.value = "publish";
}}>
Publish existing
</Button>
</div>
<div style:margin-top="-2px">
<Border
variant="ghost"
flatTop
stylePadding="1rem"
styleDisplay="block"
styleFlexDirection="column"
styleAlignItems="flex-start">
<div class="txt-small" style:line-height="1.625rem">
{#if tab.value === "seed"}
<!-- prettier-ignore -->
<div style:margin-bottom="1rem">
{#if tab.value === "seed"}
<!-- prettier-ignore -->
<div style:margin-bottom="1rem" style:color="var(--color-text-primary)">
You can search for Radicle repos by name or description at
<ExternalLink href="https://search.radicle.xyz">
search.radicle.xyz
</ExternalLink>.
</div>
<div style:width="100%">
<div class="txt-body-l-semibold" style:margin-bottom="0.5rem"></div>
<div
class="global-flex"
style:flex-direction="column"
style:align-items="flex-start"
style:gap="1rem">
<div style:width="100%">
<div class="txt-semibold" style:margin-bottom="0.5rem"></div>
<div
class="global-flex"
style:flex-direction="column"
style:align-items="flex-start"
style:gap="1rem">
<div style:width="100%">
<div class="global-flex" style:width="100%">
<TextInput
autofocus
valid={validationMessage === undefined}
bind:value={rid}
onSubmit={submit}
placeholder="RID, e.g. rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5" />
<Button
variant="ghost"
styleHeight="2.5rem"
onclick={submit}
disabled={rid.trim() === ""}>
Seed
</Button>
</div>
{#if validationMessage}
<div
class="txt-small global-flex"
style:color="var(--color-foreground-red)"
style:padding="0.25rem 0 0 0.25rem"
style:gap="0.25rem">
<Icon name="warning" />
{validationMessage}
</div>
{/if}
</div>
<div class="global-flex" style:width="100%">
<TextInput
autofocus
valid={validationMessage === undefined}
bind:value={rid}
onSubmit={submit}
placeholder="RID, e.g. rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5" />
<Button
variant="secondary"
onclick={submit}
disabled={rid.trim() === ""}>
<Icon name="seed" />
Seed
</Button>
</div>
</div>
<div
class="global-flex txt-missing"
style:align-items="flex-start"
style:margin-top="2rem">
<span style:margin-top="0.25rem">
<Icon name="info" />
</span>
By seeding a repository, your node fetches it from the network, allowing
you to interact with it locally while also making it available to others.
</div>
{#if !$nodeRunning}
<div
class="global-flex txt-missing"
style:align-items="flex-start"
style:margin-top="1rem">
<span style:margin-top="0.25rem">
<Icon name="bulb" />
</span>
<div>
Your node is
<span class="txt-semibold">
<span
style:display="inline-block"
style:vertical-align="text-top">
<Icon name="offline" />
</span>
Offline.
</span>
You can still add repos, but they will only be fetched once your
node is back online.
{#if validationMessage}
<div
class="txt-body-m-regular global-flex"
style:color="var(--color-feedback-error-text)"
style:padding="0.25rem 0 0 0.25rem"
style:gap="0.25rem">
<Icon name="warning" />
{validationMessage}
</div>
</div>
{/if}
{:else if tab.value === "publish"}
<p style="margin: 0 0 1rem 0">
Navigate to an existing Git repo in your terminal
<code
style:white-space="nowrap"
style:padding="0.125rem 0.25rem"
style:background-color="var(--color-fill-ghost)">
cd path/to/your/repo
</code>
and run the following command:
</p>
{/if}
</div>
</div>
</div>
<div
class="global-flex txt-missing"
style:align-items="flex-start"
style:margin-top="2rem">
By seeding a repository, your node fetches it from the network,
allowing you to interact with it locally while also making it
available to others.
</div>
{#if !$nodeRunning}
<div
class="global-flex txt-missing"
style:align-items="flex-start"
style:margin-top="1rem">
<div>
Your node is Offline. You can still add repos, but they will only
be fetched once your node is back online.
</div>
</div>
{/if}
{:else if tab.value === "publish"}
<p style="margin: 0 0 1rem 0" style:color="var(--color-text-primary)">
Navigate to an existing Git repo in your terminal
<code
style:white-space="nowrap"
style:padding="0.125rem 0.25rem"
style:background-color="var(--color-surface-subtle)">
cd path/to/your/repo
</code>
and run the following command:
</p>
<Command styleWidth="fit-content" command="rad init" />
<Command styleWidth="fit-content" command="rad init" />
<p style="margin: 1rem 0 0 0">
Follow the setup prompts to initialize the repo and publish it on
the Radicle network:
</p>
<p style="margin: 1rem 0 0 0" style:color="var(--color-text-primary)">
Follow the setup prompts to initialize the repo and publish it on the
Radicle network:
</p>
<ul style:padding="0 1rem">
<li>
<strong>Repository Name:</strong>
The name of your repo.
</li>
<li>
<strong>Description:</strong>
A brief summary of what your repo does.
</li>
<!-- prettier-ignore -->
<li>
<ul style:padding="0 1rem">
<li>
<strong>Repository Name:</strong>
The name of your repo.
</li>
<li>
<strong>Description:</strong>
A brief summary of what your repo does.
</li>
<!-- prettier-ignore -->
<li>
<strong>Default Branch:</strong>
Typically
<strong>main</strong>
or
<strong>master</strong>.
</li>
<li>
<strong>Visibility:</strong>
Choose
<strong>public</strong>
to share with others or
<strong>private</strong>
to not publish it to the network yet.
</li>
</ul>
<p use:twemoji style:margin="2rem 0 0 0">
That's it! Your repo is now on the Radicle network. 🚀
</p>
{/if}
</div>
</Border>
<li>
<strong>Visibility:</strong>
Choose
<strong>public</strong>
to share with others or
<strong>private</strong>
to not publish it to the network yet.
</li>
</ul>
<p use:twemoji style:margin="2rem 0 0 0">
That's it! Your repo is now on the Radicle network.
</p>
{/if}
</div>
{/snippet}
</Popover>
+2 -2
View File
@@ -40,8 +40,8 @@
<div class="container">
<Button
flatRight
variant="ghost"
flatRight
active={$announce}
onclick={() => {
storeAnnounce(true);
@@ -50,8 +50,8 @@
</Button>
<Button
flatLeft
variant="ghost"
flatLeft
active={!$announce}
onclick={() => {
storeAnnounce(false);
+222
View File
@@ -0,0 +1,222 @@
<script lang="ts">
import type { RepoInfo } from "@bindings/repo/RepoInfo";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { onMount } from "svelte";
import { boolean } from "zod";
import { checkRadicleCLI } from "@app/lib/checkRadicleCLI.svelte";
import { dynamicInterval } from "@app/lib/interval";
import { invoke } from "@app/lib/invoke";
import { modalStore, show } from "@app/lib/modal";
import { notificationCount } from "@app/lib/notificationCount.svelte";
import * as router from "@app/lib/router";
import type { SidebarData } from "@app/lib/router/definitions";
import { updateChecker } from "@app/lib/updateChecker.svelte";
import useLocalStorage from "@app/lib/useLocalStorage.svelte";
import { isMac } from "@app/lib/utils";
import { badgeCounter } from "@app/components/BadgeCounterSwitch.svelte";
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import IdentityButton from "@app/components/IdentityButton.svelte";
import NodeStatusButton from "@app/components/NodeStatusButton.svelte";
import SidebarRepoList from "@app/components/SidebarRepoList.svelte";
import SettingsView from "@app/modals/Settings.svelte";
interface Props {
sidebarData: SidebarData;
activeRepo?: RepoInfo;
}
const { sidebarData, activeRepo = undefined }: Props = $props();
const firstLaunchStorage = useLocalStorage(
"appFirstLaunch",
boolean(),
true,
!window.localStorage,
);
onMount(async () => {
try {
await checkRadicleCLI();
} catch {
dynamicInterval("checkRadicleCLI", checkRadicleCLI, 1_000);
}
const isDefaultRoute =
window.location.pathname === "/" || window.location.pathname === "/inbox";
if (firstLaunchStorage.value === true && isDefaultRoute) {
await router.push({ resource: "guide" });
firstLaunchStorage.value = false;
}
await updateNotificationCount();
dynamicInterval("notificationCount", updateNotificationCount, 3_000);
});
async function updateNotificationCount() {
notificationCount.value = await invoke<number>("notification_count");
if (window.__TAURI_INTERNALS__ && $badgeCounter) {
await getCurrentWindow().setBadgeCount(
notificationCount.value === 0 ? undefined : notificationCount.value,
);
} else if (window.__TAURI_INTERNALS__) {
await getCurrentWindow().setBadgeCount(undefined);
}
}
$effect(() => {
if (window.__TAURI_INTERNALS__) {
void getCurrentWindow().setBadgeCount(
$badgeCounter && notificationCount.value > 0
? notificationCount.value
: undefined,
);
}
});
const activeRoute = router.activeRouteStore;
function isInbox(): boolean {
return $activeRoute.resource === "inbox";
}
function isGuide(): boolean {
return $activeRoute.resource === "guide";
}
function isSettings(): boolean {
return $modalStore?.component === SettingsView;
}
</script>
<style>
.sidebar {
display: flex;
flex-direction: column;
height: 100%;
min-height: 0;
width: 16.5rem;
border-right: 1px solid var(--color-border-subtle);
}
.top {
padding: 0 0.5rem;
height: 1.75rem;
display: flex;
align-items: center;
justify-content: flex-end;
gap: 0.25rem;
flex-shrink: 0;
}
.nav {
flex: 1;
overflow: visible;
padding: 0.5rem;
display: flex;
flex-direction: column;
gap: 0.25rem;
min-height: 0;
}
.bottom {
padding: 0.5rem;
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.nav-item {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.375rem 0.5rem;
border-radius: var(--border-radius-sm);
font: var(--txt-body-m-regular);
color: var(--color-text-primary);
cursor: pointer;
width: 100%;
text-decoration: none;
}
.nav-item:hover {
background-color: var(--color-surface-subtle);
}
.nav-item.active {
background-color: var(--color-surface-subtle);
}
.nav-item .global-counter-badge {
margin-left: auto;
}
.icon {
color: var(--color-text-tertiary);
}
.update-badge {
margin-left: auto;
font: var(--txt-body-s-regular);
color: var(--color-text-tertiary);
}
</style>
<div class="sidebar">
<div
class="top"
style:height={isMac() ? "2.75rem" : "1.75rem"}
data-tauri-drag-region>
<Button
variant="naked"
onclick={() => window.history.back()}
stylePadding="0 4px">
<span class="icon"><Icon name="arrow-left" /></span>
</Button>
<Button
variant="naked"
onclick={() => window.history.forward()}
stylePadding="0 4px">
<span class="icon"><Icon name="arrow-right" /></span>
</Button>
</div>
<div class="nav">
<IdentityButton config={sidebarData.config} />
<a
class="nav-item"
class:active={isInbox()}
href={router.routeToPath({ resource: "inbox" })}>
<span class="icon"><Icon name="inbox" /></span>
Inbox
{#if notificationCount.value > 0}
<span class="global-counter-badge">{notificationCount.value}</span>
{/if}
</a>
<SidebarRepoList
initialRepos={sidebarData.repos}
initialSeededNotReplicated={sidebarData.seededNotReplicated}
{activeRepo} />
</div>
<div class="bottom">
<Button
variant="naked"
styleWidth="100%"
styleJustifyContent="flex-start"
active={isGuide()}
onclick={() => router.push({ resource: "guide" })}>
<span class="icon"><Icon name="guide" /></span>
Guide
</Button>
<Button
variant="naked"
styleWidth="100%"
styleJustifyContent="flex-start"
active={isSettings()}
onclick={() => show({ component: SettingsView, props: {} })}>
<span class="icon"><Icon name="settings" /></span>
Settings
{#if updateChecker.newVersion}
<span class="update-badge">New Update</span>
{/if}
</Button>
<NodeStatusButton />
</div>
</div>
+75 -81
View File
@@ -8,6 +8,7 @@
publicKeyFromDid,
} from "@app/lib/utils";
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import NodeId from "@app/components/NodeId.svelte";
import TextInput from "@app/components/TextInput.svelte";
@@ -17,6 +18,7 @@
assignees: Author[];
submitInProgress: boolean;
save: (updatedAssignees: Author[]) => void;
preview?: boolean;
}
const {
@@ -24,6 +26,7 @@
assignees = $bindable(),
submitInProgress = false,
save,
preview = false,
}: Props = $props();
let updatedAssignees: Author[] = $state([]);
@@ -94,33 +97,25 @@
</script>
<style>
.add-icon {
display: none;
}
.title-button:hover .add-icon {
display: flex;
}
.title-button {
font-size: var(--font-size-small);
color: var(--color-foreground-dim);
}
.body {
.row {
display: flex;
align-items: center;
flex-wrap: wrap;
flex-direction: row;
gap: 1rem;
font-size: var(--font-size-small);
margin-top: 1rem;
gap: 0.5rem;
}
.validation-message {
display: flex;
align-items: center;
gap: 0.25rem;
color: var(--color-foreground-red);
color: var(--color-feedback-error-text);
position: relative;
margin-top: 0.5rem;
}
.input-row {
display: flex;
align-items: center;
gap: 0.5rem;
}
button {
border: 0;
cursor: pointer;
@@ -128,86 +123,79 @@
background-color: transparent;
border: none;
display: flex;
color: var(--color-foreground-default);
color: var(--color-text-secondary);
padding: 0;
align-items: center;
}
</style>
<div class="global-flex">
<button
disabled={!allowedToEdit}
style:color={allowedToEdit
? "var(--color-foreground-dim)"
: "var(--color-foreground-disabled)"}
title={allowedToEdit
? undefined
: "Only delegates are allowed to add assignees"}
style:cursor={allowedToEdit ? "pointer" : "default"}
class="title-button"
onclick={() => {
inputValue = "";
showInput = !showInput;
}}>
{#if updatedAssignees.length === 0}
Add assignees
{:else}
Assignees
{/if}
{#if !showInput && allowedToEdit}
<span class="add-icon">
<Icon name="add" />
</span>
{/if}
</button>
{#if allowedToEdit}
<div class="global-flex edit-icons">
{#if showInput}
<Icon
onclick={addAssignee}
name="checkmark"
disabled={!valid || inputValue === ""} />
<Icon
onclick={() => {
inputValue = "";
showInput = false;
}}
name="cross" />
{#if preview}
<div class="row">
<Button variant="outline" disabled>
<Icon name="avatar-incognito" />
{#if updatedAssignees.length === 0}
Add assignees
{:else}
Assignees
{/if}
</div>
{/if}
</div>
{#if showInput}
<div style:margin-top="1rem">
<TextInput
autofocus
{valid}
disabled={submitInProgress}
placeholder="Assignee DID, e.g. did:key:z6MkwPUeUS2…"
bind:value={inputValue}
onSubmit={addAssignee} />
{#if !valid && validationMessage}
<div class="validation-message">
<Icon name="warning" />{validationMessage}
</div>
{/if}
</Button>
{#each updatedAssignees as assignee}
<span style:color="var(--color-text-secondary)">
<NodeId {...authorForNodeId(assignee)} />
</span>
{/each}
</div>
{/if}
{:else}
<div class="row">
{#if showInput}
<div class="input-row">
<div style:flex="1" style:min-width="0">
<TextInput
autofocus
{valid}
disabled={submitInProgress}
placeholder="Assignee DID, e.g. did:key:z6MkwPUeUS2…"
bind:value={inputValue}
onSubmit={addAssignee} />
</div>
<Button
variant="outline"
onclick={() => {
showInput = false;
inputValue = "";
}}>
<Icon name="close" />
</Button>
</div>
{:else}
<Button
variant="outline"
disabled={!allowedToEdit}
title={allowedToEdit
? undefined
: "Only delegates are allowed to add assignees"}
onclick={() => {
inputValue = "";
showInput = true;
}}>
<Icon name="avatar-incognito" />
{#if updatedAssignees.length === 0}
Add assignees
{:else}
Assignees
{/if}
</Button>
{/if}
{#if updatedAssignees.length > 0}
<div class="body">
{#if allowedToEdit}
{#each updatedAssignees as assignee}
<button
class="txt-small"
class="txt-body-m-regular"
onclick={() =>
(removeToggles[assignee.did] = !removeToggles[assignee.did])}>
<NodeId {...authorForNodeId(assignee)} />
{#if removeToggles[assignee.did]}
<Icon name="cross" onclick={() => removeAssignee(assignee)} />
<Icon name="close" onclick={() => removeAssignee(assignee)} />
{/if}
</button>
{/each}
@@ -217,4 +205,10 @@
{/each}
{/if}
</div>
{#if !valid && validationMessage}
<div class="validation-message">
<Icon name="warning" />{validationMessage}
</div>
{/if}
{/if}
-34
View File
@@ -1,34 +0,0 @@
<script lang="ts">
import { createIcon } from "@app/lib/blockies";
const { publicKey }: { publicKey: string } = $props();
function createContainer(source: string) {
const seed = source.toLowerCase();
const avatar = createIcon({
seed,
size: 8,
scale: 16,
});
return avatar.toDataURL();
}
</script>
<style>
.avatar {
display: block;
width: inherit;
object-fit: cover;
background-size: cover;
background-repeat: no-repeat;
width: 1rem;
height: 1rem;
clip-path: var(--1px-corner-fill);
}
</style>
<img
title={publicKey}
src={createContainer(publicKey)}
class="avatar"
alt="avatar" />
+45
View File
@@ -0,0 +1,45 @@
<script lang="ts" module>
import { writable } from "svelte/store";
function loadBadgeCounter(): boolean {
const stored = localStorage ? localStorage.getItem("badgeCounter") : null;
return stored === null ? true : stored === "true";
}
export const badgeCounter = writable<boolean>(loadBadgeCounter());
export function storeBadgeCounter(enabled: boolean): void {
badgeCounter.set(enabled);
if (localStorage) {
localStorage.setItem("badgeCounter", enabled.toString());
}
}
</script>
<script lang="ts">
import Button from "@app/components/Button.svelte";
</script>
<style>
.container {
display: flex;
align-items: center;
}
</style>
<div class="container">
<Button
variant="ghost"
flatRight
active={$badgeCounter}
onclick={() => storeBadgeCounter(true)}>
Show
</Button>
<Button
variant="ghost"
flatLeft
active={!$badgeCounter}
onclick={() => storeBadgeCounter(false)}>
Hide
</Button>
</div>
-293
View File
@@ -1,293 +0,0 @@
<script lang="ts">
import type { Snippet } from "svelte";
interface Props {
children: Snippet;
variant:
| "primary"
| "secondary"
| "ghost"
| "float"
| "danger"
| "success"
| "outline";
innerElement?: HTMLElement;
hoverable?: boolean;
onclick?: (e: MouseEvent) => void;
stylePosition?: string;
stylePadding?: string;
styleHeight?: string;
styleMaxHeight?: string;
styleMaxWidth?: string;
styleMinHeight?: string;
styleMinWidth?: string;
styleWidth?: string;
styleDisplay?: string;
styleCursor?: "default" | "pointer" | "text";
styleGap?: string;
styleOverflow?: string;
flatTop?: boolean;
flatBottom?: boolean;
styleBackgroundColor?: string;
styleFlexDirection?: string;
styleAlignSelf?: string;
styleAlignItems?: string;
styleJustifyContent?: string;
}
/* eslint-disable prefer-const */
let {
children,
variant,
hoverable = false,
innerElement = $bindable(),
onclick,
stylePadding,
styleHeight,
styleMaxHeight,
styleMaxWidth,
styleMinHeight,
stylePosition,
styleWidth,
styleDisplay = "flex",
styleCursor = "default",
styleGap = "0.5rem",
styleMinWidth,
styleOverflow,
flatTop = false,
flatBottom = false,
styleBackgroundColor = "var(--color-background-default)",
styleFlexDirection = "row",
styleAlignSelf,
styleAlignItems = "center",
styleJustifyContent,
}: Props = $props();
const style = $derived(
`--local-background-color: ${styleBackgroundColor};` +
`--local-button-color-1: var(--color-fill-${variant});` +
`--local-hover-background-color: ${hoverable ? "var(--color-background-float)" : styleBackgroundColor}`,
);
</script>
<style>
.container {
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
flex: 1;
column-gap: 0;
row-gap: 0;
display: grid;
grid-template-columns: 2px 2px auto 2px 2px;
grid-template-rows: 2px 2px auto 2px 2px;
grid-template-areas:
"p1-1 p1-2 p1-3 p1-4 p1-5"
"p2-1 p2-2 p2-3 p2-4 p2-5"
"p3-1 p3-2 p3-3 p3-4 p3-5"
"p4-1 p4-2 p4-3 p4-4 p4-5"
"p5-1 p5-2 p5-3 p5-4 p5-5";
}
.container:hover > .p2-3,
.container:hover > .p3-2,
.container:hover > .p3-3,
.container:hover > .p3-4,
.container:hover > .p4-3 {
background-color: var(--local-hover-background-color);
}
.p1-1 {
grid-area: p1-1;
background-color: transparent;
}
.p1-2 {
grid-area: p1-2;
background-color: transparent;
}
.p1-3 {
grid-area: p1-3;
background-color: var(--local-button-color-1);
}
.p1-4 {
grid-area: p1-4;
background-color: transparent;
}
.p1-5 {
grid-area: p1-5;
background-color: transparent;
}
.p2-1 {
grid-area: p2-1;
background-color: transparent;
}
.p2-2 {
grid-area: p2-2;
background-color: var(--local-button-color-1);
}
.p2-3 {
grid-area: p2-3;
background-color: var(--local-background-color);
}
.p2-4 {
grid-area: p2-4;
background-color: var(--local-button-color-1);
}
.p2-5 {
grid-area: p2-5;
background-color: transparent;
}
.p3-1 {
grid-area: p3-1;
background-color: var(--local-button-color-1);
}
.p3-2 {
grid-area: p3-2;
background-color: var(--local-background-color);
}
.p3-3 {
grid-area: p3-3;
background-color: var(--local-background-color);
}
.p3-4 {
grid-area: p3-4;
background-color: var(--local-background-color);
}
.p3-5 {
grid-area: p3-5;
background-color: var(--local-button-color-1);
}
.p4-1 {
grid-area: p4-1;
background-color: transparent;
}
.p4-2 {
grid-area: p4-2;
background-color: var(--local-button-color-1);
}
.p4-3 {
grid-area: p4-3;
background-color: var(--local-background-color);
}
.p4-4 {
grid-area: p4-4;
background-color: var(--local-button-color-1);
}
.p4-5 {
grid-area: p4-5;
background-color: transparent;
}
.p5-1 {
grid-area: p5-1;
background-color: transparent;
}
.p5-2 {
grid-area: p5-2;
background-color: transparent;
}
.p5-3 {
grid-area: p5-3;
background-color: var(--local-button-color-1);
}
.p5-4 {
grid-area: p5-4;
background-color: transparent;
}
.p5-5 {
grid-area: p5-5;
background-color: transparent;
}
.flat-top > .p1-3,
.flat-top > .p2-2,
.flat-top > .p2-4 {
background-color: transparent;
}
.flat-top > .p1-1,
.flat-top > .p1-5,
.flat-top > .p2-1,
.flat-top > .p2-5 {
background-color: var(--local-button-color-1);
}
.flat-bottom > .p4-2,
.flat-bottom > .p4-4 {
background-color: transparent;
}
.flat-bottom > .p4-1,
.flat-bottom > .p4-5,
.flat-bottom > .p5-3,
.flat-bottom > .p5-1,
.flat-bottom > .p5-2,
.flat-bottom > .p5-4,
.flat-bottom > .p5-5 {
background-color: var(--local-button-color-1);
}
</style>
<!-- svelte-ignore a11y_no_noninteractive_tabindex -->
<div
style:width={styleWidth}
style:max-width={styleMaxWidth}
style:align-self={styleAlignSelf}
style:cursor={styleCursor}
class="container"
class:flat-top={flatTop}
class:flat-bottom={flatBottom}
{onclick}
role={onclick !== undefined ? "button" : undefined}
tabindex={onclick !== undefined ? 0 : undefined}
{style}
style:min-height={styleMinHeight}
style:height={styleHeight}>
<div class="p1-1"></div>
<div class="p1-2"></div>
<div class="p1-3"></div>
<div class="p1-4"></div>
<div class="p1-5"></div>
<div class="p2-1"></div>
<div class="p2-2"></div>
<div class="p2-3"></div>
<div class="p2-4"></div>
<div class="p2-5"></div>
<div class="p3-1"></div>
<div class="p3-2"></div>
<div
class="p3-3"
bind:this={innerElement}
style:max-height={styleMaxHeight}
style:min-width={styleMinWidth}
style:display={styleDisplay}
style:position={stylePosition}
style:padding={stylePadding}
style:gap={styleGap}
style:overflow={styleOverflow}
style:justify-content={styleJustifyContent}
style:align-items={styleAlignItems}
style:flex-direction={styleFlexDirection}>
{@render children()}
</div>
<div class="p3-4"></div>
<div class="p3-5"></div>
<div class="p4-1"></div>
<div class="p4-2"></div>
<div class="p4-3"></div>
<div class="p4-4"></div>
<div class="p4-5"></div>
<div class="p5-1"></div>
<div class="p5-2"></div>
<div class="p5-3"></div>
<div class="p5-4"></div>
<div class="p5-5"></div>
</div>
+121 -362
View File
@@ -1,23 +1,29 @@
<script lang="ts">
import type { Snippet } from "svelte";
type Variant = "secondary" | "ghost" | "naked" | "outline";
interface Props {
id?: string;
children: Snippet;
variant: "primary" | "secondary" | "ghost" | "success" | "danger";
onclick?: () => void;
variant?: Variant;
onclick?: (e: MouseEvent) => void;
disabled?: boolean;
active?: boolean;
flatLeft?: boolean;
flatRight?: boolean;
title?: string;
styleHeight?: "2rem" | "2.5rem";
styleWidth?: string;
styleJustifyContent?: string;
stylePadding?: string;
keyShortcuts?: string;
}
const {
id,
children,
variant,
variant = "ghost",
onclick = undefined,
disabled = false,
active = false,
@@ -25,396 +31,149 @@
flatRight = false,
title,
styleHeight = "2rem",
styleWidth = undefined,
styleJustifyContent = undefined,
stylePadding = "0 0.5rem",
keyShortcuts,
}: Props = $props();
const style = $derived(
`--button-color-1: var(--color-fill-${variant});` +
`--button-color-2: var(--color-fill-${variant}-hover);` +
`--button-color-3: var(--color-fill-${variant}-shade);` +
// The ghost colors are called --color-fill-counter and --color-fill-counter-emphasized.
`--button-color-4: var(--color-fill${variant === "ghost" ? "" : `-${variant}`}-counter);` +
`--text-color: ${variant === "ghost" ? "var(--color-foreground-contrast)" : "var(--color-foreground-white)"};` +
`--text-color-active: ${variant === "ghost" ? "var(--color-foreground-emphasized)" : "var(--color-foreground-white)"};`,
);
const fills: Record<Variant, string> = {
secondary: "var(--color-surface-brand-secondary)",
ghost: "var(--color-surface-subtle)",
naked: "transparent",
outline: "transparent",
};
const fillsHover: Record<Variant, string> = {
secondary: "var(--color-surface-brand-secondary)",
ghost: "var(--color-surface-mid)",
naked: "var(--color-surface-subtle)",
outline: "var(--color-surface-subtle)",
};
const fillsActive: Record<Variant, string> = {
secondary: "var(--color-surface-brand-primary)",
ghost: "var(--color-surface-strong)",
naked: "var(--color-surface-strong)",
outline: "var(--color-surface-strong)",
};
const colors: Record<Variant, string> = {
secondary: "var(--color-text-on-brand)",
ghost: "var(--color-text-primary)",
naked: "inherit",
outline: "inherit",
};
const colorsHover: Record<Variant, string> = {
secondary: "var(--color-text-on-brand)",
ghost: "var(--color-text-primary)",
naked: "inherit",
outline: "var(--color-text-primary)",
};
const colorsActive: Record<Variant, string> = {
secondary: "var(--color-text-on-brand)",
ghost: "var(--color-text-primary)",
naked: "inherit",
outline: "var(--color-text-primary)",
};
</script>
<style>
.container {
.button {
white-space: nowrap;
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
color: var(--text-color);
column-gap: 0;
row-gap: 0;
display: grid;
grid-template-columns: 2px 2px auto 2px 2px;
grid-template-rows: 2px 2px auto 2px 2px;
grid-template-areas:
"p1-1 p1-2 p1-3 p1-4 p1-5"
"p2-1 p2-2 p2-3 p2-4 p2-5"
"p3-1 p3-2 p3-3 p3-4 p3-5"
"p4-1 p4-2 p4-3 p4-4 p4-5"
"p5-1 p5-2 p5-3 p5-4 p5-5";
}
.container:hover:not(.disabled) .p1-3,
.container:hover:not(.disabled) .p2-2,
.container:hover:not(.disabled) .p2-4,
.container:hover:not(.disabled) .p3-1,
.container:hover:not(.disabled) .p3-3,
.container:hover:not(.disabled) .p4-2 {
background-color: var(--button-color-2);
}
.container:hover:not(.disabled) .p2-3,
.container:hover:not(.disabled) .p3-2 {
background-color: var(--button-color-4);
}
.container:hover:not(.disabled) .p3-4,
.container:hover:not(.disabled) .p3-5,
.container:hover:not(.disabled) .p4-3,
.container:hover:not(.disabled) .p4-4,
.container:hover:not(.disabled) .p5-3 {
background-color: var(--button-color-1);
}
.container.active:not(.disabled) .p1-3,
.container.active:not(.disabled) .p2-2,
.container.active:not(.disabled) .p2-4,
.container.active:not(.disabled) .p3-1,
.container.active:not(.disabled) .p3-3,
.container.active:not(.disabled) .p3-5,
.container.active:not(.disabled) .p4-2,
.container.active:not(.disabled) .p4-4,
.container.active:not(.disabled) .p5-3,
.container:active:not(.disabled) .p1-3,
.container:active:not(.disabled) .p2-2,
.container:active:not(.disabled) .p2-4,
.container:active:not(.disabled) .p3-1,
.container:active:not(.disabled) .p3-3,
.container:active:not(.disabled) .p3-5,
.container:active:not(.disabled) .p4-2,
.container:active:not(.disabled) .p4-4,
.container:active:not(.disabled) .p5-3 {
background-color: var(--button-color-1);
}
.container.active:not(.disabled) .p2-3,
.container.active:not(.disabled) .p3-2,
.container:active:not(.disabled) .p2-3,
.container:active:not(.disabled) .p3-2 {
background-color: var(--button-color-3);
}
.container.active:not(.disabled) .p3-4,
.container.active:not(.disabled) .p4-3,
.container:active:not(.disabled) .p3-4,
.container:active:not(.disabled) .p4-3 {
background-color: var(--button-color-2);
}
.container.disabled {
color: var(--color-foreground-disabled);
}
.container.active:not(.disabled) {
color: var(--text-color-active);
}
.disabled .p1-3,
.disabled .p2-2,
.disabled .p2-3,
.disabled .p2-4,
.disabled .p3-1,
.disabled .p3-2,
.disabled .p3-3,
.disabled .p3-4,
.disabled .p3-5,
.disabled .p4-2,
.disabled .p4-3,
.disabled .p4-4,
.disabled .p5-3 {
background-color: var(--color-fill-ghost);
}
.flat-right .p1-4,
.flat-right .p1-5,
.flat-right .p2-5,
.flat-right .p3-4 {
background-color: var(--button-color-1);
}
.flat-right .p2-4 {
background-color: var(--button-color-2);
}
.flat-right .p4-5,
.flat-right .p5-4,
.flat-right .p5-5 {
background-color: var(--button-color-3);
}
.container:hover:not(.disabled).flat-right .p1-4,
.container:hover:not(.disabled).flat-right .p1-5,
.container:hover:not(.disabled).flat-right .p2-5,
.container:hover:not(.disabled).flat-right .p3-4 {
background-color: var(--button-color-2);
}
.container:hover:not(.disabled).flat-right .p2-4 {
background-color: var(--button-color-4);
}
.container:hover:not(.disabled).flat-right .p4-5,
.container:hover:not(.disabled).flat-right .p5-4,
.container:hover:not(.disabled).flat-right .p5-5 {
background-color: var(--button-color-1);
}
.container.active:not(.disabled).flat-right .p1-4,
.container.active:not(.disabled).flat-right .p1-5,
.container.active:not(.disabled).flat-right .p2-5,
.container.active:not(.disabled).flat-right .p3-4,
.container.active:not(.disabled).flat-right .p4-5,
.container.active:not(.disabled).flat-right .p5-4,
.container.active:not(.disabled).flat-right .p5-5,
.container:active:not(.disabled).flat-right .p1-4,
.container:active:not(.disabled).flat-right .p1-5,
.container:active:not(.disabled).flat-right .p2-5,
.container:active:not(.disabled).flat-right .p3-4,
.container:active:not(.disabled).flat-right .p4-5,
.container:active:not(.disabled).flat-right .p5-4,
.container:active:not(.disabled).flat-right .p5-5 {
background-color: var(--button-color-1);
}
.container.active:not(.disabled).flat-right .p2-4,
.container:active:not(.disabled).flat-right .p2-4 {
background-color: var(--button-color-3);
}
.container.active:not(.disabled).flat-right .p3-5,
.container.active:not(.disabled).flat-right .p4-4,
.container:active:not(.disabled).flat-right .p3-5,
.container:active:not(.disabled).flat-right .p4-4 {
background-color: var(--button-color-2);
}
.flat-left .p1-1,
.flat-left .p1-2,
.flat-left .p2-1,
.flat-left .p3-2 {
background-color: var(--button-color-1);
}
.flat-left .p2-2,
.flat-left .p3-1 {
background-color: var(--button-color-2);
}
.flat-left .p4-1,
.flat-left .p4-2,
.flat-left .p5-1,
.flat-left .p5-2 {
background-color: var(--button-color-3);
}
.container:hover:not(.disabled).flat-left .p1-1,
.container:hover:not(.disabled).flat-left .p1-2,
.container:hover:not(.disabled).flat-left .p2-1,
.container:hover:not(.disabled).flat-left .p3-2 {
background-color: var(--button-color-2);
}
.container:hover:not(.disabled).flat-left .p2-2,
.container:hover:not(.disabled).flat-left .p3-1 {
background-color: var(--button-color-4);
}
.container:hover:not(.disabled).flat-left .p4-1,
.container:hover:not(.disabled).flat-left .p4-2,
.container:hover:not(.disabled).flat-left .p5-1,
.container:hover:not(.disabled).flat-left .p5-2 {
background-color: var(--button-color-1);
}
.container.active:not(.disabled).flat-left .p1-1,
.container.active:not(.disabled).flat-left .p1-2,
.container.active:not(.disabled).flat-left .p2-1,
.container.active:not(.disabled).flat-left .p3-2,
.container.active:not(.disabled).flat-left .p4-1,
.container.active:not(.disabled).flat-left .p4-2,
.container.active:not(.disabled).flat-left .p5-1,
.container.active:not(.disabled).flat-left .p5-2,
.container:active:not(.disabled).flat-left .p1-1,
.container:active:not(.disabled).flat-left .p1-2,
.container:active:not(.disabled).flat-left .p2-1,
.container:active:not(.disabled).flat-left .p3-2,
.container:active:not(.disabled).flat-left .p4-1,
.container:active:not(.disabled).flat-left .p4-2,
.container:active:not(.disabled).flat-left .p5-1,
.container:active:not(.disabled).flat-left .p5-2 {
background-color: var(--button-color-1);
}
.container.active:not(.disabled).flat-left .p2-2,
.container.active:not(.disabled).flat-left .p3-1,
.container:active:not(.disabled).flat-left .p2-2,
.container:active:not(.disabled).flat-left .p3-1 {
background-color: var(--button-color-3);
}
.container.active:not(.disabled).flat-left .p4-2,
.container:active:not(.disabled).flat-left .p4-2 {
background-color: var(--button-color-2);
}
.p1-1 {
grid-area: p1-1;
background-color: transparent;
}
.p1-2 {
grid-area: p1-2;
background-color: transparent;
}
.p1-3 {
grid-area: p1-3;
background-color: var(--button-color-1);
}
.p1-4 {
grid-area: p1-4;
background-color: transparent;
}
.p1-5 {
grid-area: p1-5;
background-color: transparent;
}
.p2-1 {
grid-area: p2-1;
background-color: transparent;
}
.p2-2 {
grid-area: p2-2;
background-color: var(--button-color-1);
}
.p2-3 {
grid-area: p2-3;
background-color: var(--button-color-2);
}
.p2-4 {
grid-area: p2-4;
background-color: var(--button-color-1);
}
.p2-5 {
grid-area: p2-5;
background-color: transparent;
}
.p3-1 {
grid-area: p3-1;
background-color: var(--button-color-1);
}
.p3-2 {
grid-area: p3-2;
background-color: var(--button-color-2);
}
.p3-3 {
grid-area: p3-3;
background-color: var(--button-color-1);
padding: 0 0.5rem;
display: flex;
display: inline-flex;
align-items: center;
gap: 0.5rem;
}
.p3-4 {
grid-area: p3-4;
background-color: var(--button-color-3);
}
.p3-5 {
grid-area: p3-5;
background-color: var(--button-color-3);
border-radius: var(--border-radius-sm);
border: none;
background-color: var(--color-fill);
color: var(--color-text);
transition: background-color 0.1s ease;
}
.p4-1 {
grid-area: p4-1;
background-color: transparent;
}
.p4-2 {
grid-area: p4-2;
background-color: var(--button-color-1);
}
.p4-3 {
grid-area: p4-3;
background-color: var(--button-color-3);
}
.p4-4 {
grid-area: p4-4;
background-color: var(--button-color-3);
}
.p4-5 {
grid-area: p4-5;
background-color: transparent;
.button:hover:not(.disabled) {
background-color: var(--color-fill-hover);
color: var(--color-text-hover);
}
.p5-1 {
grid-area: p5-1;
background-color: transparent;
.button.active:not(.disabled),
.button:active:not(.disabled) {
background-color: var(--color-fill-active);
color: var(--color-text-active);
}
.p5-2 {
grid-area: p5-2;
background-color: transparent;
.button.disabled {
cursor: default;
color: var(--color-text-disabled);
}
.p5-3 {
grid-area: p5-3;
background-color: var(--button-color-3);
.button.secondary.disabled,
.button.ghost.disabled {
background-color: var(--color-surface-subtle);
}
.p5-4 {
grid-area: p5-4;
background-color: transparent;
.button.naked.disabled {
cursor: inherit;
}
.p5-5 {
grid-area: p5-5;
background-color: transparent;
.button.outline {
border: 1px solid var(--color-fill);
}
.button.outline.active:not(.disabled),
.button.outline:active:not(.disabled) {
border-color: var(--color-fill-active);
}
.button.outline.disabled {
border-color: var(--color-border-subtle);
}
.button.flat-left {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
.button.flat-right {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
}
</style>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
{id}
class="container active"
style:cursor={!disabled ? "pointer" : "default"}
style:height={styleHeight}
class="button txt-body-m-medium"
class:secondary={variant === "secondary"}
class:ghost={variant === "ghost"}
class:naked={variant === "naked"}
class:outline={variant === "outline"}
class:disabled
class:active
class:flat-right={flatRight}
class:flat-left={flatLeft}
class:flat-right={flatRight}
style:cursor={disabled
? variant === "naked"
? "inherit"
: "default"
: "pointer"}
style:height={styleHeight}
style:width={styleWidth}
style:padding={stylePadding}
style:justify-content={styleJustifyContent ??
(styleWidth ? "center" : undefined)}
style:--color-fill={fills[variant]}
style:--color-fill-hover={fillsHover[variant]}
style:--color-fill-active={fillsActive[variant]}
style:--color-text={colors[variant]}
style:--color-text-hover={colorsHover[variant]}
style:--color-text-active={colorsActive[variant]}
aria-keyshortcuts={keyShortcuts}
onclick={!disabled ? onclick : undefined}
role="button"
tabindex="0"
{title}
{style}>
<div class="p1-1"></div>
<div class="p1-2"></div>
<div class="p1-3"></div>
<div class="p1-4"></div>
<div class="p1-5"></div>
<div class="p2-1"></div>
<div class="p2-2"></div>
<div class="p2-3"></div>
<div class="p2-4"></div>
<div class="p2-5"></div>
<div class="p3-1"></div>
<div class="p3-2"></div>
<div class="p3-3 txt-semibold txt-small">
{@render children()}
</div>
<div class="p3-4"></div>
<div class="p3-5"></div>
<div class="p4-1"></div>
<div class="p4-2"></div>
<div class="p4-3"></div>
<div class="p4-4"></div>
<div class="p4-5"></div>
<div class="p5-1"></div>
<div class="p5-2"></div>
<div class="p5-3"></div>
<div class="p5-4"></div>
<div class="p5-5"></div>
{title}>
{@render children()}
</div>
+24 -32
View File
@@ -5,13 +5,13 @@
import { cachedGetDiff, cachedListCommits } from "@app/lib/invoke";
import { pluralize } from "@app/lib/utils";
import Button from "@app/components/Button.svelte";
import Changeset from "@app/components/Changeset.svelte";
import CobCommitTeaser from "@app/components/CobCommitTeaser.svelte";
import CommitsContainer from "@app/components/CommitsContainer.svelte";
import Icon from "@app/components/Icon.svelte";
import Id from "@app/components/Id.svelte";
import JobCob from "@app/components/JobCob.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
interface Props {
patchId: string;
@@ -66,11 +66,11 @@
position: relative;
display: flex;
flex-direction: column;
font-size: 0.875rem;
font: var(--txt-body-m-regular);
margin-left: 0.5rem;
gap: 0.5rem;
padding: 1rem 0.5rem 0.5rem 1rem;
border-left: 1px solid var(--color-fill-separator);
border-left: 1px solid var(--color-border-subtle);
}
.commit:last-of-type::after {
content: "";
@@ -78,7 +78,7 @@
left: -18.5px;
top: 14px;
bottom: -0.5rem;
border-left: 4px solid var(--color-background-default);
border-left: 4px solid var(--color-surface-canvas);
}
.commit-dot {
width: 0.25rem;
@@ -86,30 +86,30 @@
position: absolute;
top: 0.625rem;
left: -18.5px;
background-color: var(--color-fill-separator);
background-color: var(--color-border-subtle);
}
.commit {
cursor: pointer;
}
.commit-dot.active {
background-color: var(--color-border-focus);
background-color: var(--color-border-brand);
}
.commit:hover:not(.single-commit) .commit-dot:not(.active) {
background-color: var(--color-foreground-contrast);
background-color: var(--color-text-primary);
}
.commit:hover:not(.single-commit) {
background-color: var(--color-background-float);
background-color: var(--color-surface-canvas);
}
.disabled {
color: var(--color-foreground-disabled) !important;
color: var(--color-text-disabled) !important;
}
.summary {
cursor: pointer;
padding: 0.25rem 0;
}
.summary:hover:not(.single-commit) {
background-color: var(--color-background-float);
color: var(--color-foreground-contrast) !important;
background-color: var(--color-surface-canvas);
color: var(--color-text-primary) !important;
}
.single-commit {
cursor: default !important;
@@ -117,30 +117,25 @@
</style>
<div
class="txt-semibold global-flex"
class="txt-body-m-regular global-flex"
style:margin-bottom={hideChanges ? undefined : "1rem"}>
<div class="global-flex">
<NakedButton
variant="ghost"
onclick={() => (hideChanges = !hideChanges)}
stylePadding="0 4px">
<Button variant="naked" onclick={() => (hideChanges = !hideChanges)}>
<Icon name={hideChanges ? "chevron-right" : "chevron-down"} />
</NakedButton>
<div class="txt-semibold global-flex txt-regular">Changes</div>
</Button>
<div class="txt-body-m-regular global-flex">Changes</div>
</div>
{#if !hideChanges}
<div style:margin-left="auto">
<NakedButton
variant="ghost"
onclick={() => (filesExpanded = !filesExpanded)}>
<Button variant="naked" onclick={() => (filesExpanded = !filesExpanded)}>
{#if filesExpanded === true}
<Icon name="collapse" />
<Icon name="collapse-vertical" />
Collapse all
{:else}
<Icon name="expand" />
<Icon name="expand-vertical" />
Expand all
{/if}
</NakedButton>
</Button>
</div>
{/if}
</div>
@@ -150,13 +145,13 @@
<div style:margin-bottom="1rem">
<CommitsContainer>
{#snippet leftHeader()}
<div class="txt-semibold">Commits</div>
<div class="txt-body-m-regular">Commits</div>
{/snippet}
<div style:padding="0 1rem">
<!-- svelte-ignore a11y_no_static_element_interactions -->
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
class="global-flex txt-small summary"
class="global-flex txt-body-m-regular summary"
class:single-commit={commits.length === 1}
class:disabled={selectedCommit}
onclick={() => {
@@ -169,11 +164,8 @@
<Icon name="branch" />
{commits.length}
{pluralize("commit", commits.length)} on base
<Id
id={revision.base}
clipboard={revision.base}
variant={selectedCommit ? "none" : "commit"} />
<div class="global-counter">Base</div>
<Id id={revision.base} clipboard={revision.base} />
<div class="global-chip">Base</div>
</div>
<div class="commits">
{#each [...commits].reverse() as commit, idx}
@@ -211,7 +203,7 @@
{/await}
{#await cachedGetDiff(rid, { base, head, unified: 3, highlight: true })}
<span class="txt-small">Loading…</span>
<span class="txt-body-m-regular">Loading…</span>
{:then diff}
<Changeset expanded={filesExpanded} {head} {diff} {codeComments} />
{/await}
+17 -20
View File
@@ -1,10 +1,9 @@
<script lang="ts">
import { formatOid } from "@app/lib/utils";
import Border from "@app/components/Border.svelte";
import Button from "@app/components/Button.svelte";
import Command from "@app/components/Command.svelte";
import Icon from "@app/components/Icon.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import Popover from "@app/components/Popover.svelte";
interface Props {
@@ -26,34 +25,32 @@
let popoverExpanded: boolean = $state(false);
</script>
<Popover
popoverPositionRight="0"
popoverPositionTop="3rem"
bind:expanded={popoverExpanded}>
<Popover placement="bottom-end" bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<NakedButton
<Button
variant="naked"
title="Checkout patch"
styleHeight="2.5rem"
variant="ghost"
{onclick}
active={popoverExpanded}>
<Icon name="checkout" />
<span class="global-hide-on-medium-desktop-down">Checkout patch</span>
</NakedButton>
</Button>
{/snippet}
{#snippet popover()}
<Border
styleAlignItems="flex-start"
styleBackgroundColor="var(--color-background-float)"
styleFlexDirection="column"
styleGap="0.5rem"
stylePadding="1rem"
styleWidth="max-content"
variant="ghost">
<span class="txt-small">
<div
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="0.5rem"
style:align-items="flex-start"
style:background-color="var(--color-surface-canvas)"
style:flex-direction="column"
style:padding="1rem"
style:width="max-content">
<span class="txt-body-m-regular">
To checkout this patch in your working copy, run:
</span>
<Command command={checkoutCommand} styleWidth="100%" />
</Border>
</div>
{/snippet}
</Popover>
+14 -16
View File
@@ -1,5 +1,4 @@
<script lang="ts">
import Border from "@app/components/Border.svelte";
import Button from "@app/components/Button.svelte";
import Command from "@app/components/Command.svelte";
import Icon from "@app/components/Icon.svelte";
@@ -14,13 +13,10 @@
let popoverExpanded: boolean = $state(false);
</script>
<Popover
popoverPositionRight="0"
popoverPositionTop="3rem"
bind:expanded={popoverExpanded}>
<Popover placement="bottom-end" bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<Button
styleHeight="2.5rem"
styleHeight="2rem"
variant="secondary"
{onclick}
active={popoverExpanded}>
@@ -29,18 +25,20 @@
{/snippet}
{#snippet popover()}
<Border
styleAlignItems="flex-start"
styleBackgroundColor="var(--color-background-float)"
styleFlexDirection="column"
styleGap="0.5rem"
stylePadding="1rem"
styleWidth="max-content"
variant="ghost">
<span class="txt-small">
<div
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="0.5rem"
style:align-items="flex-start"
style:background-color="var(--color-surface-canvas)"
style:flex-direction="column"
style:padding="1rem"
style:width="max-content">
<span class="txt-body-m-regular">
To checkout a working copy of this repo, run:
</span>
<Command command={`rad checkout ${rid}`} styleWidth="100%" />
</Border>
</div>
{/snippet}
</Popover>
+82 -4
View File
@@ -1,6 +1,13 @@
<svelte:options customElement="radicle-clipboard" />
<script lang="ts">
import {
autoUpdate,
computePosition,
flip,
offset,
shift,
} from "@floating-ui/dom";
import debounce from "lodash/debounce";
import { writeToClipboard } from "@app/lib/invoke";
@@ -9,24 +16,61 @@
interface Props {
text: string;
noPopover?: boolean;
}
const { text }: Props = $props();
const { text, noPopover = false }: Props = $props();
let icon: "copy" | "checkmark" = $state("copy");
let tooltip = $state("Click to copy");
let visible = $state(false);
let anchorEl: HTMLElement | undefined = $state();
let floatingEl: HTMLDivElement | undefined = $state();
const restoreIcon = debounce(() => {
icon = "copy";
}, 800);
tooltip = "Click to copy";
visible = false;
}, 1000);
const setVisible = debounce((value: boolean) => {
visible = value;
}, 50);
$effect(() => {
void tooltip;
if (floatingEl && anchorEl) {
const cleanup = autoUpdate(anchorEl, floatingEl, () => {
void computePosition(anchorEl!, floatingEl!, {
placement: "top",
middleware: [offset(6), flip(), shift({ padding: 8 })],
}).then(({ x, y }) => {
if (floatingEl) {
floatingEl.style.left = `${x}px`;
floatingEl.style.top = `${y}px`;
floatingEl.style.visibility = "visible";
}
});
});
return cleanup;
}
});
export async function copy() {
await writeToClipboard(text);
icon = "checkmark";
tooltip = "Copied to clipboard";
if (!noPopover) {
setVisible(true);
}
restoreIcon();
}
</script>
<style>
.container {
display: inline-flex;
}
.clipboard {
width: 1.5rem;
height: 1.5rem;
@@ -36,9 +80,43 @@
align-items: center;
user-select: none;
}
.popover {
position: fixed;
top: 0;
left: 0;
visibility: hidden;
display: flex;
align-items: center;
flex-direction: row;
gap: 0.5rem;
justify-content: center;
z-index: 20;
background: var(--color-surface-subtle);
color: var(--color-text-primary);
border: 1px solid var(--color-border-subtle);
border-radius: var(--border-radius-md);
box-shadow: var(--elevation-low);
font: var(--txt-body-m-regular);
white-space: nowrap;
width: max-content;
padding: 0.25rem 0.5rem;
}
</style>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<span role="button" tabindex="0" class="clipboard" onclick={copy}>
<Icon name={icon} />
<span
role="group"
class="container"
bind:this={anchorEl}
onmouseenter={() => !noPopover && setVisible(true)}
onmouseleave={() => !noPopover && setVisible(false)}>
<span role="button" tabindex="0" class="clipboard" onclick={copy}>
<Icon name={icon} />
</span>
{#if visible}
<div bind:this={floatingEl} class="popover">
<Icon name={icon} />
{tooltip}
</div>
{/if}
</span>
+62
View File
@@ -0,0 +1,62 @@
<script lang="ts">
import type { CacheEvent } from "@bindings/cob/CacheEvent";
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import Spinner from "@app/components/Spinner.svelte";
interface Props {
noun: string;
cacheState: CacheEvent | undefined;
onRebuild: () => Promise<void>;
}
const { noun, cacheState, onRebuild }: Props = $props();
</script>
<style>
.container {
padding: 1rem;
}
.banner {
display: flex;
align-items: center;
gap: 1rem;
padding: 0.25rem 0.5rem;
overflow: hidden;
border: 1px solid var(--color-feedback-warning-border);
border-radius: var(--border-radius-md);
background-color: var(--color-feedback-warning-bg);
}
.action {
margin-left: auto;
}
</style>
<div class="container">
<div class="banner">
<div class="txt-overflow txt-body-m-regular global-flex">
<Icon name="warning" />
<span class="txt-overflow">
There's a problem with your COB cache, so some {noun} may not be displayed.
You can rebuild the cache to resolve this.
</span>
</div>
<div class="action">
<Button
variant="naked"
onclick={onRebuild}
disabled={cacheState !== undefined}>
{#if cacheState?.event === "started" || cacheState?.event === "progress"}
Rebuilding
<Spinner />
{:else if cacheState?.event === "finished"}
Done
<Icon name="checkmark" />
{:else}
Rebuild cache
{/if}
</Button>
</div>
</div>
</div>
+8 -11
View File
@@ -4,11 +4,11 @@
import { twemoji } from "@app/lib/utils";
import Button from "@app/components/Button.svelte";
import CompactCommitAuthorship from "@app/components/CompactCommitAuthorship.svelte";
import Icon from "@app/components/Icon.svelte";
import Id from "@app/components/Id.svelte";
import InlineTitle from "@app/components/InlineTitle.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
interface Props {
children?: Snippet;
@@ -32,7 +32,7 @@
<style>
.teaser {
display: flex;
font-size: var(--font-size-small);
font: var(--txt-body-m-regular);
align-items: start;
padding: 0.125rem 0;
}
@@ -59,7 +59,7 @@
height: 1.3125rem;
}
.commit-message {
font-size: var(--font-size-tiny);
font: var(--txt-body-s-regular);
-webkit-touch-callout: initial;
-webkit-user-select: text;
user-select: text;
@@ -70,7 +70,7 @@
align-items: center;
}
.disabled {
color: var(--color-foreground-disabled) !important;
color: var(--color-text-disabled) !important;
}
pre {
white-space: pre-wrap;
@@ -88,15 +88,15 @@
</div>
{#if commit.message.trim() !== commit.summary.trim()}
<div class="commit-expand-button">
<NakedButton
<Button
variant="naked"
stylePadding="0 0.25rem"
variant="ghost"
onclick={e => {
e.stopPropagation();
commitMessageVisible = !commitMessageVisible;
}}>
<Icon name="ellipsis" />
</NakedButton>
</Button>
</div>
{/if}
</div>
@@ -109,10 +109,7 @@
<div class="right">
{@render children?.()}
<CompactCommitAuthorship {commit}>
<Id
id={commit.id}
clipboard={commit.id}
variant={disabled ? "none" : "commit"} />
<Id id={commit.id} clipboard={commit.id} />
</CompactCommitAuthorship>
</div>
</div>
+48
View File
@@ -0,0 +1,48 @@
<script lang="ts" module>
import { writable } from "svelte/store";
type CodeFont = "jetbrains" | "system";
export const codeFont = writable<CodeFont>(loadCodeFont());
function loadCodeFont(): CodeFont {
const stored = localStorage ? localStorage.getItem("codefont") : null;
return stored === "system" ? "system" : "jetbrains";
}
export function storeCodeFont(font: CodeFont): void {
codeFont.set(font);
if (localStorage) {
localStorage.setItem("codefont", font);
}
}
</script>
<script lang="ts">
import Button from "@app/components/Button.svelte";
</script>
<style>
.container {
display: flex;
align-items: center;
}
</style>
<div class="container">
<Button
variant="ghost"
flatRight
active={$codeFont === "jetbrains"}
onclick={() => storeCodeFont("jetbrains")}>
JetBrains Mono
</Button>
<Button
variant="ghost"
flatLeft
active={$codeFont === "system"}
onclick={() => storeCodeFont("system")}>
System
</Button>
</div>
+26 -16
View File
@@ -1,5 +1,4 @@
<script lang="ts">
import Border from "@app/components/Border.svelte";
import Clipboard from "@app/components/Clipboard.svelte";
interface Props {
@@ -15,27 +14,38 @@
<style>
.cmd {
color: var(--color-foreground-dim);
color: var(--color-text-secondary);
}
.cmd:hover {
color: var(--color-foreground-contrast);
color: var(--color-text-primary);
}
.hoverable:hover {
background-color: var(--color-surface-canvas);
}
</style>
<div class="cmd txt-monospace txt-small" style:width={styleWidth}>
<Border
hoverable
onclick={() => clipboard.copy()}
styleOverflow="hidden"
styleBackgroundColor="var(--color-background-float)"
styleCursor="pointer"
styleJustifyContent="space-between"
stylePadding="0.25rem 0.5rem"
{styleWidth}
variant="ghost">
<div class="cmd txt-code-regular" style:width={styleWidth}>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
class="hoverable"
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="0.5rem"
style:align-items="center"
style:background-color="var(--color-surface-canvas)"
style:overflow="hidden"
style:cursor="pointer"
style:justify-content="space-between"
style:height="2rem"
style:padding="0 0.5rem"
style:width={styleWidth}
role="button"
tabindex="0"
onclick={() => clipboard.copy()}>
<span class="txt-overflow">
{showPrompt ? "$ " : ""}{command}
</span>
<Clipboard bind:this={clipboard} text={command} />
</Border>
<Clipboard bind:this={clipboard} text={command} noPopover />
</div>
</div>
+11 -13
View File
@@ -94,11 +94,11 @@
padding: 0 0.75rem;
min-height: 1.5rem;
gap: 0.5rem;
font-size: var(--font-size-small);
font: var(--txt-body-m-regular);
}
.card-metadata {
color: var(--color-fill-gray);
font-size: var(--font-size-small);
color: var(--color-text-quaternary);
font: var(--txt-body-m-regular);
}
.header-right {
display: flex;
@@ -110,7 +110,7 @@
align-items: center;
min-height: 1.625rem;
word-wrap: break-word;
font-size: var(--font-size-small);
font: var(--txt-body-m-regular);
padding: 0 0.75rem;
}
.actions {
@@ -121,8 +121,8 @@
margin-left: 1rem;
}
.timestamp {
font-size: var(--font-size-small);
color: var(--color-fill-gray);
font: var(--txt-body-m-regular);
color: var(--color-text-quaternary);
}
.icon-button {
cursor: pointer;
@@ -135,7 +135,7 @@
<NodeId {...utils.authorForNodeId(author)} />
{caption}
{#if id}
<Id {id} clipboard={id} variant="oid" />
<Id {id} clipboard={id} />
{/if}
{#if beforeTimestamp}
{@render beforeTimestamp()}
@@ -158,7 +158,7 @@
<div class="header-right">
{#if editComment}
<div class="icon-button">
<Icon name="pen" onclick={toggleEdit} />
<Icon name="edit" onclick={toggleEdit} />
</div>
{/if}
{#if deleteComment}
@@ -168,8 +168,7 @@
{/if}
{#if reactions && reactOnComment}
<ReactionSelector
popoverPositionRight="0"
popoverPositionBottom="1.5rem"
placement="top-end"
{reactions}
select={async ({ authors, emoji }) => {
try {
@@ -186,7 +185,7 @@
{#if (body === undefined || body?.trim() === "") && state === "read"}
<div class="card-body">
<span class="txt-missing txt-small" style:line-height="1.625rem">
<span class="txt-missing txt-body-m-regular" style:line-height="1.625rem">
No description.
</span>
</div>
@@ -233,8 +232,7 @@
<div class="actions">
{#if id && reactions && reactOnComment}
<ReactionSelector
popoverPositionLeft="0"
popoverPositionBottom="1.5rem"
placement="top-start"
{reactions}
select={async ({ authors, emoji }) => {
try {
+22 -11
View File
@@ -1,7 +1,6 @@
<script lang="ts">
import type { Embed } from "@bindings/cob/thread/Embed";
import Border from "@app/components/Border.svelte";
import ExtendedTextarea from "@app/components/ExtendedTextarea.svelte";
interface Props {
@@ -39,9 +38,14 @@
<style>
.inactive {
padding: 0 0.75rem;
font-size: var(--font-size-small);
color: var(--color-fill-gray);
font-family: var(--font-family-sans-serif);
font: var(--txt-body-m-regular);
color: var(--color-text-quaternary);
}
.hoverable {
background-color: var(--color-surface-base);
}
.hoverable:hover {
background-color: var(--color-surface-canvas);
}
</style>
@@ -71,12 +75,19 @@
}
}} />
{:else}
<Border
hoverable
styleCursor="text"
variant="ghost"
styleHeight="2.5rem"
styleWidth="100%"
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
class="hoverable"
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="0.5rem"
style:align-items="center"
style:cursor="text"
style:height="2rem"
style:width="100%"
role="button"
tabindex="0"
onclick={e => {
e.preventDefault();
e.stopPropagation();
@@ -89,5 +100,5 @@
<div style:width="100%" class="inactive">
{placeholder}
</div>
</Border>
</div>
{/if}
+17 -25
View File
@@ -1,9 +1,8 @@
<script lang="ts">
import type { Snippet } from "svelte";
import Border from "@app/components/Border.svelte";
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
interface Props {
leftHeader: Snippet;
@@ -19,10 +18,9 @@
.header {
display: flex;
align-items: center;
height: 2rem;
height: 2.5rem;
padding-left: 0.25rem;
font-size: var(--font-size-small);
background-color: var(--color-background-default);
font: var(--txt-body-m-regular);
}
.left {
@@ -30,39 +28,33 @@
gap: 0.5rem;
align-items: center;
}
.divider {
width: calc(100% + 4px);
position: relative;
top: -6px;
left: -2px;
z-index: 1;
height: 2px;
background-color: var(--color-fill-ghost);
}
</style>
<Border
variant="ghost"
styleFlexDirection="column"
styleAlignItems="flex-start">
<div
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-md)"
style:display="flex"
style:align-items="flex-start"
style:background-color="var(--color-surface-canvas)"
style:flex-direction="column">
<div class="header" class:collapsed={!expanded}>
<div class="left">
<NakedButton
stylePadding="0 0.25rem"
variant="ghost"
<Button
variant="naked"
onclick={async () => {
expanded = !expanded;
}}>
<Icon name={expanded ? "chevron-down" : "chevron-right"} />
</NakedButton>
</Button>
{@render leftHeader()}
</div>
</div>
{#if expanded}
<div class="divider"></div>
<div style:width="100%">
<div
style:width="100%"
style:border-top="1px solid var(--color-border-subtle)">
{@render children()}
</div>
{/if}
</Border>
</div>
+4 -10
View File
@@ -17,7 +17,7 @@
<style>
.authorship {
display: flex;
font-size: var(--font-size-small);
font: var(--txt-body-m-regular);
column-gap: 0.5rem;
align-items: center;
white-space: nowrap;
@@ -28,25 +28,19 @@
flex-wrap: nowrap;
white-space: nowrap;
gap: 0.5rem;
font-family: var(--font-family-monospace);
font-weight: var(--font-weight-semibold);
font: var(--txt-code-regular);
}
.label {
font-family: var(--font-family-sans-serif);
font-weight: var(--font-weight-regular);
color: var(--color-foreground-dim);
color: var(--color-text-secondary);
}
.avatar {
width: 1rem;
height: 1rem;
clip-path: var(--1px-corner-fill);
}
</style>
<div class="authorship">
<HoverPopover
stylePopoverPositionLeft="-8rem"
stylePopoverPositionBottom="1.5rem">
<HoverPopover placement="top-start">
{#snippet toggle()}
<div style="display: flex;">
{#if commit.author.email === commit.committer.email}
+9 -11
View File
@@ -1,8 +1,6 @@
<script lang="ts">
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import OutlineButton from "@app/components/OutlineButton.svelte";
interface Props {
clear: () => void;
@@ -15,22 +13,22 @@
</script>
{#if closed}
<NakedButton
<Button
variant="naked"
stylePadding="0 0.25rem"
variant="ghost"
onclick={() => (closed = false)}>
<Icon name="broom-double" />
</NakedButton>
<Icon name="clear-all" />
</Button>
{:else}
<div class="global-flex txt-small">
<div class="global-flex txt-body-m-regular">
<div class="global-flex" style:justify-content="space-between">
<Button variant="ghost" onclick={clear}>
<Icon name="broom-double" />
<Icon name="clear-all" />
Clear all {count}
</Button>
<OutlineButton variant="ghost" onclick={() => (closed = true)}>
<Icon name="cross" />Cancel
</OutlineButton>
<Button variant="outline" onclick={() => (closed = true)}>
<Icon name="close" />Cancel
</Button>
</div>
</div>
{/if}
+11 -4
View File
@@ -7,7 +7,13 @@
inline = false,
children,
id,
}: { inline?: boolean; children?: Snippet; id: string } = $props();
styleFont = undefined,
}: {
inline?: boolean;
children?: Snippet;
id: string;
styleFont?: string;
} = $props();
let clipboard: Clipboard;
</script>
@@ -15,12 +21,12 @@
<style>
.copyable-id {
cursor: pointer;
color: var(--color-foreground-dim);
color: var(--color-text-secondary);
gap: 0.25rem;
}
.copyable-id:hover {
color: var(--color-foreground-contrast);
color: var(--color-text-primary);
}
.inline {
display: inline-flex;
@@ -35,7 +41,8 @@
tabindex="0"
onclick={() => clipboard.copy()}
class:inline
class="copyable-id global-flex txt-small txt-monospace">
class="copyable-id global-flex txt-code-regular"
style:font={styleFont}>
{#if children}
{@render children()}
{:else}
+17 -19
View File
@@ -229,8 +229,7 @@
/* Make space for the box-shadow border, otherwise it gets cut off due to
overflow: hide on the container. */
padding: 0.5rem 0.0625rem;
font-size: var(--font-size-small);
font-family: var(--font-family-monospace);
font: var(--txt-code-regular);
}
.line {
display: flex;
@@ -238,38 +237,38 @@
white-space: pre-wrap;
}
.hunk-header {
color: var(--color-foreground-dim);
color: var(--color-text-secondary);
}
.hunk-header > .left,
.hunk-header > .right {
cursor: default;
}
.addition {
background-color: var(--color-fill-diff-green);
background-color: var(--color-feedback-success-bg);
}
.deletion {
background-color: var(--color-fill-diff-red);
background-color: var(--color-feedback-error-bg);
}
.addition > .left,
.addition > .right,
.addition > .sign {
color: var(--color-foreground-success);
color: var(--color-feedback-success-text);
}
.deletion > .left,
.deletion > .right,
.deletion > .sign {
color: var(--color-foreground-red);
color: var(--color-feedback-error-text);
}
.context > .left,
.context > .right,
.context > .sign {
color: var(--color-foreground-disabled);
color: var(--color-text-disabled);
}
.marker {
color: var(--color-foreground-contrast) !important;
color: var(--color-text-primary) !important;
}
.selected {
box-shadow: 0 0 0 1px var(--color-fill-secondary);
box-shadow: 0 0 0 1px var(--color-border-brand);
z-index: 1;
}
.left,
@@ -286,7 +285,7 @@
.right:hover:not(.selection-disabled),
.left:active:not(.selection-disabled),
.right:active:not(.selection-disabled) {
color: var(--color-foreground-contrast);
color: var(--color-text-primary);
}
.sign {
min-width: 1.5rem;
@@ -305,22 +304,21 @@
align-self: flex-start;
}
.thread {
background-color: var(--color-background-default);
box-shadow: inset 0 0 0 2px var(--color-border-hint);
background-color: var(--color-surface-base);
font: var(--txt-body-m-regular);
padding: 0.5rem;
}
.comment-form {
background-color: var(--color-background-default);
box-shadow: inset 0 0 0 2px var(--color-border-default);
font-family: var(--font-family-sans-serif);
background-color: var(--color-surface-base);
display: flex;
flex-direction: column;
font: var(--txt-body-m-regular);
padding: 1rem;
}
.comment-header {
display: flex;
background-color: var(--color-fill-ghost);
clip-path: var(--1px-corner-fill);
background-color: var(--color-surface-subtle);
border-radius: var(--border-radius-sm);
padding: 0 0.5rem;
width: fit-content;
}
@@ -411,7 +409,7 @@
{#if thread.root.resolved}
<div title="Unresolve comment thread">
<Icon
name="unresolve"
name="close"
onclick={partial(
codeComments.changeCommentStatus,
thread.root.id,
+7 -6
View File
@@ -11,27 +11,28 @@
<style>
.diff-stat-badge {
display: flex;
clip-path: var(--1px-corner-fill);
border: 1px solid var(--color-border-subtle);
border-radius: var(--border-radius-sm);
height: 1.5rem;
overflow: hidden;
}
.insertions {
display: flex;
padding: 0 0.5rem;
align-items: center;
color: var(--color-foreground-success);
background-color: var(--color-fill-diff-green-light);
color: var(--color-feedback-success-text);
}
.deletions {
display: flex;
padding: 0 0.5rem;
align-items: center;
color: var(--color-foreground-red);
background-color: var(--color-fill-diff-red-light);
color: var(--color-feedback-error-text);
border-left: 1px solid var(--color-border-subtle);
}
</style>
<div class="diff-stat-badge txt-mono txt-semibold txt-small">
<div class="diff-stat-badge txt-code-regular">
<div class="insertions">+{stats.insertions}</div>
<div class="deletions">-{stats.deletions}</div>
</div>
+13 -14
View File
@@ -11,9 +11,9 @@
import * as roles from "@app/lib/roles";
import { scrollIntoView } from "@app/lib/utils";
import Button from "@app/components/Button.svelte";
import CommentToggleInput from "@app/components/CommentToggleInput.svelte";
import Icon from "@app/components/Icon.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import ThreadComponent from "@app/components/Thread.svelte";
interface Props {
@@ -84,29 +84,28 @@
<style>
.connector {
width: 2px;
width: 1px;
height: 1rem;
margin-left: 1.25rem;
background-color: var(--color-border-hint);
background-color: var(--color-border-subtle);
}
</style>
<div style:margin={hideDiscussion ? "1.5rem 0" : "1.5rem 0 2.5rem 0"}>
<div class="global-flex">
<div class="global-flex">
<NakedButton
variant="ghost"
stylePadding="0 4px"
<Button
variant="naked"
disabled={commentThreads.length === 0}
onclick={() => (hideDiscussion = !hideDiscussion)}>
<Icon name={hideDiscussion ? "chevron-right" : "chevron-down"} />
</NakedButton>
</Button>
<div
class="txt-semibold global-flex txt-regular"
class="txt-body-m-regular global-flex"
style:color={commentThreads.length === 0
? "var(--color-foreground-disabled)"
? "var(--color-text-disabled)"
: undefined}>
Discussion <span style:font-weight="var(--font-weight-regular)">
Discussion <span>
{sum(
commentThreads.map(t => {
return t.replies.length + 1;
@@ -116,8 +115,8 @@
</div>
</div>
<div style:margin-left="auto">
<NakedButton
variant="ghost"
<Button
variant="naked"
active={topLevelReplyOpen}
onclick={async () => {
if (hideDiscussion) {
@@ -130,8 +129,8 @@
await toggleReply();
}}>
<Icon name="comment" />
<span class="txt-small">Comment</span>
</NakedButton>
<span class="txt-body-m-regular">Comment</span>
</Button>
</div>
</div>
<div
+2 -2
View File
@@ -38,8 +38,8 @@
overflow-y: auto;
}
.dropdown-item {
padding: 2px;
font-size: var(--font-size-small);
padding: 1px;
font: var(--txt-body-m-regular);
}
</style>
+10 -12
View File
@@ -33,32 +33,30 @@
min-height: 2rem;
padding: 0 0.75rem;
white-space: nowrap;
font-size: var(--font-size-small);
font-weight: var(--font-weight-regular);
color: var(--color-foreground-contrast);
clip-path: var(--1px-corner-fill);
font: var(--txt-body-m-regular);
color: var(--color-text-primary);
border-radius: var(--border-radius-sm);
}
.item.disabled {
color: var(--color-foreground-disabled);
color: var(--color-text-disabled);
}
.item:hover,
.selected {
background-color: var(--color-fill-ghost);
background-color: var(--color-surface-subtle);
}
.selected {
font-weight: var(--font-weight-semibold);
color: var(--color-foreground-contrast);
background-color: var(--color-fill-ghost);
color: var(--color-text-primary);
background-color: var(--color-surface-subtle);
}
.item:hover.selected {
background-color: var(--color-fill-ghost-hover);
background-color: var(--color-surface-mid);
}
.item:hover.selected.disabled {
background-color: var(--color-fill-ghost);
background-color: var(--color-surface-subtle);
}
.item:hover.disabled {
cursor: not-allowed;
background-color: var(--color-background-float);
background-color: var(--color-surface-canvas);
}
</style>
+11 -14
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import InlineTitle from "@app/components/InlineTitle.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import TextInput from "@app/components/TextInput.svelte";
interface Props {
@@ -40,14 +40,13 @@
<style>
.title {
font-size: var(--font-size-medium);
font-weight: var(--font-weight-medium);
font: var(--txt-heading-m);
-webkit-user-select: text;
user-select: text;
display: flex;
align-items: center;
word-break: break-word;
min-height: 2.5rem;
min-height: 2rem;
width: 100%;
}
.edit-title-icon {
@@ -70,22 +69,20 @@
editingTitle = false;
}} />
<div class="global-flex" style:margin-left="0.5rem">
<NakedButton
variant="ghost"
styleHeight="2.5rem"
<Button
variant="naked"
disabled={!(newTitle.trim().length > 0)}
onclick={save}>
<Icon name="checkmark" />
</NakedButton>
<NakedButton
variant="ghost"
styleHeight="2.5rem"
</Button>
<Button
variant="naked"
onclick={() => {
newTitle = title;
editingTitle = false;
}}>
<Icon name="cross" />
</NakedButton>
<Icon name="close" />
</Button>
</div>
{:else}
<div class="global-flex" style:gap="0">
@@ -102,7 +99,7 @@
tabindex="0">
<InlineTitle content={title} fontSize="medium" />
{#if allowedToEdit}
<div class="edit-title-icon"><Icon name="pen" /></div>
<div class="edit-title-icon"><Icon name="edit" /></div>
{/if}
</div>
</div>
+29 -25
View File
@@ -1,7 +1,7 @@
<script lang="ts">
import type { Embed } from "@bindings/cob/thread/Embed";
import type { UnlistenFn } from "@tauri-apps/api/event";
import type { ComponentProps } from "svelte";
import type { ComponentProps, Snippet } from "svelte";
import { listen } from "@tauri-apps/api/event";
import { open } from "@tauri-apps/plugin-dialog";
@@ -14,7 +14,6 @@
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import Markdown from "@app/components/Markdown.svelte";
import OutlineButton from "@app/components/OutlineButton.svelte";
import Textarea from "@app/components/Textarea.svelte";
interface Props {
@@ -45,6 +44,8 @@
// visible but disabled and uses the string as the title to indicate the
// reason for disabling. Defaults to `false`
disableAttachments?: boolean | string;
hideDiscard?: boolean;
belowTextarea?: Snippet;
}
/* eslint-disable prefer-const */
@@ -69,6 +70,8 @@
submit,
close,
disableAttachments: attachDisabled = false,
hideDiscard = false,
belowTextarea,
}: Props = $props();
/* eslint-enable prefer-const */
@@ -255,7 +258,6 @@
gap: 1rem;
width: 100%;
flex: 1;
font-family: var(--font-family-sans-serif);
}
.inline {
border: 0;
@@ -276,9 +278,8 @@
.preview {
width: 100%;
font-size: var(--font-size-small);
font: var(--txt-body-m-regular);
min-height: 109px;
padding: 0.75rem;
margin-left: 1px;
margin-top: 1px;
flex: 1;
@@ -287,7 +288,7 @@
<div class="comment-section" aria-label="extended-textarea" class:inline>
{#if preview}
<div class="preview">
<div class="preview" style:min-height={styleMinHeight}>
{#if body.trim().length === 0}
<span class="txt-missing">Nothing to preview.</span>
{:else}
@@ -310,24 +311,27 @@
bind:value={body}
{placeholder} />
{/if}
{@render belowTextarea?.()}
<div class="actions">
<OutlineButton
disabled={submitInProgress}
variant="ghost"
onclick={() => {
preview = false;
close();
}}>
<Icon name="cross" />
<span class="global-hide-on-small-desktop-down">Discard</span>
</OutlineButton>
{#if !hideDiscard}
<Button
variant="outline"
disabled={submitInProgress}
onclick={() => {
preview = false;
close();
}}>
<Icon name="close" />
<span class="global-hide-on-small-desktop-down">Discard</span>
</Button>
{/if}
{#if !preview}
<div
style:display=""
class="txt-overflow txt-small txt-missing"
class="txt-overflow txt-body-m-regular txt-missing"
title={`${attachEnabled ? "Drag and drop files to add them. " : ""}Markdown is supported. Press ${utils.modifierKey()}↵ to submit.`}>
{#if embedUploadError}
<span style:color="var(--color-fill-danger)">
<span style:color="var(--color-feedback-error-text)">
<Icon
styleDisplay="inline"
styleVerticalAlign="text-top"
@@ -346,19 +350,19 @@
{/if}
<div class="buttons">
{#if attachEnabled || attachDisabledReason}
<OutlineButton
variant="ghost"
<Button
variant="outline"
onclick={selectFiles}
disabled={preview || attachDisabledReason !== undefined}
title={attachDisabledReason}>
<Icon name="attachment" />
<Icon name="attach" />
Attach
</OutlineButton>
</Button>
{/if}
<OutlineButton variant="ghost" onclick={() => (preview = !preview)}>
<Icon name={preview ? "pen" : "eye"} />
<Button variant="outline" onclick={() => (preview = !preview)}>
<Icon name={preview ? "edit" : "eye"} />
{preview ? "Edit" : "Preview"}
</OutlineButton>
</Button>
<Button
variant="ghost"
title={emptyBodyTooltip}
+11 -8
View File
@@ -3,12 +3,15 @@
import Icon from "@app/components/Icon.svelte";
const { href, children }: { href: string; children?: Snippet } = $props();
const {
href,
title,
children,
}: { href: string; title?: string; children?: Snippet } = $props();
</script>
<style>
a {
font-weight: var(--font-weight-semibold);
color: inherit;
display: inline-flex;
align-items: center;
@@ -18,25 +21,25 @@
a:hover {
text-decoration: underline;
text-underline-offset: 2px;
color: var(--color-fill-secondary);
color: var(--color-text-brand);
}
.icon {
color: var(--color-foreground-dim);
color: var(--color-text-secondary);
position: relative;
bottom: 1px;
}
a:hover .icon {
color: var(--color-fill-secondary-hover);
color: var(--color-text-brand);
}
</style>
<a {href} target="_blank" rel="noreferrer">
<a {href} {title} target="_blank" rel="noreferrer">
{#if children}
{@render children()}
<span class="icon"><Icon name="open-external" /></span>
{:else}
{href}
<Icon name="open-external" />
{/if}
<span class="icon"><Icon name="open-external" /></span>
</a>
@@ -3,8 +3,8 @@
import { tick } from "svelte";
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
interface Props {
children: Snippet;
@@ -13,6 +13,7 @@
leftHeader?: Snippet;
rightHeader?: Snippet;
sticky?: boolean;
border?: boolean;
}
/* eslint-disable prefer-const */
@@ -23,6 +24,7 @@
rightHeader,
sticky = true,
expandable = true,
border = true,
}: Props = $props();
/* eslint-enable prefer-const */
@@ -34,25 +36,13 @@
display: flex;
align-items: center;
height: 2.5rem;
padding-left: 0.5rem;
padding-left: 0.25rem;
z-index: 2;
font-size: var(--font-size-small);
background-color: var(--color-background-default);
font: var(--txt-body-m-regular);
position: relative;
}
.header::after {
position: absolute;
z-index: -1;
content: " ";
background-color: var(--color-fill-float-hover);
clip-path: var(--2px-top-corner-fill);
width: 100%;
height: 100%;
top: 0;
left: 0;
}
.header.collapsed {
clip-path: var(--2px-corner-fill);
background-color: var(--color-surface-canvas);
border-top-left-radius: var(--border-radius-md);
border-top-right-radius: var(--border-radius-md);
}
.sticky {
@@ -71,26 +61,25 @@
position: relative;
overflow-x: auto;
z-index: 1;
}
.container::after {
position: absolute;
z-index: -1;
content: " ";
clip-path: var(--2px-bottom-corner-fill);
background-color: var(--color-background-float);
width: 100%;
height: 100%;
top: 0;
left: 0;
border-top: none;
border-bottom-left-radius: var(--border-radius-md);
border-bottom-right-radius: var(--border-radius-md);
}
</style>
<div class="header" class:sticky class:collapsed={!expanded} bind:this={header}>
<div
class="header"
class:sticky
class:collapsed={!expanded}
bind:this={header}
style:border={border ? "1px solid var(--color-border-subtle)" : undefined}
style:border-bottom={border
? "undefined"
: "1px solid var(--color-border-subtle)"}>
<div class="left">
{#if expandable}
<NakedButton
stylePadding="0 4px"
variant="ghost"
<Button
variant="naked"
onclick={async () => {
expanded = !expanded;
if (!expanded && header) {
@@ -99,7 +88,7 @@
}
}}>
<Icon name={expanded ? "chevron-down" : "chevron-right"} />
</NakedButton>
</Button>
{/if}
{@render leftHeader?.()}
</div>
@@ -115,7 +104,10 @@
</div>
{#if expanded}
<div class="container">
<div
class="container"
style:border={border ? "1px solid var(--color-border-subtle)" : "undefined"}
style:border-top="none">
{@render children()}
</div>
{/if}
+17 -19
View File
@@ -3,7 +3,7 @@
import type { FileDiff } from "@bindings/diff/FileDiff";
import Diff from "@app/components/Diff.svelte";
import File from "@app/components/File.svelte";
import FileBlock from "@app/components/FileBlock.svelte";
import Icon from "@app/components/Icon.svelte";
import Path from "@app/components/Path.svelte";
@@ -58,32 +58,30 @@
<style>
.added {
color: var(--color-foreground-success);
background-color: var(--color-fill-diff-green-light);
color: var(--color-feedback-success-text);
background-color: var(--color-feedback-success-bg);
}
.deleted {
color: var(--color-foreground-red);
background-color: var(--color-fill-diff-red-light);
color: var(--color-feedback-error-text);
background-color: var(--color-feedback-error-bg);
}
.moved,
.copied {
color: var(--color-foreground-dim);
background: var(--color-fill-ghost);
color: var(--color-text-secondary);
background: var(--color-surface-subtle);
}
.stats {
font-size: var(--font-size-tiny);
font-family: var(--font-family-monospace);
font-weight: var(--font-weight-semibold);
font: var(--txt-code-regular);
}
</style>
{#snippet emptyPlaceholder()}
<div class="global-flex" style:margin="1rem 0" style:justify-content="center">
<Icon name="none" />Empty file
Empty file
</div>
{/snippet}
<File {expanded}>
<FileBlock {expanded}>
{#snippet leftHeader()}
{#if file.status === "moved" || file.status === "copied"}
<span style="display: flex; align-items: center; flex-wrap: wrap;">
@@ -96,23 +94,23 @@
{/if}
{#if file.status === "added"}
<span class="global-counter added">Added</span>
<span class="global-chip added">Added</span>
{:else if file.status === "deleted"}
<span class="global-counter deleted">Deleted</span>
<span class="global-chip deleted">Deleted</span>
{:else if file.status === "moved"}
<span class="global-counter moved">Moved</span>
<span class="global-chip moved">Moved</span>
{:else if file.status === "copied"}
<span class="global-counter copied">Copied</span>
<span class="global-chip copied">Copied</span>
{/if}
{/snippet}
{#snippet rightHeader()}
{#if file.diff.type === "plain" && file.diff.hunks.length > 0}
<div class="stats">
<span style:color="var(--color-foreground-success)">
<span style:color="var(--color-feedback-success-text)">
+{file.diff.stats.additions}
</span>
<span style:color="var(--color-foreground-red)">
<span style:color="var(--color-feedback-error-text)">
-{file.diff.stats.deletions}
</span>
</div>
@@ -149,4 +147,4 @@
{:else}
{@render emptyPlaceholder()}
{/if}
</File>
</FileBlock>
@@ -5,25 +5,32 @@
name,
fetchBlob,
active,
}: { name: string; fetchBlob: () => Promise<void>; active: boolean } =
$props();
indent = 0.5,
}: {
name: string;
fetchBlob: () => Promise<void>;
active: boolean;
indent?: number;
} = $props();
</script>
<style>
.file {
width: 100%;
cursor: pointer;
white-space: nowrap;
border-radius: var(--border-radius-sm);
}
.file:hover,
.active {
background-color: var(--color-background-float);
background-color: var(--color-surface-subtle);
}
.active:hover {
background-color: var(--color-fill-ghost-hover);
background-color: var(--color-surface-strong);
}
.file:hover .icon,
.active .icon {
color: var(--color-foreground-contrast);
color: var(--color-text-primary);
}
</style>
@@ -32,14 +39,14 @@
<div
class="file"
class:active
style:padding="0 0.5rem"
style:margin="0.15rem 0"
style:padding-left="{indent}rem"
style:padding-right="0.5rem"
onclick={fetchBlob}>
<div class="global-flex" style:padding="0.25rem 0">
<div class="icon txt-missing">
<Icon name="file" />
<Icon name="document" />
</div>
<div class="txt-small">
<div class="txt-body-m-regular txt-overflow">
{name}
</div>
</div>
+84
View File
@@ -0,0 +1,84 @@
<script lang="ts">
import type { Tree } from "@bindings/source/Tree";
import FileTreeFile from "@app/components/FileTreeFile.svelte";
import FileTreeFolder from "@app/components/FileTreeFolder.svelte";
import Icon from "@app/components/Icon.svelte";
interface Props {
fetchTree: (path: string) => Promise<Tree>;
fetchBlob: (path: string) => Promise<void>;
currentPath: string;
name: string;
prefix: string;
indent?: number;
}
const {
name,
fetchBlob,
currentPath,
prefix,
fetchTree,
indent = 0.5,
}: Props = $props();
let expanded = $derived(currentPath.indexOf(prefix) === 0);
const treePromise = $derived(
expanded ? fetchTree(prefix) : Promise.resolve(undefined),
);
</script>
<style>
.folder {
cursor: pointer;
width: 100%;
border-radius: var(--border-radius-sm);
}
.folder:hover {
background-color: var(--color-surface-subtle);
}
</style>
<!-- svelte-ignore a11y_no_static_element_interactions -->
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
class="folder"
style:padding-left="{indent}rem"
style:padding-right="0.5rem"
onclick={() => (expanded = !expanded)}>
<div class="global-flex txt-body-m-regular" style:padding="0.25rem 0">
<div class:txt-missing={!expanded}>
<Icon name={expanded ? "folder-open" : "folder"} />
</div>
{name}
</div>
</div>
{#if expanded}
{#await treePromise then tree}
{#if tree}
<div
style:display="flex"
style:flex-direction="column"
style:gap="0.25rem">
{#each tree.entries as entry (entry.path)}
{#if entry.kind === "tree"}
<FileTreeFolder
{fetchTree}
{fetchBlob}
name={entry.name}
{currentPath}
prefix={`${entry.path}/`}
indent={indent + 1.5} />
{:else if entry.kind === "blob"}
<FileTreeFile
name={entry.name}
fetchBlob={() => fetchBlob(entry.path)}
active={entry.path === currentPath}
indent={indent + 1.5} />
{/if}
{/each}
</div>
{/if}
{/await}
{/if}
+3 -3
View File
@@ -14,21 +14,21 @@
<div class="global-flex" style:gap="0">
<Button
flatRight
variant="ghost"
flatRight
onclick={() => {
decreaseFontSize();
}}>
<Icon name="minus" />
</Button>
<Button flatRight flatLeft active variant="ghost">
<Button variant="ghost" flatRight flatLeft active>
{fontSettings.size}
</Button>
<Button
flatLeft
variant="ghost"
flatLeft
onclick={() => {
increaseFontSize();
}}>
+15 -14
View File
@@ -2,7 +2,6 @@
import type { ErrorWrapper } from "@bindings/error/ErrorWrapper";
import type { Snippet } from "svelte";
import Border from "@app/components/Border.svelte";
import Command from "@app/components/Command.svelte";
import ExternalLink from "@app/components/ExternalLink.svelte";
import Icon from "@app/components/Icon.svelte";
@@ -24,13 +23,12 @@
}
.error-icon {
color: var(--color-fill-);
color: var(--color-text-secondary);
margin-bottom: 1rem;
}
.error-title {
font-size: var(--font-size-large);
font-weight: var(--font-weight-bold);
font: var(--txt-heading-l);
margin: 0 0 0.75rem 0;
}
@@ -40,15 +38,18 @@
}
</style>
<div class="error-container txt-small">
<Border
styleMaxWidth="45rem"
variant="float"
styleJustifyContent="center"
styleBackgroundColor="var(--color-background-float)"
styleDisplay="flex"
styleFlexDirection="column"
stylePadding="1.5rem">
<div class="error-container txt-body-m-regular">
<div
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="0.5rem"
style:align-items="center"
style:background-color="var(--color-surface-canvas)"
style:max-width="45rem"
style:justify-content="center"
style:flex-direction="column"
style:padding="1.5rem">
<div class="error-icon">
<Icon size="32" name="warning" />
</div>
@@ -72,5 +73,5 @@
{#if error?.message}
<Command styleWidth="30rem" showPrompt={false} command={error.message} />
{/if}
</Border>
</div>
</div>
@@ -0,0 +1,43 @@
<script lang="ts">
import { hide, modalStore } from "@app/lib/modal";
</script>
<style>
.container {
height: 100vh;
width: 100vw;
position: fixed;
z-index: 300;
justify-content: center;
overflow: scroll;
display: flex;
}
.overlay {
background-color: var(--color-surface-scrim);
height: 100%;
width: 100%;
position: fixed;
}
.content {
z-index: 200;
margin: auto;
}
</style>
{#if $modalStore}
<div class="container">
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
role="button"
tabindex="0"
class="overlay"
onclick={$modalStore.disableScrimClose ? undefined : hide}
style:cursor={$modalStore.disableHide ? "not-allowed" : "default"}>
</div>
<div class="content">
<svelte:component this={$modalStore.component} {...$modalStore.props} />
</div>
</div>
{/if}
+62
View File
@@ -0,0 +1,62 @@
<script lang="ts">
import type { ComponentProps } from "svelte";
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import TextInput from "@app/components/TextInput.svelte";
interface Props {
hasItems: boolean;
placeholder: string;
icon?: ComponentProps<typeof Icon>["name"];
show: boolean;
value: string;
onFocus?: () => void;
onSubmit?: () => void;
}
/* eslint-disable prefer-const */
let {
hasItems,
placeholder,
icon = "filter",
show = $bindable(),
value = $bindable(),
onFocus,
onSubmit,
}: Props = $props();
/* eslint-enable prefer-const */
</script>
{#if hasItems}
{#if show}
<TextInput
autofocus
{onFocus}
{onSubmit}
onBlur={() => {
if (value === "") {
show = false;
}
}}
onDismiss={() => {
value = "";
show = false;
}}
{placeholder}
keyShortcuts="ctrl+f"
bind:value>
{#snippet left()}
<div
style:color="var(--color-text-secondary)"
style:padding-left="0.5rem">
<Icon name={icon} />
</div>
{/snippet}
</TextInput>
{:else}
<Button variant="naked" keyShortcuts="ctrl+f" onclick={() => (show = true)}>
<Icon name="filter" />
</Button>
{/if}
{/if}
-165
View File
@@ -1,165 +0,0 @@
<script lang="ts" module>
export const guidePopoverToggleId = "guide-popover-toggle";
</script>
<script lang="ts">
import type { Config } from "@bindings/config/Config";
import { radicleInstalled } from "@app/lib/checkRadicleCLI.svelte";
import { nodeRunning } from "@app/lib/events";
import { activeRouteStore, push } from "@app/lib/router";
import { sleep } from "@app/lib/sleep";
import { didFromPublicKey, truncateDid } from "@app/lib/utils";
import { addRepoPopoverToggleId } from "@app/components/AddRepoButton.svelte";
import Border from "@app/components/Border.svelte";
import Command from "@app/components/Command.svelte";
import CopyableId from "@app/components/CopyableId.svelte";
import Icon from "@app/components/Icon.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import NodeId from "@app/components/NodeId.svelte";
import Popover from "@app/components/Popover.svelte";
import { settingsPopoverToggleId } from "@app/components/Settings.svelte";
interface Props {
config: Config;
}
const { config }: Props = $props();
let popoverExpanded: boolean = $state(false);
</script>
<style>
.spacer {
width: 100%;
border-bottom: 1px solid var(--color-border-default);
height: 1px;
margin: 1rem 0;
}
button {
text-decoration: underline;
border: 0;
color: var(--color-foreground-contrast);
margin: 0;
padding: 0;
background-color: transparent;
cursor: pointer;
}
</style>
<Popover
popoverPadding="0"
popoverPositionTop="2.5rem"
bind:expanded={popoverExpanded}
popoverPositionRight="-9.3rem">
{#snippet toggle(onclick)}
<NakedButton
id={guidePopoverToggleId}
variant="ghost"
{onclick}
stylePadding="0 0.25rem"
active={popoverExpanded}>
<Icon name="info" /> Guide
</NakedButton>
{/snippet}
{#snippet popover()}
<Border
variant="ghost"
styleGap="0"
stylePadding="1rem"
styleMinWidth="32rem"
styleBackgroundColor="var(--color-background-float)"
styleOverflow="auto"
styleMaxHeight="calc(100vh - 5rem)"
styleAlignItems="flex-start"
styleFlexDirection="column">
<div
style:position="relative"
style:display="flex"
style:line-height="1.625rem"
style:gap="0.5rem"
style:flex-direction="column"
style:width="100%">
<div class="txt-semibold txt-medium" style:margin-bottom="1rem">
Get started
</div>
<div class="txt-small" style:display="inline">
Hello <span style:padding-left="0.25rem">
<NodeId inline publicKey={config.publicKey} alias={config.alias} />,
</span>
your identity has been created and stored on your machine.
</div>
<div class="txt-small">
Your public key is <CopyableId
inline
id={didFromPublicKey(config.publicKey)}>
{truncateDid(config.publicKey)}
</CopyableId>
you can share this with anyone to find you on the network.
</div>
<div class="txt-small" style:margin-top="1rem">
We release a new version of the app every two weeks. To stay up to
date, go to
<button
class="txt-small"
onclick={async () => {
const settingsButton = document.getElementById(
settingsPopoverToggleId,
);
await sleep(1);
settingsButton?.click();
}}>
Settings
</button>
and enable 'Check for updates' to receive notifications about new releases.
</div>
<div class="spacer"></div>
{#if radicleInstalled() || $nodeRunning}
<div class="global-flex txt-small">
<div class="global-flex">
<Icon name="thumb-up" />Radicle CLI is installed, you're good to
go.
</div>
<button
class="txt-small"
onclick={async () => {
if ($activeRouteStore.resource !== "home") {
await push({
resource: "home",
activeTab: "all",
});
}
await sleep(1);
const addRepoButton = document.getElementById(
addRepoPopoverToggleId,
);
addRepoButton?.click();
}}>
Try adding a repo!
</button>
</div>
{:else}
<div class="txt-small">
<div class="global-flex" style:padding-bottom="1rem">
<Icon name="warning" />Radicle CLI is not installed
</div>
<div style:padding-bottom="1rem">
To interact with repositories on the Radicle network, you’ll need
to install Radicle node along with its accompanying CLI tools. The
node runs in the background, enabling seamless pushing and pulling
of changes, while the CLI tools let you manage the node and
provide interoperability between Git and Radicle.
</div>
<div style:padding-bottom="0.5rem">
To install Radicle node and CLI tooling, run this in your shell:
</div>
<Command
styleWidth="fit-content"
command="curl -sSf https://radicle.xyz/install | sh" />
</div>
{/if}
</div>
</Border>
{/snippet}
</Popover>
-120
View File
@@ -1,120 +0,0 @@
<script lang="ts">
import type { Config } from "@bindings/config/Config";
import type { Snippet } from "svelte";
import { onMount } from "svelte";
import { boolean } from "zod";
import { checkRadicleCLI } from "@app/lib/checkRadicleCLI.svelte";
import { dynamicInterval } from "@app/lib/interval";
import { sleep } from "@app/lib/sleep";
import useLocalStorage from "@app/lib/useLocalStorage.svelte";
import GuideButton, {
guidePopoverToggleId,
} from "@app/components/GuideButton.svelte";
import Icon from "@app/components/Icon.svelte";
import InboxButton from "@app/components/InboxButton.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import NodeStatusButton from "@app/components/NodeStatusButton.svelte";
const firstLaunchStorage = useLocalStorage(
"appFirstLaunch",
boolean(),
true,
!window.localStorage,
);
interface Props {
breadcrumbs?: Snippet;
config: Config;
notificationCount: number;
}
const { breadcrumbs, config, notificationCount }: Props = $props();
onMount(async () => {
try {
await checkRadicleCLI();
dynamicInterval("checkRadicleCLI", checkRadicleCLI, 30_000);
} catch {
dynamicInterval("checkRadicleCLI", checkRadicleCLI, 1_000);
}
if (firstLaunchStorage.value === true) {
const guidePopoverButton = document.getElementById(guidePopoverToggleId);
await sleep(1);
guidePopoverButton?.click();
firstLaunchStorage.value = false;
}
});
</script>
<style>
.header {
height: 3rem;
padding: 0.5rem 1rem;
display: flex;
align-items: flex-start;
}
.header:after {
content: " ";
position: absolute;
top: 0;
left: 0.5rem;
right: 0.5rem;
height: 3rem;
z-index: -1;
background-color: var(--color-background-float);
clip-path: var(--3px-bottom-corner-fill);
}
.wrapper {
display: flex;
flex-direction: column;
width: 100%;
row-gap: 8px;
z-index: 50;
}
.top-row {
display: flex;
width: 100%;
justify-content: space-between;
}
</style>
<div class="header global-flex">
<div class="wrapper">
<div class="top-row">
<div class="global-flex" style:gap="0.25rem">
<NakedButton
variant="ghost"
onclick={() => {
window.history.back();
}}
stylePadding="0 4px">
<Icon name="arrow-left" />
</NakedButton>
<NakedButton
variant="ghost"
onclick={() => {
window.history.forward();
}}
stylePadding="0 4px">
<Icon name="arrow-right" />
</NakedButton>
<div
class="global-flex txt-small txt-semibold"
style:gap="0.25rem"
style:margin-left="0.5rem">
{@render breadcrumbs?.()}
</div>
</div>
<div class="global-flex">
<GuideButton {config} />
<NodeStatusButton />
<InboxButton {notificationCount} />
</div>
</div>
</div>
</div>
-117
View File
@@ -1,117 +0,0 @@
<script lang="ts">
import type { HomeReposTab } from "@app/views/home/router";
import type { RepoCount } from "@bindings/repo/RepoCount";
import * as router from "@app/lib/router";
import Border from "@app/components/Border.svelte";
import Icon from "@app/components/Icon.svelte";
import Settings from "@app/components/Settings.svelte";
interface Props {
activeTab: HomeReposTab;
repoCount: RepoCount;
}
const { activeTab, repoCount }: Props = $props();
</script>
<style>
.container {
display: flex;
flex-direction: column;
height: 100%;
justify-content: space-between;
}
.tab {
align-items: center;
gap: 0.5rem;
background-color: var(--color-background-float);
display: flex;
font-size: var(--font-size-small);
justify-content: space-between;
padding: 0.5rem 0.25rem 0.5rem 0.5rem;
width: 100%;
}
.tab:not(.active) {
color: var(--color-foreground-dim);
}
.tab:not(.active):hover {
background-color: var(--color-fill-float-hover);
}
.active {
background-color: var(--color-background-default);
font-weight: var(--font-weight-semibold);
}
</style>
<div class="container">
<div>
<Border
styleCursor="pointer"
variant="ghost"
styleFlexDirection="column"
styleGap="2px"
styleBackgroundColor="var(--color-background-float)">
<a
tabindex="0"
class="tab txt-small"
class:active={activeTab === "all"}
href={router.routeToPath({
resource: "home",
activeTab: "all",
})}>
<div class="global-flex"><Icon name="repo" />Repositories</div>
<div class="global-counter">
{repoCount.total}
</div>
</a>
<a
class="tab"
class:active={activeTab === "delegate"}
href={router.routeToPath({
resource: "home",
activeTab: "delegate",
})}>
<div class="global-flex">
<Icon name="delegate" />
<div>Delegate</div>
</div>
<div class="global-counter">{repoCount.delegate}</div>
</a>
<a
class="tab"
class:active={activeTab === "contributor"}
href={router.routeToPath({
resource: "home",
activeTab: "contributor",
})}>
<div class="global-flex">
<Icon name="user" />
<div>Contributor</div>
</div>
<div class="global-counter">{repoCount.contributor}</div>
</a>
<a
class="tab"
class:active={activeTab === "private"}
href={router.routeToPath({
resource: "home",
activeTab: "private",
})}>
<div class="global-flex">
<Icon name="lock" />
<div>Private</div>
</div>
<div class="global-counter">{repoCount.private}</div>
</a>
</Border>
</div>
<Settings
compact={false}
popoverProps={{
popoverPositionBottom: "3rem",
popoverPositionLeft: "0",
}} />
</div>
+81 -30
View File
@@ -1,31 +1,63 @@
<script lang="ts">
import type { Placement } from "@floating-ui/dom";
import type { Snippet } from "svelte";
import {
autoUpdate,
computePosition,
flip,
offset as floatingOffset,
shift,
} from "@floating-ui/dom";
import debounce from "lodash/debounce";
import { portal } from "@app/lib/portal";
interface Props {
popover: Snippet;
stylePopoverPositionBottom?: string | undefined;
stylePopoverPositionLeft?: string | undefined;
stylePopoverPositionRight?: string | undefined;
stylePadding?: string | undefined;
placement?: Placement;
offset?: number;
stylePadding?: string;
toggle: Snippet;
}
const {
popover,
stylePopoverPositionBottom,
stylePopoverPositionLeft,
stylePopoverPositionRight,
placement = "top",
offset: offsetPx = 4,
stylePadding = "0.5rem 1rem",
toggle,
}: Props = $props();
let visible: boolean = $state(false);
let anchorEl: HTMLDivElement | undefined = $state();
let floatingEl: HTMLDivElement | undefined = $state();
const setVisible = debounce((value: boolean) => {
visible = value;
}, 50);
const show = debounce(() => {
visible = true;
}, 100);
const hide = debounce(() => {
visible = false;
}, 200);
$effect(() => {
if (floatingEl && anchorEl) {
const cleanup = autoUpdate(anchorEl, floatingEl, () => {
void computePosition(anchorEl!, floatingEl!, {
placement,
middleware: [floatingOffset(offsetPx), flip(), shift({ padding: 8 })],
}).then(({ x, y }) => {
if (floatingEl) {
floatingEl.style.left = `${x}px`;
floatingEl.style.top = `${y}px`;
floatingEl.style.visibility = "visible";
}
});
});
return cleanup;
}
});
</script>
<style>
@@ -34,37 +66,56 @@
display: inline-block;
}
.popover {
background: var(--color-fill-ghost);
background: var(--color-surface-subtle);
border: 1px solid var(--color-border-subtle);
box-shadow: var(--elevation-low);
position: absolute;
clip-path: var(--2px-corner-fill);
position: fixed;
top: 0;
left: 0;
visibility: hidden;
border-radius: var(--border-radius-md);
z-index: 10;
}
</style>
<div class="container">
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div
class="container"
bind:this={anchorEl}
onmouseenter={() => {
hide.cancel();
show();
}}
onmouseleave={() => {
show.cancel();
hide();
}}>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
role="button"
tabindex="0"
onclick={e => {
e.stopPropagation();
}}
onmouseenter={() => setVisible(true)}
onmouseleave={() => setVisible(false)}>
}}>
{@render toggle()}
{#if visible}
<div style:position="absolute">
<div
class="popover"
style:padding={stylePadding}
style:left={stylePopoverPositionLeft}
style:right={stylePopoverPositionRight}
style:bottom={stylePopoverPositionBottom}>
{@render popover()}
</div>
</div>
{/if}
</div>
{#if visible}
<!-- svelte-ignore a11y_no_static_element_interactions -->
<div
use:portal
bind:this={floatingEl}
class="popover"
style:padding={stylePadding}
onmouseenter={() => {
hide.cancel();
show();
}}
onmouseleave={() => {
show.cancel();
hide();
}}>
{@render popover()}
</div>
{/if}
</div>
+585 -1438
View File
File diff suppressed because it is too large Load Diff
+58 -23
View File
@@ -1,9 +1,18 @@
<script lang="ts">
import type { Placement } from "@floating-ui/dom";
import type { ComponentProps } from "svelte";
import {
autoUpdate,
computePosition,
flip,
offset,
shift,
} from "@floating-ui/dom";
import debounce from "lodash/debounce";
import { writeToClipboard } from "@app/lib/invoke";
import { portal } from "@app/lib/portal";
import { formatOid } from "@app/lib/utils";
import Icon from "@app/components/Icon.svelte";
@@ -25,54 +34,82 @@
}
let visible: boolean = $state(false);
let anchorEl: HTMLDivElement | undefined = $state();
let floatingEl: HTMLDivElement | undefined = $state();
interface Props {
ariaLabel?: string;
clipboard: string;
id: string;
placement?: Placement;
shorten?: boolean;
variant: "oid" | "commit" | "none";
}
const { ariaLabel, clipboard, id, shorten = true, variant }: Props = $props();
const {
ariaLabel,
clipboard,
id,
placement = "top-start",
shorten = true,
}: Props = $props();
const setVisible = debounce((value: boolean) => {
visible = value;
}, 50);
$effect(() => {
// Re-run when tooltip text changes so the wider "Copied to clipboard"
// text is repositioned and doesn't overflow the viewport edge.
void tooltip;
if (floatingEl && anchorEl) {
const cleanup = autoUpdate(anchorEl, floatingEl, () => {
void computePosition(anchorEl!, floatingEl!, {
placement,
middleware: [offset(6), flip(), shift({ padding: 8 })],
}).then(({ x, y }) => {
if (floatingEl) {
floatingEl.style.left = `${x}px`;
floatingEl.style.top = `${y}px`;
floatingEl.style.visibility = "visible";
}
});
});
return cleanup;
}
});
</script>
<style>
.container {
position: relative;
display: inline-block;
}
.popover {
position: absolute;
position: fixed;
top: 0;
left: 0;
visibility: hidden;
display: flex;
align-items: center;
flex-direction: row;
gap: 0.5rem;
justify-content: center;
z-index: 20;
background: var(--color-fill-counter);
color: var(--color-foreground-contrast);
background: var(--color-surface-subtle);
color: var(--color-text-primary);
border: 1px solid var(--color-border-subtle);
border-radius: var(--border-radius-md);
box-shadow: var(--elevation-low);
font-family: var(--font-family-sans-serif);
font-size: var(--font-size-small);
font-weight: var(--font-weight-regular);
font: var(--txt-body-m-regular);
white-space: nowrap;
padding: 0.125rem 0.5rem;
clip-path: var(--1px-corner-fill);
width: max-content;
padding: 0.25rem 0.5rem;
}
.target-commit:hover {
color: var(--color-foreground-contrast);
}
.target-oid:hover {
color: var(--color-foreground-emphasized-hover);
.txt-id:hover {
color: var(--color-text-primary);
}
</style>
<div class="container">
<div class="container" bind:this={anchorEl}>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
onmouseenter={() => {
@@ -81,7 +118,7 @@
onmouseleave={() => {
setVisible(false);
}}
class="target-{variant} global-{variant}"
class="txt-id"
style:cursor="pointer"
aria-label={ariaLabel}
onclick={async event => {
@@ -99,11 +136,9 @@
</div>
{#if visible}
<div style:position="absolute">
<div class="popover" style:bottom="1.5rem" style:left="1rem">
<Icon name={icon} />
{tooltip}
</div>
<div use:portal bind:this={floatingEl} class="popover">
<Icon name={icon} />
{tooltip}
</div>
{/if}
</div>
+73
View File
@@ -0,0 +1,73 @@
<script lang="ts">
import type { Config } from "@bindings/config/Config";
import debounce from "lodash/debounce";
import { writeToClipboard } from "@app/lib/invoke";
import { didFromPublicKey, explorerUrl, truncateDid } from "@app/lib/utils";
import Button from "@app/components/Button.svelte";
import DropdownListItem from "@app/components/DropdownListItem.svelte";
import Icon from "@app/components/Icon.svelte";
import { closeFocused } from "@app/components/Popover.svelte";
import Popover from "@app/components/Popover.svelte";
import UserAvatar from "@app/components/UserAvatar.svelte";
interface Props {
config: Config;
}
const { config }: Props = $props();
let popoverExpanded: boolean = $state(false);
let copyIcon: "copy" | "checkmark" = $state("copy");
const restoreCopyIcon = debounce(() => {
copyIcon = "copy";
}, 1000);
</script>
<Popover placement="bottom-start" bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<Button variant="naked" active={popoverExpanded} {onclick}>
<UserAvatar nodeId={config.publicKey} styleWidth="1rem" />
{config.alias}
<span style:color="var(--color-text-tertiary)">
<Icon name={popoverExpanded ? "chevron-up" : "chevron-down"} />
</span>
</Button>
{/snippet}
{#snippet popover()}
<div
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-md)"
style:background-color="var(--color-surface-canvas)"
style:padding="0.25rem">
<DropdownListItem
styleGap="0.5rem"
styleWidth="100%"
selected={false}
onclick={async () => {
await writeToClipboard(didFromPublicKey(config.publicKey));
copyIcon = "checkmark";
restoreCopyIcon();
closeFocused();
}}>
<Icon name="avatar-incognito" />
{truncateDid(config.publicKey)}
<span style:margin-left="auto"><Icon name={copyIcon} /></span>
</DropdownListItem>
<a
style:text-decoration="none"
style:width="100%"
onclick={closeFocused}
href={explorerUrl(`users/${didFromPublicKey(config.publicKey)}`)}
target="_blank">
<DropdownListItem styleGap="0.5rem" styleWidth="100%" selected={false}>
<Icon name="seed" />
view on seed.radicle.garden
<span style:margin-left="auto"><Icon name="open-external" /></span>
</DropdownListItem>
</a>
</div>
{/snippet}
</Popover>
-162
View File
@@ -1,162 +0,0 @@
<script lang="ts">
import type { NotificationsByRepo } from "@bindings/cob/inbox/NotificationsByRepo";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { useOverlayScrollbars } from "overlayscrollbars-svelte";
import { onMount } from "svelte";
import { dynamicInterval } from "@app/lib/interval";
import { invoke } from "@app/lib/invoke";
import Border from "@app/components/Border.svelte";
import Icon from "@app/components/Icon.svelte";
import Inbox from "@app/components/Inbox.svelte";
import OutlineButton from "@app/components/OutlineButton.svelte";
import Popover from "@app/components/Popover.svelte";
interface Props {
notificationCount: number;
}
let { notificationCount }: Props = $props();
let borderComponent: HTMLElement | undefined = $state();
let notificationPopoverExpaneded: boolean = $state(false);
let buttonActive: boolean = $state(false);
$effect(() => {
if (notificationPopoverExpaneded === false) {
buttonActive = false;
}
});
$effect(() => {
if (borderComponent) {
const [initialize] = useOverlayScrollbars({
options: () => ({
scrollbars: { theme: "global-os-theme-radicle", autoHide: "scroll" },
}),
defer: true,
});
initialize({ target: borderComponent });
}
});
onMount(async () => {
await loadCounter();
});
dynamicInterval("auth", loadCounter, 3_000);
async function loadCounter() {
notificationCount = await invoke<number>("notification_count");
if (window.__TAURI_INTERNALS__) {
await getCurrentWindow().setBadgeCount(
notificationCount === 0 ? undefined : notificationCount,
);
}
}
let notificationsByRepo: NotificationsByRepo[] = $state([]);
async function loadNotifications() {
notificationsByRepo = await invoke<NotificationsByRepo[]>(
"list_notifications",
{ params: { take: 100 } },
);
}
async function clearAll() {
try {
await invoke("clear_notifications", {
params: { type: "all" },
});
} catch (error) {
console.error("Clearing notifications failed", error);
} finally {
await loadCounter();
await loadNotifications();
}
}
async function clearByRepo(rid: string) {
try {
await invoke("clear_notifications", {
params: { type: "repo", content: rid },
});
} catch (error) {
console.error("Clearing notifications failed", error);
} finally {
await loadCounter();
await loadNotifications();
}
}
async function clearByIds(ids: string[]) {
try {
await invoke("clear_notifications", {
params: { type: "ids", content: ids },
});
} catch (error) {
console.error("Clearing notifications failed", error);
} finally {
await loadCounter();
await loadNotifications();
}
}
async function showAll(rid: string) {
const allNotificationsForRepo = await invoke<NotificationsByRepo[]>(
"list_notifications",
{ params: { repos: [rid] } },
);
notificationsByRepo = [
...notificationsByRepo.filter(r => r.rid !== rid),
...allNotificationsForRepo,
];
}
</script>
<Popover
popoverPositionRight="0"
popoverPositionTop="3rem"
bind:expanded={notificationPopoverExpaneded}>
{#snippet toggle(onclick)}
<OutlineButton
onclick={async () => {
buttonActive = true;
await loadNotifications();
onclick();
}}
variant={notificationCount && notificationCount > 0
? "secondary"
: "ghost"}
active={buttonActive}>
<Icon name="inbox" />
{#if notificationCount !== undefined && notificationCount > 0}
{notificationCount}
{/if}
</OutlineButton>
{/snippet}
{#snippet popover()}
<Border
bind:innerElement={borderComponent}
variant="ghost"
styleWidth="40rem"
stylePadding="1rem"
styleAlignItems="flex-start"
styleOverflow="auto"
styleMaxHeight="calc(100vh - 5rem)">
<Inbox
{clearAll}
{clearByIds}
{clearByRepo}
loadNew={loadNotifications}
{notificationCount}
{notificationsByRepo}
{showAll} />
</Border>
{/snippet}
</Popover>
@@ -1,9 +1,8 @@
<script lang="ts">
import type { NotificationsByRepo } from "@bindings/cob/inbox/NotificationsByRepo";
import Button from "@app/components/Button.svelte";
import ConfirmClear from "@app/components/ConfirmClear.svelte";
import Icon from "@app/components/Icon.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import NotificationsByRepoComponent from "@app/components/NotificationsByRepo.svelte";
interface Props {
@@ -111,18 +110,20 @@
<style>
.container {
width: 100%;
display: flex;
flex-direction: column;
min-height: 100%;
}
.header {
font-weight: var(--font-weight-medium);
font-size: var(--font-size-medium);
font: var(--txt-heading-m);
display: flex;
align-items: center;
min-height: 2rem;
}
.clear-inbox {
margin-left: auto;
margin-right: 1rem;
display: none;
color: var(--color-text-tertiary);
}
.header:hover .clear-inbox {
display: flex;
@@ -136,35 +137,26 @@
</style>
<div class="container">
<div class="header">
<div>
Inbox
{#if notificationCount !== undefined && notificationCount > 0}
{notificationCount}
{#if notificationCount !== undefined && notificationCount > 0}
<div class="header">
<div class="global-flex">
Inbox
<span class="global-counter-badge">{notificationCount}</span>
</div>
{#if notificationCount > loadedNotificationCount()}
<div
class="txt-missing txt-body-m-regular global-flex"
style:margin-left="1rem">
<Button variant="naked" onclick={loadNew}>
See {notificationCount - loadedNotificationCount()} new
</Button>
</div>
{/if}
</div>
{#if notificationCount === undefined || notificationCount === 0}
<div
class="txt-missing txt-small global-flex"
style:gap="0.25rem"
style:margin-left="auto">
<Icon name="thumb-up" />
Yay, inbox zero!
</div>
{/if}
{#if notificationCount !== undefined && notificationCount > loadedNotificationCount()}
<div class="txt-missing txt-small global-flex" style:margin-left="1rem">
<NakedButton variant="ghost" onclick={loadNew}>
See {notificationCount - loadedNotificationCount()} new
</NakedButton>
</div>
{/if}
{#if notificationCount && notificationCount > 0}
<div class="clear-inbox">
<ConfirmClear count={notificationCount} clear={clearAll} />
</div>
{/if}
</div>
</div>
{/if}
{#if notificationCount !== undefined && notificationCount > 0}
<div class="repo-list">
+7 -7
View File
@@ -18,19 +18,19 @@
<style>
.content :global(code) {
font-family: var(--font-family-monospace);
font-family: monospace;
padding: 0.125rem 0.25rem;
background-color: var(--color-fill-ghost);
background-color: var(--color-surface-subtle);
font-size: inherit;
}
</style>
<span
class="content"
class:txt-large={fontSize === "large"}
class:txt-medium={fontSize === "medium"}
class:txt-regular={fontSize === "regular"}
class:txt-small={fontSize === "small"}
class:txt-tiny={fontSize === "tiny"}>
class:txt-heading-l={fontSize === "large"}
class:txt-heading-m={fontSize === "medium"}
class:txt-body-l-regular={fontSize === "regular"}
class:txt-body-m-regular={fontSize === "small"}
class:txt-body-s-regular={fontSize === "tiny"}>
{@html dompurify.sanitize(formatInlineTitle(escape(content)))}
</span>
-185
View File
@@ -1,185 +0,0 @@
<script lang="ts">
import type { IssueStatus } from "@app/views/repo/router";
import type { Issue } from "@bindings/cob/issue/Issue";
import type { RepoInfo } from "@bindings/repo/RepoInfo";
import fuzzysort from "fuzzysort";
import * as router from "@app/lib/router";
import { modifierKey } from "@app/lib/utils";
import Border from "@app/components/Border.svelte";
import Icon from "@app/components/Icon.svelte";
import IssueStateFilterButton from "@app/components/IssueStateFilterButton.svelte";
import IssueTeaser from "@app/components/IssueTeaser.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import OutlineButton from "@app/components/OutlineButton.svelte";
import TextInput from "@app/components/TextInput.svelte";
const activeRouteStore = router.activeRouteStore;
interface Props {
changeFilter: (status: IssueStatus) => void;
issues: Issue[];
repo: RepoInfo;
selectedIssueId?: string;
status: IssueStatus;
}
const { changeFilter, issues, repo, selectedIssueId, status }: Props =
$props();
const project = $derived(repo.payloads["xyz.radicle.project"]!);
let showFilters: boolean = $state(false);
let searchInput = $state("");
const searchableIssues = $derived(
issues
.flatMap(i => {
return {
issue: i,
labels: i.labels.join(" "),
assignees: i.assignees
.map(a => {
return a.alias ?? "";
})
.join(" "),
author: i.author.alias ?? "",
};
})
.filter((item): item is NonNullable<typeof item> => item !== undefined),
);
const searchResults = $derived(
fuzzysort.go(searchInput, searchableIssues, {
keys: ["issue.title", "labels", "assignees", "author", "issue.id"],
threshold: 0.5,
all: true,
}),
);
</script>
<style>
.container {
display: flex;
align-items: center;
min-height: 2.5rem;
margin-bottom: 1rem;
min-width: 28rem;
}
.list {
display: flex;
flex-direction: column;
gap: 2px;
}
</style>
<div class="container">
<div class="global-flex">
<IssueStateFilterButton
{status}
counters={project.meta.issues}
{changeFilter} />
<NakedButton
styleHeight="2.5rem"
keyShortcuts="ctrl+f"
variant="ghost"
active={showFilters}
onclick={() => {
if (showFilters) {
showFilters = false;
searchInput = "";
} else {
showFilters = true;
}
}}>
<Icon name="filter" />
</NakedButton>
</div>
<div class="global-flex" style:margin-left="auto">
<OutlineButton
variant="ghost"
styleHeight="2.5rem"
active={$activeRouteStore.resource === "repo.createIssue"}
onclick={() => {
if ($activeRouteStore.resource === "repo.createIssue") {
window.history.back();
} else {
void router.push({
resource: "repo.createIssue",
rid: repo.rid,
status,
});
}
}}>
<Icon name="add" />New issue
</OutlineButton>
</div>
</div>
{#if showFilters}
<div class="global-flex" style:margin="1rem 0">
<TextInput
onSubmit={async () => {
if (searchResults.length === 1) {
await router.push({
resource: "repo.issue",
rid: repo.rid,
issue: searchResults[0].obj.issue.id,
status,
});
}
}}
onDismiss={() => {
showFilters = false;
searchInput = "";
}}
placeholder={`Fuzzy filter issues ${modifierKey()} + f`}
autofocus
keyShortcuts="ctrl+f"
bind:value={searchInput}>
{#snippet left()}
<div
style:color="var(--color-foreground-dim)"
style:padding-left="0.5rem">
<Icon name="filter" />
</div>
{/snippet}
</TextInput>
</div>
{/if}
{#if searchResults.length > 0}
<div class="list">
{#each searchResults as result}
<IssueTeaser
selected={result.obj.issue.id === selectedIssueId}
focussed={searchResults.length === 1 && searchInput !== ""}
compact
issue={result.obj.issue}
{status}
rid={repo.rid} />
{/each}
</div>
{/if}
{#if searchResults.length === 0}
<Border
variant="ghost"
styleFlexDirection="column"
styleOverflow="hidden"
styleAlignItems="center"
styleJustifyContent="center">
<div class="global-flex" style:height="84px" style:justify-content="center">
<div class="txt-missing txt-small global-flex" style:gap="0.25rem">
<Icon name="none" />
{#if issues.length > 0 && searchResults.length === 0}
No matching issues.
{:else}
No {status === "all" ? "" : status} issues.
{/if}
</div>
</div>
</Border>
{/if}
+41 -34
View File
@@ -6,7 +6,7 @@
import { issueStatusBackgroundColor, issueStatusColor } from "@app/lib/utils";
import Border from "@app/components/Border.svelte";
import Button from "@app/components/Button.svelte";
import DropdownList from "@app/components/DropdownList.svelte";
import DropdownListItem from "@app/components/DropdownListItem.svelte";
import Icon from "@app/components/Icon.svelte";
@@ -16,56 +16,57 @@
interface Props {
selectedState: State;
onSelect: (selectedStatus: State) => void;
disabled?: boolean;
}
const { selectedState, onSelect }: Props = $props();
const { selectedState, onSelect, disabled = false }: Props = $props();
let popoverExpanded: boolean = $state(false);
</script>
<style>
button {
cursor: pointer;
border: 0;
background: none;
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--font-size-small);
}
.badge {
gap: 0.375rem;
padding-right: 0.625rem;
}
</style>
<Popover
popoverPadding="0"
popoverPositionTop="2rem"
popoverPositionLeft="0"
placement="bottom-start"
bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<button {onclick}>
<Button
variant="outline"
{disabled}
{onclick}
active={popoverExpanded}
title={disabled
? "You must be a delegate to change the issue state"
: undefined}>
<span
class="global-counter badge"
style:color={issueStatusColor[selectedState.status]}
style:background-color={issueStatusBackgroundColor[
selectedState.status
]}>
class="global-chip"
style:padding="0"
style:margin-left="-0.25rem"
style:color={disabled
? undefined
: issueStatusColor[selectedState.status]}
style:background-color={disabled
? undefined
: issueStatusBackgroundColor[selectedState.status]}>
<Icon
name={selectedState.status === "open"
? "issue"
: `issue-${selectedState.status}`} />
</span>
<span style:color={disabled ? undefined : "var(--color-text-secondary)"}>
{capitalize(selectedState.status)}
{selectedState.status === "closed" ? `as ${selectedState.reason}` : ""}
<Icon name={popoverExpanded ? "chevron-up" : "chevron-down"} />
</span>
</button>
<Icon name={popoverExpanded ? "chevron-up" : "chevron-down"} />
</Button>
{/snippet}
{#snippet popover()}
<Border variant="ghost">
<div
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="0.5rem"
style:align-items="center"
style:background-color="var(--color-surface-canvas)">
<DropdownList
items={[
{ status: "open" },
@@ -75,23 +76,29 @@
{#snippet item(state)}
<DropdownListItem
selected={isEqual(selectedState, state)}
styleGap="0.5rem"
onclick={() => {
onSelect(state);
closeFocused();
}}>
<span
class="global-flex"
style:color={issueStatusColor[state.status]}>
class="global-chip"
style:padding="0"
style:margin-left="-0.5rem"
style:color={issueStatusColor[state.status]}
style:background-color={issueStatusBackgroundColor[state.status]}>
<Icon
name={state.status === "open"
? "issue"
: `issue-${state.status}`} />
</span>
<span style:color="var(--color-text-secondary)">
{capitalize(state.status)}
{state.status === "closed" ? `as ${state.reason}` : ""}
</span>
</DropdownListItem>
{/snippet}
</DropdownList>
</Border>
</div>
{/snippet}
</Popover>
@@ -1,83 +0,0 @@
<script lang="ts">
import type { IssueStatus } from "@app/views/repo/router";
import type { ProjectPayloadMeta } from "@bindings/repo/ProjectPayloadMeta";
import capitalize from "lodash/capitalize";
import { issueStatusColor } from "@app/lib/utils";
import Border from "@app/components/Border.svelte";
import DropdownList from "@app/components/DropdownList.svelte";
import DropdownListItem from "@app/components/DropdownListItem.svelte";
import Icon from "@app/components/Icon.svelte";
import OutlineButton from "@app/components/OutlineButton.svelte";
import { closeFocused } from "@app/components/Popover.svelte";
import Popover from "@app/components/Popover.svelte";
interface Props {
changeFilter: (status: IssueStatus) => void;
status: IssueStatus;
counters: ProjectPayloadMeta["issues"];
}
const { changeFilter, counters, status }: Props = $props();
let popoverExpanded: boolean = $state(false);
</script>
{#snippet iconSnippet(status: IssueStatus)}
<div
class="icon"
style:color={status === "all" ? undefined : issueStatusColor[status]}>
<Icon name={status === "closed" ? "issue-closed" : "issue"} />
</div>
{/snippet}
{#snippet counterSnippet(status: IssueStatus)}
<div style:margin-left="auto" style:padding-left="0.25rem">
{#if status === "all"}
{counters.open + counters.closed}
{:else}
{counters[status]}
{/if}
</div>
{/snippet}
<Popover
popoverPositionLeft="0"
popoverPositionTop="3rem"
bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<OutlineButton
variant="ghost"
{onclick}
styleHeight="2.5rem"
active={popoverExpanded}>
{@render iconSnippet(status)}
{capitalize(status)}
{@render counterSnippet(status)}
<Icon name={popoverExpanded ? "chevron-up" : "chevron-down"} />
</OutlineButton>
{/snippet}
{#snippet popover()}
<Border variant="ghost">
<DropdownList items={["all", "open", "closed"] as IssueStatus[]}>
{#snippet item(state)}
<DropdownListItem
styleGap="0.5rem"
styleMinHeight="2.5rem"
selected={status === state}
onclick={() => {
changeFilter(state);
closeFocused();
}}>
{@render iconSnippet(state)}
{capitalize(state)}
{@render counterSnippet(state)}
</DropdownListItem>
{/snippet}
</DropdownList>
</Border>
{/snippet}
</Popover>
+29 -34
View File
@@ -10,7 +10,6 @@
issueStatusColor,
} from "@app/lib/utils";
import Border from "@app/components/Border.svelte";
import Icon from "@app/components/Icon.svelte";
import Id from "@app/components/Id.svelte";
import InlineTitle from "@app/components/InlineTitle.svelte";
@@ -18,22 +17,13 @@
import NodeId from "@app/components/NodeId.svelte";
interface Props {
compact?: boolean;
focussed?: boolean;
issue: Issue;
rid: string;
selected?: boolean;
status: IssueStatus;
}
const {
compact = false,
focussed,
issue,
rid,
selected = false,
status,
}: Props = $props();
const { focussed, issue, rid, status }: Props = $props();
</script>
<style>
@@ -42,31 +32,28 @@
align-items: center;
gap: 0.25rem;
min-height: 5rem;
background-color: var(--color-background-float);
background-color: var(--color-surface-canvas);
padding: 1rem;
cursor: pointer;
font-size: var(--font-size-regular);
font: var(--txt-body-l-regular);
word-break: break-word;
width: 100%;
}
.selected {
background-color: var(--color-fill-float-hover);
}
.issue-teaser:hover {
background-color: var(--color-fill-float-hover);
background-color: var(--color-surface-subtle);
}
.status {
padding: 0;
margin-right: 1rem;
}
.issue-teaser:first-of-type {
clip-path: var(--2px-top-corner-fill);
border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}
.issue-teaser:last-of-type {
clip-path: var(--2px-bottom-corner-fill);
border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
}
.issue-teaser:only-of-type {
clip-path: var(--2px-corner-fill);
border-radius: var(--border-radius-sm);
}
</style>
@@ -76,7 +63,6 @@
tabindex="0"
role="button"
class="issue-teaser"
class:selected
style:align-items="flex-start"
style:clip-path={focussed ? "none" : undefined}
style:padding={focussed ? "1rem" : "20px"}
@@ -85,7 +71,7 @@
}}>
<div class="global-flex" style:align-items="flex-start">
<div
class="global-counter status"
class="global-chip status"
style:color={issueStatusColor[issue.state.status]}
style:background-color={issueStatusBackgroundColor[issue.state.status]}>
{#if issue.state.status === "open"}
@@ -99,24 +85,29 @@
style:flex-direction="column"
style:align-items="flex-start">
<InlineTitle content={issue.title} />
<div class="global-flex txt-small" style:flex-wrap="wrap">
<div class="global-flex txt-body-m-regular" style:flex-wrap="wrap">
<NodeId {...authorForNodeId(issue.author)} />
opened
<Id id={issue.id} clipboard={issue.id} variant="oid" />
<Id id={issue.id} clipboard={issue.id} />
{formatTimestamp(issue.timestamp)}
</div>
</div>
</div>
<div class="global-flex" style:margin-left="auto">
{#if !compact}
{#each issue.labels as label}
<Label {label} />
{/each}
{/if}
{#each issue.labels as label}
<Label {label} />
{/each}
{#if issue.commentCount > 0}
<div class="txt-small global-flex" style:gap="0.25rem">
<div
class="txt-body-m-regular global-flex"
style:gap="0.25rem"
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:height="1.5rem"
style:padding="0 0.5rem"
style:color="var(--color-text-tertiary)">
<Icon name="comment" />
{issue.commentCount}
</div>
@@ -126,11 +117,15 @@
{/snippet}
{#if focussed}
<Border
styleBackgroundColor="var(--color-background-float)"
variant="secondary">
<div
style:border="1px solid var(--color-border-brand)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="0.5rem"
style:align-items="center"
style:background-color="var(--color-surface-canvas)">
{@render issueSnippet()}
</Border>
</div>
{:else}
{@render issueSnippet()}
{/if}
+5 -5
View File
@@ -94,7 +94,7 @@
}
</style>
<div class="timeline txt-small">
<div class="timeline txt-body-m-regular">
{#each timeline as op}
{#if op.type === "lifecycle"}
<div class="timeline-item">
@@ -154,7 +154,7 @@
{:else if op.type === "assign"}
<div class="timeline-item">
<div class="icon">
<Icon name="user" />
<Icon name="avatar-incognito" />
</div>
<div class="wrapper">
<NodeId {...authorForNodeId(op.author)} />
@@ -192,7 +192,7 @@
{#if op.previous && op.previous.type === op.type}
<div class="timeline-item">
<div class="icon">
<Icon name="pen" />
<Icon name="edit" />
</div>
<div class="wrapper">
<NodeId {...authorForNodeId(op.author)} />
@@ -208,13 +208,13 @@
{:else if op.type === "comment"}
{#if op.id === activity[0].id}
<div class="timeline-item">
<div class="icon" style:color="var(--color-fill-success)">
<div class="icon" style:color="var(--color-feedback-success-text)">
<Icon name="issue" />
</div>
<div class="wrapper">
<NodeId {...authorForNodeId(op.author)} />
<div>
opened issue <Id id={op.id} clipboard={op.id} variant="oid" />
opened issue <Id id={op.id} clipboard={op.id} />
</div>
<div title={absoluteTimestamp(op.timestamp)}>
{formatTimestamp(op.timestamp)}
-161
View File
@@ -1,161 +0,0 @@
<script lang="ts">
import type { IssueStatus } from "@app/views/repo/router";
import type { RepoInfo } from "@bindings/repo/RepoInfo";
import Border from "@app/components/Border.svelte";
import Icon from "@app/components/Icon.svelte";
import Link from "@app/components/Link.svelte";
import RepoTeaser from "@app/components/RepoTeaser.svelte";
import Settings from "@app/components/Settings.svelte";
interface Props {
status: IssueStatus;
repo: RepoInfo;
}
const { status, repo }: Props = $props();
const project = $derived(repo.payloads["xyz.radicle.project"]!);
</script>
<style>
.container {
display: flex;
flex-direction: column;
height: 100%;
justify-content: space-between;
}
.tab {
align-items: center;
background-color: var(--color-background-float);
clip-path: var(--1px-corner-fill);
display: flex;
font-size: var(--font-size-small);
justify-content: space-between;
padding: 0.5rem 0.25rem 0.5rem 0.5rem;
width: 100%;
}
.tab:not(.active) {
color: var(--color-foreground-dim);
}
.tab:not(.active):hover {
background-color: var(--color-fill-float-hover);
}
.active {
background-color: var(--color-background-default);
font-weight: var(--font-weight-semibold);
}
.highlight {
color: var(--color-foreground-contrast);
}
.closed {
color: var(--color-foreground-red);
}
.open {
color: var(--color-foreground-success);
}
</style>
<div class="container">
<div>
<div style:margin-bottom="0.75rem">
<Link
styleWidth="100%"
underline={false}
route={{ resource: "repo.home", rid: repo.rid }}>
<div
class="tab"
style:color="var(--color-foreground-contrast)"
style:padding-right="0.5rem"
style:padding-left="0.75rem">
<RepoTeaser name={project.data.name} seeding={repo.seeding} />
</div>
</Link>
</div>
<Border
variant="ghost"
styleFlexDirection="column"
styleGap="2px"
styleBackgroundColor="var(--color-background-float)">
<Link
styleWidth="100%"
underline={false}
route={{ resource: "repo.issues", rid: repo.rid, status: "all" }}>
<div class="tab active">
<div class="global-flex"><Icon name="issue" />Issues</div>
<div class="global-counter">
{project.meta.issues.open + project.meta.issues.closed}
</div>
</div>
</Link>
<Link
styleWidth="100%"
underline={false}
route={{
resource: "repo.issues",
rid: repo.rid,
status: "open",
}}>
<div class="tab" class:active={status === "open"}>
<div
class="global-flex"
class:open={["open", "all"].includes(status)}>
<Icon name="issue" />Open
</div>
<div class="global-counter" class:highlight={status === "all"}>
{project.meta.issues.open}
</div>
</div>
</Link>
<Link
styleWidth="100%"
underline={false}
route={{
resource: "repo.issues",
rid: repo.rid,
status: "closed",
}}>
<div class="tab" class:active={status === "closed"}>
<div
class="global-flex"
class:closed={["closed", "all"].includes(status)}>
<Icon name="issue-closed" />Closed
</div>
<div class="global-counter" class:highlight={status === "all"}>
{project.meta.issues.closed}
</div>
</div>
</Link>
</Border>
<div style:margin-top="0.5rem">
<Link
styleWidth="100%"
underline={false}
route={{ resource: "repo.patches", rid: repo.rid, status: "open" }}>
<div
class="tab"
style:color="var(--color-foreground-contrast)"
style:padding-left="0.75rem">
<div class="global-flex"><Icon name="patch" />Patches</div>
<div class="global-counter">
{project.meta.patches.draft +
project.meta.patches.open +
project.meta.patches.archived +
project.meta.patches.merged}
</div>
</div>
</Link>
</div>
</div>
<Settings
compact={false}
popoverProps={{
popoverPositionBottom: "3rem",
popoverPositionLeft: "0",
}} />
</div>
+23 -26
View File
@@ -27,10 +27,7 @@
{#await invoke<Job[]>("list_jobs", { rid, sha: commit }) then jobs}
{#if jobs.length > 0}
<HoverPopover
stylePadding="0.25rem"
stylePopoverPositionBottom="2rem"
stylePopoverPositionRight="-1.5rem">
<HoverPopover stylePadding="0.25rem" placement="bottom-end">
{#snippet toggle()}
{#if jobs.every(j => {
return j.runs.every(r => {
@@ -38,11 +35,11 @@
});
})}
<div
class="global-counter"
class="global-chip"
style:padding="0"
style:color="var(--color-fill-success)"
style:background-color="var(--color-fill-diff-green)">
<Icon name="checkmark-double" />
style:color="var(--color-feedback-success-text)"
style:background-color="var(--color-feedback-success-bg)">
<Icon name="checkmark" />
</div>
{:else if jobs.every(j => {
return j.runs.every(r => {
@@ -50,18 +47,18 @@
});
})}
<div
class="global-counter"
style:color="var(--color-foreground-red)"
class="global-chip"
style:color="var(--color-feedback-error-text)"
style:padding="0"
style:background-color="var(--color-fill-diff-red)">
<Icon name="cross-double" />
style:background-color="var(--color-feedback-error-bg)">
<Icon name="close" />
</div>
{:else}
<div
class="global-counter"
class="global-chip"
style:padding="0"
style:color="var(--color-fill-gray)"
style:background-color="var(--color-fill-ghost)">
style:color="var(--color-text-quaternary)"
style:background-color="var(--color-surface-subtle)">
<Icon name="help" />
</div>
{/if}
@@ -79,30 +76,30 @@
<DropdownListItem styleGap="0.5rem" selected={true}>
{#if run.status === "started"}
<div
class="global-counter status"
style:background-color="var(--color-fill-float)"
style:color="var(--color-fill-gray)">
class="global-chip status"
style:background-color="var(--color-surface-canvas)"
style:color="var(--color-text-quaternary)">
<Icon name="hourglass" /> Started
</div>
{:else if run.status === "failed"}
<div
class="global-counter status"
style:color="var(--color-foreground-red)"
style:background-color="var(--color-fill-diff-red)">
<Icon name="cross" /> Failed
class="global-chip status"
style:color="var(--color-feedback-error-text)"
style:background-color="var(--color-feedback-error-bg)">
<Icon name="close" /> Failed
</div>
{:else if run.status === "succeeded"}
<div
class="global-counter status"
style:color="var(--color-fill-success)"
style:background-color="var(--color-fill-diff-green)">
class="global-chip status"
style:color="var(--color-feedback-success-text)"
style:background-color="var(--color-feedback-success-bg)">
<Icon name="checkmark" /> Passed
</div>
{/if}
<NodeId {...authorForNodeId(run.node)} />
<div
style:margin-left="auto"
style:color="var(--color-fill-gray)">
style:color="var(--color-text-quaternary)">
<Icon name="open-external" />
</div>
</DropdownListItem>
+15 -1
View File
@@ -6,6 +6,20 @@
const { label }: Props = $props();
</script>
<div class="global-counter txt-small" style:max-width="10rem">
<style>
.label {
display: flex;
align-items: center;
justify-content: center;
border: 1px solid var(--color-border-subtle);
border-radius: var(--border-radius-sm);
height: 1.5rem;
padding: 0 0.5rem;
color: var(--color-text-tertiary);
max-width: 10rem;
}
</style>
<div class="label txt-body-m-regular">
<div class="txt-overflow" title={label}>{label}</div>
</div>
+87 -93
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import Label from "@app/components/Label.svelte";
import TextInput from "@app/components/TextInput.svelte";
@@ -8,6 +9,7 @@
labels: string[];
submitInProgress: boolean;
save: (updatedLabels: string[]) => void;
preview?: boolean;
}
const {
@@ -15,6 +17,7 @@
labels,
submitInProgress = false,
save,
preview = false,
}: Props = $props();
let updatedLabels: string[] = $state([]);
@@ -73,33 +76,34 @@
</script>
<style>
.add-icon {
display: none;
}
.title-button:hover .add-icon {
display: flex;
}
.title-button {
font-size: var(--font-size-small);
color: var(--color-foreground-dim);
}
.body {
.row {
display: flex;
align-items: center;
flex-wrap: wrap;
flex-direction: row;
gap: 0.5rem;
font-size: var(--font-size-small);
margin-top: 1rem;
}
.validation-message {
display: flex;
align-items: center;
gap: 0.25rem;
color: var(--color-foreground-red);
color: var(--color-feedback-error-text);
position: relative;
margin-top: 0.5rem;
}
.removable-label {
display: flex;
align-items: center;
gap: 0.25rem;
background: none;
border: none;
padding: 0;
cursor: pointer;
}
.input-row {
display: flex;
align-items: center;
gap: 0.5rem;
}
button {
border: 0;
cursor: pointer;
@@ -107,97 +111,87 @@
background-color: transparent;
border: none;
display: flex;
color: var(--color-foreground-default);
color: var(--color-text-secondary);
padding: 0;
align-items: center;
}
</style>
<div class="global-flex">
<button
disabled={!allowedToEdit}
style:color={allowedToEdit
? "var(--color-foreground-dim)"
: "var(--color-foreground-disabled)"}
title={allowedToEdit
? undefined
: "Only delegates are allowed to add labels"}
style:cursor={allowedToEdit ? "pointer" : "default"}
class="title-button"
onclick={() => {
inputValue = "";
showInput = !showInput;
}}>
{#if updatedLabels.length === 0}
Add labels
{:else}
Labels
{/if}
{#if !showInput && allowedToEdit}
<span class="add-icon">
<Icon name="add"></Icon>
</span>
{/if}
</button>
{#if allowedToEdit}
<div class="global-flex edit-icons">
{#if showInput}
<Icon
onclick={addLabel}
name="checkmark"
disabled={!valid || inputValue === ""} />
<Icon
onclick={() => {
inputValue = "";
showInput = false;
}}
name="cross" />
{#if preview}
<div class="row">
<Button variant="outline" disabled>
<Icon name="label" />
{#if updatedLabels.length === 0}
Add labels
{:else}
Labels
{/if}
</div>
{/if}
</div>
{#if showInput}
<div style:margin-top="1rem">
<TextInput
autofocus
{valid}
disabled={submitInProgress}
placeholder="Add label"
bind:value={inputValue}
onSubmit={addLabel} />
{#if !valid && validationMessage}
<div class="validation-message">
<Icon name="warning" />{validationMessage}
</div>
{/if}
</Button>
{#each updatedLabels as label}
<Label {label} />
{/each}
</div>
{/if}
{:else}
<div class="row">
{#if showInput}
<div class="input-row">
<div style:flex="1" style:min-width="0">
<TextInput
autofocus
{valid}
disabled={submitInProgress}
placeholder="Add label"
bind:value={inputValue}
onSubmit={addLabel} />
</div>
<Button
variant="outline"
onclick={() => {
showInput = false;
inputValue = "";
}}>
<Icon name="close" />
</Button>
</div>
{:else}
<Button
variant="outline"
disabled={!allowedToEdit}
title={allowedToEdit
? undefined
: "Only delegates are allowed to add labels"}
onclick={() => {
inputValue = "";
showInput = true;
}}>
<Icon name="label" />
{#if updatedLabels.length === 0}
Add labels
{:else}
Labels
{/if}
</Button>
{/if}
{#if updatedLabels.length > 0}
<div class="body">
{#if allowedToEdit}
{#each updatedLabels as label}
{#each updatedLabels as label}
{#if allowedToEdit}
<button
class="global-counter txt-small"
style:background-color="var(--color-fill-counter)"
style:padding="0 0.5rem"
style:max-width="10rem"
class="removable-label"
onclick={() => (removeToggles[label] = !removeToggles[label])}>
<div class="txt-overflow" title={label}>{label}</div>
<Label {label} />
{#if removeToggles[label]}
<span style:margin-right="0.5rem">
<Icon name="cross" onclick={() => removeLabel(label)} />
</span>
<Icon name="close" onclick={() => removeLabel(label)} />
{/if}
</button>
{/each}
{:else}
{#each updatedLabels as label}
{:else}
<Label {label} />
{/each}
{/if}
{/if}
{/each}
</div>
{#if !valid && validationMessage}
<div class="validation-message">
<Icon name="warning" />{validationMessage}
</div>
{/if}
{/if}
-54
View File
@@ -1,54 +0,0 @@
<script lang="ts">
import type { Snippet } from "svelte";
import { push, routeToPath } from "@app/lib/router";
import type { Route } from "@app/lib/router/definitions";
interface Props {
children: Snippet;
route: Route;
disabled?: boolean;
underline?: boolean;
styleWidth?: string;
styleColor?: string;
}
const {
children,
route,
disabled = false,
underline = true,
styleWidth,
styleColor,
}: Props = $props();
function navigateToRoute(event: MouseEvent): void {
event.preventDefault();
if (disabled) {
return;
}
void push(route);
}
</script>
<style>
a {
color: var(--color-foreground-contrast);
text-decoration: none;
}
.underline:hover {
text-decoration: underline;
text-decoration-thickness: 1px;
text-underline-offset: 2px;
}
</style>
<a
onclick={navigateToRoute}
href={routeToPath(route)}
class:underline
style:color={styleColor}
style:width={styleWidth}>
{@render children()}
</a>
+30 -38
View File
@@ -186,9 +186,8 @@
user-select: text;
}
.front-matter {
font-size: var(--font-size-tiny);
font-family: var(--font-family-monospace);
border: 1px dashed var(--color-border-default);
font: var(--txt-body-s-regular);
border: 1px dashed var(--color-border-mid);
padding: 0.5rem;
margin-bottom: 2rem;
}
@@ -203,19 +202,17 @@
}
.markdown :global(h1) {
font-size: calc(var(--font-size-x-large) * 0.75);
font-weight: var(--font-weight-semibold);
font: var(--txt-heading-l);
padding: 1rem 0 0.5rem 0;
margin: 0 0 0.75rem;
border-bottom: 1px solid var(--color-border-hint);
border-bottom: 1px solid var(--color-border-subtle);
}
.markdown :global(h2) {
font-size: var(--font-size-medium);
font-weight: var(--font-weight-regular);
font: var(--txt-heading-m);
padding: 0.25rem 0;
margin: 2rem 0 0.5rem;
border-bottom: 1px solid var(--color-border-hint);
border-bottom: 1px solid var(--color-border-subtle);
}
.markdown :global(.pre-wrapper) {
@@ -231,7 +228,7 @@
}
.markdown :global(radicle-clipboard) {
background-color: var(--color-fill-ghost);
background-color: var(--color-surface-subtle);
}
.markdown :global(.pre-wrapper:hover > radicle-clipboard) {
@@ -239,29 +236,26 @@
}
.markdown :global(h3) {
font-size: calc(var(--font-size-medium) * 0.9);
font-weight: var(--font-weight-semibold);
font: var(--txt-heading-m);
padding: 0.5rem 0;
margin: 1rem 0 0.25rem;
}
.markdown :global(h4) {
font-weight: var(--font-weight-semibold);
font-size: var(--font-size-regular);
font: var(--txt-body-l-semibold);
padding: 0.5rem 0;
margin: 1rem 0 0.125rem;
}
.markdown :global(h5),
.markdown :global(h6) {
font-weight: var(--font-weight-semibold);
font-size: var(--font-size-small);
font: var(--txt-body-m-semibold);
padding: 0.35rem 0;
margin: 1rem 0 0.125rem;
}
.markdown :global(h6) {
color: var(--color-foreground-dim);
color: var(--color-text-secondary);
}
.markdown :global(p) {
@@ -279,21 +273,21 @@
align-items: center;
gap: 0.5rem;
margin-left: -1.2rem;
color: var(--color-foreground-dim);
color: var(--color-text-secondary);
}
.markdown :global(li.task-item:not(:last-child)) {
margin-bottom: 0.25rem;
}
.markdown :global(blockquote) {
color: var(--color-foreground-dim);
border-left: 0.3rem solid var(--color-fill-ghost);
color: var(--color-text-secondary);
border-left: 0.3rem solid var(--color-surface-subtle);
padding: 0 0 0 1rem;
margin: 1rem 0 1rem 0;
}
.markdown :global(strong) {
font-weight: var(--font-weight-semibold);
font-weight: 600;
}
.markdown :global(.footnote-ref) {
@@ -304,11 +298,11 @@
.markdown :global(.footnote-ref),
.markdown :global(.footnote > .marker),
.markdown :global(.footnote > .ref-arrow) {
color: var(--color-foreground-dim);
color: var(--color-text-secondary);
}
.markdown :global(.footnote-ref:hover),
.markdown :global(.footnote .ref-arrow:hover) {
color: var(--color-background-default);
color: var(--color-surface-base);
}
.markdown :global(.footnote) {
margin-bottom: 0;
@@ -320,9 +314,8 @@
}
.markdown :global(code) {
font-family: var(--font-family-monospace);
font-size: var(--font-size-small);
background-color: var(--color-fill-ghost);
font: var(--txt-code-regular);
background-color: var(--color-surface-subtle);
padding: 0.125rem 0.25rem;
}
@@ -336,13 +329,12 @@
}
.markdown :global(pre) {
font-family: var(--font-family-monospace);
font-size: var(--font-size-regular);
background-color: var(--color-fill-ghost);
font: var(--txt-code-regular);
background-color: var(--color-surface-subtle);
padding: 1rem !important;
overflow: scroll;
scrollbar-width: none;
clip-path: var(--2px-corner-fill);
border-radius: var(--border-radius-sm);
}
.markdown :global(pre::-webkit-scrollbar) {
@@ -351,19 +343,19 @@
.markdown :global(a),
.markdown :global(a > code) {
color: var(--color-foreground-contrast);
color: var(--color-text-primary);
background: none;
padding: 0;
}
.markdown :global(a) {
text-decoration: underline;
text-decoration-color: var(--color-foreground-dim);
text-decoration-color: var(--color-text-secondary);
}
.markdown :global(a.no-underline) {
text-decoration: none;
}
.markdown :global(a:hover) {
text-decoration-color: var(--color-foreground-contrast);
text-decoration-color: var(--color-text-primary);
}
.markdown :global(hr) {
@@ -372,7 +364,7 @@
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid var(--color-border-hint);
border-bottom: 1px solid var(--color-border-subtle);
}
.markdown :global(ol) {
@@ -405,17 +397,17 @@
margin: 1.5rem 0;
border-collapse: collapse;
border-style: hidden;
box-shadow: 0 0 0 1px var(--color-border-hint);
box-shadow: 0 0 0 1px var(--color-border-subtle);
overflow: hidden;
}
.markdown :global(td) {
text-align: left;
text-overflow: ellipsis;
border: 1px solid var(--color-border-hint);
border: 1px solid var(--color-border-subtle);
padding: 0.5rem 1rem;
}
.markdown :global(tr:nth-child(even)) {
background-color: var(--color-background-default);
background-color: var(--color-surface-base);
}
.markdown :global(th) {
text-align: center;
@@ -443,7 +435,7 @@
<tbody>
{#each frontMatter as [key, val]}
<tr>
<td><span class="txt-bold">{key}</span></td>
<td><span class="txt-body-l-semibold">{key}</span></td>
<td>{val}</td>
</tr>
{/each}
@@ -1,42 +0,0 @@
<script lang="ts">
import type { Snippet } from "svelte";
import Border from "@app/components/Border.svelte";
import Icon from "@app/components/Icon.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import Popover from "@app/components/Popover.svelte";
interface Props {
children: Snippet;
}
const { children }: Props = $props();
let popoverExpanded: boolean = $state(false);
</script>
<Popover
popoverPositionLeft="0"
popoverPositionTop="2.5rem"
bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<NakedButton
variant="ghost"
stylePadding="0 4px"
{onclick}
active={popoverExpanded}>
<Icon name="more-vertical" />
</NakedButton>
{/snippet}
{#snippet popover()}
<Border variant="ghost">
<div
class="global-flex txt-monospace"
style:flex-direction="column"
style:align-items="flex-start">
{@render children()}
</div>
</Border>
{/snippet}
</Popover>
-287
View File
@@ -1,287 +0,0 @@
<script lang="ts">
import type { Snippet } from "svelte";
interface Props {
id?: string;
children: Snippet;
title?: string;
disabled?: boolean;
variant: "primary" | "secondary" | "ghost";
onclick?: (e: MouseEvent) => void;
styleHeight?: "2rem" | "2.5rem";
stylePadding?: string;
active?: boolean;
keyShortcuts?: string;
}
const {
id,
children,
title,
disabled,
variant,
onclick,
styleHeight = "2rem",
stylePadding = "0 0.5rem",
active = false,
keyShortcuts,
}: Props = $props();
const style = $derived(
`--button-color-1: var(--color-fill-${variant});` +
`--button-color-2: var(--color-fill-${variant}-hover);` +
`--button-color-3: var(--color-fill-${variant}-shade);` +
// The ghost colors are called --color-fill-counter and --color-fill-counter-emphasized.
`--button-color-4: var(--color-fill${variant === "ghost" ? "" : `-${variant}`}-counter)`,
);
</script>
<style>
.pixel {
background-color: transparent;
}
.p1-1 {
grid-area: p1-1;
}
.p1-2 {
grid-area: p1-2;
}
.p1-3 {
grid-area: p1-3;
}
.p1-4 {
grid-area: p1-4;
}
.p1-5 {
grid-area: p1-5;
}
.p2-1 {
grid-area: p2-1;
}
.p2-2 {
grid-area: p2-2;
}
.p2-3 {
grid-area: p2-3;
}
.p2-4 {
grid-area: p2-4;
}
.p2-5 {
grid-area: p2-5;
}
.p3-1 {
grid-area: p3-1;
}
.p3-2 {
grid-area: p3-2;
}
.p3-3 {
grid-area: p3-3;
display: flex;
align-items: center;
gap: 0.5rem;
}
.p3-4 {
grid-area: p3-4;
}
.p3-5 {
grid-area: p3-5;
}
.p4-1 {
grid-area: p4-1;
}
.p4-2 {
grid-area: p4-2;
}
.p4-3 {
grid-area: p4-3;
}
.p4-4 {
grid-area: p4-4;
}
.p4-5 {
grid-area: p4-5;
}
.p5-1 {
grid-area: p5-1;
}
.p5-2 {
grid-area: p5-2;
}
.p5-3 {
grid-area: p5-3;
}
.p5-4 {
grid-area: p5-4;
}
.p5-5 {
grid-area: p5-5;
}
.container:hover:not(.disabled) .p1-3 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p2-2 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p2-4 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p3-1 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p3-5 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p4-2 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p4-4 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p5-3 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p1-3,
.container.active:not(.disabled) .p1-3 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p2-2,
.container.active:not(.disabled) .p2-2 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p2-3,
.container.active:not(.disabled) .p2-3 {
background-color: var(--button-color-3);
}
.container:active:not(.disabled) .p2-4,
.container.active:not(.disabled) .p2-4 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p3-1,
.container.active:not(.disabled) .p3-1 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p3-2,
.container.active:not(.disabled) .p3-2 {
background-color: var(--button-color-3);
}
.container:active:not(.disabled) .p3-3,
.container.active:not(.disabled) .p3-3 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p3-4,
.container.active:not(.disabled) .p3-4 {
background-color: var(--button-color-2);
}
.container:active:not(.disabled) .p3-5,
.container.active:not(.disabled) .p3-5 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p4-2,
.container.active:not(.disabled) .p4-2 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p4-3,
.container.active:not(.disabled) .p4-3 {
background-color: var(--button-color-2);
}
.container:active:not(.disabled) .p4-4,
.container.active:not(.disabled) .p4-4 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p5-3,
.container.active:not(.disabled) .p5-3 {
background-color: var(--button-color-1);
}
.container.active:not(.disabled) {
color: var(--color-foreground-emphasized);
}
.container.disabled {
color: var(--color-foreground-disabled);
cursor: inherit;
}
.container {
cursor: pointer;
white-space: nowrap;
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
column-gap: 0;
row-gap: 0;
display: grid;
grid-template-columns: 2px 2px auto 2px 2px;
grid-template-rows: 2px 2px auto 2px 2px;
grid-template-areas:
"p1-1 p1-2 p1-3 p1-4 p1-5"
"p2-1 p2-2 p2-3 p2-4 p2-5"
"p3-1 p3-2 p3-3 p3-4 p3-5"
"p4-1 p4-2 p4-3 p4-4 p4-5"
"p5-1 p5-2 p5-3 p5-4 p5-5";
}
</style>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
{id}
class="container"
class:disabled
class:active
onclick={!disabled ? onclick : undefined}
{title}
aria-keyshortcuts={keyShortcuts}
role="button"
tabindex="0"
{style}
style:height={styleHeight}>
<div class="pixel p1-1"></div>
<div class="pixel p1-2"></div>
<div class="pixel p1-3"></div>
<div class="pixel p1-4"></div>
<div class="pixel p1-5"></div>
<div class="pixel p2-1"></div>
<div class="pixel p2-2"></div>
<div class="pixel p2-3"></div>
<div class="pixel p2-4"></div>
<div class="pixel p2-5"></div>
<div class="pixel p3-1"></div>
<div class="pixel p3-2"></div>
<div class="pixel p3-3 txt-semibold txt-small" style:padding={stylePadding}>
{@render children()}
</div>
<div class="pixel p3-4"></div>
<div class="pixel p3-5"></div>
<div class="pixel p4-1"></div>
<div class="pixel p4-2"></div>
<div class="pixel p4-3"></div>
<div class="pixel p4-4"></div>
<div class="pixel p4-5"></div>
<div class="pixel p5-1"></div>
<div class="pixel p5-2"></div>
<div class="pixel p5-3"></div>
<div class="pixel p5-4"></div>
<div class="pixel p5-5"></div>
</div>
+29 -29
View File
@@ -1,57 +1,57 @@
<script lang="ts">
import Border from "@app/components/Border.svelte";
import Button from "@app/components/Button.svelte";
import Command from "@app/components/Command.svelte";
import Icon from "@app/components/Icon.svelte";
import OutlineButton from "@app/components/OutlineButton.svelte";
import Popover from "@app/components/Popover.svelte";
interface Props {
outline?: boolean;
ghost?: boolean;
rid: string;
}
const { outline = false, rid }: Props = $props();
const { outline = false, ghost = false, rid }: Props = $props();
let popoverExpanded: boolean = $state(false);
</script>
<Popover
popoverPositionRight="0"
popoverPositionTop="3rem"
bind:expanded={popoverExpanded}>
<Popover placement="bottom-end" bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
{#if outline}
<OutlineButton
styleHeight="2.5rem"
variant="ghost"
<Button
variant="outline"
styleHeight="2rem"
{onclick}
active={popoverExpanded}>
<Icon name="add" />New patch
</OutlineButton>
<Icon name="plus" />
<span class="global-hide-on-small-desktop-down">New patch</span>
</Button>
{:else}
<Button
styleHeight="2.5rem"
variant="secondary"
styleHeight="2rem"
variant={ghost ? "ghost" : "secondary"}
{onclick}
active={popoverExpanded}>
<Icon name="add" />New patch
<Icon name="plus" />
<span class="global-hide-on-small-desktop-down">New patch</span>
</Button>
{/if}
{/snippet}
{#snippet popover()}
<div class="txt-small">
<Border
styleAlignItems="flex-start"
styleBackgroundColor="var(--color-background-float)"
styleFlexDirection="column"
styleGap="2rem"
stylePadding="1rem"
styleWidth="28rem"
variant="ghost">
<div class="txt-body-m-regular">
<div
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="2rem"
style:align-items="flex-start"
style:background-color="var(--color-surface-canvas)"
style:flex-direction="column"
style:padding="1rem"
style:width="30rem">
<div>
<div class="txt-semibold" style:margin-bottom="0.5rem">
<div class="txt-body-l-semibold" style:margin-bottom="0.5rem">
Create a new patch
</div>
<div
@@ -63,12 +63,12 @@
run:
<Command
command="git push rad HEAD:refs/patches"
styleWidth="100%" />
styleWidth="fit-content" />
</div>
</div>
<div style:margin-bottom="1rem">
<div class="txt-semibold" style:margin-bottom="0.5rem">
<div class="txt-body-l-semibold" style:margin-bottom="0.5rem">
Don't have a working copy yet?
</div>
<div
@@ -77,10 +77,10 @@
style:align-items="flex-start"
style:gap="0.5rem">
To checkout a working copy of this repo, run:
<Command command={`rad checkout ${rid}`} styleWidth="100%" />
<Command command={`rad checkout ${rid}`} styleWidth="fit-content" />
</div>
</div>
</Border>
</div>
</div>
{/snippet}
</Popover>
-30
View File
@@ -1,30 +0,0 @@
<script lang="ts">
import type { Config } from "@bindings/config/Config";
import * as router from "@app/lib/router";
import { didFromPublicKey, explorerUrl } from "@app/lib/utils";
import Link from "@app/components/Link.svelte";
import NodeId from "@app/components/NodeId.svelte";
import BreadcrumbCopyButton from "@app/views/repo/BreadcrumbCopyButton.svelte";
const activeRouteStore = router.activeRouteStore;
interface Props {
config: Config;
}
const { config }: Props = $props();
</script>
{#if $activeRouteStore.resource === "home"}
<NodeId publicKey={config.publicKey} alias={config.alias} />
<BreadcrumbCopyButton
icon="user"
id={didFromPublicKey(config.publicKey)}
url={explorerUrl(`users/${didFromPublicKey(config.publicKey)}`)} />
{:else}
<Link route={{ resource: "home", activeTab: "all" }}>
<NodeId publicKey={config.publicKey} alias={config.alias} />
</Link>
{/if}
+21 -12
View File
@@ -1,22 +1,20 @@
<script lang="ts">
import { truncateId } from "@app/lib/utils";
import Avatar from "@app/components/Avatar.svelte";
import UserAvatar from "@app/components/UserAvatar.svelte";
interface Props {
publicKey: string;
alias?: string;
inline?: boolean;
styleFontSize?: string;
styleFontWeight?: string;
styleFont?: string;
}
const {
publicKey,
alias,
inline = false,
styleFontSize = "var(--font-size-small)",
styleFontWeight = "var(--font-weight-semibold)",
styleFont = undefined,
}: Props = $props();
</script>
@@ -25,9 +23,22 @@
display: flex;
align-items: center;
gap: 0.375rem;
font: var(--txt-body-m-regular);
}
.avatar-container {
width: 1rem;
height: 1rem;
overflow: hidden;
flex-shrink: 0;
}
.avatar-container :global(img) {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.no-alias {
color: var(--color-foreground-dim);
color: var(--color-text-secondary);
}
.inline {
display: inline-flex;
@@ -39,12 +50,10 @@
}
</style>
<div
class="avatar-alias"
class:inline
style:font-size={styleFontSize}
style:font-weight={styleFontWeight}>
<Avatar {publicKey} />
<div class="avatar-alias" class:inline style:font={styleFont}>
<div class="avatar-container">
<UserAvatar nodeId={publicKey} styleWidth="1rem" />
</div>
{#if alias}
<span class="txt-overflow alias">
{alias}
+28 -17
View File
@@ -1,10 +1,9 @@
<script lang="ts">
import { nodeRunning } from "@app/lib/events";
import Border from "@app/components/Border.svelte";
import Button from "@app/components/Button.svelte";
import Command from "@app/components/Command.svelte";
import Icon from "@app/components/Icon.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import Popover from "@app/components/Popover.svelte";
let popoverExpanded: boolean = $state(false);
@@ -12,28 +11,40 @@
<Popover
popoverPadding="0"
popoverPositionTop="2.5rem"
bind:expanded={popoverExpanded}
popoverPositionRight="0">
placement="top-start"
bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<NakedButton variant="ghost" {onclick} active={popoverExpanded}>
<Button
variant="naked"
{onclick}
active={popoverExpanded}
styleWidth="100%"
styleJustifyContent="flex-start">
{#if $nodeRunning}
<Icon name="online" />
<span style:color="var(--color-text-tertiary)">
<Icon name="online" />
</span>
Online
{:else}
<Icon name="offline" />
<span style:color="var(--color-text-tertiary)">
<Icon name="offline" />
</span>
Offline
{/if}
</NakedButton>
</Button>
{/snippet}
{#snippet popover()}
<Border
variant="ghost"
stylePadding="1rem"
styleMinWidth="20rem"
styleAlignItems="flex-start"
styleFlexDirection="column">
<div class="txt-small" style:line-height="1.625rem">
<div
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="0.5rem"
style:align-items="flex-start"
style:background-color="var(--color-surface-canvas)"
style:padding="1rem"
style:width="22rem"
style:flex-direction="column">
<div class="txt-body-m-regular" style:line-height="1.625rem">
{#if $nodeRunning}
Your node is up and running, your changes will be synced
automatically.
@@ -49,6 +60,6 @@
</div>
{/if}
</div>
</Border>
</div>
{/snippet}
</Popover>
+61 -60
View File
@@ -19,9 +19,9 @@
patchStatusColor,
} from "@app/lib/utils";
import Button from "@app/components/Button.svelte";
import Icon from "@app/components/Icon.svelte";
import InlineTitle from "@app/components/InlineTitle.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import NodeId from "@app/components/NodeId.svelte";
import { closeFocused } from "@app/components/Popover.svelte";
@@ -62,10 +62,6 @@
);
});
const clearIcon = $derived(
uniqueActions.length > 1 ? "broom-double" : "broom",
);
const title = $derived.by(() => {
const lastDetail = notificationItems.at(-1);
if (lastDetail && "title" in lastDetail) {
@@ -103,8 +99,8 @@
};
} else {
return {
color: "var(--color-foreground-dim)",
background: "var(--color-fill-ghost)",
color: "var(--color-text-secondary)",
background: "var(--color-surface-subtle)",
};
}
});
@@ -134,41 +130,46 @@
<style>
.notification-teaser {
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.25rem;
min-height: 5rem;
background-color: var(--color-background-float);
background-color: var(--color-surface-subtle);
padding: 1rem;
cursor: pointer;
font-size: var(--font-size-regular);
font: var(--txt-body-l-regular);
word-break: break-word;
}
.clear-icon {
display: none;
position: absolute;
top: 0.5rem;
right: 0.5rem;
visibility: hidden;
color: var(--color-text-tertiary);
}
.notification-teaser:hover .clear-icon {
display: flex;
visibility: visible;
}
.selected {
background-color: var(--color-fill-float-hover);
background-color: var(--color-surface-mid);
}
.notification-teaser:hover {
background-color: var(--color-fill-float-hover);
background-color: var(--color-surface-mid);
}
.status {
padding: 0;
margin-right: 1rem;
}
.notification-teaser:first-of-type {
clip-path: var(--3px-top-corner-fill);
border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}
.notification-teaser:last-of-type {
clip-path: var(--3px-bottom-corner-fill);
border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
}
.notification-teaser:only-of-type {
clip-path: var(--3px-corner-fill);
border-radius: var(--border-radius-sm);
}
</style>
@@ -184,51 +185,51 @@
closeFocused();
}
}}>
<div
class="global-flex"
style:justify-content="space-between"
style:align-items="flex-start"
style:width="100%">
<div class="global-flex">
<div
class="global-counter status"
style:align-self="flex-start"
style:color={statusColor.color}
style:background-color={statusColor.background}>
<Icon name={icon} />
</div>
<div
class="global-flex"
style:flex-direction="column"
style:align-items="flex-start">
{#if title}
<InlineTitle content={title} />
{/if}
<div class="txt-small">
{#each uniqueActions as action}
<div
class="global-flex"
style:gap="0.25rem"
style:min-height="2rem"
style:flex-wrap="wrap">
<NodeId {...authorForNodeId(action.items[0].author)} />
<span>{@html action.summary}</span>
<span>{formatTimestamp(action.items[0].timestamp)}</span>
</div>
{/each}
</div>
</div>
<div class="global-flex" style:width="100%">
<div
class="global-chip status"
style:align-self="flex-start"
style:color={statusColor.color}
style:background-color={statusColor.background}>
<Icon name={icon} />
</div>
<div class="clear-icon">
<NakedButton
stylePadding="0 0.25rem"
variant="ghost"
onclick={e => {
e.stopPropagation();
void clearByIds(notificationItems.map(n => n.rowId));
}}>
<Icon name={clearIcon} />
</NakedButton>
<div
class="global-flex"
style:flex-direction="column"
style:align-items="flex-start"
style:width="100%">
{#if title}
<InlineTitle content={title} />
{/if}
<div class="txt-body-m-regular" style:width="100%">
{#each uniqueActions as action}
<div
class="global-flex"
style:gap="0.25rem"
style:min-height="2rem"
style:flex-wrap="wrap"
style:width="100%">
<NodeId {...authorForNodeId(action.items[0].author)} />
<span>{@html action.summary}</span>
<span
style:margin-left="auto"
style:color="var(--color-text-tertiary)">
{formatTimestamp(action.items[0].timestamp)}
</span>
</div>
{/each}
</div>
</div>
</div>
<div class="clear-icon">
<Button
variant="naked"
stylePadding="0 0.25rem"
onclick={e => {
e.stopPropagation();
void clearByIds(notificationItems.map(n => n.rowId));
}}>
<Icon name="trash" />
</Button>
</div>
</div>
+16 -14
View File
@@ -4,7 +4,6 @@
import Button from "@app/components/Button.svelte";
import ConfirmClear from "@app/components/ConfirmClear.svelte";
import Icon from "@app/components/Icon.svelte";
import NakedButton from "@app/components/NakedButton.svelte";
import NotificationTeaser from "@app/components/NotificationTeaser.svelte";
interface Props {
@@ -40,7 +39,6 @@
.header {
display: flex;
align-items: center;
padding-right: 1rem;
width: 100%;
min-height: 2rem;
gap: 0.75rem;
@@ -48,14 +46,16 @@
.container {
display: flex;
flex-direction: column;
gap: 2px;
gap: 1px;
}
.action-buttons {
display: flex;
gap: 0.25rem;
color: var(--color-text-tertiary);
}
.clear-repo {
margin-left: auto;
color: var(--color-text-tertiary);
}
.action-buttons,
.clear-repo {
@@ -72,32 +72,32 @@
class="header"
class:txt-missing={hidden}
style:margin-bottom={!hidden ? "1rem" : undefined}>
<span class="txt-bold">
<span class="txt-body-l-semibold">
{name}
</span>
{count}
<span class="global-counter-badge">{count}</span>
<div
class="action-buttons"
style:display={pinned || hidden ? "flex" : undefined}>
{#if !hidden}
<NakedButton
variant="ghost"
<Button
variant="naked"
stylePadding="0 0.25rem"
onclick={() => {
togglePin(rid);
}}>
<Icon name={pinned ? "pin" : "pin-hollow"} />
</NakedButton>
<Icon name={pinned ? "pin-filled" : "pin-hollow"} />
</Button>
{/if}
{#if !pinned}
<NakedButton
variant="ghost"
<Button
variant="naked"
stylePadding="0 0.25rem"
onclick={() => {
toggleHide(rid);
}}>
<Icon name={hidden ? "eye-closed" : "eye"} />
</NakedButton>
<Icon name={hidden ? "eye-slash" : "eye"} />
</Button>
{/if}
</div>
{#if count > 0 && !hidden}
@@ -128,7 +128,9 @@
style:height="100%"
style:align-items="center"
style:justify-content="center">
<div class="txt-missing txt-small global-flex" style:gap="0.25rem">
<div
class="txt-missing txt-body-m-regular global-flex"
style:gap="0.25rem">
<Icon name="none" />
No notifications.
</div>
-331
View File
@@ -1,331 +0,0 @@
<script lang="ts">
import type { Snippet } from "svelte";
interface Props {
id?: string;
popoverToggle?: string;
active?: boolean;
children: Snippet;
disabled?: boolean;
onclick?: () => void;
styleHeight?: "2rem" | "2.5rem";
title?: string;
variant: "primary" | "secondary" | "ghost";
}
const {
id,
popoverToggle,
active = false,
children,
disabled = false,
onclick,
styleHeight = "2rem",
title,
variant,
}: Props = $props();
const style = $derived(
`--button-color-1: var(--color-fill-${variant});` +
`--button-color-2: var(--color-fill-${variant}-hover);` +
`--button-color-3: var(--color-fill-${variant}-shade);` +
// The ghost colors are called --color-fill-counter and --color-fill-counter-emphasized.
`--button-color-4: var(--color-fill${variant === "ghost" ? "" : `-${variant}`}-counter);` +
`--text-color-hover: ${variant === "ghost" ? "var(--color-foreground-contrast)" : "var(--color-foreground-white)"};` +
`--text-color-active: ${variant === "ghost" ? "var(--color-foreground-emphasized)" : "var(--color-foreground-white)"};`,
);
</script>
<style>
.pixel {
background-color: transparent;
}
.p1-1 {
grid-area: p1-1;
}
.p1-2 {
grid-area: p1-2;
}
.p1-3 {
grid-area: p1-3;
background-color: var(--button-color-1);
}
.p1-4 {
grid-area: p1-4;
}
.p1-5 {
grid-area: p1-5;
}
.p2-1 {
grid-area: p2-1;
}
.p2-2 {
grid-area: p2-2;
background-color: var(--button-color-1);
}
.p2-3 {
grid-area: p2-3;
}
.p2-4 {
grid-area: p2-4;
background-color: var(--button-color-1);
}
.p2-5 {
grid-area: p2-5;
}
.p3-1 {
grid-area: p3-1;
background-color: var(--button-color-1);
}
.p3-2 {
grid-area: p3-2;
}
.p3-3 {
grid-area: p3-3;
padding: 0 0.5rem;
display: flex;
align-items: center;
gap: 0.5rem;
}
.p3-4 {
grid-area: p3-4;
}
.p3-5 {
grid-area: p3-5;
background-color: var(--button-color-1);
}
.p4-1 {
grid-area: p4-1;
}
.p4-2 {
grid-area: p4-2;
background-color: var(--button-color-1);
}
.p4-3 {
grid-area: p4-3;
}
.p4-4 {
grid-area: p4-4;
background-color: var(--button-color-1);
}
.p4-5 {
grid-area: p4-5;
}
.p5-1 {
grid-area: p5-1;
}
.p5-2 {
grid-area: p5-2;
}
.p5-3 {
grid-area: p5-3;
background-color: var(--button-color-1);
}
.p5-4 {
grid-area: p5-4;
}
.p5-5 {
grid-area: p5-5;
}
.container:hover:not(.disabled) .p1-3 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p2-2 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p2-3 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p2-4 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p3-1 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p3-2 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p3-3 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p3-4 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p3-5 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p4-2 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p4-3 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p4-4 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) .p5-3 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p1-3,
.container.active:not(.disabled) .p1-3 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p2-2,
.container.active:not(.disabled) .p2-2 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p2-3,
.container.active:not(.disabled) .p2-3 {
background-color: var(--button-color-3);
}
.container:active:not(.disabled) .p2-4,
.container.active:not(.disabled) .p2-4 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p3-1,
.container.active:not(.disabled) .p3-1 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p3-2,
.container.active:not(.disabled) .p3-2 {
background-color: var(--button-color-3);
}
.container:active:not(.disabled) .p3-3,
.container.active:not(.disabled) .p3-3 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p3-4,
.container.active:not(.disabled) .p3-4 {
background-color: var(--button-color-2);
}
.container:active:not(.disabled) .p3-5,
.container.active:not(.disabled) .p3-5 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p4-2,
.container.active:not(.disabled) .p4-2 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p4-3,
.container.active:not(.disabled) .p4-3 {
background-color: var(--button-color-2);
}
.container:active:not(.disabled) .p4-4,
.container.active:not(.disabled) .p4-4 {
background-color: var(--button-color-1);
}
.container:active:not(.disabled) .p5-3,
.container.active:not(.disabled) .p5-3 {
background-color: var(--button-color-1);
}
.container:hover:not(.disabled) {
color: var(--text-color-hover);
}
.container.active:not(.disabled) {
color: var(--text-color-active);
}
.container.disabled {
color: var(--color-foreground-disabled);
}
.disabled .p1-3,
.disabled .p2-2,
.disabled .p2-3,
.disabled .p2-4,
.disabled .p3-1,
.disabled .p3-2,
.disabled .p3-3,
.disabled .p3-4,
.disabled .p3-5,
.disabled .p4-2,
.disabled .p4-3,
.disabled .p4-4,
.disabled .p5-3 {
background-color: var(--color-fill-ghost);
}
.container {
cursor: pointer;
white-space: nowrap;
-webkit-touch-callout: none;
-webkit-user-select: none;
user-select: none;
column-gap: 0;
row-gap: 0;
display: grid;
grid-template-columns: 2px 2px auto 2px 2px;
grid-template-rows: 2px 2px auto 2px 2px;
grid-template-areas:
"p1-1 p1-2 p1-3 p1-4 p1-5"
"p2-1 p2-2 p2-3 p2-4 p2-5"
"p3-1 p3-2 p3-3 p3-4 p3-5"
"p4-1 p4-2 p4-3 p4-4 p4-5"
"p5-1 p5-2 p5-3 p5-4 p5-5";
}
</style>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
{id}
data-popover-toggle={popoverToggle}
class:active
class:disabled
class="container"
onclick={!disabled ? onclick : undefined}
role="button"
style:cursor={!disabled ? "pointer" : "default"}
style:height={styleHeight}
tabindex="0"
{style}
{title}>
<div class="pixel p1-1"></div>
<div class="pixel p1-2"></div>
<div class="pixel p1-3"></div>
<div class="pixel p1-4"></div>
<div class="pixel p1-5"></div>
<div class="pixel p2-1"></div>
<div class="pixel p2-2"></div>
<div class="pixel p2-3"></div>
<div class="pixel p2-4"></div>
<div class="pixel p2-5"></div>
<div class="pixel p3-1"></div>
<div class="pixel p3-2"></div>
<div class="pixel p3-3 txt-semibold txt-small">
{@render children()}
</div>
<div class="pixel p3-4"></div>
<div class="pixel p3-5"></div>
<div class="pixel p4-1"></div>
<div class="pixel p4-2"></div>
<div class="pixel p4-3"></div>
<div class="pixel p4-4"></div>
<div class="pixel p4-5"></div>
<div class="pixel p5-1"></div>
<div class="pixel p5-2"></div>
<div class="pixel p5-3"></div>
<div class="pixel p5-4"></div>
<div class="pixel p5-5"></div>
</div>
+8 -20
View File
@@ -7,12 +7,10 @@
import { nodeRunning } from "@app/lib/events";
import { invoke } from "@app/lib/invoke";
import * as roles from "@app/lib/roles";
import { authorForNodeId } from "@app/lib/utils";
import { announce } from "@app/components/AnnounceSwitch.svelte";
import AssigneeInput from "@app/components/AssigneeInput.svelte";
import LabelInput from "@app/components/LabelInput.svelte";
import NodeId from "@app/components/NodeId.svelte";
import PatchStateButton from "@app/components/PatchStateButton.svelte";
interface Props {
@@ -80,16 +78,12 @@
<style>
.metadata-section {
padding: 0.5rem;
font-size: var(--font-size-small);
font: var(--txt-body-m-regular);
display: flex;
flex-direction: column;
align-items: flex;
height: 100%;
}
.metadata-section-title {
margin-bottom: 0.5rem;
color: var(--color-foreground-dim);
}
</style>
<div
@@ -99,29 +93,24 @@
<div
class="metadata-section"
style={horizontal ? "flex: 1;" : "width: 100%;"}>
<div class="metadata-section-title">Author</div>
<NodeId {...authorForNodeId(patch.author)} />
</div>
<div
class="metadata-section"
style={horizontal ? "flex: 1;" : "width: 100%;"}>
<div class="metadata-section-title">Status</div>
<PatchStateButton
selectedState={patch.state}
onSelect={newState => {
void saveState(newState);
}} />
}}
disabled={!roles.isDelegate(
config.publicKey,
repo.delegates.map(d => d.did),
)} />
</div>
<div
class="metadata-section"
style={horizontal ? "flex: 1;" : "width: 100%;"}>
<LabelInput
allowedToEdit={!!roles.isDelegateOrAuthor(
allowedToEdit={!!roles.isDelegate(
config.publicKey,
repo.delegates.map(delegate => delegate.did),
patch.author.did,
)}
labels={patch.labels}
submitInProgress={labelSaveInProgress}
@@ -132,10 +121,9 @@
class="metadata-section"
style={horizontal ? "flex: 1;" : "width: 100%;"}>
<AssigneeInput
allowedToEdit={!!roles.isDelegateOrAuthor(
allowedToEdit={!!roles.isDelegate(
config.publicKey,
repo.delegates.map(delegate => delegate.did),
patch.author.did,
)}
assignees={patch.assignees}
submitInProgress={assigneesSaveInProgress}
+46 -44
View File
@@ -5,7 +5,7 @@
import { patchStatusBackgroundColor, patchStatusColor } from "@app/lib/utils";
import Border from "@app/components/Border.svelte";
import Button from "@app/components/Button.svelte";
import DropdownList from "@app/components/DropdownList.svelte";
import DropdownListItem from "@app/components/DropdownListItem.svelte";
import Icon from "@app/components/Icon.svelte";
@@ -15,67 +15,63 @@
interface Props {
selectedState: State;
onSelect: (newState: State) => void;
disabled?: boolean;
}
const { selectedState, onSelect }: Props = $props();
const { selectedState, onSelect, disabled = false }: Props = $props();
let popoverExpanded: boolean = $state(false);
</script>
<style>
button {
cursor: pointer;
border: 0;
background: none;
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--font-size-small);
background-color: none;
}
button:disabled {
cursor: inherit;
}
.badge {
gap: 0.375rem;
padding-right: 0.625rem;
}
</style>
<Popover
popoverPadding="0"
popoverPositionTop="2rem"
popoverPositionLeft="0"
placement="bottom-start"
bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<button
disabled={selectedState.status === "merged"}
<Button
variant="outline"
disabled={selectedState.status === "merged" || disabled}
{onclick}
active={popoverExpanded}
title={selectedState.status === "merged"
? "The state of merged patches can not be changed"
: "Click to change patch state"}>
: disabled
? "You must be a delegate to change the patch state"
: undefined}>
<span
class="global-counter badge"
style:color={patchStatusColor[selectedState.status]}
style:background-color={patchStatusBackgroundColor[
selectedState.status
]}>
class="global-chip"
style:padding="0"
style:margin-left="-0.25rem"
style:color={selectedState.status === "merged" || disabled
? undefined
: patchStatusColor[selectedState.status]}
style:background-color={selectedState.status === "merged" || disabled
? undefined
: patchStatusBackgroundColor[selectedState.status]}>
<Icon
name={selectedState.status === "open"
? "patch"
: `patch-${selectedState.status}`} />
{capitalize(selectedState.status)}
{#if selectedState.status !== "merged"}
<Icon name={popoverExpanded ? "chevron-up" : "chevron-down"} />
{/if}
</span>
</button>
<span
style:color={selectedState.status === "merged" || disabled
? undefined
: "var(--color-text-secondary)"}>
{capitalize(selectedState.status)}
</span>
{#if selectedState.status !== "merged"}
<Icon name={popoverExpanded ? "chevron-up" : "chevron-down"} />
{/if}
</Button>
{/snippet}
{#snippet popover()}
<Border variant="ghost">
<div
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="0.5rem"
style:align-items="center"
style:background-color="var(--color-surface-canvas)">
<DropdownList
items={[
{ status: "open" },
@@ -85,22 +81,28 @@
{#snippet item(state)}
<DropdownListItem
selected={selectedState.status === state.status}
styleGap="0.5rem"
onclick={() => {
onSelect(state);
closeFocused();
}}>
<span
class="global-flex"
style:color={patchStatusColor[state.status]}>
class="global-chip"
style:padding="0"
style:margin-left="-0.5rem"
style:color={patchStatusColor[state.status]}
style:background-color={patchStatusBackgroundColor[state.status]}>
<Icon
name={state.status === "open"
? "patch"
: `patch-${state.status}`} />
</span>
<span style:color="var(--color-text-secondary)">
{capitalize(state.status)}
</span>
</DropdownListItem>
{/snippet}
</DropdownList>
</Border>
</div>
{/snippet}
</Popover>
@@ -1,120 +0,0 @@
<script lang="ts">
import type { State } from "@bindings/cob/patch/State";
import type { ComponentProps } from "svelte";
import capitalize from "lodash/capitalize";
import { patchStatusBackgroundColor, patchStatusColor } from "@app/lib/utils";
import Border from "@app/components/Border.svelte";
import DropdownList from "@app/components/DropdownList.svelte";
import DropdownListItem from "@app/components/DropdownListItem.svelte";
import Icon from "@app/components/Icon.svelte";
import { closeFocused } from "@app/components/Popover.svelte";
import Popover from "@app/components/Popover.svelte";
interface Props {
selectedState: State;
onSelect: (newState: State) => void;
}
const { selectedState, onSelect }: Props = $props();
let focus = $state(false);
let popoverExpanded: boolean = $state(false);
function icon(): ComponentProps<typeof Icon>["name"] {
if (selectedState.status === "merged") {
return "patch-merged";
} else if (focus) {
return "chevron-down";
} else {
if (selectedState.status === "open") {
return "patch";
} else {
return `patch-${selectedState.status}`;
}
}
}
</script>
<style>
button {
cursor: pointer;
border: 0;
background: none;
margin: 0;
padding: 0;
display: flex;
align-items: center;
justify-content: center;
font-size: var(--font-size-small);
}
button:disabled {
cursor: inherit;
}
.badge {
height: 2.5rem;
width: 2.5rem;
gap: 0.375rem;
padding-right: 0.625rem;
}
</style>
<Popover
popoverPadding="0"
popoverPositionTop="3rem"
popoverPositionLeft="0"
bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<button
onmouseenter={() => (focus = true)}
onfocus={() => (focus = true)}
onblur={() => (focus = false)}
onmouseleave={() => (focus = false)}
disabled={selectedState.status === "merged"}
{onclick}
title={selectedState.status === "merged"
? "The state of merged patches can not be changed"
: "Click to change patch state"}>
<span
class="global-counter badge"
style:color={patchStatusColor[selectedState.status]}
style:background-color={patchStatusBackgroundColor[
selectedState.status
]}>
<Icon name={icon()} />
</span>
</button>
{/snippet}
{#snippet popover()}
<Border variant="ghost">
<DropdownList
items={[
{ status: "open" },
{ status: "draft" },
{ status: "archived" },
] as State[]}>
{#snippet item(state)}
<DropdownListItem
selected={selectedState.status === state.status}
onclick={() => {
onSelect(state);
closeFocused();
}}>
<span
class="global-flex"
style:color={patchStatusColor[state.status]}>
<Icon
name={state.status === "open"
? "patch"
: `patch-${state.status}`} />
{capitalize(state.status)}
</span>
</DropdownListItem>
{/snippet}
</DropdownList>
</Border>
{/snippet}
</Popover>
@@ -1,85 +0,0 @@
<script lang="ts">
import type { PatchStatus } from "@app/views/repo/router";
import type { ProjectPayloadMeta } from "@bindings/repo/ProjectPayloadMeta";
import capitalize from "lodash/capitalize";
import { patchStatusColor } from "@app/lib/utils";
import Border from "@app/components/Border.svelte";
import DropdownList from "@app/components/DropdownList.svelte";
import DropdownListItem from "@app/components/DropdownListItem.svelte";
import Icon from "@app/components/Icon.svelte";
import OutlineButton from "@app/components/OutlineButton.svelte";
import { closeFocused } from "@app/components/Popover.svelte";
import Popover from "@app/components/Popover.svelte";
interface Props {
counters: ProjectPayloadMeta["patches"];
select: (filter: PatchStatus | undefined) => Promise<void>;
status: PatchStatus | undefined;
}
const { status, select, counters }: Props = $props();
let popoverExpanded: boolean = $state(false);
</script>
{#snippet iconSnippet(status: PatchStatus | undefined)}
<div class="icon" style:color={status ? patchStatusColor[status] : undefined}>
<Icon
name={status === undefined || status === "open"
? "patch"
: `patch-${status}`} />
</div>
{/snippet}
{#snippet counterSnippet(status: PatchStatus | undefined)}
<div style:margin-left="auto" style:padding-left="0.25rem">
{#if status}
{counters[status]}
{:else}
{counters.draft + counters.open + counters.archived + counters.merged}
{/if}
</div>
{/snippet}
<Popover
popoverPositionLeft="0"
popoverPositionTop="3rem"
bind:expanded={popoverExpanded}>
{#snippet toggle(onclick)}
<OutlineButton
variant="ghost"
{onclick}
styleHeight="2.5rem"
active={popoverExpanded}>
{@render iconSnippet(status)}
{status ? capitalize(status) : "All"}
{@render counterSnippet(status)}
<Icon name={popoverExpanded ? "chevron-up" : "chevron-down"} />
</OutlineButton>
{/snippet}
{#snippet popover()}
<Border variant="ghost">
<DropdownList
items={[undefined, "draft", "open", "archived", "merged"] as const}>
{#snippet item(state)}
<DropdownListItem
styleGap="0.5rem"
styleMinHeight="2.5rem"
selected={status === state}
onclick={async () => {
await select(state);
closeFocused();
}}>
{@render iconSnippet(state)}
{state ? capitalize(state) : "All"}
{@render counterSnippet(state)}
</DropdownListItem>
{/snippet}
</DropdownList>
</Border>
{/snippet}
</Popover>
+39 -52
View File
@@ -11,7 +11,6 @@
patchStatusColor,
} from "@app/lib/utils";
import Border from "@app/components/Border.svelte";
import DiffStatBadge from "@app/components/DiffStatBadge.svelte";
import Icon from "@app/components/Icon.svelte";
import Id from "@app/components/Id.svelte";
@@ -20,24 +19,13 @@
import NodeId from "@app/components/NodeId.svelte";
interface Props {
compact?: boolean;
focussed?: boolean;
loadPatch?: (patchId: string) => Promise<void>;
patch: Patch;
rid: string;
selected?: boolean;
status: PatchStatus | undefined;
}
const {
compact = false,
focussed,
loadPatch,
patch,
rid,
selected = false,
status,
}: Props = $props();
const { focussed, patch, rid, status }: Props = $props();
</script>
<style>
@@ -47,31 +35,28 @@
justify-content: space-between;
gap: 0.25rem;
min-height: 5rem;
background-color: var(--color-background-float);
background-color: var(--color-surface-canvas);
padding: 1rem;
cursor: pointer;
font-size: var(--font-size-regular);
font: var(--txt-body-l-regular);
word-break: break-word;
width: 100%;
}
.selected {
background-color: var(--color-fill-float-hover);
}
.patch-teaser:hover {
background-color: var(--color-fill-float-hover);
background-color: var(--color-surface-subtle);
}
.status {
padding: 0;
margin-right: 1rem;
}
.patch-teaser:first-of-type {
clip-path: var(--2px-top-corner-fill);
border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
}
.patch-teaser:last-of-type {
clip-path: var(--2px-bottom-corner-fill);
border-radius: 0 0 var(--border-radius-sm) var(--border-radius-sm);
}
.patch-teaser:only-of-type {
clip-path: var(--2px-corner-fill);
border-radius: var(--border-radius-sm);
}
</style>
@@ -80,27 +65,22 @@
<div
tabindex="0"
role="button"
class:selected
class="patch-teaser"
style:align-items="flex-start"
style:clip-path={focussed ? "none" : undefined}
style:padding={focussed ? "1rem" : "1.25rem"}
onclick={async () => {
if (loadPatch) {
await loadPatch(patch.id);
} else {
void push({
resource: "repo.patch",
rid,
patch: patch.id,
status,
reviewId: undefined,
});
}
onclick={() => {
void push({
resource: "repo.patch",
rid,
patch: patch.id,
status,
reviewId: undefined,
});
}}>
<div class="global-flex" style:align-items="flex-start">
<div
class="global-counter status"
class="global-chip status"
style:color={patchStatusColor[patch.state.status]}
style:background-color={patchStatusBackgroundColor[patch.state.status]}>
<Icon
@@ -113,29 +93,32 @@
style:flex-direction="column"
style:align-items="flex-start">
<InlineTitle content={patch.title} />
<div class="global-flex txt-small" style:flex-wrap="wrap">
<div class="global-flex txt-body-m-regular" style:flex-wrap="wrap">
<NodeId {...authorForNodeId(patch.author)} />
opened
<Id id={patch.id} clipboard={patch.id} variant="oid" />
<Id id={patch.id} clipboard={patch.id} />
{formatTimestamp(patch.timestamp)}
</div>
</div>
</div>
<div class="global-flex" style:margin-left="auto">
{#if !compact}
{#await cachedDiffStats(rid, patch.base, patch.head) then stats}
<DiffStatBadge {stats} />
{/await}
{#await cachedDiffStats(rid, patch.base, patch.head) then stats}
<DiffStatBadge {stats} />
{/await}
{#each patch.labels as label}
<Label {label} />
{/each}
{/if}
{#each patch.labels as label}
<Label {label} />
{/each}
<div
class="txt-small global-flex"
class="txt-body-m-regular global-flex"
style:gap="0.25rem"
style:white-space="nowrap">
style:white-space="nowrap"
style:border="1px solid var(--color-border-subtle)"
style:border-radius="var(--border-radius-sm)"
style:height="1.5rem"
style:padding="0 0.5rem"
style:color="var(--color-text-tertiary)">
<Icon name="revision" />
{patch.revisionCount}
</div>
@@ -144,11 +127,15 @@
{/snippet}
{#if focussed}
<Border
styleBackgroundColor="var(--color-background-float)"
variant="secondary">
<div
style:border="1px solid var(--color-border-brand)"
style:border-radius="var(--border-radius-sm)"
style:display="flex"
style:gap="0.5rem"
style:align-items="center"
style:background-color="var(--color-surface-canvas)">
{@render patchSnippet()}
</Border>
</div>
{:else}
{@render patchSnippet()}
{/if}
+16 -28
View File
@@ -95,18 +95,18 @@
}
</style>
<div class="timeline txt-small">
<div class="timeline txt-body-m-regular">
{#each timeline as op}
{#if op.type === "revision"}
{#if op.id === patchId}
<div class="timeline-item">
<div class="icon" style:color="var(--color-fill-success)">
<div class="icon" style:color="var(--color-feedback-success-text)">
<Icon name="patch" />
</div>
<div class="wrapper">
<NodeId {...authorForNodeId(op.author)} />
<div>
opened patch <Id id={op.id} clipboard={op.id} variant="oid" />
opened patch <Id id={op.id} clipboard={op.id} />
</div>
<div title={absoluteTimestamp(op.timestamp)}>
{formatTimestamp(op.timestamp)}
@@ -121,7 +121,7 @@
<div class="wrapper">
<NodeId {...authorForNodeId(op.author)} />
<div>
created revision <Id id={op.id} clipboard={op.id} variant="oid" />
created revision <Id id={op.id} clipboard={op.id} />
</div>
<div title={absoluteTimestamp(op.timestamp)}>
{formatTimestamp(op.timestamp)}
@@ -188,7 +188,7 @@
{:else if op.type === "assign"}
<div class="timeline-item">
<div class="icon">
<Icon name="user" />
<Icon name="avatar-incognito" />
</div>
<div class="wrapper">
<NodeId {...authorForNodeId(op.author)} />
@@ -222,7 +222,7 @@
</div>
{:else if op.type === "merge"}
<div class="timeline-item">
<div class="icon" style:color="var(--color-fill-primary)">
<div class="icon" style:color="var(--color-brand-bg)">
<Icon name="patch-merged" />
</div>
<div class="wrapper">
@@ -230,8 +230,7 @@
<div>
merged patch at revision <Id
id={op.revision}
clipboard={op.revision}
variant="oid" />
clipboard={op.revision} />
</div>
<div title={absoluteTimestamp(op.timestamp)}>
{formatTimestamp(op.timestamp)}
@@ -242,7 +241,7 @@
{#if op.previous && op.previous.type === op.type}
<div class="timeline-item">
<div class="icon">
<Icon name="pen" />
<Icon name="edit" />
</div>
<div class="wrapper">
<NodeId {...authorForNodeId(op.author)} />
@@ -258,29 +257,23 @@
{:else if op.type === "review"}
<div class="timeline-item">
{#if op.verdict === "accept"}
<div class="icon" style:color="var(--color-foreground-success)">
<Icon name="thumb-up" />
<div class="icon" style:color="var(--color-feedback-success-text)">
<Icon name="thumbs-up" />
</div>
<div class="wrapper">
<NodeId {...authorForNodeId(op.author)} />
accepted revision <Id
id={op.revision}
clipboard={op.revision}
variant="oid" />
accepted revision <Id id={op.revision} clipboard={op.revision} />
<div title={absoluteTimestamp(op.timestamp)}>
{formatTimestamp(op.timestamp)}
</div>
</div>
{:else if op.verdict === "reject"}
<div class="icon" style:color="var(--color-foreground-red)">
<div class="icon" style:color="var(--color-feedback-error-text)">
<Icon name="stop" />
</div>
<div class="wrapper">
<NodeId {...authorForNodeId(op.author)} />
rejected revision <Id
id={op.revision}
clipboard={op.revision}
variant="oid" />
rejected revision <Id id={op.revision} clipboard={op.revision} />
<div title={absoluteTimestamp(op.timestamp)}>
{formatTimestamp(op.timestamp)}
</div>
@@ -291,10 +284,7 @@
</div>
<div class="wrapper">
<NodeId {...authorForNodeId(op.author)} />
reviewed revision <Id
id={op.revision}
clipboard={op.revision}
variant="oid" />
reviewed revision <Id id={op.revision} clipboard={op.revision} />
<div title={absoluteTimestamp(op.timestamp)}>
{formatTimestamp(op.timestamp)}
</div>
@@ -310,8 +300,7 @@
<NodeId {...authorForNodeId(op.author)} />
{op.replyTo ? "replied to a comment" : "commented"} on review <Id
id={op.review}
clipboard={op.review}
variant="oid" />
clipboard={op.review} />
<div title={absoluteTimestamp(op.timestamp)}>
{formatTimestamp(op.timestamp)}
</div>
@@ -326,8 +315,7 @@
<NodeId {...authorForNodeId(op.author)} />
{op.replyTo ? "replied to a comment" : "commented"} on revision <Id
id={op.revision}
clipboard={op.revision}
variant="oid" />
clipboard={op.revision} />
<div title={absoluteTimestamp(op.timestamp)}>
{formatTimestamp(op.timestamp)}
</div>
-207
View File
@@ -1,207 +0,0 @@
<script lang="ts">
import type { PatchStatus } from "@app/views/repo/router";
import type { ProjectPayload } from "@bindings/repo/ProjectPayload";
import type { RepoInfo } from "@bindings/repo/RepoInfo";
import Border from "@app/components/Border.svelte";
import Icon from "@app/components/Icon.svelte";
import Link from "@app/components/Link.svelte";
import RepoTeaser from "@app/components/RepoTeaser.svelte";
import Settings from "@app/components/Settings.svelte";
interface Props {
project: ProjectPayload;
status: PatchStatus | undefined;
repo: RepoInfo;
}
const { project, status, repo }: Props = $props();
</script>
<style>
.container {
display: flex;
flex-direction: column;
height: 100%;
justify-content: space-between;
}
.tab {
align-items: center;
background-color: var(--color-background-float);
clip-path: var(--1px-corner-fill);
display: flex;
font-size: var(--font-size-small);
justify-content: space-between;
padding: 0.5rem 0.25rem 0.5rem 0.5rem;
width: 100%;
}
.tab:not(.active) {
color: var(--color-foreground-dim);
}
.tab:not(.active):hover {
background-color: var(--color-fill-float-hover);
}
.active {
background-color: var(--color-background-default);
font-weight: var(--font-weight-semibold);
}
.highlight {
color: var(--color-foreground-contrast);
}
.draft {
color: var(--color-fill-gray);
}
.open {
color: var(--color-fill-success);
}
.archived {
color: var(--color-foreground-yellow);
}
.merged {
color: var(--color-foreground-primary);
}
</style>
<div class="container">
<div>
<div style:margin-bottom="0.75rem">
<Link
styleWidth="100%"
underline={false}
route={{ resource: "repo.home", rid: repo.rid }}>
<div
class="tab"
style:color="var(--color-foreground-contrast)"
style:padding-right="0.5rem"
style:padding-left="0.75rem">
<RepoTeaser name={project.data.name} seeding={repo.seeding} />
</div>
</Link>
</div>
<div style:margin-bottom="0.5rem">
<Link
styleWidth="100%"
underline={false}
route={{ resource: "repo.issues", rid: repo.rid, status: "open" }}>
<div
class="tab"
style:color="var(--color-foreground-contrast)"
style:padding-left="0.75rem">
<div class="global-flex"><Icon name="issue" />Issues</div>
<div class="global-counter">
{project.meta.issues.open + project.meta.issues.closed}
</div>
</div>
</Link>
</div>
<Border
variant="ghost"
styleFlexDirection="column"
styleGap="2px"
styleBackgroundColor="var(--color-background-float)">
<Link
styleWidth="100%"
underline={false}
route={{ resource: "repo.patches", rid: repo.rid, status: undefined }}>
<div class="tab active">
<div class="global-flex"><Icon name="patch" />Patches</div>
<div class="global-counter">
{project.meta.patches.draft +
project.meta.patches.open +
project.meta.patches.archived +
project.meta.patches.merged}
</div>
</div>
</Link>
<Link
styleWidth="100%"
underline={false}
route={{
resource: "repo.patches",
rid: repo.rid,
status: "open",
}}>
<div class="tab" class:active={status === "open"}>
<div
class="global-flex"
class:open={["open", undefined].includes(status)}>
<Icon name="patch" />
Open
</div>
<div class="global-counter" class:highlight={status === undefined}>
{project.meta.patches.open}
</div>
</div>
</Link>
<Link
styleWidth="100%"
underline={false}
route={{
resource: "repo.patches",
rid: repo.rid,
status: "merged",
}}>
<div class="tab" class:active={status === "merged"}>
<div
class="global-flex"
class:merged={["merged", undefined].includes(status)}>
<Icon name="patch-merged" />Merged
</div>
<div class="global-counter" class:highlight={status === undefined}>
{project.meta.patches.merged}
</div>
</div>
</Link>
<Link
styleWidth="100%"
underline={false}
route={{
resource: "repo.patches",
rid: repo.rid,
status: "archived",
}}>
<div class="tab" class:active={status === "archived"}>
<div
class="global-flex"
class:archived={["archived", undefined].includes(status)}>
<Icon name="patch-archived" />Archived
</div>
<div class="global-counter" class:highlight={status === undefined}>
{project.meta.patches.archived}
</div>
</div>
</Link>
<Link
styleWidth="100%"
underline={false}
route={{
resource: "repo.patches",
rid: repo.rid,
status: "draft",
}}>
<div class="tab" class:active={status === "draft"}>
<div
class="global-flex"
class:draft={["draft", undefined].includes(status)}>
<Icon name="patch-draft" />
Draft
</div>
<div class="global-counter" class:highlight={status === undefined}>
{project.meta.patches.draft}
</div>
</div>
</Link>
</Border>
</div>
<Settings
compact={false}
popoverProps={{
popoverPositionBottom: "3rem",
popoverPositionLeft: "0",
}} />
</div>
+2 -6
View File
@@ -14,16 +14,12 @@
user-select: text;
}
.path {
color: var(--color-fill-gray);
font-weight: var(--font-weight-regular);
}
.filename {
font-weight: var(--font-weight-semibold);
color: var(--color-text-quaternary);
}
</style>
<!-- prettier-ignore -->
<span class="txt-small container">
<span class="txt-body-m-regular container">
<span class="path">
{fullPath
.match(/^.*\/|/)
+55 -39
View File
@@ -1,7 +1,7 @@
<script lang="ts" module>
let focused = $state<{ element: HTMLDivElement; id: string } | undefined>(
undefined,
);
let focused = $state<
{ id: string; floatingEl: HTMLElement | undefined } | undefined
>(undefined);
export function closeFocused() {
focused = undefined;
@@ -9,17 +9,25 @@
</script>
<script lang="ts">
import type { Placement } from "@floating-ui/dom";
import type { Snippet } from "svelte";
import {
autoUpdate,
computePosition,
flip,
offset as floatingOffset,
shift,
} from "@floating-ui/dom";
import { portal } from "@app/lib/portal";
interface Props {
toggle: Snippet<[() => void]>;
popover: Snippet;
popoverContainerMinWidth?: string;
placement?: Placement;
offset?: number;
popoverPadding?: string;
popoverPositionBottom?: string;
popoverPositionLeft?: string;
popoverPositionRight?: string;
popoverPositionTop?: string;
expanded?: boolean;
}
@@ -27,45 +35,56 @@
let {
toggle,
popover,
popoverContainerMinWidth,
placement = "bottom-start",
offset: offsetPx = 4,
popoverPadding,
popoverPositionBottom,
popoverPositionLeft,
popoverPositionRight,
popoverPositionTop,
expanded = $bindable(false),
}: Props = $props();
/* eslint-enable prefer-const */
const id = crypto.randomUUID();
let thisComponent: HTMLDivElement | undefined = $state();
let containerEl: HTMLDivElement | undefined = $state();
let floatingEl: HTMLDivElement | undefined = $state();
function clickOutside(ev: MouseEvent | TouchEvent) {
const toggleElement = document.querySelector(
`[data-popover-toggle="${id}"]`,
);
if (focused && !ev.composedPath().includes(focused.element)) {
if (
thisComponent === focused.element &&
!ev.composedPath().includes(toggleElement!)
) {
if (focused?.id === id) {
const path = ev.composedPath();
const insideContainer = containerEl && path.includes(containerEl);
const insideFloating = floatingEl && path.includes(floatingEl);
if (!insideContainer && !insideFloating) {
closeFocused();
}
}
}
function toggleFn() {
if (thisComponent) {
if (focused?.element === thisComponent) {
closeFocused();
} else {
focused = { element: thisComponent, id };
}
if (focused?.id === id) {
closeFocused();
} else {
focused = { id, floatingEl: undefined };
}
}
$effect(() => {
expanded = focused?.element === thisComponent;
expanded = focused?.id === id;
});
$effect(() => {
if (floatingEl && containerEl) {
const cleanup = autoUpdate(containerEl, floatingEl, () => {
void computePosition(containerEl!, floatingEl!, {
placement,
middleware: [floatingOffset(offsetPx), flip(), shift({ padding: 8 })],
}).then(({ x, y }) => {
if (floatingEl) {
floatingEl.style.left = `${x}px`;
floatingEl.style.top = `${y}px`;
floatingEl.style.visibility = "visible";
}
});
});
return cleanup;
}
});
</script>
@@ -75,27 +94,24 @@
}
.popover {
box-shadow: var(--elevation-low);
position: absolute;
position: fixed;
top: 0;
left: 0;
visibility: hidden;
z-index: 10;
}
</style>
<svelte:window onclick={clickOutside} ontouchstart={clickOutside} />
<div
data-popover-id={id}
bind:this={thisComponent}
class="container"
style:min-width={popoverContainerMinWidth}>
<div data-popover-id={id} bind:this={containerEl} class="container">
{@render toggle(toggleFn)}
{#if expanded}
<div
use:portal
bind:this={floatingEl}
class="popover"
style:bottom={popoverPositionBottom}
style:left={popoverPositionLeft}
style:right={popoverPositionRight}
style:top={popoverPositionTop}
style:padding={popoverPadding}>
{@render popover()}
</div>
+2 -2
View File
@@ -14,8 +14,8 @@
<div class="container">
<Button
flatRight
variant="ghost"
flatRight
active={!preview}
onclick={() => {
preview = !preview;
@@ -24,8 +24,8 @@
</Button>
<Button
flatLeft
variant="ghost"
flatLeft
active={preview}
onclick={() => {
preview = !preview;
+30
View File
@@ -0,0 +1,30 @@
<script lang="ts">
</script>
<style>
svg {
fill: currentColor;
}
</style>
<svg
width="69"
height="16"
viewBox="0 0 69 16"
fill="none"
xmlns="http://www.w3.org/2000/svg">
<path
d="M1.84555 13.7149H0V15.7954H6.28119V13.7149H4.466V7.01257H8.02772V4.61917H1.84555V13.7149Z" />
<path
d="M9.20923 12.8172C9.20923 10.7169 10.627 9.62514 13.2475 9.23834L15.1855 8.96243C15.8785 8.86078 16.2152 8.63636 16.2152 8.06474C16.2152 6.98355 15.4706 6.37233 14.1861 6.37233C12.8198 6.37233 12.0964 7.10633 11.8812 8.14659L9.3518 7.76903C9.73992 5.91293 11.2792 4.41458 14.1848 4.41458C17.0904 4.41458 18.8449 6.0159 18.8449 8.56507V15.7941H16.2653V13.7241H16.1637C15.8072 14.9479 14.594 15.9974 12.7485 15.9974C10.5967 15.9974 9.21055 14.7327 9.21055 12.8159L9.20923 12.8172ZM16.2138 10.9109V10.544L13.7874 10.9928C12.5333 11.2278 11.9828 11.7572 11.9828 12.5624C11.9828 13.4601 12.6455 13.9895 13.6554 13.9895C15.369 13.9895 16.2152 12.7459 16.2152 10.9096L16.2138 10.9109Z" />
<path
d="M20.5122 10.1861C20.5122 6.65872 22.3274 4.41449 25.0191 4.41449C26.5492 4.41449 27.7518 5.28182 28.3234 6.61647H28.4158V0.826372H31.0469V15.7953H28.4158V13.7465H28.3142C27.6211 15.1841 26.5505 16 25.031 16C22.3287 16 20.5135 13.7267 20.5135 10.1874L20.5122 10.1861ZM25.8455 13.7953C27.4152 13.7953 28.4053 12.3775 28.4053 10.1861C28.4053 7.99469 27.4165 6.58611 25.8455 6.58611C24.2746 6.58611 23.2858 7.99337 23.2858 10.1861C23.2858 12.3788 24.2851 13.7953 25.8455 13.7953Z" />
<path
d="M37.3981 13.7149H39.2436V15.7954H32.9624V13.7149H34.7776V6.69967H33.0957V4.61914H37.3981V13.7149ZM34.441 1.54983C34.441 0.693069 35.1551 0 36.0212 0C36.8872 0 37.5816 0.693069 37.5816 1.54983C37.5816 2.4066 36.899 3.08911 36.0212 3.08911C35.1433 3.08911 34.441 2.4066 34.441 1.54983Z" />
<path
d="M50.0937 7.98415L47.5644 8.52409C47.299 7.28052 46.5756 6.54653 45.3413 6.54653C43.7505 6.54653 42.7406 7.8825 42.7406 10.2073C42.7406 12.532 43.7598 13.868 45.3505 13.868C46.4924 13.868 47.3083 13.2462 47.5433 12.0026H50.1532C49.8574 14.5109 48.1954 16 45.3505 16C42.0871 16 39.9868 13.7267 39.9868 10.2086C39.9868 6.69042 42.0871 4.41716 45.34 4.41716C48.0317 4.41716 49.765 5.86534 50.0911 7.98547L50.0937 7.98415Z" />
<path
d="M55.5287 13.7148H57.3742V15.7953H51.093V13.7148H52.9082V2.90558H51.2264V0.826372H55.5287V13.7148Z" />
<path
d="M57.9749 10.2271C57.9749 6.74989 60.1267 4.41458 63.3174 4.41458C66.2442 4.41458 68.5386 6.34197 68.2323 10.808H60.7273C60.8805 12.7855 61.9207 13.938 63.328 13.938C64.5412 13.938 65.3055 13.336 65.6013 12.2958H68.2626C67.9775 14.1822 66.1729 15.9974 63.328 15.9974C60.0963 15.9974 57.9749 13.744 57.9749 10.2258V10.2271ZM65.6013 9.01392C65.5405 7.37167 64.7036 6.38289 63.328 6.38289C62.0739 6.38289 61.0851 7.10633 60.7894 9.01392H65.6026H65.6013Z" />
</svg>

Some files were not shown because too many files have changed in this diff Show More