fix(android): the keyboard closes, and the write test is gone

Same origin as the sideways slide. The keyboard's validate key asks for
the next field, and the next one in the document sits on a view parked
outside the frame. Focus landed there unseen: the keyboard changed shape
- numeric for the code, alphabetic for the search - and would not close,
because the field holding it open was off screen.

No field of a resting view keeps the focus now, and the validate key
closes the keyboard instead of jumping. In the editor it saves, which is
what the key is for after typing a password.

The write test goes with it: it proved the write path before the first
real PUT, that path now carries the vault itself, and the button, its
handler, the probe and the debug hook that revealed it were only ever
scaffolding.
This commit is contained in:
r-zakarya
2026-08-21 12:39:22 +01:00
parent 7a9fe4ae77
commit 90ea09a718
2 changed files with 26 additions and 86 deletions
+26 -21
View File
@@ -224,10 +224,6 @@
<button class="btn" id="btnCfg">&#9881;&nbsp; Server settings</button>
<button class="btn" id="btnLog">&#8801;&nbsp; Log</button>
</div>
<!-- Essai du chemin d'ecriture, visible uniquement en build de debogage :
Delphi appelle PM.setDebug(true). Il ecrit dans un AUTRE fichier du
depot, jamais dans le coffre. -->
<button class="btn wide" id="btnWriteTest" hidden>Write test (debug)</button>
</div>
<!-- UNE CROIX PAR CHAMP. Vider par la touche retour demande une quarantaine
d'appuis sur un jeton, et laisse facilement un caractere - ce qui donne
@@ -399,14 +395,6 @@ document.getElementById('btnLog').addEventListener('click', function () {
var l = document.getElementById('log');
l.hidden = !l.hidden;
});
document.getElementById('btnWriteTest').addEventListener('click', function () {
// pushConfig D'ABORD, comme Sync. Sans cela, un jeton qui vient d'etre colle
// et dont le champ n'a pas encore perdu le focus n'est pas parti vers Delphi,
// qui agit alors avec l'ancien - et rend un 403 parfaitement trompeur.
pushConfig();
document.getElementById('log').hidden = false;
send('writetest');
});
function esc(s) {
return String(s == null ? '' : s).replace(/[&<>"]/g, function (c) {
@@ -593,12 +581,6 @@ function openEditor(k) {
var input = document.getElementById('editval');
input.value = detailRows[k].v;
input.focus();
input.addEventListener('keydown', function (ev) {
if (ev.key !== 'Enter') return;
ev.preventDefault();
var save = document.querySelector('[data-editsave]');
if (save && !save.disabled) save.click();
});
send('touch');
}
@@ -618,6 +600,32 @@ addEventListener('scroll', function (ev) {
if (box && box.scrollLeft && box.id !== 'folders') box.scrollLeft = 0;
}, true);
// AUCUN CHAMP D'UNE VUE AU REPOS NE GARDE LE FOCUS.
//
// Meme origine que le glissement ci-dessus. La touche de validation du clavier
// demande "champ suivant", et le suivant dans le document est sur une vue
// rangee hors du cadre. On y atterrissait sans rien voir : le clavier changeait
// de forme - numerique pour le code, alphabetique pour la recherche - et ne se
// refermait plus, puisque le champ qui le tenait ouvert etait hors de l'ecran.
addEventListener('focusin', function (ev) {
var scr = ev.target.closest && ev.target.closest('.screen');
if (scr && scr.id !== view) ev.target.blur();
});
// La validation ferme le clavier au lieu de sauter au champ suivant. Dans
// l'editeur, elle enregistre : c'est ce qu'on attend de cette touche apres
// avoir tape un mot de passe.
addEventListener('keydown', function (ev) {
var el = ev.target;
if (ev.key !== 'Enter' || !el.classList || !el.classList.contains('field-in'))
return;
ev.preventDefault();
el.blur();
if (el.id !== 'editval') return;
var save = document.querySelector('[data-editsave]');
if (save && !save.disabled) save.click();
});
function goList() {
document.body.classList.remove('on-detail');
document.body.classList.add('on-list');
@@ -644,9 +652,6 @@ var PM = {
renderRows();
},
setDebug: function (on) {
document.getElementById('btnWriteTest').hidden = !on;
},
/// Sort du mode edition sans rien demander a Delphi. Sert aux refus
/// immediats : l'editeur y restait ouvert, boutons desactives, et Cancel
/// lui-meme ne repondait plus.