Skip to content

Commit f3f4e1d

Browse files
authored
show-ships-for-some-actions (#10456)
* fix(ui): remove max-width from ChipToast to allow flexible width * feat(toast): show success chip toasts after push and PR create
1 parent 3686099 commit f3f4e1d

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

apps/desktop/src/components/PushButton.svelte

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
Modal,
2323
TestId,
2424
SimpleCommitRow,
25-
ScrollableContainer
25+
ScrollableContainer,
26+
chipToasts
2627
} from '@gitbutler/ui';
2728
import { isDefined } from '@gitbutler/ui/utils/typeguards';
2829
@@ -88,6 +89,13 @@
8889
.filter(isDefined);
8990
if (upstreamBranchNames.length === 0) return;
9091
uiState.project(projectId).branchesToPoll.add(...upstreamBranchNames);
92+
93+
// Show success notification
94+
const branchText =
95+
multipleBranches && !isLastBranchInStack
96+
? `${branchName} and all branches below it`
97+
: branchName;
98+
chipToasts.success(`Pushed ${branchText} successfully`);
9199
} catch (error: any) {
92100
if (error?.code === 'errors.git.force_push_protection') {
93101
forcePushProtectionModal?.show();

apps/desktop/src/components/ReviewCreation.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@
317317
if (definedPrNumbers.length > 0) {
318318
updatePrStackInfo(prService, definedPrNumbers);
319319
}
320+
321+
// Show success notification
322+
const unit = prService.unit.abbr || 'PR';
323+
chipToasts.success(`${unit} #${pr.number} created successfully`);
324+
325+
return pr;
320326
} catch (err: any) {
321327
console.error(err);
322328
const toast = mapErrorToToast(err);

packages/ui/src/lib/components/chipToast/ChipToast.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
--toast-padding: 8px 12px;
8181
display: flex;
8282
width: fit-content;
83-
max-width: 400px;
8483
border-radius: var(--radius-m);
8584
background: var(--clr-scale-ntrl-10);
8685
box-shadow: var(--fx-shadow-m);

0 commit comments

Comments
 (0)