mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-29 10:10:30 +08:00
Tweak copyable IDs
This commit is contained in:
@@ -3,11 +3,11 @@
|
||||
|
||||
import { twemoji } from "@app/lib/utils";
|
||||
|
||||
import CommitLink from "@app/views/projects/components/CommitLink.svelte";
|
||||
import CompactCommitAuthorship from "@app/components/CompactCommitAuthorship.svelte";
|
||||
import ExpandButton from "@app/components/ExpandButton.svelte";
|
||||
import IconButton from "@app/components/IconButton.svelte";
|
||||
import IconSmall from "@app/components/IconSmall.svelte";
|
||||
import Id from "@app/components/Id.svelte";
|
||||
import InlineMarkdown from "@app/components/InlineMarkdown.svelte";
|
||||
import Link from "@app/components/Link.svelte";
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
{/if}
|
||||
<div class="global-hide-on-small-desktop-up">
|
||||
<CompactCommitAuthorship {commit}>
|
||||
<CommitLink {baseUrl} {projectId} commitId={commit.id} />
|
||||
<Id id={commit.id} style="commit" />
|
||||
</CompactCommitAuthorship>
|
||||
</div>
|
||||
</div>
|
||||
@@ -96,7 +96,7 @@
|
||||
<div style="display: flex; gap: 0.5rem; height: 21px; align-items: center;">
|
||||
<div class="global-hide-on-mobile-down">
|
||||
<CompactCommitAuthorship {commit}>
|
||||
<CommitLink {baseUrl} {projectId} commitId={commit.id} />
|
||||
<Id id={commit.id} style="commit" />
|
||||
</CompactCommitAuthorship>
|
||||
</div>
|
||||
<IconButton title="Browse repo at this commit">
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
flex-wrap: wrap;
|
||||
gap: 0.5rem;
|
||||
font-size: var(--font-size-small);
|
||||
font-family: var(--font-family-monospace);
|
||||
}
|
||||
.summary {
|
||||
display: flex;
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
import CobCommitTeaser from "@app/views/projects/Cob/CobCommitTeaser.svelte";
|
||||
import CommentComponent from "@app/components/Comment.svelte";
|
||||
import CommitLink from "@app/views/projects/components/CommitLink.svelte";
|
||||
import DiffStatBadge from "@app/components/DiffStatBadge.svelte";
|
||||
import DropdownList from "@app/components/DropdownList.svelte";
|
||||
import DropdownListItem from "@app/components/DropdownList/DropdownListItem.svelte";
|
||||
@@ -35,6 +34,7 @@
|
||||
import ReactionSelector from "@app/components/ReactionSelector.svelte";
|
||||
import Reactions from "@app/components/Reactions.svelte";
|
||||
import Thread from "@app/components/Thread.svelte";
|
||||
import Id from "@app/components/Id.svelte";
|
||||
|
||||
export let baseUrl: BaseUrl;
|
||||
export let initiallyExpanded: boolean = false;
|
||||
@@ -300,7 +300,7 @@
|
||||
<ExpandButton {expanded} on:toggle={() => (expanded = !expanded)} />
|
||||
<span>
|
||||
Revision
|
||||
<span class="global-oid">{utils.formatObjectId(revisionId)}</span>
|
||||
<Id id={revisionId} />
|
||||
</span>
|
||||
</div>
|
||||
<div class="revision-data">
|
||||
@@ -409,21 +409,16 @@
|
||||
style:padding="0 0.375rem">
|
||||
<IconSmall name="patch" />
|
||||
</div>
|
||||
<NodeId
|
||||
stylePopoverPositionLeft="-13px"
|
||||
nodeId={revisionAuthor.id}
|
||||
alias={revisionAuthor.alias} />
|
||||
<NodeId nodeId={revisionAuthor.id} alias={revisionAuthor.alias} />
|
||||
{#if patchId === revisionId}
|
||||
opened this patch on base
|
||||
<CommitLink {baseUrl} {projectId} commitId={revisionBase} />
|
||||
<Id id={revisionBase} style="commit" />
|
||||
{:else}
|
||||
updated to
|
||||
<span class="global-oid">
|
||||
{utils.formatObjectId(revisionId)}
|
||||
</span>
|
||||
<Id id={revisionId} />
|
||||
{#if previousRevBase && previousRevBase !== revisionBase}
|
||||
with base
|
||||
<CommitLink {baseUrl} {projectId} commitId={revisionBase} />
|
||||
<Id id={revisionBase} style="commit" />
|
||||
{/if}
|
||||
{/if}
|
||||
<span
|
||||
@@ -556,20 +551,14 @@
|
||||
</div>
|
||||
|
||||
<NodeId
|
||||
stylePopoverPositionLeft="-13px"
|
||||
nodeId={element.inner.author.id}
|
||||
alias={element.inner.author.alias}>
|
||||
</NodeId>
|
||||
|
||||
merged revision
|
||||
<span class="global-oid">
|
||||
{utils.formatObjectId(element.inner.revision)}
|
||||
</span>
|
||||
<Id id={element.inner.revision} />
|
||||
at commit
|
||||
<CommitLink
|
||||
{baseUrl}
|
||||
{projectId}
|
||||
commitId={element.inner.commit} />
|
||||
<Id id={element.inner.commit} style="commit" />
|
||||
<span
|
||||
class="timestamp"
|
||||
title={utils.absoluteTimestamp(revisionTimestamp)}>
|
||||
@@ -593,9 +582,7 @@
|
||||
body={review.summary ?? ""}>
|
||||
<div slot="caption">
|
||||
{formatVerdict(review.verdict)}
|
||||
<span class="global-oid">
|
||||
{utils.formatObjectId(revisionId)}
|
||||
</span>
|
||||
<Id id={revisionId} />
|
||||
</div>
|
||||
<div slot="icon" style:color={verdictIconColor(review.verdict)}>
|
||||
{#if review.verdict === "accept"}
|
||||
|
||||
@@ -1,17 +1,15 @@
|
||||
<script lang="ts">
|
||||
import type { BaseUrl, Commit, Node, Project } from "@http-client";
|
||||
|
||||
import { formatCommit } from "@app/lib/utils";
|
||||
|
||||
import Button from "@app/components/Button.svelte";
|
||||
import Changeset from "@app/views/projects/Changeset.svelte";
|
||||
import CommitAuthorship from "@app/views/projects/Commit/CommitAuthorship.svelte";
|
||||
import CopyableId from "@app/components/CopyableId.svelte";
|
||||
import IconSmall from "@app/components/IconSmall.svelte";
|
||||
import InlineMarkdown from "@app/components/InlineMarkdown.svelte";
|
||||
import Layout from "./Layout.svelte";
|
||||
import Link from "@app/components/Link.svelte";
|
||||
import Share from "./Share.svelte";
|
||||
import Id from "@app/components/Id.svelte";
|
||||
|
||||
export let baseUrl: BaseUrl;
|
||||
export let node: Node;
|
||||
@@ -73,9 +71,7 @@
|
||||
</div>
|
||||
</span>
|
||||
<CommitAuthorship {header}>
|
||||
<CopyableId id={header.id} style="commit">
|
||||
{formatCommit(header.id)}
|
||||
</CopyableId>
|
||||
<Id id={header.id} style="commit" ariaLabel="commit-id" />
|
||||
</CommitAuthorship>
|
||||
</div>
|
||||
{#if header.description}
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
import { twemoji } from "@app/lib/utils";
|
||||
|
||||
import CommitAuthorship from "./CommitAuthorship.svelte";
|
||||
import CommitLink from "@app/views/projects/components/CommitLink.svelte";
|
||||
import ExpandButton from "@app/components/ExpandButton.svelte";
|
||||
import IconButton from "@app/components/IconButton.svelte";
|
||||
import IconSmall from "@app/components/IconSmall.svelte";
|
||||
import InlineMarkdown from "@app/components/InlineMarkdown.svelte";
|
||||
import Link from "@app/components/Link.svelte";
|
||||
import Id from "@app/components/Id.svelte";
|
||||
|
||||
export let baseUrl: BaseUrl;
|
||||
export let commit: CommitHeader;
|
||||
@@ -104,7 +104,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
<CommitAuthorship header={commit}>
|
||||
<CommitLink {baseUrl} {projectId} commitId={commit.id} />
|
||||
<Id id={commit.id} style="commit" />
|
||||
</CommitAuthorship>
|
||||
</div>
|
||||
<div class="right">
|
||||
|
||||
@@ -32,11 +32,11 @@
|
||||
import CobHeader from "@app/views/projects/Cob/CobHeader.svelte";
|
||||
import CobStateButton from "@app/views/projects/Cob/CobStateButton.svelte";
|
||||
import CommentToggleInput from "@app/components/CommentToggleInput.svelte";
|
||||
import CopyableId from "@app/components/CopyableId.svelte";
|
||||
import Embeds from "@app/views/projects/Cob/Embeds.svelte";
|
||||
import ErrorModal from "@app/modals/ErrorModal.svelte";
|
||||
import ExtendedTextarea from "@app/components/ExtendedTextarea.svelte";
|
||||
import IconSmall from "@app/components/IconSmall.svelte";
|
||||
import Id from "@app/components/Id.svelte";
|
||||
import InlineMarkdown from "@app/components/InlineMarkdown.svelte";
|
||||
import LabelInput from "./Cob/LabelInput.svelte";
|
||||
import Layout from "./Layout.svelte";
|
||||
@@ -547,14 +547,9 @@
|
||||
{issue.state.reason}
|
||||
</Badge>
|
||||
{/if}
|
||||
<NodeId
|
||||
stylePopoverPositionLeft="-13px"
|
||||
nodeId={issue.author.id}
|
||||
alias={issue.author.alias} />
|
||||
<NodeId nodeId={issue.author.id} alias={issue.author.alias} />
|
||||
opened
|
||||
<CopyableId id={issue.id} style="oid">
|
||||
{utils.formatObjectId(issue.id)}
|
||||
</CopyableId>
|
||||
<Id id={issue.id} />
|
||||
<span title={utils.absoluteTimestamp(issue.discussion[0].timestamp)}>
|
||||
{utils.formatTimestamp(issue.discussion[0].timestamp)}
|
||||
</span>
|
||||
|
||||
@@ -1,11 +1,7 @@
|
||||
<script lang="ts">
|
||||
import type { BaseUrl, Issue } from "@http-client";
|
||||
|
||||
import {
|
||||
absoluteTimestamp,
|
||||
formatObjectId,
|
||||
formatTimestamp,
|
||||
} from "@app/lib/utils";
|
||||
import { absoluteTimestamp, formatTimestamp } from "@app/lib/utils";
|
||||
|
||||
import IconSmall from "@app/components/IconSmall.svelte";
|
||||
import InlineMarkdown from "@app/components/InlineMarkdown.svelte";
|
||||
@@ -14,6 +10,7 @@
|
||||
|
||||
import CommentCounter from "../CommentCounter.svelte";
|
||||
import Labels from "../Cob/Labels.svelte";
|
||||
import Id from "@app/components/Id.svelte";
|
||||
|
||||
export let baseUrl: BaseUrl;
|
||||
export let issue: Issue;
|
||||
@@ -123,12 +120,9 @@
|
||||
{/if}
|
||||
<div
|
||||
style="display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;">
|
||||
<NodeId
|
||||
stylePopoverPositionLeft="-13px"
|
||||
nodeId={issue.author.id}
|
||||
alias={issue.author.alias} />
|
||||
<NodeId nodeId={issue.author.id} alias={issue.author.alias} />
|
||||
opened
|
||||
<span class="global-oid">{formatObjectId(issue.id)}</span>
|
||||
<Id id={issue.id} />
|
||||
<span title={absoluteTimestamp(issue.discussion[0].timestamp)}>
|
||||
{formatTimestamp(issue.discussion[0].timestamp)}
|
||||
</span>
|
||||
|
||||
@@ -52,12 +52,13 @@
|
||||
import * as role from "@app/lib/roles";
|
||||
import * as router from "@app/lib/router";
|
||||
import * as utils from "@app/lib/utils";
|
||||
import { experimental } from "@app/lib/appearance";
|
||||
import capitalize from "lodash/capitalize";
|
||||
import isEqual from "lodash/isEqual";
|
||||
import partial from "lodash/partial";
|
||||
import uniqBy from "lodash/uniqBy";
|
||||
import { HttpdClient } from "@http-client";
|
||||
import { closeFocused } from "@app/components/Popover.svelte";
|
||||
import { experimental } from "@app/lib/appearance";
|
||||
import { httpdStore } from "@app/lib/httpd";
|
||||
import { parseEmbedIntoMap } from "@app/lib/file";
|
||||
|
||||
@@ -68,12 +69,12 @@
|
||||
import CobStateButton from "@app/views/projects/Cob/CobStateButton.svelte";
|
||||
import CommentToggleInput from "@app/components/CommentToggleInput.svelte";
|
||||
import CompareButton from "@app/views/projects/Patch/CompareButton.svelte";
|
||||
import CopyableId from "@app/components/CopyableId.svelte";
|
||||
import DiffStatBadge from "@app/components/DiffStatBadge.svelte";
|
||||
import Embeds from "@app/views/projects/Cob/Embeds.svelte";
|
||||
import ErrorModal from "@app/modals/ErrorModal.svelte";
|
||||
import ExtendedTextarea from "@app/components/ExtendedTextarea.svelte";
|
||||
import IconSmall from "@app/components/IconSmall.svelte";
|
||||
import Id from "@app/components/Id.svelte";
|
||||
import InlineMarkdown from "@app/components/InlineMarkdown.svelte";
|
||||
import LabelInput from "@app/views/projects/Cob/LabelInput.svelte";
|
||||
import Layout from "@app/views/projects/Layout.svelte";
|
||||
@@ -89,7 +90,6 @@
|
||||
import RevisionSelector from "@app/views/projects/Patch/RevisionSelector.svelte";
|
||||
import Share from "@app/views/projects/Share.svelte";
|
||||
import TextInput from "@app/components/TextInput.svelte";
|
||||
import { closeFocused } from "@app/components/Popover.svelte";
|
||||
|
||||
export let baseUrl: BaseUrl;
|
||||
export let node: Node;
|
||||
@@ -775,14 +775,9 @@
|
||||
insertions={stats.insertions}
|
||||
deletions={stats.deletions} />
|
||||
</Link>
|
||||
<NodeId
|
||||
stylePopoverPositionLeft="-13px"
|
||||
nodeId={patch.author.id}
|
||||
alias={patch.author.alias} />
|
||||
<NodeId nodeId={patch.author.id} alias={patch.author.alias} />
|
||||
opened
|
||||
<CopyableId id={patch.id} style="oid">
|
||||
{utils.formatObjectId(patch.id)}
|
||||
</CopyableId>
|
||||
<Id id={patch.id} />
|
||||
<span title={utils.absoluteTimestamp(patch.revisions[0].timestamp)}>
|
||||
{utils.formatTimestamp(patch.revisions[0].timestamp)}
|
||||
</span>
|
||||
|
||||
@@ -2,20 +2,17 @@
|
||||
import type { BaseUrl } from "@http-client";
|
||||
import type { Patch } from "@http-client";
|
||||
|
||||
import {
|
||||
absoluteTimestamp,
|
||||
formatObjectId,
|
||||
formatTimestamp,
|
||||
} from "@app/lib/utils";
|
||||
import { absoluteTimestamp, formatTimestamp } from "@app/lib/utils";
|
||||
|
||||
import IconSmall from "@app/components/IconSmall.svelte";
|
||||
import InlineMarkdown from "@app/components/InlineMarkdown.svelte";
|
||||
import Link from "@app/components/Link.svelte";
|
||||
import NodeId from "@app/components/NodeId.svelte";
|
||||
|
||||
import Labels from "../Cob/Labels.svelte";
|
||||
import DiffStatBadgeLoader from "../DiffStatBadgeLoader.svelte";
|
||||
import CommentCounter from "../CommentCounter.svelte";
|
||||
import DiffStatBadgeLoader from "../DiffStatBadgeLoader.svelte";
|
||||
import Id from "@app/components/Id.svelte";
|
||||
import Labels from "../Cob/Labels.svelte";
|
||||
|
||||
export let projectId: string;
|
||||
export let baseUrl: BaseUrl;
|
||||
@@ -137,17 +134,12 @@
|
||||
{/if}
|
||||
<div
|
||||
style="display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;">
|
||||
<NodeId
|
||||
stylePopoverPositionLeft="-13px"
|
||||
nodeId={patch.author.id}
|
||||
alias={patch.author.alias} />
|
||||
<NodeId nodeId={patch.author.id} alias={patch.author.alias} />
|
||||
{patch.revisions.length > 1 ? "updated" : "opened"}
|
||||
<span class="global-oid">{formatObjectId(patch.id)}</span>
|
||||
<Id id={patch.id} />
|
||||
{#if patch.revisions.length > 1}
|
||||
<span class="global-hide-on-mobile-down">
|
||||
to <span class="global-oid">
|
||||
{formatObjectId(patch.revisions[patch.revisions.length - 1].id)}
|
||||
</span>
|
||||
to <Id id={patch.revisions[patch.revisions.length - 1].id} />
|
||||
</span>
|
||||
{/if}
|
||||
<span title={absoluteTimestamp(latestRevision.timestamp)}>
|
||||
|
||||
@@ -61,7 +61,12 @@
|
||||
<ShareButton slot="popover" />
|
||||
</Popover>
|
||||
{:else}
|
||||
<Button variant="outline" size="regular" on:click={copy}>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="regular"
|
||||
on:click={async () => {
|
||||
await copy();
|
||||
}}>
|
||||
<IconSmall name={shareIcon} />
|
||||
<span class="global-hide-on-small-desktop-down">Copy link</span>
|
||||
</Button>
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<script lang="ts">
|
||||
import type { BaseUrl, Node, Project } from "@http-client";
|
||||
|
||||
import { capitalize } from "lodash";
|
||||
import { isLocal } from "@app/lib/utils";
|
||||
|
||||
import IconButton from "@app/components/IconButton.svelte";
|
||||
import IconSmall from "@app/components/IconSmall.svelte";
|
||||
import NodeId from "@app/components/NodeId.svelte";
|
||||
import Popover from "@app/components/Popover.svelte";
|
||||
import ScopePolicyExplainer from "@app/components/ScopePolicyExplainer.svelte";
|
||||
import { isLocal } from "@app/lib/utils";
|
||||
import { capitalize } from "lodash";
|
||||
|
||||
export let disablePopovers: boolean = false;
|
||||
export let project: Project;
|
||||
@@ -86,7 +87,7 @@
|
||||
<div class="nids">
|
||||
{#each project.delegates as { id: nodeId, alias }}
|
||||
<div style:width="fit-content">
|
||||
<NodeId {alias} {nodeId} stylePopoverPositionLeft="-0.8rem" />
|
||||
<NodeId {alias} {nodeId} />
|
||||
</div>
|
||||
{/each}
|
||||
</div>
|
||||
@@ -119,11 +120,5 @@
|
||||
policy={node.config.policy} />
|
||||
</div>
|
||||
{/if}
|
||||
<div class="item txt-overflow" style:padding-top="0.5rem">
|
||||
Radicle version
|
||||
<span class="txt-missing txt-overflow txt-monospace" title={node.version}>
|
||||
{node.version}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,15 +6,14 @@
|
||||
import { formatNodeId } from "@app/lib/utils";
|
||||
import { httpdStore } from "@app/lib/httpd";
|
||||
|
||||
import NodeId from "@app/components/NodeId.svelte";
|
||||
import Avatar from "@app/components/Avatar.svelte";
|
||||
import Badge from "@app/components/Badge.svelte";
|
||||
import Button from "@app/components/Button.svelte";
|
||||
import DropdownList from "@app/components/DropdownList.svelte";
|
||||
import DropdownListItem from "@app/components/DropdownList/DropdownListItem.svelte";
|
||||
import Popover from "@app/components/Popover.svelte";
|
||||
import IconSmall from "@app/components/IconSmall.svelte";
|
||||
import Link from "@app/components/Link.svelte";
|
||||
import Button from "@app/components/Button.svelte";
|
||||
import Avatar from "@app/components/Avatar.svelte";
|
||||
import Popover from "@app/components/Popover.svelte";
|
||||
|
||||
export let peers: Array<{ remote: Remote; selected: boolean; route: Route }>;
|
||||
export let project: Project;
|
||||
@@ -48,22 +47,27 @@
|
||||
popoverPositionTop="2.5rem"
|
||||
popoverBorderRadius="var(--border-radius-small)">
|
||||
<Button
|
||||
ariaLabel="Change peer"
|
||||
slot="toggle"
|
||||
let:expanded
|
||||
let:toggle
|
||||
styleBorderRadius="var(--border-radius-tiny) 0 0 var(--border-radius-tiny)"
|
||||
on:click={toggle}
|
||||
title="Change peer"
|
||||
title={selectedPeer ? formatNodeId(selectedPeer.id) : "Change peer"}
|
||||
disabled={!peers}>
|
||||
{#if !selectedPeer}
|
||||
<IconSmall name="delegate" />
|
||||
{/if}
|
||||
|
||||
{#if selectedPeer}
|
||||
<NodeId
|
||||
nodeId={selectedPeer.id}
|
||||
alias={selectedPeer.alias}
|
||||
stylePopoverPositionLeft="-0.75rem" />
|
||||
<div style:height="1rem">
|
||||
<Avatar nodeId={selectedPeer.id} />
|
||||
</div>
|
||||
<span
|
||||
style:font-family="var(--font-family-monospace)"
|
||||
class:no-alias={!selectedPeer.alias}>
|
||||
{selectedPeer.alias || formatNodeId(selectedPeer.id)}
|
||||
</span>
|
||||
{#if selectedPeer.delegate}
|
||||
<Badge size="tiny" variant="delegate">
|
||||
<IconSmall name="badge" />
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
|
||||
import Badge from "@app/components/Badge.svelte";
|
||||
import CloneButton from "@app/views/projects/Header/CloneButton.svelte";
|
||||
import CopyableId from "@app/components/CopyableId.svelte";
|
||||
import IconSmall from "@app/components/IconSmall.svelte";
|
||||
import Id from "@app/components/Id.svelte";
|
||||
import InlineMarkdown from "@app/components/InlineMarkdown.svelte";
|
||||
import Link from "@app/components/Link.svelte";
|
||||
import SeedButton from "@app/views/projects/Header/SeedButton.svelte";
|
||||
@@ -90,7 +90,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="id">
|
||||
<CopyableId id={project.id} style="oid" />
|
||||
<Id shorten={false} id={project.id} ariaLabel="project-id" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="description" use:twemoji>
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
<script lang="ts">
|
||||
import type { BaseUrl } from "@http-client";
|
||||
|
||||
import { formatCommit } from "@app/lib/utils";
|
||||
import Link from "@app/components/Link.svelte";
|
||||
|
||||
export let baseUrl: BaseUrl;
|
||||
export let projectId: string;
|
||||
export let commitId: string;
|
||||
</script>
|
||||
|
||||
<Link
|
||||
route={{
|
||||
resource: "project.commit",
|
||||
node: baseUrl,
|
||||
project: projectId,
|
||||
commit: commitId,
|
||||
}}>
|
||||
<span class="global-commit">
|
||||
{formatCommit(commitId)}
|
||||
</span>
|
||||
</Link>
|
||||
Reference in New Issue
Block a user