HH-546: flatten conversation AI actions (#128)

* fix(HH-546): flatten conversation AI actions

* fix(HH-546): wrap AI actions on narrow screens

---------

Co-authored-by: Rogee <rogee@ipao.vip>
This commit is contained in:
Rogee
2026-08-23 21:16:19 +08:00
committed by GitHub
co-authored by rogee
parent eb1b5c8066
commit e41d40feb8
4 changed files with 253 additions and 92 deletions
@@ -62,29 +62,6 @@ const showBotHandoffBanner = computed(
currentChat.value?.status === wootConstants.STATUS_TYPE.PENDING
);
const aiTakeoverActive = computed(
() => currentChat.value?.ai_takeover_active === true
);
const toggleAITakeover = async () => {
try {
const wasActive = aiTakeoverActive.value;
const action = wasActive ? 'exitAITakeover' : 'startAITakeover';
await store.dispatch(action, currentChat.value?.id);
useAlert(
t(
wasActive
? 'CONVERSATION.AI_TAKEOVER.EXIT_SUCCESS'
: 'CONVERSATION.AI_TAKEOVER.START_SUCCESS'
)
);
} catch (error) {
useAlert(
error?.response?.data?.error || t('CONVERSATION.AI_TAKEOVER.ERROR')
);
}
};
const botHandoffActionLabel = computed(() => {
return assignedAgent.value?.id === currentUser.value?.id
? t('CONVERSATION.BOT_HANDOFF_REOPEN_ACTION')
@@ -132,19 +109,6 @@ const onClickBotHandoff = async () => {
</script>
<template>
<div class="mx-2 mb-2 flex justify-end">
<button
type="button"
class="rounded-md border border-n-slate-5 px-3 py-1.5 text-sm font-medium text-n-slate-12 hover:bg-n-alpha-2"
@click="toggleAITakeover"
>
{{
aiTakeoverActive
? $t('CONVERSATION.AI_TAKEOVER.EXIT')
: $t('CONVERSATION.AI_TAKEOVER.START')
}}
</button>
</div>
<Banner
v-if="showSelfAssignBanner && !showBotHandoffBanner"
action-button-variant="ghost"