fleetbo-cockpit-cli 1.0.130 → 1.0.131

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/cli.js +19 -9
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -641,9 +641,22 @@ if (command === 'alex') {
641
641
 
642
642
  let inputBuffer = "";
643
643
  let isProcessing = false;
644
+ let hintTimer = null;
644
645
  let submitTimer = null;
645
646
 
647
+ const showHint = () => {
648
+ if (hintTimer) clearTimeout(hintTimer);
649
+ hintTimer = setTimeout(() => {
650
+ hintTimer = null;
651
+ if (inputBuffer.trim() !== "" && !isProcessing) {
652
+ rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
653
+ rl.prompt();
654
+ }
655
+ }, 400);
656
+ };
657
+
646
658
  const doSubmit = async () => {
659
+ if (hintTimer) { clearTimeout(hintTimer); hintTimer = null; }
647
660
  if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
648
661
  if (isProcessing || inputBuffer.trim() === "") return;
649
662
 
@@ -679,19 +692,16 @@ if (command === 'alex') {
679
692
  }
680
693
 
681
694
  if (trimmedLine !== "") {
682
- // Ligne non-vide : annule le timer de soumission si une ligne vide
683
- // était en attente (cas paste avec ligne vide interne)
695
+ // Ligne non-vide : annule submit en attente (paste avec ligne vide interne)
684
696
  if (submitTimer) { clearTimeout(submitTimer); submitTimer = null; }
685
697
  inputBuffer += (inputBuffer ? "\n" : "") + line;
686
- // Affiche le hint immédiatementcomportement original préservé
687
- rl.setPrompt("\x1b[90m ↵ again to send\x1b[0m");
688
- rl.prompt();
698
+ // Hint affiché 400ms après la dernière ligne jamais pendant un paste
699
+ showHint();
689
700
  } else {
690
701
  if (inputBuffer.trim() !== "") {
691
- // Ligne vide reçue : attend 400ms avant de soumettre
692
- // Si une ligne non-vide arrive dans ce délai (paste en cours)
693
- // le timer est annulé dans le bloc trimmedLine !== "" ci-dessus
694
- // Si rien n'arrive → vraie Entrée manuelle → soumet
702
+ // Ligne vide : annule le hint, attend 400ms pour soumettre
703
+ // Si une ligne non-vide arrive submitTimer annulé (paste continue)
704
+ if (hintTimer) { clearTimeout(hintTimer); hintTimer = null; }
695
705
  if (submitTimer) clearTimeout(submitTimer);
696
706
  submitTimer = setTimeout(() => doSubmit(), 400);
697
707
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fleetbo-cockpit-cli",
3
- "version": "1.0.130",
3
+ "version": "1.0.131",
4
4
  "description": "Fleetbo CLI - Build native mobile apps with React",
5
5
  "author": "Fleetbo",
6
6
  "license": "MIT",