feat: migrate to capacitor 8

- fix(sync): unblock @sp/sync-core/@sp/sync-providers typecheck under vitest 4
- chore(mobile): pin @capacitor/keyboard to 8.0.1
- chore(mobile): migrate to Capacitor 8
- Merge branch 'feat/issue-7749-3341d1'
- docs(plugins): plan for wiring PERSISTED_DATA_CHANGED hook
- test(plugins): cover document-mode bundled load and PLUGIN_USER_DATA LWW
- chore(plugins): re-bundle document-mode and document Stage A path
This commit is contained in:
Johannes Millan 2026-05-23 20:27:03 +02:00
parent b3324e37b9
commit 334b14aa26
11 changed files with 1860 additions and 3629 deletions

View file

@ -18,8 +18,8 @@ android {
defaultConfig {
applicationId "com.superproductivity.superproductivity"
minSdkVersion 24
targetSdkVersion 35
compileSdk 35
targetSdkVersion 36
compileSdk 36
versionCode 18_07_00_9000
versionName "18.7.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

View file

@ -40,7 +40,7 @@
<activity
android:name=".FullscreenActivity"
android:allowTaskReparenting="true"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation|density"
android:exported="true"
android:hardwareAccelerated="true"
android:label="@string/title_activity_fullscreen"
@ -62,7 +62,7 @@
<activity
android:name=".CapacitorMainActivity"
android:allowTaskReparenting="true"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode|navigation|density"
android:exported="true"
android:hardwareAccelerated="true"
android:label="@string/title_activity_fullscreen"

View file

@ -1,6 +1,6 @@
buildscript {
ext.kotlin_version = "1.9.20"
ext.kotlin_version = "2.2.20"
repositories {
google()
mavenCentral()

View file

@ -1,6 +1,6 @@
#Mon Dec 05 02:55:25 MSK 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-all.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

View file

@ -13,14 +13,19 @@ const config: CapacitorConfig = {
smallIcon: 'ic_stat_sp',
},
Keyboard: {
// Used by iOS native keyboard handling. Android uses JavaScriptInterface
// for keyboard visibility and excludes the native Keyboard plugin below.
resize: 'body',
// iOS-only: Android excludes @capacitor/keyboard via includePlugins below
// and uses JavaScriptInterface for keyboard visibility instead.
// 'native' resizes the WKWebView so 100vh fits above the keyboard.
resize: 'native',
resizeOnFullScreen: true,
},
StatusBar: {
// iOS: overlay the status bar so content can sit beneath it.
// No-op on Android 15+ (targetSdk 36).
overlaysWebView: true,
},
},
android: {
adjustMarginsForEdgeToEdge: 'auto',
// Android keyboard visibility is handled by JavaScriptInterface. Keeping
// @capacitor/keyboard Android-side registers an unused insets callback
// that can crash in Keyboard$1.onEnd on some devices.
@ -46,18 +51,6 @@ const config: CapacitorConfig = {
allowsLinkPreview: true,
// Scroll behavior
scrollEnabled: true,
// iOS-specific plugin overrides
plugins: {
StatusBar: {
overlaysWebView: true,
},
Keyboard: {
// Resize the native WebView when keyboard appears
// This shrinks the viewport so 100vh/100% automatically fits above keyboard
resize: 'native',
resizeOnFullScreen: true,
},
},
},
};

5407
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -178,13 +178,13 @@
"@ctrl/tinycolor": "4.1.0"
},
"dependencies": {
"@capacitor/browser": "^7.0.4",
"@capacitor/ios": "^7.4.4",
"@capacitor/keyboard": "^7.0.4",
"@capacitor/status-bar": "^7.0.4",
"@capacitor/browser": "^8.0.3",
"@capacitor/ios": "^8.3.4",
"@capacitor/keyboard": "8.0.1",
"@capacitor/status-bar": "^8.0.2",
"@material-symbols/font-400": "^0.44.4",
"@noble/ciphers": "^2.2.0",
"capacitor-plugin-safe-area": "^4.0.3",
"capacitor-plugin-safe-area": "^5.0.0",
"electron-dl": "^3.5.2",
"electron-localshortcut": "^3.2.1",
"electron-log": "^5.4.3",
@ -216,15 +216,15 @@
"@angular/platform-server": "^21.2.11",
"@angular/router": "^21.2.11",
"@angular/service-worker": "^21.2.11",
"@capacitor/android": "^7.4.4",
"@capacitor/app": "^7.1.0",
"@capacitor/cli": "^7.5.0",
"@capacitor/core": "^7.4.3",
"@capacitor/filesystem": "^7.1.1",
"@capacitor/local-notifications": "^7.0.1",
"@capacitor/share": "^7.0.2",
"@capawesome/capacitor-android-dark-mode-support": "^7.0.0",
"@capawesome/capacitor-background-task": "^7.0.1",
"@capacitor/android": "^8.3.4",
"@capacitor/app": "^8.1.0",
"@capacitor/cli": "^8.3.4",
"@capacitor/core": "^8.3.4",
"@capacitor/filesystem": "^8.1.2",
"@capacitor/local-notifications": "^8.2.0",
"@capacitor/share": "^8.0.1",
"@capawesome/capacitor-android-dark-mode-support": "^8.0.1",
"@capawesome/capacitor-background-task": "^8.0.2",
"@csstools/stylelint-formatter-github": "^2.0.0",
"@dotenv-run/cli": "^1.3.6",
"@electron/notarize": "^3.1.1",

View file

@ -6,7 +6,7 @@
"declarationMap": false,
"noEmit": true,
"rootDir": ".",
"types": ["vitest"]
"types": ["vitest", "node"]
},
"include": ["src/**/*", "tests/**/*"],
"exclude": ["node_modules", "dist"]

View file

@ -1,14 +1,18 @@
import { describe, expect, it, vi } from 'vitest';
import { NOOP_SYNC_LOGGER, type SyncLogger } from '@sp/sync-core';
import { NOOP_SYNC_LOGGER, type SyncLogger, type SyncLogMeta } from '@sp/sync-core';
import {
WebdavXmlParser,
type FileMeta,
} from '../../../src/file-based/webdav/webdav-xml-parser';
import { RemoteFileNotFoundAPIError } from '../../../src/errors';
const makeLogger = (): SyncLogger & { critical: ReturnType<typeof vi.fn> } => ({
type CriticalFn = (message: string, meta?: SyncLogMeta) => void;
const makeLogger = (): SyncLogger & {
critical: ReturnType<typeof vi.fn<CriticalFn>>;
} => ({
...NOOP_SYNC_LOGGER,
critical: vi.fn(),
critical: vi.fn<CriticalFn>(),
});
const sampleMultistatus = `<?xml version="1.0" encoding="utf-8"?>

View file

@ -11,7 +11,7 @@
"@sp/sync-providers/log": ["src/log.ts"]
},
"rootDir": "..",
"types": ["vitest"]
"types": ["vitest", "node"]
},
"include": ["src/**/*", "tests/**/*"],
"exclude": ["node_modules", "dist"]

View file

@ -690,8 +690,7 @@ export class GlobalThemeService {
*/
/**
* Read native safe area insets and set CSS variables.
* Works around Capacitor 7's broken adjustMarginsForEdgeToEdge and
* Android WebView's unreliable env(safe-area-inset-*) values.
* Works around Android WebView's unreliable env(safe-area-inset-*) values.
*/
private _initSafeAreaInsets(): void {
const applyInsets = (insets: {