Skip to content

Commit 9a3429f

Browse files
authored
Merge branch 'master' into i18n/zh-hant-account-auth
2 parents 30b3120 + 3e85583 commit 9a3429f

240 files changed

Lines changed: 4839 additions & 47121 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.carve/ignore‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@ frontend.worker.rtc.op-mem-layer/_sync-loop-canceler
6464
frontend.worker.db-worker/init
6565
;; Used by shadow.cljs (node entrypoint)
6666
frontend.worker.db-worker-node/main
67-
;; CLI entrypoint (shadow-cljs :node-script)
68-
logseq.cli.main/main
6967
;; Future use?
7068
frontend.worker.rtc.hash/hash-blocks
7169
;; Repl fn

‎.github/workflows/build-desktop-release.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ env:
5757
CLOJURE_VERSION: '1.12.4.1618'
5858
NODE_VERSION: '24'
5959
JAVA_VERSION: '21'
60-
OCAML_VERSION: '5.4.0'
60+
OCAML_VERSION: '5.1.1'
6161

6262
jobs:
6363
compile-cljs:

‎.github/workflows/build.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ env:
1515
JAVA_VERSION: '21'
1616
# This is the latest node version we can run.
1717
NODE_VERSION: '24'
18-
OCAML_VERSION: '5.4.0'
18+
OCAML_VERSION: '5.1.1'
1919
BABASHKA_VERSION: '1.12.215'
2020

2121
jobs:

‎.github/workflows/cli-sync-stress.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ env:
3333
CLOJURE_VERSION: '1.12.4.1618'
3434
JAVA_VERSION: '21'
3535
NODE_VERSION: '24'
36-
OCAML_VERSION: '5.4.0'
36+
OCAML_VERSION: '5.1.1'
3737
BABASHKA_VERSION: '1.12.215'
3838

3939
jobs:

‎.github/workflows/deps-cli.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ env:
6464
CLOJURE_VERSION: '1.12.4.1618'
6565
JAVA_VERSION: '21'
6666
NODE_VERSION: '24'
67-
OCAML_VERSION: '5.4.0'
67+
OCAML_VERSION: '5.1.1'
6868
BABASHKA_VERSION: '1.12.215'
6969

7070
jobs:

‎.gitignore‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ cljs-test-runner-out
2828
.lein-*
2929
.nrepl-*
3030
.DS_Store
31+
__pycache__/
32+
*.pyc
33+
*.pyo
34+
nul
35+
.Rhistory
36+
.RData
37+
.Rproj.user/
38+
.ipynb_checkpoints/
3139
report.html
3240
strings.csv
3341
ssl/

‎AGENTS.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@
4444
- Use repo-local skills discovered under `.agents/skills/`; load the matching `SKILL.md` before editing files or proposing changes.
4545
- **i18n (mandatory)**: Always load `.agents/skills/logseq-i18n/SKILL.md` before any change that adds, edits, or removes user-facing UI text, regardless of whether other skills also apply.
4646
- Review notes live in `prompts/review.md`; check them when preparing changes.
47-
- DB-sync feature guide for AI agents: `docs/agent-guide/db-sync/db-sync-guide.md`.
48-
- DB-sync protocol reference: `docs/agent-guide/db-sync/protocol.md`.
47+
- Runtime, sync, CLI, rendering, search, and Graph View engineering guidance is consolidated in `docs/agent-guide/implemented/architecture/2026-08-24-logseq-runtime-and-engineering-guide.md`; current source and tests remain authoritative.
4948
- For db-sync D1 schema changes, add or update a Cloudflare worker SQL migration under `deps/db-sync/worker/migrations/`; do not rely on ad hoc runtime-only schema migration code.
5049
- New properties should be added to `logseq.db.frontend.property/built-in-properties`.
5150
- Avoid creating new class or property unless you have to.
5251
- Avoid shadow var, e.g. `bytes` should be named as `payload`.
5352
- Avoid using `js/Buffer` in browser related code.
5453
- Git commits should include a concise summary.
5554
- When deleting properties in db migration, those properties should be added to `logseq.db-sync.tx-sanitize/migration-deleted-attrs`
55+
- Use spec-dev-tool to manage agent decision documents; run `spec-dev-tool --help` and follow its AGENT WORKFLOW.
56+
- When asked to find simplifications, run `spec-dev-tool guide find-simplifications` from inside this Git worktree and follow the emitted workflow.

