@agimon-ai/po-git 0.0.0-alpha.192 → 0.0.0-alpha.194
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@ import { createApiClient, defineActivityGroup, defineChannelFile, defineFill, de
|
|
|
2
2
|
import { View } from "react-native-unistyles/components/native/View";
|
|
3
3
|
import { Text } from "react-native-unistyles/components/native/Text";
|
|
4
4
|
import { ScrollView } from "react-native-unistyles/components/native/ScrollView";
|
|
5
|
-
import { AlertIcon, Badge, BranchIcon, Button, CheckIcon, ChevronRightIcon, Dot, FileIcon, Input, Label, ListRow, MessageIcon, SegmentedControl, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, Spinner, SyntaxLine, Textarea, fontOf } from "@agimon-ai/po-native-components";
|
|
5
|
+
import { AlertIcon, Badge, BranchIcon, Button, CheckIcon, ChevronRightIcon, Dot, EmptyState, FileIcon, Input, Label, ListRow, MessageIcon, SegmentedControl, Sheet, SheetBody, SheetContent, SheetHeader, SheetTitle, Spinner, SyntaxLine, Textarea, fontOf } from "@agimon-ai/po-native-components";
|
|
6
6
|
import { createElement, memo, useCallback, useEffect, useEffectEvent, useMemo, useRef, useState, useSyncExternalStore } from "react";
|
|
7
7
|
import { StyleSheet, useUnistyles } from "react-native-unistyles";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -639,13 +639,13 @@ function worktreesTab() {
|
|
|
639
639
|
panel: WorktreesPanel
|
|
640
640
|
};
|
|
641
641
|
}
|
|
642
|
-
function WorktreesHeader({ activity = false, onNew, disabled = false }) {
|
|
642
|
+
function WorktreesHeader({ activity = false, onNew, disabled = false, showNew = true }) {
|
|
643
643
|
return /* @__PURE__ */ jsxs(View, {
|
|
644
644
|
style: styles$2.header,
|
|
645
645
|
children: [/* @__PURE__ */ jsx(Text, {
|
|
646
646
|
style: styles$2.title,
|
|
647
647
|
children: activity ? "Activity" : "Worktrees"
|
|
648
|
-
}), !activity ? /* @__PURE__ */ jsx(Button, {
|
|
648
|
+
}), !activity && showNew ? /* @__PURE__ */ jsx(Button, {
|
|
649
649
|
testID: "git-worktree-create",
|
|
650
650
|
variant: "ghost",
|
|
651
651
|
style: styles$2.newPill,
|
|
@@ -814,6 +814,8 @@ function WorktreeForm({ close = false, branch = "", baseRef = "", onBranch, onBa
|
|
|
814
814
|
}
|
|
815
815
|
function WorktreesView({ state, disabled = false, onNew, onClose, onOpen }) {
|
|
816
816
|
const { working, attention, starting, closeErrorId } = worktreesPresentation(state);
|
|
817
|
+
const empty = state.worktrees.length === 0 && !starting;
|
|
818
|
+
const busy = disabled || !!state.pending;
|
|
817
819
|
const row = (item) => /* @__PURE__ */ jsx(WorktreeRow, {
|
|
818
820
|
item,
|
|
819
821
|
disabled: disabled || !!state.pending,
|
|
@@ -825,10 +827,11 @@ function WorktreesView({ state, disabled = false, onNew, onClose, onOpen }) {
|
|
|
825
827
|
style: styles$2.screen,
|
|
826
828
|
children: [
|
|
827
829
|
/* @__PURE__ */ jsx(WorktreesHeader, {
|
|
828
|
-
disabled:
|
|
829
|
-
onNew
|
|
830
|
+
disabled: busy,
|
|
831
|
+
onNew,
|
|
832
|
+
showNew: !empty
|
|
830
833
|
}),
|
|
831
|
-
|
|
834
|
+
!empty ? /* @__PURE__ */ jsxs(View, {
|
|
832
835
|
style: styles$2.content,
|
|
833
836
|
children: [
|
|
834
837
|
/* @__PURE__ */ jsx(WorktreeGroup, {
|
|
@@ -853,15 +856,17 @@ function WorktreesView({ state, disabled = false, onNew, onClose, onOpen }) {
|
|
|
853
856
|
attention.map(row)
|
|
854
857
|
] }) : null
|
|
855
858
|
]
|
|
856
|
-
}) : /* @__PURE__ */
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
859
|
+
}) : /* @__PURE__ */ jsx(EmptyState, {
|
|
860
|
+
testID: "git-worktrees-empty",
|
|
861
|
+
icon: /* @__PURE__ */ jsx(BranchIcon, { size: 20 }),
|
|
862
|
+
title: "No worktrees yet",
|
|
863
|
+
description: "A worktree gives a branch its own checkout and a session nested under this one.",
|
|
864
|
+
action: onNew ? {
|
|
865
|
+
label: "New worktree",
|
|
866
|
+
onAction: onNew,
|
|
867
|
+
disabled: busy,
|
|
868
|
+
testId: "git-worktree-create"
|
|
869
|
+
} : void 0
|
|
865
870
|
}),
|
|
866
871
|
state.pending && !starting ? /* @__PURE__ */ jsx(Text, {
|
|
867
872
|
style: styles$2.dim,
|
|
@@ -1125,22 +1130,6 @@ const styles$2 = StyleSheet.create((theme) => ({
|
|
|
1125
1130
|
fontWeight: "600",
|
|
1126
1131
|
color: theme.colors.bg,
|
|
1127
1132
|
uni__dependencies: [0]
|
|
1128
|
-
},
|
|
1129
|
-
empty: {
|
|
1130
|
-
flex: 1,
|
|
1131
|
-
alignItems: "center",
|
|
1132
|
-
justifyContent: "center",
|
|
1133
|
-
padding: theme.spacing(8),
|
|
1134
|
-
gap: theme.spacing(3),
|
|
1135
|
-
uni__dependencies: [0]
|
|
1136
|
-
},
|
|
1137
|
-
emptyCopy: {
|
|
1138
|
-
fontFamily: fontOf(theme.fontFamily.sans),
|
|
1139
|
-
fontSize: theme.fontSize.base,
|
|
1140
|
-
lineHeight: theme.lineHeight.lg,
|
|
1141
|
-
color: theme.colors.dim,
|
|
1142
|
-
textAlign: "center",
|
|
1143
|
-
uni__dependencies: [0]
|
|
1144
1133
|
}
|
|
1145
1134
|
}));
|
|
1146
1135
|
//#endregion
|
|
@@ -1305,8 +1294,7 @@ var git_native_default = defineActivityGroup({
|
|
|
1305
1294
|
}
|
|
1306
1295
|
},
|
|
1307
1296
|
marksBackgroundWork: false,
|
|
1308
|
-
transientTab: worktreesTab
|
|
1309
|
-
order: 30
|
|
1297
|
+
transientTab: worktreesTab
|
|
1310
1298
|
});
|
|
1311
1299
|
//#endregion
|
|
1312
1300
|
//#region src/extensions/workspaces/sessions/(frontend)/channel/git-changes.native.ts
|
|
@@ -2030,14 +2018,6 @@ const styles$1 = StyleSheet.create((theme) => ({
|
|
|
2030
2018
|
alignSelf: "center",
|
|
2031
2019
|
uni__dependencies: [0]
|
|
2032
2020
|
},
|
|
2033
|
-
empty: {
|
|
2034
|
-
flex: 1,
|
|
2035
|
-
alignItems: "center",
|
|
2036
|
-
justifyContent: "center",
|
|
2037
|
-
gap: theme.spacing(3),
|
|
2038
|
-
padding: theme.spacing(6),
|
|
2039
|
-
uni__dependencies: [0]
|
|
2040
|
-
},
|
|
2041
2021
|
navigation: {
|
|
2042
2022
|
flexDirection: "row",
|
|
2043
2023
|
justifyContent: "space-between",
|
|
@@ -2186,15 +2166,16 @@ function GitReviewView(props) {
|
|
|
2186
2166
|
files: summary.files,
|
|
2187
2167
|
comments,
|
|
2188
2168
|
onFile: props.onFile
|
|
2189
|
-
}) : /* @__PURE__ */
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2169
|
+
}) : summary.repository ? /* @__PURE__ */ jsx(EmptyState, {
|
|
2170
|
+
testID: "git-review-empty",
|
|
2171
|
+
icon: /* @__PURE__ */ jsx(BranchIcon, { size: 20 }),
|
|
2172
|
+
title: "No changes yet",
|
|
2173
|
+
description: summary.base === void 0 ? "Nothing uncommitted in this checkout." : `Nothing differs from ${summary.base}, committed or not.`
|
|
2174
|
+
}) : /* @__PURE__ */ jsx(EmptyState, {
|
|
2175
|
+
testID: "git-review-no-repository",
|
|
2176
|
+
icon: /* @__PURE__ */ jsx(BranchIcon, { size: 20 }),
|
|
2177
|
+
title: "Not a Git checkout",
|
|
2178
|
+
description: "This session's folder is not inside a Git repository."
|
|
2198
2179
|
}),
|
|
2199
2180
|
summary?.truncated ? /* @__PURE__ */ jsx(Text, {
|
|
2200
2181
|
style: styles$1.dim,
|