diff --git a/package-lock.json b/package-lock.json index d1cdc90..5c176a3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "ep-mail", - "version": "0.5.4", + "version": "0.5.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "ep-mail", - "version": "0.5.4", + "version": "0.5.5", "dependencies": { "@capacitor/android": "^8.5.2", "@capacitor/core": "^8.5.2", diff --git a/package.json b/package.json index 6c66a56..9610b15 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ep-mail", - "version": "0.5.4", + "version": "0.5.5", "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 57acb96..f80fb9d 100644 --- a/service-worker.js +++ b/service-worker.js @@ -1,4 +1,4 @@ -const CACHE='ep-mail-v15'; +const CACHE='ep-mail-v16'; 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)).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()))); diff --git a/styles.css b/styles.css index 6a5f217..df10861 100644 --- a/styles.css +++ b/styles.css @@ -142,7 +142,7 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c} .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){ +@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){ 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} @@ -208,4 +208,27 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c} } .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}} +@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){ + .reader-pane{overflow-x:hidden} + .reader-header,.reader-topline,.sender-row,.sender-details,.reader-body{min-width:0;max-width:100%} + .reader-subject,.reader-body,.reader-body p,.reader-body li,.reader-body a,.reader-body td,.reader-body th{overflow-wrap:anywhere;word-break:break-word} + .reader-body table{display:block;width:100%;max-width:100%;overflow-x:auto;table-layout:fixed} + .reader-body pre,.reader-body code{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere} + .sender-row .message-date{max-width:100%;white-space:normal;overflow-wrap:anywhere} + .attachment{width:100%;max-width:100%;min-width:0} +} +@media(max-height:500px) and (orientation:landscape) and (max-width:1200px){ + .sidebar{max-height:72px;padding-top:3px} + .account-card{height:30px;margin-bottom:2px} + #mail-nav{height:34px;max-height:34px} + #mail-nav .folder{height:29px;padding-block:4px} + .rail{height:44px;gap:14px} + .rail-button{height:36px;width:36px} + .topbar{height:42px} + .list-heading{padding-block:6px} + .toolbar{height:32px} + .message{min-height:54px} + .list-foot{height:30px} + .reader-pane{padding-bottom:10px} +} +@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){.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 index 3575cc4..f199716 100644 --- a/tests/android-ui-support.test.cjs +++ b/tests/android-ui-support.test.cjs @@ -12,7 +12,9 @@ const mainActivity = fs.readFileSync(path.join(root, 'android', 'app', 'src', 'm 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, /@media\(max-width:1000px\),\(max-height:500px\) and \(orientation:landscape\)/); + assert.match(styles, /@media\(max-height:500px\) and \(orientation:landscape\)/); + assert.match(styles, /overflow-wrap:anywhere;word-break:break-word/); assert.match(styles, /\.hidden,\[hidden\]\{display:none!important\}/); assert.match(styles, /body\.reader-open \.mail-layout \.list-pane/); assert.match(app, /id="reader-back"/); diff --git a/www/service-worker.js b/www/service-worker.js index 57acb96..f80fb9d 100644 --- a/www/service-worker.js +++ b/www/service-worker.js @@ -1,4 +1,4 @@ -const CACHE='ep-mail-v15'; +const CACHE='ep-mail-v16'; 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)).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()))); diff --git a/www/styles.css b/www/styles.css index 6a5f217..df10861 100644 --- a/www/styles.css +++ b/www/styles.css @@ -142,7 +142,7 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c} .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){ +@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){ 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} @@ -208,4 +208,27 @@ body.ep-daylight .row-check:checked{accent-color:#526a2c} } .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}} +@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){ + .reader-pane{overflow-x:hidden} + .reader-header,.reader-topline,.sender-row,.sender-details,.reader-body{min-width:0;max-width:100%} + .reader-subject,.reader-body,.reader-body p,.reader-body li,.reader-body a,.reader-body td,.reader-body th{overflow-wrap:anywhere;word-break:break-word} + .reader-body table{display:block;width:100%;max-width:100%;overflow-x:auto;table-layout:fixed} + .reader-body pre,.reader-body code{max-width:100%;white-space:pre-wrap;overflow-wrap:anywhere} + .sender-row .message-date{max-width:100%;white-space:normal;overflow-wrap:anywhere} + .attachment{width:100%;max-width:100%;min-width:0} +} +@media(max-height:500px) and (orientation:landscape) and (max-width:1200px){ + .sidebar{max-height:72px;padding-top:3px} + .account-card{height:30px;margin-bottom:2px} + #mail-nav{height:34px;max-height:34px} + #mail-nav .folder{height:29px;padding-block:4px} + .rail{height:44px;gap:14px} + .rail-button{height:36px;width:36px} + .topbar{height:42px} + .list-heading{padding-block:6px} + .toolbar{height:32px} + .message{min-height:54px} + .list-foot{height:30px} + .reader-pane{padding-bottom:10px} +} +@media(max-width:1000px),(max-height:500px) and (orientation:landscape) and (max-width:1200px){.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}}