fix(10): close UX-06/UX-10/UX-13 verification gaps — Escape modal close, rename/revoke toasts, StorageBrowser picker tests

This commit is contained in:
curo1305
2026-06-16 09:57:17 +02:00
parent 2605227fe0
commit 6b56763689
4 changed files with 106 additions and 6 deletions
+13 -1
View File
@@ -113,9 +113,10 @@
</template>
<script setup>
import { ref, onMounted } from 'vue'
import { ref, onMounted, onUnmounted } from 'vue'
import AppIcon from '../ui/AppIcon.vue'
import { useDocumentsStore } from '../../stores/documents.js'
import { useToastStore } from '../../stores/toast.js'
const props = defineProps({
doc: {
@@ -127,6 +128,7 @@ const props = defineProps({
const emit = defineEmits(['close', 'unshared'])
const docsStore = useDocumentsStore()
const toast = useToastStore()
const handle = ref('')
const permission = ref('view')
@@ -137,7 +139,12 @@ const shares = ref([])
const loadingShares = ref(false)
const updatingPermission = ref(new Set())
function onKeydown(e) {
if (e.key === 'Escape') emit('close')
}
onMounted(async () => {
window.addEventListener('keydown', onKeydown)
loadingShares.value = true
try {
const data = await docsStore.listShares(props.doc.id)
@@ -149,6 +156,10 @@ onMounted(async () => {
}
})
onUnmounted(() => {
window.removeEventListener('keydown', onKeydown)
})
async function submitShare() {
const trimmed = handle.value.trim()
if (!trimmed || submitting.value) return
@@ -201,6 +212,7 @@ async function handleRevoke(shareId) {
try {
await docsStore.revokeShare(shareId)
toast.show('Share revoked', 'success')
if (shares.value.length === 0) emit('unshared', props.doc.id)
} catch (e) {
// Re-add on failure