@bobfrankston/mailx 1.0.289 → 1.0.290

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.
package/client/app.js CHANGED
@@ -1019,7 +1019,11 @@ onWsEvent((event) => {
1019
1019
  }
1020
1020
  break;
1021
1021
  case "folderCountsChanged": {
1022
- // Update folder badges + silently refresh message list (preserves selection and viewer)
1022
+ // Update folder badges + full tree refresh (not just counts) so
1023
+ // newly-synced folders appear. Without this, the first sync after
1024
+ // setup creates DB folders but the tree never picks them up because
1025
+ // syncComplete fires during page reload and gets lost.
1026
+ refreshFolderTree();
1023
1027
  updateFolderCounts();
1024
1028
  updateNewMessageCount();
1025
1029
  // Debounced silent reload — preserves scroll position, selection, and viewer
@@ -482,22 +482,34 @@ async function loadFolderTree(container) {
482
482
  "aol.com": "Use an app password: AOL Settings → Account Security → Generate app password",
483
483
  "icloud.com": "Use an app-specific password: appleid.apple.com → Sign-In and Security → App-Specific Passwords",
484
484
  };
485
+ let oauthAutoFired = false;
485
486
  emailInput?.addEventListener("input", () => {
486
487
  const email = emailInput.value.trim();
487
488
  const domain = email.split("@")[1]?.toLowerCase() || "";
488
489
  const hasAt = email.includes("@") && domain.length > 0;
489
490
  const isOAuth = ["gmail.com", "googlemail.com", "outlook.com", "hotmail.com", "live.com"].includes(domain);
490
- // Progressive reveal: email first, then name + submit,
491
- // password only for non-OAuth providers.
491
+ const isGmailLike = ["gmail.com", "googlemail.com"].includes(domain);
492
+ // OAuth providers: auto-fire setup immediately once domain
493
+ // is recognized — don't show name/password (name is auto-
494
+ // detected from Google profile, no password needed). This
495
+ // eliminates the "form flash" where fields briefly appear
496
+ // before the page reloads.
497
+ if (hasAt && isOAuth && !oauthAutoFired && !setupTriggered) {
498
+ oauthAutoFired = true;
499
+ statusEl.textContent = `Connecting to ${isGmailLike ? "Gmail" : "Outlook"}...`;
500
+ trySetup();
501
+ return;
502
+ }
503
+ // Non-OAuth: progressive reveal of name + password + submit.
492
504
  const nameRow = document.getElementById("setup-name-row");
493
505
  const pwRow = document.getElementById("setup-password-row");
494
506
  const submitBtn = document.getElementById("setup-submit");
495
507
  if (nameRow)
496
- nameRow.style.display = hasAt ? "block" : "none";
508
+ nameRow.style.display = hasAt && !isOAuth ? "block" : "none";
497
509
  if (pwRow)
498
510
  pwRow.style.display = hasAt && !isOAuth ? "block" : "none";
499
511
  if (submitBtn)
500
- submitBtn.style.display = hasAt ? "block" : "none";
512
+ submitBtn.style.display = hasAt && !isOAuth ? "block" : "none";
501
513
  const helpEl = document.getElementById("setup-app-password-help");
502
514
  if (helpEl) {
503
515
  const help = APP_PASSWORD_HELP[domain];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bobfrankston/mailx",
3
- "version": "1.0.289",
3
+ "version": "1.0.290",
4
4
  "description": "Local-first email client with IMAP sync and standalone native app",
5
5
  "type": "module",
6
6
  "main": "bin/mailx.js",