mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-11-21 14:20:42 +08:00
Add tests for clipboard, issue listing and issues
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
</OutlineButton>
|
||||
<Popover popoverPositionRight="0" popoverPositionTop="3rem">
|
||||
{#snippet toggle(onclick)}
|
||||
<NakedButton variant="ghost" {onclick}>
|
||||
<NakedButton title="Settings" variant="ghost" {onclick}>
|
||||
<Icon name="settings" />
|
||||
</NakedButton>
|
||||
{/snippet}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import type { ComponentProps, Snippet } from "svelte";
|
||||
|
||||
import { debounce } from "lodash";
|
||||
import { writeText } from "@tauri-apps/plugin-clipboard-manager";
|
||||
import { writeToClipboard } from "@app/lib/invoke";
|
||||
|
||||
import { formatOid } from "@app/lib/utils";
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
}, 1000);
|
||||
|
||||
async function copy() {
|
||||
await writeText(clipboard);
|
||||
await writeToClipboard(clipboard);
|
||||
icon = "checkmark";
|
||||
tooltip = "Copied to clipboard";
|
||||
restoreIcon();
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
|
||||
interface Props {
|
||||
children: Snippet;
|
||||
title?: string;
|
||||
variant: "primary" | "secondary" | "ghost";
|
||||
onclick?: () => void;
|
||||
}
|
||||
|
||||
const { children, variant, onclick }: Props = $props();
|
||||
const { children, title, variant, onclick }: Props = $props();
|
||||
|
||||
const style = $derived(
|
||||
`--button-color-1: var(--color-fill-${variant});` +
|
||||
@@ -203,7 +204,7 @@
|
||||
</style>
|
||||
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<div class="container" {onclick} role="button" tabindex="0" {style}>
|
||||
<div class="container" {onclick} {title} role="button" tabindex="0" {style}>
|
||||
<div class="pixel p1-1"></div>
|
||||
<div class="pixel p1-2"></div>
|
||||
<div class="pixel p1-3"></div>
|
||||
|
||||
@@ -52,6 +52,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
<Id
|
||||
ariaLabel="repo-id"
|
||||
clipboard={repo.rid}
|
||||
shorten={false}
|
||||
variant="oid"
|
||||
|
||||
Reference in New Issue
Block a user