‎CONTRIBUTING.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ For ways to help with coding, read the next section.
3232
### <a name="code-contributions"></a> Code Contributions
3333

3434
For contributors who want to help with coding, we have a list of [good first
35-
issues](https://github.com/logseq/logseq/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
35+
issues](https://github.com/logseq/db-test/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22)
3636
to help you get started. These are issues that are beginner-friendly and do not
3737
require advanced knowledge of the codebase. We encourage new contributors to
3838
start with these issues and gradually work their way up to more challenging
@@ -169,5 +169,5 @@ Your contributions to open source, large or small, make great projects like this
169169
[feature-request]: https://discuss.logseq.com/c/feedback/feature-requests/ "Submit Feature Request"
170170
[forum]: https://discuss.logseq.com "Logseq Forum"
171171
[search-pr]: https://github.com/logseq/logseq/pulls "Search open PRs"
172-
[new-issue]: https://github.com/logseq/logseq/issues/new?assignees=&labels=&template=bug_report.yaml "Submit a New issue"
173-
[issue-tracker]: https://github.com/logseq/logseq/issues "Logseq Issue Tracker"
172+
[new-issue]: https://github.com/logseq/db-test/issues/new?assignees=&labels=&template=bug_report.yaml "Submit a New issue"
173+
[issue-tracker]: https://github.com/logseq/db-test/issues "Logseq Issue Tracker"

‎android/app/src/main/java/com/logseq/app/NativeBottomSheetPlugin.kt‎

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class NativeBottomSheetPlugin : Plugin() {
2020
private val snapshotTag = "bottom-sheet"
2121
private val mainHandler = Handler(Looper.getMainLooper())
2222
private var dialog: BottomSheetDialog? = null
23+
private var pendingPresentation: (() -> Unit)? = null
2324
private var awaitingContentReady = false
2425
private var previousParent: ViewGroup? = null
2526
private var previousIndex: Int = -1
@@ -42,7 +43,7 @@ class NativeBottomSheetPlugin : Plugin() {
4243

4344
activity.runOnUiThread {
4445
WebViewSnapshotManager.registerWindow(activity.window)
45-
if (dialog != null || awaitingContentReady) {
46+
if (dialog != null || pendingPresentation != null || awaitingContentReady) {
4647
call.resolve()
4748
return@runOnUiThread
4849
}
@@ -77,16 +78,6 @@ class NativeBottomSheetPlugin : Plugin() {
7778

7879
WebViewSnapshotManager.showSnapshot(snapshotTag, webView)
7980

80-
// Move the WebView into the BottomSheet container
81-
detachWebView(webView, ctx)
82-
container!!.addView(
83-
webView,
84-
FrameLayout.LayoutParams(
85-
ViewGroup.LayoutParams.MATCH_PARENT,
86-
ViewGroup.LayoutParams.MATCH_PARENT
87-
)
88-
)
89-
9081
val behavior = sheet.behavior
9182
val defaultHeight = call.getInt("defaultHeight", null)
9283
val allowFullHeight = call.getBoolean("allowFullHeight") ?: true
@@ -122,17 +113,42 @@ class NativeBottomSheetPlugin : Plugin() {
122113
container = null
123114
}
124115

116+
pendingPresentation = {
117+
detachWebView(webView, ctx)
118+
container!!.addView(
119+
webView,
120+
FrameLayout.LayoutParams(
121+
ViewGroup.LayoutParams.MATCH_PARENT,
122+
ViewGroup.LayoutParams.MATCH_PARENT
123+
)
124+
)
125+
sheet.show()
126+
notifyListeners("state", JSObject().put("presented", true))
127+
dialog = sheet
128+
call.resolve()
129+
}
125130
notifyListeners("state", JSObject().put("presenting", true))
126-
sheet.show()
127-
notifyListeners("state", JSObject().put("presented", true))
128-
dialog = sheet
129-
call.resolve()
130131
}
131132
}
132133

133134
@PluginMethod
134135
fun dismiss(call: PluginCall) {
135136
activity?.runOnUiThread {
137+
if (pendingPresentation != null) {
138+
pendingPresentation = null
139+
container = null
140+
WebViewSnapshotManager.clearSnapshot(snapshotTag)
141+
notifyListeners("state", JSObject().put("dismissing", true))
142+
notifyListeners(
143+
"state",
144+
JSObject()
145+
.put("presented", false)
146+
.put("dismissing", false)
147+
)
148+
call.resolve()
149+
return@runOnUiThread
150+
}
151+
136152
if (dialog == null) {
137153
pendingRestoreWebView?.let { finishDismissal(it) }
138154
?: WebViewSnapshotManager.clearSnapshot(snapshotTag)
@@ -148,6 +164,13 @@ class NativeBottomSheetPlugin : Plugin() {
148164
@PluginMethod
149165
fun contentReady(call: PluginCall) {
150166
activity?.runOnUiThread {
167+
pendingPresentation?.let { presentation ->
168+
pendingPresentation = null
169+
presentation()
170+
call.resolve()
171+
return@runOnUiThread
172+
}
173+
151174
val webView = pendingRestoreWebView
152175
if (!awaitingContentReady || webView == null) {
153176
call.resolve()

‎android/app/src/main/java/com/logseq/app/NativeTopBarPlugin.kt‎

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.logseq.app
22

3-
import android.os.Build
43
import android.view.ViewGroup
54
import android.widget.FrameLayout
65
import androidx.compose.foundation.clickable
@@ -13,6 +12,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
1312
import androidx.compose.foundation.layout.padding
1413
import androidx.compose.foundation.layout.width
1514
import androidx.compose.foundation.layout.size
15+
import androidx.compose.foundation.layout.statusBarsPadding
1616
import androidx.compose.material3.HorizontalDivider
1717
import androidx.compose.material3.Icon
1818
import androidx.compose.material3.Surface
@@ -26,8 +26,6 @@ import androidx.compose.ui.Modifier
2626
import androidx.compose.ui.graphics.Color as ComposeColor
2727
import androidx.compose.ui.graphics.toArgb
2828
import androidx.compose.ui.platform.ComposeView
29-
import androidx.compose.ui.platform.LocalDensity
30-
import androidx.compose.ui.platform.LocalView
3129
import androidx.compose.ui.platform.ViewCompositionStrategy
3230
import androidx.compose.ui.text.font.FontWeight
3331
import androidx.compose.ui.text.style.TextOverflow
@@ -44,7 +42,6 @@ import com.getcapacitor.annotation.CapacitorPlugin
4442
@CapacitorPlugin(name = "NativeTopBarPlugin")
4543
class NativeTopBarPlugin : Plugin() {
4644
private var topBarView: NativeTopBarView? = null
47-
private var originalWebViewPaddingTop: Int? = null
4845

4946
@PluginMethod
5047
fun configure(call: PluginCall) {
@@ -64,11 +61,8 @@ class NativeTopBarPlugin : Plugin() {
6461
tintHex?.takeIf { it.isNotBlank() }
6562
?.let { NativeUiUtils.parseColor(it, LogseqTheme.current().tint) }
6663

67-
val webView = bridge.webView
68-
6964
if (hidden) {
7065
removeBar()
71-
restorePadding(webView)
7266
call.resolve()
7367
return@runOnUiThread
7468
}
@@ -82,9 +76,6 @@ class NativeTopBarPlugin : Plugin() {
8276
}
8377

8478
bar.bind(title, titleClickable, leftButtons, rightButtons, tintColorOverride)
85-
bar.post {
86-
adjustWebViewPadding(webView, bar.height)
87-
}
8879
call.resolve()
8980
}
9081
}
@@ -109,40 +100,6 @@ class NativeTopBarPlugin : Plugin() {
109100
topBarView = null
110101
}
111102

112-
private fun statusBarInset(webView: android.webkit.WebView?): Int {
113-
if (webView == null) return 0
114-
return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
115-
webView.rootWindowInsets?.getInsets(android.view.WindowInsets.Type.statusBars())?.top ?: 0
116-
} else {
117-
@Suppress("DEPRECATION")
118-
webView.rootWindowInsets?.stableInsetTop ?: 0
119-
}
120-
}
121-
122-
private fun adjustWebViewPadding(webView: android.webkit.WebView?, barHeight: Int) {
123-
if (webView == null) return
124-
if (originalWebViewPaddingTop == null) {
125-
originalWebViewPaddingTop = webView.paddingTop
126-
}
127-
val insetTop = statusBarInset(webView)
128-
val target = (barHeight - insetTop).coerceAtLeast(0)
129-
.takeIf { it > 0 } ?: NativeUiUtils.dp(webView.context, 56f)
130-
webView.setPadding(
131-
webView.paddingLeft,
132-
target,
133-
webView.paddingRight,
134-
webView.paddingBottom
135-
)
136-
}
137-
138-
private fun restorePadding(webView: android.webkit.WebView?) {
139-
if (webView == null) return
140-
val original = originalWebViewPaddingTop
141-
if (original != null) {
142-
webView.setPadding(webView.paddingLeft, original, webView.paddingRight, webView.paddingBottom)
143-
}
144-
}
145-
146103
private fun parseButtons(array: JSArray?): List<ButtonSpec> {
147104
if (array == null) return emptyList()
148105
val result = mutableListOf<ButtonSpec>()
@@ -227,23 +184,12 @@ private fun TopBarContent(
227184
onTap: (String) -> Unit
228185
) {
229186
val theme by LogseqTheme.colors.collectAsState()
230-
val view = LocalView.current
231-
val density = LocalDensity.current
232187
val background = ComposeColor(theme.background)
233188
val tint = tintOverride?.let { ComposeColor(it) } ?: ComposeColor(theme.tint)
234189
val contentTint = tint.copy(alpha = 0.8f)
235-
val statusBarTopPx = remember(view) {
236-
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
237-
view.rootWindowInsets?.getInsets(android.view.WindowInsets.Type.statusBars())?.top ?: 0
238-
} else {
239-
@Suppress("DEPRECATION")
240-
view.rootWindowInsets?.stableInsetTop ?: 0
241-
}
242-
}
243-
val statusBarTop = with(density) { statusBarTopPx.toDp() }
244-
val compactTopInset = maxOf(statusBarTop, 8.dp)
245190

246191
Surface(
192+
modifier = Modifier.statusBarsPadding(),
247193
color = background,
248194
shadowElevation = 4.dp
249195
) {
@@ -252,7 +198,7 @@ private fun TopBarContent(
252198
modifier = Modifier
253199
.fillMaxWidth()
254200
.heightIn(min = 42.dp)
255-
.padding(start = 12.dp, end = 8.dp, top = compactTopInset + 8.dp, bottom = 16.dp),
201+
.padding(start = 12.dp, end = 8.dp, top = 16.dp, bottom = 16.dp),
256202
verticalAlignment = Alignment.CenterVertically
257203
) {
258204
Row(

0 commit comments

Comments
 (0)