fix(web): remove projects with archived threads (#8798)
This commit is contained in:
1 parent
a81a52afbb
commit
6ff537f03c
2 files changed
+11
-7
No files matched your search
@@ -1473,13 +1473,13 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
|
||||
);
|
||||
|
||||
const removeProject = useCallback(
|
||||
async (member: SidebarProjectGroupMember, options: { force?: boolean } = {}) => {
|
||||
async (member: SidebarProjectGroupMember) => {
|
||||
const memberProjectRef = scopeProjectRef(member.environmentId, member.id);
|
||||
const result = await deleteProject({
|
||||
environmentId: member.environmentId,
|
||||
input: {
|
||||
projectId: member.id,
|
||||
...(options.force === true ? { force: true } : {}),
|
||||
force: true,
|
||||
},
|
||||
});
|
||||
if (result._tag === "Failure") {
|
||||
@@ -1547,7 +1547,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
|
||||
...(member.environmentLabel
|
||||
? [`Environment: ${member.environmentLabel}`]
|
||||
: []),
|
||||
"This permanently clears conversation history for those threads.",
|
||||
"This permanently clears conversation history for those threads and any archived threads.",
|
||||
"This removes only this project entry.",
|
||||
"This action cannot be undone.",
|
||||
].join("\n")
|
||||
@@ -1557,6 +1557,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
|
||||
...(member.environmentLabel
|
||||
? [`Environment: ${member.environmentLabel}`]
|
||||
: []),
|
||||
"This permanently clears any archived conversation history.",
|
||||
"This removes only this project entry.",
|
||||
].join("\n"),
|
||||
{ variant: "destructive" },
|
||||
@@ -1565,7 +1566,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
|
||||
return;
|
||||
}
|
||||
|
||||
const result = await removeProject(member, { force: true });
|
||||
const result = await removeProject(member);
|
||||
if (result._tag === "Failure" && !isAtomCommandInterrupted(result)) {
|
||||
const error = squashAtomCommandFailure(result);
|
||||
toastManager.add(
|
||||
@@ -1606,6 +1607,7 @@ const SidebarProjectItem = memo(function SidebarProjectItem(props: SidebarProjec
|
||||
`Remove project "${member.title}"?`,
|
||||
`Path: ${member.workspaceRoot}`,
|
||||
...(member.environmentLabel ? [`Environment: ${member.environmentLabel}`] : []),
|
||||
"This permanently clears any archived conversation history.",
|
||||
"This removes only this project entry.",
|
||||
].join("\n");
|
||||
const confirmed = await api.dialogs.confirm(message, { variant: "destructive" });
|
||||
|
||||
@@ -715,8 +715,10 @@ function ProjectDetail({ group }: { group: SidebarProjectSnapshot }) {
|
||||
]
|
||||
: [`This removes ${members.length} grouped project entries.`]),
|
||||
...(projectThreads.length > 0
|
||||
? ["This permanently clears conversation history for those threads."]
|
||||
: []),
|
||||
? [
|
||||
"This permanently clears conversation history for those threads and any archived threads.",
|
||||
]
|
||||
: ["This permanently clears any archived conversation history."]),
|
||||
isWholeGroup
|
||||
? "This removes only the project entries, not the files on disk."
|
||||
: "Other entries in this grouped project are unaffected.",
|
||||
@@ -738,7 +740,7 @@ function ProjectDetail({ group }: { group: SidebarProjectSnapshot }) {
|
||||
environmentId: member.environmentId,
|
||||
input: {
|
||||
projectId: member.id,
|
||||
...(memberThreads.length > 0 ? { force: true } : {}),
|
||||
force: true,
|
||||
},
|
||||
}),
|
||||
() => undefined,
|
||||
|
||||
Reference in new issue
Block a user