mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-09-21 18:17:05 +00:00
feat(setup-wizard): improve E2EE dialog UX and password field
- Only show the passphrase and "Obfuscate Properties" controls once end-to-end encryption is enabled, instead of leaving them visible but disabled. - Replace the password show/hide checkbox with an icon toggle button. - Let translated labels wrap to their content instead of being clipped into a fixed-width column (this clipped longer translated labels, e.g. in German and Spanish). - Scope the onboarding invitation link's 44px touch-target padding to mobile, so on desktop it renders as a normal inline link instead of a stray, oddly-padded button. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
694371898a
commit
6b37ea8778
@@ -18,6 +18,7 @@
|
||||
let showPassword = $state(false);
|
||||
const type = $derived.by(() => (showPassword ? "text" : "password"));
|
||||
const translatedPlaceholder = $derived.by(() => translate(placeholder));
|
||||
const toggleLabel = $derived.by(() => translate(showPassword ? "Hide password" : "Show password"));
|
||||
</script>
|
||||
|
||||
<input
|
||||
@@ -31,4 +32,64 @@
|
||||
autocorrect="off"
|
||||
autocapitalize="off"
|
||||
/>
|
||||
<input type="checkbox" bind:checked={showPassword} />
|
||||
<button
|
||||
type="button"
|
||||
class="sls-password-toggle"
|
||||
aria-label={toggleLabel}
|
||||
title={toggleLabel}
|
||||
aria-pressed={showPassword}
|
||||
{disabled}
|
||||
onclick={() => (showPassword = !showPassword)}
|
||||
>
|
||||
{#if showPassword}
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
width="16"
|
||||
height="16"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M9.88 9.88a3 3 0 1 0 4.24 4.24" />
|
||||
<path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" />
|
||||
<path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" />
|
||||
<line x1="2" x2="22" y1="2" y2="22" />
|
||||
</svg>
|
||||
{:else}
|
||||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
width="16"
|
||||
height="16"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z" />
|
||||
<circle cx="12" cy="12" r="3" />
|
||||
</svg>
|
||||
{/if}
|
||||
</button>
|
||||
|
||||
<style>
|
||||
.sls-password-toggle {
|
||||
display: inline-flex;
|
||||
flex: 0 0 auto;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 4px;
|
||||
margin-left: 4px;
|
||||
background: transparent;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
color: var(--text-muted);
|
||||
cursor: pointer;
|
||||
}
|
||||
.sls-password-toggle:hover {
|
||||
color: var(--text-normal);
|
||||
background: var(--background-modifier-hover);
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user