diff options
| author | Adam Soltys <[email protected]> | 2026-08-17 11:17:34 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-17 11:17:34 -0700 |
| commit | b6fd70e07ea744f6856a28c061ed6cd8ef67abe6 (patch) | |
| tree | 34365d00ae27729eb4b877825347b0597aa8a3fd /src/app.js | |
| parent | 6a78f8fefe71e636c847e1402b08b1d60483565b (diff) | |
| download | coinosv3-b6fd70e07ea744f6856a28c061ed6cd8ef67abe6.tar.gz coinosv3-b6fd70e07ea744f6856a28c061ed6cd8ef67abe6.zip | |
The entropy door moves behind the phrase: newcomers see one Generate button, tinkerers unfold the toggle after — typing re-derives the words live, clearing restores the random draft
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz
Diffstat (limited to 'src/app.js')
| -rw-r--r-- | src/app.js | 45 |
1 files changed, 26 insertions, 19 deletions
@@ -770,29 +770,12 @@ function createPane() { 'div', { class: 'col' }, h('p', { class: 'muted' }, t('genIntro')), - // BYO randomness for the seed — folded away so the common path stays - // one button. Deterministic on purpose: the typed text alone derives - // the seed (see newMnemonic), so re-typing it IS an import. - h('button', { - class: 'linklike small', style: 'align-self:flex-start', - onClick: () => { ui.ownEntropyOpen = !ui.ownEntropyOpen; render(); }, - }, (ui.ownEntropyOpen ? '▾ ' : '▸ ') + t('entropyToggle')), - ui.ownEntropyOpen - ? h('div', { class: 'col gap6' }, - h('p', { class: 'small muted', style: 'margin:0' }, t('entropyHint')), - h('div', { class: 'warn-box small' }, t('entropyWarn')), - h('textarea', { - rows: '2', style: 'font-family:var(--sans)', placeholder: t('entropyPlaceholder'), - autocapitalize: 'none', autocomplete: 'off', spellcheck: 'false', - value: ui.ownEntropy || '', onInput: (e) => (ui.ownEntropy = e.target.value), - })) - : null, h( 'button', { class: 'btn-primary btn-block', onClick: () => { - ui.draftMnemonic = newMnemonic(128, (ui.ownEntropy || '').trim()); + ui.draftRandom = ui.draftMnemonic = newMnemonic(); render(); }, }, @@ -823,13 +806,37 @@ function createPane() { { class: 'btn-ghost btn-sm', onClick: () => { - ui.draftMnemonic = newMnemonic(); + ui.draftRandom = ui.draftMnemonic = newMnemonic(); render(); }, }, t('regenerate') ) ), + // BYO randomness — tucked below the generated phrase so newcomers never + // have to parse it. Deterministic on purpose: the typed text alone + // derives the words (live, as you type), so re-typing it IS an import; + // clearing the field brings the randomly generated phrase back. + h('button', { + class: 'linklike small', style: 'align-self:flex-start', + onClick: () => { ui.ownEntropyOpen = !ui.ownEntropyOpen; render(); }, + }, (ui.ownEntropyOpen ? '▾ ' : '▸ ') + t('entropyToggle')), + ui.ownEntropyOpen + ? h('div', { class: 'col gap6' }, + h('p', { class: 'small muted', style: 'margin:0' }, t('entropyHint')), + h('div', { class: 'warn-box small' }, t('entropyWarn')), + h('textarea', { + rows: '2', style: 'font-family:var(--sans)', placeholder: t('entropyPlaceholder'), + autocapitalize: 'none', autocomplete: 'off', spellcheck: 'false', + value: ui.ownEntropy || '', + onInput: (e) => { + ui.ownEntropy = e.target.value; + const txt = ui.ownEntropy.trim(); + ui.draftMnemonic = txt ? newMnemonic(128, txt) : (ui.draftRandom || ui.draftMnemonic); + render(); + }, + })) + : null, optionsPanel(), h( 'button', |
