diff --git a/public/index.css b/public/index.css index fbac4f002..ccd3f3127 100644 --- a/public/index.css +++ b/public/index.css @@ -61,6 +61,7 @@ body { height: 1.5rem; padding: 0 0.5rem; min-width: 1.5rem; + font-weight: var(--font-weight-regular); } :root { diff --git a/src/components/Border.svelte b/src/components/Border.svelte index bd5b4152a..7a48abe45 100644 --- a/src/components/Border.svelte +++ b/src/components/Border.svelte @@ -14,6 +14,9 @@ styleGap?: string; styleOverflow?: string; flatTop?: boolean; + styleBackgroundColor?: string; + styleFlexDirection?: string; + styleJustifyContent?: string; } const { @@ -29,11 +32,15 @@ styleGap = "0.5rem", styleOverflow, flatTop = false, + styleBackgroundColor = "var(--color-background-default)", + styleFlexDirection = "row", + styleJustifyContent, }: Props = $props(); const style = $derived( - `--local-button-color-1: var(--color-fill-${variant});` + - `--local-hover-background-color: ${hoverable ? "var(--color-background-float)" : "var(--color-background-default)"}`, + `--local-background-color: ${styleBackgroundColor};` + + `--local-button-color-1: var(--color-fill-${variant});` + + `--local-hover-background-color: ${hoverable ? "var(--color-background-float)" : styleBackgroundColor}`, ); @@ -97,7 +104,7 @@ } .p2-3 { grid-area: p2-3; - background-color: var(--color-background-default); + background-color: var(--local-background-color); } .p2-4 { grid-area: p2-4; @@ -114,17 +121,17 @@ } .p3-2 { grid-area: p3-2; - background-color: var(--color-background-default); + background-color: var(--local-background-color); } .p3-3 { grid-area: p3-3; display: flex; align-items: center; - background-color: var(--color-background-default); + background-color: var(--local-background-color); } .p3-4 { grid-area: p3-4; - background-color: var(--color-background-default); + background-color: var(--local-background-color); } .p3-5 { grid-area: p3-5; @@ -141,7 +148,7 @@ } .p4-3 { grid-area: p4-3; - background-color: var(--color-background-default); + background-color: var(--local-background-color); } .p4-4 { grid-area: p4-4; @@ -217,7 +224,9 @@ class="p3-3" style:padding={stylePadding} style:gap={styleGap} - style:overflow={styleOverflow}> + style:overflow={styleOverflow} + style:justify-content={styleJustifyContent} + style:flex-direction={styleFlexDirection}> {@render children()}
diff --git a/src/components/Comment.svelte b/src/components/Comment.svelte index dd658743e..56f2a9f4e 100644 --- a/src/components/Comment.svelte +++ b/src/components/Comment.svelte @@ -116,6 +116,7 @@ .edit-buttons { display: flex; gap: 0.25rem; + cursor: pointer; } @@ -143,7 +144,7 @@
{#if id && editComment}
- +
{/if} {#if id && reactions && reactOnComment} diff --git a/src/components/Header.svelte b/src/components/Header.svelte index a02f88f9e..fcc3fccec 100644 --- a/src/components/Header.svelte +++ b/src/components/Header.svelte @@ -3,86 +3,89 @@ import { nodeRunning } from "@app/lib/events"; - import AnnounceSwitch from "./AnnounceSwitch.svelte"; - import Border from "./Border.svelte"; import Icon from "./Icon.svelte"; import NakedButton from "./NakedButton.svelte"; import OutlineButton from "./OutlineButton.svelte"; - import Popover from "./Popover.svelte"; - import ThemeSwitch from "./ThemeSwitch.svelte"; interface Props { breadcrumbs: Snippet; - iconLeft?: Snippet; + columnSwitch?: Snippet; center?: Snippet; + settingsButton?: Snippet; } - const { breadcrumbs, iconLeft, center }: Props = $props(); + const { breadcrumbs, columnSwitch, center, settingsButton }: Props = $props();
-
-
-
-
- { - window.history.back(); - }}> - - - { - window.history.forward(); - }}> - - -
- {@render iconLeft?.()} +
+
+
+ { + window.history.back(); + }}> + + + { + window.history.forward(); + }}> + +
{@render center?.()} -
+
+ {@render settingsButton?.()} {#if $nodeRunning} @@ -92,44 +95,16 @@ Offline {/if} - - {#snippet toggle(onclick)} - - - - {/snippet} - {#snippet popover()} - -
-
- Theme -
-
- Announce changes -
-
-
- {/snippet} -
- -
diff --git a/src/components/Icon.svelte b/src/components/Icon.svelte index 787d5c770..1c89cb67a 100644 --- a/src/components/Icon.svelte +++ b/src/components/Icon.svelte @@ -4,7 +4,7 @@ interface Props { size?: "16" | "32"; onclick?: () => void; - styleCursor?: "default" | "pointer"; + styleCursor?: "default" | "pointer" | "inherit"; name: | "arrow-left" | "arrow-right" @@ -27,6 +27,7 @@ | "moon" | "more-vertical" | "offline" + | "one" | "online" | "patch" | "pen" @@ -37,15 +38,15 @@ | "seedling" | "seedling-filled" | "settings" - | "sidebar" | "sun" + | "two" | "warning"; } const { size = "16", onclick = undefined, - styleCursor = "default", + styleCursor = "inherit", name, }: Props = $props(); @@ -387,6 +388,15 @@ + {:else if name === "one"} + + + + + + + + {:else if name === "online"} @@ -600,12 +610,6 @@ - {:else if name === "sidebar"} - - - - - {:else if name === "sun"} @@ -631,6 +635,32 @@ + {:else if name === "two"} + + + + + + + + + + + + + + + + + + + + + + + + + {:else if name === "warning"} diff --git a/src/components/IssueSecondColumn.svelte b/src/components/IssueSecondColumn.svelte new file mode 100644 index 000000000..849243408 --- /dev/null +++ b/src/components/IssueSecondColumn.svelte @@ -0,0 +1,56 @@ + + + + +
+
+ Issues +
+ + { + void router.push({ + resource: "repo.createIssue", + rid: repo.rid, + }); + }}> + New + +
+
+ {#each issues as issue} + + {/each} +
diff --git a/src/components/IssueTeaser.svelte b/src/components/IssueTeaser.svelte index a65b4a266..c6bf9dd0e 100644 --- a/src/components/IssueTeaser.svelte +++ b/src/components/IssueTeaser.svelte @@ -17,9 +17,11 @@ interface Props { issue: Issue; rid: string; + selected?: boolean; + compact?: boolean; } - const { issue, rid }: Props = $props(); + const { issue, rid, selected = false, compact = false }: Props = $props(); + +
+
+ + + + +
+
Issues
+
+ {project.meta.issues.open + project.meta.issues.closed} +
+
+ + + +
+
+ Open +
+
+ {project.meta.issues.open} +
+
+ + + +
+
+ Closed +
+
+ {project.meta.issues.closed} +
+
+ +
+ +
+ +
+
Patches
+
+ {project.meta.patches.draft + + project.meta.patches.open + + project.meta.patches.archived + + project.meta.patches.merged} +
+
+ +
+
+ + +
diff --git a/src/components/Link.svelte b/src/components/Link.svelte index 80b026d00..e84fe2d5e 100644 --- a/src/components/Link.svelte +++ b/src/components/Link.svelte @@ -8,14 +8,16 @@ children: Snippet; route: Route; disabled?: boolean; - variant?: "active" | "regular" | "tab"; + underline?: boolean; + styleWidth?: string; } const { children, route, disabled = false, - variant = "regular", + underline = true, + styleWidth, }: Props = $props(); function navigateToRoute(event: MouseEvent): void { @@ -33,41 +35,17 @@ color: var(--color-foreground-contrast); text-decoration: none; } - .regular:hover { + .underline:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; } - - .tab { - display: flex; - width: 100%; - justify-content: space-between; - align-items: center; - padding: 4px 4px 4px 10px; - clip-path: var(--2px-corner-fill); - } - - .tab:hover { - background-color: var(--color-fill-ghost); - } - - .active { - background-color: var(--color-fill-ghost); - display: flex; - width: 100%; - justify-content: space-between; - align-items: center; - padding: 4px 4px 4px 10px; - clip-path: var(--2px-corner-fill); - } + class:underline + style:width={styleWidth}> {@render children()} diff --git a/src/components/NakedButton.svelte b/src/components/NakedButton.svelte index 3fd4b431d..4b714afcd 100644 --- a/src/components/NakedButton.svelte +++ b/src/components/NakedButton.svelte @@ -6,9 +6,16 @@ title?: string; variant: "primary" | "secondary" | "ghost"; onclick?: () => void; + styleHeight?: string; } - const { children, title, variant, onclick }: Props = $props(); + const { + children, + title, + variant, + onclick, + styleHeight = "32px", + }: Props = $props(); const style = $derived( `--button-color-1: var(--color-fill-${variant});` + @@ -181,7 +188,6 @@ } .container { - height: 32px; cursor: pointer; white-space: nowrap; @@ -204,7 +210,14 @@ -
+
diff --git a/src/components/OutlineButton.svelte b/src/components/OutlineButton.svelte index 1b4c93a21..24ca3d59c 100644 --- a/src/components/OutlineButton.svelte +++ b/src/components/OutlineButton.svelte @@ -224,7 +224,6 @@ } .container { - height: 32px; cursor: pointer; white-space: nowrap; diff --git a/src/components/PatchTeaser.svelte b/src/components/PatchTeaser.svelte index bfc1fb72c..9ca7e7263 100644 --- a/src/components/PatchTeaser.svelte +++ b/src/components/PatchTeaser.svelte @@ -31,9 +31,11 @@ interface Props { patch: Patch; rid: string; + selected?: boolean; + compact?: boolean; } - const { patch, rid }: Props = $props(); + const { patch, rid, selected = false, compact = false }: Props = $props(); + +
+
+ + +
+ +
+
Issues
+
+ {project.meta.issues.open + project.meta.issues.closed} +
+
+ +
+ + + +
+
Patches
+
+ {project.meta.patches.draft + + project.meta.patches.open + + project.meta.patches.archived + + project.meta.patches.merged} +
+
+ + + +
+
+ + Open +
+
+ {project.meta.patches.open} +
+
+ + + +
+
+ Merged +
+
+ {project.meta.patches.merged} +
+
+ + + +
+
+ Archived +
+
+ {project.meta.patches.archived} +
+
+ + +
+
+ + Draft +
+
+ {project.meta.patches.draft} +
+
+ +
+
+ + +
diff --git a/src/components/RepoHeader.svelte b/src/components/RepoHeader.svelte index 285babe13..6ed37b5a6 100644 --- a/src/components/RepoHeader.svelte +++ b/src/components/RepoHeader.svelte @@ -6,16 +6,9 @@ interface Props { repo: RepoInfo; selfDid: string; - emphasizedTitle?: boolean; - showLabels?: boolean; } - const { - repo, - selfDid, - emphasizedTitle = true, - showLabels = true, - }: Props = $props(); + const { repo, selfDid }: Props = $props(); const project = $derived(repo.payloads["xyz.radicle.project"]!); @@ -37,22 +30,14 @@ style:background-color="var(--color-fill-ghost)"> {project.data.name[0]}
- {#if emphasizedTitle} - - {project.data.name} - - {:else} - - {project.data.name} - - {/if} + + {project.data.name} +
- {#if showLabels && repo.visibility.type === "private"} + {#if repo.visibility.type === "private"}
{/if} - {#if showLabels && repo.delegates.find(x => x.did === selfDid)} + {#if repo.delegates.find(x => x.did === selfDid)}
+ import Icon from "@app/components/Icon.svelte"; + + interface Props { + name: string; + seeding: number; + } + + const { name, seeding }: Props = $props(); + + + + +
+ + + {name} + +
+ + {seeding} +
+
diff --git a/src/components/Settings.svelte b/src/components/Settings.svelte new file mode 100644 index 000000000..4a0a07c53 --- /dev/null +++ b/src/components/Settings.svelte @@ -0,0 +1,56 @@ + + + + {#snippet toggle(onclick)} + + + {#if !compact} + Settings + {/if} + + {/snippet} + {#snippet popover()} + +
+
+ Theme +
+
+ Announce changes +
+
+
+ {/snippet} +
diff --git a/src/components/Sidebar.svelte b/src/components/Sidebar.svelte new file mode 100644 index 000000000..a9afd421e --- /dev/null +++ b/src/components/Sidebar.svelte @@ -0,0 +1,106 @@ + + + + +
+
+ +
+ {#if activeTab === "issues"} + { + void router.push({ + resource: "repo.issues", + rid, + status: "open", + }); + }} + variant="ghost" + styleWidth="40px" + styleHeight="40px" + styleJustifyContent="center"> +
+
+ {:else} + + {/if} + + {#if activeTab === "patches"} + { + void router.push({ + resource: "repo.patches", + rid, + status: "open", + }); + }} + variant="ghost" + styleWidth="40px" + styleHeight="40px" + styleJustifyContent="center"> +
+
+ {:else} + + {/if} +
+ + diff --git a/src/views/Home.svelte b/src/views/Home.svelte index 9273fbe89..2202ece99 100644 --- a/src/views/Home.svelte +++ b/src/views/Home.svelte @@ -6,8 +6,9 @@ import CopyableId from "@app/components/CopyableId.svelte"; import Header from "@app/components/Header.svelte"; - import RepoCard from "@app/components/RepoCard.svelte"; import NodeId from "@app/components/NodeId.svelte"; + import RepoCard from "@app/components/RepoCard.svelte"; + import Settings from "@app/components/Settings.svelte"; interface Props { repos: RepoInfo[]; @@ -51,6 +52,14 @@ styleFontFamily="var(--font-family-sans-serif)" styleFontSize="var(--font-size-tiny)" /> {/snippet} + {#snippet settingsButton()} + + {/snippet}
diff --git a/src/views/repo/CreateIssue.svelte b/src/views/repo/CreateIssue.svelte index ed861148b..44845c579 100644 --- a/src/views/repo/CreateIssue.svelte +++ b/src/views/repo/CreateIssue.svelte @@ -6,20 +6,21 @@ import { invoke } from "@app/lib/invoke"; - import { issueStatusColor } from "@app/lib/utils"; import * as router from "@app/lib/router"; - import Border from "@app/components/Border.svelte"; import Button from "@app/components/Button.svelte"; import Icon from "@app/components/Icon.svelte"; import InlineTitle from "@app/components/InlineTitle.svelte"; - import Layout from "./Layout.svelte"; + import IssueSecondColumn from "@app/components/IssueSecondColumn.svelte"; import Link from "@app/components/Link.svelte"; + import Markdown from "@app/components/Markdown.svelte"; import NodeId from "@app/components/NodeId.svelte"; import OutlineButton from "@app/components/OutlineButton.svelte"; + import Sidebar from "@app/components/Sidebar.svelte"; import TextInput from "@app/components/TextInput.svelte"; import Textarea from "@app/components/Textarea.svelte"; - import Markdown from "@app/components/Markdown.svelte"; + + import Layout from "./Layout.svelte"; interface Props { repo: RepoInfo; @@ -63,17 +64,6 @@ margin-top: 0.35rem; margin-bottom: 1rem; } - .issue-teaser { - max-width: 11rem; - white-space: nowrap; - } - .issue-list { - margin-top: 0.5rem; - display: flex; - flex-direction: column; - gap: 0.5rem; - padding-bottom: 1rem; - } .content { padding: 0 1rem 1rem 1rem; height: calc(100% - 8rem); @@ -110,48 +100,11 @@ {/snippet} {#snippet sidebar()} - -
- -
- Issues -
-
- {project.meta.issues.open + project.meta.issues.closed} -
-
-
+ + {/snippet} -
- {#each issues as sidebarIssue} - -
-
- -
- - - -
- - {/each} -
+ {#snippet secondColumn()} + {/snippet}
diff --git a/src/views/repo/Issue.svelte b/src/views/repo/Issue.svelte index a91de98f9..cd222a4d9 100644 --- a/src/views/repo/Issue.svelte +++ b/src/views/repo/Issue.svelte @@ -11,23 +11,19 @@ import { tick } from "svelte"; import * as roles from "@app/lib/roles"; - import { - issueStatusColor, - publicKeyFromDid, - scrollIntoView, - } from "@app/lib/utils"; import { invoke } from "@app/lib/invoke"; + import { publicKeyFromDid, scrollIntoView } from "@app/lib/utils"; import { announce } from "@app/components/AnnounceSwitch.svelte"; - import Border from "@app/components/Border.svelte"; - import IssueStateButton from "@app/components/IssueStateButton.svelte"; import CommentComponent from "@app/components/Comment.svelte"; import CommentToggleInput from "@app/components/CommentToggleInput.svelte"; import CopyableId from "@app/components/CopyableId.svelte"; import Icon from "@app/components/Icon.svelte"; import InlineTitle from "@app/components/InlineTitle.svelte"; import IssueMetadata from "@app/components/IssueMetadata.svelte"; + import IssueSecondColumn from "@app/components/IssueSecondColumn.svelte"; + import IssueStateButton from "@app/components/IssueStateButton.svelte"; import IssueTimelineLifecycleAction from "@app/components/IssueTimelineLifecycleAction.svelte"; import Link from "@app/components/Link.svelte"; import NodeId from "@app/components/NodeId.svelte"; @@ -35,6 +31,7 @@ import ThreadComponent from "@app/components/Thread.svelte"; import Layout from "./Layout.svelte"; + import Sidebar from "@app/components/Sidebar.svelte"; interface Props { repo: RepoInfo; @@ -62,9 +59,9 @@ let updatedTitle = $state(issue.title); // The view doesn't get destroyed when we switch between different issues in - // the sidebar and because of that the top-level state gets retained when the - // issue changes. This reactive statement makes sure we always load the new - // issue and reset the state to defaults. + // the second column and because of that the top-level state gets retained + // when the issue changes. This reactive statement makes sure we always load + // the new issue and reset the state to defaults. let issueId = issue.id; $effect(() => { if (issueId !== issue.id) { @@ -177,7 +174,7 @@ opts: { announce: $announce }, }); issue.title = updatedTitle; - // Update sidebar issue title without reloading the whole issue list. + // Update second colum issue title without reloading the whole issue list. const issueIndex = issues.findIndex(i => i.id === issue.id); if (issueIndex !== -1) { issues[issueIndex].title = updatedTitle; @@ -226,7 +223,7 @@ }, opts: { announce: $announce }, }); - // Update sidebar issue icon without reloading the whole issue list. + // Update second column issue icon without reloading the whole issue list. const issueIndex = issues.findIndex(i => i.id === issue.id); if (issueIndex !== -1) { issues[issueIndex].state = state; @@ -267,19 +264,8 @@ height: 100%; top: 0; } - .issue-teaser { - max-width: 11rem; - white-space: nowrap; - } - .issue-list { - margin-top: 0.5rem; - display: flex; - flex-direction: column; - gap: 0.5rem; - padding-bottom: 1rem; - } .content { - padding: 0 1rem 1rem 1rem; + padding: 0 1rem 1rem 0; } .connector { width: 2px; @@ -312,7 +298,11 @@
- Issues + + Issues + + + {issue.title} {/snippet} {#snippet headerCenter()} @@ -320,48 +310,11 @@ {/snippet} {#snippet sidebar()} - -
- -
- Issues -
-
- {project.meta.issues.open + project.meta.issues.closed} -
-
-
+ + {/snippet} -
- {#each issues as sidebarIssue} - -
-
- -
- - - -
- - {/each} -
+ {#snippet secondColumn()} + {/snippet}
diff --git a/src/views/repo/Issues.svelte b/src/views/repo/Issues.svelte index 0095533b3..8a22eef5b 100644 --- a/src/views/repo/Issues.svelte +++ b/src/views/repo/Issues.svelte @@ -5,17 +5,18 @@ import type { RepoInfo } from "@bindings/repo/RepoInfo"; import * as router from "@app/lib/router"; + import { issueStatusColor } from "@app/lib/utils"; import Layout from "./Layout.svelte"; - import Border from "@app/components/Border.svelte"; + import Button from "@app/components/Button.svelte"; import CopyableId from "@app/components/CopyableId.svelte"; import Icon from "@app/components/Icon.svelte"; import IssueTeaser from "@app/components/IssueTeaser.svelte"; + import IssuesSecondColumn from "@app/components/IssuesSecondColumn.svelte"; import Link from "@app/components/Link.svelte"; import NodeId from "@app/components/NodeId.svelte"; - import RepoHeader from "@app/components/RepoHeader.svelte"; - import Button from "@app/components/Button.svelte"; + import Sidebar from "@app/components/Sidebar.svelte"; interface Props { repo: RepoInfo; @@ -34,7 +35,7 @@ display: flex; flex-direction: column; gap: 2px; - padding: 0 1rem 1rem 1rem; + padding: 0 1rem 1rem 0; } .header { font-weight: var(--font-weight-medium); @@ -46,7 +47,7 @@ } - + {#snippet breadcrumbs()} - - + + {/snippet} -
- -
Issues
-
- {project.meta.issues.open + project.meta.issues.closed} -
- -
-
- - Open -
- {project.meta.issues.open} -
- - - Closed -
- {project.meta.issues.closed} -
- -
- -
- -
Patches
-
- {project.meta.patches.draft + - project.meta.patches.open + - project.meta.patches.archived + - project.meta.patches.merged} -
- + {#snippet secondColumn()} +
+
{/snippet} @@ -143,13 +100,14 @@
+
{#each issues as issue} {/each} {#if issues.length === 0} -
+
{#if status === "all"} No issues. {:else} diff --git a/src/views/repo/Layout.svelte b/src/views/repo/Layout.svelte index fb64ebe52..09ce0a496 100644 --- a/src/views/repo/Layout.svelte +++ b/src/views/repo/Layout.svelte @@ -1,32 +1,53 @@