Skip to content

Commit 892c6c3

Browse files
committed
fix(mobile): safe area
1 parent a02c9d3 commit 892c6c3

File tree

10 files changed

+22
-29
lines changed

10 files changed

+22
-29
lines changed

resources/mobile/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en" data-color="logseq">
33
<head>
44
<meta charset="UTF-8">
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=no">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, viewport-fit=cover, user-scalable=no">
66
<link href="./css/style.css" rel="stylesheet" type="text/css">
77
<title>Logseq: A privacy-first platform for knowledge management and collaboration</title>
88
</head>

src/main/frontend/components/repo.cljs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,8 @@
227227
(when-not (util/capacitor?)
228228
[:h1.title (t :graph/all-graphs)])
229229

230-
[:div.pl-1.content.mt-8
230+
[:div.pl-1.content
231+
{:class (when-not (util/mobile?) "mt-8")}
231232
(when-not (util/mobile?)
232233
[:div.flex.flex-row.my-8
233234
[:div.mr-8

src/main/mobile/components/app.cljs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
(rum/defc journals
3232
[]
3333
(ui-component/classic-app-container-wrap
34-
[:div.pt-6
35-
(journal/all-journals)]))
34+
(journal/all-journals)))
3635

3736
(rum/defc home-inner < rum/static
3837
[db-restoring?]
@@ -92,8 +91,7 @@
9291
{:did-mount (fn [state]
9392
(p/do!
9493
(editor-handler/quick-add-ensure-new-block-exists!)
95-
;; (editor-handler/quick-add-open-last-block!)
96-
)
94+
(editor-handler/quick-add-open-last-block!))
9795
state)}
9896
[]
9997
(quick-add/quick-add))
@@ -143,9 +141,7 @@
143141
(when-let [element (util/app-scroll-container-node)]
144142
(common-handler/listen-to-scroll! element)))
145143
[])
146-
[:div.h-full {:class (if (contains? #{"search"} tab)
147-
"mt-20"
148-
"mt-24")}
144+
[:div.h-full
149145
(mobile-header/header current-repo tab)
150146
(main-content tab route-match)]))
151147

@@ -162,7 +158,7 @@
162158
show-popup? (and open? content-fn)
163159
fold-button-on-right? (state/enable-fold-button-right?)
164160
route-match (state/sub :route-match)]
165-
[:main.w-full.h-full
161+
[:div#app-main.w-full.h-full
166162
{:class (util/classnames
167163
[{:ls-fold-button-on-right fold-button-on-right?}])}
168164
[:div.w-full.h-full {:class (when show-popup? "invisible")}

src/main/mobile/components/app.css

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,19 @@
66
:root {
77
--ls-mobile-font-scale: 1;
88
--ls-page-title-size: calc(26px * var(--ls-mobile-font-scale, 1));
9-
--safe-area-inset-top: 40px;
10-
--safe-area-inset-bottom: 16px;
119
--ls-mobile-font-size: 16px;
1210
}
1311

14-
html.is-native-ios {
15-
--safe-area-inset-top: 58px;
16-
--safe-area-inset-bottom: 24px;
17-
}
18-
1912
html.is-native-ios,
2013
html.is-ios {
2114
font-size: calc(var(--ls-mobile-font-size) * var(--ls-mobile-font-scale, 1));
2215
}
2316

17+
#app-main {
18+
padding-top: env(safe-area-inset-top);
19+
padding-bottom: env(safe-area-inset-bottom);
20+
}
21+
2422
html.is-native-ios body,
2523
html.is-native-ios textarea,
2624
html.is-native-ios input,
@@ -49,7 +47,7 @@ html.has-mobile-keyboard {
4947
}
5048

5149
.app-popup, #main-content-container, #app-main-home {
52-
padding-bottom: calc(var(--ls-native-kb-height, 0px) + 160px);
50+
padding-bottom: calc(var(--ls-native-kb-height, 0px) + 32px);
5351
}
5452
}
5553

@@ -311,7 +309,8 @@ body, #root {
311309
height: 100%;
312310
overflow-y: auto;
313311
-webkit-overflow-scrolling: touch;
314-
padding-bottom: 160px;
312+
padding-top: 0px;
313+
padding-bottom: 64px;
315314
}
316315

317316
.cp__select-main, .cp__emoji-icon-picker, .ls-property-key {

src/main/mobile/components/favorites.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(rum/defc favorites
77
[]
88
[:div.left-sidebar-inner
9-
[:div.sidebar-contents-container.mt-2
9+
[:div.sidebar-contents-container
1010
{:class "!gap-4"}
1111
(app-left-sidebar/sidebar-favorites)
1212
(app-left-sidebar/sidebar-recent-pages)]])

src/main/mobile/components/graphs.cljs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,4 @@
66
(rum/defc page < rum/reactive
77
[]
88
[:div.app-index-graphs
9-
[:div.mt-8
10-
(repo/repos-cp)]])
9+
(repo/repos-cp)])

src/main/mobile/components/header.cljs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,7 @@
143143
(defn- configure-native-top-bar!
144144
[repo {:keys [tab title route-name route-view sync-color favorited?]}]
145145
(when (mobile-util/native-ios?)
146-
(let [hidden? (and (contains? #{"search"} tab)
147-
(not= route-name :page))
146+
(let [hidden? false
148147
rtc-indicator? (and repo
149148
(ldb/get-graph-rtc-uuid (db/get-db))
150149
(user-handler/logged-in?))
@@ -219,14 +218,14 @@
219218
(:block/title block)
220219
(= tab "home")
221220
short-repo-name
221+
(= tab "search")
222+
"Search"
222223
:else
223224
(string/capitalize tab))]
224225
(configure-native-top-bar!
225226
current-repo
226227
{:tab tab
227228
:title title
228-
:hidden? (and (= tab "search")
229-
(not= route-name :page))
230229
:route-name route-name
231230
:route-view route-view
232231
:sync-color sync-color

src/main/mobile/components/search.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
(when (and (string/blank? input) (seq recents))
6060
[:div
6161
[:div.px-2.font-medium.text-muted-foreground
62-
[:div.flex.flex-item.items-center.justify-between.mt-2
62+
[:div.flex.flex-item.items-center.justify-between
6363
"Recent"
6464
(shui/button
6565
{:variant :text

src/main/mobile/deeplink.cljs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
(:require [clojure.string :as string]
44
[frontend.config :as config]
55
[frontend.db.async :as db-async]
6-
[frontend.handler.editor :as editor-handler]
76
[frontend.handler.notification :as notification]
87
[frontend.handler.route :as route-handler]
98
[frontend.mobile.intent :as intent]

src/main/mobile/routes.cljs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
["/page/:name"
1111
{:name :page
1212
:view (fn [route-match]
13-
[:div.ls-mobile-page.pt-8
13+
[:div.ls-mobile-page
1414
(page/page-cp (assoc route-match :mobile-page? true))])}]
1515
["/import"
1616
{:name :import

0 commit comments

Comments
 (0)