diff --git a/.forgejo/workflows/buildAndTest.yml b/.forgejo/workflows/buildAndTest.yml
index a0f3a375..86694c89 100644
--- a/.forgejo/workflows/buildAndTest.yml
+++ b/.forgejo/workflows/buildAndTest.yml
@@ -25,9 +25,9 @@ on:
jobs:
build:
-
runs-on: docker
-
+ container:
+ image: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v1
steps:
- name: Clone yavsc
run: |
@@ -39,10 +39,9 @@ jobs:
git checkout FETCH_HEAD
fi
git submodule update --init --recursive
- echo "Checked out at $(git rev-parse HEAD) on $(git branch --show-current 2>/dev/null || echo detached HEAD)"
- - name: Restore dependencies
- run: cd /src/_src && dotnet restore
- - name: Build
- run: cd /src/_src && dotnet build --no-restore
+ echo "✅ Checked out at $(git rev-parse HEAD) on $(git branch --show-current 2>/dev/null || echo detached HEAD)"
+
- name: Test
- run: cd /src/_src && dotnet test --no-build --verbosity normal
+ run: |
+ echo "🚀 Lancement des tests..."
+ cd /src/_src && dotnet test --verbosity normal && echo "✅ Success !"
diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml
index 09d9757a..930c97b9 100644
--- a/.forgejo/workflows/release.yml
+++ b/.forgejo/workflows/release.yml
@@ -51,6 +51,8 @@ jobs:
# via l'API REST Forgejo (pas d'actions tierces Node).
release:
runs-on: docker
+ container:
+ image: pazof/yavsc-build-env:debian13-dotnet10-android36-jdk21-v1
steps:
- name: Clone du repo au tag demandé
env:
@@ -194,10 +196,10 @@ jobs:
# la racine du checkout pour que l'étape d'upload le trouve.
run: |
cd /src/_src
- APK=src/PostIt/PostIt.Android/bin/Release/net10.0-android/android-arm64/fr.pschneider.PostIt-Signed.apk
+ APK=src/PostIt/PostIt.Android/bin/Release/net10.0-android/android-arm64/fr.pschneider.postit-Signed.apk
if [[ ! -f "$APK" ]]; then
echo "::error::APK not found at $APK"
- ls -la src/PostIt/PostIt.Android/bin/Release/net10.0-android/ 2>/dev/null || true
+ ls -la src/PostIt/PostIt.Android/bin/Release/net10.0-android/android-arm64 2>/dev/null || true
exit 1
fi
cp "$APK" /src/_src/PostIt.Android.apk
diff --git a/.github/workflows/docker-publish-android.yml b/.github/workflows/docker-publish-android.yml
index d560b216..a4ce15aa 100644
--- a/.github/workflows/docker-publish-android.yml
+++ b/.github/workflows/docker-publish-android.yml
@@ -40,7 +40,7 @@ jobs:
- name: Extraire l'APK du conteneur Docker
run: |
docker create --name extractor postit-android
- docker cp extractor:/src/src/PostIt/PostIt.Android/bin/Release/net10.0-android/android-arm64/fr.pschneider.PostIt-Signed.apk ./PostIt.Android.apk
+ docker cp extractor:/src/src/PostIt/PostIt.Android/bin/Release/net10.0-android/android-arm64/fr.pschneider.postit-Signed.apk ./PostIt.Android.apk
docker rm extractor
- name: Téléverser l'APK en tant qu'Artéfact GitHub
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 42be176a..dc8d3c68 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -1,59 +1,57 @@
{
- // Utilisez IntelliSense pour en savoir plus sur les attributs possibles.
- // Pointez pour afficher la description des attributs existants.
- // Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387
- "version": "0.2.0",
- "configurations": [
- {
- "name": "Debug - Android",
+ // Utilisez IntelliSense pour en savoir plus sur les attributs possibles.
+ // Pointez pour afficher la description des attributs existants.
+ // Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": "Android Debug",
"type": "mono",
"preLaunchTask": "run-debug-android",
"request": "attach",
"address": "localhost",
- "port": 10000
+ "port": 55555
},
{
- "name": "Attach - Android",
+ "name": "Android Attach - Debug",
"type": "mono",
"request": "attach",
"address": "localhost",
- "port": 10000
+ "port": 55555
},
- {
- "name": "API",
- "type": "dotnet",
- "request": "launch",
- "projectPath": "${workspaceFolder}/src/Api/Api.csproj"
- },
- {
- "name": "Yavsc.Org",
- "type": "dotnet",
- "request": "launch",
- "projectPath": "${workspaceFolder}/src/Yavsc.Org/Yavsc.Org.csproj",
- },
- {
- "name": "Yavsc.Blogs",
- "type": "dotnet",
- "request": "launch",
- "projectPath": "${workspaceFolder}/src/Yavsc.Blogs/Yavsc.Blogs.csproj"
- },
- {
- "name": "PostIt",
- "type": "dotnet",
- "request": "launch",
- "projectPath": "${workspaceFolder}/src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj",
-
- },
- {
- "name": "Test PostIt.Android launch (Xamarin.UITest)",
- "type": "coreclr",
- "request": "launch",
- "program": "${workspaceFolder}/src/PostIt/PostIt.Tests/bin/Debug/net10.0/PostIt.Tests.dll",
- "args": [
- ],
- "cwd": "${workspaceFolder}/src/PostIt/PostIt.Tests",
- "console": "integratedTerminal",
- "stopAtEntry": false
- }
- ]
+ {
+ "name": "API",
+ "type": "dotnet",
+ "request": "launch",
+ "projectPath": "${workspaceFolder}/src/Api/Api.csproj"
+ },
+ {
+ "name": "Yavsc Org",
+ "type": "dotnet",
+ "request": "launch",
+ "projectPath": "${workspaceFolder}/src/Yavsc.Org/Yavsc.Org.csproj",
+ },
+ {
+ "name": "Yavsc Blogs",
+ "type": "dotnet",
+ "request": "launch",
+ "projectPath": "${workspaceFolder}/src/Yavsc.Blogs/Yavsc.Blogs.csproj"
+ },
+ {
+ "name": "PostIt Desktop",
+ "type": "dotnet",
+ "request": "launch",
+ "projectPath": "${workspaceFolder}/src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj",
+ },
+ {
+ "name": "Test PostIt.Android launch (Xamarin.UITest)",
+ "type": "coreclr",
+ "request": "launch",
+ "program": "${workspaceFolder}/src/PostIt/PostIt.Tests/bin/Debug/net10.0/PostIt.Tests.dll",
+ "args": [],
+ "cwd": "${workspaceFolder}/src/PostIt/PostIt.Tests",
+ "console": "integratedTerminal",
+ "stopAtEntry": false
+ }
+ ]
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 16bbe483..915683fc 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -5,6 +5,7 @@
"appsettings",
"asciidoctor",
"ASPNETCORE",
+ "Avalonia",
"Configurabilité",
"Cratie",
"DESTDIR",
@@ -15,6 +16,7 @@
"Hsts",
"Newtonsoft",
"Npgsql",
+ "Oidc",
"PKCE",
"postit",
"pschneider",
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
index c900fa6a..3c0c0bf2 100644
--- a/.vscode/tasks.json
+++ b/.vscode/tasks.json
@@ -10,19 +10,32 @@
"env": {
"DOTNET_HOST_PATH": "/usr/share/dotnet",
"ANDROID_HOME": "/opt/android-sdk",
- "JAVA_HOME": "/usr/lib/jvm/java-1.21.0-openjdk-amd64"
+ "JAVA_HOME": "/usr/lib/jvm/java-1.25.0-openjdk-amd64"
}
},
"args": [
- "build"
- "-t:run",
+ "run",
"-p:TargetFramework=net10.0-android",
"-p:Configuration=Debug",
"-p:AndroidAttachDebugger=true",
- "-p:AndroidSdbHostPort=10000",
- "-p:AndroidSdbTargetPort=10000"
+ "-p:AndroidSdbHostPort=55555",
+ "-p:AndroidSdbTargetPort=55555"
],
- "problemMatcher": "$msCompile"
+ "problemMatcher": [
+ {
+ "owner": "dotnet",
+ "fileLocation": ["relative", "${workspaceFolder}"],
+ "source": "dotnet",
+ "pattern": {
+ "regexp": "^(.*):(\\d+):(\\d+):\\s+(error):\\s+(.*)$",
+ "file": 1,
+ "line": 2,
+ "column": 3,
+ "severity": 4,
+ "message": 5
+ }
+ }
+ ]
},
{
"label": "build",
@@ -62,59 +75,6 @@
"kind": "build"
},
"isBackground": true
- },
- {
- "label": "test blogs",
- "type": "process",
- "problemMatcher": ["$msCompile"],
- "command": "dotnet",
- "args": ["test"],
- "runOptions": {
- "instanceLimit": 1
- },
- "options": {
- "cwd": "src/Yavsc.Blogs",
- "env": {
- "DOTNET_CLI_UI_LANGUAGE": "en-US",
- "ASPNETCORE_ENVIRONMENT": "Development"
- }
- },
- "group": {
- "kind": "test"
- },
- "isBackground": true,
- "presentation": {
- "echo": true,
- "reveal": "always",
- "focus": false,
- "panel": "shared",
- "showReuseMessage": true,
- "clear": false
- }
- },
- {
- "label": "publish",
- "command": "dotnet",
- "type": "process",
- "args": [
- "publish",
- "/property:GenerateFullPaths=true",
- "/consoleloggerparameters:NoSummary;ForceNoAlign"
- ],
- "problemMatcher": "$msCompile"
- },
- {
- "label": "watch",
- "command": "dotnet",
- "type": "process",
- "args": ["watch", "--project",
- "src/Yavsc.Org/Yavsc.Org.csproj"
- ],
- "problemMatcher": "$msCompile",
- "runOptions": {
-
- }
-
}
]
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index e2a446a0..6adf462a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -16,6 +16,24 @@ Cette convention est partagée avec le dépôt
[`postit-debian`](https://forgejo.pschneider.fr/notazof/postit-debian)
pour la production des paquets `.deb`.
+## [1.0.8-rc3] - unstable
+
+### Added
+
+* a code cleanup,
+* a first Xamarin.UITest is successful, but disabled, because breaking the actual CI process,
+* Android app starts, the login process succeeds
+
+### Changed
+
+L'identifiant de l'application client Android a changé, il passe en minuscules :
+`fr.pschneider.postit`
+
+### Fixed
+
+nothing, [TODO] a bug persists laoding a blog post from PostIt, ACL sould come along with and should not need any "Refresh" button.
+Today, assigning ACL succeeds the first time, the following times result in a 409
+
## [1.0.8-rc1] - unstable
### Added
diff --git a/Directory.Build.props b/Directory.Build.props
index aec8c990..0ce825bd 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -11,6 +11,6 @@
from without conflicting names.
-->
true
- NU1701, NU1901, NU1902
+ NU1701, NU1901, NU1902, NU1507
diff --git a/Makefile b/Makefile
index d6d69196..fa9d4ecf 100644
--- a/Makefile
+++ b/Makefile
@@ -121,168 +121,4 @@ release:
git push -u origin "$$BRANCH"; \
echo "==> Terminé. Branche $$BRANCH live sur origin."
-# Cibles pour installer PostIt.Android en Debug sur l'AVD qemu.
-#
-# Usage typique :
-# make qemu # lance l'AVD, attend le boot, build l'APK, l'installe
-# make qemu-install # (re)build l'APK et l'installe (AVD doit tourner)
-# make qemu-build # build l'APK seul (sans install)
-# make qemu-run # démarre l'AVD en background
-# make qemu-stop # arrête l'émulateur
-# make qemu-wait-boot # attend que l'AVD ait fini de booter
-#
-# Variables surchargeables (make VAR=valeur) :
-# AVD_NAME default: postit_test_avd
-# (l'AVD doit être listé par `avdmanager list avd`)
-# ADB_SERIAL default: emulator-5554
-# (port standard du premier émulateur lancé)
-# ANDROID_HOME default: /opt/android-sdk
-# (le SDK Android local; doit contenir
-# emulator/emulator et platform-tools/adb)
-# POSTIT_RID default: android-x64
-# (doit matcher l'ABI de l'AVD; `avdmanager list avd`
-# affiche la ligne Tag/ABI)
-# EMU_HEADLESS default: 0
-# (1 = lancer l'émulateur sans fenêtre, pour scripter)
-# CONFIG surcharge la variable CONFIG globale (Debug par
-# défaut dans ce Makefile). Passer à Release pour
-# un APK optimisé et signé release.
-# LOGCAT_LINES default: 200
-# (nombre de lignes dumpées par `make qemu-logcat`)
-# LOGCAT_FOLLOW default: 0
-# (1 = stream live via `make qemu-logcat`,
-# sinon dump one-shot des N dernières lignes)
-# LOGCAT_BOOT_WAIT default: 30
-# (secondes d'attente entre le clear du buffer,
-# le `am start`, et le dump final dans
-# `make qemu-logcat-boot`)
-AVD_NAME ?= postit_test_avd
-ADB_SERIAL ?= emulator-5554
-ANDROID_HOME ?= /opt/android-sdk
-POSTIT_RID ?= android-x64
-EMU_HEADLESS ?= 0
-LOGCAT_LINES ?= 600
-LOGCAT_FOLLOW ?= 0
-LOGCAT_BOOT_WAIT ?= 20
-
-ANDROID_PACKAGE_NAME = fr.pschneider.PostIt
-POSTIT_ANDROID_CSPROJ := src/PostIt/PostIt.Android/PostIt.Android.csproj
-POSTIT_APK_DIR := src/PostIt/PostIt.Android/bin/$(CONFIG)/net10.0-android/$(POSTIT_RID)
-POSTIT_APK := $(POSTIT_APK_DIR)/$(ANDROID_PACKAGE_NAME)-Signed.apk
-
-qemu-run:
- @echo " Starting AVD $(AVD_NAME) on $(ADB_SERIAL)..."
- @mkdir -p /tmp/yavsc-emu
- @EMU_ARGS=""; \
- if [ "$(EMU_HEADLESS)" = "1" ]; then EMU_ARGS="-no-window -no-audio"; fi; \
- $(ANDROID_HOME)/emulator/emulator -avd $(AVD_NAME) $$EMU_ARGS \
- >/tmp/yavsc-emu/$(AVD_NAME).log 2>&1 & \
- echo " emulator PID: $$!"
-
-qemu-stop:
- adb -s $(ADB_SERIAL) emu kill
-
-qemu-wait-boot:
- @echo " Waiting for $(ADB_SERIAL) to finish booting..."
- adb -s $(ADB_SERIAL) wait-for-device
- @for i in $$(seq 1 180); do \
- BOOTED=$$(adb -s $(ADB_SERIAL) shell getprop sys.boot_completed 2>/dev/null | tr -d '\r\n'); \
- if [ "$$BOOTED" = "1" ]; then \
- echo " ✓ booted in $${i}s"; \
- exit 0; \
- fi; \
- sleep 1; \
- done; \
- echo " ERROR: device did not boot within 180s." >&2; \
- echo " Logs: /tmp/yavsc-emu/$(AVD_NAME).log" >&2; \
- exit 1
-
-qemu-build:
- # EmbedAssembliesIntoApk=true: without this, the Debug APK ships
- # without the managed assemblies in it (they are pushed at runtime
- # via `adb push`, "Fast Deployment"). On the qemu emulator, the
- # runtime cannot find them in `files/.__override__//` and
- # aborts at startup with "No assemblies found in '.__override__'"
- # (monodroid-glue.cc:757, SIGABRT). Forcing this property on
- # packages the .dlls into the APK as `assemblies//` so the
- # runtime reads them directly.
- #
- # The Xamarin.Android SDK property is `EmbedAssembliesIntoApk`,
- # not `AndroidEnableFastDeployment` (which exists in older
- # templates but is a no-op in the .NET 10 SDK).
- dotnet build $(POSTIT_ANDROID_CSPROJ) \
- -c $(CONFIG) \
- -p:RuntimeIdentifier=$(POSTIT_RID) \
- -p:EmbedAssembliesIntoApk=true \
- --nologo
- @if [ ! -f "$(POSTIT_APK)" ]; then \
- echo " APK not found at $(POSTIT_APK)." >&2; \
- echo " Files in $(POSTIT_APK_DIR):" >&2; \
- ls -la "$(POSTIT_APK_DIR)" 2>/dev/null || echo " (directory does not exist)" >&2; \
- exit 1; \
- fi
-
-
-qemu-install: qemu-build
- @echo " Installing $(POSTIT_APK) on $(ADB_SERIAL)..."
- adb -s $(ADB_SERIAL) install -r "$(POSTIT_APK)" -r
-
-qemu-uninstall:
- adb -s $(ADB_SERIAL) uninstall $(ANDROID_PACKAGE_NAME)
-
-# Dump recent logcat output for the running PostIt.Android process.
-# By default, prints the last $(LOGCAT_LINES) lines (one-shot, with
-# `-d`). Set LOGCAT_FOLLOW=1 to follow the stream live instead.
-# Filtering is by PID (pidof $(ANDROID_PACKAGE_NAME)), not by tag,
-# because Mono/Xamarin can emit logs under several tags
-# (mono, PostIt.Android, Avalonia.Android) and tag-based filtering
-# would miss the ones not matching. PID-based filtering is exact.
-# If the app is not running, pidof returns empty and logcat exits
-# silently with no output; that is the expected behaviour for
-# "no logs yet".
-qemu-logcat:
- @PID=$$(adb -s $(ADB_SERIAL) shell pidof $(ANDROID_PACKAGE_NAME) 2>/dev/null | tr -d '\r\n'); \
- if [ -z "$$PID" ]; then \
- echo " $(ANDROID_PACKAGE_NAME) is not running on $(ADB_SERIAL)."; \
- echo " Start the app first (am start -n $(ANDROID_PACKAGE_NAME)/PostIt.Android.PostItMainActivity)"; \
- exit 1; \
- fi; \
- echo " Following PID $$PID (LOGCAT_FOLLOW=$(LOGCAT_FOLLOW), LOGCAT_LINES=$(LOGCAT_LINES))"; \
- if [ "$(LOGCAT_FOLLOW)" = "1" ]; then \
- adb -s $(ADB_SERIAL) logcat -v time --pid=$$PID $(ANDROID_PACKAGE_NAME); \
- else \
- adb -s $(ADB_SERIAL) logcat -d -v time -t $(LOGCAT_LINES) --pid=$$PID $(ANDROID_PACKAGE_NAME); \
- fi
-
-# Clear logcat, launch PostIt.Android, then dump everything that was
-# emitted during the startup window. Targets the "démarrage KO" case
-# where the process starts but Avalonia never renders a frame — the
-# logcat trace from process start to first frame is what diagnoses it.
-#
-# Override LOGCAT_BOOT_WAIT to extend the post-launch wait
-# (default 15s; raise to 30+ if the device is slow to boot Avalonia).
-LOGCAT_BOOT_WAIT ?= 15
-qemu-logcat-boot:
- @echo " Clearing logcat buffer..."
- adb -s $(ADB_SERIAL) logcat -c
- @echo " Launching $(ANDROID_PACKAGE_NAME)..."
- adb -s $(ADB_SERIAL) shell am start \
- -n $(ANDROID_PACKAGE_NAME)/PostIt.Android.PostItMainActivity
- @echo " Waiting $(LOGCAT_BOOT_WAIT)s for the app to start rendering..."
- @sleep $(LOGCAT_BOOT_WAIT)
-
- @echo " Dumping logcat (PostIt PID + system buffer):"
- @PID=$$(adb -s $(ADB_SERIAL) shell pidof $(ANDROID_PACKAGE_NAME) 2>/dev/null | tr -d '\r\n'); \
- if [ -n "$$PID" ]; then \
- echo " ✅ (PID $$PID at dump time)"; \
- adb -s $(ADB_SERIAL) logcat -d -v time --pid=$$PID; \
- else \
- echo " 👿 (PostIt process not running at dump time — dumping last $(LOGCAT_LINES) lines unfiltered)"; \
- adb -s $(ADB_SERIAL) logcat -d -v time -t $(LOGCAT_LINES); \
- exit 1; \
- fi
-
-qemu: qemu-run qemu-wait-boot qemu-install
- @echo " ✓ PostIt.Android installed on $(ADB_SERIAL)"
-
-.PHONY: test release qemu qemu-run qemu-stop qemu-wait-boot qemu-build qemu-install qemu-logcat qemu-logcat-boot
+.PHONY: test release
diff --git a/src/PostIt/Directory.Packages.props b/src/PostIt/Directory.Packages.props
index 69e8a896..0d5fa50c 100644
--- a/src/PostIt/Directory.Packages.props
+++ b/src/PostIt/Directory.Packages.props
@@ -5,33 +5,35 @@
true
+ 12.1.1
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
diff --git a/src/PostIt/Makefile b/src/PostIt/Makefile
new file mode 100644
index 00000000..1217976b
--- /dev/null
+++ b/src/PostIt/Makefile
@@ -0,0 +1,178 @@
+
+# Cibles pour installer PostIt.Android en Debug sur l'AVD qemu.
+#
+# Usage typique :
+# make qemu # lance l'AVD, attend le boot, build l'APK, l'installe
+# make android-install # (re)build l'APK et l'installe (AVD doit tourner)
+# make android-build # build l'APK seul (sans install)
+# make qemu-run # démarre l'AVD en background
+# make qemu-stop # arrête l'émulateur
+# make qemu-wait-boot # attend que l'AVD ait fini de booter
+#
+# Variables surchargeables (make VAR=valeur) :
+# AVD_NAME default: postit_test_avd
+# (l'AVD doit être listé par `avdmanager list avd`)
+# ADB_SERIAL default: emulator-5554
+# (port standard du premier émulateur lancé)
+# ANDROID_HOME default: /opt/android-sdk
+# (le SDK Android local; doit contenir
+# emulator/emulator et platform-tools/adb)
+# POSTIT_RID default: android-x64
+# (doit matcher l'ABI de l'AVD; `avdmanager list avd`
+# affiche la ligne Tag/ABI)
+# EMU_HEADLESS default: 0
+# (1 = lancer l'émulateur sans fenêtre, pour scripter)
+# CONFIG surcharge la variable CONFIG globale (Debug par
+# défaut dans ce Makefile). Passer à Release pour
+# un APK optimisé et signé release.
+# LOGCAT_LINES default: 200
+# (nombre de lignes dumpées par `make qemu-logcat`)
+# LOGCAT_FOLLOW default: 0
+# (1 = stream live via `make logcat`,
+# sinon dump one-shot des N dernières lignes)
+# LOGCAT_BOOT_WAIT default: 30
+# (secondes d'attente entre le clear du buffer,
+# le `am start`, et le dump final dans
+# `make qemu-logcat-boot`)
+AVD_NAME ?= postit_test_avd
+ADB_SERIAL ?= emulator-5554
+ANDROID_HOME ?= /opt/android-sdk
+POSTIT_RID ?= android-x64
+EMU_HEADLESS ?= 0
+LOGCAT_LINES ?= 600
+LOGCAT_FOLLOW ?= 0
+LOGCAT_BOOT_WAIT ?= 30
+
+ANDROID_PACKAGE_NAME = fr.pschneider.postit
+POSTIT_ANDROID_CSPROJ := PostIt.Android/PostIt.Android.csproj
+POSTIT_APK_DIR := PostIt.Android/bin/$(CONFIG)/net10.0-android/$(POSTIT_RID)
+POSTIT_APK := $(POSTIT_APK_DIR)/$(ANDROID_PACKAGE_NAME)-Signed.apk
+
+clean: clean-PostIt clean-PostIt.Android clean-PostIt.Desktop
+
+clean-%:
+ rm -rf $*/obj $*/bin
+
+qemu-run:
+ @echo " Starting AVD $(AVD_NAME) on $(ADB_SERIAL)..."
+ @mkdir -p /tmp/yavsc-emu
+ @EMU_ARGS=""; \
+ if [ "$(EMU_HEADLESS)" = "1" ]; then EMU_ARGS="-no-window -no-audio"; fi; \
+ $(ANDROID_HOME)/emulator/emulator -avd $(AVD_NAME) $$EMU_ARGS \
+ >/tmp/yavsc-emu/$(AVD_NAME).log 2>&1 & \
+ echo " ✅ Started emulator PID: $$!"
+
+qemu-stop:
+ adb -s $(ADB_SERIAL) emu kill
+ echo " ✅ Stopped emulator"
+
+qemu-wait-boot:
+ @echo " Waiting for $(ADB_SERIAL) to finish booting..."
+ adb -s $(ADB_SERIAL) wait-for-device
+ @for i in $$(seq 1 180); do \
+ BOOTED=$$(adb -s $(ADB_SERIAL) shell getprop sys.boot_completed 2>/dev/null | tr -d '\r\n'); \
+ if [ "$$BOOTED" = "1" ]; then \
+ echo " ✓ booted in $${i}s"; \
+ exit 0; \
+ fi; \
+ sleep 1; \
+ done; \
+ echo " 👿 ERROR: device did not boot within 180s." >&2; \
+ echo " Logs: /tmp/yavsc-emu/$(AVD_NAME).log" >&2; \
+ exit 1
+
+android-build:
+ # EmbedAssembliesIntoApk=true: without this, the Debug APK ships
+ # without the managed assemblies in it (they are pushed at runtime
+ # via `adb push`, "Fast Deployment"). On the qemu emulator, the
+ # runtime cannot find them in `files/.__override__//` and
+ # aborts at startup with "No assemblies found in '.__override__'"
+ # (monodroid-glue.cc:757, SIGABRT). Forcing this property on
+ # packages the .dlls into the APK as `assemblies//` so the
+ # runtime reads them directly.
+ #
+ # The Xamarin.Android SDK property is `EmbedAssembliesIntoApk`,
+ # not `AndroidEnableFastDeployment` (which exists in older
+ # templates but is a no-op in the .NET 10 SDK).
+ dotnet build $(POSTIT_ANDROID_CSPROJ) \
+ -c $(CONFIG) \
+ -p:RuntimeIdentifier=$(POSTIT_RID) \
+ -p:EmbedAssembliesIntoApk=true \
+ --nologo
+ @if [ ! -f "$(POSTIT_APK)" ]; then \
+ echo " APK not found at $(POSTIT_APK)." >&2; \
+ echo " Files in $(POSTIT_APK_DIR):" >&2; \
+ ls -la "$(POSTIT_APK_DIR)" 2>/dev/null || echo " (directory does not exist)" >&2; \
+ exit 1; \
+ fi
+
+
+android-install: android-build
+ @echo " Installing $(POSTIT_APK) on $(ADB_SERIAL)..."
+ adb -s $(ADB_SERIAL) install -r "$(POSTIT_APK)" -r
+ @echo " ✅ PostIt.Android installed on $(ADB_SERIAL)"
+
+qemu-uninstall:
+ adb -s $(ADB_SERIAL) uninstall $(ANDROID_PACKAGE_NAME)
+
+# Dump recent logcat output for the running PostIt.Android process.
+# By default, prints the last $(LOGCAT_LINES) lines (one-shot, with
+# `-d`). Set LOGCAT_FOLLOW=1 to follow the stream live instead.
+# Filtering is by PID (pidof $(ANDROID_PACKAGE_NAME)), not by tag,
+# because Mono/Xamarin can emit logs under several tags
+# (mono, PostIt.Android, Avalonia.Android) and tag-based filtering
+# would miss the ones not matching. PID-based filtering is exact.
+# If the app is not running, pidof returns empty and logcat exits
+# silently with no output; that is the expected behaviour for
+# "no logs yet".
+logcat:
+ @PID=$$(adb -s $(ADB_SERIAL) shell pidof $(ANDROID_PACKAGE_NAME) 2>/dev/null | tr -d '\r\n'); \
+ if [ -z "$$PID" ]; then \
+ echo " $(ANDROID_PACKAGE_NAME) is not running on $(ADB_SERIAL)."; \
+ echo " Start the app first (am start -n $(ANDROID_PACKAGE_NAME)/PostIt.Android.PostItMainActivity)"; \
+ exit 1; \
+ fi; \
+ echo " Following PID $$PID (LOGCAT_FOLLOW=$(LOGCAT_FOLLOW), LOGCAT_LINES=$(LOGCAT_LINES))"; \
+ if [ "$(LOGCAT_FOLLOW)" = "1" ]; then \
+ adb -s $(ADB_SERIAL) logcat -v time --pid=$$PID $(ANDROID_PACKAGE_NAME); \
+ else \
+ adb -s $(ADB_SERIAL) logcat -d -v time -t $(LOGCAT_LINES) --pid=$$PID $(ANDROID_PACKAGE_NAME); \
+ fi
+
+# Clear logcat, launch PostIt.Android, then dump everything that was
+# emitted during the startup window. Targets the "démarrage KO" case
+# where the process starts but Avalonia never renders a frame — the
+# logcat trace from process start to first frame is what diagnoses it.
+#
+# Override LOGCAT_BOOT_WAIT to extend the post-launch wait
+# (default 15s; raise to 30+ if the device is slow to boot Avalonia).
+LOGCAT_BOOT_WAIT ?= 15
+
+
+android-start:
+ @echo " Clearing logcat buffer..."
+ adb -s $(ADB_SERIAL) logcat -c
+ @echo " Launching $(ANDROID_PACKAGE_NAME)..."
+ adb -s $(ADB_SERIAL) shell am start \
+ -n $(ANDROID_PACKAGE_NAME)/PostIt.Android.PostItMainActivity
+ @echo " ✅ $(ANDROID_PACKAGE_NAME) started on $(ADB_SERIAL)"
+
+qemu-logcat-boot: android-start
+ @echo " Waiting $(LOGCAT_BOOT_WAIT)s for the app to start rendering..."
+ @sleep $(LOGCAT_BOOT_WAIT)
+
+ @echo " Dumping logcat (PostIt PID + system buffer):"
+ @PID=$$(adb -s $(ADB_SERIAL) shell pidof $(ANDROID_PACKAGE_NAME) 2>/dev/null | tr -d '\r\n'); \
+ if [ -n "$$PID" ]; then \
+ echo " ✅ (PID $$PID at dump time)"; \
+ sleep 10; \
+ adb -s $(ADB_SERIAL) logcat -d -v time -t $(LOGCAT_LINES) --pid=$$PID; \
+ else \
+ echo " 👿 (PostIt process not running at dump time — dumping last $(LOGCAT_LINES) lines unfiltered)"; \
+ adb -s $(ADB_SERIAL) logcat -d -v time -t $(LOGCAT_LINES); \
+ exit 1; \
+ fi
+
+qemu: qemu-run qemu-wait-boot android-install
+
+.PHONY: clean qemu qemu-run qemu-stop qemu-wait-boot android-build android-install logcat qemu-logcat-boot
diff --git a/src/PostIt/PostIt.Android/MainActivity.cs b/src/PostIt/PostIt.Android/MainActivity.cs
index 62c29e10..ad8455ef 100644
--- a/src/PostIt/PostIt.Android/MainActivity.cs
+++ b/src/PostIt/PostIt.Android/MainActivity.cs
@@ -1,8 +1,11 @@
-using Android.App;
+
+using Android.App;
using Android.Content;
using Android.Content.PM;
-using Avalonia;
+using AndroidX.Core.Provider;
+using AndroidX.Emoji2.Text;
using Avalonia.Android;
+using PostIt.Droid.Services;
namespace PostIt.Android;
@@ -15,18 +18,22 @@ namespace PostIt.Android;
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
public class MainActivity : AvaloniaMainActivity
{
- ///
- /// Strongly-typed handle to the current MainActivity instance, set in
- /// and consumed by platform services such as
- /// which need to launch
- /// Chrome Custom Tabs.
+ ///
+ /// The current MainActivity instance.
///
public static MainActivity? Current { get; private set; }
protected override void OnCreate(global::Android.OS.Bundle? savedInstanceState)
{
+ FontRequest fontRequest = new FontRequest(
+ "com.google.android.gms.fonts",
+ "com.google.android.gms",
+ "Noto Color Emoji Compat",
+ Yavsc.Resource.Array.com_google_android_gms_fonts_certs); //com_google_android_gms_fonts_certs
+ EmojiCompat.Config config = new FontRequestEmojiCompatConfig(this, fontRequest);
+ EmojiCompat.Init(config);
+ PlatformBootstrap.InitPlatform();
base.OnCreate(savedInstanceState);
- PlatformBootstrap.EnsureInitialized();
Current = this;
}
///
@@ -41,7 +48,13 @@ public class MainActivity : AvaloniaMainActivity
protected override void OnNewIntent(Intent? intent)
{
base.OnNewIntent(intent);
- if (intent is not null) AndroidOidcCallbackSink.Handle(intent);
+
+ var url = intent?.DataString;
+ if (!string.IsNullOrEmpty(url) && url.StartsWith("postit://callback"))
+ {
+ OidcCallbackManager.SetResult(url);
+ }
+
}
internal static class AndroidOidcCallbackSink
diff --git a/src/PostIt/PostIt.Android/PlatformBootstrap.cs b/src/PostIt/PostIt.Android/PlatformBootstrap.cs
index d59b154f..f208f9ce 100644
--- a/src/PostIt/PostIt.Android/PlatformBootstrap.cs
+++ b/src/PostIt/PostIt.Android/PlatformBootstrap.cs
@@ -12,14 +12,9 @@ namespace PostIt.Android;
///
internal static class PlatformBootstrap
{
- private static int _initialized;
-
- internal static void EnsureInitialized()
+ internal static void InitPlatform()
{
- if (System.Threading.Interlocked.Exchange(ref _initialized, 1) != 0)
- return;
- Platform.DefaultRedirectUri = ViewModels.Settings.AndroidRedirectUri;
Platform.CreateBrowser = () =>
{
var activity = MainActivity.Current;
diff --git a/src/PostIt/PostIt.Android/PostIt.Android.csproj b/src/PostIt/PostIt.Android/PostIt.Android.csproj
index a4af1eb2..62b494f8 100644
--- a/src/PostIt/PostIt.Android/PostIt.Android.csproj
+++ b/src/PostIt/PostIt.Android/PostIt.Android.csproj
@@ -4,13 +4,11 @@
net10.0-android
23
enable
- fr.pschneider.PostIt
+ fr.pschneider.postit
1
1.0
apk
- false
- SdkOnly
- partial
+ false
@@ -23,11 +21,11 @@
-
-
-
+
+
+
diff --git a/src/PostIt/PostIt.Android/Properties/AndroidManifest.xml b/src/PostIt/PostIt.Android/Properties/AndroidManifest.xml
index 91b61d05..8793aae8 100644
--- a/src/PostIt/PostIt.Android/Properties/AndroidManifest.xml
+++ b/src/PostIt/PostIt.Android/Properties/AndroidManifest.xml
@@ -2,31 +2,5 @@
-
-
-
-
-
-
-
-
-
-
diff --git a/src/PostIt/PostIt.Android/Resources/values/font_certs.xml b/src/PostIt/PostIt.Android/Resources/values/font_certs.xml
new file mode 100644
index 00000000..f4adce1b
--- /dev/null
+++ b/src/PostIt/PostIt.Android/Resources/values/font_certs.xml
@@ -0,0 +1,13 @@
+
+
+
+ - @array/com_google_android_gms_fonts_certs_dev
+ - @array/com_google_android_gms_fonts_certs_prod
+
+
+ - MIIEqDCCA5CgAwIBAgIJAN5gc16AJfAsMA0GCSqGSIb3DQEBBQUAMIGUMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNTW91bnRhaW4gVmlldzEQMA4GA1UEChMHR29vZ2xlMRAwDgYDVQQLEwdBbmRyb2lkMRAwDgYDVQQDEwdBbmRyb2lkMSEwHwYJKoZIhvcNAQkBFhJhbmRyb2lkQGFuZHJvaWQuY29tMCAXDTA4MDQxNTIyNDA0M1YYDzQyMDgxMzA0MjI0MDQzWjCBlDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExFjAUBgNVBAcTDURvdW50YWluIFZpZXcxEDAOBgNVBAoTB0dvb2dsZTEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDEhMB8GCSqGSIb3DQEJARYSYW5kcm9pZEBhbmRyb2lkLmNvbTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALBi1vF0K1vOEHG7AxneTjOHUka46MIidBqvFcO164A49iU2DkYPhUaM4H8JCdzh6N1GzM6h9o6E2V6z8+gEtdI6nqqs0EGA0G0H701bFjLp9+K/1DkMIFeD4P8J7X1/M8t4+X09X/7bQyV3w0v7q+Qh38sY8W/7K29B3f2O2sLw+uX9U8a8Tf4Xv8A==
+
+
+ - MIIEQzCCAyugAwIBAgIJAMLgh0ZgXpYOMA0GCSqGSIb3DQEBBQUAMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAeFw0wODA4MjEyMzEzMzRaFw0zNjAxMDcyMzEzMzRaMHQxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYDVQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKKvSkUIXm+t9M8rXj2V
+
+
diff --git a/src/PostIt/PostIt.Android/Services/AndroidSystemBrowser.cs b/src/PostIt/PostIt.Android/Services/AndroidSystemBrowser.cs
index b6716e22..bb10b364 100644
--- a/src/PostIt/PostIt.Android/Services/AndroidSystemBrowser.cs
+++ b/src/PostIt/PostIt.Android/Services/AndroidSystemBrowser.cs
@@ -3,6 +3,7 @@ using System.Threading.Tasks;
using Android.App;
using AndroidX.Browser.CustomTabs;
using IdentityModel.OidcClient.Browser;
+using PostIt.Droid.Services;
namespace PostIt.Android.Services;
@@ -35,9 +36,14 @@ public sealed class AndroidSystemBrowser : IBrowser
};
}
- var uri = global::Android.Net.Uri.Parse(options.StartUrl)!;
+ // 1. Enregistrez la tâche avant de lancer le Custom Tab
+ var callbackTask = OidcCallbackManager.RegisterCallback(cancellationToken);
- var callbackTask = MainActivity.AndroidOidcCallbackSink.AwaitNextCallbackAsync();
+ // 2. LANCEZ VOTRE CUSTOM TAB ICI (via AndroidX.Browser.CustomTabs)
+ // ... code pour ouvrir l'URL d'authentification ...
+
+
+ var uri = global::Android.Net.Uri.Parse(options.StartUrl)!;
var tabsIntent = new CustomTabsIntent.Builder()
.SetShowTitle(true)!
diff --git a/src/PostIt/PostIt.Android/Services/OidcCallbackManager.cs b/src/PostIt/PostIt.Android/Services/OidcCallbackManager.cs
new file mode 100644
index 00000000..30f8fa18
--- /dev/null
+++ b/src/PostIt/PostIt.Android/Services/OidcCallbackManager.cs
@@ -0,0 +1,21 @@
+using System.Threading;
+using System.Threading.Tasks;
+
+namespace PostIt.Droid.Services;
+
+public static class OidcCallbackManager
+{
+ private static TaskCompletionSource? _tcs;
+
+ public static Task RegisterCallback(CancellationToken cancellationToken)
+ {
+ _tcs = new TaskCompletionSource();
+ cancellationToken.Register(() => _tcs.TrySetCanceled());
+ return _tcs.Task;
+ }
+
+ public static void SetResult(string url)
+ {
+ _tcs?.TrySetResult(url);
+ }
+}
diff --git a/src/PostIt/PostIt.Android/WebAuthenticationCallbackActivity.cs b/src/PostIt/PostIt.Android/WebAuthenticationCallbackActivity.cs
new file mode 100644
index 00000000..9ed2eb18
--- /dev/null
+++ b/src/PostIt/PostIt.Android/WebAuthenticationCallbackActivity.cs
@@ -0,0 +1,35 @@
+using Android.App;
+using Android.Content;
+using Android.Content.PM;
+using Android.OS;
+using PostIt.Droid.Services;
+
+namespace PostIt.Android;
+
+[Activity(NoHistory = true, LaunchMode = LaunchMode.SingleTop, Exported = true)]
+[IntentFilter(new[] { Intent.ActionView },
+ Categories = new[] { Intent.CategoryDefault, Intent.CategoryBrowsable },
+ DataScheme = "postit", // Remplacez par votre schéma personnalisé (ex: yavsc ou postit)
+ DataHost = "callback")] // Correspond à postit://callback
+public class WebAuthenticationCallbackActivity : Activity
+{
+ protected override void OnCreate(Bundle? savedInstanceState)
+ {
+ base.OnCreate(savedInstanceState);
+
+ // Capturer l'URL de redirection OIDC
+ var url = Intent?.DataString;
+
+ if (!string.IsNullOrEmpty(url))
+ {
+ // Transmettre l'URL au gestionnaire partagé pour compléter la Task
+ OidcCallbackManager.SetResult(url);
+ }
+
+ // Fermer cette activité transparente et ramener l'application au premier plan
+ var intent = new Intent(this, typeof(MainActivity));
+ intent.AddFlags(ActivityFlags.ClearTop | ActivityFlags.SingleTop);
+ StartActivity(intent);
+ Finish();
+ }
+}
diff --git a/src/PostIt/PostIt.Browser/PostIt.Browser.csproj b/src/PostIt/PostIt.Browser/PostIt.Browser.csproj
index 5202f397..2816b2f8 100644
--- a/src/PostIt/PostIt.Browser/PostIt.Browser.csproj
+++ b/src/PostIt/PostIt.Browser/PostIt.Browser.csproj
@@ -6,7 +6,7 @@
enable
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/PostIt/PostIt.Desktop/PlatformBootstrap.cs b/src/PostIt/PostIt.Desktop/PlatformBootstrap.cs
deleted file mode 100644
index ff9ca7f6..00000000
--- a/src/PostIt/PostIt.Desktop/PlatformBootstrap.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-using PostIt.Services;
-
-namespace PostIt.Desktop;
-
-///
-/// One-shot platform bootstrap. Called from Program.Main so that
-/// the shared OIDC login path sees a working IBrowser — the
-/// custom-scheme browser that hands the OIDC callback off to the
-/// running instance through the named pipe. Desktop builds do NOT use
-/// a loopback HTTP listener: the postit:// scheme is registered
-/// with the OS at install time and the browser is whatever the user
-/// has configured to open it.
-///
-internal static class PlatformBootstrap
-{
- private static int _initialized;
-
- internal static void EnsureInitialized()
- {
- if (System.Threading.Interlocked.Exchange(ref _initialized, 1) != 0)
- return;
-
- // Use the custom-scheme redirect on Desktop. Loopback is only
- // a fallback for platforms that cannot register postit://
- // (see Settings.DefaultLoopbackRedirectUri for that path).
- Platform.DefaultRedirectUri = AuthenticationSettings.DefaultDesktopRedirectUri;
- Platform.CustomScheme = "postit";
- }
-}
diff --git a/src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj b/src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj
index 4048c45e..e47c5b6d 100644
--- a/src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj
+++ b/src/PostIt/PostIt.Desktop/PostIt.Desktop.csproj
@@ -7,7 +7,7 @@
enable
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/PostIt/PostIt.Desktop/Program.cs b/src/PostIt/PostIt.Desktop/Program.cs
index f22f79b0..0de3bd69 100644
--- a/src/PostIt/PostIt.Desktop/Program.cs
+++ b/src/PostIt/PostIt.Desktop/Program.cs
@@ -12,8 +12,6 @@ sealed class Program
[STAThread]
public static void Main(string[] args)
{
- PlatformBootstrap.EnsureInitialized();
-
// Short-circuit 2nd-instance launches (OS handing us the
// postit://callback URL) BEFORE Avalonia spins up a window.
// If we let Avalonia initialise, the new MainWindow flashes
diff --git a/src/PostIt/PostIt.Tests/AddCircleMemberDialogTests.cs b/src/PostIt/PostIt.Tests/AddCircleMemberDialogTests.cs
index e2426457..8bec1dc6 100644
--- a/src/PostIt/PostIt.Tests/AddCircleMemberDialogTests.cs
+++ b/src/PostIt/PostIt.Tests/AddCircleMemberDialogTests.cs
@@ -73,7 +73,7 @@ public class AddCircleMemberDialogTests
return context;
}
///
- /// Mount a real , build a minimal
+ /// Mount a real , build a minimal
/// DI graph, push then the
/// on top of it.
/// Returns the stack size so the test can pin the delta.
@@ -98,12 +98,9 @@ public class AddCircleMemberDialogTests
services.AddTransient();
var sp = services.BuildServiceProvider();
- context.Window = new MainWindow();
+ context.Window = new MainView();
context.App = (PostIt.App)Application.Current!;
- context.App.DataTemplates.Clear();
- context.App.DataTemplates.Add(new ViewLocator(sp));
context.App.AttachMainWindow(context.Window);
- context.Window.Show();
context.page = sp.GetRequiredService();
context.Window.NavRoot.PushAsync(context.page).GetAwaiter().GetResult();
diff --git a/src/PostIt/PostIt.Tests/AndroidAppLaunchTests.cs b/src/PostIt/PostIt.Tests/AndroidAppLaunchTests.cs
index ac4756eb..d4980d26 100644
--- a/src/PostIt/PostIt.Tests/AndroidAppLaunchTests.cs
+++ b/src/PostIt/PostIt.Tests/AndroidAppLaunchTests.cs
@@ -14,7 +14,7 @@ namespace PostIt.Tests;
///
public class AndroidAppLaunchTests
{
- private const string PackageName = "fr.pschneider.PostIt";
+ private const string PackageName = "fr.pschneider.postit";
private readonly ITestOutputHelper _output;
@@ -23,7 +23,8 @@ public class AndroidAppLaunchTests
_output = output;
}
- // FIXME [Fact]
+ // https://twosixtech.com/blog/integrating-docker-and-adb/
+ // FIXME ala hosted shared resource adb server - [Fact]
public void PostIt_starts_and_draws_a_first_frame_on_the_emulator()
{
if (!IsPackageInstalledOnAnyDevice())
diff --git a/src/PostIt/PostIt.Tests/MainPageButtonsTests.cs b/src/PostIt/PostIt.Tests/MainPageButtonsTests.cs
index 3e7344a2..d1d00532 100644
--- a/src/PostIt/PostIt.Tests/MainPageButtonsTests.cs
+++ b/src/PostIt/PostIt.Tests/MainPageButtonsTests.cs
@@ -99,7 +99,7 @@ public class MainPageButtonsTests
}
///
- /// Mount a real (as
+ /// Mount a real (as
/// SessionStatusBannerTests does), push a
/// with the given VM onto
/// NavRoot. PushAsync is awaited (via
@@ -109,18 +109,12 @@ public class MainPageButtonsTests
/// realised and KeyPressQwerty has a real
/// to dispatch against.
///
- private static (MainWindow window, MainPage page) MountMainPage(MainViewModel vm)
+ private static (MainView window, MainPage page) MountMainPage(MainViewModel vm)
{
- var window = new MainWindow();
+ var window = new MainView();
var page = new MainPage { DataContext = vm };
var app = (PostIt.App)Application.Current!;
- if (vm.Services is not null)
- {
- app.DataTemplates.Clear();
- app.DataTemplates.Add(new ViewLocator(vm.Services));
- }
app.AttachMainWindow(window);
- window.Show();
window.NavRoot.PushAsync(page).GetAwaiter().GetResult();
return (window, page);
}
@@ -130,7 +124,7 @@ public class MainPageButtonsTests
/// supported headless pattern (cf. CalculatorTests in the
/// Avalonia.Samples repo). Returns the nav-stack count
/// before the click so the caller can assert on the delta.
- /// KeyPressQwerty is dispatched on the
+ /// KeyPressQwerty is dispatched on the
/// itself — it is the that owns the
/// headless implementation, and routing the key through any
/// descendant TopLevel (e.g. one obtained via
@@ -139,7 +133,7 @@ public class MainPageButtonsTests
/// because the descendant does not carry the
/// PlatformHandle the harness expects.
///
- private static int ClickAndCapture(MainWindow window, Button button)
+ private static int ClickAndCapture(MainView window, Button button)
{
var stackBefore = window.NavRoot.NavigationStack.Count;
button.Command?.Execute(button.CommandParameter);
diff --git a/src/PostIt/PostIt.Tests/PostAclDialogTests.cs b/src/PostIt/PostIt.Tests/PostAclDialogTests.cs
index 9bc28888..ccb33ec7 100644
--- a/src/PostIt/PostIt.Tests/PostAclDialogTests.cs
+++ b/src/PostIt/PostIt.Tests/PostAclDialogTests.cs
@@ -117,7 +117,7 @@ public class PostAclDialogTests
/// rebinding the global DI mid-test would trample the
/// Settings singleton the rest of the harness depends on.
///
- private static (MainWindow window, BlogAclApiClient aclClient, CircleApiClient circleClient, CountingHttpHandler handler) Mount()
+ private static (MainView window, BlogAclApiClient aclClient, CircleApiClient circleClient, CountingHttpHandler handler) Mount()
{
var handler = new CountingHttpHandler();
var settings = new Settings();
@@ -138,12 +138,9 @@ public class PostAclDialogTests
// CountingHttpHandler.
GC.KeepAlive(sp);
- var window = new MainWindow();
+ var window = new MainView();
var app = (App)Application.Current!;
- app.DataTemplates.Clear();
- app.DataTemplates.Add(new ViewLocator(sp));
app.AttachMainWindow(window);
- window.Show();
return (window, aclClient, circleClient, handler);
}
diff --git a/src/PostIt/PostIt.Tests/PostIt.Tests.csproj b/src/PostIt/PostIt.Tests/PostIt.Tests.csproj
index 433f36c3..663bdd12 100644
--- a/src/PostIt/PostIt.Tests/PostIt.Tests.csproj
+++ b/src/PostIt/PostIt.Tests/PostIt.Tests.csproj
@@ -8,7 +8,7 @@
true
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs b/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs
index e1a5dd19..4d49b865 100644
--- a/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs
+++ b/src/PostIt/PostIt.Tests/SessionStatusBannerTests.cs
@@ -9,7 +9,7 @@ namespace PostIt.Tests;
///
/// UI tests for . Mounted inside
-/// a real via the headless Avalonia
+/// a real via the headless Avalonia
/// platform declared in TestApp.cs.
///
/// The pattern is the one that UnitTest1.MainPage_Should_Load
@@ -34,11 +34,10 @@ public class SessionStatusBannerTests
[AvaloniaFact]
public void Banner_renders_three_buttons_in_the_visual_tree()
{
- var window = new MainWindow();
- window.SessionBanner.DataContext = new SessionStatusViewModel();
+ MainWindow window = new MainWindow();
window.Show();
- var buttons = window.SessionBanner.GetVisualDescendants()
+ var buttons = window.GetVisualDescendants()
.OfType
public IServiceProvider? ServiceProvider { get; private set; }
- public MainWindow? Window { get; private set; }
+ public MainView? View { get; private set; }
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
-#if DEBUG
- this.AttachDeveloperTools();
-#endif
}
public override void OnFrameworkInitializationCompleted()
@@ -47,7 +43,13 @@ public partial class App : Application
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
- desktop.MainWindow = CreateMainWindow();
+ var window = ServiceProvider.GetRequiredService();
+ desktop.MainWindow = window;
+ var api = ServiceProvider!.GetRequiredService();
+ desktop.MainWindow.Opened += async (_, _) => await BootAsync(this.ServiceProvider!, api);
+ View = window.MainView;
+ this.ConfigureRootView(window.MainView);
+
ApplyDarkMode(settings);
}
else if (ApplicationLifetime is IActivityApplicationLifetime singleViewFactoryApplicationLifetime)
@@ -55,53 +57,53 @@ public partial class App : Application
singleViewFactoryApplicationLifetime.MainViewFactory =
() =>
{
- Window = CreateMainWindow();
+ View = ServiceProvider.GetRequiredService();
+ this.ConfigureRootView(View);
ApplyDarkMode(settings);
- return Window;
+ return View;
};
}
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
{
- singleViewPlatform.MainView = CreateMainWindow();
+ singleViewPlatform.MainView = View = ServiceProvider.GetRequiredService();
+ ConfigureRootView(View);
ApplyDarkMode(settings);
}
+
base.OnFrameworkInitializationCompleted();
}
+private void ConfigureRootView(MainView rootView)
+{
+ var api = ServiceProvider!.GetRequiredService();
+ // Déclencher le Boot lors du chargement du contrôle à l'écran
+ rootView.AttachedToVisualTree += async (_, _) => await BootAsync(this.ServiceProvider!, api);
- private MainWindow CreateMainWindow()
+ var sessionStatus = ServiceProvider!.GetRequiredService();
+ sessionStatus.LogoutCompleted += () =>
{
- Window = new MainWindow();
- var api = ServiceProvider!.GetRequiredService();
- Window.Opened += async (_, _) => await BootAsync(this.ServiceProvider!, api);
- var sessionStatus = ServiceProvider!.GetRequiredService();
- sessionStatus.LogoutCompleted += () =>
- {
- Window.NavRoot.PopToRootAsync();
- };
+ // Remplacer Window.NavRoot par rootView.NavRoot
+ rootView.NavRoot.PopToRootAsync();
+ };
- sessionStatus.LoginSucceeded += () =>
- {
- PushMainPageAsync().Wait();
- };
+ sessionStatus.LoginSucceeded += async () =>
+ {
+ await PushMainPageAsync();
+ };
- var homeVm = ServiceProvider!.GetRequiredService();
-
- this.PushPageAsync(homeVm).Wait();
- Window.SessionBanner.DataContext = sessionStatus;
- return Window;
- }
+ rootView.SessionBanner.DataContext = sessionStatus;
+}
///
- /// Test-only hook: bind a concrete so
+ /// Test-only hook: bind a concrete so
/// command-driven navigation paths () can
/// push onto a real in headless
/// fixtures that do not run the full desktop lifetime bootstrap.
///
- internal void AttachMainWindow(MainWindow mainWindow)
+ internal void AttachMainWindow(MainView mainView)
{
- Window = mainWindow ?? throw new ArgumentNullException(nameof(mainWindow));
+ View = mainView ?? throw new ArgumentNullException(nameof(mainView));
}
private static void ApplyDarkMode(Settings settings)
@@ -125,6 +127,9 @@ public partial class App : Application
var refreshed = await api.TrySilentLoginAsync().ConfigureAwait(true);
var sessionStatus = provider.GetRequiredService();
sessionStatus.Refresh();
+ var homePage = provider.GetRequiredService();
+ var app = (App)Current!;
+ await app.PushPageAsync(homePage);
if (!refreshed) return;
await PushMainPageAsync().ConfigureAwait(true);
@@ -179,6 +184,6 @@ public partial class App : Application
internal async Task GoBackAsync()
{
- await Window!.NavRoot.PopAsync();
+ await View!.NavRoot.PopAsync();
}
}
diff --git a/src/PostIt/PostIt/Helpers/ServiceCollectionHelpers.cs b/src/PostIt/PostIt/Helpers/ServiceCollectionHelpers.cs
index 9e0382de..c4e774cc 100644
--- a/src/PostIt/PostIt/Helpers/ServiceCollectionHelpers.cs
+++ b/src/PostIt/PostIt/Helpers/ServiceCollectionHelpers.cs
@@ -23,11 +23,13 @@ public static class ServiceCollectionHelpers
var circleClient = new CircleApiClient(api, settings.BlogsApiUrl);
var blogAclClient = new BlogAclApiClient(api, settings.BlogsApiUrl);
var userSearchClient = new UserSearchClient(api, settings.BlogsApiUrl);
- var contactService = new ContactService();
var userDirectory = new UserDirectory(userSearchClient);
// Vues
- services.AddTransient();
+ services.AddSingleton();
+ services.AddSingleton();
+ services.AddSingleton();
+
// SettingsPage is a singleton: there must be one and only one
// instance of the settings UI for the lifetime of the app.
// This guarantees that (a) the bindings always reflect the
@@ -58,7 +60,6 @@ public static class ServiceCollectionHelpers
services.AddSingleton(circleClient);
services.AddSingleton(blogAclClient);
services.AddSingleton(userSearchClient);
- services.AddSingleton(contactService);
services.AddSingleton(userDirectory);
services.AddTransient();
services.AddTransient();
@@ -74,4 +75,4 @@ public static class ServiceCollectionHelpers
return services.BuildServiceProvider();
}
-}
\ No newline at end of file
+}
diff --git a/src/PostIt/PostIt/Helpers/ViewModelBaseHelpers.cs b/src/PostIt/PostIt/Helpers/ViewModelBaseHelpers.cs
index 7fc81b3a..e4250cbb 100644
--- a/src/PostIt/PostIt/Helpers/ViewModelBaseHelpers.cs
+++ b/src/PostIt/PostIt/Helpers/ViewModelBaseHelpers.cs
@@ -10,7 +10,8 @@ public static class ViewModelBaseHelpers
{
public static async Task PushPageAsync(this App app, ViewModelBase vm)
{
- if (app.Window is null)
+ var window = app.View;
+ if (window is null)
{
throw new InvalidOperationException("MainWindow is not initialized yet.");
}
@@ -39,12 +40,12 @@ public static class ViewModelBaseHelpers
page.DataContext = vm;
// Avoid stacking the same singleton page twice (e.g. SettingsPage).
- var stack = app.Window.NavRoot.NavigationStack;
+ var stack = window.NavRoot.NavigationStack;
if (stack.Count > 0 && ReferenceEquals(stack[stack.Count - 1], page))
{
return;
}
- await app.Window.NavRoot.PushAsync(page);
+ await window.NavRoot.PushAsync(page);
}
-}
\ No newline at end of file
+}
diff --git a/src/PostIt/PostIt/PostIt.csproj b/src/PostIt/PostIt/PostIt.csproj
index 70bd72ca..bde8fd41 100644
--- a/src/PostIt/PostIt/PostIt.csproj
+++ b/src/PostIt/PostIt/PostIt.csproj
@@ -28,7 +28,6 @@
All
-
diff --git a/src/PostIt/PostIt/Services/ContactService.Desktop.cs b/src/PostIt/PostIt/Services/ContactService.Desktop.cs
deleted file mode 100644
index fa7d37f6..00000000
--- a/src/PostIt/PostIt/Services/ContactService.Desktop.cs
+++ /dev/null
@@ -1,36 +0,0 @@
-#if !ANDROID && !IOS
-using System;
-using System.Collections.Generic;
-using System.Threading;
-using System.Threading.Tasks;
-
-namespace PostIt.Services;
-
-///
-/// Desktop stub for .
-///
-/// The desktop has no equivalent of the mobile address
-/// book (no Contacts.Default, no CardDAV out of the
-/// box). Rather than synthesise a list from a different
-/// source, this provider returns an empty list and lets the
-/// UI render an honest "no local contacts on this platform"
-/// message.
-///
-/// If desktop users want to invite people who aren't
-/// Yavsc members, that flow goes through a separate path
-/// (manual email entry + invitation endpoint) — not through
-/// . Finding existing Yavsc
-/// members is 's job, not this
-/// one's.
-///
-/// Future CardDAV / Google Contacts / Exchange
-/// providers can plug in here as additional
-/// implementations selected
-/// from DI by configuration.
-///
-public sealed class ContactService : IContactService
-{
- public Task> GetDeviceContactsAsync(CancellationToken ct = default)
- => Task.FromResult>(Array.Empty());
-}
-#endif
diff --git a/src/PostIt/PostIt/Services/Platform.cs b/src/PostIt/PostIt/Services/Platform.cs
index c867c63c..8e5f7e25 100644
--- a/src/PostIt/PostIt/Services/Platform.cs
+++ b/src/PostIt/PostIt/Services/Platform.cs
@@ -21,14 +21,14 @@ public static class Platform
/// override this property at startup (e.g. PostIt.Android sets
/// it to android://postit-signin).
///
- public static string DefaultRedirectUri { get; set; } = "postit://callback";
+ public const string RedirectUri = "postit://callback";
///
/// Scheme prefix the matches
/// against BrowserOptions.EndUrl. Overridable for apps
/// that want to register their own scheme.
///
- public static string CustomScheme { get; set; } = "postit";
+ public const string CustomScheme = "postit";
///
/// Constructs a fresh for the running platform.
@@ -37,4 +37,4 @@ public static class Platform
///
public static System.Func? CreateBrowser { get; set; } =
() => new CustomSchemeBrowser(CustomScheme);
-}
\ No newline at end of file
+}
diff --git a/src/PostIt/PostIt/Settings/AuthenticationSettings.cs b/src/PostIt/PostIt/Settings/AuthenticationSettings.cs
index 99358cfb..9ebeaebd 100644
--- a/src/PostIt/PostIt/Settings/AuthenticationSettings.cs
+++ b/src/PostIt/PostIt/Settings/AuthenticationSettings.cs
@@ -10,7 +10,7 @@ public partial class AuthenticationSettings : ObservableObject
/// hand-off in
/// (RFC 8252 §7.1). Production Desktop builds use this.
///
- public const string DefaultDesktopRedirectUri = "postit://callback";
+ public const string DesktopRedirectUri = "postit://callback";
///
/// Redirect URI used by the Android app. The corresponding IntentFilter
@@ -34,15 +34,19 @@ public partial class AuthenticationSettings : ObservableObject
[ObservableProperty]
public partial string[] Scopes { get; set; }
-
///
- /// OAuth redirect URI. Defaults to
+ /// OAuth redirect URI. Defaults to
/// (custom URI scheme) which is the right answer for desktop
/// production builds. Mobile platforms must set this to
/// before calling LoginAsync.
///
[ObservableProperty]
- public partial string RedirectUri { get; set; } = DefaultDesktopRedirectUri;
+ public partial string RedirectUri { get; set; }
+#if ANDROID
+ = AndroidRedirectUri;
+#else
+ = DesktopRedirectUri;
+#endif
///
/// Space-separated view of . Exists for the
diff --git a/src/PostIt/PostIt/ViewLocator.cs b/src/PostIt/PostIt/ViewLocator.cs
index 03ab98a1..3543a9c9 100644
--- a/src/PostIt/PostIt/ViewLocator.cs
+++ b/src/PostIt/PostIt/ViewLocator.cs
@@ -16,12 +16,6 @@ namespace PostIt;
Url = "https://docs.avaloniaui.net/docs/concepts/view-locator")]
public class ViewLocator : IDataTemplate
{
- private readonly IServiceProvider _services;
-
- public ViewLocator(IServiceProvider services)
- {
- _services = services;
- }
public Control Build(object? data)
{
@@ -38,15 +32,17 @@ public class ViewLocator : IDataTemplate
private Control BuildCore(object? data)
{
+ var app = App.Current as App;
+ var services = app!.ServiceProvider!;
return data switch
{
- MainViewModel => _services.GetRequiredService(),
- Settings => _services.GetRequiredService(),
- HomePageViewModel => _services.GetRequiredService(),
- SignaturePageViewModel => _services.GetRequiredService(),
- AddCircleMemberDialogViewModel => _services.GetRequiredService(),
- CirclesPageViewModel => _services.GetRequiredService(),
- PostAclDialogViewModel => _services.GetRequiredService(),
+ MainViewModel => services.GetRequiredService(),
+ Settings => services.GetRequiredService(),
+ HomePageViewModel => services.GetRequiredService(),
+ SignaturePageViewModel => services.GetRequiredService(),
+ AddCircleMemberDialogViewModel => services.GetRequiredService(),
+ CirclesPageViewModel => services.GetRequiredService(),
+ PostAclDialogViewModel => services.GetRequiredService(),
null => new TextBlock { Text = "No view for " },
_ => new TextBlock { Text = $"No view for {data.GetType().Name}" }
};
diff --git a/src/PostIt/PostIt/ViewModels/Settings.cs b/src/PostIt/PostIt/ViewModels/Settings.cs
index 2115a0cd..fd87d772 100644
--- a/src/PostIt/PostIt/ViewModels/Settings.cs
+++ b/src/PostIt/PostIt/ViewModels/Settings.cs
@@ -2,13 +2,11 @@ using System.Runtime.CompilerServices;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using IdentityModel.OidcClient;
-using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net.Http;
using System.Text.Json;
-using System.Threading;
[assembly: InternalsVisibleTo("PostIt.Tests")]
@@ -18,37 +16,6 @@ public partial class Settings : ViewModelBase
{
const string SettingsFileName = "postit-settings.json";
- ///
- /// Redirect URI used by the Android app. The corresponding IntentFilter
- /// in PostIt.Android/Properties/AndroidManifest.xml must match.
- ///
- public const string AndroidRedirectUri = "android://postit-signin";
-
-
-
- ///
- /// Process-wide canonical instance, wired up
- /// at application boot by
- /// through . The hybrid pattern:
- ///
- /// - The static Current reference gives
- /// ViewModels a non-DI way to reach the same instance (and lets
- /// the framework bindings push notifications through one stable
- /// ).
- /// - Tests that want to exercise a clean
- /// instance still call new Settings(); Current
- /// stays null in those contexts because
- /// is never invoked.
- /// - Reads () are
- /// thread-safe and never allocate; mutations always go through
- /// the DI-resolved singleton so two threads cannot each register
- /// a different "current" Settings.
- ///
- ///
- private static Settings? s_current;
-
-
-
[ObservableProperty]
public partial AuthenticationSettings Authentication { get; set; } = new();
@@ -66,7 +33,7 @@ public partial class Settings : ViewModelBase
/// setters above all funnel through here, and we flip
/// in lock-step. Sub-property mutations
/// (e.g. Authentication.Authority) are caught by the
- /// subscription wired up in
+ /// subscription wired up in
/// below. disables the flag during bulk
/// hydration so the disk load itself does not count as a user
/// edit.
@@ -336,7 +303,7 @@ public partial class Settings : ViewModelBase
this.Authentication.ClientId = string.IsNullOrWhiteSpace(settings.Authentication.ClientId) ?
AuthenticationSettings.DefaultClientId : settings.Authentication.ClientId;
this.Authentication.RedirectUri = string.IsNullOrWhiteSpace(settings.Authentication.RedirectUri) ?
- AuthenticationSettings.DefaultDesktopRedirectUri : settings.Authentication.RedirectUri;
+ AuthenticationSettings.DesktopRedirectUri : settings.Authentication.RedirectUri;
if (settings.Authentication.Scopes is null || settings.Authentication.Scopes.Length == 0)
{
settings.Authentication.Scopes = AuthenticationSettings.DefaultScopes;
@@ -377,7 +344,7 @@ public partial class Settings : ViewModelBase
{
Authority = AuthenticationSettings.DefaultAuthority,
ClientId = AuthenticationSettings.DefaultClientId,
- RedirectUri = AuthenticationSettings.DefaultDesktopRedirectUri,
+ RedirectUri = AuthenticationSettings.DesktopRedirectUri,
Scopes = AuthenticationSettings.DefaultScopes
};
this.DarkMode = false;
diff --git a/src/PostIt/PostIt/Views/MainPage.axaml b/src/PostIt/PostIt/Views/MainPage.axaml
index 7f1f1196..e44f9f99 100644
--- a/src/PostIt/PostIt/Views/MainPage.axaml
+++ b/src/PostIt/PostIt/Views/MainPage.axaml
@@ -97,16 +97,15 @@
-
+
+
+
+
diff --git a/src/PostIt/PostIt/Views/MainView.axaml b/src/PostIt/PostIt/Views/MainView.axaml
new file mode 100644
index 00000000..643c0f20
--- /dev/null
+++ b/src/PostIt/PostIt/Views/MainView.axaml
@@ -0,0 +1,22 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/PostIt/PostIt/Views/MainView.axaml.cs b/src/PostIt/PostIt/Views/MainView.axaml.cs
new file mode 100644
index 00000000..74f46686
--- /dev/null
+++ b/src/PostIt/PostIt/Views/MainView.axaml.cs
@@ -0,0 +1,11 @@
+using Avalonia.Controls;
+
+namespace PostIt.Views;
+
+public partial class MainView : UserControl
+{
+ public MainView()
+ {
+ InitializeComponent();
+ }
+}
diff --git a/src/PostIt/PostIt/Views/MainWindow.axaml b/src/PostIt/PostIt/Views/MainWindow.axaml
index 060e0944..e606cf2b 100644
--- a/src/PostIt/PostIt/Views/MainWindow.axaml
+++ b/src/PostIt/PostIt/Views/MainWindow.axaml
@@ -7,11 +7,6 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="PostIt.Views.MainWindow"
Icon="/Assets/avalonia-logo.ico"
- Title="PostIt" >
-
-
-
-
-
+ Title="PostIt">
+
diff --git a/src/PostIt/PostIt/Views/MainWindow.axaml.cs b/src/PostIt/PostIt/Views/MainWindow.axaml.cs
index 9cb85f55..0dd9280a 100644
--- a/src/PostIt/PostIt/Views/MainWindow.axaml.cs
+++ b/src/PostIt/PostIt/Views/MainWindow.axaml.cs
@@ -8,4 +8,4 @@ public partial class MainWindow : Window
{
InitializeComponent();
}
-}
\ No newline at end of file
+}
diff --git a/src/PostIt/PostIt/Views/TextEditorBinding.cs b/src/PostIt/PostIt/Views/TextEditorBinding.cs
deleted file mode 100644
index 56fda68c..00000000
--- a/src/PostIt/PostIt/Views/TextEditorBinding.cs
+++ /dev/null
@@ -1,51 +0,0 @@
-using Avalonia;
-using Avalonia.Data;
-using AvaloniaEdit;
-
-namespace PostIt.Views;
-
-public sealed class TextEditorBinding
-{
- public static readonly AttachedProperty TextProperty =
- AvaloniaProperty.RegisterAttached(
- "Text",
- defaultBindingMode: BindingMode.TwoWay);
-
- private static readonly AttachedProperty IsTextChangeSubscribedProperty =
- AvaloniaProperty.RegisterAttached("IsTextChangeSubscribed");
-
- static TextEditorBinding()
- {
- TextProperty.Changed.AddClassHandler((editor, args) =>
- {
- EnsureTextChangeSubscribed(editor);
-
- var text = args.GetNewValue() ?? string.Empty;
- if (editor.Text != text)
- {
- editor.Text = text;
- }
- });
- }
-
- public static string? GetText(TextEditor editor) => editor.GetValue(TextProperty);
-
- public static void SetText(TextEditor editor, string? value) => editor.SetValue(TextProperty, value);
-
- private static void EnsureTextChangeSubscribed(TextEditor editor)
- {
- if (editor.GetValue(IsTextChangeSubscribedProperty))
- {
- return;
- }
-
- editor.SetValue(IsTextChangeSubscribedProperty, true);
- editor.TextChanged += (_, _) =>
- {
- if (editor.Text != GetText(editor))
- {
- SetText(editor, editor.Text);
- }
- };
- }
-}
diff --git a/src/Yavsc.Abstract/Yavsc.Abstract.csproj b/src/Yavsc.Abstract/Yavsc.Abstract.csproj
index f76e42fd..ebbb2d1e 100644
--- a/src/Yavsc.Abstract/Yavsc.Abstract.csproj
+++ b/src/Yavsc.Abstract/Yavsc.Abstract.csproj
@@ -11,7 +11,7 @@
latest
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/Yavsc.Api.Client/Yavsc.Api.Client.csproj b/src/Yavsc.Api.Client/Yavsc.Api.Client.csproj
index 00e6e2db..047223a6 100644
--- a/src/Yavsc.Api.Client/Yavsc.Api.Client.csproj
+++ b/src/Yavsc.Api.Client/Yavsc.Api.Client.csproj
@@ -17,7 +17,7 @@
true
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/Yavsc.Api/Yavsc.Api.csproj b/src/Yavsc.Api/Yavsc.Api.csproj
index d9a814f6..2ddeb72d 100644
--- a/src/Yavsc.Api/Yavsc.Api.csproj
+++ b/src/Yavsc.Api/Yavsc.Api.csproj
@@ -7,7 +7,7 @@
true
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/Yavsc.Blogs.Tests/Yavsc.Blogs.Tests.csproj b/src/Yavsc.Blogs.Tests/Yavsc.Blogs.Tests.csproj
index 83c0dc37..34536806 100644
--- a/src/Yavsc.Blogs.Tests/Yavsc.Blogs.Tests.csproj
+++ b/src/Yavsc.Blogs.Tests/Yavsc.Blogs.Tests.csproj
@@ -9,7 +9,7 @@
true
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/Yavsc.Blogs/Yavsc.Blogs.csproj b/src/Yavsc.Blogs/Yavsc.Blogs.csproj
index 63b3d977..019fb102 100644
--- a/src/Yavsc.Blogs/Yavsc.Blogs.csproj
+++ b/src/Yavsc.Blogs/Yavsc.Blogs.csproj
@@ -8,7 +8,7 @@
true
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/Yavsc.Org.Tests/Yavsc.Org.Tests.csproj b/src/Yavsc.Org.Tests/Yavsc.Org.Tests.csproj
index d332d250..34de5bd8 100644
--- a/src/Yavsc.Org.Tests/Yavsc.Org.Tests.csproj
+++ b/src/Yavsc.Org.Tests/Yavsc.Org.Tests.csproj
@@ -11,7 +11,7 @@
$(MSBuildProjectDirectory)\test.runsettings
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/Yavsc.Org/Yavsc.Org.csproj b/src/Yavsc.Org/Yavsc.Org.csproj
index 0403c7eb..aeb94a8e 100644
--- a/src/Yavsc.Org/Yavsc.Org.csproj
+++ b/src/Yavsc.Org/Yavsc.Org.csproj
@@ -9,7 +9,7 @@
https://github.com/pazof/yavsc
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/Yavsc.Server/Yavsc.Server.csproj b/src/Yavsc.Server/Yavsc.Server.csproj
index ac9380a4..7adb3a78 100644
--- a/src/Yavsc.Server/Yavsc.Server.csproj
+++ b/src/Yavsc.Server/Yavsc.Server.csproj
@@ -9,7 +9,7 @@
true
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj b/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj
index 6ccd44c0..7f2f382a 100644
--- a/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj
+++ b/src/Yavsc.Tests.Shared/Yavsc.Tests.Shared.csproj
@@ -14,7 +14,7 @@
-->
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
diff --git a/src/cli/cli.csproj b/src/cli/cli.csproj
index 010c4eaf..237ccdd8 100644
--- a/src/cli/cli.csproj
+++ b/src/cli/cli.csproj
@@ -7,7 +7,7 @@
true
1.1.0.0
1.1.0.0
- 1.1.0-beta.1+1.Branch.release-1.0.8-rc1.Sha.1167169aa89e1bf25290e9a152d27b357a500ab3
+ 1.1.0-beta.1+49.Branch.release-1.0.8-rc3.Sha.5274d7bdf5d14406748a2063b5ae15191aac4359
1.1.0-beta.1
@@ -25,4 +25,4 @@
-
+
\ No newline at end of file