WIP V improve UX [snapshot task 2]
This commit is contained in:
1 parent
5f8c6a1916
commit
a73b3075b6
16 files changed
+238
-232
No files matched your search
+14
-5
@@ -81,7 +81,16 @@ function update(id: string, change: ConnectionUpdate) {
|
||||
});
|
||||
}
|
||||
function record(id: string, activity: ConnectionActivity) { update(id, { activity }); }
|
||||
function pair(id: string, peerKey: string) { update(id, { peerKey }); }
|
||||
// Connection setup re-reads the record so trust forgotten in another tab is
|
||||
// never reused from this tab's copy. A failed read stops setup.
|
||||
async function trust(id: string) {
|
||||
await writes;
|
||||
const records = persistent ? await loadConnections() : connections.value;
|
||||
const record = records.find(item => item.id === id);
|
||||
if (!record) throw new Error('This connection is no longer saved. Reload the page.');
|
||||
if (persistent && !pending && !removing.value) applyRecords(records);
|
||||
return record;
|
||||
}
|
||||
async function remove() {
|
||||
if (!current.value || removing.value || adding.value) return;
|
||||
const id = current.value.id;
|
||||
@@ -120,7 +129,7 @@ async function remove() {
|
||||
<p>No accounts. Your connections stay on this device.</p>
|
||||
<details class="privacy-details">
|
||||
<summary>About privacy & connections</summary>
|
||||
<p>Files travel over encrypted WebRTC data channels. Compare full fingerprints on first pairing, or authenticate a remembered device. Reconnect by exchanging fresh codes.</p>
|
||||
<p>Files travel over encrypted WebRTC data channels. Compare full fingerprints on first pairing, or let a connection authenticate its remembered device. Reconnect by exchanging fresh codes.</p>
|
||||
<p>Trust your browser and the app’s host: its code can read selected files and use your device identity. HTTPS protects delivery. A TURN relay is used only after opt-in.</p>
|
||||
<p>Clearing site data removes saved connections, identities, and history.</p>
|
||||
</details>
|
||||
@@ -135,7 +144,7 @@ async function remove() {
|
||||
<div class="title-line">
|
||||
<h1 ref="heading" class="sr-only" tabindex="-1">{{ current.name }}</h1>
|
||||
<EditableName :key="current.id" :name="current.name" :disabled="removing" @rename="update(current!.id, { name: $event })" />
|
||||
<button class="header-action" :disabled="adding || removing" @click="removalError = ''; confirmingRemoval = true">Remove</button>
|
||||
<button class="header-action" :disabled="adding || removing" @click="removalError = ''; confirmingRemoval = true"><span class="header-action-icon" aria-hidden="true">✕</span> Remove</button>
|
||||
</div>
|
||||
</div>
|
||||
<span class="session-badge" :class="states[current.id] || 'ready'"><span class="connection-dot" :class="states[current.id] || 'ready'" aria-hidden="true"></span>{{ statusLabel(current.id) }}</span>
|
||||
@@ -145,7 +154,7 @@ async function remove() {
|
||||
<p v-if="error" class="storage-error" role="alert">{{ error }}</p>
|
||||
<template v-for="item in connections" :key="item.id">
|
||||
<KeepAlive>
|
||||
<ConnectionWorkspace v-if="selected === item.id" :connection="item" @status="setStatus" @activity="record" @paired="pair" />
|
||||
<ConnectionWorkspace v-if="selected === item.id" :connection="item" :load-trust="trust" @status="setStatus" @activity="record" @update="update" />
|
||||
</KeepAlive>
|
||||
</template>
|
||||
<p v-if="!current" class="status">Opening your connections…</p>
|
||||
@@ -153,7 +162,7 @@ async function remove() {
|
||||
</main>
|
||||
</div>
|
||||
<AppDialog v-model="confirmingRemoval" :title="`Remove ${current?.name || 'connection'}?`" :busy="removing">
|
||||
<p>This ends its session and deletes its saved activity. Saved files and device identities are kept.</p>
|
||||
<p>This ends its session and deletes its saved activity and remembered device. Saved files and your device identity are kept.</p>
|
||||
<p v-if="connections.length === 1">A fresh Con 1 will replace your last connection.</p>
|
||||
<p v-if="removalError" class="error" role="alert">{{ removalError }}</p>
|
||||
<template #actions="{ close }">
|
||||
|
||||
Reference in new issue
Block a user