Compare commits
2
Commits
256fba3610
...
6d082b2ad8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d082b2ad8 | ||
|
|
81cd719327 |
@@ -134,7 +134,7 @@ jobs:
|
|||||||
echo "code=$code" >> $GITHUB_OUTPUT
|
echo "code=$code" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
if [ -n "${ANDROID_KEYSTORE_BASE64:-}" ]; then
|
if [ -n "${ANDROID_KEYSTORE_BASE64:-}" ]; then
|
||||||
printf '%s' "$ANDROID_KEYSTORE_BASE64" | base64 -d > /tmp/thoughtsync-release.jks
|
printf '%s' "$ANDROID_KEYSTORE_BASE64" | base64 -d > /tmp/inkwell-release.jks
|
||||||
echo "variant=Release" >> $GITHUB_OUTPUT
|
echo "variant=Release" >> $GITHUB_OUTPUT
|
||||||
echo "label=release" >> $GITHUB_OUTPUT
|
echo "label=release" >> $GITHUB_OUTPUT
|
||||||
# DEBUG profile, in a release APK, deliberately — see the note above
|
# DEBUG profile, in a release APK, deliberately — see the note above
|
||||||
@@ -143,7 +143,7 @@ jobs:
|
|||||||
# outright (run 4077). Unpicking that is worth doing and is not worth
|
# outright (run 4077). Unpicking that is worth doing and is not worth
|
||||||
# blocking signed builds on.
|
# blocking signed builds on.
|
||||||
echo "profile=debug" >> $GITHUB_OUTPUT
|
echo "profile=debug" >> $GITHUB_OUTPUT
|
||||||
echo "keystore=/tmp/thoughtsync-release.jks" >> $GITHUB_OUTPUT
|
echo "keystore=/tmp/inkwell-release.jks" >> $GITHUB_OUTPUT
|
||||||
echo "apk=android/app/build/outputs/apk/release/app-release.apk" >> $GITHUB_OUTPUT
|
echo "apk=android/app/build/outputs/apk/release/app-release.apk" >> $GITHUB_OUTPUT
|
||||||
echo "Signed release build — $version (versionCode $code)"
|
echo "Signed release build — $version (versionCode $code)"
|
||||||
else
|
else
|
||||||
@@ -167,7 +167,7 @@ jobs:
|
|||||||
# from the built .so. Run as its own step so a Rust failure is legible as a
|
# from the built .so. Run as its own step so a Rust failure is legible as a
|
||||||
# Rust failure instead of arriving inside a Gradle stack trace.
|
# Rust failure instead of arriving inside a Gradle stack trace.
|
||||||
- name: Build the native library and bindings
|
- name: Build the native library and bindings
|
||||||
run: ./gradlew generateUniffiBindings -PTHOUGHTSYNC_CARGO_PROFILE=${{ steps.build.outputs.profile }}
|
run: ./gradlew generateUniffiBindings -PINKWELL_CARGO_PROFILE=${{ steps.build.outputs.profile }}
|
||||||
|
|
||||||
# The image's PINNED CLIs, not Gradle plugins. ci-rust-android carries both
|
# The image's PINNED CLIs, not Gradle plugins. ci-rust-android carries both
|
||||||
# (M12 step 3) precisely so this lane needs no second image, and going
|
# (M12 step 3) precisely so this lane needs no second image, and going
|
||||||
@@ -193,7 +193,7 @@ jobs:
|
|||||||
# not exist (run 4082). It costs one extra Kotlin compile and buys the
|
# not exist (run 4082). It costs one extra Kotlin compile and buys the
|
||||||
# type-check on the debug variant, which is the one an emulator build
|
# type-check on the debug variant, which is the one an emulator build
|
||||||
# would use.
|
# would use.
|
||||||
run: ./gradlew testDebugUnitTest -PTHOUGHTSYNC_CARGO_PROFILE=${{ steps.build.outputs.profile }}
|
run: ./gradlew testDebugUnitTest -PINKWELL_CARGO_PROFILE=${{ steps.build.outputs.profile }}
|
||||||
|
|
||||||
- name: Assemble the APK
|
- name: Assemble the APK
|
||||||
env:
|
env:
|
||||||
@@ -203,9 +203,9 @@ jobs:
|
|||||||
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
|
||||||
run: |
|
run: |
|
||||||
./gradlew assemble${{ steps.build.outputs.variant }} \
|
./gradlew assemble${{ steps.build.outputs.variant }} \
|
||||||
-PTHOUGHTSYNC_CARGO_PROFILE=${{ steps.build.outputs.profile }} \
|
-PINKWELL_CARGO_PROFILE=${{ steps.build.outputs.profile }} \
|
||||||
-PTHOUGHTSYNC_VERSION_NAME=${{ steps.build.outputs.name }} \
|
-PINKWELL_VERSION_NAME=${{ steps.build.outputs.name }} \
|
||||||
-PTHOUGHTSYNC_VERSION_CODE=${{ steps.build.outputs.code }}
|
-PINKWELL_VERSION_CODE=${{ steps.build.outputs.code }}
|
||||||
|
|
||||||
# Prints the certificate the APK was actually signed with, so the operator
|
# Prints the certificate the APK was actually signed with, so the operator
|
||||||
# can compare it against the fingerprint recorded when the key was
|
# can compare it against the fingerprint recorded when the key was
|
||||||
@@ -226,10 +226,10 @@ jobs:
|
|||||||
if: steps.build.outputs.keystore != ''
|
if: steps.build.outputs.keystore != ''
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist
|
mkdir -p dist
|
||||||
cp "app/build/outputs/apk/release/app-release.apk" dist/thoughtsync.apk
|
cp "app/build/outputs/apk/release/app-release.apk" dist/inkwell.apk
|
||||||
size="$(wc -c < dist/thoughtsync.apk | tr -d ' ')"
|
size="$(wc -c < dist/inkwell.apk | tr -d ' ')"
|
||||||
sha="$(sha256sum dist/thoughtsync.apk | cut -d' ' -f1)"
|
sha="$(sha256sum dist/inkwell.apk | cut -d' ' -f1)"
|
||||||
cat > dist/thoughtsync-android.json <<JSON
|
cat > dist/inkwell-android.json <<JSON
|
||||||
{
|
{
|
||||||
"version_name": "${{ steps.build.outputs.name }}",
|
"version_name": "${{ steps.build.outputs.name }}",
|
||||||
"version_code": ${{ steps.build.outputs.code }},
|
"version_code": ${{ steps.build.outputs.code }},
|
||||||
@@ -237,7 +237,7 @@ jobs:
|
|||||||
"sha256": "$sha"
|
"sha256": "$sha"
|
||||||
}
|
}
|
||||||
JSON
|
JSON
|
||||||
cat dist/thoughtsync-android.json
|
cat dist/inkwell-android.json
|
||||||
|
|
||||||
# The rolling channel for this branch, the same fixed-tag releases the desktop
|
# The rolling channel for this branch, the same fixed-tag releases the desktop
|
||||||
# bundles use. CI artifacts are per-run and auth-gated, so they are no use as a
|
# bundles use. CI artifacts are per-run and auth-gated, so they are no use as a
|
||||||
@@ -276,7 +276,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
# The APK's variant, NOT the Cargo profile — those are the same word
|
# The APK's variant, NOT the Cargo profile — those are the same word
|
||||||
# for different things and the profile is pinned to debug (#2810).
|
# for different things and the profile is pinned to debug (#2810).
|
||||||
name: thoughtsync-android-${{ steps.build.outputs.label }}-${{ github.sha }}
|
name: inkwell-android-${{ steps.build.outputs.label }}-${{ github.sha }}
|
||||||
path: ${{ steps.build.outputs.apk }}
|
path: ${{ steps.build.outputs.apk }}
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -209,5 +209,5 @@ android/local.properties
|
|||||||
# The Android client CI bakes into the server image. Fetched fresh on every image
|
# The Android client CI bakes into the server image. Fetched fresh on every image
|
||||||
# build, so it is never worth 55 MiB of git history. client/.keep IS tracked, so
|
# build, so it is never worth 55 MiB of git history. client/.keep IS tracked, so
|
||||||
# the Dockerfile's COPY always has a directory to copy.
|
# the Dockerfile's COPY always has a directory to copy.
|
||||||
client/thoughtsync.apk
|
client/inkwell.apk
|
||||||
client/thoughtsync-android.json
|
client/inkwell-android.json
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# ThoughtSync
|
# Inkwell
|
||||||
|
|
||||||
Self-hosted personal thought-capture web app in the **FabledSword** family — a
|
Self-hosted personal thought-capture web app in the **FabledSword** family — a
|
||||||
Google-Keep-style **masonry post-it board** for capturing disparate thoughts in
|
Google-Keep-style **masonry post-it board** for capturing disparate thoughts in
|
||||||
@@ -23,7 +23,7 @@ docker-compose.yml local app + Postgres stack
|
|||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
Backend (needs a Postgres reachable at `THOUGHTSYNC_DATABASE_URL`):
|
Backend (needs a Postgres reachable at `INKWELL_DATABASE_URL`):
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
pip install -e ".[dev]"
|
pip install -e ".[dev]"
|
||||||
@@ -64,40 +64,40 @@ services:
|
|||||||
image: postgres:16-alpine
|
image: postgres:16-alpine
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
POSTGRES_USER: thoughtsync
|
POSTGRES_USER: inkwell
|
||||||
POSTGRES_PASSWORD: CHANGE_ME # change this
|
POSTGRES_PASSWORD: CHANGE_ME # change this
|
||||||
POSTGRES_DB: thoughtsync
|
POSTGRES_DB: inkwell
|
||||||
volumes:
|
volumes:
|
||||||
- thoughtsync-db:/var/lib/postgresql/data
|
- inkwell-db:/var/lib/postgresql/data
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "pg_isready -U thoughtsync"]
|
test: ["CMD-SHELL", "pg_isready -U inkwell"]
|
||||||
interval: 5s
|
interval: 5s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 10
|
retries: 10
|
||||||
|
|
||||||
app:
|
app:
|
||||||
image: git.fabledsword.com/bvandeusen/thoughtsync:latest # :dev for the current dev build
|
image: git.fabledsword.com/bvandeusen/inkwell:latest # :dev for the current dev build
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
depends_on:
|
depends_on:
|
||||||
db:
|
db:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
environment:
|
environment:
|
||||||
THOUGHTSYNC_DATABASE_URL: postgresql+asyncpg://thoughtsync:CHANGE_ME@db:5432/thoughtsync
|
INKWELL_DATABASE_URL: postgresql+asyncpg://inkwell:CHANGE_ME@db:5432/inkwell
|
||||||
volumes:
|
volumes:
|
||||||
- thoughtsync-data:/var/thoughtsync # uploaded images; omit if you don't use attachments
|
- inkwell-data:/var/inkwell # uploaded images; omit if you don't use attachments
|
||||||
ports:
|
ports:
|
||||||
- "5000:5000"
|
- "5000:5000"
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
thoughtsync-db:
|
inkwell-db:
|
||||||
thoughtsync-data:
|
inkwell-data:
|
||||||
```
|
```
|
||||||
|
|
||||||
Then open `http://<host>:5000` and register — **the first account becomes the admin**.
|
Then open `http://<host>:5000` and register — **the first account becomes the admin**.
|
||||||
|
|
||||||
- **Only `THOUGHTSYNC_DATABASE_URL` is required.** `THOUGHTSYNC_SECRET_KEY` is optional; if
|
- **Only `INKWELL_DATABASE_URL` is required.** `INKWELL_SECRET_KEY` is optional; if
|
||||||
unset, a signing key is generated and persisted in the database (sessions survive restarts).
|
unset, a signing key is generated and persisted in the database (sessions survive restarts).
|
||||||
- Uploaded images live under the `thoughtsync-data` volume at `/var/thoughtsync`.
|
- Uploaded images live under the `inkwell-data` volume at `/var/inkwell`.
|
||||||
- The app waits for the database and runs migrations (`alembic upgrade head`) automatically on start.
|
- The app waits for the database and runs migrations (`alembic upgrade head`) automatically on start.
|
||||||
- **Image tags:** `:latest` (stable, built from `main`) · `:dev` (latest `dev`
|
- **Image tags:** `:latest` (stable, built from `main`) · `:dev` (latest `dev`
|
||||||
build) · `:<git-sha>` on `main` only (immutable, the rollback unit). There are
|
build) · `:<git-sha>` on `main` only (immutable, the rollback unit). There are
|
||||||
@@ -108,7 +108,7 @@ Then open `http://<host>:5000` and register — **the first account becomes the
|
|||||||
port, and back up the attachment volume as well as the database. See
|
port, and back up the attachment volume as well as the database. See
|
||||||
[docs/public-hosting.md](docs/public-hosting.md), which also lists what the app
|
[docs/public-hosting.md](docs/public-hosting.md), which also lists what the app
|
||||||
hardens on its own and what it deliberately doesn't.
|
hardens on its own and what it deliberately doesn't.
|
||||||
- **Install as an app (PWA):** ThoughtSync is installable ("Add to Home Screen" / the
|
- **Install as an app (PWA):** Inkwell is installable ("Add to Home Screen" / the
|
||||||
browser's install button) for an app-like window. Browsers only offer install over a
|
browser's install button) for an app-like window. Browsers only offer install over a
|
||||||
**secure context**, so put the app behind a reverse proxy terminating **HTTPS** (or reach
|
**secure context**, so put the app behind a reverse proxy terminating **HTTPS** (or reach
|
||||||
it via `localhost`) — plain `http://<host>:5000` won't show the install prompt.
|
it via `localhost`) — plain `http://<host>:5000` won't show the install prompt.
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# Alembic single-database async configuration for ThoughtSync.
|
# Alembic single-database async configuration for Inkwell.
|
||||||
|
|
||||||
[alembic]
|
[alembic]
|
||||||
script_location = %(here)s/alembic
|
script_location = %(here)s/alembic
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ val rustInputs =
|
|||||||
* build, and neither is worth holding signed APKs up for. Scribe #2810.
|
* build, and neither is worth holding signed APKs up for. Scribe #2810.
|
||||||
*/
|
*/
|
||||||
val rustProfile =
|
val rustProfile =
|
||||||
(project.findProperty("THOUGHTSYNC_CARGO_PROFILE") as String?)?.takeIf { it.isNotBlank() }
|
(project.findProperty("INKWELL_CARGO_PROFILE") as String?)?.takeIf { it.isNotBlank() }
|
||||||
?: "debug"
|
?: "debug"
|
||||||
|
|
||||||
val jniLibsOut = layout.buildDirectory.dir("rustJniLibs")
|
val jniLibsOut = layout.buildDirectory.dir("rustJniLibs")
|
||||||
@@ -169,11 +169,11 @@ val generateBindings =
|
|||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
namespace = "com.fabledsword.thoughtsync"
|
namespace = "com.fabledsword.inkwell"
|
||||||
compileSdk = 36
|
compileSdk = 36
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId = "com.fabledsword.thoughtsync"
|
applicationId = "com.fabledsword.inkwell"
|
||||||
// 26 (Android 8, 2017) matches Minstrel and clears the NDK's floor with
|
// 26 (Android 8, 2017) matches Minstrel and clears the NDK's floor with
|
||||||
// room to spare.
|
// room to spare.
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
@@ -181,9 +181,9 @@ android {
|
|||||||
// Injected by CI from the git tag + commit count for a release; "dev"
|
// Injected by CI from the git tag + commit count for a release; "dev"
|
||||||
// locally so the About screen reads honestly rather than claiming 1.0.
|
// locally so the About screen reads honestly rather than claiming 1.0.
|
||||||
val nameOverride =
|
val nameOverride =
|
||||||
(project.findProperty("THOUGHTSYNC_VERSION_NAME") as String?)?.takeIf { it.isNotBlank() }
|
(project.findProperty("INKWELL_VERSION_NAME") as String?)?.takeIf { it.isNotBlank() }
|
||||||
val codeOverride =
|
val codeOverride =
|
||||||
(project.findProperty("THOUGHTSYNC_VERSION_CODE") as String?)?.toIntOrNull()
|
(project.findProperty("INKWELL_VERSION_CODE") as String?)?.toIntOrNull()
|
||||||
versionCode = codeOverride ?: 1
|
versionCode = codeOverride ?: 1
|
||||||
versionName = nameOverride ?: "dev"
|
versionName = nameOverride ?: "dev"
|
||||||
|
|
||||||
@@ -215,7 +215,10 @@ android {
|
|||||||
// Hardcoded, and NOT a secret: the alias is fixed for the life of
|
// Hardcoded, and NOT a secret: the alias is fixed for the life of
|
||||||
// this app and is written into the certificate every install
|
// this app and is written into the certificate every install
|
||||||
// already carries. Hiding it would buy nothing and stop this file
|
// already carries. Hiding it would buy nothing and stop this file
|
||||||
// describing its own signing setup.
|
// describing its own signing setup. It still says `thoughtsync`
|
||||||
|
// after the rename to Inkwell, because it names the key inside the
|
||||||
|
// existing keystore, and renaming it would only stop that key being
|
||||||
|
// found. Same key, so the signing certificate did not change either.
|
||||||
keyAlias = "thoughtsync"
|
keyAlias = "thoughtsync"
|
||||||
// PKCS12 cannot hold a key password distinct from the store
|
// PKCS12 cannot hold a key password distinct from the store
|
||||||
// password — keytool refuses to set one — so this is the same
|
// password — keytool refuses to set one — so this is the same
|
||||||
|
|||||||
Vendored
+1
-1
@@ -4,4 +4,4 @@
|
|||||||
# is the worst possible time to learn it.
|
# is the worst possible time to learn it.
|
||||||
-keep class com.sun.jna.** { *; }
|
-keep class com.sun.jna.** { *; }
|
||||||
-keepclassmembers class * extends com.sun.jna.** { public *; }
|
-keepclassmembers class * extends com.sun.jna.** { public *; }
|
||||||
-keep class com.fabledsword.thoughtsync.core.** { *; }
|
-keep class com.fabledsword.inkwell.core.** { *; }
|
||||||
|
|||||||
@@ -91,13 +91,13 @@
|
|||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:name=".ThoughtSyncApplication"
|
android:name=".InkwellApplication"
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@mipmap/ic_launcher"
|
android:icon="@mipmap/ic_launcher"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:roundIcon="@mipmap/ic_launcher_round"
|
android:roundIcon="@mipmap/ic_launcher_round"
|
||||||
android:supportsRtl="true"
|
android:supportsRtl="true"
|
||||||
android:theme="@style/Theme.ThoughtSync"
|
android:theme="@style/Theme.Inkwell"
|
||||||
android:usesCleartextTraffic="true">
|
android:usesCleartextTraffic="true">
|
||||||
<!--
|
<!--
|
||||||
launchMode="singleTop" exists for the SHARE filters below.
|
launchMode="singleTop" exists for the SHARE filters below.
|
||||||
@@ -115,7 +115,7 @@
|
|||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:launchMode="singleTop"
|
android:launchMode="singleTop"
|
||||||
android:windowSoftInputMode="adjustResize"
|
android:windowSoftInputMode="adjustResize"
|
||||||
android:theme="@style/Theme.ThoughtSync">
|
android:theme="@style/Theme.Inkwell">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@@ -42,7 +42,7 @@ import java.io.File
|
|||||||
* [UpdateReceiver], which is why a failure can be shown rather than guessed at.
|
* [UpdateReceiver], which is why a failure can be shown rather than guessed at.
|
||||||
*/
|
*/
|
||||||
object AppUpdate {
|
object AppUpdate {
|
||||||
private const val TAG = "ThoughtSyncUpdate"
|
private const val TAG = "InkwellUpdate"
|
||||||
|
|
||||||
/** This build's versionCode — what the server's is compared against. */
|
/** This build's versionCode — what the server's is compared against. */
|
||||||
fun installedVersionCode(context: Context): Long =
|
fun installedVersionCode(context: Context): Long =
|
||||||
@@ -173,5 +173,5 @@ object AppUpdate {
|
|||||||
.intentSender
|
.intentSender
|
||||||
}
|
}
|
||||||
|
|
||||||
private const val WRITE_NAME = "thoughtsync-update"
|
private const val WRITE_NAME = "inkwell-update"
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
|
||||||
+9
-9
@@ -1,9 +1,9 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.app.Application
|
import android.app.Application
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import com.fabledsword.thoughtsync.core.ThoughtSync
|
import com.fabledsword.inkwell.core.Inkwell
|
||||||
import com.fabledsword.thoughtsync.core.setClientAgent
|
import com.fabledsword.inkwell.core.setClientAgent
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opens the shared Rust core once, for the process lifetime.
|
* Opens the shared Rust core once, for the process lifetime.
|
||||||
@@ -16,14 +16,14 @@ import com.fabledsword.thoughtsync.core.setClientAgent
|
|||||||
* removed on uninstall, and never on external media. The core does not guess at
|
* removed on uninstall, and never on external media. The core does not guess at
|
||||||
* platform paths; Android is the only thing that knows where this is.
|
* platform paths; Android is the only thing that knows where this is.
|
||||||
*/
|
*/
|
||||||
class ThoughtSyncApplication : Application() {
|
class InkwellApplication : Application() {
|
||||||
/**
|
/**
|
||||||
* Null only if the store could not be opened — a corrupt or unwritable
|
* Null only if the store could not be opened — a corrupt or unwritable
|
||||||
* database. The UI reports that honestly rather than crashing on first
|
* database. The UI reports that honestly rather than crashing on first
|
||||||
* touch, because a user whose notes won't open needs a message, not a
|
* touch, because a user whose notes won't open needs a message, not a
|
||||||
* stack trace.
|
* stack trace.
|
||||||
*/
|
*/
|
||||||
var core: ThoughtSync? = null
|
var core: Inkwell? = null
|
||||||
private set
|
private set
|
||||||
|
|
||||||
var openFailure: String? = null
|
var openFailure: String? = null
|
||||||
@@ -34,13 +34,13 @@ class ThoughtSyncApplication : Application() {
|
|||||||
|
|
||||||
// Introduce this app to any server it links to, before anything can sync.
|
// Introduce this app to any server it links to, before anything can sync.
|
||||||
// The core cannot name us — the same crate is compiled into the desktop app,
|
// The core cannot name us — the same crate is compiled into the desktop app,
|
||||||
// and it used to announce every phone as `thoughtsync-desktop` carrying the
|
// and it used to announce every phone as `inkwell-desktop` carrying the
|
||||||
// core crate's own version. "unknown" rather than a guess when the package
|
// core crate's own version. "unknown" rather than a guess when the package
|
||||||
// manager will not say (note 3127 §5).
|
// manager will not say (note 3127 §5).
|
||||||
setClientAgent("thoughtsync-android", installedVersionName() ?: "unknown")
|
setClientAgent("inkwell-android", installedVersionName() ?: "unknown")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val handle = ThoughtSync(filesDir.absolutePath)
|
val handle = Inkwell(filesDir.absolutePath)
|
||||||
core = handle
|
core = handle
|
||||||
Log.i(TAG, "local store ready — ${handle.summary()}")
|
Log.i(TAG, "local store ready — ${handle.summary()}")
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
@@ -53,6 +53,6 @@ class ThoughtSyncApplication : Application() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
const val TAG = "ThoughtSync"
|
const val TAG = "Inkwell"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+21
-21
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.Manifest
|
import android.Manifest
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
@@ -22,22 +22,22 @@ import androidx.compose.runtime.setValue
|
|||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.lifecycle.viewmodel.compose.viewModel
|
import androidx.lifecycle.viewmodel.compose.viewModel
|
||||||
import com.fabledsword.thoughtsync.core.ThoughtSync
|
import com.fabledsword.inkwell.core.Inkwell
|
||||||
import com.fabledsword.thoughtsync.ui.BoardScreen
|
import com.fabledsword.inkwell.ui.BoardScreen
|
||||||
import com.fabledsword.thoughtsync.ui.BoardSync
|
import com.fabledsword.inkwell.ui.BoardSync
|
||||||
import com.fabledsword.thoughtsync.ui.BoardUpdate
|
import com.fabledsword.inkwell.ui.BoardUpdate
|
||||||
import com.fabledsword.thoughtsync.ui.BoardViewModel
|
import com.fabledsword.inkwell.ui.BoardViewModel
|
||||||
import com.fabledsword.thoughtsync.ui.ForegroundTransitions
|
import com.fabledsword.inkwell.ui.ForegroundTransitions
|
||||||
import com.fabledsword.thoughtsync.ui.NoteEditorScreen
|
import com.fabledsword.inkwell.ui.InkwellTheme
|
||||||
import com.fabledsword.thoughtsync.ui.StoreUnavailableScreen
|
import com.fabledsword.inkwell.ui.NoteEditorScreen
|
||||||
import com.fabledsword.thoughtsync.ui.SyncScreen
|
import com.fabledsword.inkwell.ui.StoreUnavailableScreen
|
||||||
import com.fabledsword.thoughtsync.ui.SyncState
|
import com.fabledsword.inkwell.ui.SyncScreen
|
||||||
import com.fabledsword.thoughtsync.ui.SyncViewModel
|
import com.fabledsword.inkwell.ui.SyncState
|
||||||
import com.fabledsword.thoughtsync.ui.TagsScreen
|
import com.fabledsword.inkwell.ui.SyncViewModel
|
||||||
import com.fabledsword.thoughtsync.ui.TagsViewModel
|
import com.fabledsword.inkwell.ui.TagsScreen
|
||||||
import com.fabledsword.thoughtsync.ui.ThoughtSyncTheme
|
import com.fabledsword.inkwell.ui.TagsViewModel
|
||||||
import com.fabledsword.thoughtsync.ui.UpdateViewModel
|
import com.fabledsword.inkwell.ui.UpdateViewModel
|
||||||
import com.fabledsword.thoughtsync.ui.olderThan
|
import com.fabledsword.inkwell.ui.olderThan
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
@@ -68,12 +68,12 @@ class MainActivity : ComponentActivity() {
|
|||||||
super.onCreate(savedInstanceState)
|
super.onCreate(savedInstanceState)
|
||||||
enableEdgeToEdge()
|
enableEdgeToEdge()
|
||||||
|
|
||||||
val app = application as ThoughtSyncApplication
|
val app = application as InkwellApplication
|
||||||
requestedNote.value = takeRequestedNote(intent)
|
requestedNote.value = takeRequestedNote(intent)
|
||||||
sharedText.value = takeSharedText(intent)
|
sharedText.value = takeSharedText(intent)
|
||||||
|
|
||||||
setContent {
|
setContent {
|
||||||
ThoughtSyncTheme {
|
InkwellTheme {
|
||||||
val core = app.core
|
val core = app.core
|
||||||
if (core == null) {
|
if (core == null) {
|
||||||
// The store never opened. There is no board to show and no
|
// The store never opened. There is no board to show and no
|
||||||
@@ -174,7 +174,7 @@ private enum class Screen { BOARD, EDITOR, SYNC, TAGS }
|
|||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
private fun App(
|
private fun App(
|
||||||
core: ThoughtSync,
|
core: Inkwell,
|
||||||
requestedNote: MutableState<String?>,
|
requestedNote: MutableState<String?>,
|
||||||
sharedText: MutableState<String?>,
|
sharedText: MutableState<String?>,
|
||||||
) {
|
) {
|
||||||
@@ -360,7 +360,7 @@ private fun App(
|
|||||||
* notifications this app would send — is spending it on nothing.
|
* notifications this app would send — is spending it on nothing.
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
private fun ReminderAlarms(core: ThoughtSync) {
|
private fun ReminderAlarms(core: Inkwell) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
// Off the main thread: this reads every note that has a reminder, and a phone
|
// Off the main thread: this reads every note that has a reminder, and a phone
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.app.NotificationChannel
|
import android.app.NotificationChannel
|
||||||
import android.app.NotificationManager
|
import android.app.NotificationManager
|
||||||
@@ -8,7 +8,7 @@ import android.content.Intent
|
|||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
import androidx.core.app.NotificationManagerCompat
|
import androidx.core.app.NotificationManagerCompat
|
||||||
import com.fabledsword.thoughtsync.core.Note
|
import com.fabledsword.inkwell.core.Note
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* What a due reminder looks like in the shade.
|
* What a due reminder looks like in the shade.
|
||||||
@@ -117,5 +117,5 @@ internal object ReminderNotification {
|
|||||||
)
|
)
|
||||||
|
|
||||||
private const val CHANNEL = "reminders"
|
private const val CHANNEL = "reminders"
|
||||||
private const val TAG = "ThoughtSyncReminders"
|
private const val TAG = "InkwellReminders"
|
||||||
}
|
}
|
||||||
+6
-6
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.content.BroadcastReceiver
|
import android.content.BroadcastReceiver
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
@@ -36,7 +36,7 @@ class ReminderReceiver : BroadcastReceiver() {
|
|||||||
context: Context,
|
context: Context,
|
||||||
intent: Intent,
|
intent: Intent,
|
||||||
) {
|
) {
|
||||||
val core = (context.applicationContext as? ThoughtSyncApplication)?.core ?: return
|
val core = (context.applicationContext as? InkwellApplication)?.core ?: return
|
||||||
val action = intent.action
|
val action = intent.action
|
||||||
val noteId = intent.getStringExtra(Reminders.EXTRA_NOTE_ID)
|
val noteId = intent.getStringExtra(Reminders.EXTRA_NOTE_ID)
|
||||||
val app = context.applicationContext
|
val app = context.applicationContext
|
||||||
@@ -64,9 +64,9 @@ class ReminderReceiver : BroadcastReceiver() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val ACTION_DUE = "com.fabledsword.thoughtsync.REMINDER_DUE"
|
const val ACTION_DUE = "com.fabledsword.inkwell.REMINDER_DUE"
|
||||||
const val ACTION_DONE = "com.fabledsword.thoughtsync.REMINDER_DONE"
|
const val ACTION_DONE = "com.fabledsword.inkwell.REMINDER_DONE"
|
||||||
const val ACTION_SNOOZE = "com.fabledsword.thoughtsync.REMINDER_SNOOZE"
|
const val ACTION_SNOOZE = "com.fabledsword.inkwell.REMINDER_SNOOZE"
|
||||||
private const val TAG = "ThoughtSyncReminders"
|
private const val TAG = "InkwellReminders"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+9
-9
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.app.AlarmManager
|
import android.app.AlarmManager
|
||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
@@ -7,8 +7,8 @@ import android.content.Intent
|
|||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
import androidx.core.app.NotificationManagerCompat
|
import androidx.core.app.NotificationManagerCompat
|
||||||
import com.fabledsword.thoughtsync.core.Note
|
import com.fabledsword.inkwell.core.Inkwell
|
||||||
import com.fabledsword.thoughtsync.core.ThoughtSync
|
import com.fabledsword.inkwell.core.Note
|
||||||
import java.time.OffsetDateTime
|
import java.time.OffsetDateTime
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,7 +52,7 @@ object Reminders {
|
|||||||
private const val MISSED_WINDOW_MS = 24L * 60 * 60 * 1000
|
private const val MISSED_WINDOW_MS = 24L * 60 * 60 * 1000
|
||||||
|
|
||||||
private const val SNOOZE_MINUTES = 60L
|
private const val SNOOZE_MINUTES = 60L
|
||||||
private const val TAG = "ThoughtSyncReminders"
|
private const val TAG = "InkwellReminders"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Announce what is due, then schedule the next one.
|
* Announce what is due, then schedule the next one.
|
||||||
@@ -63,7 +63,7 @@ object Reminders {
|
|||||||
*/
|
*/
|
||||||
fun refresh(
|
fun refresh(
|
||||||
context: Context,
|
context: Context,
|
||||||
core: ThoughtSync,
|
core: Inkwell,
|
||||||
) {
|
) {
|
||||||
ReminderNotification.ensureChannel(context)
|
ReminderNotification.ensureChannel(context)
|
||||||
val notes =
|
val notes =
|
||||||
@@ -111,7 +111,7 @@ object Reminders {
|
|||||||
*/
|
*/
|
||||||
fun promptToNotifyDue(
|
fun promptToNotifyDue(
|
||||||
context: Context,
|
context: Context,
|
||||||
core: ThoughtSync,
|
core: Inkwell,
|
||||||
): Boolean =
|
): Boolean =
|
||||||
!Announced(context).askedToNotify &&
|
!Announced(context).askedToNotify &&
|
||||||
!NotificationManagerCompat.from(context).areNotificationsEnabled() &&
|
!NotificationManagerCompat.from(context).areNotificationsEnabled() &&
|
||||||
@@ -123,7 +123,7 @@ object Reminders {
|
|||||||
/** Clear the reminder, as the notification's Done action. */
|
/** Clear the reminder, as the notification's Done action. */
|
||||||
fun complete(
|
fun complete(
|
||||||
context: Context,
|
context: Context,
|
||||||
core: ThoughtSync,
|
core: Inkwell,
|
||||||
noteId: String,
|
noteId: String,
|
||||||
) {
|
) {
|
||||||
runCatching { core.completeReminder(noteId) }
|
runCatching { core.completeReminder(noteId) }
|
||||||
@@ -134,7 +134,7 @@ object Reminders {
|
|||||||
/** Push the reminder an hour out, as the notification's Snooze action. */
|
/** Push the reminder an hour out, as the notification's Snooze action. */
|
||||||
fun snooze(
|
fun snooze(
|
||||||
context: Context,
|
context: Context,
|
||||||
core: ThoughtSync,
|
core: Inkwell,
|
||||||
noteId: String,
|
noteId: String,
|
||||||
) {
|
) {
|
||||||
runCatching { core.snoozeReminder(noteId, SNOOZE_MINUTES) }
|
runCatching { core.snoozeReminder(noteId, SNOOZE_MINUTES) }
|
||||||
@@ -237,7 +237,7 @@ private class Announced(
|
|||||||
fun markAsked() = prefs.edit().putBoolean(KEY_ASKED, true).apply()
|
fun markAsked() = prefs.edit().putBoolean(KEY_ASKED, true).apply()
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
const val FILE = "thoughtsync-reminders"
|
const val FILE = "inkwell-reminders"
|
||||||
const val KEY_SEEN = "announced"
|
const val KEY_SEEN = "announced"
|
||||||
const val KEY_PRIMED = "primed"
|
const val KEY_PRIMED = "primed"
|
||||||
const val KEY_ASKED = "asked_to_notify"
|
const val KEY_ASKED = "asked_to_notify"
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.work.BackoffPolicy
|
import androidx.work.BackoffPolicy
|
||||||
@@ -85,8 +85,8 @@ object SyncSchedule {
|
|||||||
.setRequiredNetworkType(NetworkType.CONNECTED)
|
.setRequiredNetworkType(NetworkType.CONNECTED)
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
private const val PERIODIC = "thoughtsync-periodic-sync"
|
private const val PERIODIC = "inkwell-periodic-sync"
|
||||||
private const val PUSH = "thoughtsync-push-pending"
|
private const val PUSH = "inkwell-push-pending"
|
||||||
|
|
||||||
/** WorkManager's own minimum for periodic work. Asking for less gets this. */
|
/** WorkManager's own minimum for periodic work. Asking for less gets this. */
|
||||||
private const val PERIOD_MINUTES = 15L
|
private const val PERIOD_MINUTES = 15L
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ class SyncSettings(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
const val FILE = "thoughtsync-sync"
|
const val FILE = "inkwell-sync"
|
||||||
const val KEY_AUTOMATIC = "automatic"
|
const val KEY_AUTOMATIC = "automatic"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
@@ -8,7 +8,7 @@ import androidx.work.WorkerParameters
|
|||||||
/**
|
/**
|
||||||
* One sync cycle, run by the system rather than by a person.
|
* One sync cycle, run by the system rather than by a person.
|
||||||
*
|
*
|
||||||
* WorkManager may start the process to run this, which means [ThoughtSyncApplication.onCreate]
|
* WorkManager may start the process to run this, which means [InkwellApplication.onCreate]
|
||||||
* has already opened the store by the time [doWork] is called — the same handle
|
* has already opened the store by the time [doWork] is called — the same handle
|
||||||
* the UI uses, so there is never a second SQLite connection racing the first.
|
* the UI uses, so there is never a second SQLite connection racing the first.
|
||||||
*
|
*
|
||||||
@@ -30,7 +30,7 @@ class SyncWorker(
|
|||||||
params: WorkerParameters,
|
params: WorkerParameters,
|
||||||
) : CoroutineWorker(context, params) {
|
) : CoroutineWorker(context, params) {
|
||||||
override suspend fun doWork(): Result {
|
override suspend fun doWork(): Result {
|
||||||
val core = (applicationContext as? ThoughtSyncApplication)?.core
|
val core = (applicationContext as? InkwellApplication)?.core
|
||||||
|
|
||||||
// Both of these are "nothing to do", not "something went wrong", so both
|
// Both of these are "nothing to do", not "something went wrong", so both
|
||||||
// report success and let the run retire quietly:
|
// report success and let the run retire quietly:
|
||||||
@@ -67,6 +67,6 @@ class SyncWorker(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private companion object {
|
private companion object {
|
||||||
const val TAG = "ThoughtSyncWorker"
|
const val TAG = "InkwellWorker"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync
|
package com.fabledsword.inkwell
|
||||||
|
|
||||||
import android.content.BroadcastReceiver
|
import android.content.BroadcastReceiver
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
@@ -71,7 +71,7 @@ class UpdateReceiver : BroadcastReceiver() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val ACTION_INSTALLED = "com.fabledsword.thoughtsync.UPDATE_INSTALLED"
|
const val ACTION_INSTALLED = "com.fabledsword.inkwell.UPDATE_INSTALLED"
|
||||||
private const val TAG = "ThoughtSyncUpdate"
|
private const val TAG = "InkwellUpdate"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@@ -33,7 +33,7 @@ import androidx.compose.ui.text.input.ImeAction
|
|||||||
import androidx.compose.ui.text.input.TextFieldValue
|
import androidx.compose.ui.text.input.TextFieldValue
|
||||||
import androidx.compose.ui.text.style.TextDecoration
|
import androidx.compose.ui.text.style.TextDecoration
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The note's body, as fields and checkboxes rather than as markup.
|
* The note's body, as fields and checkboxes rather than as markup.
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
@@ -63,9 +63,9 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
import androidx.compose.ui.text.input.ImeAction
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
import com.fabledsword.thoughtsync.core.Label
|
import com.fabledsword.inkwell.core.Label
|
||||||
import com.fabledsword.thoughtsync.core.Note
|
import com.fabledsword.inkwell.core.Note
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
+10
-10
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@@ -6,12 +6,12 @@ import androidx.compose.runtime.setValue
|
|||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.fabledsword.thoughtsync.core.Label
|
import com.fabledsword.inkwell.core.Inkwell
|
||||||
import com.fabledsword.thoughtsync.core.Note
|
import com.fabledsword.inkwell.core.Label
|
||||||
import com.fabledsword.thoughtsync.core.NoteDraft
|
import com.fabledsword.inkwell.core.Note
|
||||||
import com.fabledsword.thoughtsync.core.NoteEdit
|
import com.fabledsword.inkwell.core.NoteDraft
|
||||||
import com.fabledsword.thoughtsync.core.NoteQuery
|
import com.fabledsword.inkwell.core.NoteEdit
|
||||||
import com.fabledsword.thoughtsync.core.ThoughtSync
|
import com.fabledsword.inkwell.core.NoteQuery
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
@@ -99,7 +99,7 @@ data class BoardState(
|
|||||||
*/
|
*/
|
||||||
@Suppress("TooManyFunctions")
|
@Suppress("TooManyFunctions")
|
||||||
class BoardViewModel(
|
class BoardViewModel(
|
||||||
private val core: ThoughtSync,
|
private val core: Inkwell,
|
||||||
/**
|
/**
|
||||||
* Called after any write that could have moved a reminder.
|
* Called after any write that could have moved a reminder.
|
||||||
*
|
*
|
||||||
@@ -482,7 +482,7 @@ class BoardViewModel(
|
|||||||
*/
|
*/
|
||||||
private fun mutate(
|
private fun mutate(
|
||||||
closeEditor: Boolean = false,
|
closeEditor: Boolean = false,
|
||||||
block: (ThoughtSync) -> Note?,
|
block: (Inkwell) -> Note?,
|
||||||
) {
|
) {
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
state = state.copy(saving = true)
|
state = state.copy(saving = true)
|
||||||
@@ -547,7 +547,7 @@ class BoardViewModel(
|
|||||||
private const val VIEW_TRASH = "trash"
|
private const val VIEW_TRASH = "trash"
|
||||||
|
|
||||||
fun factory(
|
fun factory(
|
||||||
core: ThoughtSync,
|
core: Inkwell,
|
||||||
onRemindersChanged: () -> Unit,
|
onRemindersChanged: () -> Unit,
|
||||||
): ViewModelProvider.Factory =
|
): ViewModelProvider.Factory =
|
||||||
object : ViewModelProvider.Factory {
|
object : ViewModelProvider.Factory {
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
// The colour a LABEL wears when nobody picked one for it.
|
// The colour a LABEL wears when nobody picked one for it.
|
||||||
//
|
//
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Everything the editor can ask for, as one type.
|
* Everything the editor can ask for, as one type.
|
||||||
+3
-3
@@ -1,10 +1,10 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.runtime.saveable.Saver
|
import androidx.compose.runtime.saveable.Saver
|
||||||
import androidx.compose.ui.text.TextRange
|
import androidx.compose.ui.text.TextRange
|
||||||
import androidx.compose.ui.text.input.TextFieldValue
|
import androidx.compose.ui.text.input.TextFieldValue
|
||||||
import com.fabledsword.thoughtsync.core.checklistItems
|
import com.fabledsword.inkwell.core.checklistItems
|
||||||
import com.fabledsword.thoughtsync.core.checklistRender
|
import com.fabledsword.inkwell.core.checklistRender
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* One piece of a note body, as the editor DRAWS it.
|
* One piece of a note body, as the editor DRAWS it.
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import android.text.format.DateUtils
|
import android.text.format.DateUtils
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
@@ -41,8 +41,8 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
import com.fabledsword.thoughtsync.core.Note
|
import com.fabledsword.inkwell.core.Note
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The editor's action bar, along the top of the surface.
|
* The editor's action bar, along the top of the surface.
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.clickable
|
import androidx.compose.foundation.clickable
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@@ -36,9 +36,9 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
import androidx.compose.ui.text.input.ImeAction
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
import com.fabledsword.thoughtsync.core.Label
|
import com.fabledsword.inkwell.core.Label
|
||||||
import com.fabledsword.thoughtsync.core.Note
|
import com.fabledsword.inkwell.core.Note
|
||||||
import java.time.DayOfWeek
|
import java.time.DayOfWeek
|
||||||
import java.time.Instant
|
import java.time.Instant
|
||||||
import java.time.LocalDate
|
import java.time.LocalDate
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
@@ -16,7 +16,7 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
|
|
||||||
// Shared by the board and the editor.
|
// Shared by the board and the editor.
|
||||||
//
|
//
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.DisposableEffect
|
import androidx.compose.runtime.DisposableEffect
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.DisposableEffect
|
import androidx.compose.runtime.DisposableEffect
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@@ -12,8 +12,8 @@ import androidx.compose.ui.Modifier
|
|||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.core.LinkPreview
|
import com.fabledsword.inkwell.core.LinkPreview
|
||||||
import com.fabledsword.thoughtsync.core.Note
|
import com.fabledsword.inkwell.core.Note
|
||||||
|
|
||||||
private val PREVIEW_RADIUS = 8.dp
|
private val PREVIEW_RADIUS = 8.dp
|
||||||
|
|
||||||
+7
-7
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
@@ -38,12 +38,12 @@ import androidx.compose.ui.text.font.FontWeight
|
|||||||
import androidx.compose.ui.text.style.TextDecoration
|
import androidx.compose.ui.text.style.TextDecoration
|
||||||
import androidx.compose.ui.text.style.TextOverflow
|
import androidx.compose.ui.text.style.TextOverflow
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
import com.fabledsword.thoughtsync.core.BodyItem
|
import com.fabledsword.inkwell.core.BodyItem
|
||||||
import com.fabledsword.thoughtsync.core.Note
|
import com.fabledsword.inkwell.core.Note
|
||||||
import com.fabledsword.thoughtsync.core.NoteLabel
|
import com.fabledsword.inkwell.core.NoteLabel
|
||||||
import com.fabledsword.thoughtsync.core.bodyTags
|
import com.fabledsword.inkwell.core.bodyTags
|
||||||
import com.fabledsword.thoughtsync.core.checklistItems
|
import com.fabledsword.inkwell.core.checklistItems
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun NoteCard(
|
fun NoteCard(
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
@@ -25,8 +25,8 @@ import androidx.compose.runtime.saveable.rememberSaveable
|
|||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.core.Label
|
import com.fabledsword.inkwell.core.Label
|
||||||
import com.fabledsword.thoughtsync.core.Note
|
import com.fabledsword.inkwell.core.Note
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
|
|
||||||
/**
|
/**
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.runtime.ReadOnlyComposable
|
import androidx.compose.runtime.ReadOnlyComposable
|
||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
@@ -20,7 +20,7 @@ import androidx.compose.ui.draw.clip
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A bordered block, tinted from the same table the notes use.
|
* A bordered block, tinted from the same table the notes use.
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.annotation.StringRes
|
import androidx.annotation.StringRes
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import android.app.AlarmManager
|
import android.app.AlarmManager
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
@@ -17,8 +17,8 @@ import androidx.compose.ui.platform.LocalContext
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.core.app.NotificationManagerCompat
|
import androidx.core.app.NotificationManagerCompat
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
import com.fabledsword.thoughtsync.Reminders
|
import com.fabledsword.inkwell.Reminders
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Says so when a reminder would not actually reach anyone.
|
* Says so when a reminder would not actually reach anyone.
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
@@ -27,9 +27,9 @@ import androidx.compose.ui.text.input.KeyboardCapitalization
|
|||||||
import androidx.compose.ui.text.input.KeyboardType
|
import androidx.compose.ui.text.input.KeyboardType
|
||||||
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
import androidx.compose.ui.text.input.PasswordVisualTransformation
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
import com.fabledsword.thoughtsync.core.Compatibility
|
import com.fabledsword.inkwell.core.Compatibility
|
||||||
import com.fabledsword.thoughtsync.core.RevokeOutcome
|
import com.fabledsword.inkwell.core.RevokeOutcome
|
||||||
|
|
||||||
// Becoming linked: the probe-then-sign-in flow, and the notices around it.
|
// Becoming linked: the probe-then-sign-in flow, and the notices around it.
|
||||||
//
|
//
|
||||||
+5
-5
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
@@ -36,15 +36,15 @@ import androidx.compose.ui.res.pluralStringResource
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
import com.fabledsword.thoughtsync.UpdateOutcome
|
import com.fabledsword.inkwell.UpdateOutcome
|
||||||
import com.fabledsword.thoughtsync.installedVersionName
|
import com.fabledsword.inkwell.installedVersionName
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Opt-in server pairing.
|
* Opt-in server pairing.
|
||||||
*
|
*
|
||||||
* The whole screen is written around one idea: **being unlinked is not a
|
* The whole screen is written around one idea: **being unlinked is not a
|
||||||
* problem.** ThoughtSync is local-first and completely usable having never opened
|
* problem.** Inkwell is local-first and completely usable having never opened
|
||||||
* this screen, so the unlinked state leads with "Working offline on this device"
|
* this screen, so the unlinked state leads with "Working offline on this device"
|
||||||
* and explains what connecting would ADD, rather than presenting an empty form as
|
* and explains what connecting would ADD, rather than presenting an empty form as
|
||||||
* unfinished setup.
|
* unfinished setup.
|
||||||
+4
-4
@@ -1,11 +1,11 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.res.pluralStringResource
|
import androidx.compose.ui.res.pluralStringResource
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
import com.fabledsword.thoughtsync.core.Compatibility
|
import com.fabledsword.inkwell.core.Compatibility
|
||||||
import com.fabledsword.thoughtsync.core.SyncOutcome
|
import com.fabledsword.inkwell.core.SyncOutcome
|
||||||
|
|
||||||
// Turning sync results into sentences.
|
// Turning sync results into sentences.
|
||||||
//
|
//
|
||||||
+9
-9
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@@ -6,12 +6,12 @@ import androidx.compose.runtime.setValue
|
|||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.fabledsword.thoughtsync.core.Compatibility
|
import com.fabledsword.inkwell.core.Compatibility
|
||||||
import com.fabledsword.thoughtsync.core.ProbeResult
|
import com.fabledsword.inkwell.core.Inkwell
|
||||||
import com.fabledsword.thoughtsync.core.RevokeOutcome
|
import com.fabledsword.inkwell.core.ProbeResult
|
||||||
import com.fabledsword.thoughtsync.core.SyncOutcome
|
import com.fabledsword.inkwell.core.RevokeOutcome
|
||||||
import com.fabledsword.thoughtsync.core.SyncStatus
|
import com.fabledsword.inkwell.core.SyncOutcome
|
||||||
import com.fabledsword.thoughtsync.core.ThoughtSync
|
import com.fabledsword.inkwell.core.SyncStatus
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
@@ -113,7 +113,7 @@ data class SyncState(
|
|||||||
* stored cursor next time (Scribe #2736).
|
* stored cursor next time (Scribe #2736).
|
||||||
*/
|
*/
|
||||||
class SyncViewModel(
|
class SyncViewModel(
|
||||||
private val core: ThoughtSync,
|
private val core: Inkwell,
|
||||||
/**
|
/**
|
||||||
* Called after a sync that changed the store.
|
* Called after a sync that changed the store.
|
||||||
*
|
*
|
||||||
@@ -316,7 +316,7 @@ class SyncViewModel(
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun factory(
|
fun factory(
|
||||||
core: ThoughtSync,
|
core: Inkwell,
|
||||||
onStoreChanged: () -> Unit,
|
onStoreChanged: () -> Unit,
|
||||||
): ViewModelProvider.Factory =
|
): ViewModelProvider.Factory =
|
||||||
object : ViewModelProvider.Factory {
|
object : ViewModelProvider.Factory {
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
@@ -43,8 +43,8 @@ import androidx.compose.ui.draw.clip
|
|||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.text.input.ImeAction
|
import androidx.compose.ui.text.input.ImeAction
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
import com.fabledsword.thoughtsync.core.Label
|
import com.fabledsword.inkwell.core.Label
|
||||||
|
|
||||||
/** The swatch shown beside a tag, and tapped to change its colour. */
|
/** The swatch shown beside a tag, and tapped to change its colour. */
|
||||||
private val SWATCH = 22.dp
|
private val SWATCH = 22.dp
|
||||||
+6
-6
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
@@ -6,8 +6,8 @@ import androidx.compose.runtime.setValue
|
|||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.fabledsword.thoughtsync.core.Label
|
import com.fabledsword.inkwell.core.Inkwell
|
||||||
import com.fabledsword.thoughtsync.core.ThoughtSync
|
import com.fabledsword.inkwell.core.Label
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
@@ -57,7 +57,7 @@ data class TagsState(
|
|||||||
* the core marks the rows dirty and the next sync carries them.
|
* the core marks the rows dirty and the next sync carries them.
|
||||||
*/
|
*/
|
||||||
class TagsViewModel(
|
class TagsViewModel(
|
||||||
private val core: ThoughtSync,
|
private val core: Inkwell,
|
||||||
/**
|
/**
|
||||||
* Called after any write that landed.
|
* Called after any write that landed.
|
||||||
*
|
*
|
||||||
@@ -140,7 +140,7 @@ class TagsViewModel(
|
|||||||
* `busy` is cleared in the same assignment that stores the result, so no path
|
* `busy` is cleared in the same assignment that stores the result, so no path
|
||||||
* out of here can leave the screen stuck with its controls disabled.
|
* out of here can leave the screen stuck with its controls disabled.
|
||||||
*/
|
*/
|
||||||
private fun write(block: (ThoughtSync) -> Unit) {
|
private fun write(block: (Inkwell) -> Unit) {
|
||||||
if (state.busy) return
|
if (state.busy) return
|
||||||
state = state.copy(busy = true, error = null)
|
state = state.copy(busy = true, error = null)
|
||||||
viewModelScope.launch {
|
viewModelScope.launch {
|
||||||
@@ -164,7 +164,7 @@ class TagsViewModel(
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun factory(
|
fun factory(
|
||||||
core: ThoughtSync,
|
core: Inkwell,
|
||||||
onStoreChanged: () -> Unit,
|
onStoreChanged: () -> Unit,
|
||||||
): ViewModelProvider.Factory =
|
): ViewModelProvider.Factory =
|
||||||
object : ViewModelProvider.Factory {
|
object : ViewModelProvider.Factory {
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.isSystemInDarkTheme
|
import androidx.compose.foundation.isSystemInDarkTheme
|
||||||
import androidx.compose.material3.MaterialTheme
|
import androidx.compose.material3.MaterialTheme
|
||||||
@@ -59,7 +59,7 @@ private val DarkColors =
|
|||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Material 3 in ThoughtSync's own colours, following the system light/dark setting.
|
* Material 3 in Inkwell's own colours, following the system light/dark setting.
|
||||||
*
|
*
|
||||||
* DELIBERATELY NOT Material You dynamic colour, which this used until the operator
|
* DELIBERATELY NOT Material You dynamic colour, which this used until the operator
|
||||||
* saw the first build. Dynamic colour is the more Android-native choice and it
|
* saw the first build. Dynamic colour is the more Android-native choice and it
|
||||||
@@ -72,7 +72,7 @@ private val DarkColors =
|
|||||||
* If dynamic colour is ever wanted it belongs behind a setting, not as the default.
|
* If dynamic colour is ever wanted it belongs behind a setting, not as the default.
|
||||||
*/
|
*/
|
||||||
@Composable
|
@Composable
|
||||||
fun ThoughtSyncTheme(
|
fun InkwellTheme(
|
||||||
darkTheme: Boolean = isSystemInDarkTheme(),
|
darkTheme: Boolean = isSystemInDarkTheme(),
|
||||||
content: @Composable () -> Unit,
|
content: @Composable () -> Unit,
|
||||||
) {
|
) {
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import java.time.LocalDateTime
|
import java.time.LocalDateTime
|
||||||
import java.time.OffsetDateTime
|
import java.time.OffsetDateTime
|
||||||
+4
-4
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.border
|
import androidx.compose.foundation.border
|
||||||
@@ -25,9 +25,9 @@ import androidx.compose.ui.draw.clip
|
|||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import com.fabledsword.thoughtsync.AppUpdate
|
import com.fabledsword.inkwell.AppUpdate
|
||||||
import com.fabledsword.thoughtsync.R
|
import com.fabledsword.inkwell.R
|
||||||
import com.fabledsword.thoughtsync.UpdateOutcome
|
import com.fabledsword.inkwell.UpdateOutcome
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updating the app from the server it is linked to.
|
* Updating the app from the server it is linked to.
|
||||||
+7
-7
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
@@ -7,10 +7,10 @@ import androidx.compose.runtime.setValue
|
|||||||
import androidx.lifecycle.ViewModel
|
import androidx.lifecycle.ViewModel
|
||||||
import androidx.lifecycle.ViewModelProvider
|
import androidx.lifecycle.ViewModelProvider
|
||||||
import androidx.lifecycle.viewModelScope
|
import androidx.lifecycle.viewModelScope
|
||||||
import com.fabledsword.thoughtsync.AppUpdate
|
import com.fabledsword.inkwell.AppUpdate
|
||||||
import com.fabledsword.thoughtsync.UpdateOutcome
|
import com.fabledsword.inkwell.UpdateOutcome
|
||||||
import com.fabledsword.thoughtsync.core.ClientUpdate
|
import com.fabledsword.inkwell.core.ClientUpdate
|
||||||
import com.fabledsword.thoughtsync.core.ThoughtSync
|
import com.fabledsword.inkwell.core.Inkwell
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
@@ -61,7 +61,7 @@ data class UpdateState(
|
|||||||
* secret this app holds across two languages for no gain.
|
* secret this app holds across two languages for no gain.
|
||||||
*/
|
*/
|
||||||
class UpdateViewModel(
|
class UpdateViewModel(
|
||||||
private val core: ThoughtSync,
|
private val core: Inkwell,
|
||||||
/**
|
/**
|
||||||
* MUST be the application context — it outlives this view model, and holding an
|
* MUST be the application context — it outlives this view model, and holding an
|
||||||
* Activity here is the textbook way to leak a window.
|
* Activity here is the textbook way to leak a window.
|
||||||
@@ -207,7 +207,7 @@ class UpdateViewModel(
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun factory(
|
fun factory(
|
||||||
core: ThoughtSync,
|
core: Inkwell,
|
||||||
context: Context,
|
context: Context,
|
||||||
): ViewModelProvider.Factory =
|
): ViewModelProvider.Factory =
|
||||||
object : ViewModelProvider.Factory {
|
object : ViewModelProvider.Factory {
|
||||||
@@ -2,6 +2,6 @@
|
|||||||
<resources>
|
<resources>
|
||||||
<!-- The product's brand colour, same value the web app's manifest and
|
<!-- The product's brand colour, same value the web app's manifest and
|
||||||
<meta name="theme-color"> already use. One source of truth for "what
|
<meta name="theme-color"> already use. One source of truth for "what
|
||||||
colour is ThoughtSync" across the three surfaces. -->
|
colour is Inkwell" across the three surfaces. -->
|
||||||
<color name="ic_launcher_background">#F5C518</color>
|
<color name="ic_launcher_background">#F5C518</color>
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
truth in XML — the same reason the desktop reads its live theme rather
|
truth in XML — the same reason the desktop reads its live theme rather
|
||||||
than hardcoding a window colour.
|
than hardcoding a window colour.
|
||||||
-->
|
-->
|
||||||
<style name="Theme.ThoughtSync" parent="android:Theme.Material.NoActionBar" />
|
<style name="Theme.Inkwell" parent="android:Theme.Material.NoActionBar" />
|
||||||
</resources>
|
</resources>
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.fabledsword.thoughtsync.ui
|
package com.fabledsword.inkwell.ui
|
||||||
|
|
||||||
import org.junit.Assert.assertEquals
|
import org.junit.Assert.assertEquals
|
||||||
import org.junit.Assert.assertNotEquals
|
import org.junit.Assert.assertNotEquals
|
||||||
@@ -74,7 +74,7 @@ exceptions:
|
|||||||
# right and still applies.
|
# right and still applies.
|
||||||
excludes:
|
excludes:
|
||||||
- "**/ui/**"
|
- "**/ui/**"
|
||||||
- "**/ThoughtSyncApplication.kt"
|
- "**/InkwellApplication.kt"
|
||||||
- "**/SyncWorker.kt"
|
- "**/SyncWorker.kt"
|
||||||
- "**/ReminderReceiver.kt"
|
- "**/ReminderReceiver.kt"
|
||||||
- "**/AppUpdate.kt"
|
- "**/AppUpdate.kt"
|
||||||
|
|||||||
+19
-19
@@ -7,7 +7,7 @@
|
|||||||
//!
|
//!
|
||||||
//! ## Shape
|
//! ## Shape
|
||||||
//!
|
//!
|
||||||
//! One `ThoughtSync` object holds the store and the blob directory, mirroring how
|
//! One `Inkwell` object holds the store and the blob directory, mirroring how
|
||||||
//! Tauri manages them as app state. Kotlin constructs it once, keeps it for the
|
//! Tauri manages them as app state. Kotlin constructs it once, keeps it for the
|
||||||
//! process lifetime, and calls methods on it.
|
//! process lifetime, and calls methods on it.
|
||||||
//!
|
//!
|
||||||
@@ -108,13 +108,13 @@ impl CoreError {
|
|||||||
/// behind its mutex, the blob store being a path — which is what lets uniffi share
|
/// behind its mutex, the blob store being a path — which is what lets uniffi share
|
||||||
/// one instance across coroutines.
|
/// one instance across coroutines.
|
||||||
#[derive(uniffi::Object)]
|
#[derive(uniffi::Object)]
|
||||||
pub struct ThoughtSync {
|
pub struct Inkwell {
|
||||||
db: Db,
|
db: Db,
|
||||||
blobs: BlobStore,
|
blobs: BlobStore,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[uniffi::export]
|
#[uniffi::export]
|
||||||
impl ThoughtSync {
|
impl Inkwell {
|
||||||
/// Open (creating on first run) the store under `data_dir`, and the attachment
|
/// Open (creating on first run) the store under `data_dir`, and the attachment
|
||||||
/// directory beside it.
|
/// directory beside it.
|
||||||
///
|
///
|
||||||
@@ -131,7 +131,7 @@ impl ThoughtSync {
|
|||||||
log::info!("local store ready — {}", local::summary(&db));
|
log::info!("local store ready — {}", local::summary(&db));
|
||||||
|
|
||||||
let blobs = BlobStore::new(dir.join("blobs")).map_err(CoreError::store)?;
|
let blobs = BlobStore::new(dir.join("blobs")).map_err(CoreError::store)?;
|
||||||
Ok(Arc::new(ThoughtSync { db, blobs }))
|
Ok(Arc::new(Inkwell { db, blobs }))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A one-line count summary, for the boot log.
|
/// A one-line count summary, for the boot log.
|
||||||
@@ -413,7 +413,7 @@ impl ThoughtSync {
|
|||||||
/// functions. Split into its own impl block so the runtime attribute — and the fact
|
/// functions. Split into its own impl block so the runtime attribute — and the fact
|
||||||
/// that everything in here touches the network — is visible at a glance.
|
/// that everything in here touches the network — is visible at a glance.
|
||||||
#[uniffi::export(async_runtime = "tokio")]
|
#[uniffi::export(async_runtime = "tokio")]
|
||||||
impl ThoughtSync {
|
impl Inkwell {
|
||||||
/// Ask a server who it is, without committing to anything. Called as the user
|
/// Ask a server who it is, without committing to anything. Called as the user
|
||||||
/// finishes typing an address, so they see what answered before handing over
|
/// finishes typing an address, so they see what answered before handing over
|
||||||
/// credentials.
|
/// credentials.
|
||||||
@@ -525,7 +525,7 @@ impl ThoughtSync {
|
|||||||
///
|
///
|
||||||
/// Takes the destination rather than choosing one: only Android knows a
|
/// Takes the destination rather than choosing one: only Android knows a
|
||||||
/// directory its own package installer can read from, and the core has no
|
/// directory its own package installer can read from, and the core has no
|
||||||
/// business guessing at platform paths — the same reason `ThoughtSync::new`
|
/// business guessing at platform paths — the same reason `Inkwell::new`
|
||||||
/// takes a data dir.
|
/// takes a data dir.
|
||||||
pub async fn download_client_update(&self, dest_path: String) -> Result<(), CoreError> {
|
pub async fn download_client_update(&self, dest_path: String) -> Result<(), CoreError> {
|
||||||
let (base_url, token) = self.credentials()?;
|
let (base_url, token) = self.credentials()?;
|
||||||
@@ -587,7 +587,7 @@ pub fn checklist_render(text: String, checked: bool) -> String {
|
|||||||
/// stamps and nobody has seen. The honest value is the installed package's own
|
/// stamps and nobody has seen. The honest value is the installed package's own
|
||||||
/// `versionName`, which is what Kotlin passes here.
|
/// `versionName`, which is what Kotlin passes here.
|
||||||
///
|
///
|
||||||
/// Called once from `ThoughtSyncApplication.onCreate`, before anything can sync.
|
/// Called once from `InkwellApplication.onCreate`, before anything can sync.
|
||||||
#[uniffi::export]
|
#[uniffi::export]
|
||||||
pub fn set_client_agent(name: String, version: String) {
|
pub fn set_client_agent(name: String, version: String) {
|
||||||
compat::set_client_agent(&name, &version);
|
compat::set_client_agent(&name, &version);
|
||||||
@@ -620,7 +620,7 @@ pub fn body_tags(body: String) -> Vec<BodyTag> {
|
|||||||
|
|
||||||
/// Helpers, deliberately NOT exported — uniffi only binds what an `#[uniffi::export]`
|
/// Helpers, deliberately NOT exported — uniffi only binds what an `#[uniffi::export]`
|
||||||
/// block names, so these stay Rust-side.
|
/// block names, so these stay Rust-side.
|
||||||
impl ThoughtSync {
|
impl Inkwell {
|
||||||
/// Apply a `{text}` or `{checked}` patch to one checklist item.
|
/// Apply a `{text}` or `{checked}` patch to one checklist item.
|
||||||
///
|
///
|
||||||
/// The two public setters differ only in the key they write, and the lock +
|
/// The two public setters differ only in the key they write, and the lock +
|
||||||
@@ -701,7 +701,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn creates_a_store_and_round_trips_a_note() {
|
fn creates_a_store_and_round_trips_a_note() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
|
|
||||||
let created = app
|
let created = app
|
||||||
.create_note(draft("Groceries\nmilk"))
|
.create_note(draft("Groceries\nmilk"))
|
||||||
@@ -723,7 +723,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn a_note_is_named_by_its_first_line() {
|
fn a_note_is_named_by_its_first_line() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
|
|
||||||
let created = app
|
let created = app
|
||||||
.create_note(draft("just a thought"))
|
.create_note(draft("just a thought"))
|
||||||
@@ -738,7 +738,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn a_note_with_only_items_is_named_by_its_first_item() {
|
fn a_note_with_only_items_is_named_by_its_first_item() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
|
|
||||||
let created = app
|
let created = app
|
||||||
.create_note(NoteDraft {
|
.create_note(NoteDraft {
|
||||||
@@ -757,7 +757,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn syncing_unlinked_reports_not_linked() {
|
fn syncing_unlinked_reports_not_linked() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
|
|
||||||
let status = app.sync_status().expect("status should read");
|
let status = app.sync_status().expect("status should read");
|
||||||
assert!(!status.linked);
|
assert!(!status.linked);
|
||||||
@@ -774,7 +774,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn checklist_items_can_be_added_ticked_retitled_and_removed() {
|
fn checklist_items_can_be_added_ticked_retitled_and_removed() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
let note = app
|
let note = app
|
||||||
.create_note(NoteDraft {
|
.create_note(NoteDraft {
|
||||||
body: "Packing".to_string(),
|
body: "Packing".to_string(),
|
||||||
@@ -828,7 +828,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn setting_labels_leaves_tag_derived_ones_alone() {
|
fn setting_labels_leaves_tag_derived_ones_alone() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
|
|
||||||
let note = app
|
let note = app
|
||||||
.create_note(draft("Trip\nbook the ferry #travel"))
|
.create_note(draft("Trip\nbook the ferry #travel"))
|
||||||
@@ -869,7 +869,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn deleting_forever_removes_the_note() {
|
fn deleting_forever_removes_the_note() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
let note = app.create_note(draft("Ephemeral\nbody")).expect("create");
|
let note = app.create_note(draft("Ephemeral\nbody")).expect("create");
|
||||||
|
|
||||||
app.delete_note_forever(note.id.clone())
|
app.delete_note_forever(note.id.clone())
|
||||||
@@ -886,7 +886,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn reminders_can_be_snoozed_and_completed() {
|
fn reminders_can_be_snoozed_and_completed() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
let note = app.create_note(draft("Call back")).expect("create");
|
let note = app.create_note(draft("Call back")).expect("create");
|
||||||
assert_eq!(note.remind_at, None);
|
assert_eq!(note.remind_at, None);
|
||||||
|
|
||||||
@@ -912,7 +912,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn completing_a_recurring_reminder_moves_it_rather_than_ending_it() {
|
fn completing_a_recurring_reminder_moves_it_rather_than_ending_it() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
let note = app.create_note(draft("Water the plants")).expect("create");
|
let note = app.create_note(draft("Water the plants")).expect("create");
|
||||||
|
|
||||||
let armed = app
|
let armed = app
|
||||||
@@ -974,7 +974,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn renaming_onto_an_existing_tag_merges_into_the_older_one() {
|
fn renaming_onto_an_existing_tag_merges_into_the_older_one() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
|
|
||||||
let older = app.create_label("grocery".to_string()).expect("older");
|
let older = app.create_label("grocery".to_string()).expect("older");
|
||||||
// `created_at` is RFC3339 to the MILLISECOND. Without a gap the two rows can
|
// `created_at` is RFC3339 to the MILLISECOND. Without a gap the two rows can
|
||||||
@@ -1019,7 +1019,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn the_rename_merge_survivor_does_not_depend_on_the_direction() {
|
fn the_rename_merge_survivor_does_not_depend_on_the_direction() {
|
||||||
let dir = scratch_dir();
|
let dir = scratch_dir();
|
||||||
let app = ThoughtSync::new(dir.clone()).expect("a fresh data dir should open");
|
let app = Inkwell::new(dir.clone()).expect("a fresh data dir should open");
|
||||||
|
|
||||||
let older = app.create_label("grocery".to_string()).expect("older");
|
let older = app.create_label("grocery".to_string()).expect("older");
|
||||||
std::thread::sleep(std::time::Duration::from_millis(5));
|
std::thread::sleep(std::time::Duration::from_millis(5));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# Where the generated Kotlin lands. Matches the app's package so the bindings are
|
# Where the generated Kotlin lands. Matches the app's package so the bindings are
|
||||||
# `com.fabledsword.thoughtsync.core.*` rather than something the app has to alias.
|
# `com.fabledsword.inkwell.core.*` rather than something the app has to alias.
|
||||||
[bindings.kotlin]
|
[bindings.kotlin]
|
||||||
package_name = "com.fabledsword.thoughtsync.core"
|
package_name = "com.fabledsword.inkwell.core"
|
||||||
cdylib_name = "inkwell_ffi"
|
cdylib_name = "inkwell_ffi"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ dependencyResolutionManagement {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rootProject.name = "ThoughtSync"
|
rootProject.name = "Inkwell"
|
||||||
|
|
||||||
// `ffi/` sits beside `app/` but is deliberately NOT a Gradle module: it is a Rust
|
// `ffi/` sits beside `app/` but is deliberately NOT a Gradle module: it is a Rust
|
||||||
// crate belonging to the Cargo workspace at the repo root. Gradle reaches it by
|
// crate belonging to the Cargo workspace at the repo root. Gradle reaches it by
|
||||||
|
|||||||
+8
-7
@@ -1,4 +1,4 @@
|
|||||||
# CI Requirements — ThoughtSync
|
# CI Requirements — Inkwell
|
||||||
|
|
||||||
> Spec lives in [`docs/process.md`](https://git.fabledsword.com/bvandeusen/CI-runner/src/branch/main/docs/process.md)
|
> Spec lives in [`docs/process.md`](https://git.fabledsword.com/bvandeusen/CI-runner/src/branch/main/docs/process.md)
|
||||||
> in the CI-Runner repo.
|
> in the CI-Runner repo.
|
||||||
@@ -39,7 +39,7 @@ entirely on `ci-python:3.14`.
|
|||||||
install` cold cost is a non-blocker.
|
install` cold cost is a non-blocker.
|
||||||
- Build gates on `typecheck` + `lint` only. The `test` job runs in parallel for
|
- Build gates on `typecheck` + `lint` only. The `test` job runs in parallel for
|
||||||
visibility but does not block the dev image push. DB-backed / integration tests
|
visibility but does not block the dev image push. DB-backed / integration tests
|
||||||
run against the dev image manually — ThoughtSync's unit tests are DB-free (no
|
run against the dev image manually — Inkwell's unit tests are DB-free (no
|
||||||
Postgres service lane in CI yet).
|
Postgres service lane in CI yet).
|
||||||
- `dev` push -> `:dev` + `:<sha>`; `v*` tag -> `:latest` + `:<version>` + `:<sha>`
|
- `dev` push -> `:dev` + `:<sha>`; `v*` tag -> `:latest` + `:<version>` + `:<sha>`
|
||||||
(family rule 46).
|
(family rule 46).
|
||||||
@@ -87,7 +87,7 @@ parts. Three of them are family rules for a reason:
|
|||||||
`docker ps` by it. A spaced or underscored name breaks the filter.
|
`docker ps` by it. A spaced or underscored name breaks the filter.
|
||||||
- **Service hostnames are not routable** on this runner (rule 79), so the step resolves
|
- **Service hostnames are not routable** on this runner (rule 79), so the step resolves
|
||||||
the Postgres container's bridge IP with `docker ps --filter` + `docker inspect` and
|
the Postgres container's bridge IP with `docker ps --filter` + `docker inspect` and
|
||||||
builds `THOUGHTSYNC_DATABASE_URL` from it. `postgres:5432` will not connect.
|
builds `INKWELL_DATABASE_URL` from it. `postgres:5432` will not connect.
|
||||||
- **`run:` is busybox sh** (rule 81) — no `/dev/tcp` — so the readiness wait is a small
|
- **`run:` is busybox sh** (rule 81) — no `/dev/tcp` — so the readiness wait is a small
|
||||||
Python heredoc. Its terminator must dedent to column 0 after YAML strips the block
|
Python heredoc. Its terminator must dedent to column 0 after YAML strips the block
|
||||||
indent; check with `yaml.safe_load` and print the `run` string if you edit it.
|
indent; check with `yaml.safe_load` and print the `run` string if you edit it.
|
||||||
@@ -205,7 +205,7 @@ backend/frontend push.
|
|||||||
## Android lane — being rebuilt (M12)
|
## Android lane — being rebuilt (M12)
|
||||||
|
|
||||||
The Tauri-mobile Android lane is gone. Android is a native Kotlin/Compose client
|
The Tauri-mobile Android lane is gone. Android is a native Kotlin/Compose client
|
||||||
over the shared `thoughtsync-core` crate instead — see Scribe note 2730 for the
|
over the shared `inkwell-core` crate instead — see Scribe note 2730 for the
|
||||||
decision and milestone M12 for the arc.
|
decision and milestone M12 for the arc.
|
||||||
|
|
||||||
The image it will run on already exists: **`ci-rust-android:1.97`**, repurposed
|
The image it will run on already exists: **`ci-rust-android:1.97`**, repurposed
|
||||||
@@ -218,7 +218,7 @@ second image, and JDK 25 (which requires **Gradle 9.1+** in this repo's wrapper
|
|||||||
the old JDK 17 pin existed only because Tauri generated a Gradle 8.x project).
|
the old JDK 17 pin existed only because Tauri generated a Gradle 8.x project).
|
||||||
|
|
||||||
The Rust pin is in LOCKSTEP with `ci-tauri` and `ci-tauri-win`. All three build
|
The Rust pin is in LOCKSTEP with `ci-tauri` and `ci-tauri-win`. All three build
|
||||||
`thoughtsync-core` from one workspace `Cargo.lock` under `--locked`, so a
|
`inkwell-core` from one workspace `Cargo.lock` under `--locked`, so a
|
||||||
mismatched Rust minor across the lanes would mean divergent resolution for no
|
mismatched Rust minor across the lanes would mean divergent resolution for no
|
||||||
reason. Bump the three together or not at all.
|
reason. Bump the three together or not at all.
|
||||||
|
|
||||||
@@ -333,8 +333,9 @@ differs from CI is worse than none.
|
|||||||
|
|
||||||
**This reproduces CI exactly, not approximately.** On the 2026-08-18 run the
|
**This reproduces CI exactly, not approximately.** On the 2026-08-18 run the
|
||||||
local test binary hashes (`thoughtsync_core-bbaae79723888ad1`,
|
local test binary hashes (`thoughtsync_core-bbaae79723888ad1`,
|
||||||
`thoughtsync_desktop_lib-9d162263f8d0aca3`, `thoughtsync_ffi-fc557b96dc795e27`)
|
`thoughtsync_desktop_lib-9d162263f8d0aca3`, `thoughtsync_ffi-fc557b96dc795e27`,
|
||||||
matched CI run 3931's byte for byte. Same image, same lockfile, same units.
|
named for the crates as they were before the rename to Inkwell) matched CI run
|
||||||
|
3931's byte for byte. Same image, same lockfile, same units.
|
||||||
|
|
||||||
`target/` persists on the host between runs, so after the first cold build these
|
`target/` persists on the host between runs, so after the first cold build these
|
||||||
take seconds (~30s for clippy). It is gitignored and reaches ~1.4 GB; delete it
|
take seconds (~30s for clippy). It is gitignored and reaches ~1.4 GB; delete it
|
||||||
|
|||||||
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
# ThoughtSync desktop (Tauri v2)
|
# Inkwell desktop (Tauri v2)
|
||||||
|
|
||||||
Local-first desktop client. The window loads the shared **Vue 3 frontend** from
|
Local-first desktop client. The window loads the shared **Vue 3 frontend** from
|
||||||
`../frontend`; the Rust core (`src-tauri`) owns the on-device store and the opt-in
|
`../frontend`; the Rust core (`src-tauri`) owns the on-device store and the opt-in
|
||||||
sync engine (built out across the M10 milestone). Works fully offline; optionally
|
sync engine (built out across the M10 milestone). Works fully offline; optionally
|
||||||
syncs to a self-hosted ThoughtSync server.
|
syncs to a self-hosted Inkwell server.
|
||||||
|
|
||||||
## Layout
|
## Layout
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# ThoughtSync desktop — Arch package
|
# Inkwell desktop — Arch package
|
||||||
|
|
||||||
A **prebuilt** native pacman package, published as an asset on every ThoughtSync
|
A **prebuilt** native pacman package, published as an asset on every Inkwell
|
||||||
release. Nothing to compile, no toolchain to install.
|
release. Nothing to compile, no toolchain to install.
|
||||||
|
|
||||||
Installing natively on Arch matters for more than tidiness: pacman pulls
|
Installing natively on Arch matters for more than tidiness: pacman pulls
|
||||||
@@ -15,22 +15,22 @@ Easiest — the one-command installer picks this package automatically on any
|
|||||||
pacman system:
|
pacman system:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://git.fabledsword.com/bvandeusen/thoughtsync/raw/branch/dev/desktop/packaging/install.sh | sh
|
curl -fsSL https://git.fabledsword.com/bvandeusen/inkwell/raw/branch/dev/desktop/packaging/install.sh | sh
|
||||||
```
|
```
|
||||||
|
|
||||||
That installs the newest build from `main`. To follow the rolling development
|
That installs the newest build from `main`. To follow the rolling development
|
||||||
channel instead, pass the flag through the pipe:
|
channel instead, pass the flag through the pipe:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
curl -fsSL https://git.fabledsword.com/bvandeusen/thoughtsync/raw/branch/dev/desktop/packaging/install.sh | sh -s -- --channel dev
|
curl -fsSL https://git.fabledsword.com/bvandeusen/inkwell/raw/branch/dev/desktop/packaging/install.sh | sh -s -- --channel dev
|
||||||
```
|
```
|
||||||
|
|
||||||
Or grab the `.pkg.tar.*` from the
|
Or grab the `.pkg.tar.*` from the
|
||||||
[releases page](https://git.fabledsword.com/bvandeusen/thoughtsync/releases)
|
[releases page](https://git.fabledsword.com/bvandeusen/inkwell/releases)
|
||||||
and install it directly:
|
and install it directly:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
sudo pacman -U thoughtsync-*-x86_64.pkg.tar.*
|
sudo pacman -U inkwell-*-x86_64.pkg.tar.*
|
||||||
```
|
```
|
||||||
|
|
||||||
The compression suffix depends on what the build image provides — `.zst` when
|
The compression suffix depends on what the build image provides — `.zst` when
|
||||||
@@ -39,17 +39,18 @@ all of them; only the filename differs.
|
|||||||
|
|
||||||
Either way you get:
|
Either way you get:
|
||||||
|
|
||||||
- `/usr/bin/thoughtsync` — the app
|
- `/usr/bin/inkwell` — the app
|
||||||
- `/usr/share/applications/thoughtsync.desktop` — the menu entry
|
- `/usr/share/applications/inkwell.desktop` — the menu entry
|
||||||
- `/usr/share/icons/hicolor/*/apps/thoughtsync.png` — themed icons
|
- `/usr/share/icons/hicolor/*/apps/inkwell.png` — themed icons
|
||||||
|
|
||||||
Launch **ThoughtSync** from your app menu, or run `thoughtsync`.
|
Launch **Inkwell** from your app menu, or run `inkwell`.
|
||||||
|
|
||||||
Uninstall: `sudo pacman -R thoughtsync`.
|
Uninstall: `sudo pacman -R inkwell`.
|
||||||
|
|
||||||
The package was called `thoughtsync-desktop` before; it declares `replaces`/
|
The package was called `thoughtsync` until the app was renamed Inkwell, and
|
||||||
`conflicts` on that name, so an upgrade from it is a normal `pacman -U` and
|
`thoughtsync-desktop` before that. It declares `replaces`/`conflicts` on both
|
||||||
leaves nothing behind.
|
names, so an upgrade from either is a normal `pacman -U` and leaves nothing
|
||||||
|
behind.
|
||||||
|
|
||||||
## How the package is built
|
## How the package is built
|
||||||
|
|
||||||
|
|||||||
@@ -72,8 +72,8 @@ ASSETS=(
|
|||||||
"$BUNDLE_ROOT"/arch/*.pkg.tar.*
|
"$BUNDLE_ROOT"/arch/*.pkg.tar.*
|
||||||
"$WIN_BUNDLE_ROOT"/nsis/*.exe
|
"$WIN_BUNDLE_ROOT"/nsis/*.exe
|
||||||
"$WIN_BUNDLE_ROOT"/nsis/*.exe.sig
|
"$WIN_BUNDLE_ROOT"/nsis/*.exe.sig
|
||||||
"$REPO_ROOT"/android/dist/thoughtsync.apk
|
"$REPO_ROOT"/android/dist/inkwell.apk
|
||||||
"$REPO_ROOT"/android/dist/thoughtsync-android.json
|
"$REPO_ROOT"/android/dist/inkwell-android.json
|
||||||
)
|
)
|
||||||
# nullglob drops PATTERNS that match nothing — it does nothing for a path with no
|
# nullglob drops PATTERNS that match nothing — it does nothing for a path with no
|
||||||
# wildcard in it, which stays in the array as a literal and reaches curl as a file
|
# wildcard in it, which stays in the array as a literal and reaches curl as a file
|
||||||
@@ -149,7 +149,7 @@ fi
|
|||||||
echo "==> Creating release for $TAG"
|
echo "==> Creating release for $TAG"
|
||||||
BODY=$(cat <<JSON
|
BODY=$(cat <<JSON
|
||||||
{"tag_name":"$TAG","name":"Inkwell $CHANNEL_LABEL","draft":false,"prerelease":$RELEASE_PRERELEASE,
|
{"tag_name":"$TAG","name":"Inkwell $CHANNEL_LABEL","draft":false,"prerelease":$RELEASE_PRERELEASE,
|
||||||
"body":"Inkwell $CHANNEL_LABEL.\n\n**Desktop**\n\n- **Debian / Ubuntu** — native \`.deb\`\n- **Arch / CachyOS** — native \`.pkg.tar.*\`\n- **everything else** — \`.AppImage\` (de-bundled graphics: renders on any GPU/Wayland setup)\n\nInstall / update — picks the right one for your system:\n\`\`\`\ncurl -fsSL $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/raw/branch/dev/desktop/packaging/install.sh | $INSTALL_TAIL\n\`\`\`\n\n**Android** — \`thoughtsync.apk\`. Copy it and \`thoughtsync-android.json\` into your server's \`/var/inkwell/client/\` and the server will offer it to your devices; see docs/android-distribution.md.$CHANNEL_NOTE"}
|
"body":"Inkwell $CHANNEL_LABEL.\n\n**Desktop**\n\n- **Debian / Ubuntu** — native \`.deb\`\n- **Arch / CachyOS** — native \`.pkg.tar.*\`\n- **everything else** — \`.AppImage\` (de-bundled graphics: renders on any GPU/Wayland setup)\n\nInstall / update — picks the right one for your system:\n\`\`\`\ncurl -fsSL $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/raw/branch/dev/desktop/packaging/install.sh | $INSTALL_TAIL\n\`\`\`\n\n**Android** — \`inkwell.apk\`. Copy it and \`inkwell-android.json\` into your server's \`/var/inkwell/client/\` and the server will offer it to your devices; see docs/android-distribution.md.$CHANNEL_NOTE"}
|
||||||
JSON
|
JSON
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ if [ "${PRUNE_OLD_ASSETS:-false}" = "true" ]; then
|
|||||||
# every desktop push regardless. That is exactly what happened on run
|
# every desktop push regardless. That is exactly what happened on run
|
||||||
# 4098, which swept the APK run 4092 had just published.
|
# 4098, which swept the APK run 4092 had just published.
|
||||||
case "$asset_name" in
|
case "$asset_name" in
|
||||||
latest.json|inkwell-desktop.json|thoughtsync.apk|thoughtsync-android.json) continue ;;
|
latest.json|inkwell-desktop.json|inkwell.apk|inkwell-android.json) continue ;;
|
||||||
*"$APP_VERSION"*) continue ;;
|
*"$APP_VERSION"*) continue ;;
|
||||||
esac
|
esac
|
||||||
echo " removing $asset_name"
|
echo " removing $asset_name"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Getting the Android app onto your server
|
# Getting the Android app onto your server
|
||||||
|
|
||||||
ThoughtSync's server hands out the Android client it syncs with. Once an APK is in
|
Inkwell's server hands out the Android client it syncs with. Once an APK is in
|
||||||
place, anyone with an account on that server can download it from **Account →
|
place, anyone with an account on that server can download it from **Account →
|
||||||
Linked devices**, and linked phones can update themselves from it.
|
Linked devices**, and linked phones can update themselves from it.
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ pinning.
|
|||||||
## Overriding it
|
## Overriding it
|
||||||
|
|
||||||
If you want a specific build — testing something, or holding back — drop it in
|
If you want a specific build — testing something, or holding back — drop it in
|
||||||
`/var/thoughtsync/client/` and it wins over the image's copy.
|
`/var/inkwell/client/` and it wins over the image's copy.
|
||||||
|
|
||||||
That directory is shared with the desktop clients the server hands out, and
|
That directory is shared with the desktop clients the server hands out, and
|
||||||
**precedence is decided per platform**: dropping in an APK overrides the baked APK
|
**precedence is decided per platform**: dropping in an APK overrides the baked APK
|
||||||
@@ -44,14 +44,14 @@ Two files, both required:
|
|||||||
|
|
||||||
| File | What it is |
|
| File | What it is |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `thoughtsync.apk` | the client |
|
| `inkwell.apk` | the client |
|
||||||
| `thoughtsync-android.json` | `{version_name, version_code, size, sha256}` |
|
| `inkwell-android.json` | `{version_name, version_code, size, sha256}` |
|
||||||
|
|
||||||
The sidecar exists because an APK keeps its version in a binary manifest that
|
The sidecar exists because an APK keeps its version in a binary manifest that
|
||||||
needs the Android build tools to read. CI writes it beside the APK, where the
|
needs the Android build tools to read. CI writes it beside the APK, where the
|
||||||
real values are already known.
|
real values are already known.
|
||||||
|
|
||||||
`/var/thoughtsync` is the same volume that holds attachments (`Config.DATA_DIR`),
|
`/var/inkwell` is the same volume that holds attachments (`Config.DATA_DIR`),
|
||||||
so a build dropped there survives container recreation — and survives an image
|
so a build dropped there survives container recreation — and survives an image
|
||||||
upgrade, which is the point of an override.
|
upgrade, which is the point of an override.
|
||||||
|
|
||||||
@@ -59,10 +59,10 @@ Both files are published to the rolling dev-channel release (tag `dev-rolling`)
|
|||||||
on every green Android build:
|
on every green Android build:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
REPO=https://git.fabledsword.com/bvandeusen/thoughtsync
|
REPO=https://git.fabledsword.com/bvandeusen/inkwell
|
||||||
TOKEN=... # a Fabled-Git token with read access; the instance is private
|
TOKEN=... # a Fabled-Git token with read access; the instance is private
|
||||||
|
|
||||||
for f in thoughtsync.apk thoughtsync-android.json; do
|
for f in inkwell.apk inkwell-android.json; do
|
||||||
curl -fsSL -H "Authorization: token $TOKEN" \
|
curl -fsSL -H "Authorization: token $TOKEN" \
|
||||||
-o "/tmp/$f" "$REPO/releases/download/dev-rolling/$f"
|
-o "/tmp/$f" "$REPO/releases/download/dev-rolling/$f"
|
||||||
done
|
done
|
||||||
@@ -70,8 +70,8 @@ done
|
|||||||
# Copy the sidecar LAST. A sidecar that does not match the APK beside it is not a
|
# Copy the sidecar LAST. A sidecar that does not match the APK beside it is not a
|
||||||
# client, so a half-finished copy falls back to the image's build rather than
|
# client, so a half-finished copy falls back to the image's build rather than
|
||||||
# advertising a lie.
|
# advertising a lie.
|
||||||
docker compose cp /tmp/thoughtsync.apk app:/var/thoughtsync/client/
|
docker compose cp /tmp/inkwell.apk app:/var/inkwell/client/
|
||||||
docker compose cp /tmp/thoughtsync-android.json app:/var/thoughtsync/client/
|
docker compose cp /tmp/inkwell-android.json app:/var/inkwell/client/
|
||||||
```
|
```
|
||||||
|
|
||||||
To go back to whatever the image ships, delete both files.
|
To go back to whatever the image ships, delete both files.
|
||||||
@@ -88,7 +88,7 @@ offering a button that fails.
|
|||||||
|
|
||||||
## What happens if you get it wrong
|
## What happens if you get it wrong
|
||||||
|
|
||||||
All of these describe an override in `/var/thoughtsync/client/`. A broken
|
All of these describe an override in `/var/inkwell/client/`. A broken
|
||||||
override does not take the feature away — it falls through to the build the image
|
override does not take the feature away — it falls through to the build the image
|
||||||
shipped with, which is the whole reason precedence runs in that direction.
|
shipped with, which is the whole reason precedence runs in that direction.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# Putting ThoughtSync on the public internet
|
# Putting Inkwell on the public internet
|
||||||
|
|
||||||
ThoughtSync is built to run on a LAN and works fine there with no ceremony. Exposing
|
Inkwell is built to run on a LAN and works fine there with no ceremony. Exposing
|
||||||
it changes the threat model: anyone can now reach the login form, and any account is
|
it changes the threat model: anyone can now reach the login form, and any account is
|
||||||
one guessed password away from someone's whole note history.
|
one guessed password away from someone's whole note history.
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ Which fix depends on where your proxy runs:
|
|||||||
the `ports:` block from `docker-compose.yml`. The proxy reaches the app over the
|
the `ports:` block from `docker-compose.yml`. The proxy reaches the app over the
|
||||||
compose network; no published port is needed at all, and this is the safest of the
|
compose network; no published port is needed at all, and this is the safest of the
|
||||||
two because there is no host port to reach even from the host.
|
two because there is no host port to reach even from the host.
|
||||||
- **Proxy on the host**: set `THOUGHTSYNC_BIND=127.0.0.1` in `.env`, so the port
|
- **Proxy on the host**: set `INKWELL_BIND=127.0.0.1` in `.env`, so the port
|
||||||
exists but only the host itself can use it.
|
exists but only the host itself can use it.
|
||||||
|
|
||||||
To check which you have: `docker compose ps` shows the published ports, and
|
To check which you have: `docker compose ps` shows the published ports, and
|
||||||
@@ -73,12 +73,12 @@ To check which you have: `docker compose ps` shows the published ports, and
|
|||||||
app is still answering around the proxy. It should not be.
|
app is still answering around the proxy. It should not be.
|
||||||
|
|
||||||
**5. Have a backup that includes the files.** Attachments are files on the
|
**5. Have a backup that includes the files.** Attachments are files on the
|
||||||
`thoughtsync-data` volume, not rows — a `pg_dump` restores notes whose images are all
|
`inkwell-data` volume, not rows — a `pg_dump` restores notes whose images are all
|
||||||
gone. Back up both:
|
gone. Back up both:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker compose exec -T db pg_dump -U thoughtsync thoughtsync > notes.sql
|
docker compose exec -T db pg_dump -U inkwell inkwell > notes.sql
|
||||||
docker run --rm -v thoughtsync-data:/d -v "$PWD":/out alpine tar czf /out/media.tgz -C /d .
|
docker run --rm -v inkwell-data:/d -v "$PWD":/out alpine tar czf /out/media.tgz -C /d .
|
||||||
```
|
```
|
||||||
|
|
||||||
## What the app already does
|
## What the app already does
|
||||||
@@ -132,7 +132,7 @@ know. They are the reason not to hand out open registration to strangers.
|
|||||||
|
|
||||||
The app allows plain HTTP so a self-hosted server on a LAN is usable at all — Android
|
The app allows plain HTTP so a self-hosted server on a LAN is usable at all — Android
|
||||||
blocks cleartext by default from API 28, and `http://192.168.1.10:8000` is exactly the
|
blocks cleartext by default from API 28, and `http://192.168.1.10:8000` is exactly the
|
||||||
case ThoughtSync is built for. Over the public internet, link the phone to the
|
case Inkwell is built for. Over the public internet, link the phone to the
|
||||||
**HTTPS** hostname. The sync screen shows a warning before any credential field
|
**HTTPS** hostname. The sync screen shows a warning before any credential field
|
||||||
whenever the address it probed was `http://`; on a public network that warning means
|
whenever the address it probed was `http://`; on a public network that warning means
|
||||||
what it says.
|
what it says.
|
||||||
|
|||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
# ThoughtSync sync protocol
|
# Inkwell sync protocol
|
||||||
|
|
||||||
The contract the local-first native clients (Tauri desktop, Android) implement
|
The contract the local-first native clients (Tauri desktop, Android) implement
|
||||||
against. The server is the **sync hub**: each client keeps a full local store
|
against. The server is the **sync hub**: each client keeps a full local store
|
||||||
@@ -38,8 +38,8 @@ token, or even has an account:
|
|||||||
```
|
```
|
||||||
|
|
||||||
The client identifies itself on every request with
|
The client identifies itself on every request with
|
||||||
`X-ThoughtSync-Client: thoughtsync-desktop/<app version>` and
|
`X-Inkwell-Client: inkwell-desktop/<app version>` and
|
||||||
`X-ThoughtSync-Protocol: <n>`.
|
`X-Inkwell-Protocol: <n>`.
|
||||||
|
|
||||||
### `sync_features` — why versions alone aren't enough
|
### `sync_features` — why versions alone aren't enough
|
||||||
|
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "thoughtsync-frontend",
|
"name": "inkwell-frontend",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "thoughtsync-frontend",
|
"name": "inkwell-frontend",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pinia": "^2.2.0",
|
"pinia": "^2.2.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "thoughtsync-frontend",
|
"name": "inkwell-frontend",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
// and avoid deploy staleness, this SW does NOT cache the app shell, hashed build
|
// and avoid deploy staleness, this SW does NOT cache the app shell, hashed build
|
||||||
// assets, or any /api response — everything but the offline fallback goes
|
// assets, or any /api response — everything but the offline fallback goes
|
||||||
// straight to the network.
|
// straight to the network.
|
||||||
const CACHE = "thoughtsync-shell-v1";
|
const CACHE = "inkwell-shell-v1";
|
||||||
const OFFLINE_URL = "/offline.html";
|
const OFFLINE_URL = "/offline.html";
|
||||||
|
|
||||||
self.addEventListener("install", (event) => {
|
self.addEventListener("install", (event) => {
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ echo "==> Collecting the $channel clients"
|
|||||||
# Its sidecar is published whole by the Android lane — an APK keeps its version in
|
# Its sidecar is published whole by the Android lane — an APK keeps its version in
|
||||||
# a binary AXML manifest, so the values are recorded where they were already known.
|
# a binary AXML manifest, so the values are recorded where they were already known.
|
||||||
# Copied verbatim rather than rebuilt here.
|
# Copied verbatim rather than rebuilt here.
|
||||||
if fetch "$BASE/thoughtsync.apk" "$dest/inkwell.apk" &&
|
if fetch "$BASE/inkwell.apk" "$dest/inkwell.apk" &&
|
||||||
fetch "$BASE/thoughtsync-android.json" "$dest/inkwell-android.json"; then
|
fetch "$BASE/inkwell-android.json" "$dest/inkwell-android.json"; then
|
||||||
echo " android $(field "$dest/inkwell-android.json" version_name)"
|
echo " android $(field "$dest/inkwell-android.json" version_name)"
|
||||||
else
|
else
|
||||||
# Both or neither. Half a pair is worse than none: the server would read a
|
# Both or neither. Half a pair is worse than none: the server would read a
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ published_for() {
|
|||||||
| sed -E 's/.*"([^"]+)"$/\1/'; } || true
|
| sed -E 's/.*"([^"]+)"$/\1/'; } || true
|
||||||
;;
|
;;
|
||||||
android)
|
android)
|
||||||
{ fetch "$SERVER/$REPO/releases/download/$_tag/thoughtsync-android.json" \
|
{ fetch "$SERVER/$REPO/releases/download/$_tag/inkwell-android.json" \
|
||||||
| grep -oE '"version_code"[[:space:]]*:[[:space:]]*[0-9]+' | head -1 \
|
| grep -oE '"version_code"[[:space:]]*:[[:space:]]*[0-9]+' | head -1 \
|
||||||
| grep -oE '[0-9]+$'; } || true
|
| grep -oE '[0-9]+$'; } || true
|
||||||
;;
|
;;
|
||||||
@@ -126,7 +126,7 @@ published_name() {
|
|||||||
case "$1" in
|
case "$1" in
|
||||||
desktop) published_for desktop "$2" ;;
|
desktop) published_for desktop "$2" ;;
|
||||||
android)
|
android)
|
||||||
{ fetch "$SERVER/$REPO/releases/download/$_tag/thoughtsync-android.json" \
|
{ fetch "$SERVER/$REPO/releases/download/$_tag/inkwell-android.json" \
|
||||||
| grep -oE '"version_name"[[:space:]]*:[[:space:]]*"[^"]+"' | head -1 \
|
| grep -oE '"version_name"[[:space:]]*:[[:space:]]*"[^"]+"' | head -1 \
|
||||||
| sed -E 's/.*"([^"]+)"$/\1/'; } || true
|
| sed -E 's/.*"([^"]+)"$/\1/'; } || true
|
||||||
;;
|
;;
|
||||||
|
|||||||
Reference in New Issue
Block a user