Skip to content

Commit

Permalink
Redesign node view
Browse files Browse the repository at this point in the history
  • Loading branch information
rudolfs committed Jul 3, 2024
1 parent 1669345 commit 9cc66ef
Show file tree
Hide file tree
Showing 19 changed files with 427 additions and 206 deletions.
2 changes: 2 additions & 0 deletions http-client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import type {
Revision,
Verdict,
} from "./lib/project/patch.js";
import type { Profile } from "./lib/profile.js";
import type { RequestOptions } from "./lib/fetcher.js";
import type { ZodSchema } from "zod";

Expand Down Expand Up @@ -81,6 +82,7 @@ export type {
PatchState,
PatchUpdateAction,
Project,
Profile,
ProjectListQuery,
Range,
Reaction,
Expand Down
6 changes: 6 additions & 0 deletions http-client/lib/profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ const profileSchema = object({
publicExplorer: string(),
preferredSeeds: array(string()),
cli: object({ hints: boolean() }),
web: object({
pinned: object({ repositories: array(string()) }),
imageUrl: string().optional(),
name: string().optional(),
description: string().optional(),
}),
node: nodeConfigSchema,
}),
home: string(),
Expand Down
Binary file added public/images/aliens.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions src/App/AppLayout.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
import Footer from "@app/App/Footer.svelte";
import Header from "@app/App/Header.svelte";
import MobileFooter from "@app/App/MobileFooter.svelte";
export let styleHeaderBorderBottom: string =
"1px solid var(--color-fill-separator)";
</script>

<style>
Expand All @@ -10,9 +13,6 @@
flex-direction: column;
height: 100%;
}
.header {
border-bottom: 1px solid var(--color-fill-separator);
}
.content {
height: 100%;
overflow-y: scroll;
Expand All @@ -30,7 +30,9 @@
</style>

<div class="app">
<div class="global-hide-on-mobile-down header">
<div
class="global-hide-on-mobile-down header"
style:border-bottom={styleHeaderBorderBottom}>
<Header />
</div>
<div class="content">
Expand Down
6 changes: 1 addition & 5 deletions src/App/Header/Breadcrumbs.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,8 @@
}
</style>

{#if $activeRouteStore.resource === "booting" || $activeRouteStore.resource === "home" || $activeRouteStore.resource === "session" || $activeRouteStore.resource === "error" || $activeRouteStore.resource === "notFound"}
{#if $activeRouteStore.resource === "booting" || $activeRouteStore.resource === "home" || $activeRouteStore.resource === "session" || $activeRouteStore.resource === "error" || $activeRouteStore.resource === "notFound" || $activeRouteStore.resource === "nodes"}
<!-- Don't render breadcrumbs for these routes. -->
{:else if $activeRouteStore.resource === "nodes"}
<div class="breadcrumbs">
<NodeSegment baseUrl={$activeRouteStore.params.baseUrl} showLocalNode />
</div>
{:else if $activeRouteStore.resource === "project.source" || $activeRouteStore.resource === "project.history" || $activeRouteStore.resource === "project.commit" || $activeRouteStore.resource === "project.issues" || $activeRouteStore.resource === "project.newIssue" || $activeRouteStore.resource === "project.issue" || $activeRouteStore.resource === "project.patches" || $activeRouteStore.resource === "project.patch"}
<div class="breadcrumbs">
<NodeSegment baseUrl={$activeRouteStore.params.baseUrl} />
Expand Down
76 changes: 76 additions & 0 deletions src/views/nodes/NodeInfo.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<script lang="ts">
import type { DefaultSeedingPolicy } from "@http-client";
import IconButton from "@app/components/IconButton.svelte";
import IconSmall from "@app/components/IconSmall.svelte";
import Id from "@app/components/Id.svelte";
import ScopePolicyExplainer from "@app/components/ScopePolicyExplainer.svelte";
import { capitalize } from "lodash";
import { formatUserAgent } from "@app/lib/utils";
export let agent: string;
export let seedingPolicy: DefaultSeedingPolicy | undefined = undefined;
let expandedNode = false;
$: shortScope =
seedingPolicy?.default === "allow" && seedingPolicy?.scope === "all"
? "permissive"
: "restrictive";
</script>

<style>
.agent {
color: var(--color-fill-gray);
font-family: var(--font-family-monospace);
font-size: var(--font-size-small);
}
.policies {
font-size: var(--font-size-small);
display: flex;
flex-direction: column;
}
.item {
display: flex;
flex-wrap: nowrap;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
}
</style>

<div class="policies">
<div class="item">
<div class="item" style="justify-content: flex-start;">
<span class="no-wrap">Seeding Policy</span>
</div>
<div
style="display: flex; flex-direction: row; gap: 0.5rem; align-items: center;">
<div class="txt-bold">
{capitalize(shortScope)}
</div>
<IconButton on:click={() => (expandedNode = !expandedNode)}>
<IconSmall name={`chevron-${expandedNode ? "down" : "right"}`} />
</IconButton>
</div>
</div>
{#if expandedNode && seedingPolicy}
<div style:padding="0 0 1rem 1rem">
<ScopePolicyExplainer {seedingPolicy} />
</div>
{/if}
</div>
<div
class="item"
style="justify-content: space-between; display: flex; text-wrap: nowrap; font-size: var(--font-size-small); ">
<span>Radicle version</span>
<Id
ariaLabel="agent"
id={formatUserAgent(agent)}
shorten={false}
style="none">
<div class="agent" style="width: 10rem;">
<div class="txt-overflow">{formatUserAgent(agent)}</div>
</div>
</Id>
</div>
63 changes: 0 additions & 63 deletions src/views/nodes/ScopePolicyPopover.svelte

This file was deleted.

Loading

0 comments on commit 9cc66ef

Please sign in to comment.