|
@@ -65,15 +65,9 @@
|
|
|
|
|
|
|
|
<span class="codex-session__meta">{{ formatCodexRelative(session.updatedAt) }}</span>
|
|
<span class="codex-session__meta">{{ formatCodexRelative(session.updatedAt) }}</span>
|
|
|
|
|
|
|
|
- <div v-if="pendingDeleteId === session.threadId" class="codex-session__confirm">
|
|
|
|
|
- <button class="codex-btn" type="button" @click="confirmRemove(session.threadId)">删除</button>
|
|
|
|
|
- <button class="codex-btn" type="button" @click="pendingDeleteId = ''">取消</button>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div v-else class="codex-session__actions">
|
|
|
|
|
|
|
+ <div class="codex-session__actions">
|
|
|
<button class="codex-btn" type="button" title="重命名" @click="startRename(session)">改名</button>
|
|
<button class="codex-btn" type="button" title="重命名" @click="startRename(session)">改名</button>
|
|
|
- <button class="codex-btn" type="button" title="从列表移除" @click="pendingDeleteId = session.threadId">
|
|
|
|
|
- 移除
|
|
|
|
|
- </button>
|
|
|
|
|
|
|
+ <button class="codex-btn" type="button" title="从列表移除" @click="onRemove(session)">移除</button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</li>
|
|
</li>
|
|
@@ -91,7 +85,7 @@
|
|
|
* 删除只从本地列表移除,不动 Codex 侧已落盘的历史,避免误删。
|
|
* 删除只从本地列表移除,不动 Codex 侧已落盘的历史,避免误删。
|
|
|
*/
|
|
*/
|
|
|
import { computed, nextTick, ref } from 'vue';
|
|
import { computed, nextTick, ref } from 'vue';
|
|
|
- import { Input } from 'ant-design-vue';
|
|
|
|
|
|
|
+ import { Input, Modal } from 'ant-design-vue';
|
|
|
import { downloadByData } from '@/core/utils/file/download';
|
|
import { downloadByData } from '@/core/utils/file/download';
|
|
|
import Icon from '@/core/components/Icon/src/Icon.vue';
|
|
import Icon from '@/core/components/Icon/src/Icon.vue';
|
|
|
import { useMessage } from '@/core/hooks/web/useMessage';
|
|
import { useMessage } from '@/core/hooks/web/useMessage';
|
|
@@ -113,7 +107,6 @@
|
|
|
const renamingId = ref('');
|
|
const renamingId = ref('');
|
|
|
const renameDraft = ref('');
|
|
const renameDraft = ref('');
|
|
|
const renameInputRef = ref();
|
|
const renameInputRef = ref();
|
|
|
- const pendingDeleteId = ref('');
|
|
|
|
|
const fileInputRef = ref<HTMLInputElement>();
|
|
const fileInputRef = ref<HTMLInputElement>();
|
|
|
|
|
|
|
|
const sessions = computed(() => store.sessions);
|
|
const sessions = computed(() => store.sessions);
|
|
@@ -135,7 +128,6 @@
|
|
|
|
|
|
|
|
async function onSelect(threadId: string) {
|
|
async function onSelect(threadId: string) {
|
|
|
if (threadId === activeThreadId.value) return;
|
|
if (threadId === activeThreadId.value) return;
|
|
|
- pendingDeleteId.value = '';
|
|
|
|
|
await store.selectSession(threadId);
|
|
await store.selectSession(threadId);
|
|
|
emit('select', threadId);
|
|
emit('select', threadId);
|
|
|
|
|
|
|
@@ -199,10 +191,24 @@
|
|
|
cancelRename();
|
|
cancelRename();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- function confirmRemove(threadId: string) {
|
|
|
|
|
- store.removeSession(threadId);
|
|
|
|
|
- pendingDeleteId.value = '';
|
|
|
|
|
- showMessage('已从列表移除', 'success');
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 删除前弹框确认。
|
|
|
|
|
+ *
|
|
|
|
|
+ * 删除是破坏性操作:会话从本机列表移除后就找不回来了(Codex 侧已落盘的历史不删,
|
|
|
|
|
+ * 但提问落盘与事件缓存都会清掉),所以不能一按就生效。
|
|
|
|
|
+ */
|
|
|
|
|
+ function onRemove(session: CodexSessionMeta) {
|
|
|
|
|
+ Modal.confirm({
|
|
|
|
|
+ title: '删除会话',
|
|
|
|
|
+ content: `确认删除「${session.title}」?将把它从本机列表移除,Codex 侧已落盘的历史不受影响。`,
|
|
|
|
|
+ okText: '删除',
|
|
|
|
|
+ okType: 'danger',
|
|
|
|
|
+ cancelText: '取消',
|
|
|
|
|
+ onOk: () => {
|
|
|
|
|
+ store.removeSession(session.threadId);
|
|
|
|
|
+ showMessage('已从列表移除', 'success');
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
@@ -330,12 +336,6 @@
|
|
|
display: none;
|
|
display: none;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- &__confirm {
|
|
|
|
|
- display: flex;
|
|
|
|
|
- align-items: center;
|
|
|
|
|
- gap: 2px;
|
|
|
|
|
- flex: 0 0 auto;
|
|
|
|
|
- }
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@keyframes codex-session-pulse {
|
|
@keyframes codex-session-pulse {
|