Skip to content

Commit 27c7ab3

Browse files
authored
Merge pull request #10389 from gitbutlerapp/move-clipboard-to-ui-package
Move clipboard to UI package
2 parents cefdc9d + 837fc66 commit 27c7ab3

File tree

9 files changed

+22
-10
lines changed

9 files changed

+22
-10
lines changed

apps/desktop/src/components/InfoMessage.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
</script>
55

66
<script lang="ts">
7-
import { copyToClipboard } from '@gitbutler/shared/clipboard';
8-
97
import { Button, Icon } from '@gitbutler/ui';
8+
import { copyToClipboard } from '@gitbutler/ui/utils/clipboard';
9+
1010
import type iconsJson from '@gitbutler/ui/data/icons.json';
1111
import type { Snippet } from 'svelte';
1212

apps/desktop/src/components/RuleFiltersEditor.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
type RuleFilterMap
1313
} from '$lib/rules/rule';
1414
import { typedKeys } from '$lib/utils/object';
15-
import { copyToClipboard } from '@gitbutler/shared/clipboard';
1615
import { Button, Select, SelectItem, Textbox, Icon, FileStatusBadge } from '@gitbutler/ui';
16+
import { copyToClipboard } from '@gitbutler/ui/utils/clipboard';
1717
import type { FileStatus } from '@gitbutler/ui/components/file/types';
1818
1919
const FILE_STATUS_OPTIONS: FileStatus[] = ['addition', 'modification', 'deletion', 'rename'];

apps/desktop/src/components/profileSettings/CliSymLink.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script lang="ts">
22
import { CLI_MANAGER } from '$lib/cli/cli';
33
import { inject } from '@gitbutler/core/context';
4-
import { copyToClipboard } from '@gitbutler/shared/clipboard';
54
import { Icon } from '@gitbutler/ui';
5+
import { copyToClipboard } from '@gitbutler/ui/utils/clipboard';
66
77
interface Props {
88
class?: string;

apps/web/src/lib/components/chat/MessageContextMenu.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<script lang="ts">
22
import RulesModal from '$lib/components/rules/RulesModal.svelte';
3-
import { copyToClipboard } from '@gitbutler/shared/clipboard';
4-
53
import { ContextMenu, ContextMenuItem, ContextMenuSection } from '@gitbutler/ui';
4+
import { copyToClipboard } from '@gitbutler/ui/utils/clipboard';
5+
66
import type { ChatMessage } from '@gitbutler/shared/chat/types';
77
88
type Props = {

apps/web/src/lib/components/review/ReviewInfo.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import { inject } from '@gitbutler/core/context';
55
import { getChatChannelParticipants } from '@gitbutler/shared/chat/chatChannelsPreview.svelte';
66
import { CHAT_CHANNELS_SERVICE } from '@gitbutler/shared/chat/chatChannelsService';
7-
import { copyToClipboard } from '@gitbutler/shared/clipboard';
87
import {
98
getUsersWithAvatars,
109
getPatchApproversWithAvatars,
@@ -15,6 +14,7 @@
1514
import { type PatchCommit } from '@gitbutler/shared/patches/types';
1615
import { APP_STATE } from '@gitbutler/shared/redux/store.svelte';
1716
import { AvatarGroup, Icon } from '@gitbutler/ui';
17+
import { copyToClipboard } from '@gitbutler/ui/utils/clipboard';
1818
1919
const NO_REVIEWERS = 'Not reviewed yet';
2020
const NO_CONTRIBUTORS = 'No contributors';

apps/web/src/lib/diff/lineSelection.svelte.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { copyToClipboard } from '@gitbutler/shared/clipboard';
1+
import { copyToClipboard } from '@gitbutler/ui/utils/clipboard';
22
import {
33
readDiffLineKey,
44
type DiffLineKey,

apps/web/src/routes/(app)/[ownerSlug]/[projectSlug]/reviews/[branchId]/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import { lookupLatestBranchUuid } from '@gitbutler/shared/branches/latestBranchLookup.svelte';
1515
import { LATEST_BRANCH_LOOKUP_SERVICE } from '@gitbutler/shared/branches/latestBranchLookupService';
1616
import { BranchStatus, type Branch } from '@gitbutler/shared/branches/types';
17-
import { copyToClipboard } from '@gitbutler/shared/clipboard';
1817
import { getContributorsWithAvatars } from '@gitbutler/shared/contributors';
1918
import Loading from '@gitbutler/shared/network/Loading.svelte';
2019
import { isFound, and, isError, map } from '@gitbutler/shared/network/loadable';
@@ -38,6 +37,7 @@
3837
import FileUploadPlugin, {
3938
type DropFileResult
4039
} from '@gitbutler/ui/richText/plugins/FileUpload.svelte';
40+
import { copyToClipboard } from '@gitbutler/ui/utils/clipboard';
4141
import dayjs from 'dayjs';
4242
import relativeTime from 'dayjs/plugin/relativeTime';
4343

crates/gitbutler-branch-actions/src/upstream_integration.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use crate::{r#virtual::IsCommitIntegrated, BranchManagerExt, VirtualBranchesExt
33
use anyhow::{anyhow, bail, Context, Result};
44
use but_core::Reference;
55
use but_rebase::{RebaseOutput, RebaseStep};
6+
use but_workspace::ref_info::Options;
67
use but_workspace::stack_ext::StackExt;
78
use gitbutler_command_context::CommandContext;
89
use gitbutler_commit::commit_ext::CommitExt as _;
@@ -185,6 +186,17 @@ impl<'a> UpstreamIntegrationContext<'a> {
185186
permission: &'a mut WorktreeWritePermission,
186187
gix_repo: &'a gix::Repository,
187188
) -> Result<Self> {
189+
let meta = ctx.meta(permission.read_permission())?;
190+
let repo = ctx.gix_repo()?;
191+
let _ref_info = but_workspace::head_info(
192+
&repo,
193+
&*meta,
194+
Options {
195+
expensive_commit_info: true,
196+
traversal: meta.graph_options(),
197+
},
198+
)?;
199+
188200
let virtual_branches_handle = ctx.project().virtual_branches();
189201
let target = virtual_branches_handle.get_default_target()?;
190202
let repo = ctx.repo();

packages/shared/src/lib/clipboard.ts renamed to packages/ui/src/lib/utils/clipboard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { chipToasts } from '@gitbutler/ui';
1+
import { chipToasts } from '$components/chipToast/chipToastStore';
22

33
export function copyToClipboard(text: string) {
44
if (!navigator.clipboard) {

0 commit comments

Comments
 (0)