diff --git a/frontend/src/components/prompts/Delete.vue b/frontend/src/components/prompts/Delete.vue index 89fb5096..aa2482ce 100644 --- a/frontend/src/components/prompts/Delete.vue +++ b/frontend/src/components/prompts/Delete.vue @@ -48,9 +48,9 @@ export default { "selectedCount", "req", "selected", - "currentPrompt", ]), - ...mapWritableState(useFileStore, ["reload"]), + ...mapState(useLayoutStore, ["currentPrompt"]), + ...mapWritableState(useFileStore, ["reload", "preselect"]), }, methods: { ...mapActions(useLayoutStore, ["closeHovers"]), @@ -80,6 +80,12 @@ export default { await Promise.all(promises); buttons.success("delete"); + + const nearbyItem = + this.req.items[Math.max(0, Math.min(this.selected) - 1)]; + + this.preselect = nearbyItem?.path; + this.reload = true; } catch (e) { buttons.done("delete"); diff --git a/frontend/src/components/prompts/DiscardEditorChanges.vue b/frontend/src/components/prompts/DiscardEditorChanges.vue index 69963674..4c1e5faa 100644 --- a/frontend/src/components/prompts/DiscardEditorChanges.vue +++ b/frontend/src/components/prompts/DiscardEditorChanges.vue @@ -17,7 +17,7 @@