From b9d46fde1ec9363cccdd8aecac4021ad71275768 Mon Sep 17 00:00:00 2001 From: Tero Date: Tue, 3 Nov 2026 09:30:14 +0200 Subject: [PATCH] Fix Android ui scaling and account creation issue --- .../daybreak/mail/AndroidAccountVault.kt | 10 ++- .../daybreak/mail/AndroidMailService.kt | 66 +++++++--------- .../daybreak/mail/AndroidMailTransport.kt | 45 +++++++++++ .../java/studio/daybreak/mail/EpMailPlugin.kt | 23 ++++-- .../studio/daybreak/mail/MainActivity.java | 8 +- .../daybreak/mail/AndroidMailTransportTest.kt | 46 +++++++++++ app.js | 20 ++--- mail-ui.js | 30 +++++++- package-lock.json | 4 +- package.json | 2 +- service-worker.js | 6 +- styles.css | 76 ++++++++++++++++++- tests/android-ui-support.test.cjs | 44 +++++++++++ www/app.js | 20 ++--- www/mail-ui.js | 30 +++++++- www/service-worker.js | 6 +- www/styles.css | 76 ++++++++++++++++++- 17 files changed, 417 insertions(+), 95 deletions(-) create mode 100644 android/app/src/main/java/studio/daybreak/mail/AndroidMailTransport.kt create mode 100644 android/app/src/test/java/studio/daybreak/mail/AndroidMailTransportTest.kt create mode 100644 tests/android-ui-support.test.cjs diff --git a/android/app/src/main/java/studio/daybreak/mail/AndroidAccountVault.kt b/android/app/src/main/java/studio/daybreak/mail/AndroidAccountVault.kt index 283a7f0..d72b981 100644 --- a/android/app/src/main/java/studio/daybreak/mail/AndroidAccountVault.kt +++ b/android/app/src/main/java/studio/daybreak/mail/AndroidAccountVault.kt @@ -440,9 +440,13 @@ internal object AndroidAccountVault { .put("id", account.optString("id")) .put("email", account.optString("email")) .put("displayName", account.optString("displayName")) - .put("imapHost", account.optString("imapHost")) - .put("smtpHost", account.optString("smtpHost")) - .put("signature", account.optString("signature")) + .put("imapHost", account.optString("imapHost")) + .put("smtpHost", account.optString("smtpHost")) + .put("imapPort", account.optInt("imapPort", 143)) + .put("smtpPort", account.optInt("smtpPort", 587)) + .put("imapSecure", account.optBoolean("imapSecure", false)) + .put("smtpSecure", account.optBoolean("smtpSecure", false)) + .put("signature", account.optString("signature")) .put("notificationsEnabled", account.optBoolean("notificationsEnabled", true)) .put("syncIntervalMinutes", account.optInt("syncIntervalMinutes", 2)) .put("rules", account.optJSONArray("rules") ?: JSONArray()) diff --git a/android/app/src/main/java/studio/daybreak/mail/AndroidMailService.kt b/android/app/src/main/java/studio/daybreak/mail/AndroidMailService.kt index 826620c..8de4f5a 100644 --- a/android/app/src/main/java/studio/daybreak/mail/AndroidMailService.kt +++ b/android/app/src/main/java/studio/daybreak/mail/AndroidMailService.kt @@ -487,18 +487,19 @@ internal object AndroidMailService { fun watchInbox( account: JSONObject, - onNewMail: (Int) -> Unit, - shouldStop: () -> Boolean, - onConnection: (Store?, Folder?) -> Unit - ) { - val props = imapProperties(account).apply { - setProperty("mail.imap.timeout", "0") - setProperty("mail.imap.writetimeout", "60000") - } + onNewMail: (Int) -> Unit, + shouldStop: () -> Boolean, + onConnection: (Store?, Folder?) -> Unit + ) { + val protocol = imapProtocol(account) + val props = imapProperties(account).apply { + setProperty("mail.$protocol.timeout", "0") + setProperty("mail.$protocol.writetimeout", "60000") + } val pollingIntervalMs = account.optInt("syncIntervalMinutes", 2) .coerceIn(2, 60) * 60_000L val session = Session.getInstance(props, credentials(account)) - val store = session.getStore("imap") + val store = session.getStore(protocol) try { store.connect( account.optString("imapHost"), @@ -782,9 +783,9 @@ internal object AndroidMailService { } } - private fun withStore(account: JSONObject, block: (Session, Store) -> T): T { - val session = Session.getInstance(imapProperties(account), credentials(account)) - val store = session.getStore("imap") + private fun withStore(account: JSONObject, block: (Session, Store) -> T): T { + val session = Session.getInstance(imapProperties(account), credentials(account)) + val store = session.getStore(imapProtocol(account)) try { store.connect( account.optString("imapHost"), @@ -798,37 +799,28 @@ internal object AndroidMailService { } } - private fun credentials(account: JSONObject) = object : Authenticator() { + private fun credentials(account: JSONObject) = object : Authenticator() { override fun getPasswordAuthentication() = PasswordAuthentication( account.optString("email"), account.optString("password") ) } - private fun imapProperties(account: JSONObject) = Properties().apply { - setProperty("mail.store.protocol", "imap") - setProperty("mail.imap.host", account.optString("imapHost")) - setProperty("mail.imap.port", account.optInt("imapPort", 143).toString()) - setProperty("mail.imap.auth", "true") - setProperty("mail.imap.starttls.enable", "true") - setProperty("mail.imap.starttls.required", "true") - setProperty("mail.imap.ssl.checkserveridentity", "true") - setProperty("mail.imap.connectiontimeout", "20000") - setProperty("mail.imap.timeout", "30000") - setProperty("mail.imap.writetimeout", "30000") - } - - private fun smtpProperties(account: JSONObject) = Properties().apply { - setProperty("mail.smtp.host", account.optString("smtpHost")) - setProperty("mail.smtp.port", account.optInt("smtpPort", 587).toString()) - setProperty("mail.smtp.auth", "true") - setProperty("mail.smtp.starttls.enable", "true") - setProperty("mail.smtp.starttls.required", "true") - setProperty("mail.smtp.ssl.checkserveridentity", "true") - setProperty("mail.smtp.connectiontimeout", "20000") - setProperty("mail.smtp.timeout", "30000") - setProperty("mail.smtp.writetimeout", "30000") - } + private fun imapProperties(account: JSONObject) = Properties().apply { + putAll(AndroidMailTransport.imapProperties(MailServerConnection( + account.optString("imapHost"), + account.optInt("imapPort", 143), + account.optBoolean("imapSecure", false) + ))) + } + + private fun imapProtocol(account: JSONObject) = if (account.optBoolean("imapSecure", false)) "imaps" else "imap" + + private fun smtpProperties(account: JSONObject) = AndroidMailTransport.smtpProperties(MailServerConnection( + account.optString("smtpHost"), + account.optInt("smtpPort", 587), + account.optBoolean("smtpSecure", false) + )) private fun displayName(account: JSONObject) = account.optString("displayName").replace(Regex("[\\r\\n]"), " ").take(80) diff --git a/android/app/src/main/java/studio/daybreak/mail/AndroidMailTransport.kt b/android/app/src/main/java/studio/daybreak/mail/AndroidMailTransport.kt new file mode 100644 index 0000000..1bac3de --- /dev/null +++ b/android/app/src/main/java/studio/daybreak/mail/AndroidMailTransport.kt @@ -0,0 +1,45 @@ +package studio.daybreak.mail + +import java.util.Properties + +internal data class MailServerConnection( + val host: String, + val port: Int, + val secure: Boolean +) + +internal object AndroidMailTransport { + fun imapProperties(server: MailServerConnection): Properties = Properties().apply { + val protocol = if (server.secure) "imaps" else "imap" + setProperty("mail.store.protocol", protocol) + setProperty("mail.$protocol.host", server.host) + setProperty("mail.$protocol.port", server.port.toString()) + setProperty("mail.$protocol.auth", "true") + setProperty("mail.$protocol.ssl.checkserveridentity", "true") + if (server.secure) { + setProperty("mail.$protocol.ssl.enable", "true") + } else { + setProperty("mail.$protocol.starttls.enable", "true") + setProperty("mail.$protocol.starttls.required", "true") + } + setProperty("mail.$protocol.connectiontimeout", "20000") + setProperty("mail.$protocol.timeout", "30000") + setProperty("mail.$protocol.writetimeout", "30000") + } + + fun smtpProperties(server: MailServerConnection): Properties = Properties().apply { + setProperty("mail.smtp.host", server.host) + setProperty("mail.smtp.port", server.port.toString()) + setProperty("mail.smtp.auth", "true") + setProperty("mail.smtp.ssl.checkserveridentity", "true") + if (server.secure) { + setProperty("mail.smtp.ssl.enable", "true") + } else { + setProperty("mail.smtp.starttls.enable", "true") + setProperty("mail.smtp.starttls.required", "true") + } + setProperty("mail.smtp.connectiontimeout", "20000") + setProperty("mail.smtp.timeout", "30000") + setProperty("mail.smtp.writetimeout", "30000") + } +} diff --git a/android/app/src/main/java/studio/daybreak/mail/EpMailPlugin.kt b/android/app/src/main/java/studio/daybreak/mail/EpMailPlugin.kt index 799c249..517990d 100644 --- a/android/app/src/main/java/studio/daybreak/mail/EpMailPlugin.kt +++ b/android/app/src/main/java/studio/daybreak/mail/EpMailPlugin.kt @@ -476,12 +476,17 @@ class EpMailPlugin : Plugin() { private fun normalizeAccount(input: JSONObject): JSONObject { val email = input.optString("email").trim() val password = input.optString("password") - val displayName = input.optString("displayName").trim().take(80) - val imapHost = input.optString("imapHost").trim() - val smtpHost = input.optString("smtpHost").trim() - require(EMAIL.matches(email) && password.isNotBlank() && displayName.isNotBlank() && imapHost.isNotBlank() && smtpHost.isNotBlank()) { - "Enter a valid email, account display name, password, and both mail server names." - } + val displayName = input.optString("displayName").trim().take(80) + val imapHost = input.optString("imapHost").trim() + val smtpHost = input.optString("smtpHost").trim() + val imapPort = input.optInt("imapPort", 143) + val smtpPort = input.optInt("smtpPort", 587) + require(EMAIL.matches(email) && password.isNotBlank() && displayName.isNotBlank() && imapHost.isNotBlank() && smtpHost.isNotBlank()) { + "Enter a valid email, account display name, password, and both mail server names." + } + require(imapPort in 1..65535 && smtpPort in 1..65535) { + "Enter valid IMAP and SMTP ports (1–65535)." + } return JSONObject() .put("id", input.optString("id").ifBlank { UUID.randomUUID().toString() }) .put("email", email) @@ -495,8 +500,10 @@ class EpMailPlugin : Plugin() { require(it in setOf(2, 5, 15, 30, 60)) { "Choose a supported mailbox sync interval." } }) .put("rules", normalizeRules(input.optJSONArray("rules"))) - .put("imapPort", input.optInt("imapPort", 143)) - .put("smtpPort", input.optInt("smtpPort", 587)) + .put("imapPort", imapPort) + .put("smtpPort", smtpPort) + .put("imapSecure", input.optBoolean("imapSecure", false)) + .put("smtpSecure", input.optBoolean("smtpSecure", false)) } private fun normalizeRules(input: JSONArray?): JSONArray { diff --git a/android/app/src/main/java/studio/daybreak/mail/MainActivity.java b/android/app/src/main/java/studio/daybreak/mail/MainActivity.java index 91cc237..a7652cd 100644 --- a/android/app/src/main/java/studio/daybreak/mail/MainActivity.java +++ b/android/app/src/main/java/studio/daybreak/mail/MainActivity.java @@ -8,10 +8,10 @@ import androidx.core.app.ActivityCompat; import com.getcapacitor.BridgeActivity; public class MainActivity extends BridgeActivity { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - registerPlugin(EpMailPlugin.class); + @Override + public void onCreate(Bundle savedInstanceState) { + registerPlugin(EpMailPlugin.class); + super.onCreate(savedInstanceState); if (Build.VERSION.SDK_INT >= 33 && checkSelfPermission(Manifest.permission.POST_NOTIFICATIONS) != PackageManager.PERMISSION_GRANTED) { ActivityCompat.requestPermissions(this, new String[] { Manifest.permission.POST_NOTIFICATIONS }, 701); } diff --git a/android/app/src/test/java/studio/daybreak/mail/AndroidMailTransportTest.kt b/android/app/src/test/java/studio/daybreak/mail/AndroidMailTransportTest.kt new file mode 100644 index 0000000..3a8d60e --- /dev/null +++ b/android/app/src/test/java/studio/daybreak/mail/AndroidMailTransportTest.kt @@ -0,0 +1,46 @@ +package studio.daybreak.mail + +import org.junit.Assert.assertEquals +import org.junit.Assert.assertNull +import org.junit.Test + +class AndroidMailTransportTest { + @Test + fun imapUsesRequiredStarttlsWhenImplicitTlsIsOff() { + val properties = AndroidMailTransport.imapProperties( + MailServerConnection("imap.example.test", 143, false) + ) + assertEquals("imap", properties.getProperty("mail.store.protocol")) + assertEquals("true", properties.getProperty("mail.imap.starttls.enable")) + assertEquals("true", properties.getProperty("mail.imap.starttls.required")) + assertEquals("true", properties.getProperty("mail.imap.ssl.checkserveridentity")) + assertNull(properties.getProperty("mail.imap.ssl.enable")) + } + + @Test + fun imapUsesImplicitTlsForSecurePort() { + val properties = AndroidMailTransport.imapProperties( + MailServerConnection("imap.example.test", 993, true) + ) + assertEquals("imaps", properties.getProperty("mail.store.protocol")) + assertEquals("true", properties.getProperty("mail.imaps.ssl.enable")) + assertEquals("true", properties.getProperty("mail.imaps.ssl.checkserveridentity")) + assertNull(properties.getProperty("mail.imaps.starttls.required")) + } + + @Test + fun smtpSupportsStarttlsAndImplicitTlsWithoutDowngrade() { + val startTls = AndroidMailTransport.smtpProperties( + MailServerConnection("smtp.example.test", 587, false) + ) + assertEquals("true", startTls.getProperty("mail.smtp.starttls.enable")) + assertEquals("true", startTls.getProperty("mail.smtp.starttls.required")) + + val implicitTls = AndroidMailTransport.smtpProperties( + MailServerConnection("smtp.example.test", 465, true) + ) + assertEquals("true", implicitTls.getProperty("mail.smtp.ssl.enable")) + assertEquals("true", implicitTls.getProperty("mail.smtp.ssl.checkserveridentity")) + assertNull(implicitTls.getProperty("mail.smtp.starttls.required")) + } +} diff --git a/app.js b/app.js index f3a973e..a2da58c 100644 --- a/app.js +++ b/app.js @@ -4,11 +4,12 @@ const state = window.epMailState; const $=s=>document.querySelector(s), $$=s=>[...document.querySelectorAll(s)]; function esc(x){return String(x).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]))} const { safeRemoteImageUrl, sanitizeMailHtml } = window.epMailFeatures.contentSecurity; -function renderList(){let rows=state.messages.filter(m=>{if(state.activeFolder==='Starred'&&!m.star)return false;if(state.activeFolder==='Inbox'&&m.archived)return false;if(state.activeFolder==='Archive'&&!m.archived)return false;if(state.activeFolder==='Trash'&&!m.deleted)return false;if(state.activeFolder==='Sent'&&!m.sent)return false;if(state.activeFolder==='Drafts')return false;if(state.activeFolder==='Snoozed')return false;if(m.deleted&&state.activeFolder!=='Trash')return false;return !state.query||`${m.sender} ${m.email} ${m.subject} ${m.snippet}`.toLowerCase().includes(state.query.toLowerCase())});$('#message-list').innerHTML=rows.length?rows.map(m=>`
${m.initials}
${esc(m.sender)}
${esc(m.subject)}
${esc(m.snippet)}
${esc(m.time)}
`).join(''):`
⌕

No messages here

Try another folder or search.

`;$$('.message').forEach(row=>{row.addEventListener('click',e=>{if(e.target.closest('.row-check')){const id=+row.dataset.id;state.selectedIds.has(id)?state.selectedIds.delete(id):state.selectedIds.add(id);return}if(e.target.closest('.star')){const m=state.messages.find(x=>x.id===+row.dataset.id);m.star=!m.star;renderList();return}openMessage(+row.dataset.id)});});if(!rows.length)$('#reader-pane').innerHTML=emptyReader()} -function openMessage(id){ - state.activeMessage=id; - const m=state.messages.find(x=>x.id===id); - if(!m)return; +function renderList(){let rows=state.messages.filter(m=>{if(state.activeFolder==='Starred'&&!m.star)return false;if(state.activeFolder==='Inbox'&&m.archived)return false;if(state.activeFolder==='Archive'&&!m.archived)return false;if(state.activeFolder==='Trash'&&!m.deleted)return false;if(state.activeFolder==='Sent'&&!m.sent)return false;if(state.activeFolder==='Drafts')return false;if(state.activeFolder==='Snoozed')return false;if(m.deleted&&state.activeFolder!=='Trash')return false;return !state.query||`${m.sender} ${m.email} ${m.subject} ${m.snippet}`.toLowerCase().includes(state.query.toLowerCase())});$('#message-list').innerHTML=rows.length?rows.map(m=>`
${m.initials}
${esc(m.sender)}
${esc(m.subject)}
${esc(m.snippet)}
${esc(m.time)}
`).join(''):`
⌕

No messages here

Try another folder or search.

`;$$('.message').forEach(row=>{row.addEventListener('click',e=>{if(e.target.closest('.row-check')){const id=+row.dataset.id;state.selectedIds.has(id)?state.selectedIds.delete(id):state.selectedIds.add(id);return}if(e.target.closest('.star')){const m=state.messages.find(x=>x.id===+row.dataset.id);m.star=!m.star;renderList();return}openMessage(+row.dataset.id)});});if(!rows.length){document.body.classList.remove('reader-open');$('#reader-pane').innerHTML=emptyReader()}} +function openMessage(id){ + state.activeMessage=id; + const m=state.messages.find(x=>x.id===id); + if(!m){state.activeMessage=null;document.body.classList.remove('reader-open');return;} + document.body.classList.add('reader-open'); m.unread=false; renderList(); let safeHtml={html:'',remoteImageCount:0}; @@ -16,7 +17,8 @@ function openMessage(id){ const body=safeHtml.html?safeHtml.html:`${m.body.map(p=>`

${esc(p)}

`).join('')}

${esc(m.signature||m.sender)}

`; const imageNotice=safeHtml.remoteImageCount?`

This message contains ${safeHtml.remoteImageCount} remote image${safeHtml.remoteImageCount===1?'':'s'}. Loading them can reveal your network address and that you opened this message to the image host.

`:''; const attachments=(m.attachments?.length?m.attachments:m.attachment?[{filename:m.attachment,size:m.size}]:[]).map(file=>`
${file.filename.toLowerCase().endsWith('.pdf')?'▤':'▧'}
${esc(file.filename)}${file.size?(typeof file.size==='string'?esc(file.size):`${(file.size/1048576).toFixed(1)} MB`):'Attachment'}
`).join(''); - $('#reader-pane').innerHTML=`
${m.tags.map((t,i)=>`${esc(t)}`).join('')}

${esc(m.subject)}

${m.initials}
${esc(m.sender)}${esc(m.email)} · to me
${esc(m.date)}
${imageNotice}
${body}${attachments}
`; + $('#reader-pane').innerHTML=`
${m.tags.map((t,i)=>`${esc(t)}`).join('')}

${esc(m.subject)}

${m.initials}
${esc(m.sender)}${esc(m.email)} · to me
${esc(m.date)}
${imageNotice}
${body}${attachments}
`; + $('#reader-back').onclick=()=>{state.activeMessage=null;document.body.classList.remove('reader-open');$('#reader-pane').innerHTML=emptyReader();renderList()}; $('#load-remote-images')?.addEventListener('click',()=>{ $('#reader-pane').querySelectorAll('.reader-body img[data-remote-src]').forEach(image=>{ const url=safeRemoteImageUrl(image.getAttribute('data-remote-src')); @@ -25,8 +27,8 @@ function openMessage(id){ }); $('.remote-image-notice')?.remove(); }); - $('#reader-archive').onclick=()=>{m.archived=true;toast('Moved to Archive');renderList();$('#reader-pane').innerHTML=emptyReader()}; - $('#reader-delete').onclick=()=>{m.deleted=true;toast('Moved to Trash');renderList();$('#reader-pane').innerHTML=emptyReader()}; + $('#reader-archive').onclick=()=>{m.archived=true;state.activeMessage=null;document.body.classList.remove('reader-open');toast('Moved to Archive');renderList();$('#reader-pane').innerHTML=emptyReader()}; + $('#reader-delete').onclick=()=>{m.deleted=true;state.activeMessage=null;document.body.classList.remove('reader-open');toast('Moved to Trash');renderList();$('#reader-pane').innerHTML=emptyReader()}; $('#reader-star').onclick=()=>{m.star=!m.star;renderList();openMessage(id)}; $('#reply').onclick=()=>showCompose(m); $('#forward').onclick=()=>showCompose(m,true); @@ -35,7 +37,7 @@ function emptyReader(){return `
`;const close=()=>root.innerHTML='';$('.modal-close').onclick=close;$('#discard').onclick=close;$('.modal-overlay').addEventListener('click',e=>{if(e.target.classList.contains('modal-overlay'))close()});$('#send').onclick=()=>{const to=$('#compose-to').value.trim();if(!to){$('#compose-to').focus();toast('Add a recipient to send your message');return}const subject=$('#compose-subject').value.trim()||'(no subject)';const body=$('#compose-body').value;state.messages.unshift({id:Date.now(),initials:(window.epMailFeatures.productivity?.profileName||window.epMailFeatures.mail.connectedAccount?.email?.split('@')[0]||'Me').split(/\\s+/).map(x=>x[0]).join('').slice(0,2).toUpperCase(),color:'#dce9dd',sender:(window.epMailFeatures.productivity?.profileName||window.epMailFeatures.mail.connectedAccount?.email?.split('@')[0]||'Me'),email:(window.epMailFeatures.mail.connectedAccount?.email||''),subject,snippet:body||'No message text',time:'Just now',date:'Today',unread:false,star:false,sent:true,tags:['Sent'],body:body.split('\n').filter(Boolean)});close();toast('Message sent');renderList()};$('#compose-to').focus()} function switchView(view){state.activeView=view;$$('.rail-button[data-view]').forEach(b=>b.classList.toggle('active',b.dataset.view===view));$('.mail-layout').classList.toggle('hidden',view!=='mail');$('#calendar-view').classList.toggle('hidden',view!=='calendar');$('#contacts-view').classList.toggle('hidden',view!=='contacts');$('#sidebar-title').textContent=view==='mail'?state.activeFolder:view==='calendar'?'Calendar':'Contacts';$('#crumb-parent').textContent=view==='mail'?'Mail':'Workspace';$('#crumb-current').textContent=view==='mail'?state.activeFolder:view==='calendar'?'Calendar':'Contacts';if(view==='calendar')window.epMailFeatures.productivity.renderCalendar();if(view==='contacts')window.epMailFeatures.productivity.renderContacts();} -$$('.folder').forEach(b=>b.onclick=()=>{state.activeFolder=b.dataset.folder;$$('.folder').forEach(x=>x.classList.toggle('active',x===b));$('#sidebar-title').textContent=state.activeFolder;$('#crumb-current').textContent=state.activeFolder;renderList()});$$('.rail-button[data-view]').forEach(b=>b.onclick=()=>{switchView(b.dataset.view);});function applyTheme(theme,showToast=false){const themes=['daylight','wasteland','ep-wasteland','ep-daylight'];const selected=themes.includes(theme)?theme:'ep-wasteland';const info={daylight:{name:'Eternity Daylight',icon:'☼'},wasteland:{name:'Wasteland',icon:'☾'},'ep-wasteland':{name:'EP Wasteland',icon:'◈'},'ep-daylight':{name:'EP Daylight',icon:'☀'}}[selected];document.body.classList.remove('wasteland','ep-wasteland','ep-daylight');if(selected!=='daylight')document.body.classList.add(selected);document.querySelector('meta[name=theme-color]')?.setAttribute('content',selected==='ep-wasteland'?'#161210':selected==='ep-daylight'?'#f1f1e9':selected==='wasteland'?'#eee8db':'#f4f5f1');localStorage.setItem('daybreak-theme',selected);const brandLogo=$("#brand-logo");if(brandLogo)brandLogo.src=selected==='ep-wasteland'?'logo-ep-wasteland.svg':'logo-ep-daylight.svg';if(showToast)toast(`${info.name} theme`)}applyTheme(localStorage.getItem('daybreak-theme')||'ep-wasteland');$('#search').oninput=e=>{state.query=e.target.value;renderList()};$('#search').addEventListener('keydown',e=>{if(e.key==='Escape'){e.target.value='';state.query='';renderList()}});$('#compose').onclick=()=>showCompose();$('#refresh').onclick=()=>{toast('You’re all up to date');renderList()};$('#select-all').onclick=()=>{const visible=state.messages.filter(m=>!m.archived&&!m.deleted);const all=visible.every(m=>state.selectedIds.has(m.id));visible.forEach(m=>all?state.selectedIds.delete(m.id):state.selectedIds.add(m.id));renderList()};$('#archive-selected').onclick=()=>{state.messages.filter(m=>state.selectedIds.has(m.id)).forEach(m=>m.archived=true);state.selectedIds.clear();renderList();toast('Selected messages archived')};$('#delete-selected').onclick=()=>{state.messages.filter(m=>state.selectedIds.has(m.id)).forEach(m=>m.deleted=true);state.selectedIds.clear();renderList();toast('Selected messages moved to Trash')};$('#sidebar-menu').onclick=()=>toast('More mailbox options');$$('.settings-button,.help-button,.tiny-plus,.text-button').forEach(b=>b.onclick=()=>toast('You’re all caught up'));document.addEventListener('keydown',e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==='k'){e.preventDefault();$('#search').focus()}if(e.key==='Escape')$('#modal-root').innerHTML=''});$('#today-label').textContent=new Intl.DateTimeFormat('en-US',{weekday:'long',month:'long',day:'numeric'}).format(new Date()).toUpperCase();$('#reader-pane').innerHTML=emptyReader();renderList();openMessage(state.activeMessage); +$$('.folder').forEach(b=>b.onclick=()=>{state.activeFolder=b.dataset.folder;state.activeMessage=null;document.body.classList.remove('reader-open');$('#reader-pane').innerHTML=emptyReader();$$('.folder').forEach(x=>x.classList.toggle('active',x===b));$('#sidebar-title').textContent=state.activeFolder;$('#crumb-current').textContent=state.activeFolder;renderList()});$$('.rail-button[data-view]').forEach(b=>b.onclick=()=>{document.body.classList.remove('reader-open');switchView(b.dataset.view);});function applyTheme(theme,showToast=false){const themes=['daylight','wasteland','ep-wasteland','ep-daylight'];const selected=themes.includes(theme)?theme:'ep-wasteland';const info={daylight:{name:'Eternity Daylight',icon:'☼'},wasteland:{name:'Wasteland',icon:'☾'},'ep-wasteland':{name:'EP Wasteland',icon:'◈'},'ep-daylight':{name:'EP Daylight',icon:'☀'}}[selected];document.body.classList.remove('wasteland','ep-wasteland','ep-daylight');if(selected!=='daylight')document.body.classList.add(selected);document.querySelector('meta[name=theme-color]')?.setAttribute('content',selected==='ep-wasteland'?'#161210':selected==='ep-daylight'?'#f1f1e9':selected==='wasteland'?'#eee8db':'#f4f5f1');localStorage.setItem('daybreak-theme',selected);const brandLogo=$("#brand-logo");if(brandLogo)brandLogo.src=selected==='ep-wasteland'?'logo-ep-wasteland.svg':'logo-ep-daylight.svg';if(showToast)toast(`${info.name} theme`)}applyTheme(localStorage.getItem('daybreak-theme')||'ep-wasteland');$('#search').oninput=e=>{state.query=e.target.value;renderList()};$('#search').addEventListener('keydown',e=>{if(e.key==='Escape'){e.target.value='';state.query='';renderList()}});$('#compose').onclick=()=>showCompose();$('#refresh').onclick=()=>{toast('You’re all up to date');renderList()};$('#select-all').onclick=()=>{const visible=state.messages.filter(m=>!m.archived&&!m.deleted);const all=visible.every(m=>state.selectedIds.has(m.id));visible.forEach(m=>all?state.selectedIds.delete(m.id):state.selectedIds.add(m.id));renderList()};$('#archive-selected').onclick=()=>{state.messages.filter(m=>state.selectedIds.has(m.id)).forEach(m=>m.archived=true);state.selectedIds.clear();renderList();toast('Selected messages archived')};$('#delete-selected').onclick=()=>{state.messages.filter(m=>state.selectedIds.has(m.id)).forEach(m=>m.deleted=true);state.selectedIds.clear();renderList();toast('Selected messages moved to Trash')};$('#sidebar-menu').onclick=()=>toast('More mailbox options');$$('.settings-button,.help-button,.tiny-plus,.text-button').forEach(b=>b.onclick=()=>toast('You’re all caught up'));document.addEventListener('keydown',e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==='k'){e.preventDefault();$('#search').focus()}if(e.key==='Escape')$('#modal-root').innerHTML=''});$('#today-label').textContent=new Intl.DateTimeFormat('en-US',{weekday:'long',month:'long',day:'numeric'}).format(new Date()).toUpperCase();$('#reader-pane').innerHTML=emptyReader();renderList();openMessage(state.activeMessage); window.epMailShell = Object.freeze({ state, diff --git a/mail-ui.js b/mail-ui.js index c3a4302..1197eb2 100644 --- a/mail-ui.js +++ b/mail-ui.js @@ -228,7 +228,7 @@ function openMailAccount(existingAccount = null) { : ``}
`).join(''); - root.innerHTML = ``; + root.innerHTML = ``; const authMethodRow = document.createElement('label'); authMethodRow.className = 'compose-line'; authMethodRow.innerHTML = 'Sign-in method'; @@ -249,7 +249,11 @@ function openMailAccount(existingAccount = null) { if (oauthMethodOption) oauthMethodOption.disabled = existingAccount?.authMethod !== 'oauth2'; const passwordRow = selectMailUi('#mail-account-password').closest('.compose-line'); const imapRow = selectMailUi('#mail-account-imap').closest('.compose-line'); + const imapPortRow = selectMailUi('#mail-account-imap-port').closest('.compose-line'); + const imapSecureRow = selectMailUi('#mail-account-imap-secure').closest('.compose-line'); const smtpRow = selectMailUi('#mail-account-smtp').closest('.compose-line'); + const smtpPortRow = selectMailUi('#mail-account-smtp-port').closest('.compose-line'); + const smtpSecureRow = selectMailUi('#mail-account-smtp-secure').closest('.compose-line'); const authNote = selectMailUi('#modal-root .compose-fields > .account-note'); authMethodSelect.value = existingAccount?.authMethod === 'oauth2' ? 'oauth2' : 'password'; if (existingAccount?.oauthProvider) oauthProviderSelect.value = existingAccount.oauthProvider; @@ -258,7 +262,11 @@ function openMailAccount(existingAccount = null) { ? { imap: 'imap.gmail.com', smtp: 'smtp.gmail.com' } : { imap: 'outlook.office365.com', smtp: 'smtp.office365.com' }; selectMailUi('#mail-account-imap').value = servers.imap; + selectMailUi('#mail-account-imap-port').value = '993'; + selectMailUi('#mail-account-imap-secure').checked = true; selectMailUi('#mail-account-smtp').value = servers.smtp; + selectMailUi('#mail-account-smtp-port').value = '587'; + selectMailUi('#mail-account-smtp-secure').checked = false; }; const updateAuthFields = () => { const oauth = authMethodSelect.value === 'oauth2'; @@ -267,12 +275,16 @@ function openMailAccount(existingAccount = null) { reauthorizeRow.hidden = !oauth || !editing; passwordRow.hidden = oauth; imapRow.hidden = oauth; + imapPortRow.hidden = oauth; + imapSecureRow.hidden = oauth; smtpRow.hidden = oauth; + smtpPortRow.hidden = oauth; + smtpSecureRow.hidden = oauth; authNote.textContent = oauth ? 'Sign in in your browser. Configure the provider client ID in the desktop environment; OAuth refresh tokens are stored in encrypted credential storage.' : configuredOAuthProviders && configuredOAuthProviders.size === 0 ? 'Password sign-in is available. To enable OAuth2, configure EP_MAIL_GOOGLE_OAUTH_CLIENT_ID and/or EP_MAIL_MICROSOFT_OAUTH_CLIENT_ID, then restart ep-mail.' - : 'Your password is encrypted with this computer\'s credential storage. Connections require TLS.'; + : 'Credentials are stored encrypted. Connections require verified TLS.'; selectMailUi('#mail-account-password').placeholder = editing && existingAccount?.authMethod !== 'oauth2' ? 'Leave blank to keep current password' : 'Enter mailbox password'; }; @@ -332,6 +344,12 @@ function openMailAccount(existingAccount = null) { const name = selectMailUi('#mail-account-display-name').value.trim(); if (!name) { status.textContent = 'Enter a display name for this mail account.'; selectMailUi('#mail-account-display-name').focus(); return; } if (authMethod === 'password' && !password && (!editing || existingAccount?.authMethod === 'oauth2')) { status.textContent = 'Enter the mailbox password to connect.'; selectMailUi('#mail-account-password').focus(); return; } + const imapPort = Number(selectMailUi('#mail-account-imap-port').value); + const smtpPort = Number(selectMailUi('#mail-account-smtp-port').value); + if (authMethod === 'password' && (![imapPort, smtpPort].every(port => Number.isInteger(port) && port >= 1 && port <= 65535))) { + status.textContent = 'Enter valid IMAP and SMTP ports (1–65535).'; + return; + } button.disabled = true; const reauthorizeOAuth = authMethod === 'oauth2' && editing && selectMailUi('#mail-account-reauthorize').checked; button.textContent = authMethod === 'oauth2' && (!editing || reauthorizeOAuth) ? 'Starting OAuth2 sign-in…' : editing ? 'Checking updated settings…' : 'Checking secure connections…'; @@ -346,8 +364,12 @@ function openMailAccount(existingAccount = null) { ...(authMethod === 'oauth2' ? { oauthProvider } : {}), ...(editing && authMethod === 'oauth2' ? { reauthorizeOAuth } : {}), displayName: name, - imapHost: selectMailUi('#mail-account-imap').value, - smtpHost: selectMailUi('#mail-account-smtp').value, + imapHost: selectMailUi('#mail-account-imap').value, + imapPort, + imapSecure: selectMailUi('#mail-account-imap-secure').checked, + smtpHost: selectMailUi('#mail-account-smtp').value, + smtpPort, + smtpSecure: selectMailUi('#mail-account-smtp-secure').checked, signature: selectMailUi('#mail-account-signature').value, notificationsEnabled: selectMailUi('#mail-account-notifications').checked, syncIntervalMinutes: Number(selectMailUi('#mail-account-sync-interval').value), diff --git a/package-lock.json b/package-lock.json index 572064a..d1cdc90 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ep-mail", - "version": "0.5.3", + "version": "0.5.4", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ep-mail", - "version": "0.5.3", + "version": "0.5.4", "dependencies": { "@capacitor/android": "^8.5.2", "@capacitor/core": "^8.5.2", diff --git a/package.json b/package.json index 29e080a..6c66a56 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ep-mail", - "version": "0.5.3", + "version": "0.5.4", "private": true, "description": "Eternity Project mail client", "homepage": "https://git.eternityproject.fi/thuttu/ep-mail-client", diff --git a/service-worker.js b/service-worker.js index eb59867..57acb96 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1,5 +1,5 @@ -const CACHE='ep-mail-v12'; +const CACHE='ep-mail-v15'; const FILES=['./','./index.html','./styles.css','./branding.css','./renderer-state.js','./mail-content-security.js','./renderer-mail-api.js','./app.js','./platform-bridge-loader.js','./platform-bridge.js','./mail-ui.js','./productivity.js','./snooze-ui.js','./account-ui.js','./dav-ui.js','./shortcuts.js','./attachments.js','./pgp-ui.js','./pgp-mail-ui.js','./manifest.webmanifest','./icon.svg','./logo-ep-daylight.svg','./logo-ep-wasteland.svg']; -self.addEventListener('install',event=>event.waitUntil(caches.open(CACHE).then(cache=>cache.addAll(FILES)))); -self.addEventListener('activate',event=>event.waitUntil(caches.keys().then(keys=>Promise.all(keys.filter(k=>k!==CACHE).map(k=>caches.delete(k)))))); +self.addEventListener('install',event=>event.waitUntil(caches.open(CACHE).then(cache=>cache.addAll(FILES)).then(()=>self.skipWaiting()))); +self.addEventListener('activate',event=>event.waitUntil(caches.keys().then(keys=>Promise.all(keys.filter(k=>k!==CACHE).map(k=>caches.delete(k)))).then(()=>self.clients.claim()))); self.addEventListener('fetch',event=>{if(event.request.method!=='GET')return;event.respondWith(caches.match(event.request).then(cached=>cached||fetch(event.request).then(response=>{if(new URL(event.request.url).origin===location.origin){const copy=response.clone();caches.open(CACHE).then(cache=>cache.put(event.request,copy))}return response}).catch(()=>caches.match('./index.html'))))}); diff --git a/styles.css b/styles.css index 2643ed1..6a5f217 100644 --- a/styles.css +++ b/styles.css @@ -1,8 +1,8 @@ :root{font-family:'DM Sans',Inter,ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif;color:#252a28;background:#f4f5f1;font-synthesis:none;text-rendering:optimizeLegibility;--bg:#f4f5f1;--panel:#fff;--line:#eaede8;--text:#252a28;--muted:#8b918b;--subtle:#f7f8f5;--accent:#55816c;--accent-soft:#edf4ef;--shadow:0 2px 10px #2636290b} -*{box-sizing:border-box}body{margin:0;min-width:760px;min-height:100vh;background:var(--bg);color:var(--text)}button,input,textarea{font:inherit}button{color:inherit;cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #7eae90;outline-offset:2px}.app-shell{height:100vh;min-height:640px;display:flex;overflow:hidden}.rail{width:66px;flex:none;background:#edf0ea;border-right:1px solid #e5e9e2;display:flex;align-items:center;flex-direction:column;padding:17px 0 13px;gap:10px}.brand-mark{height:35px;width:35px;border-radius:12px;background:#5b826c;color:white;display:grid;place-items:center;font-size:24px;margin-bottom:21px;box-shadow:0 3px 8px #476c541d}.rail-button{height:39px;width:39px;border:0;background:transparent;color:#7e8780;border-radius:11px;font-size:20px;display:grid;place-items:center;transition:.18s}.rail-button:hover{background:#e2e8e1;color:#446a54}.rail-button.active{color:#477253;background:#dce9dd}.rail-spacer{flex:1}.avatar{border:0;border-radius:50%;height:34px;width:34px;background:#e7cbb6;color:#614c3c;font-size:11px;font-weight:700;display:grid;place-items:center}.avatar.tiny{height:27px;width:27px;font-size:9px} +*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:var(--bg);color:var(--text)}button,input,textarea{font:inherit}button{color:inherit;cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #7eae90;outline-offset:2px}.app-shell{height:100vh;min-height:640px;display:flex;overflow:hidden}.rail{width:66px;flex:none;background:#edf0ea;border-right:1px solid #e5e9e2;display:flex;align-items:center;flex-direction:column;padding:17px 0 13px;gap:10px}.brand-mark{height:35px;width:35px;border-radius:12px;background:#5b826c;color:white;display:grid;place-items:center;font-size:24px;margin-bottom:21px;box-shadow:0 3px 8px #476c541d}.rail-button{height:39px;width:39px;border:0;background:transparent;color:#7e8780;border-radius:11px;font-size:20px;display:grid;place-items:center;transition:.18s}.rail-button:hover{background:#e2e8e1;color:#446a54}.rail-button.active{color:#477253;background:#dce9dd}.rail-spacer{flex:1}.avatar{border:0;border-radius:50%;height:34px;width:34px;background:#e7cbb6;color:#614c3c;font-size:11px;font-weight:700;display:grid;place-items:center}.avatar.tiny{height:27px;width:27px;font-size:9px} .sidebar{width:244px;flex:none;background:#fff;border-right:1px solid var(--line);padding:26px 17px 14px;display:flex;flex-direction:column}.sidebar-head{display:flex;align-items:center;justify-content:space-between;padding:0 5px;margin-bottom:21px}.eyebrow{color:#969c95;font-size:9px;font-weight:700;letter-spacing:1.25px;margin:0 0 5px}.sidebar-head h1{font-family:'DM Serif Display',Georgia,serif;font-size:24px;font-weight:400;margin:0}.icon-button{border:0;background:transparent;color:#89918a;height:30px;min-width:30px;border-radius:8px;font-size:19px;display:inline-grid;place-items:center}.icon-button:hover{background:var(--subtle);color:#47544a}.account-card{display:flex;align-items:center;gap:10px;padding:10px 9px;background:#f7f8f5;border:1px solid #eff1ec;border-radius:10px;margin:0 0 22px}.account-avatar{height:30px;width:30px;border-radius:9px;background:#dce9dd;color:#477253;display:grid;place-items:center;font-family:Georgia,serif;font-weight:bold}.account-info{min-width:0;display:flex;flex-direction:column;gap:2px;flex:1}.account-info strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-info span{color:#929891;font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.online-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#70ad7b}.folder-nav{display:grid;gap:3px}.folder{width:100%;border:0;background:transparent;display:flex;align-items:center;gap:12px;text-align:left;padding:9px 10px;border-radius:8px;font-size:11px;color:#707970}.folder:hover,.label-link:hover{background:#f6f8f5}.folder.active{background:#edf4ee;color:#487354;font-weight:600}.nav-glyph{width:15px;text-align:center;font-size:15px;color:#879188}.folder.active .nav-glyph{color:#578366}.count{margin-left:auto;padding:2px 6px;min-width:19px;text-align:center;border-radius:5px;background:#fff;color:#61836a;font-size:9px}.count.muted{color:#969c95}.sidebar-divider{height:1px;background:#edf0ec;margin:18px 4px 16px}.section-label{display:flex;justify-content:space-between;align-items:center;font-size:9px;letter-spacing:1.1px;font-weight:700;color:#a0a59f;padding:0 6px;margin-bottom:9px}.tiny-plus{border:0;background:transparent;color:#929990;font-size:18px}.label-link{border:0;background:transparent;border-radius:7px;text-align:left;display:flex;align-items:center;gap:10px;color:#727970;font-size:11px;padding:8px 10px}.label-dot{width:8px;height:8px;border-radius:50%}.dot-amber{background:#dda854}.dot-blue{background:#79a4c9}.dot-green{background:#82ab83}.sidebar-bottom{margin-top:auto}.storage{padding:13px 10px 14px;border-bottom:1px solid #eef0ec}.storage-top{display:flex;justify-content:space-between;color:#606960;font-size:10px}.storage-top span+span{color:#979d97;font-size:9px}.storage-bar{height:4px;background:#edf0eb;margin:9px 0 7px;border-radius:5px;overflow:hidden}.storage-bar i{display:block;width:28%;height:100%;background:#79a785;border-radius:5px}.storage small{font-size:9px;color:#9ba19a}.settings-button{border:0;background:transparent;color:#7e867f;display:flex;gap:10px;align-items:center;margin:10px 0 0 4px;font-size:11px;padding:7px} .main-area{flex:1;min-width:0;display:flex;flex-direction:column}.topbar{height:57px;flex:none;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 24px}.breadcrumbs{display:flex;align-items:center;gap:10px;font-size:10px;color:#969c96}.breadcrumbs strong{font-weight:600;color:#475048}.crumb-divider{color:#c6cbc5}.top-actions{display:flex;align-items:center;gap:13px}.search-wrap{height:31px;width:218px;background:#f6f7f4;border:1px solid #eff0ec;border-radius:8px;display:flex;align-items:center;padding:0 9px;gap:7px;color:#90978f}.search-wrap>span{font-size:19px}.search-wrap input{border:0;outline:0;background:transparent;width:100%;font-size:10px;color:#3f4740}.search-wrap kbd{font:9px 'DM Sans',sans-serif;border:1px solid #e3e6e1;border-radius:4px;padding:2px 4px;white-space:nowrap;color:#999f99}.help-button{font-size:12px;border:1px solid #e7eae6;border-radius:50%;height:20px;min-width:20px;font-weight:600}.top-avatar{width:27px;height:27px;font-size:9px} -.content-view{flex:1;min-height:0}.mail-layout{display:grid;grid-template-columns:minmax(330px,44%) minmax(340px,1fr);padding:18px 20px 20px;gap:14px}.list-pane,.reader-pane{background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);min-height:0}.list-pane{display:flex;flex-direction:column;overflow:hidden}.list-heading{padding:20px 19px 15px;display:flex;align-items:center;justify-content:space-between}.date-line{font-size:8px;font-weight:700;letter-spacing:1.25px;color:#a0a69f;margin-bottom:7px}.list-heading h2{font-family:'DM Serif Display',Georgia,serif;font-size:20px;font-weight:400;margin:0;color:#303732}.sun{font-family:sans-serif;font-size:14px;color:#dda95f;vertical-align:2px}.compose-button{border:0;border-radius:7px;background:#5b8068;color:white;padding:8px 12px;font-size:10px;font-weight:600;box-shadow:0 2px 4px #406e4f20}.compose-button:hover{background:#476f56}.compose-button span{font-size:15px;vertical-align:-1px;margin-right:4px}.toolbar{height:39px;border-top:1px solid #f2f3f1;border-bottom:1px solid #f0f2ee;display:flex;align-items:center;padding:0 12px;gap:6px;color:#888f88}.toolbar .icon-button{font-size:15px;height:26px;min-width:26px}.tool-checkbox{font-size:14px;color:#818981;border:0;background:transparent;width:25px}.toolbar-divider{height:16px;width:1px;background:#e9ece8;margin:0 3px}.toolbar-spacer{flex:1}.pagination{font-size:9px;color:#90968f;white-space:nowrap}.message-list{overflow-y:auto;flex:1}.message{min-height:68px;display:grid;grid-template-columns:18px 32px minmax(0,1fr) auto;align-items:center;gap:9px;padding:9px 12px;border-bottom:1px solid #f0f2ef;cursor:pointer;transition:background .14s}.message:hover{background:#fafbf9}.message.selected{background:#f3f7f2;box-shadow:inset 2px 0 #669074}.message.unread .sender,.message.unread .subject{font-weight:700;color:#303832}.row-check{appearance:none;width:13px;height:13px;border:1px solid #d7dcd6;border-radius:3px;cursor:pointer;margin:0}.row-check:checked{appearance:auto;accent-color:#63866d}.contact-avatar{width:31px;height:31px;border-radius:50%;display:grid;place-items:center;font-size:9px;font-weight:700;color:#55483d;background:#e9d8c9}.message-body{min-width:0;overflow:hidden}.sender{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#626a63;margin-bottom:4px}.subject{font-size:10px;color:#3e4640;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:3px}.snippet{font-size:9px;color:#a1a69f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-meta{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;padding:2px 0;min-width:31px}.time{font-size:8px;color:#989e98;white-space:nowrap}.star{border:0;background:transparent;color:#c9cec8;font-size:14px;line-height:1;padding:0}.star.on{color:#dcaa56}.list-foot{height:37px;flex:none;border-top:1px solid #f0f2ef;display:flex;align-items:center;justify-content:space-between;padding:0 14px;color:#929991;font-size:9px}.list-foot .online-dot{margin-right:6px}.text-button{border:0;background:transparent;color:#708878;font-size:9px}.reader-pane{overflow-y:auto;padding:0 24px 24px}.reader-empty{height:100%;display:grid;place-items:center;text-align:center;color:#9ca39c}.empty-icon{height:52px;width:52px;margin:0 auto 12px;border-radius:17px;background:#f1f5ef;color:#71937a;display:grid;place-items:center;font-size:24px}.reader-empty h3{font-family:'DM Serif Display',Georgia,serif;font-weight:400;font-size:19px;color:#525a53;margin:0 0 6px}.reader-empty p{font-size:10px;color:#9aa098;margin:0}.reader-header{padding:24px 0 17px;border-bottom:1px solid #edf0ec}.reader-topline{display:flex;align-items:center;justify-content:space-between;margin-bottom:17px}.reader-tags{display:flex;gap:6px}.tag{font-size:8px;border-radius:4px;padding:4px 7px;background:#f4f3e9;color:#a38a52}.tag.green{background:#edf4ee;color:#62816a}.reader-tools{display:flex;gap:2px}.reader-subject{font-family:'DM Serif Display',Georgia,serif;font-size:22px;line-height:1.25;margin:0 0 17px;font-weight:400;color:#343a35}.sender-row{display:flex;align-items:center;gap:9px}.sender-row .contact-avatar{width:34px;height:34px;font-size:10px}.sender-details{min-width:0;flex:1}.sender-details strong{display:block;font-size:10px;color:#434a44}.sender-details span{display:block;font-size:9px;color:#999f99;margin-top:3px}.message-date{font-size:8px;color:#999f99;white-space:nowrap}.reader-body{padding:21px 1px 15px;font-size:11px;line-height:1.85;color:#616a62}.reader-body p{margin:0 0 13px}.reader-body .signoff{margin-top:24px}.attachment{margin-top:18px;padding:11px;border:1px solid #e8ece7;border-radius:8px;display:flex;align-items:center;gap:10px;max-width:260px}.file-icon{height:33px;width:30px;border-radius:6px;background:#f4eeec;color:#ad7466;display:grid;place-items:center;font-size:15px}.attachment-info{flex:1}.attachment-info strong{display:block;font-size:9px;color:#59615a}.attachment-info small{font-size:8px;color:#a1a69f}.download{border:0;background:transparent;color:#8b938b}.reply-bar{border-top:1px solid #edf0ec;padding-top:15px;display:flex;gap:8px}.reply-button{padding:8px 12px;border:1px solid #e3e8e3;border-radius:7px;background:#fff;color:#6e786e;font-size:9px}.reply-button:hover{background:#f6f8f5}.reply-button.primary{background:#5b8068;border-color:#5b8068;color:white}.page-view{padding:22px 28px;overflow:auto}.hidden{display:none!important} +.content-view{flex:1;min-height:0}.mail-layout{display:grid;grid-template-columns:minmax(330px,44%) minmax(340px,1fr);padding:18px 20px 20px;gap:14px}.list-pane,.reader-pane{background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);min-height:0}.list-pane{display:flex;flex-direction:column;overflow:hidden}.list-heading{padding:20px 19px 15px;display:flex;align-items:center;justify-content:space-between}.date-line{font-size:8px;font-weight:700;letter-spacing:1.25px;color:#a0a69f;margin-bottom:7px}.list-heading h2{font-family:'DM Serif Display',Georgia,serif;font-size:20px;font-weight:400;margin:0;color:#303732}.sun{font-family:sans-serif;font-size:14px;color:#dda95f;vertical-align:2px}.compose-button{border:0;border-radius:7px;background:#5b8068;color:white;padding:8px 12px;font-size:10px;font-weight:600;box-shadow:0 2px 4px #406e4f20}.compose-button:hover{background:#476f56}.compose-button span{font-size:15px;vertical-align:-1px;margin-right:4px}.toolbar{height:39px;border-top:1px solid #f2f3f1;border-bottom:1px solid #f0f2ee;display:flex;align-items:center;padding:0 12px;gap:6px;color:#888f88}.toolbar .icon-button{font-size:15px;height:26px;min-width:26px}.tool-checkbox{font-size:14px;color:#818981;border:0;background:transparent;width:25px}.toolbar-divider{height:16px;width:1px;background:#e9ece8;margin:0 3px}.toolbar-spacer{flex:1}.pagination{font-size:9px;color:#90968f;white-space:nowrap}.message-list{overflow-y:auto;flex:1}.message{min-height:68px;display:grid;grid-template-columns:18px 32px minmax(0,1fr) auto;align-items:center;gap:9px;padding:9px 12px;border-bottom:1px solid #f0f2ef;cursor:pointer;transition:background .14s}.message:hover{background:#fafbf9}.message.selected{background:#f3f7f2;box-shadow:inset 2px 0 #669074}.message.unread .sender,.message.unread .subject{font-weight:700;color:#303832}.row-check{appearance:none;width:13px;height:13px;border:1px solid #d7dcd6;border-radius:3px;cursor:pointer;margin:0}.row-check:checked{appearance:auto;accent-color:#63866d}.contact-avatar{width:31px;height:31px;border-radius:50%;display:grid;place-items:center;font-size:9px;font-weight:700;color:#55483d;background:#e9d8c9}.message-body{min-width:0;overflow:hidden}.sender{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#626a63;margin-bottom:4px}.subject{font-size:10px;color:#3e4640;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:3px}.snippet{font-size:9px;color:#a1a69f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-meta{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;padding:2px 0;min-width:31px}.time{font-size:8px;color:#989e98;white-space:nowrap}.star{border:0;background:transparent;color:#c9cec8;font-size:14px;line-height:1;padding:0}.star.on{color:#dcaa56}.list-foot{height:37px;flex:none;border-top:1px solid #f0f2ef;display:flex;align-items:center;justify-content:space-between;padding:0 14px;color:#929991;font-size:9px}.list-foot .online-dot{margin-right:6px}.text-button{border:0;background:transparent;color:#708878;font-size:9px}.reader-pane{overflow-y:auto;padding:0 24px 24px}.reader-empty{height:100%;display:grid;place-items:center;text-align:center;color:#9ca39c}.empty-icon{height:52px;width:52px;margin:0 auto 12px;border-radius:17px;background:#f1f5ef;color:#71937a;display:grid;place-items:center;font-size:24px}.reader-empty h3{font-family:'DM Serif Display',Georgia,serif;font-weight:400;font-size:19px;color:#525a53;margin:0 0 6px}.reader-empty p{font-size:10px;color:#9aa098;margin:0}.reader-header{padding:24px 0 17px;border-bottom:1px solid #edf0ec}.reader-topline{display:flex;align-items:center;justify-content:space-between;margin-bottom:17px}.reader-tags{display:flex;gap:6px}.tag{font-size:8px;border-radius:4px;padding:4px 7px;background:#f4f3e9;color:#a38a52}.tag.green{background:#edf4ee;color:#62816a}.reader-tools{display:flex;gap:2px}.reader-subject{font-family:'DM Serif Display',Georgia,serif;font-size:22px;line-height:1.25;margin:0 0 17px;font-weight:400;color:#343a35}.sender-row{display:flex;align-items:center;gap:9px}.sender-row .contact-avatar{width:34px;height:34px;font-size:10px}.sender-details{min-width:0;flex:1}.sender-details strong{display:block;font-size:10px;color:#434a44}.sender-details span{display:block;font-size:9px;color:#999f99;margin-top:3px}.message-date{font-size:8px;color:#999f99;white-space:nowrap}.reader-body{padding:21px 1px 15px;font-size:11px;line-height:1.85;color:#616a62}.reader-body p{margin:0 0 13px}.reader-body .signoff{margin-top:24px}.attachment{margin-top:18px;padding:11px;border:1px solid #e8ece7;border-radius:8px;display:flex;align-items:center;gap:10px;max-width:260px}.file-icon{height:33px;width:30px;border-radius:6px;background:#f4eeec;color:#ad7466;display:grid;place-items:center;font-size:15px}.attachment-info{flex:1}.attachment-info strong{display:block;font-size:9px;color:#59615a}.attachment-info small{font-size:8px;color:#a1a69f}.download{border:0;background:transparent;color:#8b938b}.reply-bar{border-top:1px solid #edf0ec;padding-top:15px;display:flex;gap:8px}.reply-button{padding:8px 12px;border:1px solid #e3e8e3;border-radius:7px;background:#fff;color:#6e786e;font-size:9px}.reply-button:hover{background:#f6f8f5}.reply-button.primary{background:#5b8068;border-color:#5b8068;color:white}.page-view{padding:22px 28px;overflow:auto}.hidden,[hidden]{display:none!important} .modal-overlay{position:fixed;inset:0;background:#2028204a;z-index:10;display:grid;place-items:center;padding:20px}.compose-modal{width:min(600px,95vw);background:white;border-radius:13px;box-shadow:0 18px 65px #17271c35;overflow:hidden}.modal-head{padding:15px 19px;background:#f6f7f4;border-bottom:1px solid #ebeee9;display:flex;justify-content:space-between;align-items:center;font-size:11px;font-weight:600}.modal-close{border:0;background:transparent;color:#89908a;font-size:19px}.compose-fields{padding:9px 20px 0}.compose-line{display:flex;align-items:center;gap:10px;min-height:39px;border-bottom:1px solid #f0f1ef;color:#969d96;font-size:10px}.compose-line input{flex:1;border:0;outline:0;font-size:10px;color:#424942}.compose-line input::placeholder{color:#aeb3ad}.compose-subject{border:0;width:100%;font-size:14px!important;padding:15px 0;outline:0;color:#303831}.compose-body{width:100%;height:220px;resize:vertical;border:0;border-top:1px solid #f0f1ef;padding:15px 20px;outline:0;font-size:11px;line-height:1.6;color:#414941}.compose-footer{display:flex;justify-content:space-between;align-items:center;padding:12px 20px 15px}.send-button{border:0;border-radius:6px;background:#5b8068;color:white;padding:8px 16px;font-weight:600;font-size:10px}.discard{border:0;background:transparent;color:#929890;font-size:10px}.toast{position:fixed;bottom:22px;left:50%;transform:translate(-50%,15px);opacity:0;pointer-events:none;background:#293b2e;color:#fff;padding:10px 16px;border-radius:8px;font-size:11px;box-shadow:0 5px 20px #1c2b2030;transition:.2s;z-index:20}.toast.visible{opacity:1;transform:translate(-50%,0)} /* Wasteland: warm paper, weathered ink and rust. */ body.wasteland{--bg:#eee8db;--panel:#faf6ed;--line:#e6dccb;--text:#373129;--muted:#998a76;--subtle:#f3ede1;--accent:#a75d3d;--accent-soft:#f5e8dc;--shadow:0 2px 10px #44351d0c}body.wasteland .rail{background:#e7dece;border-color:#dfd4c2}body.wasteland .brand-mark{background:#ad6847}body.wasteland .rail-button.active{background:#f1dfcd;color:#a15a39}body.wasteland .rail-button:hover{background:#eee2d2;color:#9a5739}body.wasteland .sidebar,body.wasteland .topbar{background:#faf6ed;border-color:#e6dccb}body.wasteland .account-card{background:#f4eee2;border-color:#ece2d2}body.wasteland .account-avatar{background:#ead8bf;color:#9b633e}body.wasteland .folder.active{background:#f3e6d7;color:#995c3d}body.wasteland .folder.active .nav-glyph{color:#a76645}body.wasteland .count{color:#9e6947}body.wasteland .list-pane,body.wasteland .reader-pane,body.wasteland .compose-modal{background:#faf6ed;border-color:#e6dccb}body.wasteland .compose-button,body.wasteland .send-button,body.wasteland .reply-button.primary{background:#a76645;border-color:#a76645}body.wasteland .compose-button:hover{background:#905538}body.wasteland .message.selected{background:#f5ede0;box-shadow:inset 2px 0 #ad704c}body.wasteland .reader-empty .empty-icon{background:#f3e8d8;color:#a8734c}body.wasteland .reader-button,body.wasteland .reply-button{background:#faf6ed} @@ -138,6 +138,74 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c} .pgp-trust{margin-left:8px} .draft-delete{margin-top:4px;font-size:15px;opacity:.55}.draft-delete:hover{opacity:1;color:#b3261e}.pgp-prompt-box{width:min(380px,92vw)} -.reader-body img{display:block;max-width:100%;height:auto;margin:12px 0;border-radius:6px}.reader-body table{max-width:100%;border-collapse:collapse}.reader-body th,.reader-body td{border:1px solid var(--line);padding:5px}.remote-image-notice{margin:14px 0 0;padding:12px;border:1px solid #d7a85c;border-radius:8px;background:#fff8e9;color:#664a23;font-size:10px;line-height:1.5}.remote-image-notice p{margin:0 0 8px}.remote-image-notice .reply-button{background:transparent;color:inherit;border-color:#d7a85c}body.ep-wasteland .remote-image-notice{background:#3a3022;color:#e6d1a8;border-color:#806b44}body.ep-daylight .remote-image-notice{background:#fff8e9;color:#664a23;border-color:#d7a85c} +.reader-body img{display:block;max-width:100%;height:auto;margin:12px 0;border-radius:6px}.reader-body table{max-width:100%;border-collapse:collapse}.reader-body th,.reader-body td{border:1px solid var(--line);padding:5px}.remote-image-notice{margin:14px 0 0;padding:12px;border:1px solid #d7a85c;border-radius:8px;background:#fff8e9;color:#664a23;font-size:10px;line-height:1.5}.remote-image-notice p{margin:0 0 8px}.remote-image-notice .reply-button{background:transparent;color:inherit;border-color:#d7a85c}body.ep-wasteland .remote-image-notice{background:#3a3022;color:#e6d1a8;border-color:#806b44}body.ep-daylight .remote-image-notice{background:#fff8e9;color:#664a23;border-color:#d7a85c} + +.reader-back{display:none;border:0;background:transparent;color:var(--accent);font-size:12px;padding:5px 8px 5px 0;white-space:nowrap} +.mail-security-option input[type=checkbox]{flex:0 0 auto;width:17px;height:17px} +@media(max-width:700px){ + body{min-width:320px;min-height:100dvh;overflow:hidden} + .app-shell{height:100dvh;min-height:0;flex-direction:column} + .sidebar{order:0;position:relative;width:100%;height:auto;max-height:88px;padding:5px 8px 0;border-right:0;border-bottom:1px solid var(--line);overflow:hidden} + .sidebar-head,.folders-head,.sidebar-divider,.sidebar>.section-label,.sidebar>.label-link,#custom-labels{display:none!important} + .account-card{height:36px;margin:0 64px 4px 0;padding:4px 7px;gap:7px} + .account-avatar{width:26px;height:26px} + .sidebar-bottom{position:absolute;top:3px;right:5px;margin:0;padding:0} + .storage{display:none} + .settings-button{margin:0;padding:8px;font-size:0} + .settings-button span{font-size:17px} + #mail-nav{display:flex;flex:none;gap:3px;min-height:0;max-height:42px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:none} + #mail-nav::-webkit-scrollbar{display:none} + #mail-nav .folder{width:auto;min-width:max-content;flex:none;gap:5px;padding:6px 9px} + #mail-nav .nav-glyph{display:none} + #custom-folders{display:contents} + .rail{order:2;width:100%;height:54px;flex-direction:row;justify-content:center;gap:24px;padding:4px 0;border-right:0;border-top:1px solid var(--line)} + .brand-mark,.rail-spacer{display:none} + .rail-button{height:42px;width:42px} + .main-area{order:1;flex:1;min-height:0;width:100%;overflow:hidden} + .topbar{height:48px;padding:0 8px;gap:5px} + .breadcrumbs{display:none} + .top-actions{flex:1;min-width:0;gap:4px} + .search-wrap{flex:1;width:auto;min-width:0} + .search-wrap kbd,.help-button{display:none} + .top-avatar{flex:none} + .mail-layout{display:flex;flex:1;min-height:0;flex-direction:column;padding:0;gap:0;overflow:hidden} + .list-pane,.reader-pane{width:100%;height:100%;min-height:0;border:0;border-radius:0;box-shadow:none} + .reader-pane{display:none;padding:10px 12px 20px;overflow:auto} + body.reader-open .mail-layout .list-pane{display:none} + body.reader-open .mail-layout .reader-pane{display:block} + .reader-back{display:inline-flex} + .reader-topline{gap:8px} + .reader-subject{font-size:19px} + .sender-row{flex-wrap:wrap} + .message{grid-template-columns:16px 30px minmax(0,1fr) auto;gap:6px;padding:8px} + .list-heading{padding:10px 12px} + .date-line{display:none} + .list-heading h2{font-size:20px} + .compose-button{padding:8px 10px} + .page-view{padding:12px;overflow:auto} + .page-heading{align-items:flex-start;gap:8px;flex-wrap:wrap} + .page-heading h2{font-size:24px} + .cal-actions{max-width:100%;flex-wrap:wrap} + .calendar-card{overflow-x:auto} + .calendar-week,.calendar-grid{min-width:560px} + .cal-cell{height:78px;padding:4px} + .contacts-grid{grid-template-columns:1fr} + .contact-card{min-width:0} + .compose-modal{width:100%;max-width:600px;max-height:calc(100dvh - 20px);border-radius:10px} + .modal-overlay{padding:10px} + .compose-fields{padding:8px 12px 0} + .compose-line{min-height:44px;font-size:12px;gap:8px} + .compose-line input,.compose-line select{min-width:0;font-size:14px} + .compose-line input[type=checkbox]{flex:0 0 auto;width:20px;height:20px} + .compose-line span{flex:0 1 54%;line-height:1.25} + .compose-line input:not([type=checkbox]){flex:1;max-width:100%;min-width:0} + .compose-footer{gap:8px;padding:10px 12px} + .compose-body{height:30vh;padding:12px} + .account-note,.account-status{font-size:12px} + .mail-rule-row{grid-template-columns:1fr;gap:6px} + .mail-rule-row>*{grid-column:1} + .search-filters{right:8px;top:calc(100% + 4px)} +} -.sidebar{overflow-y:auto}#mail-nav{overflow-y:auto;min-height:150px;flex:0 1 auto;scrollbar-width:thin;align-content:start}#custom-folders{display:contents}.folders-head{flex:none}.sidebar>:not(#mail-nav){flex-shrink:0}.folders-head+.folder-nav{margin-top:0} +.sidebar{overflow-y:auto}#mail-nav{overflow-y:auto;min-height:150px;flex:0 1 auto;scrollbar-width:thin;align-content:start}#custom-folders{display:contents}.folders-head{flex:none}.sidebar>:not(#mail-nav){flex-shrink:0}.folders-head+.folder-nav{margin-top:0} +@media(max-width:700px){.sidebar{overflow:hidden}#mail-nav{display:flex;flex-direction:row;align-items:center;height:42px;min-height:0;max-height:42px;flex:none;overflow-x:auto;overflow-y:hidden;align-content:normal}#mail-nav .folder{height:34px;align-self:center}} diff --git a/tests/android-ui-support.test.cjs b/tests/android-ui-support.test.cjs new file mode 100644 index 0000000..3575cc4 --- /dev/null +++ b/tests/android-ui-support.test.cjs @@ -0,0 +1,44 @@ +const test = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); + +const root = path.resolve(__dirname, '..'); +const styles = fs.readFileSync(path.join(root, 'styles.css'), 'utf8'); +const mailUi = fs.readFileSync(path.join(root, 'mail-ui.js'), 'utf8'); +const app = fs.readFileSync(path.join(root, 'app.js'), 'utf8'); +const transport = fs.readFileSync(path.join(root, 'android', 'app', 'src', 'main', 'java', 'studio', 'daybreak', 'mail', 'AndroidMailTransport.kt'), 'utf8'); +const mainActivity = fs.readFileSync(path.join(root, 'android', 'app', 'src', 'main', 'java', 'studio', 'daybreak', 'mail', 'MainActivity.java'), 'utf8'); + +test('mobile layout removes desktop minimum width and provides a compact reader flow', () => { + assert.match(styles, /min-width:320px/); + assert.match(styles, /@media\(max-width:700px\)/); + assert.match(styles, /\.hidden,\[hidden\]\{display:none!important\}/); + assert.match(styles, /body\.reader-open \.mail-layout \.list-pane/); + assert.match(app, /id="reader-back"/); + assert.match(app, /classList\.add\('reader-open'\)/); + assert.match(app, /\$\$\('\.folder'\)\.forEach/); + assert.match(app, /if\(!m\)\{state\.activeMessage=null;document\.body\.classList\.remove\('reader-open'\);return;\}/); +}); + +test('mailbox setup exposes ports and TLS modes and submits them to Android', () => { + for (const id of ['mail-account-imap-port', 'mail-account-imap-secure', 'mail-account-smtp-port', 'mail-account-smtp-secure']) { + assert.ok(mailUi.includes(`id="${id}"`), `missing account field ${id}`); + } + assert.match(mailUi, /imapPort,/); + assert.match(mailUi, /imapSecure:/); + assert.match(mailUi, /smtpPort,/); + assert.match(mailUi, /smtpSecure:/); +}); + +test('Android mail transport supports verified implicit TLS and required STARTTLS modes', () => { + assert.match(transport, /"imaps" else "imap"/); + assert.match(transport, /mail\.\$protocol\.starttls\.required/); + assert.match(transport, /mail\.smtp\.ssl\.enable/); + assert.match(transport, /mail\.smtp\.starttls\.required/); + assert.match(transport, /ssl\.checkserveridentity/); +}); + +test('Capacitor mail plugin is registered before BridgeActivity creates the bridge', () => { + assert.ok(mainActivity.indexOf('registerPlugin(EpMailPlugin.class)') < mainActivity.indexOf('super.onCreate(savedInstanceState)')); +}); diff --git a/www/app.js b/www/app.js index f3a973e..a2da58c 100644 --- a/www/app.js +++ b/www/app.js @@ -4,11 +4,12 @@ const state = window.epMailState; const $=s=>document.querySelector(s), $$=s=>[...document.querySelectorAll(s)]; function esc(x){return String(x).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]))} const { safeRemoteImageUrl, sanitizeMailHtml } = window.epMailFeatures.contentSecurity; -function renderList(){let rows=state.messages.filter(m=>{if(state.activeFolder==='Starred'&&!m.star)return false;if(state.activeFolder==='Inbox'&&m.archived)return false;if(state.activeFolder==='Archive'&&!m.archived)return false;if(state.activeFolder==='Trash'&&!m.deleted)return false;if(state.activeFolder==='Sent'&&!m.sent)return false;if(state.activeFolder==='Drafts')return false;if(state.activeFolder==='Snoozed')return false;if(m.deleted&&state.activeFolder!=='Trash')return false;return !state.query||`${m.sender} ${m.email} ${m.subject} ${m.snippet}`.toLowerCase().includes(state.query.toLowerCase())});$('#message-list').innerHTML=rows.length?rows.map(m=>`
${m.initials}
${esc(m.sender)}
${esc(m.subject)}
${esc(m.snippet)}
${esc(m.time)}
`).join(''):`
⌕

No messages here

Try another folder or search.

`;$$('.message').forEach(row=>{row.addEventListener('click',e=>{if(e.target.closest('.row-check')){const id=+row.dataset.id;state.selectedIds.has(id)?state.selectedIds.delete(id):state.selectedIds.add(id);return}if(e.target.closest('.star')){const m=state.messages.find(x=>x.id===+row.dataset.id);m.star=!m.star;renderList();return}openMessage(+row.dataset.id)});});if(!rows.length)$('#reader-pane').innerHTML=emptyReader()} -function openMessage(id){ - state.activeMessage=id; - const m=state.messages.find(x=>x.id===id); - if(!m)return; +function renderList(){let rows=state.messages.filter(m=>{if(state.activeFolder==='Starred'&&!m.star)return false;if(state.activeFolder==='Inbox'&&m.archived)return false;if(state.activeFolder==='Archive'&&!m.archived)return false;if(state.activeFolder==='Trash'&&!m.deleted)return false;if(state.activeFolder==='Sent'&&!m.sent)return false;if(state.activeFolder==='Drafts')return false;if(state.activeFolder==='Snoozed')return false;if(m.deleted&&state.activeFolder!=='Trash')return false;return !state.query||`${m.sender} ${m.email} ${m.subject} ${m.snippet}`.toLowerCase().includes(state.query.toLowerCase())});$('#message-list').innerHTML=rows.length?rows.map(m=>`
${m.initials}
${esc(m.sender)}
${esc(m.subject)}
${esc(m.snippet)}
${esc(m.time)}
`).join(''):`
⌕

No messages here

Try another folder or search.

`;$$('.message').forEach(row=>{row.addEventListener('click',e=>{if(e.target.closest('.row-check')){const id=+row.dataset.id;state.selectedIds.has(id)?state.selectedIds.delete(id):state.selectedIds.add(id);return}if(e.target.closest('.star')){const m=state.messages.find(x=>x.id===+row.dataset.id);m.star=!m.star;renderList();return}openMessage(+row.dataset.id)});});if(!rows.length){document.body.classList.remove('reader-open');$('#reader-pane').innerHTML=emptyReader()}} +function openMessage(id){ + state.activeMessage=id; + const m=state.messages.find(x=>x.id===id); + if(!m){state.activeMessage=null;document.body.classList.remove('reader-open');return;} + document.body.classList.add('reader-open'); m.unread=false; renderList(); let safeHtml={html:'',remoteImageCount:0}; @@ -16,7 +17,8 @@ function openMessage(id){ const body=safeHtml.html?safeHtml.html:`${m.body.map(p=>`

${esc(p)}

`).join('')}

${esc(m.signature||m.sender)}

`; const imageNotice=safeHtml.remoteImageCount?`

This message contains ${safeHtml.remoteImageCount} remote image${safeHtml.remoteImageCount===1?'':'s'}. Loading them can reveal your network address and that you opened this message to the image host.

`:''; const attachments=(m.attachments?.length?m.attachments:m.attachment?[{filename:m.attachment,size:m.size}]:[]).map(file=>`
${file.filename.toLowerCase().endsWith('.pdf')?'▤':'▧'}
${esc(file.filename)}${file.size?(typeof file.size==='string'?esc(file.size):`${(file.size/1048576).toFixed(1)} MB`):'Attachment'}
`).join(''); - $('#reader-pane').innerHTML=`
${m.tags.map((t,i)=>`${esc(t)}`).join('')}

${esc(m.subject)}

${m.initials}
${esc(m.sender)}${esc(m.email)} · to me
${esc(m.date)}
${imageNotice}
${body}${attachments}
`; + $('#reader-pane').innerHTML=`
${m.tags.map((t,i)=>`${esc(t)}`).join('')}

${esc(m.subject)}

${m.initials}
${esc(m.sender)}${esc(m.email)} · to me
${esc(m.date)}
${imageNotice}
${body}${attachments}
`; + $('#reader-back').onclick=()=>{state.activeMessage=null;document.body.classList.remove('reader-open');$('#reader-pane').innerHTML=emptyReader();renderList()}; $('#load-remote-images')?.addEventListener('click',()=>{ $('#reader-pane').querySelectorAll('.reader-body img[data-remote-src]').forEach(image=>{ const url=safeRemoteImageUrl(image.getAttribute('data-remote-src')); @@ -25,8 +27,8 @@ function openMessage(id){ }); $('.remote-image-notice')?.remove(); }); - $('#reader-archive').onclick=()=>{m.archived=true;toast('Moved to Archive');renderList();$('#reader-pane').innerHTML=emptyReader()}; - $('#reader-delete').onclick=()=>{m.deleted=true;toast('Moved to Trash');renderList();$('#reader-pane').innerHTML=emptyReader()}; + $('#reader-archive').onclick=()=>{m.archived=true;state.activeMessage=null;document.body.classList.remove('reader-open');toast('Moved to Archive');renderList();$('#reader-pane').innerHTML=emptyReader()}; + $('#reader-delete').onclick=()=>{m.deleted=true;state.activeMessage=null;document.body.classList.remove('reader-open');toast('Moved to Trash');renderList();$('#reader-pane').innerHTML=emptyReader()}; $('#reader-star').onclick=()=>{m.star=!m.star;renderList();openMessage(id)}; $('#reply').onclick=()=>showCompose(m); $('#forward').onclick=()=>showCompose(m,true); @@ -35,7 +37,7 @@ function emptyReader(){return `
`;const close=()=>root.innerHTML='';$('.modal-close').onclick=close;$('#discard').onclick=close;$('.modal-overlay').addEventListener('click',e=>{if(e.target.classList.contains('modal-overlay'))close()});$('#send').onclick=()=>{const to=$('#compose-to').value.trim();if(!to){$('#compose-to').focus();toast('Add a recipient to send your message');return}const subject=$('#compose-subject').value.trim()||'(no subject)';const body=$('#compose-body').value;state.messages.unshift({id:Date.now(),initials:(window.epMailFeatures.productivity?.profileName||window.epMailFeatures.mail.connectedAccount?.email?.split('@')[0]||'Me').split(/\\s+/).map(x=>x[0]).join('').slice(0,2).toUpperCase(),color:'#dce9dd',sender:(window.epMailFeatures.productivity?.profileName||window.epMailFeatures.mail.connectedAccount?.email?.split('@')[0]||'Me'),email:(window.epMailFeatures.mail.connectedAccount?.email||''),subject,snippet:body||'No message text',time:'Just now',date:'Today',unread:false,star:false,sent:true,tags:['Sent'],body:body.split('\n').filter(Boolean)});close();toast('Message sent');renderList()};$('#compose-to').focus()} function switchView(view){state.activeView=view;$$('.rail-button[data-view]').forEach(b=>b.classList.toggle('active',b.dataset.view===view));$('.mail-layout').classList.toggle('hidden',view!=='mail');$('#calendar-view').classList.toggle('hidden',view!=='calendar');$('#contacts-view').classList.toggle('hidden',view!=='contacts');$('#sidebar-title').textContent=view==='mail'?state.activeFolder:view==='calendar'?'Calendar':'Contacts';$('#crumb-parent').textContent=view==='mail'?'Mail':'Workspace';$('#crumb-current').textContent=view==='mail'?state.activeFolder:view==='calendar'?'Calendar':'Contacts';if(view==='calendar')window.epMailFeatures.productivity.renderCalendar();if(view==='contacts')window.epMailFeatures.productivity.renderContacts();} -$$('.folder').forEach(b=>b.onclick=()=>{state.activeFolder=b.dataset.folder;$$('.folder').forEach(x=>x.classList.toggle('active',x===b));$('#sidebar-title').textContent=state.activeFolder;$('#crumb-current').textContent=state.activeFolder;renderList()});$$('.rail-button[data-view]').forEach(b=>b.onclick=()=>{switchView(b.dataset.view);});function applyTheme(theme,showToast=false){const themes=['daylight','wasteland','ep-wasteland','ep-daylight'];const selected=themes.includes(theme)?theme:'ep-wasteland';const info={daylight:{name:'Eternity Daylight',icon:'☼'},wasteland:{name:'Wasteland',icon:'☾'},'ep-wasteland':{name:'EP Wasteland',icon:'◈'},'ep-daylight':{name:'EP Daylight',icon:'☀'}}[selected];document.body.classList.remove('wasteland','ep-wasteland','ep-daylight');if(selected!=='daylight')document.body.classList.add(selected);document.querySelector('meta[name=theme-color]')?.setAttribute('content',selected==='ep-wasteland'?'#161210':selected==='ep-daylight'?'#f1f1e9':selected==='wasteland'?'#eee8db':'#f4f5f1');localStorage.setItem('daybreak-theme',selected);const brandLogo=$("#brand-logo");if(brandLogo)brandLogo.src=selected==='ep-wasteland'?'logo-ep-wasteland.svg':'logo-ep-daylight.svg';if(showToast)toast(`${info.name} theme`)}applyTheme(localStorage.getItem('daybreak-theme')||'ep-wasteland');$('#search').oninput=e=>{state.query=e.target.value;renderList()};$('#search').addEventListener('keydown',e=>{if(e.key==='Escape'){e.target.value='';state.query='';renderList()}});$('#compose').onclick=()=>showCompose();$('#refresh').onclick=()=>{toast('You’re all up to date');renderList()};$('#select-all').onclick=()=>{const visible=state.messages.filter(m=>!m.archived&&!m.deleted);const all=visible.every(m=>state.selectedIds.has(m.id));visible.forEach(m=>all?state.selectedIds.delete(m.id):state.selectedIds.add(m.id));renderList()};$('#archive-selected').onclick=()=>{state.messages.filter(m=>state.selectedIds.has(m.id)).forEach(m=>m.archived=true);state.selectedIds.clear();renderList();toast('Selected messages archived')};$('#delete-selected').onclick=()=>{state.messages.filter(m=>state.selectedIds.has(m.id)).forEach(m=>m.deleted=true);state.selectedIds.clear();renderList();toast('Selected messages moved to Trash')};$('#sidebar-menu').onclick=()=>toast('More mailbox options');$$('.settings-button,.help-button,.tiny-plus,.text-button').forEach(b=>b.onclick=()=>toast('You’re all caught up'));document.addEventListener('keydown',e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==='k'){e.preventDefault();$('#search').focus()}if(e.key==='Escape')$('#modal-root').innerHTML=''});$('#today-label').textContent=new Intl.DateTimeFormat('en-US',{weekday:'long',month:'long',day:'numeric'}).format(new Date()).toUpperCase();$('#reader-pane').innerHTML=emptyReader();renderList();openMessage(state.activeMessage); +$$('.folder').forEach(b=>b.onclick=()=>{state.activeFolder=b.dataset.folder;state.activeMessage=null;document.body.classList.remove('reader-open');$('#reader-pane').innerHTML=emptyReader();$$('.folder').forEach(x=>x.classList.toggle('active',x===b));$('#sidebar-title').textContent=state.activeFolder;$('#crumb-current').textContent=state.activeFolder;renderList()});$$('.rail-button[data-view]').forEach(b=>b.onclick=()=>{document.body.classList.remove('reader-open');switchView(b.dataset.view);});function applyTheme(theme,showToast=false){const themes=['daylight','wasteland','ep-wasteland','ep-daylight'];const selected=themes.includes(theme)?theme:'ep-wasteland';const info={daylight:{name:'Eternity Daylight',icon:'☼'},wasteland:{name:'Wasteland',icon:'☾'},'ep-wasteland':{name:'EP Wasteland',icon:'◈'},'ep-daylight':{name:'EP Daylight',icon:'☀'}}[selected];document.body.classList.remove('wasteland','ep-wasteland','ep-daylight');if(selected!=='daylight')document.body.classList.add(selected);document.querySelector('meta[name=theme-color]')?.setAttribute('content',selected==='ep-wasteland'?'#161210':selected==='ep-daylight'?'#f1f1e9':selected==='wasteland'?'#eee8db':'#f4f5f1');localStorage.setItem('daybreak-theme',selected);const brandLogo=$("#brand-logo");if(brandLogo)brandLogo.src=selected==='ep-wasteland'?'logo-ep-wasteland.svg':'logo-ep-daylight.svg';if(showToast)toast(`${info.name} theme`)}applyTheme(localStorage.getItem('daybreak-theme')||'ep-wasteland');$('#search').oninput=e=>{state.query=e.target.value;renderList()};$('#search').addEventListener('keydown',e=>{if(e.key==='Escape'){e.target.value='';state.query='';renderList()}});$('#compose').onclick=()=>showCompose();$('#refresh').onclick=()=>{toast('You’re all up to date');renderList()};$('#select-all').onclick=()=>{const visible=state.messages.filter(m=>!m.archived&&!m.deleted);const all=visible.every(m=>state.selectedIds.has(m.id));visible.forEach(m=>all?state.selectedIds.delete(m.id):state.selectedIds.add(m.id));renderList()};$('#archive-selected').onclick=()=>{state.messages.filter(m=>state.selectedIds.has(m.id)).forEach(m=>m.archived=true);state.selectedIds.clear();renderList();toast('Selected messages archived')};$('#delete-selected').onclick=()=>{state.messages.filter(m=>state.selectedIds.has(m.id)).forEach(m=>m.deleted=true);state.selectedIds.clear();renderList();toast('Selected messages moved to Trash')};$('#sidebar-menu').onclick=()=>toast('More mailbox options');$$('.settings-button,.help-button,.tiny-plus,.text-button').forEach(b=>b.onclick=()=>toast('You’re all caught up'));document.addEventListener('keydown',e=>{if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==='k'){e.preventDefault();$('#search').focus()}if(e.key==='Escape')$('#modal-root').innerHTML=''});$('#today-label').textContent=new Intl.DateTimeFormat('en-US',{weekday:'long',month:'long',day:'numeric'}).format(new Date()).toUpperCase();$('#reader-pane').innerHTML=emptyReader();renderList();openMessage(state.activeMessage); window.epMailShell = Object.freeze({ state, diff --git a/www/mail-ui.js b/www/mail-ui.js index c3a4302..1197eb2 100644 --- a/www/mail-ui.js +++ b/www/mail-ui.js @@ -228,7 +228,7 @@ function openMailAccount(existingAccount = null) { : ``}
`).join(''); - root.innerHTML = ``; + root.innerHTML = ``; const authMethodRow = document.createElement('label'); authMethodRow.className = 'compose-line'; authMethodRow.innerHTML = 'Sign-in method'; @@ -249,7 +249,11 @@ function openMailAccount(existingAccount = null) { if (oauthMethodOption) oauthMethodOption.disabled = existingAccount?.authMethod !== 'oauth2'; const passwordRow = selectMailUi('#mail-account-password').closest('.compose-line'); const imapRow = selectMailUi('#mail-account-imap').closest('.compose-line'); + const imapPortRow = selectMailUi('#mail-account-imap-port').closest('.compose-line'); + const imapSecureRow = selectMailUi('#mail-account-imap-secure').closest('.compose-line'); const smtpRow = selectMailUi('#mail-account-smtp').closest('.compose-line'); + const smtpPortRow = selectMailUi('#mail-account-smtp-port').closest('.compose-line'); + const smtpSecureRow = selectMailUi('#mail-account-smtp-secure').closest('.compose-line'); const authNote = selectMailUi('#modal-root .compose-fields > .account-note'); authMethodSelect.value = existingAccount?.authMethod === 'oauth2' ? 'oauth2' : 'password'; if (existingAccount?.oauthProvider) oauthProviderSelect.value = existingAccount.oauthProvider; @@ -258,7 +262,11 @@ function openMailAccount(existingAccount = null) { ? { imap: 'imap.gmail.com', smtp: 'smtp.gmail.com' } : { imap: 'outlook.office365.com', smtp: 'smtp.office365.com' }; selectMailUi('#mail-account-imap').value = servers.imap; + selectMailUi('#mail-account-imap-port').value = '993'; + selectMailUi('#mail-account-imap-secure').checked = true; selectMailUi('#mail-account-smtp').value = servers.smtp; + selectMailUi('#mail-account-smtp-port').value = '587'; + selectMailUi('#mail-account-smtp-secure').checked = false; }; const updateAuthFields = () => { const oauth = authMethodSelect.value === 'oauth2'; @@ -267,12 +275,16 @@ function openMailAccount(existingAccount = null) { reauthorizeRow.hidden = !oauth || !editing; passwordRow.hidden = oauth; imapRow.hidden = oauth; + imapPortRow.hidden = oauth; + imapSecureRow.hidden = oauth; smtpRow.hidden = oauth; + smtpPortRow.hidden = oauth; + smtpSecureRow.hidden = oauth; authNote.textContent = oauth ? 'Sign in in your browser. Configure the provider client ID in the desktop environment; OAuth refresh tokens are stored in encrypted credential storage.' : configuredOAuthProviders && configuredOAuthProviders.size === 0 ? 'Password sign-in is available. To enable OAuth2, configure EP_MAIL_GOOGLE_OAUTH_CLIENT_ID and/or EP_MAIL_MICROSOFT_OAUTH_CLIENT_ID, then restart ep-mail.' - : 'Your password is encrypted with this computer\'s credential storage. Connections require TLS.'; + : 'Credentials are stored encrypted. Connections require verified TLS.'; selectMailUi('#mail-account-password').placeholder = editing && existingAccount?.authMethod !== 'oauth2' ? 'Leave blank to keep current password' : 'Enter mailbox password'; }; @@ -332,6 +344,12 @@ function openMailAccount(existingAccount = null) { const name = selectMailUi('#mail-account-display-name').value.trim(); if (!name) { status.textContent = 'Enter a display name for this mail account.'; selectMailUi('#mail-account-display-name').focus(); return; } if (authMethod === 'password' && !password && (!editing || existingAccount?.authMethod === 'oauth2')) { status.textContent = 'Enter the mailbox password to connect.'; selectMailUi('#mail-account-password').focus(); return; } + const imapPort = Number(selectMailUi('#mail-account-imap-port').value); + const smtpPort = Number(selectMailUi('#mail-account-smtp-port').value); + if (authMethod === 'password' && (![imapPort, smtpPort].every(port => Number.isInteger(port) && port >= 1 && port <= 65535))) { + status.textContent = 'Enter valid IMAP and SMTP ports (1–65535).'; + return; + } button.disabled = true; const reauthorizeOAuth = authMethod === 'oauth2' && editing && selectMailUi('#mail-account-reauthorize').checked; button.textContent = authMethod === 'oauth2' && (!editing || reauthorizeOAuth) ? 'Starting OAuth2 sign-in…' : editing ? 'Checking updated settings…' : 'Checking secure connections…'; @@ -346,8 +364,12 @@ function openMailAccount(existingAccount = null) { ...(authMethod === 'oauth2' ? { oauthProvider } : {}), ...(editing && authMethod === 'oauth2' ? { reauthorizeOAuth } : {}), displayName: name, - imapHost: selectMailUi('#mail-account-imap').value, - smtpHost: selectMailUi('#mail-account-smtp').value, + imapHost: selectMailUi('#mail-account-imap').value, + imapPort, + imapSecure: selectMailUi('#mail-account-imap-secure').checked, + smtpHost: selectMailUi('#mail-account-smtp').value, + smtpPort, + smtpSecure: selectMailUi('#mail-account-smtp-secure').checked, signature: selectMailUi('#mail-account-signature').value, notificationsEnabled: selectMailUi('#mail-account-notifications').checked, syncIntervalMinutes: Number(selectMailUi('#mail-account-sync-interval').value), diff --git a/www/service-worker.js b/www/service-worker.js index eb59867..57acb96 100644 --- a/www/service-worker.js +++ b/www/service-worker.js @@ -1,5 +1,5 @@ -const CACHE='ep-mail-v12'; +const CACHE='ep-mail-v15'; const FILES=['./','./index.html','./styles.css','./branding.css','./renderer-state.js','./mail-content-security.js','./renderer-mail-api.js','./app.js','./platform-bridge-loader.js','./platform-bridge.js','./mail-ui.js','./productivity.js','./snooze-ui.js','./account-ui.js','./dav-ui.js','./shortcuts.js','./attachments.js','./pgp-ui.js','./pgp-mail-ui.js','./manifest.webmanifest','./icon.svg','./logo-ep-daylight.svg','./logo-ep-wasteland.svg']; -self.addEventListener('install',event=>event.waitUntil(caches.open(CACHE).then(cache=>cache.addAll(FILES)))); -self.addEventListener('activate',event=>event.waitUntil(caches.keys().then(keys=>Promise.all(keys.filter(k=>k!==CACHE).map(k=>caches.delete(k)))))); +self.addEventListener('install',event=>event.waitUntil(caches.open(CACHE).then(cache=>cache.addAll(FILES)).then(()=>self.skipWaiting()))); +self.addEventListener('activate',event=>event.waitUntil(caches.keys().then(keys=>Promise.all(keys.filter(k=>k!==CACHE).map(k=>caches.delete(k)))).then(()=>self.clients.claim()))); self.addEventListener('fetch',event=>{if(event.request.method!=='GET')return;event.respondWith(caches.match(event.request).then(cached=>cached||fetch(event.request).then(response=>{if(new URL(event.request.url).origin===location.origin){const copy=response.clone();caches.open(CACHE).then(cache=>cache.put(event.request,copy))}return response}).catch(()=>caches.match('./index.html'))))}); diff --git a/www/styles.css b/www/styles.css index 2643ed1..6a5f217 100644 --- a/www/styles.css +++ b/www/styles.css @@ -1,8 +1,8 @@ :root{font-family:'DM Sans',Inter,ui-sans-serif,system-ui,-apple-system,'Segoe UI',sans-serif;color:#252a28;background:#f4f5f1;font-synthesis:none;text-rendering:optimizeLegibility;--bg:#f4f5f1;--panel:#fff;--line:#eaede8;--text:#252a28;--muted:#8b918b;--subtle:#f7f8f5;--accent:#55816c;--accent-soft:#edf4ef;--shadow:0 2px 10px #2636290b} -*{box-sizing:border-box}body{margin:0;min-width:760px;min-height:100vh;background:var(--bg);color:var(--text)}button,input,textarea{font:inherit}button{color:inherit;cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #7eae90;outline-offset:2px}.app-shell{height:100vh;min-height:640px;display:flex;overflow:hidden}.rail{width:66px;flex:none;background:#edf0ea;border-right:1px solid #e5e9e2;display:flex;align-items:center;flex-direction:column;padding:17px 0 13px;gap:10px}.brand-mark{height:35px;width:35px;border-radius:12px;background:#5b826c;color:white;display:grid;place-items:center;font-size:24px;margin-bottom:21px;box-shadow:0 3px 8px #476c541d}.rail-button{height:39px;width:39px;border:0;background:transparent;color:#7e8780;border-radius:11px;font-size:20px;display:grid;place-items:center;transition:.18s}.rail-button:hover{background:#e2e8e1;color:#446a54}.rail-button.active{color:#477253;background:#dce9dd}.rail-spacer{flex:1}.avatar{border:0;border-radius:50%;height:34px;width:34px;background:#e7cbb6;color:#614c3c;font-size:11px;font-weight:700;display:grid;place-items:center}.avatar.tiny{height:27px;width:27px;font-size:9px} +*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;background:var(--bg);color:var(--text)}button,input,textarea{font:inherit}button{color:inherit;cursor:pointer}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid #7eae90;outline-offset:2px}.app-shell{height:100vh;min-height:640px;display:flex;overflow:hidden}.rail{width:66px;flex:none;background:#edf0ea;border-right:1px solid #e5e9e2;display:flex;align-items:center;flex-direction:column;padding:17px 0 13px;gap:10px}.brand-mark{height:35px;width:35px;border-radius:12px;background:#5b826c;color:white;display:grid;place-items:center;font-size:24px;margin-bottom:21px;box-shadow:0 3px 8px #476c541d}.rail-button{height:39px;width:39px;border:0;background:transparent;color:#7e8780;border-radius:11px;font-size:20px;display:grid;place-items:center;transition:.18s}.rail-button:hover{background:#e2e8e1;color:#446a54}.rail-button.active{color:#477253;background:#dce9dd}.rail-spacer{flex:1}.avatar{border:0;border-radius:50%;height:34px;width:34px;background:#e7cbb6;color:#614c3c;font-size:11px;font-weight:700;display:grid;place-items:center}.avatar.tiny{height:27px;width:27px;font-size:9px} .sidebar{width:244px;flex:none;background:#fff;border-right:1px solid var(--line);padding:26px 17px 14px;display:flex;flex-direction:column}.sidebar-head{display:flex;align-items:center;justify-content:space-between;padding:0 5px;margin-bottom:21px}.eyebrow{color:#969c95;font-size:9px;font-weight:700;letter-spacing:1.25px;margin:0 0 5px}.sidebar-head h1{font-family:'DM Serif Display',Georgia,serif;font-size:24px;font-weight:400;margin:0}.icon-button{border:0;background:transparent;color:#89918a;height:30px;min-width:30px;border-radius:8px;font-size:19px;display:inline-grid;place-items:center}.icon-button:hover{background:var(--subtle);color:#47544a}.account-card{display:flex;align-items:center;gap:10px;padding:10px 9px;background:#f7f8f5;border:1px solid #eff1ec;border-radius:10px;margin:0 0 22px}.account-avatar{height:30px;width:30px;border-radius:9px;background:#dce9dd;color:#477253;display:grid;place-items:center;font-family:Georgia,serif;font-weight:bold}.account-info{min-width:0;display:flex;flex-direction:column;gap:2px;flex:1}.account-info strong{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-info span{color:#929891;font-size:9px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.online-dot{display:inline-block;width:7px;height:7px;border-radius:50%;background:#70ad7b}.folder-nav{display:grid;gap:3px}.folder{width:100%;border:0;background:transparent;display:flex;align-items:center;gap:12px;text-align:left;padding:9px 10px;border-radius:8px;font-size:11px;color:#707970}.folder:hover,.label-link:hover{background:#f6f8f5}.folder.active{background:#edf4ee;color:#487354;font-weight:600}.nav-glyph{width:15px;text-align:center;font-size:15px;color:#879188}.folder.active .nav-glyph{color:#578366}.count{margin-left:auto;padding:2px 6px;min-width:19px;text-align:center;border-radius:5px;background:#fff;color:#61836a;font-size:9px}.count.muted{color:#969c95}.sidebar-divider{height:1px;background:#edf0ec;margin:18px 4px 16px}.section-label{display:flex;justify-content:space-between;align-items:center;font-size:9px;letter-spacing:1.1px;font-weight:700;color:#a0a59f;padding:0 6px;margin-bottom:9px}.tiny-plus{border:0;background:transparent;color:#929990;font-size:18px}.label-link{border:0;background:transparent;border-radius:7px;text-align:left;display:flex;align-items:center;gap:10px;color:#727970;font-size:11px;padding:8px 10px}.label-dot{width:8px;height:8px;border-radius:50%}.dot-amber{background:#dda854}.dot-blue{background:#79a4c9}.dot-green{background:#82ab83}.sidebar-bottom{margin-top:auto}.storage{padding:13px 10px 14px;border-bottom:1px solid #eef0ec}.storage-top{display:flex;justify-content:space-between;color:#606960;font-size:10px}.storage-top span+span{color:#979d97;font-size:9px}.storage-bar{height:4px;background:#edf0eb;margin:9px 0 7px;border-radius:5px;overflow:hidden}.storage-bar i{display:block;width:28%;height:100%;background:#79a785;border-radius:5px}.storage small{font-size:9px;color:#9ba19a}.settings-button{border:0;background:transparent;color:#7e867f;display:flex;gap:10px;align-items:center;margin:10px 0 0 4px;font-size:11px;padding:7px} .main-area{flex:1;min-width:0;display:flex;flex-direction:column}.topbar{height:57px;flex:none;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;padding:0 24px}.breadcrumbs{display:flex;align-items:center;gap:10px;font-size:10px;color:#969c96}.breadcrumbs strong{font-weight:600;color:#475048}.crumb-divider{color:#c6cbc5}.top-actions{display:flex;align-items:center;gap:13px}.search-wrap{height:31px;width:218px;background:#f6f7f4;border:1px solid #eff0ec;border-radius:8px;display:flex;align-items:center;padding:0 9px;gap:7px;color:#90978f}.search-wrap>span{font-size:19px}.search-wrap input{border:0;outline:0;background:transparent;width:100%;font-size:10px;color:#3f4740}.search-wrap kbd{font:9px 'DM Sans',sans-serif;border:1px solid #e3e6e1;border-radius:4px;padding:2px 4px;white-space:nowrap;color:#999f99}.help-button{font-size:12px;border:1px solid #e7eae6;border-radius:50%;height:20px;min-width:20px;font-weight:600}.top-avatar{width:27px;height:27px;font-size:9px} -.content-view{flex:1;min-height:0}.mail-layout{display:grid;grid-template-columns:minmax(330px,44%) minmax(340px,1fr);padding:18px 20px 20px;gap:14px}.list-pane,.reader-pane{background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);min-height:0}.list-pane{display:flex;flex-direction:column;overflow:hidden}.list-heading{padding:20px 19px 15px;display:flex;align-items:center;justify-content:space-between}.date-line{font-size:8px;font-weight:700;letter-spacing:1.25px;color:#a0a69f;margin-bottom:7px}.list-heading h2{font-family:'DM Serif Display',Georgia,serif;font-size:20px;font-weight:400;margin:0;color:#303732}.sun{font-family:sans-serif;font-size:14px;color:#dda95f;vertical-align:2px}.compose-button{border:0;border-radius:7px;background:#5b8068;color:white;padding:8px 12px;font-size:10px;font-weight:600;box-shadow:0 2px 4px #406e4f20}.compose-button:hover{background:#476f56}.compose-button span{font-size:15px;vertical-align:-1px;margin-right:4px}.toolbar{height:39px;border-top:1px solid #f2f3f1;border-bottom:1px solid #f0f2ee;display:flex;align-items:center;padding:0 12px;gap:6px;color:#888f88}.toolbar .icon-button{font-size:15px;height:26px;min-width:26px}.tool-checkbox{font-size:14px;color:#818981;border:0;background:transparent;width:25px}.toolbar-divider{height:16px;width:1px;background:#e9ece8;margin:0 3px}.toolbar-spacer{flex:1}.pagination{font-size:9px;color:#90968f;white-space:nowrap}.message-list{overflow-y:auto;flex:1}.message{min-height:68px;display:grid;grid-template-columns:18px 32px minmax(0,1fr) auto;align-items:center;gap:9px;padding:9px 12px;border-bottom:1px solid #f0f2ef;cursor:pointer;transition:background .14s}.message:hover{background:#fafbf9}.message.selected{background:#f3f7f2;box-shadow:inset 2px 0 #669074}.message.unread .sender,.message.unread .subject{font-weight:700;color:#303832}.row-check{appearance:none;width:13px;height:13px;border:1px solid #d7dcd6;border-radius:3px;cursor:pointer;margin:0}.row-check:checked{appearance:auto;accent-color:#63866d}.contact-avatar{width:31px;height:31px;border-radius:50%;display:grid;place-items:center;font-size:9px;font-weight:700;color:#55483d;background:#e9d8c9}.message-body{min-width:0;overflow:hidden}.sender{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#626a63;margin-bottom:4px}.subject{font-size:10px;color:#3e4640;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:3px}.snippet{font-size:9px;color:#a1a69f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-meta{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;padding:2px 0;min-width:31px}.time{font-size:8px;color:#989e98;white-space:nowrap}.star{border:0;background:transparent;color:#c9cec8;font-size:14px;line-height:1;padding:0}.star.on{color:#dcaa56}.list-foot{height:37px;flex:none;border-top:1px solid #f0f2ef;display:flex;align-items:center;justify-content:space-between;padding:0 14px;color:#929991;font-size:9px}.list-foot .online-dot{margin-right:6px}.text-button{border:0;background:transparent;color:#708878;font-size:9px}.reader-pane{overflow-y:auto;padding:0 24px 24px}.reader-empty{height:100%;display:grid;place-items:center;text-align:center;color:#9ca39c}.empty-icon{height:52px;width:52px;margin:0 auto 12px;border-radius:17px;background:#f1f5ef;color:#71937a;display:grid;place-items:center;font-size:24px}.reader-empty h3{font-family:'DM Serif Display',Georgia,serif;font-weight:400;font-size:19px;color:#525a53;margin:0 0 6px}.reader-empty p{font-size:10px;color:#9aa098;margin:0}.reader-header{padding:24px 0 17px;border-bottom:1px solid #edf0ec}.reader-topline{display:flex;align-items:center;justify-content:space-between;margin-bottom:17px}.reader-tags{display:flex;gap:6px}.tag{font-size:8px;border-radius:4px;padding:4px 7px;background:#f4f3e9;color:#a38a52}.tag.green{background:#edf4ee;color:#62816a}.reader-tools{display:flex;gap:2px}.reader-subject{font-family:'DM Serif Display',Georgia,serif;font-size:22px;line-height:1.25;margin:0 0 17px;font-weight:400;color:#343a35}.sender-row{display:flex;align-items:center;gap:9px}.sender-row .contact-avatar{width:34px;height:34px;font-size:10px}.sender-details{min-width:0;flex:1}.sender-details strong{display:block;font-size:10px;color:#434a44}.sender-details span{display:block;font-size:9px;color:#999f99;margin-top:3px}.message-date{font-size:8px;color:#999f99;white-space:nowrap}.reader-body{padding:21px 1px 15px;font-size:11px;line-height:1.85;color:#616a62}.reader-body p{margin:0 0 13px}.reader-body .signoff{margin-top:24px}.attachment{margin-top:18px;padding:11px;border:1px solid #e8ece7;border-radius:8px;display:flex;align-items:center;gap:10px;max-width:260px}.file-icon{height:33px;width:30px;border-radius:6px;background:#f4eeec;color:#ad7466;display:grid;place-items:center;font-size:15px}.attachment-info{flex:1}.attachment-info strong{display:block;font-size:9px;color:#59615a}.attachment-info small{font-size:8px;color:#a1a69f}.download{border:0;background:transparent;color:#8b938b}.reply-bar{border-top:1px solid #edf0ec;padding-top:15px;display:flex;gap:8px}.reply-button{padding:8px 12px;border:1px solid #e3e8e3;border-radius:7px;background:#fff;color:#6e786e;font-size:9px}.reply-button:hover{background:#f6f8f5}.reply-button.primary{background:#5b8068;border-color:#5b8068;color:white}.page-view{padding:22px 28px;overflow:auto}.hidden{display:none!important} +.content-view{flex:1;min-height:0}.mail-layout{display:grid;grid-template-columns:minmax(330px,44%) minmax(340px,1fr);padding:18px 20px 20px;gap:14px}.list-pane,.reader-pane{background:var(--panel);border:1px solid var(--line);border-radius:12px;box-shadow:var(--shadow);min-height:0}.list-pane{display:flex;flex-direction:column;overflow:hidden}.list-heading{padding:20px 19px 15px;display:flex;align-items:center;justify-content:space-between}.date-line{font-size:8px;font-weight:700;letter-spacing:1.25px;color:#a0a69f;margin-bottom:7px}.list-heading h2{font-family:'DM Serif Display',Georgia,serif;font-size:20px;font-weight:400;margin:0;color:#303732}.sun{font-family:sans-serif;font-size:14px;color:#dda95f;vertical-align:2px}.compose-button{border:0;border-radius:7px;background:#5b8068;color:white;padding:8px 12px;font-size:10px;font-weight:600;box-shadow:0 2px 4px #406e4f20}.compose-button:hover{background:#476f56}.compose-button span{font-size:15px;vertical-align:-1px;margin-right:4px}.toolbar{height:39px;border-top:1px solid #f2f3f1;border-bottom:1px solid #f0f2ee;display:flex;align-items:center;padding:0 12px;gap:6px;color:#888f88}.toolbar .icon-button{font-size:15px;height:26px;min-width:26px}.tool-checkbox{font-size:14px;color:#818981;border:0;background:transparent;width:25px}.toolbar-divider{height:16px;width:1px;background:#e9ece8;margin:0 3px}.toolbar-spacer{flex:1}.pagination{font-size:9px;color:#90968f;white-space:nowrap}.message-list{overflow-y:auto;flex:1}.message{min-height:68px;display:grid;grid-template-columns:18px 32px minmax(0,1fr) auto;align-items:center;gap:9px;padding:9px 12px;border-bottom:1px solid #f0f2ef;cursor:pointer;transition:background .14s}.message:hover{background:#fafbf9}.message.selected{background:#f3f7f2;box-shadow:inset 2px 0 #669074}.message.unread .sender,.message.unread .subject{font-weight:700;color:#303832}.row-check{appearance:none;width:13px;height:13px;border:1px solid #d7dcd6;border-radius:3px;cursor:pointer;margin:0}.row-check:checked{appearance:auto;accent-color:#63866d}.contact-avatar{width:31px;height:31px;border-radius:50%;display:grid;place-items:center;font-size:9px;font-weight:700;color:#55483d;background:#e9d8c9}.message-body{min-width:0;overflow:hidden}.sender{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#626a63;margin-bottom:4px}.subject{font-size:10px;color:#3e4640;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-bottom:3px}.snippet{font-size:9px;color:#a1a69f;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-meta{height:100%;display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end;padding:2px 0;min-width:31px}.time{font-size:8px;color:#989e98;white-space:nowrap}.star{border:0;background:transparent;color:#c9cec8;font-size:14px;line-height:1;padding:0}.star.on{color:#dcaa56}.list-foot{height:37px;flex:none;border-top:1px solid #f0f2ef;display:flex;align-items:center;justify-content:space-between;padding:0 14px;color:#929991;font-size:9px}.list-foot .online-dot{margin-right:6px}.text-button{border:0;background:transparent;color:#708878;font-size:9px}.reader-pane{overflow-y:auto;padding:0 24px 24px}.reader-empty{height:100%;display:grid;place-items:center;text-align:center;color:#9ca39c}.empty-icon{height:52px;width:52px;margin:0 auto 12px;border-radius:17px;background:#f1f5ef;color:#71937a;display:grid;place-items:center;font-size:24px}.reader-empty h3{font-family:'DM Serif Display',Georgia,serif;font-weight:400;font-size:19px;color:#525a53;margin:0 0 6px}.reader-empty p{font-size:10px;color:#9aa098;margin:0}.reader-header{padding:24px 0 17px;border-bottom:1px solid #edf0ec}.reader-topline{display:flex;align-items:center;justify-content:space-between;margin-bottom:17px}.reader-tags{display:flex;gap:6px}.tag{font-size:8px;border-radius:4px;padding:4px 7px;background:#f4f3e9;color:#a38a52}.tag.green{background:#edf4ee;color:#62816a}.reader-tools{display:flex;gap:2px}.reader-subject{font-family:'DM Serif Display',Georgia,serif;font-size:22px;line-height:1.25;margin:0 0 17px;font-weight:400;color:#343a35}.sender-row{display:flex;align-items:center;gap:9px}.sender-row .contact-avatar{width:34px;height:34px;font-size:10px}.sender-details{min-width:0;flex:1}.sender-details strong{display:block;font-size:10px;color:#434a44}.sender-details span{display:block;font-size:9px;color:#999f99;margin-top:3px}.message-date{font-size:8px;color:#999f99;white-space:nowrap}.reader-body{padding:21px 1px 15px;font-size:11px;line-height:1.85;color:#616a62}.reader-body p{margin:0 0 13px}.reader-body .signoff{margin-top:24px}.attachment{margin-top:18px;padding:11px;border:1px solid #e8ece7;border-radius:8px;display:flex;align-items:center;gap:10px;max-width:260px}.file-icon{height:33px;width:30px;border-radius:6px;background:#f4eeec;color:#ad7466;display:grid;place-items:center;font-size:15px}.attachment-info{flex:1}.attachment-info strong{display:block;font-size:9px;color:#59615a}.attachment-info small{font-size:8px;color:#a1a69f}.download{border:0;background:transparent;color:#8b938b}.reply-bar{border-top:1px solid #edf0ec;padding-top:15px;display:flex;gap:8px}.reply-button{padding:8px 12px;border:1px solid #e3e8e3;border-radius:7px;background:#fff;color:#6e786e;font-size:9px}.reply-button:hover{background:#f6f8f5}.reply-button.primary{background:#5b8068;border-color:#5b8068;color:white}.page-view{padding:22px 28px;overflow:auto}.hidden,[hidden]{display:none!important} .modal-overlay{position:fixed;inset:0;background:#2028204a;z-index:10;display:grid;place-items:center;padding:20px}.compose-modal{width:min(600px,95vw);background:white;border-radius:13px;box-shadow:0 18px 65px #17271c35;overflow:hidden}.modal-head{padding:15px 19px;background:#f6f7f4;border-bottom:1px solid #ebeee9;display:flex;justify-content:space-between;align-items:center;font-size:11px;font-weight:600}.modal-close{border:0;background:transparent;color:#89908a;font-size:19px}.compose-fields{padding:9px 20px 0}.compose-line{display:flex;align-items:center;gap:10px;min-height:39px;border-bottom:1px solid #f0f1ef;color:#969d96;font-size:10px}.compose-line input{flex:1;border:0;outline:0;font-size:10px;color:#424942}.compose-line input::placeholder{color:#aeb3ad}.compose-subject{border:0;width:100%;font-size:14px!important;padding:15px 0;outline:0;color:#303831}.compose-body{width:100%;height:220px;resize:vertical;border:0;border-top:1px solid #f0f1ef;padding:15px 20px;outline:0;font-size:11px;line-height:1.6;color:#414941}.compose-footer{display:flex;justify-content:space-between;align-items:center;padding:12px 20px 15px}.send-button{border:0;border-radius:6px;background:#5b8068;color:white;padding:8px 16px;font-weight:600;font-size:10px}.discard{border:0;background:transparent;color:#929890;font-size:10px}.toast{position:fixed;bottom:22px;left:50%;transform:translate(-50%,15px);opacity:0;pointer-events:none;background:#293b2e;color:#fff;padding:10px 16px;border-radius:8px;font-size:11px;box-shadow:0 5px 20px #1c2b2030;transition:.2s;z-index:20}.toast.visible{opacity:1;transform:translate(-50%,0)} /* Wasteland: warm paper, weathered ink and rust. */ body.wasteland{--bg:#eee8db;--panel:#faf6ed;--line:#e6dccb;--text:#373129;--muted:#998a76;--subtle:#f3ede1;--accent:#a75d3d;--accent-soft:#f5e8dc;--shadow:0 2px 10px #44351d0c}body.wasteland .rail{background:#e7dece;border-color:#dfd4c2}body.wasteland .brand-mark{background:#ad6847}body.wasteland .rail-button.active{background:#f1dfcd;color:#a15a39}body.wasteland .rail-button:hover{background:#eee2d2;color:#9a5739}body.wasteland .sidebar,body.wasteland .topbar{background:#faf6ed;border-color:#e6dccb}body.wasteland .account-card{background:#f4eee2;border-color:#ece2d2}body.wasteland .account-avatar{background:#ead8bf;color:#9b633e}body.wasteland .folder.active{background:#f3e6d7;color:#995c3d}body.wasteland .folder.active .nav-glyph{color:#a76645}body.wasteland .count{color:#9e6947}body.wasteland .list-pane,body.wasteland .reader-pane,body.wasteland .compose-modal{background:#faf6ed;border-color:#e6dccb}body.wasteland .compose-button,body.wasteland .send-button,body.wasteland .reply-button.primary{background:#a76645;border-color:#a76645}body.wasteland .compose-button:hover{background:#905538}body.wasteland .message.selected{background:#f5ede0;box-shadow:inset 2px 0 #ad704c}body.wasteland .reader-empty .empty-icon{background:#f3e8d8;color:#a8734c}body.wasteland .reader-button,body.wasteland .reply-button{background:#faf6ed} @@ -138,6 +138,74 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c} .pgp-trust{margin-left:8px} .draft-delete{margin-top:4px;font-size:15px;opacity:.55}.draft-delete:hover{opacity:1;color:#b3261e}.pgp-prompt-box{width:min(380px,92vw)} -.reader-body img{display:block;max-width:100%;height:auto;margin:12px 0;border-radius:6px}.reader-body table{max-width:100%;border-collapse:collapse}.reader-body th,.reader-body td{border:1px solid var(--line);padding:5px}.remote-image-notice{margin:14px 0 0;padding:12px;border:1px solid #d7a85c;border-radius:8px;background:#fff8e9;color:#664a23;font-size:10px;line-height:1.5}.remote-image-notice p{margin:0 0 8px}.remote-image-notice .reply-button{background:transparent;color:inherit;border-color:#d7a85c}body.ep-wasteland .remote-image-notice{background:#3a3022;color:#e6d1a8;border-color:#806b44}body.ep-daylight .remote-image-notice{background:#fff8e9;color:#664a23;border-color:#d7a85c} +.reader-body img{display:block;max-width:100%;height:auto;margin:12px 0;border-radius:6px}.reader-body table{max-width:100%;border-collapse:collapse}.reader-body th,.reader-body td{border:1px solid var(--line);padding:5px}.remote-image-notice{margin:14px 0 0;padding:12px;border:1px solid #d7a85c;border-radius:8px;background:#fff8e9;color:#664a23;font-size:10px;line-height:1.5}.remote-image-notice p{margin:0 0 8px}.remote-image-notice .reply-button{background:transparent;color:inherit;border-color:#d7a85c}body.ep-wasteland .remote-image-notice{background:#3a3022;color:#e6d1a8;border-color:#806b44}body.ep-daylight .remote-image-notice{background:#fff8e9;color:#664a23;border-color:#d7a85c} + +.reader-back{display:none;border:0;background:transparent;color:var(--accent);font-size:12px;padding:5px 8px 5px 0;white-space:nowrap} +.mail-security-option input[type=checkbox]{flex:0 0 auto;width:17px;height:17px} +@media(max-width:700px){ + body{min-width:320px;min-height:100dvh;overflow:hidden} + .app-shell{height:100dvh;min-height:0;flex-direction:column} + .sidebar{order:0;position:relative;width:100%;height:auto;max-height:88px;padding:5px 8px 0;border-right:0;border-bottom:1px solid var(--line);overflow:hidden} + .sidebar-head,.folders-head,.sidebar-divider,.sidebar>.section-label,.sidebar>.label-link,#custom-labels{display:none!important} + .account-card{height:36px;margin:0 64px 4px 0;padding:4px 7px;gap:7px} + .account-avatar{width:26px;height:26px} + .sidebar-bottom{position:absolute;top:3px;right:5px;margin:0;padding:0} + .storage{display:none} + .settings-button{margin:0;padding:8px;font-size:0} + .settings-button span{font-size:17px} + #mail-nav{display:flex;flex:none;gap:3px;min-height:0;max-height:42px;overflow-x:auto;overflow-y:hidden;white-space:nowrap;scrollbar-width:none} + #mail-nav::-webkit-scrollbar{display:none} + #mail-nav .folder{width:auto;min-width:max-content;flex:none;gap:5px;padding:6px 9px} + #mail-nav .nav-glyph{display:none} + #custom-folders{display:contents} + .rail{order:2;width:100%;height:54px;flex-direction:row;justify-content:center;gap:24px;padding:4px 0;border-right:0;border-top:1px solid var(--line)} + .brand-mark,.rail-spacer{display:none} + .rail-button{height:42px;width:42px} + .main-area{order:1;flex:1;min-height:0;width:100%;overflow:hidden} + .topbar{height:48px;padding:0 8px;gap:5px} + .breadcrumbs{display:none} + .top-actions{flex:1;min-width:0;gap:4px} + .search-wrap{flex:1;width:auto;min-width:0} + .search-wrap kbd,.help-button{display:none} + .top-avatar{flex:none} + .mail-layout{display:flex;flex:1;min-height:0;flex-direction:column;padding:0;gap:0;overflow:hidden} + .list-pane,.reader-pane{width:100%;height:100%;min-height:0;border:0;border-radius:0;box-shadow:none} + .reader-pane{display:none;padding:10px 12px 20px;overflow:auto} + body.reader-open .mail-layout .list-pane{display:none} + body.reader-open .mail-layout .reader-pane{display:block} + .reader-back{display:inline-flex} + .reader-topline{gap:8px} + .reader-subject{font-size:19px} + .sender-row{flex-wrap:wrap} + .message{grid-template-columns:16px 30px minmax(0,1fr) auto;gap:6px;padding:8px} + .list-heading{padding:10px 12px} + .date-line{display:none} + .list-heading h2{font-size:20px} + .compose-button{padding:8px 10px} + .page-view{padding:12px;overflow:auto} + .page-heading{align-items:flex-start;gap:8px;flex-wrap:wrap} + .page-heading h2{font-size:24px} + .cal-actions{max-width:100%;flex-wrap:wrap} + .calendar-card{overflow-x:auto} + .calendar-week,.calendar-grid{min-width:560px} + .cal-cell{height:78px;padding:4px} + .contacts-grid{grid-template-columns:1fr} + .contact-card{min-width:0} + .compose-modal{width:100%;max-width:600px;max-height:calc(100dvh - 20px);border-radius:10px} + .modal-overlay{padding:10px} + .compose-fields{padding:8px 12px 0} + .compose-line{min-height:44px;font-size:12px;gap:8px} + .compose-line input,.compose-line select{min-width:0;font-size:14px} + .compose-line input[type=checkbox]{flex:0 0 auto;width:20px;height:20px} + .compose-line span{flex:0 1 54%;line-height:1.25} + .compose-line input:not([type=checkbox]){flex:1;max-width:100%;min-width:0} + .compose-footer{gap:8px;padding:10px 12px} + .compose-body{height:30vh;padding:12px} + .account-note,.account-status{font-size:12px} + .mail-rule-row{grid-template-columns:1fr;gap:6px} + .mail-rule-row>*{grid-column:1} + .search-filters{right:8px;top:calc(100% + 4px)} +} -.sidebar{overflow-y:auto}#mail-nav{overflow-y:auto;min-height:150px;flex:0 1 auto;scrollbar-width:thin;align-content:start}#custom-folders{display:contents}.folders-head{flex:none}.sidebar>:not(#mail-nav){flex-shrink:0}.folders-head+.folder-nav{margin-top:0} +.sidebar{overflow-y:auto}#mail-nav{overflow-y:auto;min-height:150px;flex:0 1 auto;scrollbar-width:thin;align-content:start}#custom-folders{display:contents}.folders-head{flex:none}.sidebar>:not(#mail-nav){flex-shrink:0}.folders-head+.folder-nav{margin-top:0} +@media(max-width:700px){.sidebar{overflow:hidden}#mail-nav{display:flex;flex-direction:row;align-items:center;height:42px;min-height:0;max-height:42px;flex:none;overflow-x:auto;overflow-y:hidden;align-content:normal}#mail-nav .folder{height:34px;align-self:center}}