Compare commits
50 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1f3c7975eb | |||
| 30024ca977 | |||
| dd01603ad0 | |||
| 954dc2caae | |||
| fed0e8200e | |||
| 62123582f5 | |||
| 7ae35920f8 | |||
| f04dd3da1a | |||
| facd72db16 | |||
| 6c9de115e9 | |||
| 8818576ee8 | |||
| 3d042c673e | |||
| 05e4689339 | |||
| 2c04f4bfb6 | |||
| 1a946d5c26 | |||
| 13b6b4bfce | |||
| 8a7dc8d3dc | |||
| 981cf10048 | |||
| 3ec6ed2329 | |||
| 4963282620 | |||
| 8aa37bde34 | |||
| 92cc2e6232 | |||
| 841cb9aaec | |||
| 538b28e5d2 | |||
| 1b439e9499 | |||
| e4c62f2b56 | |||
| 08459ad29d | |||
| 64b974a7a6 | |||
| 6a65175154 | |||
| fa768ef17f | |||
| a47bd6badd | |||
| d80f6d50fa | |||
| 071be44851 | |||
| f17ae7751c | |||
| 3de01bd948 | |||
| 2884ddd3c7 | |||
| 0763047d02 | |||
| 06e2ad29c9 | |||
| bec3493e37 | |||
| e054e280dc | |||
| 85a75ac3b7 | |||
| 4d99e1a840 | |||
| 831730e308 | |||
| 50edb5ff75 | |||
| 9b0ef1fc40 | |||
| b906161d70 | |||
| 654ed1fe68 | |||
| bbd8d3580f | |||
| f968f64de8 | |||
| a575f01207 |
119 changed files with 14664 additions and 3001 deletions
|
|
@ -1,19 +1,32 @@
|
||||||
# Release automation for git.comunes.org (Forgejo Actions).
|
# Release automation for git.comunes.org (Forgejo Actions).
|
||||||
#
|
#
|
||||||
# Password-free: pushing a tag `v*` builds a signed AAB + per-ABI APKs, uploads
|
# Pushing a tag `v*` runs two independent jobs:
|
||||||
# the AAB to Google Play's internal track via fastlane, and attaches the signed
|
# play - build the signed AAB and ship it to Google Play (production, 100%).
|
||||||
# per-ABI APKs to the Forgejo release (the reference binaries F-Droid verifies
|
# fdroid_reference- build the per-ABI reference APKs the SAME way F-Droid will
|
||||||
# for reproducible, developer-signed publishing). All credentials come from repo
|
# (fdroid build inside the fdroidserver buildserver image),
|
||||||
# secrets (Settings > Actions > Secrets), never typed:
|
# sign them with the tane-upload key, and attach them to the
|
||||||
|
# Forgejo release. F-Droid re-runs `fdroid build` on the same
|
||||||
|
# commit+recipe+image, gets byte-identical output, verifies our
|
||||||
|
# signature (AllowedAPKSigningKeys) and publishes OUR APK — so
|
||||||
|
# F-Droid and Play share the same signing key.
|
||||||
|
#
|
||||||
|
# All credentials come from repo secrets (Settings > Actions > Secrets):
|
||||||
# TANE_KEYSTORE_BASE64 base64 of the dedicated tane-upload.jks
|
# TANE_KEYSTORE_BASE64 base64 of the dedicated tane-upload.jks
|
||||||
# TANE_KEYSTORE_PASSWORD store password
|
# TANE_KEYSTORE_PASSWORD store password
|
||||||
# TANE_KEY_ALIAS tane-upload
|
# TANE_KEY_ALIAS tane-upload
|
||||||
# TANE_KEY_PASSWORD key password
|
# TANE_KEY_PASSWORD key password
|
||||||
# SUPPLY_JSON_KEY_DATA Google Play service-account JSON (reused from Ğ1nkgo)
|
# SUPPLY_JSON_KEY_DATA Google Play service-account JSON
|
||||||
#
|
#
|
||||||
# Build + deploy live in ONE job so the AAB never has to cross a job boundary.
|
# NOTE: `runs-on` must match a label your Forgejo runner registered with.
|
||||||
# NOTE: `runs-on` must match a label your Forgejo runner registered with; adjust
|
# fdroid_reference is 3 separate jobs chained with `needs:` (armeabi-v7a ->
|
||||||
# if the Comunes runner uses something other than `docker`.
|
# arm64-v8a -> x86_64), NOT a matrix: this runner's act_runner does not honor
|
||||||
|
# `strategy.max-parallel`, so a matrix always ran all 3 concurrently — 2-3
|
||||||
|
# simultaneous cold NDK/CMake/Gradle builds contend for RAM and get OOM-killed
|
||||||
|
# (silent "Gradle build daemon disappeared", no error message). `needs:` is
|
||||||
|
# core Actions syntax with no such gap, so it actually serializes them. Each
|
||||||
|
# needs its own full cold NDK+tesseract-native+flutter compile (~30-35min
|
||||||
|
# alone), which is why they're chained rather than run in one job (that alone
|
||||||
|
# was too slow even for a 90m timeout).
|
||||||
|
|
||||||
name: release
|
name: release
|
||||||
|
|
||||||
|
|
@ -21,9 +34,89 @@ on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
# Manual trigger to test the fdroid_reference job on a branch without cutting a
|
||||||
|
# tag or deploying to Play (the play job below is guarded to tags only).
|
||||||
|
# Pass ref_tag (e.g. v0.1.10) to rebuild the reference APKs for an EXISTING
|
||||||
|
# release and re-upload them (idempotently), without cutting a new tag — used
|
||||||
|
# to iterate on build-reproducibility fixes without re-deploying to Play.
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
ref_tag:
|
||||||
|
description: 'Existing tag to rebuild+re-upload reference APKs for (e.g. v0.1.10). Empty = build-only, no upload.'
|
||||||
|
required: false
|
||||||
|
default: ''
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
android:
|
# Test gate. Forgejo/Actions workflows are independent — there is no cross-workflow
|
||||||
|
# `needs:`, and ci.yml does NOT trigger on tag pushes (its `branches` filter never
|
||||||
|
# matches refs/tags/*). So the CI test jobs are duplicated here (verbatim from
|
||||||
|
# ci.yml) to gate the deploy: nothing ships unless analyze + both test suites pass.
|
||||||
|
# Keep these in sync with ci.yml by hand.
|
||||||
|
analyze:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: ghcr.io/cirruslabs/flutter:3.41.9
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
git init -q .
|
||||||
|
git remote add origin "http://x-access-token:${TOKEN}@forgejo:3000/${GITHUB_REPOSITORY}.git"
|
||||||
|
git fetch -q --depth 1 origin "${GITHUB_SHA}"
|
||||||
|
git checkout -q FETCH_HEAD
|
||||||
|
- run: flutter pub get
|
||||||
|
- run: flutter analyze
|
||||||
|
|
||||||
|
test-commons-core:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: ghcr.io/cirruslabs/flutter:3.41.9
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
git init -q .
|
||||||
|
git remote add origin "http://x-access-token:${TOKEN}@forgejo:3000/${GITHUB_REPOSITORY}.git"
|
||||||
|
git fetch -q --depth 1 origin "${GITHUB_SHA}"
|
||||||
|
git checkout -q FETCH_HEAD
|
||||||
|
- run: flutter pub get
|
||||||
|
- name: dart test
|
||||||
|
working-directory: packages/commons_core
|
||||||
|
run: dart test
|
||||||
|
|
||||||
|
test-app-seeds:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: ghcr.io/cirruslabs/flutter:3.41.9
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
git init -q .
|
||||||
|
git remote add origin "http://x-access-token:${TOKEN}@forgejo:3000/${GITHUB_REPOSITORY}.git"
|
||||||
|
git fetch -q --depth 1 origin "${GITHUB_SHA}"
|
||||||
|
git checkout -q FETCH_HEAD
|
||||||
|
# SQLCipher so the "no plaintext at rest" security test actually runs.
|
||||||
|
- run: apt-get update -qq && apt-get install -y -qq libsqlcipher-dev
|
||||||
|
- run: flutter pub get
|
||||||
|
- name: Generate code + test
|
||||||
|
working-directory: apps/app_seeds
|
||||||
|
run: |
|
||||||
|
dart run slang
|
||||||
|
dart run build_runner build --delete-conflicting-outputs
|
||||||
|
flutter test --coverage
|
||||||
|
|
||||||
|
play:
|
||||||
|
# Gate on the tests: with no status-check function in this `if`, the implicit
|
||||||
|
# success() on `needs` still applies — play runs only on a tag AND green tests.
|
||||||
|
needs: [analyze, test-commons-core, test-app-seeds]
|
||||||
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
container:
|
container:
|
||||||
image: ghcr.io/cirruslabs/flutter:3.41.9
|
image: ghcr.io/cirruslabs/flutter:3.41.9
|
||||||
|
|
@ -44,6 +137,13 @@ jobs:
|
||||||
working-directory: apps/app_seeds
|
working-directory: apps/app_seeds
|
||||||
run: |
|
run: |
|
||||||
flutter pub get
|
flutter pub get
|
||||||
|
# Same two hardenings the fdroid recipe applies (this job builds the AAB
|
||||||
|
# directly, not via the recipe, so a cold cache is still exposed):
|
||||||
|
# 1) strip flutter_tesseract_ocr's dead-jcenter buildscript (AGP 7.1.2) so
|
||||||
|
# it inherits the app's AGP instead of hitting jcenter.bintray.com;
|
||||||
|
# 2) cap the Gradle heap so the build fits the shared CI host's RAM.
|
||||||
|
find "${PUB_CACHE:-$HOME/.pub-cache}" -path '*flutter_tesseract_ocr-*/android/build.gradle' -exec sed -i '/^buildscript {/,/^}/d' {} +
|
||||||
|
printf 'org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g\norg.gradle.daemon=false\n' >> android/gradle.properties
|
||||||
dart run slang
|
dart run slang
|
||||||
dart run build_runner build --delete-conflicting-outputs
|
dart run build_runner build --delete-conflicting-outputs
|
||||||
|
|
||||||
|
|
@ -63,33 +163,9 @@ jobs:
|
||||||
keyPassword=$TANE_KEY_PASSWORD
|
keyPassword=$TANE_KEY_PASSWORD
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
- name: Build signed AAB + per-ABI APKs
|
- name: Build signed AAB
|
||||||
working-directory: apps/app_seeds
|
working-directory: apps/app_seeds
|
||||||
run: |
|
run: flutter build appbundle --release
|
||||||
flutter build appbundle --release
|
|
||||||
# Per-ABI splits: these are the reference binaries F-Droid rebuilds and
|
|
||||||
# verifies against (see docs/fdroid/org.comunes.tane.yml, binary:).
|
|
||||||
flutter build apk --release --split-per-abi
|
|
||||||
|
|
||||||
- name: Publish signed per-ABI APKs to the Forgejo release
|
|
||||||
working-directory: apps/app_seeds
|
|
||||||
env:
|
|
||||||
TOKEN: ${{ github.token }}
|
|
||||||
run: |
|
|
||||||
apt-get update -qq && apt-get install -y -qq curl jq
|
|
||||||
api="http://forgejo:3000/api/v1/repos/${GITHUB_REPOSITORY}"
|
|
||||||
tag="${GITHUB_REF_NAME}"
|
|
||||||
# Create the release for this tag if it does not exist yet, then get its id.
|
|
||||||
curl -sf -X POST "$api/releases" \
|
|
||||||
-H "Authorization: token ${TOKEN}" -H 'Content-Type: application/json' \
|
|
||||||
-d "{\"tag_name\":\"${tag}\",\"name\":\"${tag}\"}" >/dev/null || true
|
|
||||||
rid=$(curl -sf -H "Authorization: token ${TOKEN}" "$api/releases/tags/${tag}" | jq -r .id)
|
|
||||||
for abi in armeabi-v7a arm64-v8a x86_64; do
|
|
||||||
f="build/app/outputs/flutter-apk/app-${abi}-release.apk"
|
|
||||||
curl -sf -X POST "$api/releases/${rid}/assets?name=app-${abi}-release.apk" \
|
|
||||||
-H "Authorization: token ${TOKEN}" \
|
|
||||||
-F "attachment=@${f};type=application/vnd.android.package-archive"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Install fastlane
|
- name: Install fastlane
|
||||||
working-directory: apps/app_seeds
|
working-directory: apps/app_seeds
|
||||||
|
|
@ -99,7 +175,7 @@ jobs:
|
||||||
gem install bundler --no-document
|
gem install bundler --no-document
|
||||||
bundle install
|
bundle install
|
||||||
|
|
||||||
- name: Publish to Google Play (internal track)
|
- name: Publish to Google Play (production track, 100%)
|
||||||
working-directory: apps/app_seeds
|
working-directory: apps/app_seeds
|
||||||
env:
|
env:
|
||||||
SUPPLY_JSON_KEY_DATA: ${{ secrets.SUPPLY_JSON_KEY_DATA }}
|
SUPPLY_JSON_KEY_DATA: ${{ secrets.SUPPLY_JSON_KEY_DATA }}
|
||||||
|
|
@ -109,3 +185,423 @@ jobs:
|
||||||
if: always()
|
if: always()
|
||||||
working-directory: apps/app_seeds
|
working-directory: apps/app_seeds
|
||||||
run: rm -f android/key.properties "$GITHUB_WORKSPACE/tane-upload.jks"
|
run: rm -f android/key.properties "$GITHUB_WORKSPACE/tane-upload.jks"
|
||||||
|
|
||||||
|
fdroid_reference_armeabi_v7a:
|
||||||
|
# Serialize after play so two heavy Android builds never run concurrently on
|
||||||
|
# the shared host (capacity:2) — that contention OOM-killed play's Gradle
|
||||||
|
# daemon. Gated on the test jobs, but kept INDEPENDENT of play's result:
|
||||||
|
# `!cancelled()` is a status function, which drops the implicit success() on
|
||||||
|
# `needs`, so play failing/skipping (e.g. on workflow_dispatch, where play is
|
||||||
|
# tag-only) does not block the fdroid chain — while the explicit result checks
|
||||||
|
# still hard-gate on green tests. Nothing gets built/uploaded on a red suite.
|
||||||
|
needs: [analyze, test-commons-core, test-app-seeds, play]
|
||||||
|
if: ${{ !cancelled()
|
||||||
|
&& needs.analyze.result == 'success'
|
||||||
|
&& needs.test-commons-core.result == 'success'
|
||||||
|
&& needs.test-app-seeds.result == 'success' }}
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: registry.gitlab.com/fdroid/fdroidserver:buildserver-trixie
|
||||||
|
steps:
|
||||||
|
- name: Build the armeabi-v7a reference APK with fdroid, sign, and attach it
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
TANE_KEYSTORE_BASE64: ${{ secrets.TANE_KEYSTORE_BASE64 }}
|
||||||
|
TANE_KEYSTORE_PASSWORD: ${{ secrets.TANE_KEYSTORE_PASSWORD }}
|
||||||
|
TANE_KEY_ALIAS: ${{ secrets.TANE_KEY_ALIAS }}
|
||||||
|
TANE_KEY_PASSWORD: ${{ secrets.TANE_KEY_PASSWORD }}
|
||||||
|
REF_TAG: ${{ github.event.inputs.ref_tag }}
|
||||||
|
ABI: armeabi-v7a
|
||||||
|
OFFSET: 1
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
# 1) Reproduce F-Droid's build environment (ANDROID_HOME, PATH, NDK...).
|
||||||
|
sh /opt/buildserver/setup-env-vars /opt/android-sdk
|
||||||
|
. /etc/profile.d/bsenv.sh
|
||||||
|
|
||||||
|
# 2) fdroidserver from master, exactly like the fdroiddata CI.
|
||||||
|
fds=/opt/fdroidserver-src
|
||||||
|
mkdir -p "$fds"
|
||||||
|
# Download to a file with retries: a mid-transfer vSwitch blip used to
|
||||||
|
# pipe an empty stream straight into tar ("gzip: unexpected end of
|
||||||
|
# file"). -f fails on HTTP errors; --retry-all-errors covers resets.
|
||||||
|
for a in 1 2 3 4 5; do
|
||||||
|
curl -fsSL --retry 5 --retry-delay 3 --retry-all-errors \
|
||||||
|
https://gitlab.com/fdroid/fdroidserver/-/archive/master/fdroidserver-master.tar.gz \
|
||||||
|
-o /tmp/fds.tgz && tar -tzf /tmp/fds.tgz >/dev/null 2>&1 && break
|
||||||
|
echo "fdroidserver download attempt $a failed; retrying in 5s" >&2; sleep 5
|
||||||
|
done
|
||||||
|
tar -xz -C "$fds" --strip-components=1 -f /tmp/fds.tgz
|
||||||
|
export PATH="$fds:$PATH"
|
||||||
|
export PYTHONPATH="$fds:$fds/examples"
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
# The job container reaches github.com but not the host's public git.comunes.org
|
||||||
|
# (NAT hairpin); redirect the app clone to the internal Forgejo host so
|
||||||
|
# `fdroid build` can fetch the source (and SOURCE_DATE_EPOCH from its commit).
|
||||||
|
git config --global url."http://x-access-token:${TOKEN}@forgejo:3000/".insteadOf "https://git.comunes.org/"
|
||||||
|
|
||||||
|
# 3) Fetch our in-repo recipe (the single source of truth) at this commit,
|
||||||
|
# plus the pubspec versionCode base for this ABI's versionCode.
|
||||||
|
# Which app commit/tag to build: on a tag push, the pushed commit; on a
|
||||||
|
# manual dispatch with ref_tag set, that tag (to rebuild+re-upload an
|
||||||
|
# existing release's references without cutting a new tag / Play deploy).
|
||||||
|
BUILD_REF="${REF_TAG:-$GITHUB_SHA}"
|
||||||
|
work=/tmp/tane-src
|
||||||
|
mkdir -p "$work" && cd "$work"
|
||||||
|
git init -q .
|
||||||
|
git remote add origin "http://x-access-token:${TOKEN}@forgejo:3000/${GITHUB_REPOSITORY}.git"
|
||||||
|
git fetch -q --depth 1 origin "$BUILD_REF"
|
||||||
|
git checkout -q FETCH_HEAD
|
||||||
|
base=$(sed -n -E 's/^version:.*\+([0-9]+)$/\1/p' apps/app_seeds/pubspec.yaml)
|
||||||
|
[ -n "$base" ]
|
||||||
|
vc=$((base * 10 + OFFSET))
|
||||||
|
|
||||||
|
# 4) Assemble a minimal fdroiddata (config.yml + srclibs + our recipe) from the
|
||||||
|
# in-repo files. No external host needed — the job container reaches
|
||||||
|
# git.comunes.org (via forgejo:3000) but not gitlab.com.
|
||||||
|
# Match F-Droid's buildserver path (~/build/<appid>) so the native .so
|
||||||
|
# embed identical build paths — required for the byte-for-byte repro check.
|
||||||
|
fdd=/home/vagrant
|
||||||
|
mkdir -p "$fdd/metadata" "$fdd/srclibs"
|
||||||
|
cp "$work/fdroid-ci/config.yml" "$fdd/config.yml"
|
||||||
|
cp "$work"/fdroid-ci/srclibs/*.yml "$fdd/srclibs/"
|
||||||
|
cp "$work/docs/fdroid/org.comunes.tane.yml" "$fdd/metadata/org.comunes.tane.yml"
|
||||||
|
cd "$fdd"
|
||||||
|
# Build THIS commit; drop binary: (we PRODUCE the reference here, not verify it).
|
||||||
|
sed -i "s#^\( *commit: \).*#\1${BUILD_REF}#" metadata/org.comunes.tane.yml
|
||||||
|
sed -i '/^ *binary: /d' metadata/org.comunes.tane.yml
|
||||||
|
|
||||||
|
# Pre-clone the app into fdroid's build dir: fdroidserver computes
|
||||||
|
# SOURCE_DATE_EPOCH from this checkout BEFORE it clones anything — on a
|
||||||
|
# fresh dir it falls back to `git log` of the fdroiddata tree, which our
|
||||||
|
# assembled skeleton doesn't have, and crashes on None. With the clone in
|
||||||
|
# place the primary path pins SOURCE_DATE_EPOCH to the app commit
|
||||||
|
# timestamp (deterministic; the public URL is redirected to forgejo:3000
|
||||||
|
# by the insteadOf rule above).
|
||||||
|
mkdir -p build
|
||||||
|
git clone -q https://git.comunes.org/comunes/tane.git build/org.comunes.tane
|
||||||
|
git -C build/org.comunes.tane checkout -q "${BUILD_REF}"
|
||||||
|
|
||||||
|
# 5) Build ONLY this ABI's split with F-Droid's own toolchain. Splitting
|
||||||
|
# per-ABI into its own job/matrix-entry (rather than all 3 sequentially in
|
||||||
|
# one job) is what keeps each build inside the runner's max-job-runtime —
|
||||||
|
# each needs a full cold NDK+tesseract-native+flutter compile.
|
||||||
|
# Retry the build: a transient network blip mid-Gradle (maven/pub) used
|
||||||
|
# to kill it. `fdroid build` exits 0 even on failure, so gate the retry
|
||||||
|
# on the APK actually appearing. Up to 3 attempts fit the 90m timeout.
|
||||||
|
for a in 1 2 3; do
|
||||||
|
fdroid build --verbose --no-tarball "org.comunes.tane:${vc}" || true
|
||||||
|
if [ -f "unsigned/org.comunes.tane_${vc}.apk" ]; then break; fi
|
||||||
|
echo "fdroid build attempt $a produced no APK; retrying" >&2
|
||||||
|
done
|
||||||
|
|
||||||
|
# `fdroid build` exits 0 even when builds fail — demand the APK.
|
||||||
|
f="unsigned/org.comunes.tane_${vc}.apk"
|
||||||
|
if [ ! -f "$f" ]; then
|
||||||
|
echo "expected $f, not found" >&2
|
||||||
|
tail -n 80 logs/*.log 2>/dev/null || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 6) Sign the unsigned APK with tane-upload and attach it to the Forgejo release.
|
||||||
|
apksigner=$(find "$ANDROID_HOME" -name apksigner -type f 2>/dev/null | sort -V | tail -1)
|
||||||
|
if [ -z "$apksigner" ]; then
|
||||||
|
yes | sdkmanager "build-tools;34.0.0" >/dev/null 2>&1 || true
|
||||||
|
apksigner=$(find "$ANDROID_HOME" -name apksigner -type f 2>/dev/null | sort -V | tail -1)
|
||||||
|
fi
|
||||||
|
echo "$TANE_KEYSTORE_BASE64" | base64 -d > /tmp/ks.jks
|
||||||
|
out="/tmp/app-${ABI}-release.apk"
|
||||||
|
# v2/v3 only — NO v1 (JAR) signature. minSdk is 24, so v1 is never
|
||||||
|
# needed, and v1 adds META-INF/*.SF/*.RSA/MANIFEST.MF as zip ENTRIES
|
||||||
|
# that F-Droid's rebuild doesn't have. F-Droid's apksigcopier transplants
|
||||||
|
# only the v2/v3 signing block, so those extra v1 entries make the
|
||||||
|
# reference's signed content differ from F-Droid's rebuild (CHUNKED_SHA512
|
||||||
|
# mismatch) even when every file is identical. Dropping v1 makes the
|
||||||
|
# reference byte-match F-Droid's build so the signature copy verifies.
|
||||||
|
"$apksigner" sign --ks /tmp/ks.jks --ks-key-alias "$TANE_KEY_ALIAS" \
|
||||||
|
--ks-pass "pass:$TANE_KEYSTORE_PASSWORD" --key-pass "pass:$TANE_KEY_PASSWORD" \
|
||||||
|
--v1-signing-enabled false --v2-signing-enabled true --v3-signing-enabled true \
|
||||||
|
--alignment-preserved true \
|
||||||
|
--out "$out" "$f"
|
||||||
|
# Prove the signer cert matches AllowedAPKSigningKeys.
|
||||||
|
"$apksigner" verify --print-certs "$out" | grep -i 'SHA-256' || true
|
||||||
|
rm -f /tmp/ks.jks
|
||||||
|
|
||||||
|
# Upload target: the pushed tag, or (on a manual dispatch) the ref_tag
|
||||||
|
# input. A plain dispatch with no ref_tag just builds+signs, no upload.
|
||||||
|
api="http://forgejo:3000/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||||
|
UPLOAD_TAG=""
|
||||||
|
if [ "${GITHUB_REF_TYPE:-}" = tag ]; then
|
||||||
|
UPLOAD_TAG="${GITHUB_REF_NAME}"
|
||||||
|
elif [ -n "${REF_TAG:-}" ]; then
|
||||||
|
UPLOAD_TAG="${REF_TAG}"
|
||||||
|
fi
|
||||||
|
if [ -n "$UPLOAD_TAG" ]; then
|
||||||
|
curl -sf -X POST "$api/releases" \
|
||||||
|
-H "Authorization: token ${TOKEN}" -H 'Content-Type: application/json' \
|
||||||
|
-d "{\"tag_name\":\"${UPLOAD_TAG}\",\"name\":\"${UPLOAD_TAG}\"}" >/dev/null || true
|
||||||
|
rid=$(curl -sf -H "Authorization: token ${TOKEN}" "$api/releases/tags/${UPLOAD_TAG}" \
|
||||||
|
| python3 -c 'import sys,json;print(json.load(sys.stdin)["id"])')
|
||||||
|
# Idempotent re-upload: delete any existing asset of this name first
|
||||||
|
# (the assets POST rejects a duplicate name).
|
||||||
|
curl -sf -H "Authorization: token ${TOKEN}" "$api/releases/${rid}/assets" \
|
||||||
|
| python3 -c "import sys,json;[print(a['id']) for a in json.load(sys.stdin) if a['name']=='app-${ABI}-release.apk']" 2>/dev/null \
|
||||||
|
| while read -r aid; do [ -n "$aid" ] && curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "$api/releases/${rid}/assets/${aid}" >/dev/null || true; done
|
||||||
|
curl -sf -X POST "$api/releases/${rid}/assets?name=app-${ABI}-release.apk" \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
-F "attachment=@${out};type=application/vnd.android.package-archive"
|
||||||
|
echo "uploaded app-${ABI}-release.apk to ${UPLOAD_TAG} (from ${f##*/})"
|
||||||
|
else
|
||||||
|
echo "built+signed app-${ABI}-release.apk (dispatch: no ref_tag, upload skipped)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fdroid_reference_arm64_v8a:
|
||||||
|
needs: fdroid_reference_armeabi_v7a
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: registry.gitlab.com/fdroid/fdroidserver:buildserver-trixie
|
||||||
|
steps:
|
||||||
|
- name: Build the arm64-v8a reference APK with fdroid, sign, and attach it
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
TANE_KEYSTORE_BASE64: ${{ secrets.TANE_KEYSTORE_BASE64 }}
|
||||||
|
TANE_KEYSTORE_PASSWORD: ${{ secrets.TANE_KEYSTORE_PASSWORD }}
|
||||||
|
TANE_KEY_ALIAS: ${{ secrets.TANE_KEY_ALIAS }}
|
||||||
|
TANE_KEY_PASSWORD: ${{ secrets.TANE_KEY_PASSWORD }}
|
||||||
|
REF_TAG: ${{ github.event.inputs.ref_tag }}
|
||||||
|
ABI: arm64-v8a
|
||||||
|
OFFSET: 2
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
sh /opt/buildserver/setup-env-vars /opt/android-sdk
|
||||||
|
. /etc/profile.d/bsenv.sh
|
||||||
|
fds=/opt/fdroidserver-src
|
||||||
|
mkdir -p "$fds"
|
||||||
|
# Download to a file with retries: a mid-transfer vSwitch blip used to
|
||||||
|
# pipe an empty stream straight into tar ("gzip: unexpected end of
|
||||||
|
# file"). -f fails on HTTP errors; --retry-all-errors covers resets.
|
||||||
|
for a in 1 2 3 4 5; do
|
||||||
|
curl -fsSL --retry 5 --retry-delay 3 --retry-all-errors \
|
||||||
|
https://gitlab.com/fdroid/fdroidserver/-/archive/master/fdroidserver-master.tar.gz \
|
||||||
|
-o /tmp/fds.tgz && tar -tzf /tmp/fds.tgz >/dev/null 2>&1 && break
|
||||||
|
echo "fdroidserver download attempt $a failed; retrying in 5s" >&2; sleep 5
|
||||||
|
done
|
||||||
|
tar -xz -C "$fds" --strip-components=1 -f /tmp/fds.tgz
|
||||||
|
export PATH="$fds:$PATH"
|
||||||
|
export PYTHONPATH="$fds:$fds/examples"
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
git config --global url."http://x-access-token:${TOKEN}@forgejo:3000/".insteadOf "https://git.comunes.org/"
|
||||||
|
# Which app commit/tag to build: on a tag push, the pushed commit; on a
|
||||||
|
# manual dispatch with ref_tag set, that tag (to rebuild+re-upload an
|
||||||
|
# existing release's references without cutting a new tag / Play deploy).
|
||||||
|
BUILD_REF="${REF_TAG:-$GITHUB_SHA}"
|
||||||
|
work=/tmp/tane-src
|
||||||
|
mkdir -p "$work" && cd "$work"
|
||||||
|
git init -q .
|
||||||
|
git remote add origin "http://x-access-token:${TOKEN}@forgejo:3000/${GITHUB_REPOSITORY}.git"
|
||||||
|
git fetch -q --depth 1 origin "$BUILD_REF"
|
||||||
|
git checkout -q FETCH_HEAD
|
||||||
|
base=$(sed -n -E 's/^version:.*\+([0-9]+)$/\1/p' apps/app_seeds/pubspec.yaml)
|
||||||
|
[ -n "$base" ]
|
||||||
|
vc=$((base * 10 + OFFSET))
|
||||||
|
# Match F-Droid's buildserver path (~/build/<appid>) so the native .so
|
||||||
|
# embed identical build paths — required for the byte-for-byte repro check.
|
||||||
|
fdd=/home/vagrant
|
||||||
|
mkdir -p "$fdd/metadata" "$fdd/srclibs"
|
||||||
|
cp "$work/fdroid-ci/config.yml" "$fdd/config.yml"
|
||||||
|
cp "$work"/fdroid-ci/srclibs/*.yml "$fdd/srclibs/"
|
||||||
|
cp "$work/docs/fdroid/org.comunes.tane.yml" "$fdd/metadata/org.comunes.tane.yml"
|
||||||
|
cd "$fdd"
|
||||||
|
sed -i "s#^\( *commit: \).*#\1${BUILD_REF}#" metadata/org.comunes.tane.yml
|
||||||
|
sed -i '/^ *binary: /d' metadata/org.comunes.tane.yml
|
||||||
|
mkdir -p build
|
||||||
|
git clone -q https://git.comunes.org/comunes/tane.git build/org.comunes.tane
|
||||||
|
git -C build/org.comunes.tane checkout -q "${BUILD_REF}"
|
||||||
|
# Retry the build: a transient network blip mid-Gradle (maven/pub) used
|
||||||
|
# to kill it. `fdroid build` exits 0 even on failure, so gate the retry
|
||||||
|
# on the APK actually appearing. Up to 3 attempts fit the 90m timeout.
|
||||||
|
for a in 1 2 3; do
|
||||||
|
fdroid build --verbose --no-tarball "org.comunes.tane:${vc}" || true
|
||||||
|
if [ -f "unsigned/org.comunes.tane_${vc}.apk" ]; then break; fi
|
||||||
|
echo "fdroid build attempt $a produced no APK; retrying" >&2
|
||||||
|
done
|
||||||
|
f="unsigned/org.comunes.tane_${vc}.apk"
|
||||||
|
if [ ! -f "$f" ]; then
|
||||||
|
echo "expected $f, not found" >&2
|
||||||
|
tail -n 80 logs/*.log 2>/dev/null || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
apksigner=$(find "$ANDROID_HOME" -name apksigner -type f 2>/dev/null | sort -V | tail -1)
|
||||||
|
if [ -z "$apksigner" ]; then
|
||||||
|
yes | sdkmanager "build-tools;34.0.0" >/dev/null 2>&1 || true
|
||||||
|
apksigner=$(find "$ANDROID_HOME" -name apksigner -type f 2>/dev/null | sort -V | tail -1)
|
||||||
|
fi
|
||||||
|
echo "$TANE_KEYSTORE_BASE64" | base64 -d > /tmp/ks.jks
|
||||||
|
out="/tmp/app-${ABI}-release.apk"
|
||||||
|
# v2/v3 only — NO v1 (JAR) signature. minSdk is 24, so v1 is never
|
||||||
|
# needed, and v1 adds META-INF/*.SF/*.RSA/MANIFEST.MF as zip ENTRIES
|
||||||
|
# that F-Droid's rebuild doesn't have. F-Droid's apksigcopier transplants
|
||||||
|
# only the v2/v3 signing block, so those extra v1 entries make the
|
||||||
|
# reference's signed content differ from F-Droid's rebuild (CHUNKED_SHA512
|
||||||
|
# mismatch) even when every file is identical. Dropping v1 makes the
|
||||||
|
# reference byte-match F-Droid's build so the signature copy verifies.
|
||||||
|
"$apksigner" sign --ks /tmp/ks.jks --ks-key-alias "$TANE_KEY_ALIAS" \
|
||||||
|
--ks-pass "pass:$TANE_KEYSTORE_PASSWORD" --key-pass "pass:$TANE_KEY_PASSWORD" \
|
||||||
|
--v1-signing-enabled false --v2-signing-enabled true --v3-signing-enabled true \
|
||||||
|
--alignment-preserved true \
|
||||||
|
--out "$out" "$f"
|
||||||
|
"$apksigner" verify --print-certs "$out" | grep -i 'SHA-256' || true
|
||||||
|
rm -f /tmp/ks.jks
|
||||||
|
# Upload target: the pushed tag, or (on a manual dispatch) the ref_tag
|
||||||
|
# input. A plain dispatch with no ref_tag just builds+signs, no upload.
|
||||||
|
api="http://forgejo:3000/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||||
|
UPLOAD_TAG=""
|
||||||
|
if [ "${GITHUB_REF_TYPE:-}" = tag ]; then
|
||||||
|
UPLOAD_TAG="${GITHUB_REF_NAME}"
|
||||||
|
elif [ -n "${REF_TAG:-}" ]; then
|
||||||
|
UPLOAD_TAG="${REF_TAG}"
|
||||||
|
fi
|
||||||
|
if [ -n "$UPLOAD_TAG" ]; then
|
||||||
|
curl -sf -X POST "$api/releases" \
|
||||||
|
-H "Authorization: token ${TOKEN}" -H 'Content-Type: application/json' \
|
||||||
|
-d "{\"tag_name\":\"${UPLOAD_TAG}\",\"name\":\"${UPLOAD_TAG}\"}" >/dev/null || true
|
||||||
|
rid=$(curl -sf -H "Authorization: token ${TOKEN}" "$api/releases/tags/${UPLOAD_TAG}" \
|
||||||
|
| python3 -c 'import sys,json;print(json.load(sys.stdin)["id"])')
|
||||||
|
# Idempotent re-upload: delete any existing asset of this name first
|
||||||
|
# (the assets POST rejects a duplicate name).
|
||||||
|
curl -sf -H "Authorization: token ${TOKEN}" "$api/releases/${rid}/assets" \
|
||||||
|
| python3 -c "import sys,json;[print(a['id']) for a in json.load(sys.stdin) if a['name']=='app-${ABI}-release.apk']" 2>/dev/null \
|
||||||
|
| while read -r aid; do [ -n "$aid" ] && curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "$api/releases/${rid}/assets/${aid}" >/dev/null || true; done
|
||||||
|
curl -sf -X POST "$api/releases/${rid}/assets?name=app-${ABI}-release.apk" \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
-F "attachment=@${out};type=application/vnd.android.package-archive"
|
||||||
|
echo "uploaded app-${ABI}-release.apk to ${UPLOAD_TAG} (from ${f##*/})"
|
||||||
|
else
|
||||||
|
echo "built+signed app-${ABI}-release.apk (dispatch: no ref_tag, upload skipped)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
fdroid_reference_x86_64:
|
||||||
|
needs: fdroid_reference_arm64_v8a
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: registry.gitlab.com/fdroid/fdroidserver:buildserver-trixie
|
||||||
|
steps:
|
||||||
|
- name: Build the x86_64 reference APK with fdroid, sign, and attach it
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ github.token }}
|
||||||
|
TANE_KEYSTORE_BASE64: ${{ secrets.TANE_KEYSTORE_BASE64 }}
|
||||||
|
TANE_KEYSTORE_PASSWORD: ${{ secrets.TANE_KEYSTORE_PASSWORD }}
|
||||||
|
TANE_KEY_ALIAS: ${{ secrets.TANE_KEY_ALIAS }}
|
||||||
|
TANE_KEY_PASSWORD: ${{ secrets.TANE_KEY_PASSWORD }}
|
||||||
|
REF_TAG: ${{ github.event.inputs.ref_tag }}
|
||||||
|
ABI: x86_64
|
||||||
|
OFFSET: 3
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
sh /opt/buildserver/setup-env-vars /opt/android-sdk
|
||||||
|
. /etc/profile.d/bsenv.sh
|
||||||
|
fds=/opt/fdroidserver-src
|
||||||
|
mkdir -p "$fds"
|
||||||
|
# Download to a file with retries: a mid-transfer vSwitch blip used to
|
||||||
|
# pipe an empty stream straight into tar ("gzip: unexpected end of
|
||||||
|
# file"). -f fails on HTTP errors; --retry-all-errors covers resets.
|
||||||
|
for a in 1 2 3 4 5; do
|
||||||
|
curl -fsSL --retry 5 --retry-delay 3 --retry-all-errors \
|
||||||
|
https://gitlab.com/fdroid/fdroidserver/-/archive/master/fdroidserver-master.tar.gz \
|
||||||
|
-o /tmp/fds.tgz && tar -tzf /tmp/fds.tgz >/dev/null 2>&1 && break
|
||||||
|
echo "fdroidserver download attempt $a failed; retrying in 5s" >&2; sleep 5
|
||||||
|
done
|
||||||
|
tar -xz -C "$fds" --strip-components=1 -f /tmp/fds.tgz
|
||||||
|
export PATH="$fds:$PATH"
|
||||||
|
export PYTHONPATH="$fds:$fds/examples"
|
||||||
|
git config --global --add safe.directory '*'
|
||||||
|
git config --global url."http://x-access-token:${TOKEN}@forgejo:3000/".insteadOf "https://git.comunes.org/"
|
||||||
|
# Which app commit/tag to build: on a tag push, the pushed commit; on a
|
||||||
|
# manual dispatch with ref_tag set, that tag (to rebuild+re-upload an
|
||||||
|
# existing release's references without cutting a new tag / Play deploy).
|
||||||
|
BUILD_REF="${REF_TAG:-$GITHUB_SHA}"
|
||||||
|
work=/tmp/tane-src
|
||||||
|
mkdir -p "$work" && cd "$work"
|
||||||
|
git init -q .
|
||||||
|
git remote add origin "http://x-access-token:${TOKEN}@forgejo:3000/${GITHUB_REPOSITORY}.git"
|
||||||
|
git fetch -q --depth 1 origin "$BUILD_REF"
|
||||||
|
git checkout -q FETCH_HEAD
|
||||||
|
base=$(sed -n -E 's/^version:.*\+([0-9]+)$/\1/p' apps/app_seeds/pubspec.yaml)
|
||||||
|
[ -n "$base" ]
|
||||||
|
vc=$((base * 10 + OFFSET))
|
||||||
|
# Match F-Droid's buildserver path (~/build/<appid>) so the native .so
|
||||||
|
# embed identical build paths — required for the byte-for-byte repro check.
|
||||||
|
fdd=/home/vagrant
|
||||||
|
mkdir -p "$fdd/metadata" "$fdd/srclibs"
|
||||||
|
cp "$work/fdroid-ci/config.yml" "$fdd/config.yml"
|
||||||
|
cp "$work"/fdroid-ci/srclibs/*.yml "$fdd/srclibs/"
|
||||||
|
cp "$work/docs/fdroid/org.comunes.tane.yml" "$fdd/metadata/org.comunes.tane.yml"
|
||||||
|
cd "$fdd"
|
||||||
|
sed -i "s#^\( *commit: \).*#\1${BUILD_REF}#" metadata/org.comunes.tane.yml
|
||||||
|
sed -i '/^ *binary: /d' metadata/org.comunes.tane.yml
|
||||||
|
mkdir -p build
|
||||||
|
git clone -q https://git.comunes.org/comunes/tane.git build/org.comunes.tane
|
||||||
|
git -C build/org.comunes.tane checkout -q "${BUILD_REF}"
|
||||||
|
# Retry the build: a transient network blip mid-Gradle (maven/pub) used
|
||||||
|
# to kill it. `fdroid build` exits 0 even on failure, so gate the retry
|
||||||
|
# on the APK actually appearing. Up to 3 attempts fit the 90m timeout.
|
||||||
|
for a in 1 2 3; do
|
||||||
|
fdroid build --verbose --no-tarball "org.comunes.tane:${vc}" || true
|
||||||
|
if [ -f "unsigned/org.comunes.tane_${vc}.apk" ]; then break; fi
|
||||||
|
echo "fdroid build attempt $a produced no APK; retrying" >&2
|
||||||
|
done
|
||||||
|
f="unsigned/org.comunes.tane_${vc}.apk"
|
||||||
|
if [ ! -f "$f" ]; then
|
||||||
|
echo "expected $f, not found" >&2
|
||||||
|
tail -n 80 logs/*.log 2>/dev/null || true
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
apksigner=$(find "$ANDROID_HOME" -name apksigner -type f 2>/dev/null | sort -V | tail -1)
|
||||||
|
if [ -z "$apksigner" ]; then
|
||||||
|
yes | sdkmanager "build-tools;34.0.0" >/dev/null 2>&1 || true
|
||||||
|
apksigner=$(find "$ANDROID_HOME" -name apksigner -type f 2>/dev/null | sort -V | tail -1)
|
||||||
|
fi
|
||||||
|
echo "$TANE_KEYSTORE_BASE64" | base64 -d > /tmp/ks.jks
|
||||||
|
out="/tmp/app-${ABI}-release.apk"
|
||||||
|
# v2/v3 only — NO v1 (JAR) signature. minSdk is 24, so v1 is never
|
||||||
|
# needed, and v1 adds META-INF/*.SF/*.RSA/MANIFEST.MF as zip ENTRIES
|
||||||
|
# that F-Droid's rebuild doesn't have. F-Droid's apksigcopier transplants
|
||||||
|
# only the v2/v3 signing block, so those extra v1 entries make the
|
||||||
|
# reference's signed content differ from F-Droid's rebuild (CHUNKED_SHA512
|
||||||
|
# mismatch) even when every file is identical. Dropping v1 makes the
|
||||||
|
# reference byte-match F-Droid's build so the signature copy verifies.
|
||||||
|
"$apksigner" sign --ks /tmp/ks.jks --ks-key-alias "$TANE_KEY_ALIAS" \
|
||||||
|
--ks-pass "pass:$TANE_KEYSTORE_PASSWORD" --key-pass "pass:$TANE_KEY_PASSWORD" \
|
||||||
|
--v1-signing-enabled false --v2-signing-enabled true --v3-signing-enabled true \
|
||||||
|
--alignment-preserved true \
|
||||||
|
--out "$out" "$f"
|
||||||
|
"$apksigner" verify --print-certs "$out" | grep -i 'SHA-256' || true
|
||||||
|
rm -f /tmp/ks.jks
|
||||||
|
# Upload target: the pushed tag, or (on a manual dispatch) the ref_tag
|
||||||
|
# input. A plain dispatch with no ref_tag just builds+signs, no upload.
|
||||||
|
api="http://forgejo:3000/api/v1/repos/${GITHUB_REPOSITORY}"
|
||||||
|
UPLOAD_TAG=""
|
||||||
|
if [ "${GITHUB_REF_TYPE:-}" = tag ]; then
|
||||||
|
UPLOAD_TAG="${GITHUB_REF_NAME}"
|
||||||
|
elif [ -n "${REF_TAG:-}" ]; then
|
||||||
|
UPLOAD_TAG="${REF_TAG}"
|
||||||
|
fi
|
||||||
|
if [ -n "$UPLOAD_TAG" ]; then
|
||||||
|
curl -sf -X POST "$api/releases" \
|
||||||
|
-H "Authorization: token ${TOKEN}" -H 'Content-Type: application/json' \
|
||||||
|
-d "{\"tag_name\":\"${UPLOAD_TAG}\",\"name\":\"${UPLOAD_TAG}\"}" >/dev/null || true
|
||||||
|
rid=$(curl -sf -H "Authorization: token ${TOKEN}" "$api/releases/tags/${UPLOAD_TAG}" \
|
||||||
|
| python3 -c 'import sys,json;print(json.load(sys.stdin)["id"])')
|
||||||
|
# Idempotent re-upload: delete any existing asset of this name first
|
||||||
|
# (the assets POST rejects a duplicate name).
|
||||||
|
curl -sf -H "Authorization: token ${TOKEN}" "$api/releases/${rid}/assets" \
|
||||||
|
| python3 -c "import sys,json;[print(a['id']) for a in json.load(sys.stdin) if a['name']=='app-${ABI}-release.apk']" 2>/dev/null \
|
||||||
|
| while read -r aid; do [ -n "$aid" ] && curl -sf -X DELETE -H "Authorization: token ${TOKEN}" "$api/releases/${rid}/assets/${aid}" >/dev/null || true; done
|
||||||
|
curl -sf -X POST "$api/releases/${rid}/assets?name=app-${ABI}-release.apk" \
|
||||||
|
-H "Authorization: token ${TOKEN}" \
|
||||||
|
-F "attachment=@${out};type=application/vnd.android.package-archive"
|
||||||
|
echo "uploaded app-${ABI}-release.apk to ${UPLOAD_TAG} (from ${f##*/})"
|
||||||
|
else
|
||||||
|
echo "built+signed app-${ABI}-release.apk (dispatch: no ref_tag, upload skipped)"
|
||||||
|
fi
|
||||||
|
|
|
||||||
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -13,3 +13,6 @@ node_modules/
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
apps/app_seeds/fastlane/README.md
|
apps/app_seeds/fastlane/README.md
|
||||||
apps/app_seeds/TODO.org
|
apps/app_seeds/TODO.org
|
||||||
|
|
||||||
|
# Internal working notes — live in the private repo (tane-private)
|
||||||
|
docs/notes/
|
||||||
|
|
|
||||||
|
|
@ -74,4 +74,4 @@ Social layer uses: Nostr (offers NIP-99, DMs NIP-17, via the pure-Dart `nostr` p
|
||||||
- Live decision log: [`docs/design/open-decisions.md`](docs/design/open-decisions.md) — check before deciding anything.
|
- Live decision log: [`docs/design/open-decisions.md`](docs/design/open-decisions.md) — check before deciding anything.
|
||||||
- First code steps: [`docs/design/first-sprint.md`](docs/design/first-sprint.md).
|
- First code steps: [`docs/design/first-sprint.md`](docs/design/first-sprint.md).
|
||||||
- Prior art / valuable mockups: [`docs/mockups/`](docs/mockups/) (inventory, item, search, profile, chat — the UI spec).
|
- Prior art / valuable mockups: [`docs/mockups/`](docs/mockups/) (inventory, item, search, profile, chat — the UI spec).
|
||||||
- Git: bare at `~/repos/tane.git`; working clone here. Commit messages in English.
|
- Git: `origin` is the forge at `git.comunes.org/comunes/tane.git` (authoritative; push here). Working clone here. A pre-split backup of the old (pre-`filter-repo`) history is archived at `~/repos/tane-pre-split-2026-07-15.git` — not a remote, do not push to it. Commit messages in English.
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,16 @@ The name honors the old Japanese mutual-aid traditions around rice — *yui* (sh
|
||||||
- Web: https://tane.comunes.org
|
- Web: https://tane.comunes.org
|
||||||
- Package id: `org.comunes.tane`
|
- Package id: `org.comunes.tane`
|
||||||
|
|
||||||
|
## Install
|
||||||
|
|
||||||
|
Android, same signature in both stores — you can switch between them without reinstalling:
|
||||||
|
|
||||||
|
- **F-Droid**: https://f-droid.org/packages/org.comunes.tane/ (reproducible, developer-signed build)
|
||||||
|
- **Google Play**: https://play.google.com/store/apps/details?id=org.comunes.tane
|
||||||
|
|
||||||
## Status
|
## Status
|
||||||
|
|
||||||
Early design. See [`PLAN.md`](PLAN.md) for the full analysis and roadmap (in Spanish). The valuable prior work lives in [`docs/mockups/`](docs/mockups/).
|
Block 1 (inventory) is shipped and in beta; Block 2 (the social layer) is under way. See [`PLAN.md`](PLAN.md) for the full analysis and roadmap (in Spanish) and [`docs/design/open-decisions.md`](docs/design/open-decisions.md) for the live decision log. The valuable prior work lives in [`docs/mockups/`](docs/mockups/).
|
||||||
|
|
||||||
## Principles
|
## Principles
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,17 @@ android {
|
||||||
} else {
|
} else {
|
||||||
signingConfigs.getByName("debug")
|
signingConfigs.getByName("debug")
|
||||||
}
|
}
|
||||||
|
// R8: shrink + optimize + obfuscate the Java/Kotlin bytecode and strip
|
||||||
|
// unused resources — Play's "app optimization" recommendation (smaller
|
||||||
|
// download, less memory). Native .so libs are untouched, so this does
|
||||||
|
// not change device/ABI compatibility. Keep rules for reflection/JNI
|
||||||
|
// heavy deps (OCR, SQLCipher, notifications) live in proguard-rules.pro.
|
||||||
|
isMinifyEnabled = true
|
||||||
|
isShrinkResources = true
|
||||||
|
proguardFiles(
|
||||||
|
getDefaultProguardFile("proguard-android-optimize.txt"),
|
||||||
|
"proguard-rules.pro",
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -86,6 +97,17 @@ dependencies {
|
||||||
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// F-Droid: Flutter's embedding transitively pulls Google Play Core (deferred
|
||||||
|
// components / split install — com.google.android.play.core.*), which F-Droid's
|
||||||
|
// scanner rejects as a proprietary Google dependency. Tane does not use deferred
|
||||||
|
// components, so drop the whole com.google.android.play group; those split-install
|
||||||
|
// code paths are never reached. R8 keeps the referenced classes otherwise, so the
|
||||||
|
// exclusion (not shrinking) is what removes them; -dontwarn in proguard-rules.pro
|
||||||
|
// silences the now-dangling compile-time references.
|
||||||
|
configurations.all {
|
||||||
|
exclude(group = "com.google.android.play")
|
||||||
|
}
|
||||||
|
|
||||||
// F-Droid builds one split APK per ABI (smaller downloads than a universal
|
// F-Droid builds one split APK per ABI (smaller downloads than a universal
|
||||||
// APK) and needs each split to carry a distinct versionCode so its repo can
|
// APK) and needs each split to carry a distinct versionCode so its repo can
|
||||||
// tell them apart; `flutter build apk --split-per-abi` alone gives every
|
// tell them apart; `flutter build apk --split-per-abi` alone gives every
|
||||||
|
|
|
||||||
52
apps/app_seeds/android/app/proguard-rules.pro
vendored
Normal file
52
apps/app_seeds/android/app/proguard-rules.pro
vendored
Normal file
|
|
@ -0,0 +1,52 @@
|
||||||
|
# R8/ProGuard keep rules for Tane (org.comunes.tane).
|
||||||
|
#
|
||||||
|
# R8 is enabled for release builds (see build.gradle.kts). It shrinks/optimizes
|
||||||
|
# the Java/Kotlin bytecode and can break code reached only via reflection or JNI
|
||||||
|
# — the native plugins below load their Java classes from C, so R8 can't see the
|
||||||
|
# references and would strip/rename them. Keep them explicitly. Start
|
||||||
|
# conservative; trim only after a release smoke test proves a class is unused.
|
||||||
|
|
||||||
|
# --- Flutter engine & embedding ---
|
||||||
|
# Do NOT blanket-keep io.flutter.** : that pins io.flutter.embedding.engine.
|
||||||
|
# deferredcomponents.PlayStoreDeferredComponentManager, which references the
|
||||||
|
# proprietary com.google.android.play.core.* (SplitInstall/SplitCompat) API and
|
||||||
|
# makes F-Droid's scanner reject the APK. Tane doesn't use deferred components,
|
||||||
|
# so let R8 shrink that unused manager away (removing the Play Core references).
|
||||||
|
# JNI-critical embedding classes (FlutterJNI, etc.) are kept by the Flutter
|
||||||
|
# embedding AAR's own bundled consumer ProGuard rules, so this stays safe.
|
||||||
|
-keep class io.flutter.plugins.** { *; }
|
||||||
|
-dontwarn io.flutter.embedding.**
|
||||||
|
|
||||||
|
# --- On-device OCR: tesseract4android (JNI) ---
|
||||||
|
# libtesseract/libleptonica call back into these Java classes by name.
|
||||||
|
-keep class com.googlecode.tesseract.android.** { *; }
|
||||||
|
-keep class com.googlecode.leptonica.android.** { *; }
|
||||||
|
-keep class io.paratoner.flutter_tesseract_ocr.** { *; }
|
||||||
|
|
||||||
|
# --- QR scanning: zxing_barcode_scanner (pure ZXing, platform view) ---
|
||||||
|
-keep class com.shirisharyal.zxing_barcode_scanner.** { *; }
|
||||||
|
|
||||||
|
# --- Encrypted DB: SQLCipher / sqlite3 native loader ---
|
||||||
|
# sqlite3 is reached over FFI (dlopen), but keep the loader plugin classes.
|
||||||
|
-keep class eu.simonbinder.sqlite3_flutter_libs.** { *; }
|
||||||
|
-keep class net.zetetic.** { *; }
|
||||||
|
-dontwarn net.zetetic.**
|
||||||
|
|
||||||
|
# --- Local notifications ---
|
||||||
|
# Published keep rules for flutter_local_notifications' Gson-serialized models.
|
||||||
|
-keep class com.dexterous.** { *; }
|
||||||
|
-keep class com.google.gson.** { *; }
|
||||||
|
-keep class * extends com.google.gson.TypeAdapter
|
||||||
|
-keepattributes Signature
|
||||||
|
-keepattributes *Annotation*
|
||||||
|
-dontwarn com.google.errorprone.annotations.**
|
||||||
|
|
||||||
|
# --- Core library desugaring ---
|
||||||
|
-dontwarn java.lang.invoke.**
|
||||||
|
-dontwarn build.IgnoreJava8API
|
||||||
|
|
||||||
|
# --- F-Droid: Google Play Core excluded (see build.gradle.kts) ---
|
||||||
|
# The Flutter embedding references Play Core split-install classes for deferred
|
||||||
|
# components, which Tane doesn't use; the com.google.android.play group is
|
||||||
|
# excluded from the build, so tell R8 not to warn about the absent references.
|
||||||
|
-dontwarn com.google.android.play.**
|
||||||
|
|
@ -1,10 +1,29 @@
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<!-- Network access for the social layer (relays: offers, messaging, trust,
|
||||||
|
device sync). Flutter auto-adds this only to the debug/profile manifests,
|
||||||
|
so release builds shipped it MISSING — every store build had no network
|
||||||
|
at all (the market's "can't reach the servers" was the visible symptom;
|
||||||
|
messaging and sync were equally dead). Must live in the main manifest. -->
|
||||||
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<!-- Coarse location only, for the optional "use my location" sharing area
|
<!-- Coarse location only, for the optional "use my location" sharing area
|
||||||
(reduced to a low-precision geohash; never a precise fix). -->
|
(reduced to a low-precision geohash; never a precise fix). -->
|
||||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||||
<!-- Foreground local notifications for incoming private messages (Android 13+
|
<!-- Foreground local notifications for incoming private messages (Android 13+
|
||||||
asks the user at runtime). -->
|
asks the user at runtime). -->
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
|
<!-- The CAMERA permission (pulled in by zxing_barcode_scanner for QR scanning
|
||||||
|
and used by image_picker) makes Android implicitly require the camera
|
||||||
|
hardware features, which would exclude camera-less devices — Chromebooks,
|
||||||
|
Android Automotive, many TVs — from Play. The app degrades gracefully
|
||||||
|
without a camera (gallery import still works; the scan button hides), so
|
||||||
|
declare these optional to keep those devices supported. Same for the
|
||||||
|
location features implied by ACCESS_COARSE_LOCATION. -->
|
||||||
|
<uses-feature android:name="android.hardware.camera" android:required="false" />
|
||||||
|
<uses-feature android:name="android.hardware.camera.any" android:required="false" />
|
||||||
|
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
|
||||||
|
<uses-feature android:name="android.hardware.location" android:required="false" />
|
||||||
|
<uses-feature android:name="android.hardware.location.network" android:required="false" />
|
||||||
|
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
|
||||||
<application
|
<application
|
||||||
android:label="Tane"
|
android:label="Tane"
|
||||||
android:name="${applicationName}"
|
android:name="${applicationName}"
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ class MainActivity : FlutterActivity() {
|
||||||
.setMethodCallHandler { call, result ->
|
.setMethodCallHandler { call, result ->
|
||||||
when (call.method) {
|
when (call.method) {
|
||||||
"getCoarseLatLon" -> getCoarseLatLon(result)
|
"getCoarseLatLon" -> getCoarseLatLon(result)
|
||||||
|
"hasCamera" -> result.success(hasCameraHardware())
|
||||||
else -> result.notImplemented()
|
else -> result.notImplemented()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -72,6 +73,15 @@ class MainActivity : FlutterActivity() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether this device has any camera. Camera-less devices (Chromebooks,
|
||||||
|
* Android Automotive, many TVs) are supported — see AndroidManifest's
|
||||||
|
* uses-feature required="false" — so the QR scan and camera-capture UI
|
||||||
|
* hide themselves when this is false instead of offering broken actions.
|
||||||
|
*/
|
||||||
|
private fun hasCameraHardware(): Boolean =
|
||||||
|
packageManager.hasSystemFeature(PackageManager.FEATURE_CAMERA_ANY)
|
||||||
|
|
||||||
private fun hasLocationPermission(): Boolean =
|
private fun hasLocationPermission(): Boolean =
|
||||||
ContextCompat.checkSelfPermission(
|
ContextCompat.checkSelfPermission(
|
||||||
this,
|
this,
|
||||||
|
|
|
||||||
2509
apps/app_seeds/drift_schemas/drift_schema_v14.json
Normal file
2509
apps/app_seeds/drift_schemas/drift_schema_v14.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -16,13 +16,24 @@ default_platform(:android)
|
||||||
AAB_PATH = "build/app/outputs/bundle/release/app-release.aab".freeze
|
AAB_PATH = "build/app/outputs/bundle/release/app-release.aab".freeze
|
||||||
|
|
||||||
platform :android do
|
platform :android do
|
||||||
desc "Upload the signed AAB + store listing to Google Play (internal track)"
|
desc "Upload the signed AAB + store listing to Google Play (production, 100%)"
|
||||||
lane :deploy_play do
|
lane :deploy_play do
|
||||||
|
supply(
|
||||||
|
track: "production",
|
||||||
|
aab: AAB_PATH,
|
||||||
|
release_status: "completed", # publish to 100% of users (subject to review)
|
||||||
|
skip_upload_apk: true, # we ship the AAB, not a raw APK
|
||||||
|
skip_upload_changelogs: false,
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
|
desc "Upload the signed AAB to the internal test track (manual QA safety net)"
|
||||||
|
lane :deploy_internal do
|
||||||
supply(
|
supply(
|
||||||
track: "internal",
|
track: "internal",
|
||||||
aab: AAB_PATH,
|
aab: AAB_PATH,
|
||||||
release_status: "completed", # internal testing has no review delay
|
release_status: "completed", # internal testing has no review delay
|
||||||
skip_upload_apk: true, # we ship the AAB, not a raw APK
|
skip_upload_apk: true,
|
||||||
skip_upload_changelogs: false,
|
skip_upload_changelogs: false,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Tane now stays completely offline until you join the sharing part — it no longer contacts any server on its own. The store description finally says which community servers it talks to, what they can see, and how to change them or switch them all off.
|
||||||
|
|
@ -13,8 +13,11 @@ MANAGE YOUR BANK
|
||||||
• Search and filter; snap a photo now and name it later.
|
• Search and filter; snap a photo now and name it later.
|
||||||
|
|
||||||
YOURS, AND ONLY YOURS
|
YOURS, AND ONLY YOURS
|
||||||
• Works fully offline. No account, no server, no trackers.
|
• Your seed book works with no internet at all. What you write stays on your
|
||||||
|
phone; nothing goes out unless you put some of your seeds up for sharing, or
|
||||||
|
write to someone.
|
||||||
• Everything is encrypted at rest on your device.
|
• Everything is encrypted at rest on your device.
|
||||||
|
• No account, no sign-up, no ads, no trackers.
|
||||||
• Save an encrypted backup and keep a printed recovery sheet — restore your
|
• Save an encrypted backup and keep a printed recovery sheet — restore your
|
||||||
whole bank on a new device.
|
whole bank on a new device.
|
||||||
|
|
||||||
|
|
@ -22,6 +25,26 @@ SHARE, THE WAY IT'S ALWAYS BEEN DONE
|
||||||
• Mark what you have spare to give away, swap or sell.
|
• Mark what you have spare to give away, swap or sell.
|
||||||
• Print a catalog of what you share to take to a seed fair.
|
• Print a catalog of what you share to take to a seed fair.
|
||||||
|
|
||||||
|
SHARING NEEDS THE INTERNET
|
||||||
|
Keeping your seed book needs nothing but your phone. Sharing does need a
|
||||||
|
connection: to get an offer or a message across to someone, Tane leaves it on
|
||||||
|
community servers — machines run by people, not by a company. Tane comes with
|
||||||
|
four: relay.comunes.org, which Asociación Comunes runs (the same people who make
|
||||||
|
Tane), plus three public ones that others already use — nos.lol, relay.damus.io
|
||||||
|
and relay.primal.net.
|
||||||
|
|
||||||
|
Tane only talks to them once you join the sharing part and agree to the
|
||||||
|
community rules. Before that it doesn't connect to anything, and messaging stays
|
||||||
|
switched off. Once you join, those servers see the key that stands for you and
|
||||||
|
the address your phone connects from — no name, no email, no account. Your seed
|
||||||
|
book itself is never sent anywhere.
|
||||||
|
|
||||||
|
You stay in charge of that list of servers. In the sharing setup you can switch
|
||||||
|
off any server on it, switch off every one of them — Tane then goes back to
|
||||||
|
being a seed book that never connects — or add the address of a different
|
||||||
|
server. Anyone can run a server of their own, and Tane works just as well with
|
||||||
|
it.
|
||||||
|
|
||||||
Tane is free software (AGPL-3.0). No ads, no commissions, no business model
|
Tane is free software (AGPL-3.0). No ads, no commissions, no business model
|
||||||
— it exists to support traditional varieties and push back against the seed
|
— it exists to support traditional varieties and push back against the seed
|
||||||
monopoly.
|
monopoly.
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
Tane ya no se conecta a ningún servidor por su cuenta: se queda completamente sin conexión hasta que entras en la parte de compartir. Y la descripción de la tienda por fin dice con qué servidores comunitarios habla, qué pueden ver y cómo cambiarlos o desactivarlos todos.
|
||||||
|
|
@ -13,8 +13,11 @@ GESTIONA TU BANCO
|
||||||
• Busca y filtra; haz una foto ahora y ponle nombre después.
|
• Busca y filtra; haz una foto ahora y ponle nombre después.
|
||||||
|
|
||||||
TUYO, Y SOLO TUYO
|
TUYO, Y SOLO TUYO
|
||||||
• Funciona totalmente sin conexión. Sin cuenta, sin servidor, sin rastreadores.
|
• Tu cuaderno de semillas funciona sin nada de internet. Lo que escribes se
|
||||||
|
queda en el móvil; no sale nada salvo que pongas a compartir parte de tus
|
||||||
|
semillas o le escribas a alguien.
|
||||||
• Todo va cifrado en tu dispositivo.
|
• Todo va cifrado en tu dispositivo.
|
||||||
|
• Sin cuenta, sin registro, sin anuncios, sin rastreadores.
|
||||||
• Guarda una copia cifrada y ten una hoja de recuperación impresa: recupera
|
• Guarda una copia cifrada y ten una hoja de recuperación impresa: recupera
|
||||||
todo tu banco en un dispositivo nuevo.
|
todo tu banco en un dispositivo nuevo.
|
||||||
|
|
||||||
|
|
@ -22,6 +25,25 @@ COMPARTIR, COMO SE HA HECHO SIEMPRE
|
||||||
• Marca lo que te sobra para regalar, intercambiar o vender.
|
• Marca lo que te sobra para regalar, intercambiar o vender.
|
||||||
• Imprime un catálogo de lo que compartes para llevar a una feria de semillas.
|
• Imprime un catálogo de lo que compartes para llevar a una feria de semillas.
|
||||||
|
|
||||||
|
COMPARTIR SÍ NECESITA INTERNET
|
||||||
|
Para llevar tu cuaderno de semillas no hace falta más que el móvil. Compartir sí
|
||||||
|
necesita conexión: para que una oferta o un mensaje le lleguen a otra persona,
|
||||||
|
Tane los deja en servidores comunitarios, máquinas que lleva gente, no una
|
||||||
|
empresa. Tane viene con cuatro: relay.comunes.org, que lleva la Asociación
|
||||||
|
Comunes (la misma gente que hace Tane), y tres públicos que ya usa otra gente:
|
||||||
|
nos.lol, relay.damus.io y relay.primal.net.
|
||||||
|
|
||||||
|
Tane solo habla con ellos cuando entras en la parte de compartir y aceptas las
|
||||||
|
normas de la comunidad. Antes de eso no se conecta a nada, y la mensajería está
|
||||||
|
apagada. Cuando entras, esos servidores ven la clave que te representa y la
|
||||||
|
dirección desde la que se conecta tu móvil: ni nombre, ni correo, ni cuenta. Tu
|
||||||
|
cuaderno de semillas no se envía nunca a ningún sitio.
|
||||||
|
|
||||||
|
Tú mandas sobre esa lista de servidores. En la configuración de compartir puedes
|
||||||
|
desactivar el servidor que quieras, desactivarlos todos —y Tane vuelve a ser un
|
||||||
|
cuaderno que no se conecta nunca— o añadir la dirección de otro servidor.
|
||||||
|
Cualquiera puede montar su propio servidor, y Tane funciona igual de bien con él.
|
||||||
|
|
||||||
Tane es software libre (AGPL-3.0). Sin anuncios, sin comisiones, sin modelo
|
Tane es software libre (AGPL-3.0). Sin anuncios, sin comisiones, sin modelo
|
||||||
de negocio: existe para apoyar las variedades tradicionales y plantar cara al
|
de negocio: existe para apoyar las variedades tradicionales y plantar cara al
|
||||||
monopolio de las semillas.
|
monopolio de las semillas.
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@ import 'services/social_account_store.dart';
|
||||||
import 'services/social_connection.dart';
|
import 'services/social_connection.dart';
|
||||||
import 'services/social_service.dart';
|
import 'services/social_service.dart';
|
||||||
import 'services/social_settings.dart';
|
import 'services/social_settings.dart';
|
||||||
|
import 'services/sharing_switch.dart';
|
||||||
import 'state/inventory_cubit.dart';
|
import 'state/inventory_cubit.dart';
|
||||||
import 'state/variety_detail_cubit.dart';
|
import 'state/variety_detail_cubit.dart';
|
||||||
import 'ui/about_screen.dart';
|
import 'ui/about_screen.dart';
|
||||||
|
|
@ -70,6 +71,7 @@ class TaneApp extends StatelessWidget {
|
||||||
this.notifications,
|
this.notifications,
|
||||||
this.showIntro = false,
|
this.showIntro = false,
|
||||||
this.autoBackup,
|
this.autoBackup,
|
||||||
|
SharingSwitch? sharing,
|
||||||
super.key,
|
super.key,
|
||||||
}) : _router = _buildRouter(
|
}) : _router = _buildRouter(
|
||||||
repository,
|
repository,
|
||||||
|
|
@ -87,6 +89,17 @@ class TaneApp extends StatelessWidget {
|
||||||
savedSearches,
|
savedSearches,
|
||||||
socialAccounts,
|
socialAccounts,
|
||||||
inbox,
|
inbox,
|
||||||
|
// `bootstrap` passes the real switch, holding the person's stored
|
||||||
|
// answer. A widget test that doesn't care gets one already on, so
|
||||||
|
// screens behave as they did before sharing became opt-in.
|
||||||
|
sharing ??
|
||||||
|
(socialSettings == null
|
||||||
|
? null
|
||||||
|
: SharingSwitch(
|
||||||
|
settings: socialSettings,
|
||||||
|
connection: connection,
|
||||||
|
enabled: true,
|
||||||
|
)),
|
||||||
) {
|
) {
|
||||||
// A tapped message notification opens that peer's chat. Wired here because
|
// A tapped message notification opens that peer's chat. Wired here because
|
||||||
// the router only exists now; taps only happen while the app is foreground,
|
// the router only exists now; taps only happen while the app is foreground,
|
||||||
|
|
@ -161,14 +174,17 @@ class TaneApp extends StatelessWidget {
|
||||||
SavedSearchesStore? savedSearches,
|
SavedSearchesStore? savedSearches,
|
||||||
SocialAccountStore? socialAccounts,
|
SocialAccountStore? socialAccounts,
|
||||||
InboxService? inbox,
|
InboxService? inbox,
|
||||||
|
SharingSwitch? sharing,
|
||||||
) {
|
) {
|
||||||
return GoRouter(
|
return GoRouter(
|
||||||
initialLocation: showIntro ? '/intro' : '/',
|
initialLocation: showIntro ? '/intro' : '/',
|
||||||
routes: [
|
routes: [
|
||||||
GoRoute(
|
GoRoute(
|
||||||
path: '/',
|
path: '/',
|
||||||
|
// A null switch means there is no social layer at all: the market card
|
||||||
|
// and the social drawer entries aren't drawn.
|
||||||
builder: (context, state) =>
|
builder: (context, state) =>
|
||||||
HomeScreen(marketEnabled: social != null),
|
HomeScreen(sharing: sharing, onboarding: onboarding),
|
||||||
),
|
),
|
||||||
if (social != null && socialSettings != null && connection != null)
|
if (social != null && socialSettings != null && connection != null)
|
||||||
GoRoute(
|
GoRoute(
|
||||||
|
|
@ -181,6 +197,7 @@ class TaneApp extends StatelessWidget {
|
||||||
outbox: outbox,
|
outbox: outbox,
|
||||||
onboarding: onboarding,
|
onboarding: onboarding,
|
||||||
savedSearches: savedSearches,
|
savedSearches: savedSearches,
|
||||||
|
sharing: sharing,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (social != null && connection != null)
|
if (social != null && connection != null)
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ import 'data/variety_repository.dart';
|
||||||
import 'di/injector.dart';
|
import 'di/injector.dart';
|
||||||
import 'i18n/strings.g.dart';
|
import 'i18n/strings.g.dart';
|
||||||
import 'services/auto_backup_service.dart';
|
import 'services/auto_backup_service.dart';
|
||||||
|
import 'services/camera_availability.dart';
|
||||||
import 'services/coarse_location.dart';
|
import 'services/coarse_location.dart';
|
||||||
import 'services/inbox_service.dart';
|
import 'services/inbox_service.dart';
|
||||||
import 'services/locale_store.dart';
|
import 'services/locale_store.dart';
|
||||||
|
|
@ -22,6 +23,7 @@ import 'services/profile_store.dart';
|
||||||
import 'services/saved_offers_store.dart';
|
import 'services/saved_offers_store.dart';
|
||||||
import 'services/saved_search_alert_service.dart';
|
import 'services/saved_search_alert_service.dart';
|
||||||
import 'services/saved_searches_store.dart';
|
import 'services/saved_searches_store.dart';
|
||||||
|
import 'services/sharing_switch.dart';
|
||||||
import 'services/social_account_store.dart';
|
import 'services/social_account_store.dart';
|
||||||
import 'services/social_connection.dart';
|
import 'services/social_connection.dart';
|
||||||
import 'services/social_service.dart';
|
import 'services/social_service.dart';
|
||||||
|
|
@ -50,6 +52,11 @@ class _BootstrapState extends State<Bootstrap> {
|
||||||
Future<TaneApp> _boot() async {
|
Future<TaneApp> _boot() async {
|
||||||
await configureDependencies();
|
await configureDependencies();
|
||||||
|
|
||||||
|
// Detect camera presence once, before the home screen builds, so camera-less
|
||||||
|
// devices (Chromebooks, Automotive, some TVs) hide the QR scan / camera UI
|
||||||
|
// instead of offering broken actions. Non-Android platforms keep the default.
|
||||||
|
await initCameraAvailability();
|
||||||
|
|
||||||
// The saved language lives in the keystore, so it can only be applied once
|
// The saved language lives in the keystore, so it can only be applied once
|
||||||
// DI is up. Until now the splash showed in the device language (it has no
|
// DI is up. Until now the splash showed in the device language (it has no
|
||||||
// text), so there is no visible flip.
|
// text), so there is no visible flip.
|
||||||
|
|
@ -75,14 +82,24 @@ class _BootstrapState extends State<Bootstrap> {
|
||||||
final savedSearchAlerts = getIt.isRegistered<SavedSearchAlertService>()
|
final savedSearchAlerts = getIt.isRegistered<SavedSearchAlertService>()
|
||||||
? getIt<SavedSearchAlertService>()
|
? getIt<SavedSearchAlertService>()
|
||||||
: null;
|
: null;
|
||||||
|
// Sharing is opt-in: the app must not touch the network until the person
|
||||||
|
// has joined the sharing side. An install from before this setting keeps
|
||||||
|
// whatever it had (see `migrateSharingEnabled`) so nobody silently loses
|
||||||
|
// messaging on upgrade.
|
||||||
|
final introSeen = await onboarding.introSeen();
|
||||||
|
final sharingOn = await getIt<SocialSettings>().migrateSharingEnabled(
|
||||||
|
introSeen: introSeen,
|
||||||
|
);
|
||||||
|
|
||||||
// Subscribe the inbox + sync + plantaré + saved-search listeners BEFORE the
|
// Subscribe the inbox + sync + plantaré + saved-search listeners BEFORE the
|
||||||
// shared connection starts connecting, so the first session is caught; then
|
// shared connection starts connecting, so the first session is caught; then
|
||||||
// bring the connection up.
|
// bring the connection up. The listeners are harmless while sharing is off:
|
||||||
|
// they only ever react to a session, and none arrives.
|
||||||
inbox?.start();
|
inbox?.start();
|
||||||
sync?.start();
|
sync?.start();
|
||||||
plantares?.start();
|
plantares?.start();
|
||||||
savedSearchAlerts?.start();
|
savedSearchAlerts?.start();
|
||||||
connection?.start();
|
if (sharingOn) connection?.start();
|
||||||
|
|
||||||
return TaneApp(
|
return TaneApp(
|
||||||
repository: getIt<VarietyRepository>(),
|
repository: getIt<VarietyRepository>(),
|
||||||
|
|
@ -102,7 +119,12 @@ class _BootstrapState extends State<Bootstrap> {
|
||||||
socialAccounts: getIt<SocialAccountStore>(),
|
socialAccounts: getIt<SocialAccountStore>(),
|
||||||
inbox: inbox,
|
inbox: inbox,
|
||||||
notifications: notifications,
|
notifications: notifications,
|
||||||
showIntro: !await onboarding.introSeen(),
|
showIntro: !introSeen,
|
||||||
|
sharing: SharingSwitch(
|
||||||
|
settings: getIt<SocialSettings>(),
|
||||||
|
connection: connection,
|
||||||
|
enabled: sharingOn,
|
||||||
|
),
|
||||||
autoBackup: getIt.isRegistered<AutoBackupService>()
|
autoBackup: getIt.isRegistered<AutoBackupService>()
|
||||||
? getIt<AutoBackupService>()
|
? getIt<AutoBackupService>()
|
||||||
: null,
|
: null,
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:async/async.dart';
|
import 'package:async/async.dart';
|
||||||
import 'package:commons_core/commons_core.dart';
|
import 'package:commons_core/commons_core.dart';
|
||||||
import 'package:drift/drift.dart';
|
import 'package:drift/drift.dart';
|
||||||
|
|
@ -652,13 +654,27 @@ class VarietyRepository {
|
||||||
required this.idGen,
|
required this.idGen,
|
||||||
required this.nodeId,
|
required this.nodeId,
|
||||||
int Function()? nowMillis,
|
int Function()? nowMillis,
|
||||||
|
Uint8List? Function(Uint8List)? thumbnailBuilder,
|
||||||
}) : _now = nowMillis ?? (() => DateTime.now().millisecondsSinceEpoch),
|
}) : _now = nowMillis ?? (() => DateTime.now().millisecondsSinceEpoch),
|
||||||
|
_thumbnailBuilder = thumbnailBuilder,
|
||||||
_clock = Hlc.zero(nodeId);
|
_clock = Hlc.zero(nodeId);
|
||||||
|
|
||||||
final AppDatabase _db;
|
final AppDatabase _db;
|
||||||
final IdGen idGen;
|
final IdGen idGen;
|
||||||
final String nodeId;
|
final String nodeId;
|
||||||
final int Function() _now;
|
final int Function() _now;
|
||||||
|
|
||||||
|
/// Builds the small list-avatar thumbnail from a full photo. Injected (from
|
||||||
|
/// `services/offer_thumbnail.dart` in production) so the data layer stays free
|
||||||
|
/// of the image codec and unit tests run without decoding. Null → no
|
||||||
|
/// thumbnail is stored and the list falls back to the full photo.
|
||||||
|
final Uint8List? Function(Uint8List)? _thumbnailBuilder;
|
||||||
|
|
||||||
|
/// The thumbnail for [photoBytes], or null when no builder is wired or the
|
||||||
|
/// bytes aren't decodable. Wrapped in a Value for direct use in a companion.
|
||||||
|
Value<Uint8List?> _thumbValue(Uint8List photoBytes) =>
|
||||||
|
Value(_thumbnailBuilder?.call(photoBytes));
|
||||||
|
|
||||||
Hlc _clock;
|
Hlc _clock;
|
||||||
|
|
||||||
/// Emits the non-deleted inventory, ordered by category then label, each with
|
/// Emits the non-deleted inventory, ordered by category then label, each with
|
||||||
|
|
@ -696,7 +712,11 @@ class VarietyRepository {
|
||||||
_db.select(_db.species).watch().map((_) {}),
|
_db.select(_db.species).watch().map((_) {}),
|
||||||
_db.select(_db.lots).watch().map((_) {}),
|
_db.select(_db.lots).watch().map((_) {}),
|
||||||
]);
|
]);
|
||||||
return triggers.asyncMap(
|
// Coalesce bursts: a single quick-add or handover touches several of these
|
||||||
|
// tables at once, and each would otherwise re-run the full (7-query) load.
|
||||||
|
// Debouncing collapses the burst into one reload — decisive with a large
|
||||||
|
// inventory.
|
||||||
|
return _debounce(triggers, const Duration(milliseconds: 250)).asyncMap(
|
||||||
(_) async => (items: await _loadInventory(), drafts: await _loadDrafts()),
|
(_) async => (items: await _loadInventory(), drafts: await _loadDrafts()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -929,7 +949,10 @@ class VarietyRepository {
|
||||||
return rows.map((l) => l.varietyId).toSet();
|
return rows.map((l) => l.varietyId).toSet();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Loads the first photo BLOB for each of [varietyIds] (one query).
|
/// Loads the first photo's small [thumbnail] for each of [varietyIds] (one
|
||||||
|
/// query) — for the inventory-list avatar. Falls back to the full-resolution
|
||||||
|
/// [bytes] only when a thumbnail hasn't been generated yet (older rows,
|
||||||
|
/// pending lazy backfill), so the list stays correct meanwhile.
|
||||||
Future<Map<String, Uint8List>> _firstPhotosFor(
|
Future<Map<String, Uint8List>> _firstPhotosFor(
|
||||||
List<String> varietyIds,
|
List<String> varietyIds,
|
||||||
) async {
|
) async {
|
||||||
|
|
@ -950,17 +973,69 @@ class VarietyRepository {
|
||||||
.get();
|
.get();
|
||||||
final byVariety = <String, Uint8List>{};
|
final byVariety = <String, Uint8List>{};
|
||||||
for (final row in rows) {
|
for (final row in rows) {
|
||||||
final bytes = row.bytes;
|
final image = row.thumbnail ?? row.bytes;
|
||||||
if (bytes != null) byVariety.putIfAbsent(row.parentId, () => bytes);
|
if (image != null) byVariety.putIfAbsent(row.parentId, () => image);
|
||||||
}
|
}
|
||||||
return byVariety;
|
return byVariety;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Generates the missing list thumbnails for photos that predate the
|
||||||
|
/// thumbnail column (or arrived via sync/backup restore, which never carry
|
||||||
|
/// one). Processes in small batches so decoding doesn't block the UI; safe to
|
||||||
|
/// call at startup as fire-and-forget. No-op when no thumbnail builder is
|
||||||
|
/// wired. Returns how many thumbnails were written.
|
||||||
|
Future<int> backfillThumbnails({int batchSize = 20}) async {
|
||||||
|
final build = _thumbnailBuilder;
|
||||||
|
if (build == null) return 0;
|
||||||
|
var written = 0;
|
||||||
|
while (true) {
|
||||||
|
final batch =
|
||||||
|
await (_db.select(_db.attachments)
|
||||||
|
..where(
|
||||||
|
(a) =>
|
||||||
|
a.kind.equalsValue(AttachmentKind.photo) &
|
||||||
|
a.isDeleted.equals(false) &
|
||||||
|
a.thumbnail.isNull() &
|
||||||
|
a.bytes.isNotNull(),
|
||||||
|
)
|
||||||
|
..limit(batchSize))
|
||||||
|
.get();
|
||||||
|
if (batch.isEmpty) break;
|
||||||
|
for (final row in batch) {
|
||||||
|
final thumb = build(row.bytes!);
|
||||||
|
// No decodable image → store the full bytes as the "thumbnail" so this
|
||||||
|
// row isn't re-scanned forever. It's rare (corrupt photo) and still
|
||||||
|
// bounded by the avatar's cacheWidth at render time.
|
||||||
|
await (_db.update(_db.attachments)..where((a) => a.id.equals(row.id)))
|
||||||
|
.write(AttachmentsCompanion(thumbnail: Value(thumb ?? row.bytes)));
|
||||||
|
written++;
|
||||||
|
}
|
||||||
|
if (batch.length < batchSize) break;
|
||||||
|
}
|
||||||
|
return written;
|
||||||
|
}
|
||||||
|
|
||||||
/// The cover photo (lowest `sortOrder`) for a single variety, or null when it
|
/// The cover photo (lowest `sortOrder`) for a single variety, or null when it
|
||||||
/// has none. Used by the publish step to host an offer's image; reuses the
|
/// has none. Used by the publish step to host an offer's image, so it returns
|
||||||
/// same "first photo" rule as the inventory avatar.
|
/// the FULL-resolution [bytes] (not the list thumbnail).
|
||||||
Future<Uint8List?> coverPhotoFor(String varietyId) async =>
|
Future<Uint8List?> coverPhotoFor(String varietyId) async {
|
||||||
(await _firstPhotosFor([varietyId]))[varietyId];
|
final rows =
|
||||||
|
await (_db.select(_db.attachments)
|
||||||
|
..where(
|
||||||
|
(a) =>
|
||||||
|
a.parentId.equals(varietyId) &
|
||||||
|
a.parentType.equalsValue(ParentType.variety) &
|
||||||
|
a.kind.equalsValue(AttachmentKind.photo) &
|
||||||
|
a.isDeleted.equals(false),
|
||||||
|
)
|
||||||
|
..orderBy([
|
||||||
|
(a) => OrderingTerm(expression: a.sortOrder),
|
||||||
|
(a) => OrderingTerm(expression: a.createdAt),
|
||||||
|
])
|
||||||
|
..limit(1))
|
||||||
|
.get();
|
||||||
|
return rows.isEmpty ? null : rows.first.bytes;
|
||||||
|
}
|
||||||
|
|
||||||
/// Maps each of [speciesIds] to its scientific name (one query).
|
/// Maps each of [speciesIds] to its scientific name (one query).
|
||||||
Future<Map<String, String>> _scientificNamesFor(
|
Future<Map<String, String>> _scientificNamesFor(
|
||||||
|
|
@ -1040,6 +1115,7 @@ class VarietyRepository {
|
||||||
parentId: varietyId,
|
parentId: varietyId,
|
||||||
kind: AttachmentKind.photo,
|
kind: AttachmentKind.photo,
|
||||||
bytes: Value(photoBytes),
|
bytes: Value(photoBytes),
|
||||||
|
thumbnail: _thumbValue(photoBytes),
|
||||||
mimeType: const Value('image/jpeg'),
|
mimeType: const Value('image/jpeg'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -1080,6 +1156,7 @@ class VarietyRepository {
|
||||||
parentId: varietyId,
|
parentId: varietyId,
|
||||||
kind: AttachmentKind.photo,
|
kind: AttachmentKind.photo,
|
||||||
bytes: Value(photoBytes),
|
bytes: Value(photoBytes),
|
||||||
|
thumbnail: _thumbValue(photoBytes),
|
||||||
mimeType: const Value('image/jpeg'),
|
mimeType: const Value('image/jpeg'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -1795,6 +1872,7 @@ class VarietyRepository {
|
||||||
parentId: varietyId,
|
parentId: varietyId,
|
||||||
kind: AttachmentKind.photo,
|
kind: AttachmentKind.photo,
|
||||||
bytes: Value(bytes),
|
bytes: Value(bytes),
|
||||||
|
thumbnail: _thumbValue(bytes),
|
||||||
mimeType: const Value('image/jpeg'),
|
mimeType: const Value('image/jpeg'),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -3006,3 +3084,46 @@ class VarietyRepository {
|
||||||
return maxPacked == null ? null : Hlc.parse(maxPacked);
|
return maxPacked == null ? null : Hlc.parse(maxPacked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Emits the latest event from [source] only once [duration] has elapsed with
|
||||||
|
/// no newer event — collapsing a burst of rapid change-triggers into a single
|
||||||
|
/// downstream reload. Trailing-edge; single-subscription (matches the merged
|
||||||
|
/// Drift trigger stream it wraps).
|
||||||
|
Stream<T> _debounce<T>(Stream<T> source, Duration duration) {
|
||||||
|
late StreamController<T> controller;
|
||||||
|
StreamSubscription<T>? sub;
|
||||||
|
Timer? timer;
|
||||||
|
T? pending;
|
||||||
|
var hasPending = false;
|
||||||
|
|
||||||
|
void flush() {
|
||||||
|
if (hasPending) {
|
||||||
|
hasPending = false;
|
||||||
|
controller.add(pending as T);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
controller = StreamController<T>(
|
||||||
|
onListen: () {
|
||||||
|
sub = source.listen(
|
||||||
|
(value) {
|
||||||
|
pending = value;
|
||||||
|
hasPending = true;
|
||||||
|
timer?.cancel();
|
||||||
|
timer = Timer(duration, flush);
|
||||||
|
},
|
||||||
|
onError: controller.addError,
|
||||||
|
onDone: () {
|
||||||
|
timer?.cancel();
|
||||||
|
flush();
|
||||||
|
controller.close();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
onCancel: () async {
|
||||||
|
timer?.cancel();
|
||||||
|
await sub?.cancel();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
return controller.stream;
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ class AppDatabase extends _$AppDatabase {
|
||||||
|
|
||||||
/// Current schema version; also stamped into interchange exports so an
|
/// Current schema version; also stamped into interchange exports so an
|
||||||
/// importer knows which app generation wrote the file (data-model §7).
|
/// importer knows which app generation wrote the file (data-model §7).
|
||||||
static const int currentSchemaVersion = 13;
|
static const int currentSchemaVersion = 14;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get schemaVersion => currentSchemaVersion;
|
int get schemaVersion => currentSchemaVersion;
|
||||||
|
|
@ -196,9 +196,40 @@ class AppDatabase extends _$AppDatabase {
|
||||||
await m.createTable(gardenOutcomes);
|
await m.createTable(gardenOutcomes);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// v14: scalability for large inventories. A local, regenerable [thumbnail]
|
||||||
|
// BLOB on attachments (so the list never decodes full-resolution photos)
|
||||||
|
// plus indexes on the columns the inventory list filters/joins on. All
|
||||||
|
// additive and guarded, so a half-migrated dev database re-runs cleanly
|
||||||
|
// (see the v7 note above). Existing thumbnails are backfilled lazily in
|
||||||
|
// the background, not here (image decoding in a migration is slow/fragile).
|
||||||
|
if (from < 14) {
|
||||||
|
if (!await _hasColumn('attachments', 'thumbnail')) {
|
||||||
|
await m.addColumn(attachments, attachments.thumbnail);
|
||||||
|
}
|
||||||
|
// Declared as `@TableIndex` on the tables, so a fresh install gets them
|
||||||
|
// via createAll(); existing databases get them here. Guarded against a
|
||||||
|
// half-migrated dev database (see the v7 note above).
|
||||||
|
for (final index in [
|
||||||
|
idxVarietiesDeletedDraft,
|
||||||
|
idxAttachmentsParent,
|
||||||
|
idxLotsVariety,
|
||||||
|
]) {
|
||||||
|
if (!await _hasIndex(index.entityName)) await m.create(index);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// Whether an index named [name] already exists — keeps the additive v14
|
||||||
|
/// index creation idempotent against partially-migrated databases.
|
||||||
|
Future<bool> _hasIndex(String name) async {
|
||||||
|
final rows = await customSelect(
|
||||||
|
"SELECT 1 FROM sqlite_master WHERE type = 'index' AND name = ?",
|
||||||
|
variables: [Variable.withString(name)],
|
||||||
|
).get();
|
||||||
|
return rows.isNotEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
/// Whether a table named [table] already exists. Keeps the additive v8
|
/// Whether a table named [table] already exists. Keeps the additive v8
|
||||||
/// table creation idempotent against partially-migrated databases.
|
/// table creation idempotent against partially-migrated databases.
|
||||||
Future<bool> _hasTable(String table) async {
|
Future<bool> _hasTable(String table) async {
|
||||||
|
|
|
||||||
|
|
@ -7975,6 +7975,17 @@ class $AttachmentsTable extends Attachments
|
||||||
type: DriftSqlType.blob,
|
type: DriftSqlType.blob,
|
||||||
requiredDuringInsert: false,
|
requiredDuringInsert: false,
|
||||||
);
|
);
|
||||||
|
static const VerificationMeta _thumbnailMeta = const VerificationMeta(
|
||||||
|
'thumbnail',
|
||||||
|
);
|
||||||
|
@override
|
||||||
|
late final GeneratedColumn<Uint8List> thumbnail = GeneratedColumn<Uint8List>(
|
||||||
|
'thumbnail',
|
||||||
|
aliasedName,
|
||||||
|
true,
|
||||||
|
type: DriftSqlType.blob,
|
||||||
|
requiredDuringInsert: false,
|
||||||
|
);
|
||||||
static const VerificationMeta _mimeTypeMeta = const VerificationMeta(
|
static const VerificationMeta _mimeTypeMeta = const VerificationMeta(
|
||||||
'mimeType',
|
'mimeType',
|
||||||
);
|
);
|
||||||
|
|
@ -8011,6 +8022,7 @@ class $AttachmentsTable extends Attachments
|
||||||
kind,
|
kind,
|
||||||
uri,
|
uri,
|
||||||
bytes,
|
bytes,
|
||||||
|
thumbnail,
|
||||||
mimeType,
|
mimeType,
|
||||||
sortOrder,
|
sortOrder,
|
||||||
];
|
];
|
||||||
|
|
@ -8090,6 +8102,12 @@ class $AttachmentsTable extends Attachments
|
||||||
bytes.isAcceptableOrUnknown(data['bytes']!, _bytesMeta),
|
bytes.isAcceptableOrUnknown(data['bytes']!, _bytesMeta),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (data.containsKey('thumbnail')) {
|
||||||
|
context.handle(
|
||||||
|
_thumbnailMeta,
|
||||||
|
thumbnail.isAcceptableOrUnknown(data['thumbnail']!, _thumbnailMeta),
|
||||||
|
);
|
||||||
|
}
|
||||||
if (data.containsKey('mime_type')) {
|
if (data.containsKey('mime_type')) {
|
||||||
context.handle(
|
context.handle(
|
||||||
_mimeTypeMeta,
|
_mimeTypeMeta,
|
||||||
|
|
@ -8159,6 +8177,10 @@ class $AttachmentsTable extends Attachments
|
||||||
DriftSqlType.blob,
|
DriftSqlType.blob,
|
||||||
data['${effectivePrefix}bytes'],
|
data['${effectivePrefix}bytes'],
|
||||||
),
|
),
|
||||||
|
thumbnail: attachedDatabase.typeMapping.read(
|
||||||
|
DriftSqlType.blob,
|
||||||
|
data['${effectivePrefix}thumbnail'],
|
||||||
|
),
|
||||||
mimeType: attachedDatabase.typeMapping.read(
|
mimeType: attachedDatabase.typeMapping.read(
|
||||||
DriftSqlType.string,
|
DriftSqlType.string,
|
||||||
data['${effectivePrefix}mime_type'],
|
data['${effectivePrefix}mime_type'],
|
||||||
|
|
@ -8193,6 +8215,13 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
final AttachmentKind kind;
|
final AttachmentKind kind;
|
||||||
final String? uri;
|
final String? uri;
|
||||||
final Uint8List? bytes;
|
final Uint8List? bytes;
|
||||||
|
|
||||||
|
/// A small JPEG thumbnail of [bytes] (photos only), decoded once on save so
|
||||||
|
/// the inventory list never has to decode the full-resolution photo for a
|
||||||
|
/// 48px avatar. Purely derived, local and regenerable — it is EXCLUDED from
|
||||||
|
/// CRDT sync payloads and backups (see [SyncColumns] usage); a peer or a
|
||||||
|
/// restored backup regenerates it lazily via `backfillThumbnails`.
|
||||||
|
final Uint8List? thumbnail;
|
||||||
final String? mimeType;
|
final String? mimeType;
|
||||||
|
|
||||||
/// Display order among sibling attachments (lower first). The lowest-ordered
|
/// Display order among sibling attachments (lower first). The lowest-ordered
|
||||||
|
|
@ -8212,6 +8241,7 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
required this.kind,
|
required this.kind,
|
||||||
this.uri,
|
this.uri,
|
||||||
this.bytes,
|
this.bytes,
|
||||||
|
this.thumbnail,
|
||||||
this.mimeType,
|
this.mimeType,
|
||||||
required this.sortOrder,
|
required this.sortOrder,
|
||||||
});
|
});
|
||||||
|
|
@ -8241,6 +8271,9 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
if (!nullToAbsent || bytes != null) {
|
if (!nullToAbsent || bytes != null) {
|
||||||
map['bytes'] = Variable<Uint8List>(bytes);
|
map['bytes'] = Variable<Uint8List>(bytes);
|
||||||
}
|
}
|
||||||
|
if (!nullToAbsent || thumbnail != null) {
|
||||||
|
map['thumbnail'] = Variable<Uint8List>(thumbnail);
|
||||||
|
}
|
||||||
if (!nullToAbsent || mimeType != null) {
|
if (!nullToAbsent || mimeType != null) {
|
||||||
map['mime_type'] = Variable<String>(mimeType);
|
map['mime_type'] = Variable<String>(mimeType);
|
||||||
}
|
}
|
||||||
|
|
@ -8263,6 +8296,9 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
bytes: bytes == null && nullToAbsent
|
bytes: bytes == null && nullToAbsent
|
||||||
? const Value.absent()
|
? const Value.absent()
|
||||||
: Value(bytes),
|
: Value(bytes),
|
||||||
|
thumbnail: thumbnail == null && nullToAbsent
|
||||||
|
? const Value.absent()
|
||||||
|
: Value(thumbnail),
|
||||||
mimeType: mimeType == null && nullToAbsent
|
mimeType: mimeType == null && nullToAbsent
|
||||||
? const Value.absent()
|
? const Value.absent()
|
||||||
: Value(mimeType),
|
: Value(mimeType),
|
||||||
|
|
@ -8291,6 +8327,7 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
),
|
),
|
||||||
uri: serializer.fromJson<String?>(json['uri']),
|
uri: serializer.fromJson<String?>(json['uri']),
|
||||||
bytes: serializer.fromJson<Uint8List?>(json['bytes']),
|
bytes: serializer.fromJson<Uint8List?>(json['bytes']),
|
||||||
|
thumbnail: serializer.fromJson<Uint8List?>(json['thumbnail']),
|
||||||
mimeType: serializer.fromJson<String?>(json['mimeType']),
|
mimeType: serializer.fromJson<String?>(json['mimeType']),
|
||||||
sortOrder: serializer.fromJson<int>(json['sortOrder']),
|
sortOrder: serializer.fromJson<int>(json['sortOrder']),
|
||||||
);
|
);
|
||||||
|
|
@ -8314,6 +8351,7 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
),
|
),
|
||||||
'uri': serializer.toJson<String?>(uri),
|
'uri': serializer.toJson<String?>(uri),
|
||||||
'bytes': serializer.toJson<Uint8List?>(bytes),
|
'bytes': serializer.toJson<Uint8List?>(bytes),
|
||||||
|
'thumbnail': serializer.toJson<Uint8List?>(thumbnail),
|
||||||
'mimeType': serializer.toJson<String?>(mimeType),
|
'mimeType': serializer.toJson<String?>(mimeType),
|
||||||
'sortOrder': serializer.toJson<int>(sortOrder),
|
'sortOrder': serializer.toJson<int>(sortOrder),
|
||||||
};
|
};
|
||||||
|
|
@ -8331,6 +8369,7 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
AttachmentKind? kind,
|
AttachmentKind? kind,
|
||||||
Value<String?> uri = const Value.absent(),
|
Value<String?> uri = const Value.absent(),
|
||||||
Value<Uint8List?> bytes = const Value.absent(),
|
Value<Uint8List?> bytes = const Value.absent(),
|
||||||
|
Value<Uint8List?> thumbnail = const Value.absent(),
|
||||||
Value<String?> mimeType = const Value.absent(),
|
Value<String?> mimeType = const Value.absent(),
|
||||||
int? sortOrder,
|
int? sortOrder,
|
||||||
}) => Attachment(
|
}) => Attachment(
|
||||||
|
|
@ -8345,6 +8384,7 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
kind: kind ?? this.kind,
|
kind: kind ?? this.kind,
|
||||||
uri: uri.present ? uri.value : this.uri,
|
uri: uri.present ? uri.value : this.uri,
|
||||||
bytes: bytes.present ? bytes.value : this.bytes,
|
bytes: bytes.present ? bytes.value : this.bytes,
|
||||||
|
thumbnail: thumbnail.present ? thumbnail.value : this.thumbnail,
|
||||||
mimeType: mimeType.present ? mimeType.value : this.mimeType,
|
mimeType: mimeType.present ? mimeType.value : this.mimeType,
|
||||||
sortOrder: sortOrder ?? this.sortOrder,
|
sortOrder: sortOrder ?? this.sortOrder,
|
||||||
);
|
);
|
||||||
|
|
@ -8367,6 +8407,7 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
kind: data.kind.present ? data.kind.value : this.kind,
|
kind: data.kind.present ? data.kind.value : this.kind,
|
||||||
uri: data.uri.present ? data.uri.value : this.uri,
|
uri: data.uri.present ? data.uri.value : this.uri,
|
||||||
bytes: data.bytes.present ? data.bytes.value : this.bytes,
|
bytes: data.bytes.present ? data.bytes.value : this.bytes,
|
||||||
|
thumbnail: data.thumbnail.present ? data.thumbnail.value : this.thumbnail,
|
||||||
mimeType: data.mimeType.present ? data.mimeType.value : this.mimeType,
|
mimeType: data.mimeType.present ? data.mimeType.value : this.mimeType,
|
||||||
sortOrder: data.sortOrder.present ? data.sortOrder.value : this.sortOrder,
|
sortOrder: data.sortOrder.present ? data.sortOrder.value : this.sortOrder,
|
||||||
);
|
);
|
||||||
|
|
@ -8386,6 +8427,7 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
..write('kind: $kind, ')
|
..write('kind: $kind, ')
|
||||||
..write('uri: $uri, ')
|
..write('uri: $uri, ')
|
||||||
..write('bytes: $bytes, ')
|
..write('bytes: $bytes, ')
|
||||||
|
..write('thumbnail: $thumbnail, ')
|
||||||
..write('mimeType: $mimeType, ')
|
..write('mimeType: $mimeType, ')
|
||||||
..write('sortOrder: $sortOrder')
|
..write('sortOrder: $sortOrder')
|
||||||
..write(')'))
|
..write(')'))
|
||||||
|
|
@ -8405,6 +8447,7 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
kind,
|
kind,
|
||||||
uri,
|
uri,
|
||||||
$driftBlobEquality.hash(bytes),
|
$driftBlobEquality.hash(bytes),
|
||||||
|
$driftBlobEquality.hash(thumbnail),
|
||||||
mimeType,
|
mimeType,
|
||||||
sortOrder,
|
sortOrder,
|
||||||
);
|
);
|
||||||
|
|
@ -8423,6 +8466,7 @@ class Attachment extends DataClass implements Insertable<Attachment> {
|
||||||
other.kind == this.kind &&
|
other.kind == this.kind &&
|
||||||
other.uri == this.uri &&
|
other.uri == this.uri &&
|
||||||
$driftBlobEquality.equals(other.bytes, this.bytes) &&
|
$driftBlobEquality.equals(other.bytes, this.bytes) &&
|
||||||
|
$driftBlobEquality.equals(other.thumbnail, this.thumbnail) &&
|
||||||
other.mimeType == this.mimeType &&
|
other.mimeType == this.mimeType &&
|
||||||
other.sortOrder == this.sortOrder);
|
other.sortOrder == this.sortOrder);
|
||||||
}
|
}
|
||||||
|
|
@ -8439,6 +8483,7 @@ class AttachmentsCompanion extends UpdateCompanion<Attachment> {
|
||||||
final Value<AttachmentKind> kind;
|
final Value<AttachmentKind> kind;
|
||||||
final Value<String?> uri;
|
final Value<String?> uri;
|
||||||
final Value<Uint8List?> bytes;
|
final Value<Uint8List?> bytes;
|
||||||
|
final Value<Uint8List?> thumbnail;
|
||||||
final Value<String?> mimeType;
|
final Value<String?> mimeType;
|
||||||
final Value<int> sortOrder;
|
final Value<int> sortOrder;
|
||||||
final Value<int> rowid;
|
final Value<int> rowid;
|
||||||
|
|
@ -8454,6 +8499,7 @@ class AttachmentsCompanion extends UpdateCompanion<Attachment> {
|
||||||
this.kind = const Value.absent(),
|
this.kind = const Value.absent(),
|
||||||
this.uri = const Value.absent(),
|
this.uri = const Value.absent(),
|
||||||
this.bytes = const Value.absent(),
|
this.bytes = const Value.absent(),
|
||||||
|
this.thumbnail = const Value.absent(),
|
||||||
this.mimeType = const Value.absent(),
|
this.mimeType = const Value.absent(),
|
||||||
this.sortOrder = const Value.absent(),
|
this.sortOrder = const Value.absent(),
|
||||||
this.rowid = const Value.absent(),
|
this.rowid = const Value.absent(),
|
||||||
|
|
@ -8470,6 +8516,7 @@ class AttachmentsCompanion extends UpdateCompanion<Attachment> {
|
||||||
required AttachmentKind kind,
|
required AttachmentKind kind,
|
||||||
this.uri = const Value.absent(),
|
this.uri = const Value.absent(),
|
||||||
this.bytes = const Value.absent(),
|
this.bytes = const Value.absent(),
|
||||||
|
this.thumbnail = const Value.absent(),
|
||||||
this.mimeType = const Value.absent(),
|
this.mimeType = const Value.absent(),
|
||||||
this.sortOrder = const Value.absent(),
|
this.sortOrder = const Value.absent(),
|
||||||
this.rowid = const Value.absent(),
|
this.rowid = const Value.absent(),
|
||||||
|
|
@ -8492,6 +8539,7 @@ class AttachmentsCompanion extends UpdateCompanion<Attachment> {
|
||||||
Expression<String>? kind,
|
Expression<String>? kind,
|
||||||
Expression<String>? uri,
|
Expression<String>? uri,
|
||||||
Expression<Uint8List>? bytes,
|
Expression<Uint8List>? bytes,
|
||||||
|
Expression<Uint8List>? thumbnail,
|
||||||
Expression<String>? mimeType,
|
Expression<String>? mimeType,
|
||||||
Expression<int>? sortOrder,
|
Expression<int>? sortOrder,
|
||||||
Expression<int>? rowid,
|
Expression<int>? rowid,
|
||||||
|
|
@ -8508,6 +8556,7 @@ class AttachmentsCompanion extends UpdateCompanion<Attachment> {
|
||||||
if (kind != null) 'kind': kind,
|
if (kind != null) 'kind': kind,
|
||||||
if (uri != null) 'uri': uri,
|
if (uri != null) 'uri': uri,
|
||||||
if (bytes != null) 'bytes': bytes,
|
if (bytes != null) 'bytes': bytes,
|
||||||
|
if (thumbnail != null) 'thumbnail': thumbnail,
|
||||||
if (mimeType != null) 'mime_type': mimeType,
|
if (mimeType != null) 'mime_type': mimeType,
|
||||||
if (sortOrder != null) 'sort_order': sortOrder,
|
if (sortOrder != null) 'sort_order': sortOrder,
|
||||||
if (rowid != null) 'rowid': rowid,
|
if (rowid != null) 'rowid': rowid,
|
||||||
|
|
@ -8526,6 +8575,7 @@ class AttachmentsCompanion extends UpdateCompanion<Attachment> {
|
||||||
Value<AttachmentKind>? kind,
|
Value<AttachmentKind>? kind,
|
||||||
Value<String?>? uri,
|
Value<String?>? uri,
|
||||||
Value<Uint8List?>? bytes,
|
Value<Uint8List?>? bytes,
|
||||||
|
Value<Uint8List?>? thumbnail,
|
||||||
Value<String?>? mimeType,
|
Value<String?>? mimeType,
|
||||||
Value<int>? sortOrder,
|
Value<int>? sortOrder,
|
||||||
Value<int>? rowid,
|
Value<int>? rowid,
|
||||||
|
|
@ -8542,6 +8592,7 @@ class AttachmentsCompanion extends UpdateCompanion<Attachment> {
|
||||||
kind: kind ?? this.kind,
|
kind: kind ?? this.kind,
|
||||||
uri: uri ?? this.uri,
|
uri: uri ?? this.uri,
|
||||||
bytes: bytes ?? this.bytes,
|
bytes: bytes ?? this.bytes,
|
||||||
|
thumbnail: thumbnail ?? this.thumbnail,
|
||||||
mimeType: mimeType ?? this.mimeType,
|
mimeType: mimeType ?? this.mimeType,
|
||||||
sortOrder: sortOrder ?? this.sortOrder,
|
sortOrder: sortOrder ?? this.sortOrder,
|
||||||
rowid: rowid ?? this.rowid,
|
rowid: rowid ?? this.rowid,
|
||||||
|
|
@ -8588,6 +8639,9 @@ class AttachmentsCompanion extends UpdateCompanion<Attachment> {
|
||||||
if (bytes.present) {
|
if (bytes.present) {
|
||||||
map['bytes'] = Variable<Uint8List>(bytes.value);
|
map['bytes'] = Variable<Uint8List>(bytes.value);
|
||||||
}
|
}
|
||||||
|
if (thumbnail.present) {
|
||||||
|
map['thumbnail'] = Variable<Uint8List>(thumbnail.value);
|
||||||
|
}
|
||||||
if (mimeType.present) {
|
if (mimeType.present) {
|
||||||
map['mime_type'] = Variable<String>(mimeType.value);
|
map['mime_type'] = Variable<String>(mimeType.value);
|
||||||
}
|
}
|
||||||
|
|
@ -8614,6 +8668,7 @@ class AttachmentsCompanion extends UpdateCompanion<Attachment> {
|
||||||
..write('kind: $kind, ')
|
..write('kind: $kind, ')
|
||||||
..write('uri: $uri, ')
|
..write('uri: $uri, ')
|
||||||
..write('bytes: $bytes, ')
|
..write('bytes: $bytes, ')
|
||||||
|
..write('thumbnail: $thumbnail, ')
|
||||||
..write('mimeType: $mimeType, ')
|
..write('mimeType: $mimeType, ')
|
||||||
..write('sortOrder: $sortOrder, ')
|
..write('sortOrder: $sortOrder, ')
|
||||||
..write('rowid: $rowid')
|
..write('rowid: $rowid')
|
||||||
|
|
@ -11435,6 +11490,18 @@ abstract class _$AppDatabase extends GeneratedDatabase {
|
||||||
late final $ExternalLinksTable externalLinks = $ExternalLinksTable(this);
|
late final $ExternalLinksTable externalLinks = $ExternalLinksTable(this);
|
||||||
late final $PlantaresTable plantares = $PlantaresTable(this);
|
late final $PlantaresTable plantares = $PlantaresTable(this);
|
||||||
late final $SalesTable sales = $SalesTable(this);
|
late final $SalesTable sales = $SalesTable(this);
|
||||||
|
late final Index idxVarietiesDeletedDraft = Index(
|
||||||
|
'idx_varieties_deleted_draft',
|
||||||
|
'CREATE INDEX idx_varieties_deleted_draft ON varieties (is_deleted, is_draft)',
|
||||||
|
);
|
||||||
|
late final Index idxLotsVariety = Index(
|
||||||
|
'idx_lots_variety',
|
||||||
|
'CREATE INDEX idx_lots_variety ON lots (variety_id)',
|
||||||
|
);
|
||||||
|
late final Index idxAttachmentsParent = Index(
|
||||||
|
'idx_attachments_parent',
|
||||||
|
'CREATE INDEX idx_attachments_parent ON attachments (parent_type, parent_id, kind)',
|
||||||
|
);
|
||||||
@override
|
@override
|
||||||
Iterable<TableInfo<Table, Object?>> get allTables =>
|
Iterable<TableInfo<Table, Object?>> get allTables =>
|
||||||
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
allSchemaEntities.whereType<TableInfo<Table, Object?>>();
|
||||||
|
|
@ -11454,6 +11521,9 @@ abstract class _$AppDatabase extends GeneratedDatabase {
|
||||||
externalLinks,
|
externalLinks,
|
||||||
plantares,
|
plantares,
|
||||||
sales,
|
sales,
|
||||||
|
idxVarietiesDeletedDraft,
|
||||||
|
idxLotsVariety,
|
||||||
|
idxAttachmentsParent,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -15118,6 +15188,7 @@ typedef $$AttachmentsTableCreateCompanionBuilder =
|
||||||
required AttachmentKind kind,
|
required AttachmentKind kind,
|
||||||
Value<String?> uri,
|
Value<String?> uri,
|
||||||
Value<Uint8List?> bytes,
|
Value<Uint8List?> bytes,
|
||||||
|
Value<Uint8List?> thumbnail,
|
||||||
Value<String?> mimeType,
|
Value<String?> mimeType,
|
||||||
Value<int> sortOrder,
|
Value<int> sortOrder,
|
||||||
Value<int> rowid,
|
Value<int> rowid,
|
||||||
|
|
@ -15135,6 +15206,7 @@ typedef $$AttachmentsTableUpdateCompanionBuilder =
|
||||||
Value<AttachmentKind> kind,
|
Value<AttachmentKind> kind,
|
||||||
Value<String?> uri,
|
Value<String?> uri,
|
||||||
Value<Uint8List?> bytes,
|
Value<Uint8List?> bytes,
|
||||||
|
Value<Uint8List?> thumbnail,
|
||||||
Value<String?> mimeType,
|
Value<String?> mimeType,
|
||||||
Value<int> sortOrder,
|
Value<int> sortOrder,
|
||||||
Value<int> rowid,
|
Value<int> rowid,
|
||||||
|
|
@ -15206,6 +15278,11 @@ class $$AttachmentsTableFilterComposer
|
||||||
builder: (column) => ColumnFilters(column),
|
builder: (column) => ColumnFilters(column),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ColumnFilters<Uint8List> get thumbnail => $composableBuilder(
|
||||||
|
column: $table.thumbnail,
|
||||||
|
builder: (column) => ColumnFilters(column),
|
||||||
|
);
|
||||||
|
|
||||||
ColumnFilters<String> get mimeType => $composableBuilder(
|
ColumnFilters<String> get mimeType => $composableBuilder(
|
||||||
column: $table.mimeType,
|
column: $table.mimeType,
|
||||||
builder: (column) => ColumnFilters(column),
|
builder: (column) => ColumnFilters(column),
|
||||||
|
|
@ -15281,6 +15358,11 @@ class $$AttachmentsTableOrderingComposer
|
||||||
builder: (column) => ColumnOrderings(column),
|
builder: (column) => ColumnOrderings(column),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ColumnOrderings<Uint8List> get thumbnail => $composableBuilder(
|
||||||
|
column: $table.thumbnail,
|
||||||
|
builder: (column) => ColumnOrderings(column),
|
||||||
|
);
|
||||||
|
|
||||||
ColumnOrderings<String> get mimeType => $composableBuilder(
|
ColumnOrderings<String> get mimeType => $composableBuilder(
|
||||||
column: $table.mimeType,
|
column: $table.mimeType,
|
||||||
builder: (column) => ColumnOrderings(column),
|
builder: (column) => ColumnOrderings(column),
|
||||||
|
|
@ -15341,6 +15423,9 @@ class $$AttachmentsTableAnnotationComposer
|
||||||
GeneratedColumn<Uint8List> get bytes =>
|
GeneratedColumn<Uint8List> get bytes =>
|
||||||
$composableBuilder(column: $table.bytes, builder: (column) => column);
|
$composableBuilder(column: $table.bytes, builder: (column) => column);
|
||||||
|
|
||||||
|
GeneratedColumn<Uint8List> get thumbnail =>
|
||||||
|
$composableBuilder(column: $table.thumbnail, builder: (column) => column);
|
||||||
|
|
||||||
GeneratedColumn<String> get mimeType =>
|
GeneratedColumn<String> get mimeType =>
|
||||||
$composableBuilder(column: $table.mimeType, builder: (column) => column);
|
$composableBuilder(column: $table.mimeType, builder: (column) => column);
|
||||||
|
|
||||||
|
|
@ -15390,6 +15475,7 @@ class $$AttachmentsTableTableManager
|
||||||
Value<AttachmentKind> kind = const Value.absent(),
|
Value<AttachmentKind> kind = const Value.absent(),
|
||||||
Value<String?> uri = const Value.absent(),
|
Value<String?> uri = const Value.absent(),
|
||||||
Value<Uint8List?> bytes = const Value.absent(),
|
Value<Uint8List?> bytes = const Value.absent(),
|
||||||
|
Value<Uint8List?> thumbnail = const Value.absent(),
|
||||||
Value<String?> mimeType = const Value.absent(),
|
Value<String?> mimeType = const Value.absent(),
|
||||||
Value<int> sortOrder = const Value.absent(),
|
Value<int> sortOrder = const Value.absent(),
|
||||||
Value<int> rowid = const Value.absent(),
|
Value<int> rowid = const Value.absent(),
|
||||||
|
|
@ -15405,6 +15491,7 @@ class $$AttachmentsTableTableManager
|
||||||
kind: kind,
|
kind: kind,
|
||||||
uri: uri,
|
uri: uri,
|
||||||
bytes: bytes,
|
bytes: bytes,
|
||||||
|
thumbnail: thumbnail,
|
||||||
mimeType: mimeType,
|
mimeType: mimeType,
|
||||||
sortOrder: sortOrder,
|
sortOrder: sortOrder,
|
||||||
rowid: rowid,
|
rowid: rowid,
|
||||||
|
|
@ -15422,6 +15509,7 @@ class $$AttachmentsTableTableManager
|
||||||
required AttachmentKind kind,
|
required AttachmentKind kind,
|
||||||
Value<String?> uri = const Value.absent(),
|
Value<String?> uri = const Value.absent(),
|
||||||
Value<Uint8List?> bytes = const Value.absent(),
|
Value<Uint8List?> bytes = const Value.absent(),
|
||||||
|
Value<Uint8List?> thumbnail = const Value.absent(),
|
||||||
Value<String?> mimeType = const Value.absent(),
|
Value<String?> mimeType = const Value.absent(),
|
||||||
Value<int> sortOrder = const Value.absent(),
|
Value<int> sortOrder = const Value.absent(),
|
||||||
Value<int> rowid = const Value.absent(),
|
Value<int> rowid = const Value.absent(),
|
||||||
|
|
@ -15437,6 +15525,7 @@ class $$AttachmentsTableTableManager
|
||||||
kind: kind,
|
kind: kind,
|
||||||
uri: uri,
|
uri: uri,
|
||||||
bytes: bytes,
|
bytes: bytes,
|
||||||
|
thumbnail: thumbnail,
|
||||||
mimeType: mimeType,
|
mimeType: mimeType,
|
||||||
sortOrder: sortOrder,
|
sortOrder: sortOrder,
|
||||||
rowid: rowid,
|
rowid: rowid,
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@ import 'sync_columns.dart';
|
||||||
|
|
||||||
/// The identity/accession — one row per distinct thing in the inventory.
|
/// The identity/accession — one row per distinct thing in the inventory.
|
||||||
/// Only [label] is mandatory (progressive disclosure).
|
/// Only [label] is mandatory (progressive disclosure).
|
||||||
|
///
|
||||||
|
/// The index covers the inventory list's hot filter — non-deleted, non-draft
|
||||||
|
/// rows — so it stays fast with a large catalogue.
|
||||||
|
@TableIndex(name: 'idx_varieties_deleted_draft', columns: {#isDeleted, #isDraft})
|
||||||
class Varieties extends Table with SyncColumns {
|
class Varieties extends Table with SyncColumns {
|
||||||
TextColumn get label => text()();
|
TextColumn get label => text()();
|
||||||
TextColumn get speciesId => text().nullable()(); // → Species
|
TextColumn get speciesId => text().nullable()(); // → Species
|
||||||
|
|
@ -77,6 +81,10 @@ class SpeciesCommonNames extends Table with SyncColumns {
|
||||||
|
|
||||||
/// A homogeneous batch held for a Variety — its own year and its own unit.
|
/// A homogeneous batch held for a Variety — its own year and its own unit.
|
||||||
/// Quantity (commons_core value type) is flattened into columns here.
|
/// Quantity (commons_core value type) is flattened into columns here.
|
||||||
|
///
|
||||||
|
/// Indexed by [varietyId] — the inventory list joins lots per variety (types,
|
||||||
|
/// shared status, viability), so this avoids a full scan per reload.
|
||||||
|
@TableIndex(name: 'idx_lots_variety', columns: {#varietyId})
|
||||||
class Lots extends Table with SyncColumns {
|
class Lots extends Table with SyncColumns {
|
||||||
TextColumn get varietyId => text()();
|
TextColumn get varietyId => text()();
|
||||||
TextColumn get type =>
|
TextColumn get type =>
|
||||||
|
|
@ -181,12 +189,26 @@ class Parties extends Table with SyncColumns {
|
||||||
/// rest by SQLCipher) via [bytes]; external files use [uri]. Storing bytes here
|
/// rest by SQLCipher) via [bytes]; external files use [uri]. Storing bytes here
|
||||||
/// keeps the "no plaintext at rest" rule for photos in Block 1; an external
|
/// keeps the "no plaintext at rest" rule for photos in Block 1; an external
|
||||||
/// encrypted file store is a later optimization.
|
/// encrypted file store is a later optimization.
|
||||||
|
///
|
||||||
|
/// Indexed by (parentType, parentId, kind) — the list's "first photo per
|
||||||
|
/// variety" lookup filters on exactly these.
|
||||||
|
@TableIndex(
|
||||||
|
name: 'idx_attachments_parent',
|
||||||
|
columns: {#parentType, #parentId, #kind},
|
||||||
|
)
|
||||||
class Attachments extends Table with SyncColumns {
|
class Attachments extends Table with SyncColumns {
|
||||||
TextColumn get parentType => textEnum<ParentType>()();
|
TextColumn get parentType => textEnum<ParentType>()();
|
||||||
TextColumn get parentId => text()();
|
TextColumn get parentId => text()();
|
||||||
TextColumn get kind => textEnum<AttachmentKind>()();
|
TextColumn get kind => textEnum<AttachmentKind>()();
|
||||||
TextColumn get uri => text().nullable()();
|
TextColumn get uri => text().nullable()();
|
||||||
BlobColumn get bytes => blob().nullable()();
|
BlobColumn get bytes => blob().nullable()();
|
||||||
|
|
||||||
|
/// A small JPEG thumbnail of [bytes] (photos only), decoded once on save so
|
||||||
|
/// the inventory list never has to decode the full-resolution photo for a
|
||||||
|
/// 48px avatar. Purely derived, local and regenerable — it is EXCLUDED from
|
||||||
|
/// CRDT sync payloads and backups (see [SyncColumns] usage); a peer or a
|
||||||
|
/// restored backup regenerates it lazily via `backfillThumbnails`.
|
||||||
|
BlobColumn get thumbnail => blob().nullable()();
|
||||||
TextColumn get mimeType => text().nullable()();
|
TextColumn get mimeType => text().nullable()();
|
||||||
|
|
||||||
/// Display order among sibling attachments (lower first). The lowest-ordered
|
/// Display order among sibling attachments (lower first). The lowest-ordered
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import '../services/file_service.dart';
|
||||||
import '../services/inbox_service.dart';
|
import '../services/inbox_service.dart';
|
||||||
import '../services/locale_store.dart';
|
import '../services/locale_store.dart';
|
||||||
import '../services/notification_service.dart';
|
import '../services/notification_service.dart';
|
||||||
|
import '../services/offer_thumbnail.dart';
|
||||||
import '../services/ocr/label_text_extractor.dart';
|
import '../services/ocr/label_text_extractor.dart';
|
||||||
import '../services/ocr/ocr_language.dart';
|
import '../services/ocr/ocr_language.dart';
|
||||||
import '../services/ocr/tesseract_label_extractor.dart';
|
import '../services/ocr/tesseract_label_extractor.dart';
|
||||||
|
|
@ -152,7 +153,11 @@ Future<void> configureDependencies() async {
|
||||||
database,
|
database,
|
||||||
idGen: IdGen(),
|
idGen: IdGen(),
|
||||||
nodeId: nodeId,
|
nodeId: nodeId,
|
||||||
|
thumbnailBuilder: inventoryThumbnailBytes,
|
||||||
);
|
);
|
||||||
|
// Backfill list thumbnails for photos that predate the thumbnail column (or
|
||||||
|
// arrived via a restored backup). Fire-and-forget so startup isn't blocked.
|
||||||
|
unawaited(varietyRepository.backfillThumbnails());
|
||||||
|
|
||||||
const fileService = FilePickerFileService();
|
const fileService = FilePickerFileService();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,7 @@
|
||||||
"cancel": "Encaboxar",
|
"cancel": "Encaboxar",
|
||||||
"delete": "Desaniciar",
|
"delete": "Desaniciar",
|
||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"type": "Triba",
|
"type": "Triba"
|
||||||
"comingSoon": "Aína"
|
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"tagline": "Comparte y cultiva simiente llocal",
|
"tagline": "Comparte y cultiva simiente llocal",
|
||||||
|
|
@ -94,6 +93,7 @@
|
||||||
"langEs": "Español",
|
"langEs": "Español",
|
||||||
"langEn": "English",
|
"langEn": "English",
|
||||||
"langPt": "Português",
|
"langPt": "Português",
|
||||||
|
"langPtBr": "Português (Brasil)",
|
||||||
"langAst": "Asturianu",
|
"langAst": "Asturianu",
|
||||||
"langFr": "Français",
|
"langFr": "Français",
|
||||||
"langDe": "Deutsch",
|
"langDe": "Deutsch",
|
||||||
|
|
@ -146,9 +146,9 @@
|
||||||
"license": "Llicencia",
|
"license": "Llicencia",
|
||||||
"licenseValue": "AGPL-3.0",
|
"licenseValue": "AGPL-3.0",
|
||||||
"website": "Sitiu web",
|
"website": "Sitiu web",
|
||||||
"sourceCode": "Códigu fonte",
|
"sourceCode": "Códigu fonte",
|
||||||
"translate": "Ayuda a traducir",
|
"translate": "Ayuda a traducir",
|
||||||
"translateSubtitle": "Ayuda a traer Tane a la to llingua",
|
"translateSubtitle": "Ayuda a traer Tane a la to llingua",
|
||||||
"openSourceLicenses": "Llicencies de códigu abiertu",
|
"openSourceLicenses": "Llicencies de códigu abiertu",
|
||||||
"openSourceLicensesSubtitle": "Biblioteques de terceros y les sos llicencies",
|
"openSourceLicensesSubtitle": "Biblioteques de terceros y les sos llicencies",
|
||||||
"copyright": "© {years} Asociación Comunes, baxo AGPLv3"
|
"copyright": "© {years} Asociación Comunes, baxo AGPLv3"
|
||||||
|
|
@ -515,7 +515,7 @@
|
||||||
"contact": "Mensaxe",
|
"contact": "Mensaxe",
|
||||||
"mine": "Tu",
|
"mine": "Tu",
|
||||||
"configTitle": "Configuración de compartir",
|
"configTitle": "Configuración de compartir",
|
||||||
"setupIntro": "Compartir con xente cercano ye opcional. Namás indica la to zona averada — yá tas coneutáu a servidores comunitarios compartíos pa qu'otres persones atopen lo qu'ufiertes, ensin nenguna empresa en mediu.",
|
"setupIntro": "Compartir con xente cercano ye opcional. Namás indica la to zona averada — lo qu'ufiertes viaxa per servidores comunitarios, calteníos por persones y coleutivos, non por una empresa, pa qu'otres persones cercanes puedan atopalo.",
|
||||||
"areaLabel": "La to zona",
|
"areaLabel": "La to zona",
|
||||||
"areaHelp": "Caltiénse averao a costafecha — la to zona, enxamás un puntu esactu.",
|
"areaHelp": "Caltiénse averao a costafecha — la to zona, enxamás un puntu esactu.",
|
||||||
"areaSet": "La to zona ta puesta — averada, enxamás el to puntu esactu",
|
"areaSet": "La to zona ta puesta — averada, enxamás el to puntu esactu",
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,6 @@
|
||||||
"delete": "Löschen",
|
"delete": "Löschen",
|
||||||
"edit": "Bearbeiten",
|
"edit": "Bearbeiten",
|
||||||
"type": "Typ",
|
"type": "Typ",
|
||||||
"comingSoon": "Bald",
|
|
||||||
"offline": "Offline - Teilen ist unterbrochen"
|
"offline": "Offline - Teilen ist unterbrochen"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
|
|
@ -95,6 +94,7 @@
|
||||||
"langEs": "Español",
|
"langEs": "Español",
|
||||||
"langEn": "English",
|
"langEn": "English",
|
||||||
"langPt": "Português",
|
"langPt": "Português",
|
||||||
|
"langPtBr": "Português (Brasil)",
|
||||||
"langAst": "Asturianu",
|
"langAst": "Asturianu",
|
||||||
"about": "Über",
|
"about": "Über",
|
||||||
"aboutText": "Lokale, verschlüsselte Saatgutbank für traditionelle Samen. AGPL-3.0.",
|
"aboutText": "Lokale, verschlüsselte Saatgutbank für traditionelle Samen. AGPL-3.0.",
|
||||||
|
|
@ -147,9 +147,9 @@
|
||||||
"license": "Lizenz",
|
"license": "Lizenz",
|
||||||
"licenseValue": "AGPL-3.0",
|
"licenseValue": "AGPL-3.0",
|
||||||
"website": "Webseite",
|
"website": "Webseite",
|
||||||
"sourceCode": "Quellcode",
|
"sourceCode": "Quellcode",
|
||||||
"translate": "Beim Übersetzen helfen",
|
"translate": "Beim Übersetzen helfen",
|
||||||
"translateSubtitle": "Hilf, Tane in deine Sprache zu bringen",
|
"translateSubtitle": "Hilf, Tane in deine Sprache zu bringen",
|
||||||
"openSourceLicenses": "Open-Source-Lizenzen",
|
"openSourceLicenses": "Open-Source-Lizenzen",
|
||||||
"openSourceLicensesSubtitle": "Bibliotheken von Drittanbietern und ihre Lizenzen",
|
"openSourceLicensesSubtitle": "Bibliotheken von Drittanbietern und ihre Lizenzen",
|
||||||
"copyright": "© {years} Comunes Association, unter AGPLv3"
|
"copyright": "© {years} Comunes Association, unter AGPLv3"
|
||||||
|
|
@ -518,7 +518,7 @@
|
||||||
"contact": "Nachricht",
|
"contact": "Nachricht",
|
||||||
"mine": "Du",
|
"mine": "Du",
|
||||||
"configTitle": "Teilen-Einrichtung",
|
"configTitle": "Teilen-Einrichtung",
|
||||||
"setupIntro": "Teilen mit Menschen in der Nähe ist optional. Gib einfach dein ungefähres Gebiet an - du bist bereits mit freigegebenen Gemeinschaftsservern verbunden, damit Leute das finden können, das du anbietest, ohne ein Unternehmen dazwischen.",
|
"setupIntro": "Teilen mit Menschen in der Nähe ist optional. Gib einfach dein ungefähres Gebiet an - was du anbietest, läuft über Gemeinschaftsserver, die von Menschen und Kollektiven betrieben werden, nicht von einem Unternehmen, damit andere in deiner Nähe es finden können.",
|
||||||
"areaLabel": "Dein Gebiet",
|
"areaLabel": "Dein Gebiet",
|
||||||
"areaHelp": "Absichtlich grob gehalten - deine Zone, nie ein genauer Punkt.",
|
"areaHelp": "Absichtlich grob gehalten - deine Zone, nie ein genauer Punkt.",
|
||||||
"areaSet": "Dein Gebiet ist gesetzt - grob, nie dein genauer Punkt",
|
"areaSet": "Dein Gebiet ist gesetzt - grob, nie dein genauer Punkt",
|
||||||
|
|
@ -723,4 +723,4 @@
|
||||||
"manageEmpty": "Du hast niemanden blockiert",
|
"manageEmpty": "Du hast niemanden blockiert",
|
||||||
"unblock": "Entsperren"
|
"unblock": "Entsperren"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -59,7 +59,6 @@
|
||||||
"delete": "Supprimer",
|
"delete": "Supprimer",
|
||||||
"edit": "Modifier",
|
"edit": "Modifier",
|
||||||
"type": "Type",
|
"type": "Type",
|
||||||
"comingSoon": "À venir",
|
|
||||||
"offline": "Vous êtes hors ligne — le partage est en pause"
|
"offline": "Vous êtes hors ligne — le partage est en pause"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
|
|
@ -95,6 +94,7 @@
|
||||||
"langEs": "Español",
|
"langEs": "Español",
|
||||||
"langEn": "English",
|
"langEn": "English",
|
||||||
"langPt": "Português",
|
"langPt": "Português",
|
||||||
|
"langPtBr": "Português (Brasil)",
|
||||||
"langAst": "Asturianu",
|
"langAst": "Asturianu",
|
||||||
"langFr": "Français",
|
"langFr": "Français",
|
||||||
"langDe": "Deutsch",
|
"langDe": "Deutsch",
|
||||||
|
|
@ -147,9 +147,9 @@
|
||||||
"license": "Licence",
|
"license": "Licence",
|
||||||
"licenseValue": "AGPL-3.0",
|
"licenseValue": "AGPL-3.0",
|
||||||
"website": "Site web",
|
"website": "Site web",
|
||||||
"sourceCode": "Code source",
|
"sourceCode": "Code source",
|
||||||
"translate": "Aider à traduire",
|
"translate": "Aider à traduire",
|
||||||
"translateSubtitle": "Aidez à traduire Tane dans votre langue",
|
"translateSubtitle": "Aidez à traduire Tane dans votre langue",
|
||||||
"openSourceLicenses": "Licences open source",
|
"openSourceLicenses": "Licences open source",
|
||||||
"openSourceLicensesSubtitle": "Bibliothèques tiers et leurs licences",
|
"openSourceLicensesSubtitle": "Bibliothèques tiers et leurs licences",
|
||||||
"copyright": "© {years} Association Comunes, sous AGPLv3"
|
"copyright": "© {years} Association Comunes, sous AGPLv3"
|
||||||
|
|
@ -518,7 +518,7 @@
|
||||||
"contact": "Message",
|
"contact": "Message",
|
||||||
"mine": "Vous",
|
"mine": "Vous",
|
||||||
"configTitle": "Configuration du partage",
|
"configTitle": "Configuration du partage",
|
||||||
"setupIntro": "Le partage avec les gens à proximité est optionnel. Définissez simplement votre zone approximative — vous êtes déjà connectés aux serveurs communautaires partagés pour que les gens trouvent ce que vous offrez, sans aucune entreprise au milieu.",
|
"setupIntro": "Le partage avec les gens à proximité est optionnel. Définissez simplement votre zone approximative — ce que vous offrez passe par des serveurs communautaires, tenus par des personnes et des collectifs et non par une entreprise, pour que d'autres près de chez vous puissent le trouver.",
|
||||||
"areaLabel": "Votre zone",
|
"areaLabel": "Votre zone",
|
||||||
"areaHelp": "Gardée approximative volontairement — votre zone, jamais un point exact.",
|
"areaHelp": "Gardée approximative volontairement — votre zone, jamais un point exact.",
|
||||||
"areaSet": "Votre zone est définie — approximative, jamais votre point exact",
|
"areaSet": "Votre zone est définie — approximative, jamais votre point exact",
|
||||||
|
|
|
||||||
|
|
@ -1,46 +1,46 @@
|
||||||
{
|
{
|
||||||
"app": {
|
"app": {
|
||||||
"title": "Tane"
|
"title": "Tane"
|
||||||
},
|
},
|
||||||
"common": {
|
"common": {
|
||||||
"save": "保存",
|
"save": "保存",
|
||||||
"cancel": "キャンセル",
|
"cancel": "キャンセル",
|
||||||
"delete": "削除",
|
"delete": "削除",
|
||||||
"edit": "編集",
|
"edit": "編集",
|
||||||
"type": "種類",
|
"type": "種類",
|
||||||
"comingSoon": "近日公開",
|
"offline": "オフラインです — 共有を一時停止しています"
|
||||||
"offline": "オフラインです — 共有を一時停止しています"
|
},
|
||||||
},
|
"menu": {
|
||||||
"menu": {
|
"tagline": "あなたの種子バンク",
|
||||||
"tagline": "あなたの種子バンク",
|
"inventory": "在庫",
|
||||||
"inventory": "在庫",
|
"market": "マーケット",
|
||||||
"market": "マーケット",
|
"profile": "プロフィール",
|
||||||
"profile": "プロフィール",
|
"chat": "チャット",
|
||||||
"chat": "チャット",
|
"wishlist": "お気に入り",
|
||||||
"wishlist": "お気に入り",
|
"following": "フォロー中",
|
||||||
"following": "フォロー中",
|
"calendar": "カレンダー",
|
||||||
"calendar": "カレンダー",
|
"settings": "設定"
|
||||||
"settings": "設定"
|
},
|
||||||
},
|
"settings": {
|
||||||
"settings": {
|
"language": "言語",
|
||||||
"language": "言語",
|
"systemLanguage": "システムの言語",
|
||||||
"systemLanguage": "システムの言語",
|
"langEs": "Español",
|
||||||
"langEs": "Español",
|
"langEn": "English",
|
||||||
"langEn": "English",
|
"langPt": "Português",
|
||||||
"langPt": "Português",
|
"langPtBr": "Português (Brasil)",
|
||||||
"langAst": "Asturianu",
|
"langAst": "Asturianu",
|
||||||
"langFr": "Français",
|
"langFr": "Français",
|
||||||
"langDe": "Deutsch",
|
"langDe": "Deutsch",
|
||||||
"langJa": "日本語",
|
"langJa": "日本語",
|
||||||
"about": "このアプリについて",
|
"about": "このアプリについて",
|
||||||
"aboutText": "在来種のためのローカルファースト・暗号化在庫管理。AGPL-3.0。",
|
"aboutText": "在来種のためのローカルファースト・暗号化在庫管理。AGPL-3.0。",
|
||||||
"aboutOpen": "Tane について"
|
"aboutOpen": "Tane について"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
"tagline": "地域の種を分かち合い、育てよう",
|
"tagline": "地域の種を分かち合い、育てよう",
|
||||||
"openMarket": "マーケット",
|
"openMarket": "マーケット",
|
||||||
"openMarketSubtitle": "近くの種を見つけて分かち合う",
|
"openMarketSubtitle": "近くの種を見つけて分かち合う",
|
||||||
"yourInventory": "あなたの在庫",
|
"yourInventory": "あなたの在庫",
|
||||||
"yourInventorySubtitle": "種を管理する"
|
"yourInventorySubtitle": "種を管理する"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,19 @@
|
||||||
"remove": "Remover dos favoritos",
|
"remove": "Remover dos favoritos",
|
||||||
"unavailable": "Já não está disponível"
|
"unavailable": "Já não está disponível"
|
||||||
},
|
},
|
||||||
|
"savedSearches": {
|
||||||
|
"title": "Pesquisas guardadas",
|
||||||
|
"empty": "Ainda não há pesquisas guardadas. Guarda uma pesquisa no mercado e avisamos-te quando aparecer algo parecido na tua zona.",
|
||||||
|
"save": "Guardar esta pesquisa",
|
||||||
|
"nameLabel": "Dá um nome a esta pesquisa",
|
||||||
|
"namePlaceholder": "ex.: Tomates perto de mim",
|
||||||
|
"saved": "Pesquisa guardada — vamos avisar-te sobre novas correspondências perto de ti",
|
||||||
|
"openTooltip": "Pesquisas guardadas",
|
||||||
|
"delete": "Eliminar",
|
||||||
|
"deleteConfirm": "Eliminar esta pesquisa guardada?",
|
||||||
|
"newMatchesBadge": "{n} novas",
|
||||||
|
"alert": "Sementes perto de ti: {label}"
|
||||||
|
},
|
||||||
"seedSaving": {
|
"seedSaving": {
|
||||||
"title": "Guardar a sua semente",
|
"title": "Guardar a sua semente",
|
||||||
"subtitle": "O que é preciso para manter a variedade fiel",
|
"subtitle": "O que é preciso para manter a variedade fiel",
|
||||||
|
|
@ -59,7 +72,6 @@
|
||||||
"delete": "Eliminar",
|
"delete": "Eliminar",
|
||||||
"edit": "Editar",
|
"edit": "Editar",
|
||||||
"type": "Tipo",
|
"type": "Tipo",
|
||||||
"comingSoon": "Em breve",
|
|
||||||
"offline": "Sem ligação — a partilha está em pausa"
|
"offline": "Sem ligação — a partilha está em pausa"
|
||||||
},
|
},
|
||||||
"home": {
|
"home": {
|
||||||
|
|
@ -95,6 +107,7 @@
|
||||||
"langEs": "Español",
|
"langEs": "Español",
|
||||||
"langEn": "English",
|
"langEn": "English",
|
||||||
"langPt": "Português",
|
"langPt": "Português",
|
||||||
|
"langPtBr": "Português (Brasil)",
|
||||||
"langAst": "Asturianu",
|
"langAst": "Asturianu",
|
||||||
"langFr": "Français",
|
"langFr": "Français",
|
||||||
"langDe": "Deutsch",
|
"langDe": "Deutsch",
|
||||||
|
|
@ -147,9 +160,9 @@
|
||||||
"license": "Licença",
|
"license": "Licença",
|
||||||
"licenseValue": "AGPL-3.0",
|
"licenseValue": "AGPL-3.0",
|
||||||
"website": "Sítio web",
|
"website": "Sítio web",
|
||||||
"sourceCode": "Código-fonte",
|
"sourceCode": "Código-fonte",
|
||||||
"translate": "Ajuda a traduzir",
|
"translate": "Ajuda a traduzir",
|
||||||
"translateSubtitle": "Ajuda a trazer o Tane para o teu idioma",
|
"translateSubtitle": "Ajuda a trazer o Tane para o teu idioma",
|
||||||
"openSourceLicenses": "Licenças de código aberto",
|
"openSourceLicenses": "Licenças de código aberto",
|
||||||
"openSourceLicensesSubtitle": "Bibliotecas de terceiros e as suas licenças",
|
"openSourceLicensesSubtitle": "Bibliotecas de terceiros e as suas licenças",
|
||||||
"copyright": "© {years} Associação Comunes, sob AGPLv3"
|
"copyright": "© {years} Associação Comunes, sob AGPLv3"
|
||||||
|
|
@ -226,6 +239,10 @@
|
||||||
"addLink": "Adicionar ligação",
|
"addLink": "Adicionar ligação",
|
||||||
"linkUrl": "URL",
|
"linkUrl": "URL",
|
||||||
"linkTitle": "Título (opcional)",
|
"linkTitle": "Título (opcional)",
|
||||||
|
"reference": "Saber mais",
|
||||||
|
"refGbif": "GBIF",
|
||||||
|
"refWikipedia": "Wikipédia",
|
||||||
|
"refWikispecies": "Wikispecies",
|
||||||
"notes": "Notas",
|
"notes": "Notas",
|
||||||
"addLot": "Adicionar lote",
|
"addLot": "Adicionar lote",
|
||||||
"editLot": "Editar lote",
|
"editLot": "Editar lote",
|
||||||
|
|
@ -351,6 +368,15 @@
|
||||||
"saved": "Etiquetas guardadas",
|
"saved": "Etiquetas guardadas",
|
||||||
"cancelled": "Cancelado"
|
"cancelled": "Cancelado"
|
||||||
},
|
},
|
||||||
|
"scan": {
|
||||||
|
"action": "Digitalizar um rótulo de semente",
|
||||||
|
"title": "Digitalizar um rótulo",
|
||||||
|
"notALabel": "Esse código não é um rótulo de semente",
|
||||||
|
"addTitle": "Não está na tua coleção",
|
||||||
|
"addBody": "Adicionar “{label}” às tuas sementes?",
|
||||||
|
"add": "Adicionar",
|
||||||
|
"added": "Adicionado à tua coleção"
|
||||||
|
},
|
||||||
"cropCalendar": {
|
"cropCalendar": {
|
||||||
"add": "Calendário de cultivo",
|
"add": "Calendário de cultivo",
|
||||||
"title": "Calendário de cultivo",
|
"title": "Calendário de cultivo",
|
||||||
|
|
@ -514,7 +540,7 @@
|
||||||
"contact": "Mensagem",
|
"contact": "Mensagem",
|
||||||
"mine": "Tu",
|
"mine": "Tu",
|
||||||
"configTitle": "Configuração de partilha",
|
"configTitle": "Configuração de partilha",
|
||||||
"setupIntro": "Partilhar com pessoas por perto é opcional. Basta indicar a tua zona aproximada — já estás ligado a servidores comunitários partilhados para que outras pessoas encontrem o que ofereces, sem nenhuma empresa no meio.",
|
"setupIntro": "Partilhar com pessoas por perto é opcional. Basta indicar a tua zona aproximada — o que ofereces viaja por servidores comunitários, mantidos por pessoas e coletivos, não por uma empresa, para que outras pessoas perto de ti o possam encontrar.",
|
||||||
"areaLabel": "A tua zona",
|
"areaLabel": "A tua zona",
|
||||||
"areaHelp": "Mantém-se aproximado de propósito — a tua zona, nunca um ponto exato.",
|
"areaHelp": "Mantém-se aproximado de propósito — a tua zona, nunca um ponto exato.",
|
||||||
"areaSet": "A tua zona está definida — aproximada, nunca o teu ponto exato",
|
"areaSet": "A tua zona está definida — aproximada, nunca o teu ponto exato",
|
||||||
|
|
@ -645,7 +671,30 @@
|
||||||
"dueByHint": "Um lembrete gentil, nunca imposto",
|
"dueByHint": "Um lembrete gentil, nunca imposto",
|
||||||
"pickDate": "Escolher data",
|
"pickDate": "Escolher data",
|
||||||
"clearDate": "Limpar data",
|
"clearDate": "Limpar data",
|
||||||
"sectionTitle": "Compromissos"
|
"sectionTitle": "Compromissos",
|
||||||
|
"propose": "Propor um Plantaré assinado",
|
||||||
|
"proposeHelp": "Ambos mantêm a mesma promessa, assinada pelos dois — prova de que esta semente mudou de mãos e será cultivada e devolvida.",
|
||||||
|
"proposeTo": "Com {name}",
|
||||||
|
"sent": "Proposta enviada — a aguardar que assinem",
|
||||||
|
"seedLabel": "Que semente?",
|
||||||
|
"seedHint": "A variedade a que se refere esta promessa",
|
||||||
|
"returnKindLabel": "O que volta?",
|
||||||
|
"returnSimilar": "Uma quantidade semelhante de semente",
|
||||||
|
"returnSimilarNote": "polinização aberta · não transgénico · cultivado organicamente",
|
||||||
|
"returnWork": "Algumas horas de trabalho",
|
||||||
|
"returnOther": "Outra coisa",
|
||||||
|
"workHoursLabel": "Quantas horas?",
|
||||||
|
"proposalsSection": "À espera da tua resposta",
|
||||||
|
"incomingFrom": "{name} propõe um Plantaré",
|
||||||
|
"accept": "Aceitar e assinar",
|
||||||
|
"declineAction": "Recusar",
|
||||||
|
"declineReasonHint": "Motivo (opcional)",
|
||||||
|
"acceptedToast": "Assinado — agora ambos o mantêm",
|
||||||
|
"declinedToast": "Recusado",
|
||||||
|
"badgeAwaiting": "A aguardar assinatura",
|
||||||
|
"badgeSigned": "Assinado por ambos",
|
||||||
|
"badgeDeclined": "Recusado",
|
||||||
|
"offline": "Estás offline — será enviado quando reconectares"
|
||||||
},
|
},
|
||||||
"handover": {
|
"handover": {
|
||||||
"title": "Dei ou recebi sementes",
|
"title": "Dei ou recebi sementes",
|
||||||
|
|
@ -660,6 +709,37 @@
|
||||||
"promiseGave": "Vão devolver-me semente",
|
"promiseGave": "Vão devolver-me semente",
|
||||||
"promiseReceived": "Vou devolver semente"
|
"promiseReceived": "Vou devolver semente"
|
||||||
},
|
},
|
||||||
|
"history": {
|
||||||
|
"title": "História deste lote",
|
||||||
|
"tooltip": "História",
|
||||||
|
"sowToday": "Semeado hoje",
|
||||||
|
"harvestToday": "Colhido hoje",
|
||||||
|
"sownRecorded": "Sementeira registada",
|
||||||
|
"harvestRecorded": "Colheita registada",
|
||||||
|
"movementReceived": "Recebido",
|
||||||
|
"movementGiven": "Oferecido",
|
||||||
|
"movementSown": "Semeado",
|
||||||
|
"movementHarvested": "Colhido",
|
||||||
|
"movementGerminationTest": "Teste de germinação",
|
||||||
|
"movementSplit": "Dividido em lotes",
|
||||||
|
"movementDiscarded": "Descartado",
|
||||||
|
"created": "Adicionado à tua coleção",
|
||||||
|
"from": "De {origin}",
|
||||||
|
"germinationResult": "Teste de germinação — {percent}%",
|
||||||
|
"linkedEarlier": "Vem de um lote anterior",
|
||||||
|
"outcomeQuestion": "Como correu?",
|
||||||
|
"outcomeGood": "Bem",
|
||||||
|
"outcomeMixed": "Mais ou menos",
|
||||||
|
"outcomePoor": "Mal",
|
||||||
|
"outcomeNoteHint": "Uma nota para o teu eu futuro (opcional)",
|
||||||
|
"outcomeSaved": "Registado",
|
||||||
|
"ratedGood": "Correu bem",
|
||||||
|
"ratedMixed": "Correu mais ou menos",
|
||||||
|
"ratedPoor": "Correu mal",
|
||||||
|
"outcomeTitle": "Nota da estação",
|
||||||
|
"outcomeYear": "Estação {year}",
|
||||||
|
"isolationHint": "Esta espécie cruza-se com vizinhas próximas — cultiva-a a cerca de {meters} m de distância de outras para a manter pura"
|
||||||
|
},
|
||||||
"sale": {
|
"sale": {
|
||||||
"title": "Vendas",
|
"title": "Vendas",
|
||||||
"help": "Regista semente vendida ou comprada — dinheiro, Ğ1 ou qualquer moeda. Um modelo separado do presente e do Plantare. Nunca se cobra comissão pelas sementes.",
|
"help": "Regista semente vendida ou comprada — dinheiro, Ğ1 ou qualquer moeda. Um modelo separado do presente e do Plantare. Nunca se cobra comissão pelas sementes.",
|
||||||
|
|
|
||||||
809
apps/app_seeds/lib/i18n/pt_BR.i18n.json
Normal file
809
apps/app_seeds/lib/i18n/pt_BR.i18n.json
Normal file
|
|
@ -0,0 +1,809 @@
|
||||||
|
{
|
||||||
|
"avatar": {
|
||||||
|
"title": "A sua foto ou avatar",
|
||||||
|
"fromPhoto": "Tirar ou escolher uma foto",
|
||||||
|
"illustration": "Ou escolhe um desenho",
|
||||||
|
"remove": "Remover"
|
||||||
|
},
|
||||||
|
"favorites": {
|
||||||
|
"title": "Favoritos",
|
||||||
|
"empty": "Ainda não tem favoritos. Salve ofertas que goste do mercado.",
|
||||||
|
"save": "Salvar nos favoritos",
|
||||||
|
"remove": "Remover dos favoritos",
|
||||||
|
"unavailable": "Já não está disponível"
|
||||||
|
},
|
||||||
|
"savedSearches": {
|
||||||
|
"title": "Pesquisas salvas",
|
||||||
|
"empty": "Ainda não há pesquisas salvas. Salve uma pesquisa no mercado e te avisamos quando aparecer algo parecido na sua zona.",
|
||||||
|
"save": "Salvar esta pesquisa",
|
||||||
|
"nameLabel": "Dá um nome a esta pesquisa",
|
||||||
|
"namePlaceholder": "ex.: Tomates perto de mim",
|
||||||
|
"saved": "Pesquisa salva — vamos te avisar sobre novas correspondências perto de você",
|
||||||
|
"openTooltip": "Pesquisas salvas",
|
||||||
|
"delete": "Eliminar",
|
||||||
|
"deleteConfirm": "Eliminar esta pesquisa salva?",
|
||||||
|
"newMatchesBadge": "{n} novas",
|
||||||
|
"alert": "Sementes perto de você: {label}"
|
||||||
|
},
|
||||||
|
"seedSaving": {
|
||||||
|
"title": "Guardar a sua semente",
|
||||||
|
"subtitle": "O que é preciso para manter a variedade fiel",
|
||||||
|
"lifeCycle": "Ciclo",
|
||||||
|
"cycleAnnual": "Anual",
|
||||||
|
"cycleBiennial": "Bienal — dá semente no 2.º ano",
|
||||||
|
"cyclePerennial": "Perene",
|
||||||
|
"pollination": "Polinização",
|
||||||
|
"pollSelf": "Autopoliniza-se",
|
||||||
|
"pollCross": "Cruza-se com outras",
|
||||||
|
"pollMixed": "Autopoliniza-se, mas às vezes cruza",
|
||||||
|
"byInsect": "por insetos",
|
||||||
|
"byWind": "pelo vento",
|
||||||
|
"isolation": "Separe-a",
|
||||||
|
"isolationRange": "{min}–{max} m de outras variedades",
|
||||||
|
"isolationSingle": "{min} m de outras variedades",
|
||||||
|
"plants": "Guarde de várias plantas",
|
||||||
|
"plantsValue": "De pelo menos {n} plantas",
|
||||||
|
"processing": "Como limpá-la",
|
||||||
|
"procDry": "Semente seca (debulhar)",
|
||||||
|
"procWet": "Semente húmida (fermentar e lavar)",
|
||||||
|
"difficulty": "Dificuldade",
|
||||||
|
"diffEasy": "Fácil",
|
||||||
|
"diffMedium": "Média",
|
||||||
|
"diffHard": "Difícil",
|
||||||
|
"advisory": "Orientativo — adapte-o ao seu clima e variedade.",
|
||||||
|
"sourcePrefix": "Fonte"
|
||||||
|
},
|
||||||
|
"calendar": {
|
||||||
|
"title": "Este mês",
|
||||||
|
"filterChip": "Este mês",
|
||||||
|
"selfNote": "O que você anotou nas suas variedades.",
|
||||||
|
"nothing": "Nada anotado para {month}."
|
||||||
|
},
|
||||||
|
"app": {
|
||||||
|
"title": "Tane"
|
||||||
|
},
|
||||||
|
"bootstrap": {
|
||||||
|
"failed": "O Tane não conseguiu iniciar",
|
||||||
|
"retry": "Tentar de novo"
|
||||||
|
},
|
||||||
|
"common": {
|
||||||
|
"save": "Salvar",
|
||||||
|
"cancel": "Cancelar",
|
||||||
|
"delete": "Eliminar",
|
||||||
|
"edit": "Editar",
|
||||||
|
"type": "Tipo",
|
||||||
|
"offline": "Sem ligação — a compartilha está em pausa"
|
||||||
|
},
|
||||||
|
"home": {
|
||||||
|
"tagline": "Compartilha e cultiva sementes locais",
|
||||||
|
"openMarket": "Mercado",
|
||||||
|
"openMarketSubtitle": "Descobre e compartilha sementes por perto",
|
||||||
|
"yourInventory": "O seu inventário",
|
||||||
|
"yourInventorySubtitle": "Gere as suas sementes"
|
||||||
|
},
|
||||||
|
"photo": {
|
||||||
|
"camera": "Tirar uma foto",
|
||||||
|
"gallery": "Escolher da galeria",
|
||||||
|
"setAsCover": "Usar como capa",
|
||||||
|
"isCover": "Foto de capa",
|
||||||
|
"deleteConfirm": "Eliminar esta foto?"
|
||||||
|
},
|
||||||
|
"menu": {
|
||||||
|
"tagline": "o seu banco de sementes",
|
||||||
|
"inventory": "Inventário",
|
||||||
|
"market": "Mercado",
|
||||||
|
"profile": "O seu perfil",
|
||||||
|
"chat": "Conversas",
|
||||||
|
"wishlist": "Favoritos",
|
||||||
|
"following": "A seguir",
|
||||||
|
"plantares": "Plantares",
|
||||||
|
"sales": "Vendas",
|
||||||
|
"calendar": "Calendário",
|
||||||
|
"settings": "Definições"
|
||||||
|
},
|
||||||
|
"settings": {
|
||||||
|
"language": "Idioma",
|
||||||
|
"systemLanguage": "Idioma do sistema",
|
||||||
|
"langEs": "Español",
|
||||||
|
"langEn": "English",
|
||||||
|
"langPt": "Português",
|
||||||
|
"langPtBr": "Português (Brasil)",
|
||||||
|
"langAst": "Asturianu",
|
||||||
|
"langFr": "Français",
|
||||||
|
"langDe": "Deutsch",
|
||||||
|
"langJa": "日本語",
|
||||||
|
"about": "Acerca de",
|
||||||
|
"aboutText": "Inventário local e cifrado para sementes tradicionais. AGPL-3.0.",
|
||||||
|
"aboutOpen": "Acerca do Tane"
|
||||||
|
},
|
||||||
|
"backup": {
|
||||||
|
"title": "Cópia de segurança",
|
||||||
|
"autoBackupTitle": "Cópias automáticas",
|
||||||
|
"autoBackupLast": "Última cópia em {date} · a cada {days} dias",
|
||||||
|
"autoBackupNone": "Uma cópia é salva automaticamente a cada {days} dias",
|
||||||
|
"exportJson": "Salvar uma cópia de segurança",
|
||||||
|
"exportJsonSubtitle": "Uma cópia completa para guardar em segurança, restaurar depois ou levar para outro aparelho",
|
||||||
|
"importJson": "Restaurar uma cópia",
|
||||||
|
"importJsonSubtitle": "Recupera uma cópia salva — nada fica duplicado",
|
||||||
|
"exportCsv": "Exportar para uma folha de cálculo",
|
||||||
|
"exportCsvSubtitle": "Uma lista simples para Excel ou LibreOffice — sem fotos",
|
||||||
|
"importCsv": "Importar uma lista",
|
||||||
|
"importCsvSubtitle": "Acrescenta entradas a partir de uma folha de cálculo",
|
||||||
|
"importConfirmTitle": "Restaurar uma cópia?",
|
||||||
|
"importConfirmBody": "As entradas fundem-se com o seu inventário; quando a mesma entrada existe dos dois lados, vence a versão mais recente. Nada fica duplicado.",
|
||||||
|
"importCsvConfirmTitle": "Importar uma lista?",
|
||||||
|
"importCsvConfirmBody": "Cada linha é acrescentada como uma entrada nova. Não funde nem substitui, por isso importar o mesmo arquivo duas vezes acrescenta-o duas vezes.",
|
||||||
|
"importAction": "Importar",
|
||||||
|
"exportSaved": "Cópia salva",
|
||||||
|
"cancelled": "Cancelado",
|
||||||
|
"importDone": "Importado: {added} novas, {updated} atualizadas",
|
||||||
|
"importCsvDone": "{count} entradas acrescentadas",
|
||||||
|
"importFailed": "Este arquivo não pôde ser lido como uma cópia do Tane",
|
||||||
|
"failed": "Algo correu mal",
|
||||||
|
"recoveryTitle": "O seu código de recuperação",
|
||||||
|
"recoverySubtitle": "Imprime-o e guarda-o bem: abre as suas cópias noutro aparelho",
|
||||||
|
"recoveryIntro": "Este código abre as suas cópias salvas e recupera o seu banco em qualquer aparelho. Guarde duas cópias em papel em lugares seguros, como a sua melhor semente. Quem o tiver pode ler as suas cópias, por isso não o compartilhe com ninguém.",
|
||||||
|
"recoveryCopy": "Copiar",
|
||||||
|
"recoverySave": "Salvar a folha",
|
||||||
|
"recoverySheetTitle": "Tane — a sua folha de recuperação",
|
||||||
|
"recoveryPromptTitle": "Escreve o seu código de recuperação",
|
||||||
|
"recoveryPromptBody": "Esta cópia foi salva com outro código. Escreve o código da sua folha de recuperação para a abrir.",
|
||||||
|
"recoveryWrongCode": "Esse código não abre esta cópia"
|
||||||
|
},
|
||||||
|
"about": {
|
||||||
|
"title": "Acerca de",
|
||||||
|
"kanji": "種",
|
||||||
|
"tagline": "Uma aplicação local e descentralizada para gerir e compartilhar sementes e plântulas tradicionais.",
|
||||||
|
"intro": "O Tane (種, \"semente\" em japonês) ajuda pessoas e coletivos a manter um inventário amigável do seu banco de sementes, decidir o que oferecem e compartilhá-lo localmente — sem um intermediário central que possa controlar, censurar ou ser multado por isso. O seu nome vem de tanemaki (種まき), \"semear / espalhar sementes\". O objetivo é prático e político ao mesmo tempo: apoiar as variedades tradicionais e fazer frente ao monopólio das sementes.",
|
||||||
|
"heritage": "O nome honra as antigas tradições japonesas de ajuda mútua à volta do arroz — yui (trabalho comunitário compartilhado) e tanomoshi (fundos de reciprocidade) — que inspiraram o Plantare em papel, a \"moeda comunitária de troca de sementes\" (BAH-Semillero, 2009, CC-BY-SA). O Tane é o Plantare digital.",
|
||||||
|
"version": "Versão",
|
||||||
|
"license": "Licença",
|
||||||
|
"licenseValue": "AGPL-3.0",
|
||||||
|
"website": "Sítio web",
|
||||||
|
"sourceCode": "Código-fonte",
|
||||||
|
"translate": "Ajuda a traduzir",
|
||||||
|
"translateSubtitle": "Ajuda a trazer o Tane para o seu idioma",
|
||||||
|
"openSourceLicenses": "Licenças de código aberto",
|
||||||
|
"openSourceLicensesSubtitle": "Bibliotecas de terceiros e as suas licenças",
|
||||||
|
"copyright": "© {years} Associação Comunes, sob AGPLv3"
|
||||||
|
},
|
||||||
|
"intro": {
|
||||||
|
"skip": "Saltar",
|
||||||
|
"next": "Seguinte",
|
||||||
|
"start": "Começar",
|
||||||
|
"menuEntry": "Como funciona o Tane",
|
||||||
|
"slides": {
|
||||||
|
"welcome": {
|
||||||
|
"title": "A semente que te trouxe até aqui",
|
||||||
|
"body": "Cada semente tradicional é uma carta escrita por milhares de gerações, passada de mão em mão. Somos o que somos graças a essa compartilha."
|
||||||
|
},
|
||||||
|
"inventory": {
|
||||||
|
"title": "O seu banco de sementes, no bolso",
|
||||||
|
"body": "Anote o que tem, de que ano, quanto e de onde veio — com o nome que você usa. Uma foto e um nome chegam para começar."
|
||||||
|
},
|
||||||
|
"privacy": {
|
||||||
|
"title": "Seu, e só seu",
|
||||||
|
"body": "Sem conta, sem internet, sem rastreadores. Os seus dados vivem cifrados no seu aparelho, e só o que você escolher é compartilhado."
|
||||||
|
},
|
||||||
|
"share": {
|
||||||
|
"title": "Compartilhar, como sempre se fez",
|
||||||
|
"body": "Ofereça o que sobra — dar, trocar ou vender — e deixe que alguém perto de você o encontre. Só se mostra uma distância aproximada, nunca a sua morada; o acordo fecha-se em pessoa."
|
||||||
|
},
|
||||||
|
"plantare": {
|
||||||
|
"title": "Semear é multiplicar",
|
||||||
|
"body": "Com um Plantare, quem recebe semente promete devolver uma parte mais tarde. E como devolvê-la implica cultivá-la, cada empréstimo multiplica o comum."
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"inventory": {
|
||||||
|
"title": "Inventário",
|
||||||
|
"searchHint": "Procurar sementes",
|
||||||
|
"empty": "Ainda não há sementes. Toca em + para adicionar a primeira.",
|
||||||
|
"noMatches": "Nenhuma semente corresponde aos seus filtros.",
|
||||||
|
"clearFilters": "Limpar filtros",
|
||||||
|
"uncategorized": "Sem categoria",
|
||||||
|
"needsReproductionFilter": "Para reproduzir",
|
||||||
|
"loadError": "Não foi possível abrir o seu banco de sementes. Talvez estivesse ocupado — tenta de novo.",
|
||||||
|
"retry": "Tentar de novo"
|
||||||
|
},
|
||||||
|
"draft": {
|
||||||
|
"capture": "Capturar fotos",
|
||||||
|
"captured": "{n} capturadas para catalogar",
|
||||||
|
"triageTitle": "Para catalogar",
|
||||||
|
"triageCount": "{n} para catalogar",
|
||||||
|
"untitled": "Sem nome",
|
||||||
|
"nameField": "Dá um nome a esta semente",
|
||||||
|
"nameHint": "O que é?",
|
||||||
|
"suggestFromPhoto": "Sugerir nome a partir da foto",
|
||||||
|
"discard": "Descartar"
|
||||||
|
},
|
||||||
|
"quickAdd": {
|
||||||
|
"title": "Adicionar uma semente",
|
||||||
|
"labelField": "Nome",
|
||||||
|
"labelRequired": "Dá-lhe um nome",
|
||||||
|
"addPhoto": "Adicionar foto",
|
||||||
|
"quantity": "Quanto?",
|
||||||
|
"more": "Adicionar mais…",
|
||||||
|
"save": "Salvar",
|
||||||
|
"saveAndAddAnother": "Salvar e adicionar outra",
|
||||||
|
"addedCount": "{n} adicionadas",
|
||||||
|
"cancel": "Cancelar"
|
||||||
|
},
|
||||||
|
"detail": {
|
||||||
|
"notFound": "Esta semente já não está aqui.",
|
||||||
|
"lots": "Lotes",
|
||||||
|
"noLots": "Ainda não há lotes.",
|
||||||
|
"names": "Também conhecida como",
|
||||||
|
"addName": "Adicionar nome",
|
||||||
|
"links": "Ligações",
|
||||||
|
"addLink": "Adicionar ligação",
|
||||||
|
"linkUrl": "URL",
|
||||||
|
"linkTitle": "Título (opcional)",
|
||||||
|
"reference": "Saber mais",
|
||||||
|
"refGbif": "GBIF",
|
||||||
|
"refWikipedia": "Wikipédia",
|
||||||
|
"refWikispecies": "Wikispecies",
|
||||||
|
"notes": "Notas",
|
||||||
|
"addLot": "Adicionar lote",
|
||||||
|
"editLot": "Editar lote",
|
||||||
|
"deleteConfirm": "Eliminar esta semente?",
|
||||||
|
"year": "Ano {year}",
|
||||||
|
"noYear": "Ano desconhecido"
|
||||||
|
},
|
||||||
|
"germination": {
|
||||||
|
"title": "Germinação",
|
||||||
|
"add": "Adicionar teste",
|
||||||
|
"sampleSize": "Tamanho da amostra",
|
||||||
|
"germinated": "Germinadas",
|
||||||
|
"none": "Ainda não há testes de germinação.",
|
||||||
|
"result": "{percent}%"
|
||||||
|
},
|
||||||
|
"viability": {
|
||||||
|
"expiringSoon": "Usa ou reproduz nesta época",
|
||||||
|
"expiringSoonYears": "Usa ou reproduz nesta época · dura ~{years} anos",
|
||||||
|
"expired": "Passou a viabilidade típica — reproduzir",
|
||||||
|
"expiredYears": "Passou a viabilidade típica (~{years} anos) — reproduzir"
|
||||||
|
},
|
||||||
|
"editVariety": {
|
||||||
|
"title": "Editar semente",
|
||||||
|
"name": "Nome",
|
||||||
|
"category": "Categoria",
|
||||||
|
"notes": "Notas",
|
||||||
|
"species": "Espécie (do catálogo)",
|
||||||
|
"speciesHint": "Procura uma espécie…",
|
||||||
|
"speciesSuggested": "Sugerida pelo nome",
|
||||||
|
"organic": "Biológica",
|
||||||
|
"organicHint": "Cultivada em modo biológico"
|
||||||
|
},
|
||||||
|
"addLot": {
|
||||||
|
"title": "Adicionar lote",
|
||||||
|
"year": "Data de colheita",
|
||||||
|
"quantity": "Quanto?",
|
||||||
|
"amount": "Quantidade"
|
||||||
|
},
|
||||||
|
"harvest": {
|
||||||
|
"pickTitle": "Escolhe mês / ano",
|
||||||
|
"anyMonth": "Qualquer mês",
|
||||||
|
"noDate": "Definir data de colheita",
|
||||||
|
"monthNames": [
|
||||||
|
"janeiro",
|
||||||
|
"fevereiro",
|
||||||
|
"março",
|
||||||
|
"abril",
|
||||||
|
"maio",
|
||||||
|
"junho",
|
||||||
|
"julho",
|
||||||
|
"agosto",
|
||||||
|
"setembro",
|
||||||
|
"outubro",
|
||||||
|
"novembro",
|
||||||
|
"dezembro"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"lotType": {
|
||||||
|
"seed": "Sementes",
|
||||||
|
"plant": "Planta",
|
||||||
|
"seedling": "Plântula",
|
||||||
|
"tree": "Árvore / arbusto",
|
||||||
|
"bulb": "Bolbo / tubérculo",
|
||||||
|
"cutting": "Estaca"
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"title": "Apresentação",
|
||||||
|
"none": "Sem indicar",
|
||||||
|
"pot": "Vaso",
|
||||||
|
"tray": "Tabuleiro",
|
||||||
|
"plug": "Alvéolo",
|
||||||
|
"bareRoot": "Raiz nua",
|
||||||
|
"rootBall": "Torrão"
|
||||||
|
},
|
||||||
|
"provenance": {
|
||||||
|
"section": "De onde vem",
|
||||||
|
"seedsFrom": "Sementes de",
|
||||||
|
"seedsFromHint": "Quem as cultivou ou ofereceu",
|
||||||
|
"place": "Lugar",
|
||||||
|
"placeHint": "De onde vêm (com a região)",
|
||||||
|
"addSeedsFrom": "Sementes de",
|
||||||
|
"addPlace": "Lugar"
|
||||||
|
},
|
||||||
|
"abundance": {
|
||||||
|
"add": "Quanta tenho",
|
||||||
|
"title": "Quanta tenho",
|
||||||
|
"none": "Sem indicar",
|
||||||
|
"plentyToShare": "De sobra para compartilhar",
|
||||||
|
"enoughToShare": "Bastante, para compartilhar com moderação",
|
||||||
|
"enoughForMe": "Suficiente para mim",
|
||||||
|
"runningLow": "Resta pouca"
|
||||||
|
},
|
||||||
|
"share": {
|
||||||
|
"add": "Compartilhas esta?",
|
||||||
|
"title": "Compartilhas esta?",
|
||||||
|
"nudge": "Tem de sobra: podia compartilhar um pouco.",
|
||||||
|
"price": "Preço",
|
||||||
|
"priceHint": "Deixe vazio para combinar depois",
|
||||||
|
"private": "Só para mim",
|
||||||
|
"gift": "Para dar",
|
||||||
|
"exchange": "Para trocar",
|
||||||
|
"sell": "À venda",
|
||||||
|
"filterChip": "Compartilho",
|
||||||
|
"printCatalog": "Imprimir o que compartilho",
|
||||||
|
"catalogTitle": "O que compartilho",
|
||||||
|
"catalogSaved": "Catálogo salvo",
|
||||||
|
"cancelled": "Cancelado"
|
||||||
|
},
|
||||||
|
"printLabels": {
|
||||||
|
"action": "Imprimir etiquetas",
|
||||||
|
"title": "Imprimir etiquetas",
|
||||||
|
"selectHint": "Escolhe as sementes para imprimir as etiquetas",
|
||||||
|
"selectAll": "Selecionar tudo",
|
||||||
|
"selected": "{n} selecionadas",
|
||||||
|
"none": "Seleciona sementes primeiro",
|
||||||
|
"format": "Tamanho da etiqueta",
|
||||||
|
"formatStickers": "Autocolantes pequenos",
|
||||||
|
"formatStickersHint": "Muitas etiquetas pequenas por folha — para colar em envelopes",
|
||||||
|
"formatCards": "Cartões grandes",
|
||||||
|
"formatCardsHint": "Menos etiquetas, maiores — para frascos e caixas",
|
||||||
|
"count": "{n} etiquetas",
|
||||||
|
"save": "Salvar etiquetas",
|
||||||
|
"saved": "Etiquetas salvas",
|
||||||
|
"cancelled": "Cancelado"
|
||||||
|
},
|
||||||
|
"scan": {
|
||||||
|
"action": "Digitalizar um rótulo de semente",
|
||||||
|
"title": "Digitalizar um rótulo",
|
||||||
|
"notALabel": "Esse código não é um rótulo de semente",
|
||||||
|
"addTitle": "Não está na sua coleção",
|
||||||
|
"addBody": "Adicionar “{label}” às suas sementes?",
|
||||||
|
"add": "Adicionar",
|
||||||
|
"added": "Adicionado à sua coleção"
|
||||||
|
},
|
||||||
|
"cropCalendar": {
|
||||||
|
"add": "Calendário de cultivo",
|
||||||
|
"title": "Calendário de cultivo",
|
||||||
|
"sow": "Sementeira",
|
||||||
|
"transplant": "Transplante",
|
||||||
|
"flowering": "Floração",
|
||||||
|
"fruiting": "Frutificação",
|
||||||
|
"seedHarvest": "Colheita de semente",
|
||||||
|
"editorHint": "Anote os meses típicos desta variedade na sua zona — são suas notas.",
|
||||||
|
"unset": "—"
|
||||||
|
},
|
||||||
|
"needsReproduction": {
|
||||||
|
"label": "Reproduzir nesta época",
|
||||||
|
"hint": "Cultiva-a antes que a semente acabe",
|
||||||
|
"badge": "Por reproduzir"
|
||||||
|
},
|
||||||
|
"preservation": {
|
||||||
|
"add": "Como está guardada",
|
||||||
|
"title": "Como está guardada",
|
||||||
|
"none": "Sem indicar",
|
||||||
|
"jarWithDesiccant": "Frasco com agente secante",
|
||||||
|
"glassJar": "Frasco de vidro",
|
||||||
|
"paperEnvelope": "Envelope de papel",
|
||||||
|
"paperBag": "Saco de papel",
|
||||||
|
"plasticBag": "Saco de plástico"
|
||||||
|
},
|
||||||
|
"conditionCheck": {
|
||||||
|
"advanced": "Armazenamento e detalhes de banco de sementes",
|
||||||
|
"title": "Verificações de armazenamento",
|
||||||
|
"add": "Adicionar verificação",
|
||||||
|
"containers": "Frascos / recipientes",
|
||||||
|
"desiccant": "Agente secante",
|
||||||
|
"none": "Ainda não há verificações de armazenamento.",
|
||||||
|
"summary": "{count} frasco(s) · {state}"
|
||||||
|
},
|
||||||
|
"desiccant": {
|
||||||
|
"none": "Nenhum",
|
||||||
|
"add": "Adicionar",
|
||||||
|
"replace": "Substituir",
|
||||||
|
"dry": "Azul — seco",
|
||||||
|
"fresh": "Acabado de renovar"
|
||||||
|
},
|
||||||
|
"unit": {
|
||||||
|
"aFew": "algumas",
|
||||||
|
"some": "bastantes",
|
||||||
|
"plenty": "muitas",
|
||||||
|
"pinch": "uma pitada",
|
||||||
|
"handful": {
|
||||||
|
"singular": "mão-cheia",
|
||||||
|
"plural": "mãos-cheias"
|
||||||
|
},
|
||||||
|
"teaspoon": {
|
||||||
|
"singular": "colher de chá",
|
||||||
|
"plural": "colheres de chá"
|
||||||
|
},
|
||||||
|
"spoon": {
|
||||||
|
"singular": "colher",
|
||||||
|
"plural": "colheres"
|
||||||
|
},
|
||||||
|
"cup": {
|
||||||
|
"singular": "chávena",
|
||||||
|
"plural": "chávenas"
|
||||||
|
},
|
||||||
|
"jar": {
|
||||||
|
"singular": "frasco",
|
||||||
|
"plural": "frascos"
|
||||||
|
},
|
||||||
|
"sack": {
|
||||||
|
"singular": "saco",
|
||||||
|
"plural": "sacos"
|
||||||
|
},
|
||||||
|
"packet": {
|
||||||
|
"singular": "pacote",
|
||||||
|
"plural": "pacotes"
|
||||||
|
},
|
||||||
|
"cob": {
|
||||||
|
"singular": "maçaroca",
|
||||||
|
"plural": "maçarocas"
|
||||||
|
},
|
||||||
|
"pod": {
|
||||||
|
"singular": "vagem",
|
||||||
|
"plural": "vagens"
|
||||||
|
},
|
||||||
|
"ear": {
|
||||||
|
"singular": "espiga",
|
||||||
|
"plural": "espigas"
|
||||||
|
},
|
||||||
|
"head": {
|
||||||
|
"singular": "cabeça",
|
||||||
|
"plural": "cabeças"
|
||||||
|
},
|
||||||
|
"fruit": {
|
||||||
|
"singular": "fruto",
|
||||||
|
"plural": "frutos"
|
||||||
|
},
|
||||||
|
"bulb": {
|
||||||
|
"singular": "bolbo",
|
||||||
|
"plural": "bolbos"
|
||||||
|
},
|
||||||
|
"tuber": {
|
||||||
|
"singular": "tubérculo",
|
||||||
|
"plural": "tubérculos"
|
||||||
|
},
|
||||||
|
"seedHead": {
|
||||||
|
"singular": "capítulo",
|
||||||
|
"plural": "capítulos"
|
||||||
|
},
|
||||||
|
"bunch": {
|
||||||
|
"singular": "molho",
|
||||||
|
"plural": "molhos"
|
||||||
|
},
|
||||||
|
"plant": {
|
||||||
|
"singular": "planta",
|
||||||
|
"plural": "plantas"
|
||||||
|
},
|
||||||
|
"pot": {
|
||||||
|
"singular": "vaso",
|
||||||
|
"plural": "vasos"
|
||||||
|
},
|
||||||
|
"tray": {
|
||||||
|
"singular": "tabuleiro",
|
||||||
|
"plural": "tabuleiros"
|
||||||
|
},
|
||||||
|
"seedling": {
|
||||||
|
"singular": "plântula",
|
||||||
|
"plural": "plântulas"
|
||||||
|
},
|
||||||
|
"tree": {
|
||||||
|
"singular": "árvore",
|
||||||
|
"plural": "árvores"
|
||||||
|
},
|
||||||
|
"cutting": {
|
||||||
|
"singular": "estaca",
|
||||||
|
"plural": "estacas"
|
||||||
|
},
|
||||||
|
"grams": {
|
||||||
|
"singular": "grama",
|
||||||
|
"plural": "gramas"
|
||||||
|
},
|
||||||
|
"count": {
|
||||||
|
"singular": "semente",
|
||||||
|
"plural": "sementes"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"market": {
|
||||||
|
"title": "Sementes perto de você",
|
||||||
|
"subtitle": "O que outras pessoas compartilham por perto",
|
||||||
|
"notSetUp": "Ainda não configurou a compartilha",
|
||||||
|
"notSetUpBody": "Ativa a compartilha para ver e dar sementes a pessoas por perto. Mantém-se aproximado — a sua zona, nunca a sua morada exata.",
|
||||||
|
"setUp": "Configurar a compartilha",
|
||||||
|
"cantReach": "Não é possível ligar aos servidores neste momento",
|
||||||
|
"cantReachBody": "Tenta de novo, ou verifica os servidores na configuração avançada.",
|
||||||
|
"retry": "Tentar de novo",
|
||||||
|
"setArea": "Indica a sua zona",
|
||||||
|
"setAreaBody": "Diz ao mercado a sua zona aproximada para ver sementes por perto.",
|
||||||
|
"searching": "A procurar pela sua zona…",
|
||||||
|
"empty": "Ainda não há sementes compartilhadas perto de você",
|
||||||
|
"searchHint": "Procurar nestas sementes",
|
||||||
|
"noMatches": "Nenhuma semente compartilhada corresponde à procura",
|
||||||
|
"near": "Perto de você",
|
||||||
|
"contact": "Mensagem",
|
||||||
|
"mine": "Você",
|
||||||
|
"configTitle": "Configuração de compartilha",
|
||||||
|
"setupIntro": "Compartilhar com pessoas por perto é opcional. Basta indicar a sua zona aproximada — o que você oferece viaja por servidores comunitários, mantidos por pessoas e coletivos, não por uma empresa, para que outras pessoas perto de você possam encontrar.",
|
||||||
|
"areaLabel": "A sua zona",
|
||||||
|
"areaHelp": "Mantém-se aproximado de propósito — a sua zona, nunca um ponto exato.",
|
||||||
|
"areaSet": "A sua zona está definida — aproximada, nunca o seu ponto exato",
|
||||||
|
"areaNotSet": "Zona por definir — usa a sua localização, ou adiciona um código em Avançado",
|
||||||
|
"advanced": "Avançado",
|
||||||
|
"areaCodeLabel": "Código de zona",
|
||||||
|
"areaCodeHint": "Um código curto como sp3e9 — não um nome de lugar",
|
||||||
|
"serversLabel": "Servidores da comunidade",
|
||||||
|
"serversHelp": "Escolha que servidores usar. Deixe assim se não souber.",
|
||||||
|
"serversAdvanced": "Adicionar outro servidor",
|
||||||
|
"serverAddress": "Endereço do servidor",
|
||||||
|
"serverInvalid": "Introduz um endereço válido (wss://…)",
|
||||||
|
"save": "Salvar",
|
||||||
|
"saved": "Salvo",
|
||||||
|
"wanted": "Procuro",
|
||||||
|
"shareMine": "Compartilhar as minhas sementes",
|
||||||
|
"sharedCount": "Compartilhadas {n} sementes",
|
||||||
|
"nothingToShare": "Marca primeiro algumas sementes para dar, trocar ou vender",
|
||||||
|
"useLocation": "Usar a minha localização aproximada",
|
||||||
|
"locationFailed": "Não foi possível obter a sua localização — verifica se a localização está ativa e a permissão concedida",
|
||||||
|
"queued": "Salvo — vamos compartilhá-las quando você tiver conexão",
|
||||||
|
"shareFailed": "Não foi possível contactar os servidores — as suas sementes não foram compartilhadas. Tenta de novo daqui a pouco.",
|
||||||
|
"rangeLabel": "Até onde procurar",
|
||||||
|
"rangeNear": "Muito perto",
|
||||||
|
"rangeArea": "Pela minha zona",
|
||||||
|
"rangeRegion": "A minha região",
|
||||||
|
"sharedBy": "Compartilhado por",
|
||||||
|
"noProfile": "Esta pessoa ainda não compartilhou o seu perfil",
|
||||||
|
"copyId": "Copiar código",
|
||||||
|
"idCopied": "Código copiado",
|
||||||
|
"photo": "Foto"
|
||||||
|
},
|
||||||
|
"profile": {
|
||||||
|
"title": "O seu perfil",
|
||||||
|
"name": "Nome",
|
||||||
|
"nameHint": "Como os outros te veem",
|
||||||
|
"about": "Sobre você",
|
||||||
|
"aboutHint": "Uma linha — o que cultivas, onde",
|
||||||
|
"g1": "Endereço Ğ1 (opcional)",
|
||||||
|
"g1Hint": "Para que te paguem em Ğ1 — separado da sua chave",
|
||||||
|
"yourId": "A sua identidade",
|
||||||
|
"idHelp": "Compartilha-a para que te reconheçam",
|
||||||
|
"copy": "Copiar",
|
||||||
|
"copied": "Copiado",
|
||||||
|
"save": "Salvar",
|
||||||
|
"saved": "Perfil salvo",
|
||||||
|
"identities": "As suas identidades",
|
||||||
|
"identitiesHelp": "Mantém identidades separadas — cada uma com as suas mensagens e contactos. Todas vêm da sua única cópia de segurança, por isso mudar não acrescenta nada para lembrar.",
|
||||||
|
"identityLabel": "Identidade {n}",
|
||||||
|
"current": "Em uso",
|
||||||
|
"newIdentity": "Nova identidade",
|
||||||
|
"switchTitle": "Mudar de identidade?",
|
||||||
|
"switchBody": "As mensagens e contatos são guardados separadamente para cada identidade. Pode voltar quando quiser.",
|
||||||
|
"switchAction": "Mudar"
|
||||||
|
},
|
||||||
|
"chatList": {
|
||||||
|
"title": "Mensagens",
|
||||||
|
"empty": "Ainda não há conversas. Escreve a alguém a partir do mercado."
|
||||||
|
},
|
||||||
|
"chat": {
|
||||||
|
"title": "Conversa",
|
||||||
|
"hint": "Escreve uma mensagem…",
|
||||||
|
"send": "Enviar",
|
||||||
|
"empty": "Ainda não há mensagens — diz olá",
|
||||||
|
"offline": "Configura a compartilha para enviar mensagens",
|
||||||
|
"payG1": "Pagar em Ğ1",
|
||||||
|
"g1Copied": "Endereço Ğ1 copiado — cola-o na sua carteira",
|
||||||
|
"today": "Hoje",
|
||||||
|
"yesterday": "Ontem",
|
||||||
|
"sendError": "Não foi possível enviar — verifica a sua ligação",
|
||||||
|
"noLinks": "Não são permitidos links nas mensagens"
|
||||||
|
},
|
||||||
|
"trust": {
|
||||||
|
"none": "Ainda ninguém os avaliza",
|
||||||
|
"count": "Avalizada por {n}",
|
||||||
|
"vouch": "Conheço esta pessoa",
|
||||||
|
"vouched": "Avalizas esta pessoa",
|
||||||
|
"circle": "No seu círculo"
|
||||||
|
},
|
||||||
|
"yourPeople": {
|
||||||
|
"title": "A sua gente",
|
||||||
|
"help": "Pessoas que conheces e avalizas, e pessoas que te avalizam.",
|
||||||
|
"youVouchFor": "Você avaliza",
|
||||||
|
"vouchesForYou": "Avalizam-te",
|
||||||
|
"youVouchForEmpty": "Ainda não avaliza ninguém. Quando conhecer alguém, abra a conversa com essa pessoa e toque em \"Conheço esta pessoa\".",
|
||||||
|
"vouchesForYouEmpty": "Ainda ninguém te avaliza",
|
||||||
|
"revoke": "Deixar de avalizar",
|
||||||
|
"revokeConfirm": "Deixar de avalizar esta pessoa?",
|
||||||
|
"offline": "Sem conexão — tente novamente quando estiver online"
|
||||||
|
},
|
||||||
|
"ratings": {
|
||||||
|
"rate": "Avaliar esta pessoa",
|
||||||
|
"edit": "Editar a sua avaliação",
|
||||||
|
"commentHint": "Como correu? (opcional)",
|
||||||
|
"fromYourCircle": "{n} de pessoas que conheces",
|
||||||
|
"retract": "Remover a sua avaliação",
|
||||||
|
"saved": "Avaliação salva"
|
||||||
|
},
|
||||||
|
"notifications": {
|
||||||
|
"newMessageFrom": "Nova mensagem de {name}"
|
||||||
|
},
|
||||||
|
"plantare": {
|
||||||
|
"title": "Plantares",
|
||||||
|
"help": "Um Plantare é o compromisso de reproduzir uma semente e devolver uma parte — assim uma variedade continua a viajar de mão em mão. Não é uma venda.",
|
||||||
|
"add": "Adicionar compromisso",
|
||||||
|
"empty": "Ainda não há compromissos. Quando compartilhar ou receber semente com o compromisso de reproduzi-la e devolver algo, anote aqui.",
|
||||||
|
"iReturn": "Reproduzo e devolvo eu",
|
||||||
|
"owedToMe": "Devolvem-me a mim",
|
||||||
|
"direction": "Quem reproduz e devolve",
|
||||||
|
"counterparty": "Com quem?",
|
||||||
|
"counterpartyHint": "Uma pessoa ou um coletivo (opcional)",
|
||||||
|
"owed": "O que é devolvido?",
|
||||||
|
"owedHint": "p. ex. um punhado na próxima temporada (opcional)",
|
||||||
|
"note": "Nota (opcional)",
|
||||||
|
"save": "Salvar",
|
||||||
|
"markReturned": "Marcar devolvido",
|
||||||
|
"markForgiven": "Dar por saldado",
|
||||||
|
"reopen": "Reabrir",
|
||||||
|
"delete": "Remover",
|
||||||
|
"statusReturned": "Devolvido",
|
||||||
|
"statusForgiven": "Saldado",
|
||||||
|
"openSection": "Pendentes",
|
||||||
|
"settledSection": "Feitos",
|
||||||
|
"removeConfirm": "Remover este compromisso?",
|
||||||
|
"returnBy": "Devolver até {date}",
|
||||||
|
"overdue": "vencido",
|
||||||
|
"dueByLabel": "Devolver até (opcional)",
|
||||||
|
"dueByHint": "Um lembrete gentil, nunca imposto",
|
||||||
|
"pickDate": "Escolher data",
|
||||||
|
"clearDate": "Limpar data",
|
||||||
|
"sectionTitle": "Compromissos",
|
||||||
|
"propose": "Propor um Plantaré assinado",
|
||||||
|
"proposeHelp": "Ambos mantêm a mesma promessa, assinada pelos dois — prova de que esta semente mudou de mãos e será cultivada e devolvida.",
|
||||||
|
"proposeTo": "Com {name}",
|
||||||
|
"sent": "Proposta enviada — a aguardar que assinem",
|
||||||
|
"seedLabel": "Que semente?",
|
||||||
|
"seedHint": "A variedade a que se refere esta promessa",
|
||||||
|
"returnKindLabel": "O que volta?",
|
||||||
|
"returnSimilar": "Uma quantidade semelhante de semente",
|
||||||
|
"returnSimilarNote": "polinização aberta · não transgénico · cultivado organicamente",
|
||||||
|
"returnWork": "Algumas horas de trabalho",
|
||||||
|
"returnOther": "Outra coisa",
|
||||||
|
"workHoursLabel": "Quantas horas?",
|
||||||
|
"proposalsSection": "À espera da sua resposta",
|
||||||
|
"incomingFrom": "{name} propõe um Plantaré",
|
||||||
|
"accept": "Aceitar e assinar",
|
||||||
|
"declineAction": "Recusar",
|
||||||
|
"declineReasonHint": "Motivo (opcional)",
|
||||||
|
"acceptedToast": "Assinado — agora ambos o mantêm",
|
||||||
|
"declinedToast": "Recusado",
|
||||||
|
"badgeAwaiting": "A aguardar assinatura",
|
||||||
|
"badgeSigned": "Assinado por ambos",
|
||||||
|
"badgeDeclined": "Recusado",
|
||||||
|
"offline": "Você está offline — será enviado quando reconectar"
|
||||||
|
},
|
||||||
|
"handover": {
|
||||||
|
"title": "Dei ou recebi sementes",
|
||||||
|
"help": "Uma oferta, uma troca ou uma venda: anota-o, com promessa de devolver semente ou sem ela.",
|
||||||
|
"iGave": "Dei sementes",
|
||||||
|
"iReceived": "Recebi sementes",
|
||||||
|
"whichLot": "De que lote?",
|
||||||
|
"howMuch": "Quanto?",
|
||||||
|
"allOfIt": "Tudo",
|
||||||
|
"partOfIt": "Uma parte",
|
||||||
|
"paymentChip": "Houve dinheiro pelo meio",
|
||||||
|
"promiseGave": "Vão devolver-me semente",
|
||||||
|
"promiseReceived": "Vou devolver semente"
|
||||||
|
},
|
||||||
|
"history": {
|
||||||
|
"title": "História deste lote",
|
||||||
|
"tooltip": "História",
|
||||||
|
"sowToday": "Semeado hoje",
|
||||||
|
"harvestToday": "Colhido hoje",
|
||||||
|
"sownRecorded": "Sementeira registada",
|
||||||
|
"harvestRecorded": "Colheita registada",
|
||||||
|
"movementReceived": "Recebido",
|
||||||
|
"movementGiven": "Oferecido",
|
||||||
|
"movementSown": "Semeado",
|
||||||
|
"movementHarvested": "Colhido",
|
||||||
|
"movementGerminationTest": "Teste de germinação",
|
||||||
|
"movementSplit": "Dividido em lotes",
|
||||||
|
"movementDiscarded": "Descartado",
|
||||||
|
"created": "Adicionado à sua coleção",
|
||||||
|
"from": "De {origin}",
|
||||||
|
"germinationResult": "Teste de germinação — {percent}%",
|
||||||
|
"linkedEarlier": "Vem de um lote anterior",
|
||||||
|
"outcomeQuestion": "Como correu?",
|
||||||
|
"outcomeGood": "Bem",
|
||||||
|
"outcomeMixed": "Mais ou menos",
|
||||||
|
"outcomePoor": "Mal",
|
||||||
|
"outcomeNoteHint": "Uma nota para o seu eu futuro (opcional)",
|
||||||
|
"outcomeSaved": "Registado",
|
||||||
|
"ratedGood": "Correu bem",
|
||||||
|
"ratedMixed": "Correu mais ou menos",
|
||||||
|
"ratedPoor": "Correu mal",
|
||||||
|
"outcomeTitle": "Nota da estação",
|
||||||
|
"outcomeYear": "Estação {year}",
|
||||||
|
"isolationHint": "Esta espécie cruza-se com vizinhas próximas — cultiva-a a cerca de {meters} m de distância de outras para a manter pura"
|
||||||
|
},
|
||||||
|
"sale": {
|
||||||
|
"title": "Vendas",
|
||||||
|
"help": "Regista semente vendida ou comprada — dinheiro, Ğ1 ou qualquer moeda. Um modelo separado do presente e do Plantare. Nunca se cobra comissão pelas sementes.",
|
||||||
|
"add": "Registar venda",
|
||||||
|
"empty": "Ainda não há vendas. Anota aqui o que vendes ou compras.",
|
||||||
|
"iSold": "Vendi",
|
||||||
|
"iBought": "Comprei",
|
||||||
|
"direction": "Vendes ou compras?",
|
||||||
|
"counterparty": "Com quem?",
|
||||||
|
"counterpartyHint": "Uma pessoa ou um coletivo (opcional)",
|
||||||
|
"amount": "Montante",
|
||||||
|
"currency": "Moeda",
|
||||||
|
"currencyHint": "€, Ğ1, horas… (opcional)",
|
||||||
|
"hours": "horas",
|
||||||
|
"note": "Nota (opcional)",
|
||||||
|
"save": "Salvar",
|
||||||
|
"delete": "Remover",
|
||||||
|
"removeConfirm": "Remover esta venda?"
|
||||||
|
},
|
||||||
|
"legal": {
|
||||||
|
"title": "Privacidade e regras",
|
||||||
|
"subtitle": "A sua privacidade, as regras do mercado e a legalidade das sementes",
|
||||||
|
"privacyTitle": "A sua privacidade",
|
||||||
|
"privacyBody": "O Tane funciona sem conta, e tudo o que você registra fica no seu dispositivo, cifrado. Não há publicidade, nem rastreadores, nem servidor do Tane.\n\nNada é compartilhado a não ser que você queira: quando publica uma oferta ou o seu perfil, ou envia uma mensagem, viaja por servidores comunitários. As ofertas levam apenas uma zona aproximada — nunca a sua morada.\n\nO que publica é público, e podem ficar cópias mesmo depois de você retirar — por isso compartilhe com cuidado.",
|
||||||
|
"rulesTitle": "As regras do jogo",
|
||||||
|
"rulesBody": "O Tane é uma ferramenta, não uma loja: as trocas são acordadas diretamente entre pessoas e ninguém fica com comissão. Isso também significa que é responsável pelo que oferece e envia.\n\nNo mercado: seja honesto com suas sementes, ofereça apenas o que pode compartilhar, trate bem as pessoas e não faça spam. Pode bloquear qualquer pessoa e denunciar ofertas ou pessoas que quebrem as regras — as denúncias são tratadas nos servidores comunitários.",
|
||||||
|
"seedsTitle": "Sobre compartilhar sementes e mudas",
|
||||||
|
"seedsBody": "Oferecer e trocar sementes entre amadores é amplamente reconhecido na maioria dos países. Vender pode ser diferente: em muitos lugares, vender sementes de variedades não registadas oficialmente é restrito — consulta as regras locais antes de pedir um preço.\n\nEnviar sementes para outro país também costuma ser restrito, e as variedades protegidas comercialmente não podem ser propagadas sem autorização. Na dúvida, melhor local e melhor oferta.\n\nO mesmo se aplica a mudas e plantas jovens, mas a planta viva pode ter regras de transporte e fitossanitárias mais rígidas do que a semente: movê-la entre regiões ou países pode exigir controlos adicionais.",
|
||||||
|
"readFull": "Ler os documentos completos na web"
|
||||||
|
},
|
||||||
|
"marketGate": {
|
||||||
|
"title": "Antes de entrar no mercado",
|
||||||
|
"intro": "O mercado é um espaço compartilhado entre vizinhas e vizinhos. Ao continuar, aceitas umas poucas regras simples:",
|
||||||
|
"ruleHonest": "Seja honesto com as sementes que oferece",
|
||||||
|
"ruleLegal": "Compartilhe apenas o que pode compartilhar onde vive",
|
||||||
|
"ruleRespect": "Trata bem as pessoas — sem spam nem abusos",
|
||||||
|
"publicNote": "O que você publicar aqui é público, e podem ficar cópias mesmo que você retire depois.",
|
||||||
|
"viewLegal": "Privacidade e regras",
|
||||||
|
"accept": "Aceito",
|
||||||
|
"decline": "Agora não"
|
||||||
|
},
|
||||||
|
"report": {
|
||||||
|
"offer": "Denunciar esta oferta",
|
||||||
|
"person": "Denunciar esta pessoa",
|
||||||
|
"title": "Denunciar",
|
||||||
|
"prompt": "O que se passa?",
|
||||||
|
"reasonSpam": "Spam ou uma burla",
|
||||||
|
"reasonAbuse": "Abusivo ou desrespeitoso",
|
||||||
|
"reasonIllegal": "Sementes que não deviam ser oferecidas",
|
||||||
|
"reasonOther": "Outra coisa",
|
||||||
|
"detailsHint": "Acrescenta detalhes (opcional)",
|
||||||
|
"send": "Enviar denúncia",
|
||||||
|
"sentHidden": "Denúncia enviada — já não voltas a ver isto",
|
||||||
|
"failed": "Não foi possível enviar a denúncia — verifica a sua ligação",
|
||||||
|
"alsoBlock": "Bloquear também esta pessoa"
|
||||||
|
},
|
||||||
|
"block": {
|
||||||
|
"action": "Bloquear esta pessoa",
|
||||||
|
"confirmTitle": "Bloquear esta pessoa?",
|
||||||
|
"confirmBody": "Deixa de ver as suas ofertas e mensagens. Pode desbloqueá-la mais tarde em Pessoas bloqueadas, na configuração de compartilhamento.",
|
||||||
|
"confirm": "Bloquear",
|
||||||
|
"blockedToast": "Pessoa bloqueada — as suas ofertas e mensagens ficam ocultas",
|
||||||
|
"manageTitle": "Pessoas bloqueadas",
|
||||||
|
"manageEmpty": "Você não bloqueou ninguém",
|
||||||
|
"unblock": "Desbloquear"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -3,10 +3,10 @@
|
||||||
/// Source: lib/i18n
|
/// Source: lib/i18n
|
||||||
/// To regenerate, run: `dart run slang`
|
/// To regenerate, run: `dart run slang`
|
||||||
///
|
///
|
||||||
/// Locales: 7
|
/// Locales: 8
|
||||||
/// Strings: 3566 (509 per locale)
|
/// Strings: 4299 (537 per locale)
|
||||||
///
|
///
|
||||||
/// Built on 2026-07-18 at 10:28 UTC
|
/// Built on 2026-07-25 at 14:38 UTC
|
||||||
|
|
||||||
// coverage:ignore-file
|
// coverage:ignore-file
|
||||||
// ignore_for_file: type=lint, unused_import
|
// ignore_for_file: type=lint, unused_import
|
||||||
|
|
@ -24,6 +24,7 @@ import 'strings_es.g.dart' as l_es;
|
||||||
import 'strings_fr.g.dart' as l_fr;
|
import 'strings_fr.g.dart' as l_fr;
|
||||||
import 'strings_ja.g.dart' as l_ja;
|
import 'strings_ja.g.dart' as l_ja;
|
||||||
import 'strings_pt.g.dart' as l_pt;
|
import 'strings_pt.g.dart' as l_pt;
|
||||||
|
import 'strings_pt_BR.g.dart' as l_pt_BR;
|
||||||
part 'strings_en.g.dart';
|
part 'strings_en.g.dart';
|
||||||
|
|
||||||
/// Supported locales.
|
/// Supported locales.
|
||||||
|
|
@ -39,7 +40,8 @@ enum AppLocale with BaseAppLocale<AppLocale, Translations> {
|
||||||
es(languageCode: 'es'),
|
es(languageCode: 'es'),
|
||||||
fr(languageCode: 'fr'),
|
fr(languageCode: 'fr'),
|
||||||
ja(languageCode: 'ja'),
|
ja(languageCode: 'ja'),
|
||||||
pt(languageCode: 'pt');
|
pt(languageCode: 'pt'),
|
||||||
|
ptBr(languageCode: 'pt', countryCode: 'BR');
|
||||||
|
|
||||||
const AppLocale({
|
const AppLocale({
|
||||||
required this.languageCode,
|
required this.languageCode,
|
||||||
|
|
@ -113,6 +115,12 @@ enum AppLocale with BaseAppLocale<AppLocale, Translations> {
|
||||||
cardinalResolver: cardinalResolver,
|
cardinalResolver: cardinalResolver,
|
||||||
ordinalResolver: ordinalResolver,
|
ordinalResolver: ordinalResolver,
|
||||||
);
|
);
|
||||||
|
case AppLocale.ptBr:
|
||||||
|
return l_pt_BR.TranslationsPtBr(
|
||||||
|
overrides: overrides,
|
||||||
|
cardinalResolver: cardinalResolver,
|
||||||
|
ordinalResolver: ordinalResolver,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,6 @@ class _Translations$common$ast extends Translations$common$en {
|
||||||
@override String get delete => 'Desaniciar';
|
@override String get delete => 'Desaniciar';
|
||||||
@override String get edit => 'Editar';
|
@override String get edit => 'Editar';
|
||||||
@override String get type => 'Triba';
|
@override String get type => 'Triba';
|
||||||
@override String get comingSoon => 'Aína';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path: home
|
// Path: home
|
||||||
|
|
@ -262,6 +261,7 @@ class _Translations$settings$ast extends Translations$settings$en {
|
||||||
@override String get langEs => 'Español';
|
@override String get langEs => 'Español';
|
||||||
@override String get langEn => 'English';
|
@override String get langEn => 'English';
|
||||||
@override String get langPt => 'Português';
|
@override String get langPt => 'Português';
|
||||||
|
@override String get langPtBr => 'Português (Brasil)';
|
||||||
@override String get langAst => 'Asturianu';
|
@override String get langAst => 'Asturianu';
|
||||||
@override String get langFr => 'Français';
|
@override String get langFr => 'Français';
|
||||||
@override String get langDe => 'Deutsch';
|
@override String get langDe => 'Deutsch';
|
||||||
|
|
@ -765,7 +765,7 @@ class _Translations$market$ast extends Translations$market$en {
|
||||||
@override String get contact => 'Mensaxe';
|
@override String get contact => 'Mensaxe';
|
||||||
@override String get mine => 'Tu';
|
@override String get mine => 'Tu';
|
||||||
@override String get configTitle => 'Configuración de compartir';
|
@override String get configTitle => 'Configuración de compartir';
|
||||||
@override String get setupIntro => 'Compartir con xente cercano ye opcional. Namás indica la to zona averada — yá tas coneutáu a servidores comunitarios compartíos pa qu\'otres persones atopen lo qu\'ufiertes, ensin nenguna empresa en mediu.';
|
@override String get setupIntro => 'Compartir con xente cercano ye opcional. Namás indica la to zona averada — lo qu\'ufiertes viaxa per servidores comunitarios, calteníos por persones y coleutivos, non por una empresa, pa qu\'otres persones cercanes puedan atopalo.';
|
||||||
@override String get areaLabel => 'La to zona';
|
@override String get areaLabel => 'La to zona';
|
||||||
@override String get areaHelp => 'Caltiénse averao a costafecha — la to zona, enxamás un puntu esactu.';
|
@override String get areaHelp => 'Caltiénse averao a costafecha — la to zona, enxamás un puntu esactu.';
|
||||||
@override String get areaSet => 'La to zona ta puesta — averada, enxamás el to puntu esactu';
|
@override String get areaSet => 'La to zona ta puesta — averada, enxamás el to puntu esactu';
|
||||||
|
|
@ -1464,7 +1464,6 @@ extension on TranslationsAst {
|
||||||
'common.delete' => 'Desaniciar',
|
'common.delete' => 'Desaniciar',
|
||||||
'common.edit' => 'Editar',
|
'common.edit' => 'Editar',
|
||||||
'common.type' => 'Triba',
|
'common.type' => 'Triba',
|
||||||
'common.comingSoon' => 'Aína',
|
|
||||||
'home.tagline' => 'Comparte y cultiva simiente llocal',
|
'home.tagline' => 'Comparte y cultiva simiente llocal',
|
||||||
'home.openMarket' => 'Mercáu',
|
'home.openMarket' => 'Mercáu',
|
||||||
'home.openMarketSubtitle' => 'Descubri y comparte simiente cerca',
|
'home.openMarketSubtitle' => 'Descubri y comparte simiente cerca',
|
||||||
|
|
@ -1491,6 +1490,7 @@ extension on TranslationsAst {
|
||||||
'settings.langEs' => 'Español',
|
'settings.langEs' => 'Español',
|
||||||
'settings.langEn' => 'English',
|
'settings.langEn' => 'English',
|
||||||
'settings.langPt' => 'Português',
|
'settings.langPt' => 'Português',
|
||||||
|
'settings.langPtBr' => 'Português (Brasil)',
|
||||||
'settings.langAst' => 'Asturianu',
|
'settings.langAst' => 'Asturianu',
|
||||||
'settings.langFr' => 'Français',
|
'settings.langFr' => 'Français',
|
||||||
'settings.langDe' => 'Deutsch',
|
'settings.langDe' => 'Deutsch',
|
||||||
|
|
@ -1800,7 +1800,7 @@ extension on TranslationsAst {
|
||||||
'market.contact' => 'Mensaxe',
|
'market.contact' => 'Mensaxe',
|
||||||
'market.mine' => 'Tu',
|
'market.mine' => 'Tu',
|
||||||
'market.configTitle' => 'Configuración de compartir',
|
'market.configTitle' => 'Configuración de compartir',
|
||||||
'market.setupIntro' => 'Compartir con xente cercano ye opcional. Namás indica la to zona averada — yá tas coneutáu a servidores comunitarios compartíos pa qu\'otres persones atopen lo qu\'ufiertes, ensin nenguna empresa en mediu.',
|
'market.setupIntro' => 'Compartir con xente cercano ye opcional. Namás indica la to zona averada — lo qu\'ufiertes viaxa per servidores comunitarios, calteníos por persones y coleutivos, non por una empresa, pa qu\'otres persones cercanes puedan atopalo.',
|
||||||
'market.areaLabel' => 'La to zona',
|
'market.areaLabel' => 'La to zona',
|
||||||
'market.areaHelp' => 'Caltiénse averao a costafecha — la to zona, enxamás un puntu esactu.',
|
'market.areaHelp' => 'Caltiénse averao a costafecha — la to zona, enxamás un puntu esactu.',
|
||||||
'market.areaSet' => 'La to zona ta puesta — averada, enxamás el to puntu esactu',
|
'market.areaSet' => 'La to zona ta puesta — averada, enxamás el to puntu esactu',
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,6 @@ class _Translations$common$de extends Translations$common$en {
|
||||||
@override String get delete => 'Löschen';
|
@override String get delete => 'Löschen';
|
||||||
@override String get edit => 'Bearbeiten';
|
@override String get edit => 'Bearbeiten';
|
||||||
@override String get type => 'Typ';
|
@override String get type => 'Typ';
|
||||||
@override String get comingSoon => 'Bald';
|
|
||||||
@override String get offline => 'Offline - Teilen ist unterbrochen';
|
@override String get offline => 'Offline - Teilen ist unterbrochen';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -263,6 +262,7 @@ class _Translations$settings$de extends Translations$settings$en {
|
||||||
@override String get langEs => 'Español';
|
@override String get langEs => 'Español';
|
||||||
@override String get langEn => 'English';
|
@override String get langEn => 'English';
|
||||||
@override String get langPt => 'Português';
|
@override String get langPt => 'Português';
|
||||||
|
@override String get langPtBr => 'Português (Brasil)';
|
||||||
@override String get langAst => 'Asturianu';
|
@override String get langAst => 'Asturianu';
|
||||||
@override String get about => 'Über';
|
@override String get about => 'Über';
|
||||||
@override String get aboutText => 'Lokale, verschlüsselte Saatgutbank für traditionelle Samen. AGPL-3.0.';
|
@override String get aboutText => 'Lokale, verschlüsselte Saatgutbank für traditionelle Samen. AGPL-3.0.';
|
||||||
|
|
@ -768,7 +768,7 @@ class _Translations$market$de extends Translations$market$en {
|
||||||
@override String get contact => 'Nachricht';
|
@override String get contact => 'Nachricht';
|
||||||
@override String get mine => 'Du';
|
@override String get mine => 'Du';
|
||||||
@override String get configTitle => 'Teilen-Einrichtung';
|
@override String get configTitle => 'Teilen-Einrichtung';
|
||||||
@override String get setupIntro => 'Teilen mit Menschen in der Nähe ist optional. Gib einfach dein ungefähres Gebiet an - du bist bereits mit freigegebenen Gemeinschaftsservern verbunden, damit Leute das finden können, das du anbietest, ohne ein Unternehmen dazwischen.';
|
@override String get setupIntro => 'Teilen mit Menschen in der Nähe ist optional. Gib einfach dein ungefähres Gebiet an - was du anbietest, läuft über Gemeinschaftsserver, die von Menschen und Kollektiven betrieben werden, nicht von einem Unternehmen, damit andere in deiner Nähe es finden können.';
|
||||||
@override String get areaLabel => 'Dein Gebiet';
|
@override String get areaLabel => 'Dein Gebiet';
|
||||||
@override String get areaHelp => 'Absichtlich grob gehalten - deine Zone, nie ein genauer Punkt.';
|
@override String get areaHelp => 'Absichtlich grob gehalten - deine Zone, nie ein genauer Punkt.';
|
||||||
@override String get areaSet => 'Dein Gebiet ist gesetzt - grob, nie dein genauer Punkt';
|
@override String get areaSet => 'Dein Gebiet ist gesetzt - grob, nie dein genauer Punkt';
|
||||||
|
|
@ -1460,7 +1460,6 @@ extension on TranslationsDe {
|
||||||
'common.delete' => 'Löschen',
|
'common.delete' => 'Löschen',
|
||||||
'common.edit' => 'Bearbeiten',
|
'common.edit' => 'Bearbeiten',
|
||||||
'common.type' => 'Typ',
|
'common.type' => 'Typ',
|
||||||
'common.comingSoon' => 'Bald',
|
|
||||||
'common.offline' => 'Offline - Teilen ist unterbrochen',
|
'common.offline' => 'Offline - Teilen ist unterbrochen',
|
||||||
'home.tagline' => 'Teile und baue lokale Samen an',
|
'home.tagline' => 'Teile und baue lokale Samen an',
|
||||||
'home.openMarket' => 'Markt',
|
'home.openMarket' => 'Markt',
|
||||||
|
|
@ -1488,6 +1487,7 @@ extension on TranslationsDe {
|
||||||
'settings.langEs' => 'Español',
|
'settings.langEs' => 'Español',
|
||||||
'settings.langEn' => 'English',
|
'settings.langEn' => 'English',
|
||||||
'settings.langPt' => 'Português',
|
'settings.langPt' => 'Português',
|
||||||
|
'settings.langPtBr' => 'Português (Brasil)',
|
||||||
'settings.langAst' => 'Asturianu',
|
'settings.langAst' => 'Asturianu',
|
||||||
'settings.about' => 'Über',
|
'settings.about' => 'Über',
|
||||||
'settings.aboutText' => 'Lokale, verschlüsselte Saatgutbank für traditionelle Samen. AGPL-3.0.',
|
'settings.aboutText' => 'Lokale, verschlüsselte Saatgutbank für traditionelle Samen. AGPL-3.0.',
|
||||||
|
|
@ -1799,7 +1799,7 @@ extension on TranslationsDe {
|
||||||
'market.contact' => 'Nachricht',
|
'market.contact' => 'Nachricht',
|
||||||
'market.mine' => 'Du',
|
'market.mine' => 'Du',
|
||||||
'market.configTitle' => 'Teilen-Einrichtung',
|
'market.configTitle' => 'Teilen-Einrichtung',
|
||||||
'market.setupIntro' => 'Teilen mit Menschen in der Nähe ist optional. Gib einfach dein ungefähres Gebiet an - du bist bereits mit freigegebenen Gemeinschaftsservern verbunden, damit Leute das finden können, das du anbietest, ohne ein Unternehmen dazwischen.',
|
'market.setupIntro' => 'Teilen mit Menschen in der Nähe ist optional. Gib einfach dein ungefähres Gebiet an - was du anbietest, läuft über Gemeinschaftsserver, die von Menschen und Kollektiven betrieben werden, nicht von einem Unternehmen, damit andere in deiner Nähe es finden können.',
|
||||||
'market.areaLabel' => 'Dein Gebiet',
|
'market.areaLabel' => 'Dein Gebiet',
|
||||||
'market.areaHelp' => 'Absichtlich grob gehalten - deine Zone, nie ein genauer Punkt.',
|
'market.areaHelp' => 'Absichtlich grob gehalten - deine Zone, nie ein genauer Punkt.',
|
||||||
'market.areaSet' => 'Dein Gebiet ist gesetzt - grob, nie dein genauer Punkt',
|
'market.areaSet' => 'Dein Gebiet ist gesetzt - grob, nie dein genauer Punkt',
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ class Translations with BaseTranslations<AppLocale, Translations> {
|
||||||
late final Translations$marketGate$en marketGate = Translations$marketGate$en.internal(_root);
|
late final Translations$marketGate$en marketGate = Translations$marketGate$en.internal(_root);
|
||||||
late final Translations$report$en report = Translations$report$en.internal(_root);
|
late final Translations$report$en report = Translations$report$en.internal(_root);
|
||||||
late final Translations$block$en block = Translations$block$en.internal(_root);
|
late final Translations$block$en block = Translations$block$en.internal(_root);
|
||||||
|
late final Translations$sharingInvite$en sharingInvite = Translations$sharingInvite$en.internal(_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path: avatar
|
// Path: avatar
|
||||||
|
|
@ -340,9 +341,6 @@ class Translations$common$en {
|
||||||
/// en: 'Type'
|
/// en: 'Type'
|
||||||
String get type => 'Type';
|
String get type => 'Type';
|
||||||
|
|
||||||
/// en: 'Coming soon'
|
|
||||||
String get comingSoon => 'Coming soon';
|
|
||||||
|
|
||||||
/// en: 'You're offline — sharing is paused'
|
/// en: 'You're offline — sharing is paused'
|
||||||
String get offline => 'You\'re offline — sharing is paused';
|
String get offline => 'You\'re offline — sharing is paused';
|
||||||
}
|
}
|
||||||
|
|
@ -460,6 +458,9 @@ class Translations$settings$en {
|
||||||
/// en: 'Português'
|
/// en: 'Português'
|
||||||
String get langPt => 'Português';
|
String get langPt => 'Português';
|
||||||
|
|
||||||
|
/// en: 'Português (Brasil)'
|
||||||
|
String get langPtBr => 'Português (Brasil)';
|
||||||
|
|
||||||
/// en: 'Asturianu'
|
/// en: 'Asturianu'
|
||||||
String get langAst => 'Asturianu';
|
String get langAst => 'Asturianu';
|
||||||
|
|
||||||
|
|
@ -1480,8 +1481,8 @@ class Translations$market$en {
|
||||||
/// en: 'Sharing setup'
|
/// en: 'Sharing setup'
|
||||||
String get configTitle => 'Sharing setup';
|
String get configTitle => 'Sharing setup';
|
||||||
|
|
||||||
/// en: 'Sharing with people nearby is optional. Just set your rough area — you're already connected to shared community servers so people can find what you offer, with no company in the middle.'
|
/// en: 'Sharing with people nearby is optional. Just set your rough area — what you offer travels through community servers, run by people and collectives rather than a company, so others nearby can find it.'
|
||||||
String get setupIntro => 'Sharing with people nearby is optional. Just set your rough area — you\'re already connected to shared community servers so people can find what you offer, with no company in the middle.';
|
String get setupIntro => 'Sharing with people nearby is optional. Just set your rough area — what you offer travels through community servers, run by people and collectives rather than a company, so others nearby can find it.';
|
||||||
|
|
||||||
/// en: 'Your area'
|
/// en: 'Your area'
|
||||||
String get areaLabel => 'Your area';
|
String get areaLabel => 'Your area';
|
||||||
|
|
@ -1575,6 +1576,12 @@ class Translations$market$en {
|
||||||
|
|
||||||
/// en: 'Photo'
|
/// en: 'Photo'
|
||||||
String get photo => 'Photo';
|
String get photo => 'Photo';
|
||||||
|
|
||||||
|
/// en: 'Sharing is on'
|
||||||
|
String get sharingOnLabel => 'Sharing is on';
|
||||||
|
|
||||||
|
/// en: 'Turn this off and Tane stops connecting to any server. Your seed book keeps working just the same.'
|
||||||
|
String get sharingOnHelp => 'Turn this off and Tane stops connecting to any server. Your seed book keeps working just the same.';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path: profile
|
// Path: profile
|
||||||
|
|
@ -2238,6 +2245,9 @@ class Translations$marketGate$en {
|
||||||
|
|
||||||
/// en: 'Not now'
|
/// en: 'Not now'
|
||||||
String get decline => 'Not now';
|
String get decline => 'Not now';
|
||||||
|
|
||||||
|
/// en: 'To carry offers and messages between people, Tane needs to go online and leave them on community servers. Until you agree, it doesn't connect to anything.'
|
||||||
|
String get networkNote => 'To carry offers and messages between people, Tane needs to go online and leave them on community servers. Until you agree, it doesn\'t connect to anything.';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path: report
|
// Path: report
|
||||||
|
|
@ -2321,6 +2331,36 @@ class Translations$block$en {
|
||||||
String get unblock => 'Unblock';
|
String get unblock => 'Unblock';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Path: sharingInvite
|
||||||
|
class Translations$sharingInvite$en {
|
||||||
|
Translations$sharingInvite$en.internal(this._root);
|
||||||
|
|
||||||
|
final Translations _root; // ignore: unused_field
|
||||||
|
|
||||||
|
// Translations
|
||||||
|
|
||||||
|
/// en: 'This wakes up when you start sharing'
|
||||||
|
String get title => 'This wakes up when you start sharing';
|
||||||
|
|
||||||
|
/// en: 'Write to whoever has seeds near you'
|
||||||
|
String get perkChat => 'Write to whoever has seeds near you';
|
||||||
|
|
||||||
|
/// en: 'Keep the offers you like'
|
||||||
|
String get perkFavorites => 'Keep the offers you like';
|
||||||
|
|
||||||
|
/// en: 'Your circle of people you trust'
|
||||||
|
String get perkPeople => 'Your circle of people you trust';
|
||||||
|
|
||||||
|
/// en: 'For that, Tane needs to go online. Until you say yes, it doesn't talk to anyone.'
|
||||||
|
String get networkNote => 'For that, Tane needs to go online. Until you say yes, it doesn\'t talk to anyone.';
|
||||||
|
|
||||||
|
/// en: 'Start sharing'
|
||||||
|
String get start => 'Start sharing';
|
||||||
|
|
||||||
|
/// en: 'Not now'
|
||||||
|
String get notNow => 'Not now';
|
||||||
|
}
|
||||||
|
|
||||||
// Path: intro.slides
|
// Path: intro.slides
|
||||||
class Translations$intro$slides$en {
|
class Translations$intro$slides$en {
|
||||||
Translations$intro$slides$en.internal(this._root);
|
Translations$intro$slides$en.internal(this._root);
|
||||||
|
|
@ -2836,7 +2876,6 @@ extension on Translations {
|
||||||
'common.delete' => 'Delete',
|
'common.delete' => 'Delete',
|
||||||
'common.edit' => 'Edit',
|
'common.edit' => 'Edit',
|
||||||
'common.type' => 'Type',
|
'common.type' => 'Type',
|
||||||
'common.comingSoon' => 'Coming soon',
|
|
||||||
'common.offline' => 'You\'re offline — sharing is paused',
|
'common.offline' => 'You\'re offline — sharing is paused',
|
||||||
'home.tagline' => 'Share and grow local seeds',
|
'home.tagline' => 'Share and grow local seeds',
|
||||||
'home.openMarket' => 'Market',
|
'home.openMarket' => 'Market',
|
||||||
|
|
@ -2864,6 +2903,7 @@ extension on Translations {
|
||||||
'settings.langEs' => 'Español',
|
'settings.langEs' => 'Español',
|
||||||
'settings.langEn' => 'English',
|
'settings.langEn' => 'English',
|
||||||
'settings.langPt' => 'Português',
|
'settings.langPt' => 'Português',
|
||||||
|
'settings.langPtBr' => 'Português (Brasil)',
|
||||||
'settings.langAst' => 'Asturianu',
|
'settings.langAst' => 'Asturianu',
|
||||||
'settings.langFr' => 'Français',
|
'settings.langFr' => 'Français',
|
||||||
'settings.langDe' => 'Deutsch',
|
'settings.langDe' => 'Deutsch',
|
||||||
|
|
@ -3182,7 +3222,7 @@ extension on Translations {
|
||||||
'market.contact' => 'Message',
|
'market.contact' => 'Message',
|
||||||
'market.mine' => 'You',
|
'market.mine' => 'You',
|
||||||
'market.configTitle' => 'Sharing setup',
|
'market.configTitle' => 'Sharing setup',
|
||||||
'market.setupIntro' => 'Sharing with people nearby is optional. Just set your rough area — you\'re already connected to shared community servers so people can find what you offer, with no company in the middle.',
|
'market.setupIntro' => 'Sharing with people nearby is optional. Just set your rough area — what you offer travels through community servers, run by people and collectives rather than a company, so others nearby can find it.',
|
||||||
'market.areaLabel' => 'Your area',
|
'market.areaLabel' => 'Your area',
|
||||||
'market.areaHelp' => 'Kept rough on purpose — your zone, never an exact spot.',
|
'market.areaHelp' => 'Kept rough on purpose — your zone, never an exact spot.',
|
||||||
'market.areaSet' => 'Your area is set — kept coarse, never your exact spot',
|
'market.areaSet' => 'Your area is set — kept coarse, never your exact spot',
|
||||||
|
|
@ -3214,6 +3254,8 @@ extension on Translations {
|
||||||
'market.copyId' => 'Copy code',
|
'market.copyId' => 'Copy code',
|
||||||
'market.idCopied' => 'Code copied',
|
'market.idCopied' => 'Code copied',
|
||||||
'market.photo' => 'Photo',
|
'market.photo' => 'Photo',
|
||||||
|
'market.sharingOnLabel' => 'Sharing is on',
|
||||||
|
'market.sharingOnHelp' => 'Turn this off and Tane stops connecting to any server. Your seed book keeps working just the same.',
|
||||||
'profile.title' => 'Your profile',
|
'profile.title' => 'Your profile',
|
||||||
'profile.name' => 'Display name',
|
'profile.name' => 'Display name',
|
||||||
'profile.nameHint' => 'How others see you',
|
'profile.nameHint' => 'How others see you',
|
||||||
|
|
@ -3288,10 +3330,10 @@ extension on Translations {
|
||||||
'plantare.delete' => 'Remove',
|
'plantare.delete' => 'Remove',
|
||||||
'plantare.statusReturned' => 'Returned',
|
'plantare.statusReturned' => 'Returned',
|
||||||
'plantare.statusForgiven' => 'Settled',
|
'plantare.statusForgiven' => 'Settled',
|
||||||
'plantare.openSection' => 'Open',
|
|
||||||
'plantare.settledSection' => 'Done',
|
|
||||||
_ => null,
|
_ => null,
|
||||||
} ?? switch (path) {
|
} ?? switch (path) {
|
||||||
|
'plantare.openSection' => 'Open',
|
||||||
|
'plantare.settledSection' => 'Done',
|
||||||
'plantare.removeConfirm' => 'Remove this commitment?',
|
'plantare.removeConfirm' => 'Remove this commitment?',
|
||||||
'plantare.returnBy' => ({required Object date}) => 'Return by ${date}',
|
'plantare.returnBy' => ({required Object date}) => 'Return by ${date}',
|
||||||
'plantare.overdue' => 'overdue',
|
'plantare.overdue' => 'overdue',
|
||||||
|
|
@ -3398,6 +3440,7 @@ extension on Translations {
|
||||||
'marketGate.viewLegal' => 'Privacy & rules',
|
'marketGate.viewLegal' => 'Privacy & rules',
|
||||||
'marketGate.accept' => 'I agree',
|
'marketGate.accept' => 'I agree',
|
||||||
'marketGate.decline' => 'Not now',
|
'marketGate.decline' => 'Not now',
|
||||||
|
'marketGate.networkNote' => 'To carry offers and messages between people, Tane needs to go online and leave them on community servers. Until you agree, it doesn\'t connect to anything.',
|
||||||
'report.offer' => 'Report this offer',
|
'report.offer' => 'Report this offer',
|
||||||
'report.person' => 'Report this person',
|
'report.person' => 'Report this person',
|
||||||
'report.title' => 'Report',
|
'report.title' => 'Report',
|
||||||
|
|
@ -3419,6 +3462,13 @@ extension on Translations {
|
||||||
'block.manageTitle' => 'Blocked people',
|
'block.manageTitle' => 'Blocked people',
|
||||||
'block.manageEmpty' => 'You haven\'t blocked anyone',
|
'block.manageEmpty' => 'You haven\'t blocked anyone',
|
||||||
'block.unblock' => 'Unblock',
|
'block.unblock' => 'Unblock',
|
||||||
|
'sharingInvite.title' => 'This wakes up when you start sharing',
|
||||||
|
'sharingInvite.perkChat' => 'Write to whoever has seeds near you',
|
||||||
|
'sharingInvite.perkFavorites' => 'Keep the offers you like',
|
||||||
|
'sharingInvite.perkPeople' => 'Your circle of people you trust',
|
||||||
|
'sharingInvite.networkNote' => 'For that, Tane needs to go online. Until you say yes, it doesn\'t talk to anyone.',
|
||||||
|
'sharingInvite.start' => 'Start sharing',
|
||||||
|
'sharingInvite.notNow' => 'Not now',
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ class TranslationsEs extends Translations with BaseTranslations<AppLocale, Trans
|
||||||
@override late final _Translations$marketGate$es marketGate = _Translations$marketGate$es._(_root);
|
@override late final _Translations$marketGate$es marketGate = _Translations$marketGate$es._(_root);
|
||||||
@override late final _Translations$report$es report = _Translations$report$es._(_root);
|
@override late final _Translations$report$es report = _Translations$report$es._(_root);
|
||||||
@override late final _Translations$block$es block = _Translations$block$es._(_root);
|
@override late final _Translations$block$es block = _Translations$block$es._(_root);
|
||||||
|
@override late final _Translations$sharingInvite$es sharingInvite = _Translations$sharingInvite$es._(_root);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path: avatar
|
// Path: avatar
|
||||||
|
|
@ -222,7 +223,6 @@ class _Translations$common$es extends Translations$common$en {
|
||||||
@override String get delete => 'Eliminar';
|
@override String get delete => 'Eliminar';
|
||||||
@override String get edit => 'Editar';
|
@override String get edit => 'Editar';
|
||||||
@override String get type => 'Tipo';
|
@override String get type => 'Tipo';
|
||||||
@override String get comingSoon => 'Pronto';
|
|
||||||
@override String get offline => 'Sin conexión — el compartir está en pausa';
|
@override String get offline => 'Sin conexión — el compartir está en pausa';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -286,6 +286,7 @@ class _Translations$settings$es extends Translations$settings$en {
|
||||||
@override String get langEs => 'Español';
|
@override String get langEs => 'Español';
|
||||||
@override String get langEn => 'English';
|
@override String get langEn => 'English';
|
||||||
@override String get langPt => 'Português';
|
@override String get langPt => 'Português';
|
||||||
|
@override String get langPtBr => 'Português (Brasil)';
|
||||||
@override String get langFr => 'Français';
|
@override String get langFr => 'Français';
|
||||||
@override String get langDe => 'Deutsch';
|
@override String get langDe => 'Deutsch';
|
||||||
@override String get langJa => '日本語';
|
@override String get langJa => '日本語';
|
||||||
|
|
@ -806,7 +807,7 @@ class _Translations$market$es extends Translations$market$en {
|
||||||
@override String get contact => 'Mensaje';
|
@override String get contact => 'Mensaje';
|
||||||
@override String get mine => 'Tú';
|
@override String get mine => 'Tú';
|
||||||
@override String get configTitle => 'Configuración de compartir';
|
@override String get configTitle => 'Configuración de compartir';
|
||||||
@override String get setupIntro => 'Compartir con gente cercana es opcional. Solo indica tu zona aproximada — ya estás conectado a servidores comunitarios compartidos para que otras personas encuentren lo que ofreces, sin ninguna empresa en medio.';
|
@override String get setupIntro => 'Compartir con gente cercana es opcional. Solo indica tu zona aproximada — lo que ofreces viaja por servidores comunitarios, mantenidos por personas y colectivos, no por una empresa, para que otras personas cercanas puedan encontrarlo.';
|
||||||
@override String get areaLabel => 'Tu zona';
|
@override String get areaLabel => 'Tu zona';
|
||||||
@override String get areaHelp => 'Se mantiene aproximado a propósito — tu zona, nunca un punto exacto.';
|
@override String get areaHelp => 'Se mantiene aproximado a propósito — tu zona, nunca un punto exacto.';
|
||||||
@override String get areaSet => 'Tu zona está puesta — aproximada, nunca tu punto exacto';
|
@override String get areaSet => 'Tu zona está puesta — aproximada, nunca tu punto exacto';
|
||||||
|
|
@ -838,6 +839,8 @@ class _Translations$market$es extends Translations$market$en {
|
||||||
@override String get copyId => 'Copiar código';
|
@override String get copyId => 'Copiar código';
|
||||||
@override String get idCopied => 'Código copiado';
|
@override String get idCopied => 'Código copiado';
|
||||||
@override String get photo => 'Foto';
|
@override String get photo => 'Foto';
|
||||||
|
@override String get sharingOnLabel => 'Compartir está activado';
|
||||||
|
@override String get sharingOnHelp => 'Si lo desactivas, Tane deja de conectarse a ningún servidor. Tu cuaderno de semillas sigue funcionando igual.';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path: profile
|
// Path: profile
|
||||||
|
|
@ -1137,6 +1140,7 @@ class _Translations$marketGate$es extends Translations$marketGate$en {
|
||||||
@override String get viewLegal => 'Privacidad y normas';
|
@override String get viewLegal => 'Privacidad y normas';
|
||||||
@override String get accept => 'Acepto';
|
@override String get accept => 'Acepto';
|
||||||
@override String get decline => 'Ahora no';
|
@override String get decline => 'Ahora no';
|
||||||
|
@override String get networkNote => 'Para llevar las ofertas y los mensajes de unas personas a otras, Tane necesita conectarse y dejarlos en servidores comunitarios. Hasta que aceptes, no se conecta a nada.';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Path: report
|
// Path: report
|
||||||
|
|
@ -1178,6 +1182,22 @@ class _Translations$block$es extends Translations$block$en {
|
||||||
@override String get unblock => 'Desbloquear';
|
@override String get unblock => 'Desbloquear';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Path: sharingInvite
|
||||||
|
class _Translations$sharingInvite$es extends Translations$sharingInvite$en {
|
||||||
|
_Translations$sharingInvite$es._(TranslationsEs root) : this._root = root, super.internal(root);
|
||||||
|
|
||||||
|
final TranslationsEs _root; // ignore: unused_field
|
||||||
|
|
||||||
|
// Translations
|
||||||
|
@override String get title => 'Esto se enciende cuando empiezas a compartir';
|
||||||
|
@override String get perkChat => 'Escribirte con quien tiene semillas cerca';
|
||||||
|
@override String get perkFavorites => 'Guardar las ofertas que te gustan';
|
||||||
|
@override String get perkPeople => 'Tu círculo de gente de confianza';
|
||||||
|
@override String get networkNote => 'Para eso Tane necesita conectarse. Hasta que digas que sí, no habla con nadie.';
|
||||||
|
@override String get start => 'Empezar a compartir';
|
||||||
|
@override String get notNow => 'Ahora no';
|
||||||
|
}
|
||||||
|
|
||||||
// Path: intro.slides
|
// Path: intro.slides
|
||||||
class _Translations$intro$slides$es extends Translations$intro$slides$en {
|
class _Translations$intro$slides$es extends Translations$intro$slides$en {
|
||||||
_Translations$intro$slides$es._(TranslationsEs root) : this._root = root, super.internal(root);
|
_Translations$intro$slides$es._(TranslationsEs root) : this._root = root, super.internal(root);
|
||||||
|
|
@ -1577,7 +1597,6 @@ extension on TranslationsEs {
|
||||||
'common.delete' => 'Eliminar',
|
'common.delete' => 'Eliminar',
|
||||||
'common.edit' => 'Editar',
|
'common.edit' => 'Editar',
|
||||||
'common.type' => 'Tipo',
|
'common.type' => 'Tipo',
|
||||||
'common.comingSoon' => 'Pronto',
|
|
||||||
'common.offline' => 'Sin conexión — el compartir está en pausa',
|
'common.offline' => 'Sin conexión — el compartir está en pausa',
|
||||||
'home.tagline' => 'Comparte y cultiva semillas locales',
|
'home.tagline' => 'Comparte y cultiva semillas locales',
|
||||||
'home.openMarket' => 'Mercado',
|
'home.openMarket' => 'Mercado',
|
||||||
|
|
@ -1605,6 +1624,7 @@ extension on TranslationsEs {
|
||||||
'settings.langEs' => 'Español',
|
'settings.langEs' => 'Español',
|
||||||
'settings.langEn' => 'English',
|
'settings.langEn' => 'English',
|
||||||
'settings.langPt' => 'Português',
|
'settings.langPt' => 'Português',
|
||||||
|
'settings.langPtBr' => 'Português (Brasil)',
|
||||||
'settings.langFr' => 'Français',
|
'settings.langFr' => 'Français',
|
||||||
'settings.langDe' => 'Deutsch',
|
'settings.langDe' => 'Deutsch',
|
||||||
'settings.langJa' => '日本語',
|
'settings.langJa' => '日本語',
|
||||||
|
|
@ -1922,7 +1942,7 @@ extension on TranslationsEs {
|
||||||
'market.contact' => 'Mensaje',
|
'market.contact' => 'Mensaje',
|
||||||
'market.mine' => 'Tú',
|
'market.mine' => 'Tú',
|
||||||
'market.configTitle' => 'Configuración de compartir',
|
'market.configTitle' => 'Configuración de compartir',
|
||||||
'market.setupIntro' => 'Compartir con gente cercana es opcional. Solo indica tu zona aproximada — ya estás conectado a servidores comunitarios compartidos para que otras personas encuentren lo que ofreces, sin ninguna empresa en medio.',
|
'market.setupIntro' => 'Compartir con gente cercana es opcional. Solo indica tu zona aproximada — lo que ofreces viaja por servidores comunitarios, mantenidos por personas y colectivos, no por una empresa, para que otras personas cercanas puedan encontrarlo.',
|
||||||
'market.areaLabel' => 'Tu zona',
|
'market.areaLabel' => 'Tu zona',
|
||||||
'market.areaHelp' => 'Se mantiene aproximado a propósito — tu zona, nunca un punto exacto.',
|
'market.areaHelp' => 'Se mantiene aproximado a propósito — tu zona, nunca un punto exacto.',
|
||||||
'market.areaSet' => 'Tu zona está puesta — aproximada, nunca tu punto exacto',
|
'market.areaSet' => 'Tu zona está puesta — aproximada, nunca tu punto exacto',
|
||||||
|
|
@ -1954,6 +1974,8 @@ extension on TranslationsEs {
|
||||||
'market.copyId' => 'Copiar código',
|
'market.copyId' => 'Copiar código',
|
||||||
'market.idCopied' => 'Código copiado',
|
'market.idCopied' => 'Código copiado',
|
||||||
'market.photo' => 'Foto',
|
'market.photo' => 'Foto',
|
||||||
|
'market.sharingOnLabel' => 'Compartir está activado',
|
||||||
|
'market.sharingOnHelp' => 'Si lo desactivas, Tane deja de conectarse a ningún servidor. Tu cuaderno de semillas sigue funcionando igual.',
|
||||||
'profile.title' => 'Tu perfil',
|
'profile.title' => 'Tu perfil',
|
||||||
'profile.name' => 'Nombre',
|
'profile.name' => 'Nombre',
|
||||||
'profile.nameHint' => 'Cómo te ven los demás',
|
'profile.nameHint' => 'Cómo te ven los demás',
|
||||||
|
|
@ -2029,10 +2051,10 @@ extension on TranslationsEs {
|
||||||
'plantare.statusReturned' => 'Devuelto',
|
'plantare.statusReturned' => 'Devuelto',
|
||||||
'plantare.statusForgiven' => 'Saldado',
|
'plantare.statusForgiven' => 'Saldado',
|
||||||
'plantare.openSection' => 'Pendientes',
|
'plantare.openSection' => 'Pendientes',
|
||||||
'plantare.settledSection' => 'Hechos',
|
|
||||||
'plantare.removeConfirm' => '¿Quitar este compromiso?',
|
|
||||||
_ => null,
|
_ => null,
|
||||||
} ?? switch (path) {
|
} ?? switch (path) {
|
||||||
|
'plantare.settledSection' => 'Hechos',
|
||||||
|
'plantare.removeConfirm' => '¿Quitar este compromiso?',
|
||||||
'plantare.returnBy' => ({required Object date}) => 'Devolver antes del ${date}',
|
'plantare.returnBy' => ({required Object date}) => 'Devolver antes del ${date}',
|
||||||
'plantare.overdue' => 'vencido',
|
'plantare.overdue' => 'vencido',
|
||||||
'plantare.dueByLabel' => 'Devolver antes de (opcional)',
|
'plantare.dueByLabel' => 'Devolver antes de (opcional)',
|
||||||
|
|
@ -2138,6 +2160,7 @@ extension on TranslationsEs {
|
||||||
'marketGate.viewLegal' => 'Privacidad y normas',
|
'marketGate.viewLegal' => 'Privacidad y normas',
|
||||||
'marketGate.accept' => 'Acepto',
|
'marketGate.accept' => 'Acepto',
|
||||||
'marketGate.decline' => 'Ahora no',
|
'marketGate.decline' => 'Ahora no',
|
||||||
|
'marketGate.networkNote' => 'Para llevar las ofertas y los mensajes de unas personas a otras, Tane necesita conectarse y dejarlos en servidores comunitarios. Hasta que aceptes, no se conecta a nada.',
|
||||||
'report.offer' => 'Denunciar esta oferta',
|
'report.offer' => 'Denunciar esta oferta',
|
||||||
'report.person' => 'Denunciar a esta persona',
|
'report.person' => 'Denunciar a esta persona',
|
||||||
'report.title' => 'Denunciar',
|
'report.title' => 'Denunciar',
|
||||||
|
|
@ -2159,6 +2182,13 @@ extension on TranslationsEs {
|
||||||
'block.manageTitle' => 'Personas bloqueadas',
|
'block.manageTitle' => 'Personas bloqueadas',
|
||||||
'block.manageEmpty' => 'No has bloqueado a nadie',
|
'block.manageEmpty' => 'No has bloqueado a nadie',
|
||||||
'block.unblock' => 'Desbloquear',
|
'block.unblock' => 'Desbloquear',
|
||||||
|
'sharingInvite.title' => 'Esto se enciende cuando empiezas a compartir',
|
||||||
|
'sharingInvite.perkChat' => 'Escribirte con quien tiene semillas cerca',
|
||||||
|
'sharingInvite.perkFavorites' => 'Guardar las ofertas que te gustan',
|
||||||
|
'sharingInvite.perkPeople' => 'Tu círculo de gente de confianza',
|
||||||
|
'sharingInvite.networkNote' => 'Para eso Tane necesita conectarse. Hasta que digas que sí, no habla con nadie.',
|
||||||
|
'sharingInvite.start' => 'Empezar a compartir',
|
||||||
|
'sharingInvite.notNow' => 'Ahora no',
|
||||||
_ => null,
|
_ => null,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,6 @@ class _Translations$common$fr extends Translations$common$en {
|
||||||
@override String get delete => 'Supprimer';
|
@override String get delete => 'Supprimer';
|
||||||
@override String get edit => 'Modifier';
|
@override String get edit => 'Modifier';
|
||||||
@override String get type => 'Type';
|
@override String get type => 'Type';
|
||||||
@override String get comingSoon => 'À venir';
|
|
||||||
@override String get offline => 'Vous êtes hors ligne — le partage est en pause';
|
@override String get offline => 'Vous êtes hors ligne — le partage est en pause';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -263,6 +262,7 @@ class _Translations$settings$fr extends Translations$settings$en {
|
||||||
@override String get langEs => 'Español';
|
@override String get langEs => 'Español';
|
||||||
@override String get langEn => 'English';
|
@override String get langEn => 'English';
|
||||||
@override String get langPt => 'Português';
|
@override String get langPt => 'Português';
|
||||||
|
@override String get langPtBr => 'Português (Brasil)';
|
||||||
@override String get langAst => 'Asturianu';
|
@override String get langAst => 'Asturianu';
|
||||||
@override String get langFr => 'Français';
|
@override String get langFr => 'Français';
|
||||||
@override String get langDe => 'Deutsch';
|
@override String get langDe => 'Deutsch';
|
||||||
|
|
@ -768,7 +768,7 @@ class _Translations$market$fr extends Translations$market$en {
|
||||||
@override String get contact => 'Message';
|
@override String get contact => 'Message';
|
||||||
@override String get mine => 'Vous';
|
@override String get mine => 'Vous';
|
||||||
@override String get configTitle => 'Configuration du partage';
|
@override String get configTitle => 'Configuration du partage';
|
||||||
@override String get setupIntro => 'Le partage avec les gens à proximité est optionnel. Définissez simplement votre zone approximative — vous êtes déjà connectés aux serveurs communautaires partagés pour que les gens trouvent ce que vous offrez, sans aucune entreprise au milieu.';
|
@override String get setupIntro => 'Le partage avec les gens à proximité est optionnel. Définissez simplement votre zone approximative — ce que vous offrez passe par des serveurs communautaires, tenus par des personnes et des collectifs et non par une entreprise, pour que d\'autres près de chez vous puissent le trouver.';
|
||||||
@override String get areaLabel => 'Votre zone';
|
@override String get areaLabel => 'Votre zone';
|
||||||
@override String get areaHelp => 'Gardée approximative volontairement — votre zone, jamais un point exact.';
|
@override String get areaHelp => 'Gardée approximative volontairement — votre zone, jamais un point exact.';
|
||||||
@override String get areaSet => 'Votre zone est définie — approximative, jamais votre point exact';
|
@override String get areaSet => 'Votre zone est définie — approximative, jamais votre point exact';
|
||||||
|
|
@ -1460,7 +1460,6 @@ extension on TranslationsFr {
|
||||||
'common.delete' => 'Supprimer',
|
'common.delete' => 'Supprimer',
|
||||||
'common.edit' => 'Modifier',
|
'common.edit' => 'Modifier',
|
||||||
'common.type' => 'Type',
|
'common.type' => 'Type',
|
||||||
'common.comingSoon' => 'À venir',
|
|
||||||
'common.offline' => 'Vous êtes hors ligne — le partage est en pause',
|
'common.offline' => 'Vous êtes hors ligne — le partage est en pause',
|
||||||
'home.tagline' => 'Partagez et cultivez des graines locales',
|
'home.tagline' => 'Partagez et cultivez des graines locales',
|
||||||
'home.openMarket' => 'Marché',
|
'home.openMarket' => 'Marché',
|
||||||
|
|
@ -1488,6 +1487,7 @@ extension on TranslationsFr {
|
||||||
'settings.langEs' => 'Español',
|
'settings.langEs' => 'Español',
|
||||||
'settings.langEn' => 'English',
|
'settings.langEn' => 'English',
|
||||||
'settings.langPt' => 'Português',
|
'settings.langPt' => 'Português',
|
||||||
|
'settings.langPtBr' => 'Português (Brasil)',
|
||||||
'settings.langAst' => 'Asturianu',
|
'settings.langAst' => 'Asturianu',
|
||||||
'settings.langFr' => 'Français',
|
'settings.langFr' => 'Français',
|
||||||
'settings.langDe' => 'Deutsch',
|
'settings.langDe' => 'Deutsch',
|
||||||
|
|
@ -1799,7 +1799,7 @@ extension on TranslationsFr {
|
||||||
'market.contact' => 'Message',
|
'market.contact' => 'Message',
|
||||||
'market.mine' => 'Vous',
|
'market.mine' => 'Vous',
|
||||||
'market.configTitle' => 'Configuration du partage',
|
'market.configTitle' => 'Configuration du partage',
|
||||||
'market.setupIntro' => 'Le partage avec les gens à proximité est optionnel. Définissez simplement votre zone approximative — vous êtes déjà connectés aux serveurs communautaires partagés pour que les gens trouvent ce que vous offrez, sans aucune entreprise au milieu.',
|
'market.setupIntro' => 'Le partage avec les gens à proximité est optionnel. Définissez simplement votre zone approximative — ce que vous offrez passe par des serveurs communautaires, tenus par des personnes et des collectifs et non par une entreprise, pour que d\'autres près de chez vous puissent le trouver.',
|
||||||
'market.areaLabel' => 'Votre zone',
|
'market.areaLabel' => 'Votre zone',
|
||||||
'market.areaHelp' => 'Gardée approximative volontairement — votre zone, jamais un point exact.',
|
'market.areaHelp' => 'Gardée approximative volontairement — votre zone, jamais un point exact.',
|
||||||
'market.areaSet' => 'Votre zone est définie — approximative, jamais votre point exact',
|
'market.areaSet' => 'Votre zone est définie — approximative, jamais votre point exact',
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,6 @@ class _Translations$common$ja extends Translations$common$en {
|
||||||
@override String get delete => '削除';
|
@override String get delete => '削除';
|
||||||
@override String get edit => '編集';
|
@override String get edit => '編集';
|
||||||
@override String get type => '種類';
|
@override String get type => '種類';
|
||||||
@override String get comingSoon => '近日公開';
|
|
||||||
@override String get offline => 'オフラインです — 共有を一時停止しています';
|
@override String get offline => 'オフラインです — 共有を一時停止しています';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -102,6 +101,7 @@ class _Translations$settings$ja extends Translations$settings$en {
|
||||||
@override String get langEs => 'Español';
|
@override String get langEs => 'Español';
|
||||||
@override String get langEn => 'English';
|
@override String get langEn => 'English';
|
||||||
@override String get langPt => 'Português';
|
@override String get langPt => 'Português';
|
||||||
|
@override String get langPtBr => 'Português (Brasil)';
|
||||||
@override String get langAst => 'Asturianu';
|
@override String get langAst => 'Asturianu';
|
||||||
@override String get langFr => 'Français';
|
@override String get langFr => 'Français';
|
||||||
@override String get langDe => 'Deutsch';
|
@override String get langDe => 'Deutsch';
|
||||||
|
|
@ -139,7 +139,6 @@ extension on TranslationsJa {
|
||||||
'common.delete' => '削除',
|
'common.delete' => '削除',
|
||||||
'common.edit' => '編集',
|
'common.edit' => '編集',
|
||||||
'common.type' => '種類',
|
'common.type' => '種類',
|
||||||
'common.comingSoon' => '近日公開',
|
|
||||||
'common.offline' => 'オフラインです — 共有を一時停止しています',
|
'common.offline' => 'オフラインです — 共有を一時停止しています',
|
||||||
'menu.tagline' => 'あなたの種子バンク',
|
'menu.tagline' => 'あなたの種子バンク',
|
||||||
'menu.inventory' => '在庫',
|
'menu.inventory' => '在庫',
|
||||||
|
|
@ -155,6 +154,7 @@ extension on TranslationsJa {
|
||||||
'settings.langEs' => 'Español',
|
'settings.langEs' => 'Español',
|
||||||
'settings.langEn' => 'English',
|
'settings.langEn' => 'English',
|
||||||
'settings.langPt' => 'Português',
|
'settings.langPt' => 'Português',
|
||||||
|
'settings.langPtBr' => 'Português (Brasil)',
|
||||||
'settings.langAst' => 'Asturianu',
|
'settings.langAst' => 'Asturianu',
|
||||||
'settings.langFr' => 'Français',
|
'settings.langFr' => 'Français',
|
||||||
'settings.langDe' => 'Deutsch',
|
'settings.langDe' => 'Deutsch',
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
2168
apps/app_seeds/lib/i18n/strings_pt_BR.g.dart
Normal file
2168
apps/app_seeds/lib/i18n/strings_pt_BR.g.dart
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
import 'bootstrap.dart';
|
import 'bootstrap.dart';
|
||||||
|
|
@ -6,6 +7,16 @@ import 'ui/restart_widget.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
// Draw behind the system bars (edge-to-edge) with transparent bars, so the app
|
||||||
|
// fills the screen on Android 15+ (where edge-to-edge is enforced) and stays
|
||||||
|
// consistent elsewhere. Scaffolds use SafeArea to keep content off the insets.
|
||||||
|
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||||
|
SystemChrome.setSystemUIOverlayStyle(
|
||||||
|
const SystemUiOverlayStyle(
|
||||||
|
statusBarColor: Color(0x00000000),
|
||||||
|
systemNavigationBarColor: Color(0x00000000),
|
||||||
|
),
|
||||||
|
);
|
||||||
// Start from the device language, then let an explicit in-app choice win —
|
// Start from the device language, then let an explicit in-app choice win —
|
||||||
// it's the only reliable way to reach languages the OS picker doesn't offer
|
// it's the only reliable way to reach languages the OS picker doesn't offer
|
||||||
// (e.g. Asturian). The saved choice is restored inside [Bootstrap], after DI.
|
// (e.g. Asturian). The saved choice is restored inside [Bootstrap], after DI.
|
||||||
|
|
|
||||||
35
apps/app_seeds/lib/services/camera_availability.dart
Normal file
35
apps/app_seeds/lib/services/camera_availability.dart
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
|
|
||||||
|
/// Whether this device has any camera. Resolved once at startup (via the native
|
||||||
|
/// channel, `PackageManager.FEATURE_CAMERA_ANY`) and cached so `build()` methods
|
||||||
|
/// can read it synchronously — the QR scan button ([qrScanSupported]) and the
|
||||||
|
/// photo-source sheet hide their camera options when it is false.
|
||||||
|
///
|
||||||
|
/// Defaults to `true` so a normal phone never loses camera UI over a transient
|
||||||
|
/// channel error; only genuinely camera-less devices (Chromebooks, Android
|
||||||
|
/// Automotive, some TVs — kept installable by the `uses-feature required=false`
|
||||||
|
/// in AndroidManifest) flip it to false. Non-Android platforms keep the default
|
||||||
|
/// (iOS devices have a camera; desktop/web gate camera UI elsewhere).
|
||||||
|
bool _deviceHasCamera = true;
|
||||||
|
|
||||||
|
bool get deviceHasCamera => _deviceHasCamera;
|
||||||
|
|
||||||
|
@visibleForTesting
|
||||||
|
set deviceHasCamera(bool value) => _deviceHasCamera = value;
|
||||||
|
|
||||||
|
const _channel = MethodChannel('org.comunes.tane/coarse_location');
|
||||||
|
|
||||||
|
/// Queries the native camera-presence check and caches it. Called once during
|
||||||
|
/// bootstrap, before the first real frame, so synchronous readers see the right
|
||||||
|
/// value. Android-only; elsewhere the default stands. Never throws — a channel
|
||||||
|
/// error leaves the safe default in place.
|
||||||
|
Future<void> initCameraAvailability() async {
|
||||||
|
if (defaultTargetPlatform != TargetPlatform.android) return;
|
||||||
|
try {
|
||||||
|
final has = await _channel.invokeMethod<bool>('hasCamera');
|
||||||
|
if (has != null) _deviceHasCamera = has;
|
||||||
|
} catch (_) {
|
||||||
|
// Keep the default; a normal phone shouldn't lose camera UI over this.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -34,6 +34,26 @@ String? offerThumbnailDataUri(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Builds a small JPEG thumbnail (longest edge [edge]px) for the inventory-list
|
||||||
|
/// avatar, so the list never has to decode the full-resolution photo. Returns
|
||||||
|
/// raw JPEG bytes, or null on undecodable input (the caller falls back to the
|
||||||
|
/// full photo). Kept as local bytes — regenerable, so it is excluded from sync
|
||||||
|
/// and backups.
|
||||||
|
Uint8List? inventoryThumbnailBytes(
|
||||||
|
Uint8List bytes, {
|
||||||
|
int edge = 96,
|
||||||
|
int quality = 72,
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
final decoded = img.decodeImage(bytes);
|
||||||
|
if (decoded == null) return null;
|
||||||
|
final resized = _fitWithin(decoded, edge);
|
||||||
|
return Uint8List.fromList(img.encodeJpg(resized, quality: quality));
|
||||||
|
} catch (_) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Extracts the raw bytes from a `data:...;base64,…` URI, or null when [uri] is
|
/// Extracts the raw bytes from a `data:...;base64,…` URI, or null when [uri] is
|
||||||
/// not a base64 data URI. Used by the UI to render an inline thumbnail with
|
/// not a base64 data URI. Used by the UI to render an inline thumbnail with
|
||||||
/// `Image.memory` instead of a network fetch.
|
/// `Image.memory` instead of a network fetch.
|
||||||
|
|
|
||||||
46
apps/app_seeds/lib/services/sharing_switch.dart
Normal file
46
apps/app_seeds/lib/services/sharing_switch.dart
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
import 'package:flutter/foundation.dart';
|
||||||
|
|
||||||
|
import 'social_connection.dart';
|
||||||
|
import 'social_settings.dart';
|
||||||
|
|
||||||
|
/// The one place that turns the sharing side of Tane on and off.
|
||||||
|
///
|
||||||
|
/// Sharing is opt-in: until someone joins it, the app opens no connection at
|
||||||
|
/// all and the seed book is entirely offline. Joining has to move three things
|
||||||
|
/// at once — the stored choice, the live relay connection, and the flag the UI
|
||||||
|
/// listens to — and doing that from several screens is how they drift apart.
|
||||||
|
/// So every caller (the community-rules gate, the invite sheet, the sharing
|
||||||
|
/// setup) goes through here instead.
|
||||||
|
class SharingSwitch {
|
||||||
|
SharingSwitch({
|
||||||
|
required SocialSettings settings,
|
||||||
|
SocialConnection? connection,
|
||||||
|
bool enabled = false,
|
||||||
|
}) : _settings = settings,
|
||||||
|
_connection = connection,
|
||||||
|
on = ValueNotifier(enabled);
|
||||||
|
|
||||||
|
final SocialSettings _settings;
|
||||||
|
final SocialConnection? _connection;
|
||||||
|
|
||||||
|
/// Whether sharing is on right now. Screens listen so the drawer's social
|
||||||
|
/// entries light up the moment someone joins, with no restart.
|
||||||
|
final ValueNotifier<bool> on;
|
||||||
|
|
||||||
|
Future<void> enable() async {
|
||||||
|
await _settings.setSharingEnabled(true);
|
||||||
|
// Safe to call even if it is already running: `start` guards itself.
|
||||||
|
_connection?.start();
|
||||||
|
on.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Turning it off must actually go offline — closing the live session, not
|
||||||
|
/// just recording the choice for the next launch.
|
||||||
|
Future<void> disable() async {
|
||||||
|
await _settings.setSharingEnabled(false);
|
||||||
|
await _connection?.stop();
|
||||||
|
on.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void dispose() => on.dispose();
|
||||||
|
}
|
||||||
|
|
@ -25,19 +25,36 @@ class SocialConnection {
|
||||||
required SocialSettings settings,
|
required SocialSettings settings,
|
||||||
SessionOpener? open,
|
SessionOpener? open,
|
||||||
Stream<bool>? online,
|
Stream<bool>? online,
|
||||||
|
List<Duration>? retrySchedule,
|
||||||
}) : _settings = settings,
|
}) : _settings = settings,
|
||||||
_open = open ?? social.openSession,
|
_open = open ?? social.openSession,
|
||||||
_online = online;
|
_online = online,
|
||||||
|
_retrySchedule = retrySchedule ?? _defaultRetrySchedule;
|
||||||
|
|
||||||
|
/// Backoff for self-retries after a failed attempt while started and not
|
||||||
|
/// knowingly offline (the fresh-install case: online the whole time, first
|
||||||
|
/// connect fails, so no connectivity change ever retriggers a connect).
|
||||||
|
static const _defaultRetrySchedule = [
|
||||||
|
Duration(seconds: 5),
|
||||||
|
Duration(seconds: 15),
|
||||||
|
Duration(seconds: 45),
|
||||||
|
Duration(seconds: 90),
|
||||||
|
];
|
||||||
|
|
||||||
final SocialSettings _settings;
|
final SocialSettings _settings;
|
||||||
final SessionOpener _open;
|
final SessionOpener _open;
|
||||||
final Stream<bool>? _online;
|
final Stream<bool>? _online;
|
||||||
|
final List<Duration> _retrySchedule;
|
||||||
|
|
||||||
final _sessions = StreamController<SocialSession?>.broadcast();
|
final _sessions = StreamController<SocialSession?>.broadcast();
|
||||||
SocialSession? _current;
|
SocialSession? _current;
|
||||||
Future<SocialSession?>? _pending;
|
Future<SocialSession?>? _pending;
|
||||||
StreamSubscription<bool>? _onlineSub;
|
StreamSubscription<bool>? _onlineSub;
|
||||||
bool _disposed = false;
|
bool _disposed = false;
|
||||||
|
bool _started = false;
|
||||||
|
bool _knownOffline = false;
|
||||||
|
Timer? _retryTimer;
|
||||||
|
int _retryIndex = 0;
|
||||||
|
|
||||||
/// Emits the live session on each (re)connect, and null when it drops.
|
/// Emits the live session on each (re)connect, and null when it drops.
|
||||||
Stream<SocialSession?> get sessions => _sessions.stream;
|
Stream<SocialSession?> get sessions => _sessions.stream;
|
||||||
|
|
@ -46,12 +63,19 @@ class SocialConnection {
|
||||||
SocialSession? get current => _current;
|
SocialSession? get current => _current;
|
||||||
|
|
||||||
/// Begins watching connectivity (reconnect on regain, drop when offline) and
|
/// Begins watching connectivity (reconnect on regain, drop when offline) and
|
||||||
/// attempts an initial connect. Idempotent-ish; call once at startup.
|
/// attempts an initial connect. Called at startup when sharing is already on,
|
||||||
|
/// and again the moment someone joins the sharing side — hence the guard, so
|
||||||
|
/// a second call never stacks a second connectivity subscription.
|
||||||
void start() {
|
void start() {
|
||||||
|
if (_started || _disposed) return;
|
||||||
|
_started = true;
|
||||||
_onlineSub = (_online ?? _connectivityOnline()).listen((isOnline) {
|
_onlineSub = (_online ?? _connectivityOnline()).listen((isOnline) {
|
||||||
|
_knownOffline = !isOnline;
|
||||||
if (!isOnline) {
|
if (!isOnline) {
|
||||||
|
_cancelRetry();
|
||||||
_drop();
|
_drop();
|
||||||
} else if (_current == null) {
|
} else if (_current == null) {
|
||||||
|
_retryIndex = 0; // fresh network — start the backoff over
|
||||||
unawaited(session());
|
unawaited(session());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -75,15 +99,40 @@ class SocialConnection {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
_current = s;
|
_current = s;
|
||||||
|
_retryIndex = 0;
|
||||||
|
_cancelRetry();
|
||||||
_sessions.add(s);
|
_sessions.add(s);
|
||||||
return s;
|
return s;
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
return null; // unreachable — a later connectivity change retries
|
_scheduleRetry(); // unreachable — retry with backoff (see below)
|
||||||
|
return null;
|
||||||
} finally {
|
} finally {
|
||||||
_pending = null;
|
_pending = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// After a failed attempt, retries by itself while started and not knowingly
|
||||||
|
/// offline — a connectivity change may never come if the device was online
|
||||||
|
/// all along. Un-started connections (one-shot [session] callers, tests)
|
||||||
|
/// never leave a timer behind.
|
||||||
|
void _scheduleRetry() {
|
||||||
|
if (!_started || _disposed || _knownOffline || _current != null) return;
|
||||||
|
_cancelRetry();
|
||||||
|
final i = _retryIndex < _retrySchedule.length
|
||||||
|
? _retryIndex
|
||||||
|
: _retrySchedule.length - 1;
|
||||||
|
_retryIndex++;
|
||||||
|
_retryTimer = Timer(_retrySchedule[i], () {
|
||||||
|
if (_disposed || _current != null) return;
|
||||||
|
unawaited(session());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void _cancelRetry() {
|
||||||
|
_retryTimer?.cancel();
|
||||||
|
_retryTimer = null;
|
||||||
|
}
|
||||||
|
|
||||||
void _drop() {
|
void _drop() {
|
||||||
final s = _current;
|
final s = _current;
|
||||||
_current = null;
|
_current = null;
|
||||||
|
|
@ -93,8 +142,22 @@ class SocialConnection {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Goes offline for good until [start] is called again: stops watching
|
||||||
|
/// connectivity, cancels any pending retry and tears the live session down.
|
||||||
|
/// This is what "turn sharing off" must do — before it existed, clearing the
|
||||||
|
/// server list only took effect on the next launch, because the already-open
|
||||||
|
/// session was never closed. Unlike [dispose] the object stays usable.
|
||||||
|
Future<void> stop() async {
|
||||||
|
_started = false;
|
||||||
|
_cancelRetry();
|
||||||
|
await _onlineSub?.cancel();
|
||||||
|
_onlineSub = null;
|
||||||
|
_drop();
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> dispose() async {
|
Future<void> dispose() async {
|
||||||
_disposed = true;
|
_disposed = true;
|
||||||
|
_cancelRetry();
|
||||||
await _onlineSub?.cancel();
|
await _onlineSub?.cancel();
|
||||||
_onlineSub = null;
|
_onlineSub = null;
|
||||||
_drop();
|
_drop();
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,11 @@ import '../security/secret_store.dart';
|
||||||
/// keystore (via [SecretStore]) to honour "no plaintext at rest" — no
|
/// keystore (via [SecretStore]) to honour "no plaintext at rest" — no
|
||||||
/// shared_preferences.
|
/// shared_preferences.
|
||||||
///
|
///
|
||||||
/// Relays default to a small set of well-known public servers so the market
|
/// Sharing is off until the person joins it ([sharingEnabled]); until then the
|
||||||
/// works out of the box; the exposure is minimal (offers are opt-in and carry
|
/// app opens no connection at all. Once they do, relays default to a small set
|
||||||
/// only a coarse geohash) and the user can swap them for a community server.
|
/// of well-known public servers so the market works out of the box; the exposure
|
||||||
|
/// is minimal (offers are opt-in and carry only a coarse geohash) and the user
|
||||||
|
/// can swap them for a community server or turn them all off.
|
||||||
/// The area stays unset until the user picks one (it's inherently personal).
|
/// The area stays unset until the user picks one (it's inherently personal).
|
||||||
class SocialSettings {
|
class SocialSettings {
|
||||||
SocialSettings(this._store);
|
SocialSettings(this._store);
|
||||||
|
|
@ -16,6 +18,7 @@ class SocialSettings {
|
||||||
|
|
||||||
static const _areaKey = 'tane.social.area_geohash';
|
static const _areaKey = 'tane.social.area_geohash';
|
||||||
static const _relaysKey = 'tane.social.relays';
|
static const _relaysKey = 'tane.social.relays';
|
||||||
|
static const _sharingKey = 'tane.social.sharing_enabled';
|
||||||
static const _searchPrecisionKey = 'tane.social.search_precision';
|
static const _searchPrecisionKey = 'tane.social.search_precision';
|
||||||
static const _blockedKey = 'tane.social.blocked_pubkeys';
|
static const _blockedKey = 'tane.social.blocked_pubkeys';
|
||||||
static const _hiddenOffersKey = 'tane.social.hidden_offers';
|
static const _hiddenOffersKey = 'tane.social.hidden_offers';
|
||||||
|
|
@ -29,11 +32,11 @@ class SocialSettings {
|
||||||
static const int maxSearchPrecision = 5;
|
static const int maxSearchPrecision = 5;
|
||||||
static const int defaultSearchPrecision = 4;
|
static const int defaultSearchPrecision = 4;
|
||||||
|
|
||||||
/// Community servers used automatically so sharing works from the first
|
/// Community servers used automatically once the person joins the sharing
|
||||||
/// launch. The relay pool skips any that are unreachable, so a dead one never
|
/// side, so the market works without any setup. The relay pool skips any that
|
||||||
/// breaks the market; the user never has to know these exist. The Comunes
|
/// are unreachable, so a dead one never breaks the market; the user never has
|
||||||
/// relay comes first as the reliable, non-commercial home; the public ones
|
/// to know these exist. The Comunes relay comes first as the reliable,
|
||||||
/// are backup.
|
/// non-commercial home; the public ones are backup.
|
||||||
static const List<String> defaultRelays = [
|
static const List<String> defaultRelays = [
|
||||||
'wss://relay.comunes.org',
|
'wss://relay.comunes.org',
|
||||||
'wss://nos.lol',
|
'wss://nos.lol',
|
||||||
|
|
@ -62,6 +65,38 @@ class SocialSettings {
|
||||||
urls.map((u) => u.trim()).where((u) => u.isNotEmpty).join('\n'),
|
urls.map((u) => u.trim()).where((u) => u.isNotEmpty).join('\n'),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// Whether the person has said yes to the sharing side of the app. Until they
|
||||||
|
/// do, Tane opens no connection at all — the seed book is entirely offline.
|
||||||
|
///
|
||||||
|
/// Three states on purpose: `null` means "never asked", which is what lets an
|
||||||
|
/// install that predates this setting keep working exactly as before (see
|
||||||
|
/// `migrateSharingEnabled`). Once written it is a plain yes/no the person
|
||||||
|
/// controls from the sharing setup.
|
||||||
|
Future<bool?> sharingEnabled() async {
|
||||||
|
final raw = await _store.read(_sharingKey);
|
||||||
|
if (raw == null) return null;
|
||||||
|
return raw == '1';
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> setSharingEnabled(bool enabled) =>
|
||||||
|
_store.write(_sharingKey, enabled ? '1' : '0');
|
||||||
|
|
||||||
|
/// Decides, once, what an install that predates the setting should get, and
|
||||||
|
/// records it. Anyone who had already been through the intro was on a build
|
||||||
|
/// that connected at launch, so they keep sharing on and lose nothing —
|
||||||
|
/// messages, device sync and offer alerts keep arriving. A fresh install has
|
||||||
|
/// not seen the intro yet, so it starts fully offline and only goes online
|
||||||
|
/// when the person joins the sharing side.
|
||||||
|
///
|
||||||
|
/// Returns the effective value. Safe to call on every launch: it writes only
|
||||||
|
/// when nothing has been recorded yet.
|
||||||
|
Future<bool> migrateSharingEnabled({required bool introSeen}) async {
|
||||||
|
final stored = await sharingEnabled();
|
||||||
|
if (stored != null) return stored;
|
||||||
|
await setSharingEnabled(introSeen);
|
||||||
|
return introSeen;
|
||||||
|
}
|
||||||
|
|
||||||
/// How wide to search — a geohash prefix length in [minSearchPrecision,
|
/// How wide to search — a geohash prefix length in [minSearchPrecision,
|
||||||
/// maxSearchPrecision]. Defaults (and falls back on any garbage) to
|
/// maxSearchPrecision]. Defaults (and falls back on any garbage) to
|
||||||
/// [defaultSearchPrecision].
|
/// [defaultSearchPrecision].
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import '../services/offer_mapper.dart';
|
||||||
import '../services/offer_outbox.dart';
|
import '../services/offer_outbox.dart';
|
||||||
import '../services/offer_thumbnail.dart';
|
import '../services/offer_thumbnail.dart';
|
||||||
import '../services/social_connection.dart';
|
import '../services/social_connection.dart';
|
||||||
|
import '../services/social_service.dart';
|
||||||
|
|
||||||
/// State of the offer discovery/publish screen. Transport-agnostic — it holds
|
/// State of the offer discovery/publish screen. Transport-agnostic — it holds
|
||||||
/// only what the UI shows, never a relay handle.
|
/// only what the UI shows, never a relay handle.
|
||||||
|
|
@ -24,12 +25,17 @@ class OffersState extends Equatable {
|
||||||
this.blockedAuthors = const {},
|
this.blockedAuthors = const {},
|
||||||
this.hiddenOfferKeys = const {},
|
this.hiddenOfferKeys = const {},
|
||||||
this.searching = false,
|
this.searching = false,
|
||||||
|
this.loadingMore = false,
|
||||||
|
this.nextPageCursor,
|
||||||
this.publishing = false,
|
this.publishing = false,
|
||||||
this.hasSearched = false,
|
this.hasSearched = false,
|
||||||
|
this.connectionEpoch = 0,
|
||||||
this.error,
|
this.error,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// Offers discovered so far for [areaGeohash], newest appended as they arrive.
|
/// Offers discovered so far for [areaGeohash], newest first. Bounded in size
|
||||||
|
/// (see [OffersCubit.maxOffersKept]) so a busy area can't grow the list — and
|
||||||
|
/// the inline photo thumbnails it carries — without limit.
|
||||||
final List<Offer> offers;
|
final List<Offer> offers;
|
||||||
|
|
||||||
/// The coarse area currently being browsed.
|
/// The coarse area currently being browsed.
|
||||||
|
|
@ -57,12 +63,30 @@ class OffersState extends Equatable {
|
||||||
final Set<String> hiddenOfferKeys;
|
final Set<String> hiddenOfferKeys;
|
||||||
|
|
||||||
final bool searching;
|
final bool searching;
|
||||||
|
|
||||||
|
/// True while a "load more" page is in flight, so the UI shows a footer
|
||||||
|
/// spinner and doesn't fire overlapping page requests.
|
||||||
|
final bool loadingMore;
|
||||||
|
|
||||||
|
/// Cursor (Unix seconds) for the next older page, or null when the newest
|
||||||
|
/// page was short (nothing older) or the in-memory cap was reached — in both
|
||||||
|
/// cases there is no more to load.
|
||||||
|
final int? nextPageCursor;
|
||||||
|
|
||||||
final bool publishing;
|
final bool publishing;
|
||||||
|
|
||||||
|
/// Whether more offers can be paged in (drives the infinite-scroll trigger).
|
||||||
|
bool get canLoadMore => nextPageCursor != null;
|
||||||
|
|
||||||
/// True once a discovery has been started, so the UI can tell "no search yet"
|
/// True once a discovery has been started, so the UI can tell "no search yet"
|
||||||
/// from "searched, found nothing".
|
/// from "searched, found nothing".
|
||||||
final bool hasSearched;
|
final bool hasSearched;
|
||||||
|
|
||||||
|
/// Bumped whenever the underlying transport comes or goes, so the UI rebuilds
|
||||||
|
/// and re-reads [OffersCubit.isOnline] — states differing only here are
|
||||||
|
/// otherwise Equatable-equal and bloc would skip the emit.
|
||||||
|
final int connectionEpoch;
|
||||||
|
|
||||||
/// Last error, in human terms for the UI (null when fine).
|
/// Last error, in human terms for the UI (null when fine).
|
||||||
final String? error;
|
final String? error;
|
||||||
|
|
||||||
|
|
@ -115,8 +139,11 @@ class OffersState extends Equatable {
|
||||||
Set<String>? blockedAuthors,
|
Set<String>? blockedAuthors,
|
||||||
Set<String>? hiddenOfferKeys,
|
Set<String>? hiddenOfferKeys,
|
||||||
bool? searching,
|
bool? searching,
|
||||||
|
bool? loadingMore,
|
||||||
|
int? Function()? nextPageCursor,
|
||||||
bool? publishing,
|
bool? publishing,
|
||||||
bool? hasSearched,
|
bool? hasSearched,
|
||||||
|
int? connectionEpoch,
|
||||||
String? Function()? error,
|
String? Function()? error,
|
||||||
}) {
|
}) {
|
||||||
return OffersState(
|
return OffersState(
|
||||||
|
|
@ -129,8 +156,12 @@ class OffersState extends Equatable {
|
||||||
blockedAuthors: blockedAuthors ?? this.blockedAuthors,
|
blockedAuthors: blockedAuthors ?? this.blockedAuthors,
|
||||||
hiddenOfferKeys: hiddenOfferKeys ?? this.hiddenOfferKeys,
|
hiddenOfferKeys: hiddenOfferKeys ?? this.hiddenOfferKeys,
|
||||||
searching: searching ?? this.searching,
|
searching: searching ?? this.searching,
|
||||||
|
loadingMore: loadingMore ?? this.loadingMore,
|
||||||
|
nextPageCursor:
|
||||||
|
nextPageCursor != null ? nextPageCursor() : this.nextPageCursor,
|
||||||
publishing: publishing ?? this.publishing,
|
publishing: publishing ?? this.publishing,
|
||||||
hasSearched: hasSearched ?? this.hasSearched,
|
hasSearched: hasSearched ?? this.hasSearched,
|
||||||
|
connectionEpoch: connectionEpoch ?? this.connectionEpoch,
|
||||||
error: error != null ? error() : this.error,
|
error: error != null ? error() : this.error,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -146,8 +177,11 @@ class OffersState extends Equatable {
|
||||||
blockedAuthors,
|
blockedAuthors,
|
||||||
hiddenOfferKeys,
|
hiddenOfferKeys,
|
||||||
searching,
|
searching,
|
||||||
|
loadingMore,
|
||||||
|
nextPageCursor,
|
||||||
publishing,
|
publishing,
|
||||||
hasSearched,
|
hasSearched,
|
||||||
|
connectionEpoch,
|
||||||
error,
|
error,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
@ -159,15 +193,40 @@ class OffersState extends Equatable {
|
||||||
class OffersCubit extends Cubit<OffersState> {
|
class OffersCubit extends Cubit<OffersState> {
|
||||||
OffersCubit(
|
OffersCubit(
|
||||||
this._transport, {
|
this._transport, {
|
||||||
|
SocialConnection? connection,
|
||||||
Future<Uint8List?> Function(String varietyId)? coverPhoto,
|
Future<Uint8List?> Function(String varietyId)? coverPhoto,
|
||||||
String? Function(Uint8List bytes)? thumbnail,
|
String? Function(Uint8List bytes)? thumbnail,
|
||||||
Future<void> Function()? onDispose,
|
Future<void> Function()? onDispose,
|
||||||
}) : _coverPhoto = coverPhoto,
|
}) : _coverPhoto = coverPhoto,
|
||||||
_thumbnail = thumbnail,
|
_thumbnail = thumbnail,
|
||||||
_onDispose = onDispose,
|
_onDispose = onDispose,
|
||||||
super(const OffersState());
|
super(const OffersState()) {
|
||||||
|
// Fresh-install fix: the transport captured at build time may be null while
|
||||||
|
// the shared connection is still coming up (or dropped). Follow the
|
||||||
|
// connection so the market recovers by itself instead of staying offline
|
||||||
|
// until a manual retry.
|
||||||
|
_connSub = connection?.sessions.listen(_onSession);
|
||||||
|
}
|
||||||
|
|
||||||
final OfferTransport? _transport;
|
OfferTransport? _transport;
|
||||||
|
StreamSubscription<SocialSession?>? _connSub;
|
||||||
|
|
||||||
|
/// The last area prefix asked of [discover]; re-run when the connection
|
||||||
|
/// (re)appears so results show without the user tapping anything.
|
||||||
|
String? _lastPrefix;
|
||||||
|
|
||||||
|
void _onSession(SocialSession? session) {
|
||||||
|
if (isClosed) return;
|
||||||
|
final transport = session?.offers;
|
||||||
|
if (identical(transport, _transport)) return;
|
||||||
|
_transport = transport;
|
||||||
|
final prefix = _lastPrefix;
|
||||||
|
if (transport != null && prefix != null) {
|
||||||
|
unawaited(discover(prefix)); // emits fresh states as results arrive
|
||||||
|
} else {
|
||||||
|
emit(state.copyWith(connectionEpoch: state.connectionEpoch + 1));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Fetches a variety's cover photo bytes; null in tests or when no inventory
|
/// Fetches a variety's cover photo bytes; null in tests or when no inventory
|
||||||
/// repo is wired.
|
/// repo is wired.
|
||||||
|
|
@ -183,11 +242,25 @@ class OffersCubit extends Cubit<OffersState> {
|
||||||
StreamSubscription<Offer>? _sub;
|
StreamSubscription<Offer>? _sub;
|
||||||
Timer? _searchTimeout;
|
Timer? _searchTimeout;
|
||||||
|
|
||||||
|
/// Upper bound on offers held in memory. Each offer can carry an inline
|
||||||
|
/// (~40 KB) photo thumbnail, so an unbounded list in a busy area is a real
|
||||||
|
/// out-of-memory risk on mobile. Paging stops once the list reaches this, and
|
||||||
|
/// live offers beyond it evict the oldest — the newest stay visible.
|
||||||
|
static const int maxOffersKept = 400;
|
||||||
|
|
||||||
/// Whether a live transport is available (relay configured and reachable).
|
/// Whether a live transport is available (relay configured and reachable).
|
||||||
bool get isOnline => _transport != null;
|
bool get isOnline => _transport != null;
|
||||||
|
|
||||||
/// Starts (or restarts) discovery for [geohashPrefix]. Results stream in.
|
/// Current time in Unix seconds — the granularity Nostr filters use for
|
||||||
|
/// `since`/`until`.
|
||||||
|
int _now() => DateTime.now().millisecondsSinceEpoch ~/ 1000;
|
||||||
|
|
||||||
|
/// Starts (or restarts) discovery for [geohashPrefix]. Fetches the newest page
|
||||||
|
/// up front (bounded), then keeps a live subscription for offers published
|
||||||
|
/// from now on — older results arrive via [loadNextPage], not by draining the
|
||||||
|
/// whole area into memory.
|
||||||
Future<void> discover(String geohashPrefix) async {
|
Future<void> discover(String geohashPrefix) async {
|
||||||
|
_lastPrefix = geohashPrefix;
|
||||||
final transport = _transport;
|
final transport = _transport;
|
||||||
if (transport == null) {
|
if (transport == null) {
|
||||||
emit(state.copyWith(error: () => 'offline', hasSearched: true));
|
emit(state.copyWith(error: () => 'offline', hasSearched: true));
|
||||||
|
|
@ -207,15 +280,38 @@ class OffersCubit extends Cubit<OffersState> {
|
||||||
searching: true,
|
searching: true,
|
||||||
hasSearched: true,
|
hasSearched: true,
|
||||||
));
|
));
|
||||||
_sub = transport.discover(DiscoveryQuery(geohashPrefix: geohashPrefix)).listen(
|
|
||||||
(offer) =>
|
final query = DiscoveryQuery(
|
||||||
emit(state.copyWith(offers: _merge(state.offers, offer), searching: false)),
|
geohashPrefix: geohashPrefix,
|
||||||
onError: (Object e) =>
|
types: state.typeFilter,
|
||||||
emit(state.copyWith(searching: false, error: () => '$e')),
|
|
||||||
);
|
);
|
||||||
// The discover stream stays open for live offers and never signals "done",
|
// Live subscription first, bounded to offers published from now on, so a new
|
||||||
// so stop the spinner after a beat: no results → show the empty state, not
|
// listing shows up immediately without re-dumping the whole area.
|
||||||
// an endless "searching".
|
final since = _now();
|
||||||
|
_sub = transport.discover(query, since: since).listen(
|
||||||
|
(offer) => emit(state.copyWith(
|
||||||
|
offers: _capped(_prepend(state.offers, offer)),
|
||||||
|
searching: false,
|
||||||
|
)),
|
||||||
|
onError: (Object e) =>
|
||||||
|
emit(state.copyWith(searching: false, error: () => '$e')),
|
||||||
|
);
|
||||||
|
|
||||||
|
try {
|
||||||
|
final page = await transport.discoverPage(query);
|
||||||
|
if (!isClosed) {
|
||||||
|
emit(state.copyWith(
|
||||||
|
offers: _capped(_mergePage(state.offers, page.offers)),
|
||||||
|
nextPageCursor: () => page.nextCursor,
|
||||||
|
searching: false,
|
||||||
|
));
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
if (!isClosed) emit(state.copyWith(searching: false, error: () => '$e'));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Safety net: if the first page hangs and no live offer arrives, still stop
|
||||||
|
// the spinner so the screen shows the empty state, not an endless search.
|
||||||
_searchTimeout = Timer(const Duration(seconds: 6), () {
|
_searchTimeout = Timer(const Duration(seconds: 6), () {
|
||||||
if (!isClosed && state.searching) {
|
if (!isClosed && state.searching) {
|
||||||
emit(state.copyWith(searching: false));
|
emit(state.copyWith(searching: false));
|
||||||
|
|
@ -223,18 +319,64 @@ class OffersCubit extends Cubit<OffersState> {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Appends [incoming] to [current], replacing any existing offer with the same
|
/// Loads the next (older) page of offers for the current area. Called by the
|
||||||
/// author + id. Relays legitimately resend addressable events (a stored copy
|
/// list as it nears the end. No-op when offline, already loading, or there is
|
||||||
/// plus a live echo after publishing), so a plain append would double the
|
/// nothing older to fetch.
|
||||||
/// listing; keeping one entry per (author, id) is the NIP-99 semantics.
|
Future<void> loadNextPage() async {
|
||||||
static List<Offer> _merge(List<Offer> current, Offer incoming) => [
|
final transport = _transport;
|
||||||
for (final o in current)
|
final cursor = state.nextPageCursor;
|
||||||
if (!(o.id == incoming.id &&
|
if (transport == null || cursor == null || state.loadingMore) return;
|
||||||
o.authorPubkeyHex == incoming.authorPubkeyHex))
|
emit(state.copyWith(loadingMore: true));
|
||||||
o,
|
try {
|
||||||
|
final page = await transport.discoverPage(DiscoveryQuery(
|
||||||
|
geohashPrefix: state.areaGeohash,
|
||||||
|
types: state.typeFilter,
|
||||||
|
until: cursor,
|
||||||
|
));
|
||||||
|
final merged = _mergePage(state.offers, page.offers);
|
||||||
|
// Stop paging once the cap is reached — the list is already as large as we
|
||||||
|
// keep — otherwise carry the transport's cursor onward.
|
||||||
|
final reachedCap = merged.length >= maxOffersKept;
|
||||||
|
emit(state.copyWith(
|
||||||
|
offers: _capped(merged),
|
||||||
|
nextPageCursor: () => reachedCap ? null : page.nextCursor,
|
||||||
|
loadingMore: false,
|
||||||
|
));
|
||||||
|
} catch (e) {
|
||||||
|
emit(state.copyWith(loadingMore: false, error: () => '$e'));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The offer's identity for de-duplication: NIP-99 addressable events are keyed
|
||||||
|
/// by (author, `d`-tag id), so the same listing from two relays — or a stored
|
||||||
|
/// copy plus a live echo — collapses to one entry.
|
||||||
|
static String _key(Offer o) => '${o.authorPubkeyHex}:${o.id}';
|
||||||
|
|
||||||
|
/// Prepends a freshly-arrived (newer) [incoming] offer, dropping any existing
|
||||||
|
/// entry with the same identity so a live echo never doubles the listing.
|
||||||
|
static List<Offer> _prepend(List<Offer> current, Offer incoming) => [
|
||||||
incoming,
|
incoming,
|
||||||
|
for (final o in current)
|
||||||
|
if (_key(o) != _key(incoming)) o,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/// Appends an older [page] after [current] (older offers sort below newer),
|
||||||
|
/// skipping any already present. Keeps the newest-first ordering.
|
||||||
|
static List<Offer> _mergePage(List<Offer> current, List<Offer> page) {
|
||||||
|
final seen = {for (final o in current) _key(o)};
|
||||||
|
return [
|
||||||
|
...current,
|
||||||
|
for (final o in page)
|
||||||
|
if (seen.add(_key(o))) o,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Caps the list to [maxOffersKept], keeping the newest (front) and dropping
|
||||||
|
/// the oldest (tail) — bounds memory in a busy area.
|
||||||
|
static List<Offer> _capped(List<Offer> offers) => offers.length <= maxOffersKept
|
||||||
|
? offers
|
||||||
|
: offers.sublist(0, maxOffersKept);
|
||||||
|
|
||||||
/// Narrows the visible offers to those whose summary matches [query]. Purely
|
/// Narrows the visible offers to those whose summary matches [query]. Purely
|
||||||
/// local over the already-discovered list; does not re-hit the transport.
|
/// local over the already-discovered list; does not re-hit the transport.
|
||||||
void search(String query) => emit(state.copyWith(query: query));
|
void search(String query) => emit(state.copyWith(query: query));
|
||||||
|
|
@ -361,6 +503,7 @@ class OffersCubit extends Cubit<OffersState> {
|
||||||
@override
|
@override
|
||||||
Future<void> close() async {
|
Future<void> close() async {
|
||||||
_searchTimeout?.cancel();
|
_searchTimeout?.cancel();
|
||||||
|
await _connSub?.cancel();
|
||||||
await _sub?.cancel();
|
await _sub?.cancel();
|
||||||
await _onDispose?.call();
|
await _onDispose?.call();
|
||||||
return super.close();
|
return super.close();
|
||||||
|
|
@ -378,6 +521,7 @@ Future<OffersCubit> createOffersCubit(
|
||||||
final session = await connection.session();
|
final session = await connection.session();
|
||||||
return OffersCubit(
|
return OffersCubit(
|
||||||
session?.offers,
|
session?.offers,
|
||||||
|
connection: connection, // keeps following (re)connects — see _onSession
|
||||||
coverPhoto: repository?.coverPhotoFor,
|
coverPhoto: repository?.coverPhotoFor,
|
||||||
thumbnail: offerThumbnailDataUri,
|
thumbnail: offerThumbnailDataUri,
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -3,24 +3,66 @@ import 'package:go_router/go_router.dart';
|
||||||
import 'package:material_symbols_icons/symbols.dart';
|
import 'package:material_symbols_icons/symbols.dart';
|
||||||
|
|
||||||
import '../i18n/strings.g.dart';
|
import '../i18n/strings.g.dart';
|
||||||
|
import '../services/onboarding_store.dart';
|
||||||
|
import '../services/sharing_switch.dart';
|
||||||
import 'seed_glyph.dart';
|
import 'seed_glyph.dart';
|
||||||
|
import 'sharing_invite_sheet.dart';
|
||||||
import 'theme.dart';
|
import 'theme.dart';
|
||||||
import 'unread_badge.dart';
|
import 'unread_badge.dart';
|
||||||
|
|
||||||
/// The app's navigation drawer (redesign screen 05). A white sheet: Inventory is
|
/// The app's navigation drawer (redesign screen 05). A white sheet: Inventory is
|
||||||
/// the live destination (green seed glyph), the social items (market, profile,
|
/// the live destination (green seed glyph), the social items sit below a divider,
|
||||||
/// chat…) belong to Block 2 and are greyed with a "soon" tag, and Settings sits
|
/// and Settings is pinned at the bottom.
|
||||||
/// pinned at the bottom.
|
///
|
||||||
|
/// While sharing is off the social items stay visible but quiet, with a small
|
||||||
|
/// padlock: tapping one explains what it does and offers to join. The Market is
|
||||||
|
/// the exception — it is always live, because it is the door people go through
|
||||||
|
/// to join in the first place.
|
||||||
class AppDrawer extends StatelessWidget {
|
class AppDrawer extends StatelessWidget {
|
||||||
const AppDrawer({this.marketEnabled = false, super.key});
|
const AppDrawer({this.sharing, this.onboarding, super.key});
|
||||||
|
|
||||||
/// When the Block 2 social layer is wired, the Market becomes a live drawer
|
/// The sharing on/off switch. Null when the social layer isn't there at all
|
||||||
/// destination; other social items stay "soon" until they're built.
|
/// (identity derivation failed) — then the social items are not drawn, since
|
||||||
final bool marketEnabled;
|
/// there is nothing the person could do to turn them on.
|
||||||
|
final SharingSwitch? sharing;
|
||||||
|
|
||||||
|
/// Needed to run the community-rules step when someone accepts the invite.
|
||||||
|
final OnboardingStore? onboarding;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final sharing = this.sharing;
|
||||||
|
if (sharing == null) return _build(context, social: false, sharingOn: false);
|
||||||
|
return ValueListenableBuilder<bool>(
|
||||||
|
valueListenable: sharing.on,
|
||||||
|
builder: (context, on, _) =>
|
||||||
|
_build(context, social: true, sharingOn: on),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _build(
|
||||||
|
BuildContext context, {
|
||||||
|
required bool social,
|
||||||
|
required bool sharingOn,
|
||||||
|
}) {
|
||||||
final t = context.t;
|
final t = context.t;
|
||||||
|
// While sharing is off, tapping a social entry invites the person in rather
|
||||||
|
// than doing nothing.
|
||||||
|
Future<void> invite() async {
|
||||||
|
final sharing = this.sharing;
|
||||||
|
final onboarding = this.onboarding;
|
||||||
|
if (sharing == null || onboarding == null) return;
|
||||||
|
// Close the drawer first, then run the sheet off the navigator's own
|
||||||
|
// context — this one dies with the drawer.
|
||||||
|
final navigator = Navigator.of(context);
|
||||||
|
navigator.pop();
|
||||||
|
await showSharingInvite(
|
||||||
|
navigator.context,
|
||||||
|
onboarding: onboarding,
|
||||||
|
sharing: sharing,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return Drawer(
|
return Drawer(
|
||||||
child: SafeArea(
|
child: SafeArea(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
@ -69,59 +111,68 @@ class AppDrawer extends StatelessWidget {
|
||||||
context.push('/calendar');
|
context.push('/calendar');
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
_DrawerItem(
|
// The market is always live when the social layer exists: it
|
||||||
icon: const Icon(Symbols.storefront),
|
// is where people join sharing, so locking it would lock the
|
||||||
label: t.menu.market,
|
// only door.
|
||||||
divider: true,
|
if (social)
|
||||||
onTap: marketEnabled
|
_DrawerItem(
|
||||||
? () {
|
icon: const Icon(Symbols.storefront),
|
||||||
Navigator.of(context).pop();
|
label: t.menu.market,
|
||||||
context.push('/market');
|
divider: true,
|
||||||
}
|
onTap: () {
|
||||||
: null,
|
Navigator.of(context).pop();
|
||||||
),
|
context.push('/market');
|
||||||
_DrawerItem(
|
},
|
||||||
icon: const Icon(Icons.person),
|
),
|
||||||
label: t.menu.profile,
|
if (social)
|
||||||
onTap: marketEnabled
|
_DrawerItem(
|
||||||
? () {
|
icon: const Icon(Icons.person),
|
||||||
Navigator.of(context).pop();
|
label: t.menu.profile,
|
||||||
context.push('/profile');
|
locked: !sharingOn,
|
||||||
}
|
onTap: sharingOn
|
||||||
: null,
|
? () {
|
||||||
),
|
Navigator.of(context).pop();
|
||||||
_DrawerItem(
|
context.push('/profile');
|
||||||
icon: const UnreadBadge(child: Icon(Icons.chat_bubble)),
|
}
|
||||||
label: t.menu.chat,
|
: invite,
|
||||||
onTap: marketEnabled
|
),
|
||||||
? () {
|
if (social)
|
||||||
Navigator.of(context).pop();
|
_DrawerItem(
|
||||||
context.push('/messages');
|
icon: const UnreadBadge(child: Icon(Icons.chat_bubble)),
|
||||||
}
|
label: t.menu.chat,
|
||||||
: null,
|
locked: !sharingOn,
|
||||||
),
|
onTap: sharingOn
|
||||||
_DrawerItem(
|
? () {
|
||||||
icon: const Icon(Icons.favorite),
|
Navigator.of(context).pop();
|
||||||
label: t.menu.wishlist,
|
context.push('/messages');
|
||||||
onTap: marketEnabled
|
}
|
||||||
? () {
|
: invite,
|
||||||
Navigator.of(context).pop();
|
),
|
||||||
context.push('/favorites');
|
if (social)
|
||||||
}
|
_DrawerItem(
|
||||||
: null,
|
icon: const Icon(Icons.favorite),
|
||||||
),
|
label: t.menu.wishlist,
|
||||||
// The ego-centric web of trust ("your people") — live once the
|
locked: !sharingOn,
|
||||||
// social layer is on.
|
onTap: sharingOn
|
||||||
_DrawerItem(
|
? () {
|
||||||
icon: const Icon(Icons.group),
|
Navigator.of(context).pop();
|
||||||
label: t.menu.following,
|
context.push('/favorites');
|
||||||
onTap: marketEnabled
|
}
|
||||||
? () {
|
: invite,
|
||||||
Navigator.of(context).pop();
|
),
|
||||||
context.push('/your-people');
|
// The ego-centric web of trust ("your people").
|
||||||
}
|
if (social)
|
||||||
: null,
|
_DrawerItem(
|
||||||
),
|
icon: const Icon(Icons.group),
|
||||||
|
label: t.menu.following,
|
||||||
|
locked: !sharingOn,
|
||||||
|
onTap: sharingOn
|
||||||
|
? () {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
context.push('/your-people');
|
||||||
|
}
|
||||||
|
: invite,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -203,6 +254,7 @@ class _DrawerItem extends StatelessWidget {
|
||||||
required this.label,
|
required this.label,
|
||||||
this.onTap,
|
this.onTap,
|
||||||
this.divider = false,
|
this.divider = false,
|
||||||
|
this.locked = false,
|
||||||
});
|
});
|
||||||
|
|
||||||
final Widget icon;
|
final Widget icon;
|
||||||
|
|
@ -210,9 +262,13 @@ class _DrawerItem extends StatelessWidget {
|
||||||
final VoidCallback? onTap;
|
final VoidCallback? onTap;
|
||||||
final bool divider;
|
final bool divider;
|
||||||
|
|
||||||
|
/// Drawn quiet, with a padlock, but still tappable — it leads to the
|
||||||
|
/// invitation to join sharing rather than to the destination itself.
|
||||||
|
final bool locked;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final enabled = onTap != null;
|
final enabled = onTap != null && !locked;
|
||||||
final fg = enabled ? seedOnSurface : const Color(0xFF9AA88F);
|
final fg = enabled ? seedOnSurface : const Color(0xFF9AA88F);
|
||||||
final iconColor = enabled ? seedGreen : const Color(0xFF9AA88F);
|
final iconColor = enabled ? seedGreen : const Color(0xFF9AA88F);
|
||||||
final row = InkWell(
|
final row = InkWell(
|
||||||
|
|
@ -247,15 +303,11 @@ class _DrawerItem extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (!enabled)
|
if (locked)
|
||||||
Text(
|
const Icon(
|
||||||
context.t.common.comingSoon.toUpperCase(),
|
Icons.lock_outline,
|
||||||
style: const TextStyle(
|
size: 16,
|
||||||
color: Color(0xFFB3BDA8),
|
color: Color(0xFFB3BDA8),
|
||||||
fontSize: 11,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
letterSpacing: 0.5,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -235,8 +235,14 @@ class _CalendarRow extends StatelessWidget {
|
||||||
leading: CircleAvatar(
|
leading: CircleAvatar(
|
||||||
radius: 20,
|
radius: 20,
|
||||||
backgroundColor: swatch.fill,
|
backgroundColor: swatch.fill,
|
||||||
foregroundImage:
|
// Decode to the 40px avatar size (× dpr), not the full photo.
|
||||||
entry.photo == null ? null : MemoryImage(entry.photo!),
|
foregroundImage: entry.photo == null
|
||||||
|
? null
|
||||||
|
: ResizeImage(
|
||||||
|
MemoryImage(entry.photo!),
|
||||||
|
width: (40 * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||||
|
height: (40 * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||||
|
),
|
||||||
child: entry.photo == null
|
child: entry.photo == null
|
||||||
? Text(
|
? Text(
|
||||||
entry.label.isEmpty
|
entry.label.isEmpty
|
||||||
|
|
|
||||||
|
|
@ -108,6 +108,10 @@ class _DraftTile extends StatelessWidget {
|
||||||
photo,
|
photo,
|
||||||
width: 48,
|
width: 48,
|
||||||
height: 48,
|
height: 48,
|
||||||
|
cacheWidth:
|
||||||
|
(48 * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||||
|
cacheHeight:
|
||||||
|
(48 * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -192,6 +196,8 @@ class _NameDraftDialogState extends State<NameDraftDialog> {
|
||||||
child: Image.memory(
|
child: Image.memory(
|
||||||
widget.photo!,
|
widget.photo!,
|
||||||
height: 140,
|
height: 140,
|
||||||
|
cacheHeight:
|
||||||
|
(140 * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.dart';
|
import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
import '../i18n/strings.g.dart';
|
import '../i18n/strings.g.dart';
|
||||||
|
import '../services/onboarding_store.dart';
|
||||||
|
import '../services/sharing_switch.dart';
|
||||||
import 'app_drawer.dart';
|
import 'app_drawer.dart';
|
||||||
import 'seed_glyph.dart';
|
import 'seed_glyph.dart';
|
||||||
import 'theme.dart';
|
import 'theme.dart';
|
||||||
|
|
@ -9,14 +11,19 @@ import 'unread_badge.dart';
|
||||||
|
|
||||||
/// The main menu (redesign screen 00): a sprout logo in a soft green disc over a
|
/// The main menu (redesign screen 00): a sprout logo in a soft green disc over a
|
||||||
/// faint seed-glyph watermark, with "Your inventory" as the primary green call
|
/// faint seed-glyph watermark, with "Your inventory" as the primary green call
|
||||||
/// to action and "Open market" (Block 2) as a disabled outlined card. The
|
/// to action and "Open market" as an outlined card below it. The hamburger opens
|
||||||
/// hamburger opens [AppDrawer].
|
/// [AppDrawer].
|
||||||
|
///
|
||||||
|
/// The market card is always live when the social layer exists — it is the door
|
||||||
|
/// people go through to join sharing — and simply isn't drawn when it doesn't.
|
||||||
class HomeScreen extends StatelessWidget {
|
class HomeScreen extends StatelessWidget {
|
||||||
const HomeScreen({this.marketEnabled = false, super.key});
|
const HomeScreen({this.sharing, this.onboarding, super.key});
|
||||||
|
|
||||||
/// When the Block 2 social layer is wired, the market becomes a live
|
/// The sharing on/off switch, or null when there is no social layer at all.
|
||||||
/// destination; otherwise it stays a disabled "coming soon" card.
|
final SharingSwitch? sharing;
|
||||||
final bool marketEnabled;
|
|
||||||
|
/// Needed to run the community-rules step from the drawer's invitation.
|
||||||
|
final OnboardingStore? onboarding;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -34,7 +41,7 @@ class HomeScreen extends StatelessWidget {
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
drawer: AppDrawer(marketEnabled: marketEnabled),
|
drawer: AppDrawer(sharing: sharing, onboarding: onboarding),
|
||||||
body: Stack(
|
body: Stack(
|
||||||
children: [
|
children: [
|
||||||
const Positioned.fill(child: _SeedWatermark()),
|
const Positioned.fill(child: _SeedWatermark()),
|
||||||
|
|
@ -99,17 +106,16 @@ class HomeScreen extends StatelessWidget {
|
||||||
subtitle: t.home.yourInventorySubtitle,
|
subtitle: t.home.yourInventorySubtitle,
|
||||||
onTap: () => context.push('/inventory'),
|
onTap: () => context.push('/inventory'),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
if (sharing != null) ...[
|
||||||
_OutlinedMenuCard(
|
const SizedBox(height: 16),
|
||||||
key: const Key('home.market'),
|
_OutlinedMenuCard(
|
||||||
icon: Icons.storefront_outlined,
|
key: const Key('home.market'),
|
||||||
label: t.home.openMarket,
|
icon: Icons.storefront_outlined,
|
||||||
subtitle: t.home.openMarketSubtitle,
|
label: t.home.openMarket,
|
||||||
tag: marketEnabled ? null : t.common.comingSoon,
|
subtitle: t.home.openMarketSubtitle,
|
||||||
onTap: marketEnabled
|
onTap: () => context.push('/market'),
|
||||||
? () => context.push('/market')
|
),
|
||||||
: null,
|
],
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -175,14 +181,12 @@ class _PrimaryMenuCard extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A disabled Block-2 destination: an outlined white card with a green-disc
|
/// A secondary destination: an outlined white card with a green-disc icon.
|
||||||
/// icon and a "soon" tag.
|
|
||||||
class _OutlinedMenuCard extends StatelessWidget {
|
class _OutlinedMenuCard extends StatelessWidget {
|
||||||
const _OutlinedMenuCard({
|
const _OutlinedMenuCard({
|
||||||
required this.icon,
|
required this.icon,
|
||||||
required this.label,
|
required this.label,
|
||||||
required this.subtitle,
|
required this.subtitle,
|
||||||
this.tag,
|
|
||||||
this.onTap,
|
this.onTap,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
@ -191,9 +195,6 @@ class _OutlinedMenuCard extends StatelessWidget {
|
||||||
final String label;
|
final String label;
|
||||||
final String subtitle;
|
final String subtitle;
|
||||||
|
|
||||||
/// A small trailing tag (e.g. "coming soon"); omitted for live cards.
|
|
||||||
final String? tag;
|
|
||||||
|
|
||||||
/// When set, the card is tappable; otherwise it reads as disabled.
|
/// When set, the card is tappable; otherwise it reads as disabled.
|
||||||
final VoidCallback? onTap;
|
final VoidCallback? onTap;
|
||||||
|
|
||||||
|
|
@ -221,17 +222,7 @@ class _OutlinedMenuCard extends StatelessWidget {
|
||||||
subtitleColor: seedMuted,
|
subtitleColor: seedMuted,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
if (tag != null)
|
if (onTap != null)
|
||||||
Text(
|
|
||||||
tag!.toUpperCase(),
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Color(0xFFB3BDA8),
|
|
||||||
fontSize: 11,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
letterSpacing: 0.5,
|
|
||||||
),
|
|
||||||
)
|
|
||||||
else if (onTap != null)
|
|
||||||
const Icon(Icons.chevron_right, color: seedMuted),
|
const Icon(Icons.chevron_right, color: seedMuted),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -582,27 +582,47 @@ class _InventoryBody extends StatelessWidget {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Items arrive ordered by category then label; insert a header whenever the
|
// Items arrive ordered by category then label; insert a header whenever the
|
||||||
// category changes.
|
// category changes. Precompute a flat row model (header or item) so the
|
||||||
final rows = <Widget>[];
|
// ListView can build tiles lazily — with a large inventory, building every
|
||||||
|
// tile upfront (the old `ListView(children:)`) stalled the first paint.
|
||||||
|
final rows = <_InventoryRow>[];
|
||||||
String? currentCategory;
|
String? currentCategory;
|
||||||
for (final item in items) {
|
for (final item in items) {
|
||||||
final category = item.category ?? t.inventory.uncategorized;
|
final category = item.category ?? t.inventory.uncategorized;
|
||||||
if (category != currentCategory) {
|
if (category != currentCategory) {
|
||||||
currentCategory = category;
|
currentCategory = category;
|
||||||
rows.add(_CategoryHeader(title: category));
|
rows.add(_InventoryRow.header(category));
|
||||||
}
|
}
|
||||||
rows.add(
|
rows.add(_InventoryRow.variety(item));
|
||||||
_VarietyTile(
|
|
||||||
item: item,
|
|
||||||
selectionMode: selectionMode,
|
|
||||||
selected: selectedIds.contains(item.id),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return ListView(children: rows);
|
return ListView.builder(
|
||||||
|
itemCount: rows.length,
|
||||||
|
itemBuilder: (context, i) {
|
||||||
|
final row = rows[i];
|
||||||
|
final header = row.header;
|
||||||
|
if (header != null) {
|
||||||
|
return _CategoryHeader(title: header);
|
||||||
|
}
|
||||||
|
return _VarietyTile(
|
||||||
|
item: row.item!,
|
||||||
|
selectionMode: selectionMode,
|
||||||
|
selected: selectedIds.contains(row.item!.id),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A single row in the flattened inventory list: either a category [header] or
|
||||||
|
/// a variety [item] (exactly one is non-null).
|
||||||
|
class _InventoryRow {
|
||||||
|
const _InventoryRow.header(this.header) : item = null;
|
||||||
|
const _InventoryRow.variety(this.item) : header = null;
|
||||||
|
|
||||||
|
final String? header;
|
||||||
|
final VarietyListItem? item;
|
||||||
|
}
|
||||||
|
|
||||||
class _CategoryHeader extends StatelessWidget {
|
class _CategoryHeader extends StatelessWidget {
|
||||||
const _CategoryHeader({required this.title});
|
const _CategoryHeader({required this.title});
|
||||||
|
|
||||||
|
|
@ -767,10 +787,21 @@ class _Avatar extends StatelessWidget {
|
||||||
// Decorative: the tile title already announces the variety name, so keep
|
// Decorative: the tile title already announces the variety name, so keep
|
||||||
// the thumbnail / initial out of the semantics tree.
|
// the thumbnail / initial out of the semantics tree.
|
||||||
if (photo != null) {
|
if (photo != null) {
|
||||||
|
// Decode straight to the 48px avatar size (× device pixel ratio) instead
|
||||||
|
// of holding the full-resolution photo in the image cache — decisive for
|
||||||
|
// memory with a large inventory of photographed varieties.
|
||||||
|
final cachePx = (48 * MediaQuery.devicePixelRatioOf(context)).round();
|
||||||
return ExcludeSemantics(
|
return ExcludeSemantics(
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(8),
|
borderRadius: BorderRadius.circular(8),
|
||||||
child: Image.memory(photo, width: 48, height: 48, fit: BoxFit.cover),
|
child: Image.memory(
|
||||||
|
photo,
|
||||||
|
width: 48,
|
||||||
|
height: 48,
|
||||||
|
cacheWidth: cachePx,
|
||||||
|
cacheHeight: cachePx,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,29 @@ import 'package:go_router/go_router.dart';
|
||||||
|
|
||||||
import '../i18n/strings.g.dart';
|
import '../i18n/strings.g.dart';
|
||||||
import '../services/onboarding_store.dart';
|
import '../services/onboarding_store.dart';
|
||||||
|
import '../services/sharing_switch.dart';
|
||||||
import 'theme.dart';
|
import 'theme.dart';
|
||||||
|
|
||||||
/// Makes sure the community rules have been accepted once before the user
|
/// Makes sure the community rules have been accepted once before the user
|
||||||
/// joins the market or publishes anything. Returns true when the rules are
|
/// joins the market or publishes anything. Returns true when the rules are
|
||||||
/// (or become) accepted; false when the user declines. Play/App Store UGC
|
/// (or become) accepted; false when the user declines. Play/App Store UGC
|
||||||
/// policies require this acceptance before content can be created.
|
/// policies require this acceptance before content can be created.
|
||||||
|
///
|
||||||
|
/// This is also where Tane goes online for the first time: agreeing here is the
|
||||||
|
/// opt-in that turns [sharing] on. Keeping both in one step means there is a
|
||||||
|
/// single moment where someone says yes, and it is a moment that explains
|
||||||
|
/// itself — rather than a connection that happened at launch without asking.
|
||||||
Future<bool> ensureMarketRulesAccepted(
|
Future<bool> ensureMarketRulesAccepted(
|
||||||
BuildContext context,
|
BuildContext context,
|
||||||
OnboardingStore store,
|
OnboardingStore store, {
|
||||||
) async {
|
SharingSwitch? sharing,
|
||||||
if (await store.marketRulesAccepted()) return true;
|
}) async {
|
||||||
|
if (await store.marketRulesAccepted()) {
|
||||||
|
// Already agreed, but sharing may still be off (they turned it off in the
|
||||||
|
// sharing setup, or agreed on a build that had no switch): honour the ask.
|
||||||
|
if (sharing != null && !sharing.on.value) await sharing.enable();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (!context.mounted) return false;
|
if (!context.mounted) return false;
|
||||||
final accepted = await showModalBottomSheet<bool>(
|
final accepted = await showModalBottomSheet<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
@ -24,6 +36,7 @@ Future<bool> ensureMarketRulesAccepted(
|
||||||
);
|
);
|
||||||
if (accepted == true) {
|
if (accepted == true) {
|
||||||
await store.markMarketRulesAccepted();
|
await store.markMarketRulesAccepted();
|
||||||
|
await sharing?.enable();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -77,6 +90,14 @@ class MarketGateSheet extends StatelessWidget {
|
||||||
height: 1.4,
|
height: 1.4,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Text(
|
||||||
|
t.marketGate.networkNote,
|
||||||
|
style: theme.textTheme.bodySmall?.copyWith(
|
||||||
|
color: seedMuted,
|
||||||
|
height: 1.4,
|
||||||
|
),
|
||||||
|
),
|
||||||
TextButton.icon(
|
TextButton.icon(
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
padding: EdgeInsets.zero,
|
padding: EdgeInsets.zero,
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import '../services/offer_outbox.dart';
|
||||||
import '../services/saved_searches_store.dart';
|
import '../services/saved_searches_store.dart';
|
||||||
import '../services/social_connection.dart';
|
import '../services/social_connection.dart';
|
||||||
import '../services/social_service.dart';
|
import '../services/social_service.dart';
|
||||||
|
import '../services/sharing_switch.dart';
|
||||||
import '../services/social_settings.dart';
|
import '../services/social_settings.dart';
|
||||||
import '../services/onboarding_store.dart';
|
import '../services/onboarding_store.dart';
|
||||||
import '../state/offers_cubit.dart';
|
import '../state/offers_cubit.dart';
|
||||||
|
|
@ -35,6 +36,7 @@ class MarketScreen extends StatefulWidget {
|
||||||
this.onboarding,
|
this.onboarding,
|
||||||
this.savedSearches,
|
this.savedSearches,
|
||||||
this.initialSearch,
|
this.initialSearch,
|
||||||
|
this.sharing,
|
||||||
super.key,
|
super.key,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -54,6 +56,10 @@ class MarketScreen extends StatefulWidget {
|
||||||
/// created). Null in tests → no gate.
|
/// created). Null in tests → no gate.
|
||||||
final OnboardingStore? onboarding;
|
final OnboardingStore? onboarding;
|
||||||
|
|
||||||
|
/// The sharing on/off switch. Accepting the rules turns it on (that is the
|
||||||
|
/// moment Tane first goes online); the sharing setup can turn it back off.
|
||||||
|
final SharingSwitch? sharing;
|
||||||
|
|
||||||
/// The shared relay connection (one per identity), reused for discovery.
|
/// The shared relay connection (one per identity), reused for discovery.
|
||||||
final SocialConnection connection;
|
final SocialConnection connection;
|
||||||
|
|
||||||
|
|
@ -84,11 +90,18 @@ class _MarketScreenState extends State<MarketScreen> {
|
||||||
/// network; declining leaves the market.
|
/// network; declining leaves the market.
|
||||||
Future<void> _start() async {
|
Future<void> _start() async {
|
||||||
final store = widget.onboarding;
|
final store = widget.onboarding;
|
||||||
if (store != null && !await store.marketRulesAccepted()) {
|
final sharing = widget.sharing;
|
||||||
|
// The rules step is also the moment Tane first goes online, so it runs
|
||||||
|
// whenever sharing is still off — even for someone who agreed long ago and
|
||||||
|
// later switched sharing back off.
|
||||||
|
if (store != null &&
|
||||||
|
(!await store.marketRulesAccepted() ||
|
||||||
|
(sharing != null && !sharing.on.value))) {
|
||||||
// Wait for the first frame so the sheet has a surface to attach to.
|
// Wait for the first frame so the sheet has a surface to attach to.
|
||||||
await WidgetsBinding.instance.endOfFrame;
|
await WidgetsBinding.instance.endOfFrame;
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
final ok = await ensureMarketRulesAccepted(context, store);
|
final ok = await ensureMarketRulesAccepted(context, store,
|
||||||
|
sharing: sharing);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
if (mounted) context.pop();
|
if (mounted) context.pop();
|
||||||
return;
|
return;
|
||||||
|
|
@ -100,11 +113,11 @@ class _MarketScreenState extends State<MarketScreen> {
|
||||||
Future<void> _init() async {
|
Future<void> _init() async {
|
||||||
// Only needed to flush the outbox; read here (while mounted) to avoid using
|
// Only needed to flush the outbox; read here (while mounted) to avoid using
|
||||||
// context across the awaits below. Null when there's no outbox (e.g. tests).
|
// context across the awaits below. Null when there's no outbox (e.g. tests).
|
||||||
final repo =
|
final repo = widget.outbox != null
|
||||||
widget.outbox != null ? context.read<VarietyRepository>() : null;
|
? context.read<VarietyRepository>()
|
||||||
|
: null;
|
||||||
setState(() => _loading = true);
|
setState(() => _loading = true);
|
||||||
final cubit =
|
final cubit = await createOffersCubit(widget.connection, repository: repo);
|
||||||
await createOffersCubit(widget.connection, repository: repo);
|
|
||||||
cubit.setBlockedAuthors(await widget.settings.blockedPubkeys());
|
cubit.setBlockedAuthors(await widget.settings.blockedPubkeys());
|
||||||
cubit.setHiddenOffers(await widget.settings.hiddenOfferKeys());
|
cubit.setHiddenOffers(await widget.settings.hiddenOfferKeys());
|
||||||
final area = await widget.settings.areaGeohash();
|
final area = await widget.settings.areaGeohash();
|
||||||
|
|
@ -122,10 +135,10 @@ class _MarketScreenState extends State<MarketScreen> {
|
||||||
_loading = false;
|
_loading = false;
|
||||||
});
|
});
|
||||||
await previous?.close();
|
await previous?.close();
|
||||||
if (area.isNotEmpty && cubit.isOnline) {
|
if (area.isNotEmpty) {
|
||||||
// Flush anything parked while offline, then show what's out there.
|
// Flush anything parked while offline, then show what's out there.
|
||||||
final outbox = widget.outbox;
|
final outbox = widget.outbox;
|
||||||
if (outbox != null && repo != null) {
|
if (outbox != null && repo != null && cubit.isOnline) {
|
||||||
await flushOutbox(
|
await flushOutbox(
|
||||||
outbox: outbox,
|
outbox: outbox,
|
||||||
cubit: cubit,
|
cubit: cubit,
|
||||||
|
|
@ -136,6 +149,8 @@ class _MarketScreenState extends State<MarketScreen> {
|
||||||
}
|
}
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
final precision = await widget.settings.searchPrecision();
|
final precision = await widget.settings.searchPrecision();
|
||||||
|
// Even when offline: this records the wanted area on the cubit, which
|
||||||
|
// re-runs the discovery by itself once the connection comes up.
|
||||||
if (mounted) await cubit.discover(searchPrefix(area, precision));
|
if (mounted) await cubit.discover(searchPrefix(area, precision));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -154,8 +169,11 @@ class _MarketScreenState extends State<MarketScreen> {
|
||||||
final changed = await showModalBottomSheet<bool>(
|
final changed = await showModalBottomSheet<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
isScrollControlled: true,
|
isScrollControlled: true,
|
||||||
builder: (_) =>
|
builder: (_) => _ConfigSheet(
|
||||||
_ConfigSheet(settings: widget.settings, location: widget.location),
|
settings: widget.settings,
|
||||||
|
location: widget.location,
|
||||||
|
sharing: widget.sharing,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
if (changed == true) await _init();
|
if (changed == true) await _init();
|
||||||
}
|
}
|
||||||
|
|
@ -206,12 +224,18 @@ class _MarketScreenState extends State<MarketScreen> {
|
||||||
await widget.outbox?.remove(ids); // published now, so unpark any duplicates
|
await widget.outbox?.remove(ids); // published now, so unpark any duplicates
|
||||||
// count == 0 with lots to share means every relay refused — say so plainly
|
// count == 0 with lots to share means every relay refused — say so plainly
|
||||||
// rather than "shared 0", which reads like success.
|
// rather than "shared 0", which reads like success.
|
||||||
messenger.showSnackBar(SnackBar(
|
messenger.showSnackBar(
|
||||||
content: Text(count == 0 ? t.market.shareFailed : t.market.sharedCount(n: count)),
|
SnackBar(
|
||||||
));
|
content: Text(
|
||||||
|
count == 0 ? t.market.shareFailed : t.market.sharedCount(n: count),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
final precision = await widget.settings.searchPrecision();
|
final precision = await widget.settings.searchPrecision();
|
||||||
if (!mounted) return;
|
if (!mounted) return;
|
||||||
await cubit.discover(searchPrefix(area, precision)); // refresh incl. just-shared
|
await cubit.discover(
|
||||||
|
searchPrefix(area, precision),
|
||||||
|
); // refresh incl. just-shared
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -240,13 +264,13 @@ class _MarketScreenState extends State<MarketScreen> {
|
||||||
),
|
),
|
||||||
floatingActionButton:
|
floatingActionButton:
|
||||||
cubit != null && (cubit.isOnline || widget.outbox != null)
|
cubit != null && (cubit.isOnline || widget.outbox != null)
|
||||||
? FloatingActionButton.extended(
|
? FloatingActionButton.extended(
|
||||||
key: const Key('market.shareMine'),
|
key: const Key('market.shareMine'),
|
||||||
onPressed: _shareMine,
|
onPressed: _shareMine,
|
||||||
icon: const Icon(Icons.campaign_outlined),
|
icon: const Icon(Icons.campaign_outlined),
|
||||||
label: Text(t.market.shareMine),
|
label: Text(t.market.shareMine),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
body: _loading || cubit == null
|
body: _loading || cubit == null
|
||||||
? const Center(child: CircularProgressIndicator())
|
? const Center(child: CircularProgressIndicator())
|
||||||
: BlocProvider.value(
|
: BlocProvider.value(
|
||||||
|
|
@ -298,6 +322,17 @@ class MarketBody extends StatelessWidget {
|
||||||
final t = context.t;
|
final t = context.t;
|
||||||
return BlocBuilder<OffersCubit, OffersState>(
|
return BlocBuilder<OffersCubit, OffersState>(
|
||||||
builder: (context, state) {
|
builder: (context, state) {
|
||||||
|
// A new user's first step is setting a zone — which works offline — so
|
||||||
|
// that prompt wins over the connection error.
|
||||||
|
if (!hasArea) {
|
||||||
|
return _EmptyState(
|
||||||
|
icon: Icons.place_outlined,
|
||||||
|
title: t.market.setArea,
|
||||||
|
body: t.market.setAreaBody,
|
||||||
|
actionLabel: t.market.setUp,
|
||||||
|
onAction: onConfigure,
|
||||||
|
);
|
||||||
|
}
|
||||||
if (!context.read<OffersCubit>().isOnline) {
|
if (!context.read<OffersCubit>().isOnline) {
|
||||||
// Default community servers exist, so "offline" means unreachable —
|
// Default community servers exist, so "offline" means unreachable —
|
||||||
// offer a retry rather than "set up sharing".
|
// offer a retry rather than "set up sharing".
|
||||||
|
|
@ -309,15 +344,6 @@ class MarketBody extends StatelessWidget {
|
||||||
onAction: onRetry,
|
onAction: onRetry,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (!hasArea) {
|
|
||||||
return _EmptyState(
|
|
||||||
icon: Icons.place_outlined,
|
|
||||||
title: t.market.setArea,
|
|
||||||
body: t.market.setAreaBody,
|
|
||||||
actionLabel: t.market.setUp,
|
|
||||||
onAction: onConfigure,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (state.searching && state.offers.isEmpty) {
|
if (state.searching && state.offers.isEmpty) {
|
||||||
return Center(
|
return Center(
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|
@ -325,8 +351,10 @@ class MarketBody extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
const CircularProgressIndicator(),
|
const CircularProgressIndicator(),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
Text(t.market.searching,
|
Text(
|
||||||
style: const TextStyle(color: seedMuted)),
|
t.market.searching,
|
||||||
|
style: const TextStyle(color: seedMuted),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -370,16 +398,22 @@ class MarketBody extends StatelessWidget {
|
||||||
prefixIcon: const Icon(Icons.search, color: seedMuted),
|
prefixIcon: const Icon(Icons.search, color: seedMuted),
|
||||||
// Offer to save the current search once it's worth alerting on
|
// Offer to save the current search once it's worth alerting on
|
||||||
// (some text typed or a chip active), never for the bare list.
|
// (some text typed or a chip active), never for the bare list.
|
||||||
suffixIcon: savedSearches != null &&
|
suffixIcon:
|
||||||
|
savedSearches != null &&
|
||||||
(state.query.trim().isNotEmpty ||
|
(state.query.trim().isNotEmpty ||
|
||||||
state.hasActiveFilter)
|
state.hasActiveFilter)
|
||||||
? IconButton(
|
? IconButton(
|
||||||
key: const Key('market.saveSearch'),
|
key: const Key('market.saveSearch'),
|
||||||
icon: const Icon(Icons.bookmark_add_outlined,
|
icon: const Icon(
|
||||||
color: seedGreen),
|
Icons.bookmark_add_outlined,
|
||||||
|
color: seedGreen,
|
||||||
|
),
|
||||||
tooltip: t.savedSearches.save,
|
tooltip: t.savedSearches.save,
|
||||||
onPressed: () =>
|
onPressed: () => _saveCurrentSearch(
|
||||||
_saveCurrentSearch(context, savedSearches!, state),
|
context,
|
||||||
|
savedSearches!,
|
||||||
|
state,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
: null,
|
: null,
|
||||||
hintStyle: const TextStyle(color: seedMuted),
|
hintStyle: const TextStyle(color: seedMuted),
|
||||||
|
|
@ -414,23 +448,48 @@ class MarketBody extends StatelessWidget {
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
: ListView.separated(
|
: NotificationListener<ScrollNotification>(
|
||||||
physics: const AlwaysScrollableScrollPhysics(),
|
// Page in older offers as the list nears its end, so a
|
||||||
padding: const EdgeInsets.all(16),
|
// large area streams in on demand rather than all at
|
||||||
itemCount: visible.length,
|
// once. The cubit guards against overlapping loads.
|
||||||
separatorBuilder: (_, _) => const SizedBox(height: 12),
|
onNotification: (n) {
|
||||||
itemBuilder: (context, i) {
|
if (state.canLoadMore &&
|
||||||
final o = visible[i];
|
!state.loadingMore &&
|
||||||
final mine = o.authorPubkeyHex == selfPubkey;
|
n.metrics.axis == Axis.vertical &&
|
||||||
return _OfferCard(
|
n.metrics.extentAfter < 500) {
|
||||||
offer: o,
|
cubit.loadNextPage();
|
||||||
mine: mine,
|
}
|
||||||
onTap: () async {
|
return false;
|
||||||
await context.push('/market/offer', extra: o);
|
|
||||||
await onOfferClosed?.call();
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
|
child: ListView.separated(
|
||||||
|
physics: const AlwaysScrollableScrollPhysics(),
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
// A trailing spinner row while the next page loads.
|
||||||
|
itemCount:
|
||||||
|
visible.length + (state.loadingMore ? 1 : 0),
|
||||||
|
separatorBuilder: (_, _) =>
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
itemBuilder: (context, i) {
|
||||||
|
if (i >= visible.length) {
|
||||||
|
return const Padding(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 16),
|
||||||
|
child: Center(
|
||||||
|
child: CircularProgressIndicator(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
final o = visible[i];
|
||||||
|
final mine = o.authorPubkeyHex == selfPubkey;
|
||||||
|
return _OfferCard(
|
||||||
|
offer: o,
|
||||||
|
mine: mine,
|
||||||
|
onTap: () async {
|
||||||
|
await context.push('/market/offer', extra: o);
|
||||||
|
await onOfferClosed?.call();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -553,7 +612,9 @@ class _OfferCard extends StatelessWidget {
|
||||||
if (mine) ...[
|
if (mine) ...[
|
||||||
Container(
|
Container(
|
||||||
padding: const EdgeInsets.symmetric(
|
padding: const EdgeInsets.symmetric(
|
||||||
horizontal: 8, vertical: 3),
|
horizontal: 8,
|
||||||
|
vertical: 3,
|
||||||
|
),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: seedGreen,
|
color: seedGreen,
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: BorderRadius.circular(20),
|
||||||
|
|
@ -577,8 +638,10 @@ class _OfferCard extends StatelessWidget {
|
||||||
children: [
|
children: [
|
||||||
const Icon(Icons.place_outlined, size: 15, color: seedMuted),
|
const Icon(Icons.place_outlined, size: 15, color: seedMuted),
|
||||||
const SizedBox(width: 4),
|
const SizedBox(width: 4),
|
||||||
Text(t.market.near,
|
Text(
|
||||||
style: const TextStyle(color: seedMuted, fontSize: 13)),
|
t.market.near,
|
||||||
|
style: const TextStyle(color: seedMuted, fontSize: 13),
|
||||||
|
),
|
||||||
if (offer.isOrganic) ...[
|
if (offer.isOrganic) ...[
|
||||||
const SizedBox(width: 10),
|
const SizedBox(width: 10),
|
||||||
const Icon(Icons.eco, size: 15, color: seedGreen),
|
const Icon(Icons.eco, size: 15, color: seedGreen),
|
||||||
|
|
@ -586,7 +649,8 @@ class _OfferCard extends StatelessWidget {
|
||||||
const Spacer(),
|
const Spacer(),
|
||||||
if (offer.type == OfferType.sale && offer.priceAmount != null)
|
if (offer.type == OfferType.sale && offer.priceAmount != null)
|
||||||
Text(
|
Text(
|
||||||
'${offer.priceAmount} ${offer.priceCurrency ?? ''}'.trim(),
|
'${offer.priceAmount} ${offer.priceCurrency ?? ''}'
|
||||||
|
.trim(),
|
||||||
style: const TextStyle(
|
style: const TextStyle(
|
||||||
color: seedOnSurface,
|
color: seedOnSurface,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
|
|
@ -738,10 +802,11 @@ class _EmptyState extends StatelessWidget {
|
||||||
/// Coarse-area + community-server setup. Kept behind progressive disclosure — a
|
/// Coarse-area + community-server setup. Kept behind progressive disclosure — a
|
||||||
/// power-user surface — with human-worded labels.
|
/// power-user surface — with human-worded labels.
|
||||||
class _ConfigSheet extends StatefulWidget {
|
class _ConfigSheet extends StatefulWidget {
|
||||||
const _ConfigSheet({required this.settings, this.location});
|
const _ConfigSheet({required this.settings, this.location, this.sharing});
|
||||||
|
|
||||||
final SocialSettings settings;
|
final SocialSettings settings;
|
||||||
final CoarseLocationProvider? location;
|
final CoarseLocationProvider? location;
|
||||||
|
final SharingSwitch? sharing;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<_ConfigSheet> createState() => _ConfigSheetState();
|
State<_ConfigSheet> createState() => _ConfigSheetState();
|
||||||
|
|
@ -885,194 +950,250 @@ class _ConfigSheetState extends State<_ConfigSheet> {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final t = context.t;
|
final t = context.t;
|
||||||
final hasArea = _area.text.trim().isNotEmpty;
|
final hasArea = _area.text.trim().isNotEmpty;
|
||||||
return Padding(
|
// SafeArea keeps the Save button above the system nav bar on edge-to-edge
|
||||||
padding: EdgeInsets.only(
|
// devices; the viewInsets padding still lifts it above the keyboard.
|
||||||
left: 20,
|
return SafeArea(
|
||||||
right: 20,
|
top: false,
|
||||||
top: 20,
|
child: Padding(
|
||||||
bottom: MediaQuery.of(context).viewInsets.bottom + 20,
|
padding: EdgeInsets.only(
|
||||||
),
|
left: 20,
|
||||||
child: _loading
|
right: 20,
|
||||||
? const SizedBox(
|
top: 20,
|
||||||
height: 120, child: Center(child: CircularProgressIndicator()))
|
bottom: MediaQuery.of(context).viewInsets.bottom + 20,
|
||||||
: SingleChildScrollView(
|
),
|
||||||
child: Column(
|
child: _loading
|
||||||
mainAxisSize: MainAxisSize.min,
|
? const SizedBox(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
height: 120,
|
||||||
children: [
|
child: Center(child: CircularProgressIndicator()),
|
||||||
Text(
|
)
|
||||||
t.market.configTitle,
|
: SingleChildScrollView(
|
||||||
style: const TextStyle(
|
child: Column(
|
||||||
fontSize: 18,
|
mainAxisSize: MainAxisSize.min,
|
||||||
fontWeight: FontWeight.w600,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
color: seedTitle,
|
children: [
|
||||||
),
|
Text(
|
||||||
),
|
t.market.configTitle,
|
||||||
const SizedBox(height: 8),
|
style: const TextStyle(
|
||||||
Text(
|
fontSize: 18,
|
||||||
t.market.setupIntro,
|
fontWeight: FontWeight.w600,
|
||||||
style: const TextStyle(
|
color: seedTitle,
|
||||||
color: seedMuted, fontSize: 13, height: 1.4),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 18),
|
|
||||||
// Setting your area from device location is the human path;
|
|
||||||
// typing a code is the advanced fallback.
|
|
||||||
if (widget.location != null)
|
|
||||||
FilledButton.tonalIcon(
|
|
||||||
key: const Key('market.useLocation'),
|
|
||||||
onPressed: _locationBusy ? null : _useLocation,
|
|
||||||
icon: _locationBusy
|
|
||||||
? const SizedBox(
|
|
||||||
width: 16,
|
|
||||||
height: 16,
|
|
||||||
child: CircularProgressIndicator(strokeWidth: 2),
|
|
||||||
)
|
|
||||||
: const Icon(Icons.my_location, size: 18),
|
|
||||||
label: Text(t.market.useLocation),
|
|
||||||
),
|
|
||||||
if (_locationError != null)
|
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsets.only(top: 6),
|
|
||||||
child: Text(
|
|
||||||
_locationError!,
|
|
||||||
style: const TextStyle(
|
|
||||||
color: Color(0xFFB3261E), fontSize: 12),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 8),
|
||||||
Row(
|
Text(
|
||||||
children: [
|
t.market.setupIntro,
|
||||||
Icon(
|
style: const TextStyle(
|
||||||
hasArea
|
color: seedMuted,
|
||||||
? Icons.check_circle
|
fontSize: 13,
|
||||||
: Icons.pending_outlined,
|
height: 1.4,
|
||||||
size: 18,
|
|
||||||
color: hasArea ? seedGreen : seedMuted,
|
|
||||||
),
|
),
|
||||||
const SizedBox(width: 8),
|
),
|
||||||
Expanded(
|
const SizedBox(height: 18),
|
||||||
|
// Setting your area from device location is the human path;
|
||||||
|
// typing a code is the advanced fallback.
|
||||||
|
if (widget.location != null)
|
||||||
|
FilledButton.tonalIcon(
|
||||||
|
key: const Key('market.useLocation'),
|
||||||
|
onPressed: _locationBusy ? null : _useLocation,
|
||||||
|
icon: _locationBusy
|
||||||
|
? const SizedBox(
|
||||||
|
width: 16,
|
||||||
|
height: 16,
|
||||||
|
child: CircularProgressIndicator(
|
||||||
|
strokeWidth: 2,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: const Icon(Icons.my_location, size: 18),
|
||||||
|
label: Text(t.market.useLocation),
|
||||||
|
),
|
||||||
|
if (_locationError != null)
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 6),
|
||||||
child: Text(
|
child: Text(
|
||||||
hasArea ? t.market.areaSet : t.market.areaNotSet,
|
_locationError!,
|
||||||
style: TextStyle(
|
style: const TextStyle(
|
||||||
color: hasArea ? seedOnSurface : seedMuted,
|
color: Color(0xFFB3261E),
|
||||||
fontSize: 13,
|
fontSize: 12,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
const SizedBox(height: 12),
|
||||||
),
|
Row(
|
||||||
const SizedBox(height: 16),
|
|
||||||
Align(
|
|
||||||
alignment: AlignmentDirectional.centerStart,
|
|
||||||
child: Text(
|
|
||||||
t.market.rangeLabel,
|
|
||||||
style: const TextStyle(fontSize: 13, color: seedMuted),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
SegmentedButton<int>(
|
|
||||||
key: const Key('market.range'),
|
|
||||||
segments: [
|
|
||||||
ButtonSegment(value: 5, label: Text(t.market.rangeNear)),
|
|
||||||
ButtonSegment(value: 4, label: Text(t.market.rangeArea)),
|
|
||||||
ButtonSegment(value: 3, label: Text(t.market.rangeRegion)),
|
|
||||||
],
|
|
||||||
selected: {_precision},
|
|
||||||
showSelectedIcon: false,
|
|
||||||
onSelectionChanged: (s) =>
|
|
||||||
setState(() => _precision = s.first),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 8),
|
|
||||||
Theme(
|
|
||||||
data: Theme.of(context)
|
|
||||||
.copyWith(dividerColor: Colors.transparent),
|
|
||||||
child: ExpansionTile(
|
|
||||||
key: const Key('market.advanced'),
|
|
||||||
tilePadding: EdgeInsets.zero,
|
|
||||||
childrenPadding: const EdgeInsets.only(bottom: 8),
|
|
||||||
title: Text(
|
|
||||||
t.market.advanced,
|
|
||||||
style: const TextStyle(fontSize: 13, color: seedMuted),
|
|
||||||
),
|
|
||||||
children: [
|
children: [
|
||||||
TextField(
|
Icon(
|
||||||
key: const Key('market.area'),
|
hasArea ? Icons.check_circle : Icons.pending_outlined,
|
||||||
controller: _area,
|
size: 18,
|
||||||
onChanged: (_) => setState(() {}),
|
color: hasArea ? seedGreen : seedMuted,
|
||||||
decoration: InputDecoration(
|
|
||||||
labelText: t.market.areaCodeLabel,
|
|
||||||
helperText: t.market.areaCodeHint,
|
|
||||||
helperMaxLines: 2,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 14),
|
const SizedBox(width: 8),
|
||||||
Align(
|
Expanded(
|
||||||
alignment: AlignmentDirectional.centerStart,
|
|
||||||
child: Text(
|
child: Text(
|
||||||
t.market.serversLabel,
|
hasArea ? t.market.areaSet : t.market.areaNotSet,
|
||||||
style: const TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 13, color: seedMuted),
|
color: hasArea ? seedOnSurface : seedMuted,
|
||||||
),
|
fontSize: 13,
|
||||||
),
|
),
|
||||||
Padding(
|
|
||||||
padding: const EdgeInsetsDirectional.only(
|
|
||||||
top: 2, bottom: 4),
|
|
||||||
child: Text(
|
|
||||||
t.market.serversHelp,
|
|
||||||
style: const TextStyle(
|
|
||||||
fontSize: 12, color: seedMuted, height: 1.3),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
for (final url in _knownRelays)
|
|
||||||
CheckboxListTile(
|
|
||||||
key: Key('market.server.$url'),
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
dense: true,
|
|
||||||
controlAffinity: ListTileControlAffinity.leading,
|
|
||||||
value: _selectedRelays.contains(url),
|
|
||||||
title: Text(_relayLabel(url)),
|
|
||||||
onChanged: (on) => setState(() {
|
|
||||||
if (on ?? false) {
|
|
||||||
_selectedRelays.add(url);
|
|
||||||
} else {
|
|
||||||
_selectedRelays.remove(url);
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
),
|
|
||||||
Align(
|
|
||||||
alignment: AlignmentDirectional.centerStart,
|
|
||||||
child: TextButton.icon(
|
|
||||||
key: const Key('market.addServer'),
|
|
||||||
onPressed: _addServer,
|
|
||||||
icon: const Icon(Icons.add, size: 18),
|
|
||||||
label: Text(t.market.serversAdvanced),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
ListTile(
|
|
||||||
key: const Key('market.blockedPeople'),
|
|
||||||
contentPadding: EdgeInsets.zero,
|
|
||||||
leading: const Icon(Icons.block, color: seedMuted),
|
|
||||||
title: Text(t.block.manageTitle),
|
|
||||||
trailing: const Icon(Icons.chevron_right),
|
|
||||||
onTap: () => showModalBottomSheet<void>(
|
|
||||||
context: context,
|
|
||||||
isScrollControlled: true,
|
|
||||||
builder: (_) =>
|
|
||||||
BlockedPeopleSheet(settings: widget.settings),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
const SizedBox(height: 16),
|
||||||
const SizedBox(height: 20),
|
Align(
|
||||||
FilledButton(
|
alignment: AlignmentDirectional.centerStart,
|
||||||
key: const Key('market.save'),
|
child: Text(
|
||||||
onPressed: _save,
|
t.market.rangeLabel,
|
||||||
child: Text(t.market.save),
|
style: const TextStyle(fontSize: 13, color: seedMuted),
|
||||||
),
|
),
|
||||||
],
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
SegmentedButton<int>(
|
||||||
|
key: const Key('market.range'),
|
||||||
|
segments: [
|
||||||
|
ButtonSegment(
|
||||||
|
value: 5,
|
||||||
|
label: Text(t.market.rangeNear),
|
||||||
|
),
|
||||||
|
ButtonSegment(
|
||||||
|
value: 4,
|
||||||
|
label: Text(t.market.rangeArea),
|
||||||
|
),
|
||||||
|
ButtonSegment(
|
||||||
|
value: 3,
|
||||||
|
label: Text(t.market.rangeRegion),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
selected: {_precision},
|
||||||
|
showSelectedIcon: false,
|
||||||
|
onSelectionChanged: (s) =>
|
||||||
|
setState(() => _precision = s.first),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 8),
|
||||||
|
Theme(
|
||||||
|
data: Theme.of(
|
||||||
|
context,
|
||||||
|
).copyWith(dividerColor: Colors.transparent),
|
||||||
|
child: ExpansionTile(
|
||||||
|
key: const Key('market.advanced'),
|
||||||
|
tilePadding: EdgeInsets.zero,
|
||||||
|
childrenPadding: const EdgeInsets.only(bottom: 8),
|
||||||
|
title: Text(
|
||||||
|
t.market.advanced,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: seedMuted,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
children: [
|
||||||
|
// The master switch: turning it off takes Tane fully
|
||||||
|
// offline right away, not at the next launch.
|
||||||
|
if (widget.sharing != null)
|
||||||
|
ValueListenableBuilder<bool>(
|
||||||
|
valueListenable: widget.sharing!.on,
|
||||||
|
builder: (context, on, _) => SwitchListTile(
|
||||||
|
key: const Key('market.sharingOn'),
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
dense: true,
|
||||||
|
value: on,
|
||||||
|
title: Text(t.market.sharingOnLabel),
|
||||||
|
subtitle: Text(
|
||||||
|
t.market.sharingOnHelp,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: seedMuted,
|
||||||
|
height: 1.3,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onChanged: (want) => want
|
||||||
|
? widget.sharing!.enable()
|
||||||
|
: widget.sharing!.disable(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextField(
|
||||||
|
key: const Key('market.area'),
|
||||||
|
controller: _area,
|
||||||
|
onChanged: (_) => setState(() {}),
|
||||||
|
decoration: InputDecoration(
|
||||||
|
labelText: t.market.areaCodeLabel,
|
||||||
|
helperText: t.market.areaCodeHint,
|
||||||
|
helperMaxLines: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 14),
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.centerStart,
|
||||||
|
child: Text(
|
||||||
|
t.market.serversLabel,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 13,
|
||||||
|
color: seedMuted,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.only(
|
||||||
|
top: 2,
|
||||||
|
bottom: 4,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
t.market.serversHelp,
|
||||||
|
style: const TextStyle(
|
||||||
|
fontSize: 12,
|
||||||
|
color: seedMuted,
|
||||||
|
height: 1.3,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
for (final url in _knownRelays)
|
||||||
|
CheckboxListTile(
|
||||||
|
key: Key('market.server.$url'),
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
dense: true,
|
||||||
|
controlAffinity: ListTileControlAffinity.leading,
|
||||||
|
value: _selectedRelays.contains(url),
|
||||||
|
title: Text(_relayLabel(url)),
|
||||||
|
onChanged: (on) => setState(() {
|
||||||
|
if (on ?? false) {
|
||||||
|
_selectedRelays.add(url);
|
||||||
|
} else {
|
||||||
|
_selectedRelays.remove(url);
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
Align(
|
||||||
|
alignment: AlignmentDirectional.centerStart,
|
||||||
|
child: TextButton.icon(
|
||||||
|
key: const Key('market.addServer'),
|
||||||
|
onPressed: _addServer,
|
||||||
|
icon: const Icon(Icons.add, size: 18),
|
||||||
|
label: Text(t.market.serversAdvanced),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
ListTile(
|
||||||
|
key: const Key('market.blockedPeople'),
|
||||||
|
contentPadding: EdgeInsets.zero,
|
||||||
|
leading: const Icon(Icons.block, color: seedMuted),
|
||||||
|
title: Text(t.block.manageTitle),
|
||||||
|
trailing: const Icon(Icons.chevron_right),
|
||||||
|
onTap: () => showModalBottomSheet<void>(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
builder: (_) =>
|
||||||
|
BlockedPeopleSheet(settings: widget.settings),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 20),
|
||||||
|
FilledButton(
|
||||||
|
key: const Key('market.save'),
|
||||||
|
onPressed: _save,
|
||||||
|
child: Text(t.market.save),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ class OfferThumbnail extends StatelessWidget {
|
||||||
return ClipRRect(
|
return ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(10),
|
borderRadius: BorderRadius.circular(10),
|
||||||
child: _offerImage(
|
child: _offerImage(
|
||||||
|
context,
|
||||||
url,
|
url,
|
||||||
semanticLabel: semanticLabel,
|
semanticLabel: semanticLabel,
|
||||||
width: size,
|
width: size,
|
||||||
|
|
@ -63,7 +64,7 @@ class OfferHeroImage extends StatelessWidget {
|
||||||
borderRadius: BorderRadius.circular(14),
|
borderRadius: BorderRadius.circular(14),
|
||||||
child: AspectRatio(
|
child: AspectRatio(
|
||||||
aspectRatio: 4 / 3,
|
aspectRatio: 4 / 3,
|
||||||
child: _offerImage(url, semanticLabel: semanticLabel),
|
child: _offerImage(context, url, semanticLabel: semanticLabel),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -73,6 +74,7 @@ class OfferHeroImage extends StatelessWidget {
|
||||||
/// remote URL (via network), always cropping to fill and falling back to a
|
/// remote URL (via network), always cropping to fill and falling back to a
|
||||||
/// neutral placeholder — a broken image must never block the card.
|
/// neutral placeholder — a broken image must never block the card.
|
||||||
Widget _offerImage(
|
Widget _offerImage(
|
||||||
|
BuildContext context,
|
||||||
String url, {
|
String url, {
|
||||||
required String semanticLabel,
|
required String semanticLabel,
|
||||||
double? width,
|
double? width,
|
||||||
|
|
@ -80,10 +82,16 @@ Widget _offerImage(
|
||||||
}) {
|
}) {
|
||||||
final inline = decodeDataUri(url);
|
final inline = decodeDataUri(url);
|
||||||
if (inline != null) {
|
if (inline != null) {
|
||||||
|
// For a sized thumbnail, decode down to its on-screen pixels instead of the
|
||||||
|
// photo's full resolution (Play's "bitmap downscaling"). The hero image
|
||||||
|
// passes no width, so it decodes at native size as intended.
|
||||||
|
final dpr = MediaQuery.devicePixelRatioOf(context);
|
||||||
return Image.memory(
|
return Image.memory(
|
||||||
inline,
|
inline,
|
||||||
width: width,
|
width: width,
|
||||||
height: height,
|
height: height,
|
||||||
|
cacheWidth: width == null ? null : (width * dpr).round(),
|
||||||
|
cacheHeight: height == null ? null : (height * dpr).round(),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
semanticLabel: semanticLabel,
|
semanticLabel: semanticLabel,
|
||||||
errorBuilder: (context, _, _) =>
|
errorBuilder: (context, _, _) =>
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,19 @@ class PeerAvatar extends StatelessWidget {
|
||||||
if (pic.startsWith('data:')) {
|
if (pic.startsWith('data:')) {
|
||||||
final bytes = decodeDataUri(pic);
|
final bytes = decodeDataUri(pic);
|
||||||
if (bytes != null) {
|
if (bytes != null) {
|
||||||
return CircleAvatar(radius: radius, backgroundImage: MemoryImage(bytes));
|
// Decode the photo down to the avatar's on-screen size (in physical
|
||||||
|
// pixels) instead of full resolution — the "bitmap downscaling" Play
|
||||||
|
// recommends. A tiny disc never needs a multi-megapixel decode.
|
||||||
|
final side = (radius * 2 * MediaQuery.devicePixelRatioOf(context))
|
||||||
|
.round();
|
||||||
|
return CircleAvatar(
|
||||||
|
radius: radius,
|
||||||
|
backgroundImage: ResizeImage(
|
||||||
|
MemoryImage(bytes),
|
||||||
|
width: side,
|
||||||
|
height: side,
|
||||||
|
),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else if (pic.startsWith(avatarGlyphPrefix)) {
|
} else if (pic.startsWith(avatarGlyphPrefix)) {
|
||||||
final glyph = avatarGlyphChar(pic.substring(avatarGlyphPrefix.length));
|
final glyph = avatarGlyphChar(pic.substring(avatarGlyphPrefix.length));
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:image_picker/image_picker.dart';
|
import 'package:image_picker/image_picker.dart';
|
||||||
|
|
||||||
import '../i18n/strings.g.dart';
|
import '../i18n/strings.g.dart';
|
||||||
|
import '../services/camera_availability.dart';
|
||||||
|
|
||||||
/// Asks the user to take a photo or pick one from the gallery, then returns its
|
/// Asks the user to take a photo or pick one from the gallery, then returns its
|
||||||
/// bytes (or null if cancelled/unavailable). Camera failures — e.g. on desktop,
|
/// bytes (or null if cancelled/unavailable). Camera failures — e.g. on desktop,
|
||||||
|
|
@ -16,12 +17,15 @@ Future<Uint8List?> pickPhoto(BuildContext context) async {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
ListTile(
|
// Only offer the camera when the device actually has one; camera-less
|
||||||
key: const Key('photo.source.camera'),
|
// devices (Chromebooks, Automotive, some TVs) fall back to gallery.
|
||||||
leading: const Icon(Icons.photo_camera_outlined),
|
if (deviceHasCamera)
|
||||||
title: Text(t.photo.camera),
|
ListTile(
|
||||||
onTap: () => Navigator.of(sheetContext).pop(ImageSource.camera),
|
key: const Key('photo.source.camera'),
|
||||||
),
|
leading: const Icon(Icons.photo_camera_outlined),
|
||||||
|
title: Text(t.photo.camera),
|
||||||
|
onTap: () => Navigator.of(sheetContext).pop(ImageSource.camera),
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
key: const Key('photo.source.gallery'),
|
key: const Key('photo.source.gallery'),
|
||||||
leading: const Icon(Icons.photo_library_outlined),
|
leading: const Icon(Icons.photo_library_outlined),
|
||||||
|
|
@ -57,12 +61,15 @@ Future<List<Uint8List>> pickPhotos(BuildContext context) async {
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
ListTile(
|
// Only offer the camera when the device actually has one; camera-less
|
||||||
key: const Key('photos.source.camera'),
|
// devices (Chromebooks, Automotive, some TVs) fall back to gallery.
|
||||||
leading: const Icon(Icons.photo_camera_outlined),
|
if (deviceHasCamera)
|
||||||
title: Text(t.photo.camera),
|
ListTile(
|
||||||
onTap: () => Navigator.of(sheetContext).pop(ImageSource.camera),
|
key: const Key('photos.source.camera'),
|
||||||
),
|
leading: const Icon(Icons.photo_camera_outlined),
|
||||||
|
title: Text(t.photo.camera),
|
||||||
|
onTap: () => Navigator.of(sheetContext).pop(ImageSource.camera),
|
||||||
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
key: const Key('photos.source.gallery'),
|
key: const Key('photos.source.gallery'),
|
||||||
leading: const Icon(Icons.photo_library_outlined),
|
leading: const Icon(Icons.photo_library_outlined),
|
||||||
|
|
|
||||||
|
|
@ -7,12 +7,17 @@ import 'package:zxing_barcode_scanner/zxing_barcode_scanner.dart';
|
||||||
import '../data/species_repository.dart';
|
import '../data/species_repository.dart';
|
||||||
import '../data/variety_repository.dart';
|
import '../data/variety_repository.dart';
|
||||||
import '../i18n/strings.g.dart';
|
import '../i18n/strings.g.dart';
|
||||||
|
import '../services/camera_availability.dart';
|
||||||
import '../services/seed_label_scan.dart';
|
import '../services/seed_label_scan.dart';
|
||||||
|
|
||||||
/// Whether this platform can open the camera scanner. Mobile-only for now
|
/// Whether this platform can open the camera scanner. Mobile-only for now
|
||||||
/// (pure-ZXing platform views; no Google Play Services) — elsewhere the scan
|
/// (pure-ZXing platform views; no Google Play Services) — elsewhere the scan
|
||||||
/// button simply isn't offered, same pattern as the OCR capture.
|
/// button simply isn't offered, same pattern as the OCR capture. On Android it
|
||||||
bool get qrScanSupported => !kIsWeb && (Platform.isAndroid || Platform.isIOS);
|
/// also requires an actual camera, so camera-less devices (Chromebooks,
|
||||||
|
/// Automotive, some TVs) don't get a scan button that can't open — see
|
||||||
|
/// [deviceHasCamera].
|
||||||
|
bool get qrScanSupported =>
|
||||||
|
!kIsWeb && ((Platform.isAndroid && deviceHasCamera) || Platform.isIOS);
|
||||||
|
|
||||||
/// Opens the full-screen camera scanner and returns the first decoded QR
|
/// Opens the full-screen camera scanner and returns the first decoded QR
|
||||||
/// payload, or null if the person backed out. (Ğ1nkgo's scanner pattern on
|
/// payload, or null if the person backed out. (Ğ1nkgo's scanner pattern on
|
||||||
|
|
|
||||||
|
|
@ -199,6 +199,8 @@ class _MoreSection extends StatelessWidget {
|
||||||
child: Image.memory(
|
child: Image.memory(
|
||||||
state.photoBytes!,
|
state.photoBytes!,
|
||||||
height: 120,
|
height: 120,
|
||||||
|
cacheHeight:
|
||||||
|
(120 * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -57,6 +57,7 @@ List<(AppLocale, String)> _languages(Translations t) => [
|
||||||
(AppLocale.ast, t.settings.langAst),
|
(AppLocale.ast, t.settings.langAst),
|
||||||
(AppLocale.en, t.settings.langEn),
|
(AppLocale.en, t.settings.langEn),
|
||||||
(AppLocale.pt, t.settings.langPt),
|
(AppLocale.pt, t.settings.langPt),
|
||||||
|
(AppLocale.ptBr, t.settings.langPtBr),
|
||||||
(AppLocale.fr, t.settings.langFr),
|
(AppLocale.fr, t.settings.langFr),
|
||||||
(AppLocale.de, t.settings.langDe),
|
(AppLocale.de, t.settings.langDe),
|
||||||
(AppLocale.ja, t.settings.langJa),
|
(AppLocale.ja, t.settings.langJa),
|
||||||
|
|
|
||||||
123
apps/app_seeds/lib/ui/sharing_invite_sheet.dart
Normal file
123
apps/app_seeds/lib/ui/sharing_invite_sheet.dart
Normal file
|
|
@ -0,0 +1,123 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../i18n/strings.g.dart';
|
||||||
|
import '../services/onboarding_store.dart';
|
||||||
|
import '../services/sharing_switch.dart';
|
||||||
|
import 'market_gate.dart';
|
||||||
|
import 'theme.dart';
|
||||||
|
|
||||||
|
/// Shown when someone taps a social entry (chat, profile, favourites, your
|
||||||
|
/// people) while sharing is still off.
|
||||||
|
///
|
||||||
|
/// The alternative was hiding those entries until sharing is on, but then
|
||||||
|
/// nobody would ever discover that Tane does any of it. So they stay in the
|
||||||
|
/// drawer, quiet, and tapping one explains what they are and offers to switch
|
||||||
|
/// them on — with the community rules, which is the same single consent step
|
||||||
|
/// the market uses. Returns true when sharing ended up on.
|
||||||
|
Future<bool> showSharingInvite(
|
||||||
|
BuildContext context, {
|
||||||
|
required OnboardingStore onboarding,
|
||||||
|
required SharingSwitch sharing,
|
||||||
|
}) async {
|
||||||
|
final wants = await showModalBottomSheet<bool>(
|
||||||
|
context: context,
|
||||||
|
isScrollControlled: true,
|
||||||
|
builder: (_) => const SharingInviteSheet(),
|
||||||
|
);
|
||||||
|
if (wants != true || !context.mounted) return false;
|
||||||
|
return ensureMarketRulesAccepted(context, onboarding, sharing: sharing);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The invitation itself: what lights up when you join, and the plain fact that
|
||||||
|
/// it needs a connection.
|
||||||
|
class SharingInviteSheet extends StatelessWidget {
|
||||||
|
const SharingInviteSheet({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final t = context.t;
|
||||||
|
final theme = Theme.of(context);
|
||||||
|
return SafeArea(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 20,
|
||||||
|
right: 20,
|
||||||
|
top: 24,
|
||||||
|
bottom: 16 + MediaQuery.of(context).viewInsets.bottom,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
t.sharingInvite.title,
|
||||||
|
style: theme.textTheme.titleLarge?.copyWith(
|
||||||
|
color: seedOnSurface,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
_Perk(Icons.chat_bubble_outline, t.sharingInvite.perkChat),
|
||||||
|
_Perk(Icons.favorite_border, t.sharingInvite.perkFavorites),
|
||||||
|
_Perk(Icons.group_outlined, t.sharingInvite.perkPeople),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Text(
|
||||||
|
t.sharingInvite.networkNote,
|
||||||
|
style: theme.textTheme.bodySmall?.copyWith(
|
||||||
|
color: seedMuted,
|
||||||
|
height: 1.4,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(height: 12),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
TextButton(
|
||||||
|
key: const Key('sharingInvite.notNow'),
|
||||||
|
onPressed: () => Navigator.of(context).pop(false),
|
||||||
|
child: Text(t.sharingInvite.notNow),
|
||||||
|
),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
FilledButton(
|
||||||
|
key: const Key('sharingInvite.start'),
|
||||||
|
onPressed: () => Navigator.of(context).pop(true),
|
||||||
|
child: Text(t.sharingInvite.start),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class _Perk extends StatelessWidget {
|
||||||
|
const _Perk(this.icon, this.text);
|
||||||
|
|
||||||
|
final IconData icon;
|
||||||
|
final String text;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsetsDirectional.only(bottom: 8),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Icon(icon, size: 18, color: seedGreen),
|
||||||
|
const SizedBox(width: 8),
|
||||||
|
Expanded(
|
||||||
|
child: Text(
|
||||||
|
text,
|
||||||
|
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
|
||||||
|
color: seedOnSurface,
|
||||||
|
height: 1.35,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2244,10 +2244,16 @@ class _PhotoGalleryState extends State<_PhotoGallery> {
|
||||||
itemBuilder: (_, i) => GestureDetector(
|
itemBuilder: (_, i) => GestureDetector(
|
||||||
key: Key('photo.thumb.$i'),
|
key: Key('photo.thumb.$i'),
|
||||||
onTap: () => _openPhotoViewer(context, cubit, i),
|
onTap: () => _openPhotoViewer(context, cubit, i),
|
||||||
|
// Decode to the 140px thumbnail size (× dpr), not full photo
|
||||||
|
// resolution — the full-res decode happens in the viewer.
|
||||||
child: Image.memory(
|
child: Image.memory(
|
||||||
photos[i].bytes,
|
photos[i].bytes,
|
||||||
width: 140,
|
width: 140,
|
||||||
height: 140,
|
height: 140,
|
||||||
|
cacheWidth:
|
||||||
|
(140 * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||||
|
cacheHeight:
|
||||||
|
(140 * MediaQuery.devicePixelRatioOf(context)).round(),
|
||||||
fit: BoxFit.cover,
|
fit: BoxFit.cover,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
name: tane
|
name: tane
|
||||||
description: "Tane — local-first, encrypted, decentralized traditional-seed inventory and market."
|
description: "Tane — local-first, encrypted, decentralized traditional-seed inventory and market."
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
version: 0.1.3+5
|
version: 0.1.16+18
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.11.5
|
sdk: ^3.11.5
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,8 @@ void main() {
|
||||||
});
|
});
|
||||||
tearDown(() => db.close());
|
tearDown(() => db.close());
|
||||||
|
|
||||||
test('the inventory view loads 3000 varieties quickly', () async {
|
test('the inventory view loads 10000 varieties quickly', () async {
|
||||||
const count = 3000;
|
const count = 10000;
|
||||||
for (var i = 0; i < count; i++) {
|
for (var i = 0; i < count; i++) {
|
||||||
final id = await repo.addQuickVariety(
|
final id = await repo.addQuickVariety(
|
||||||
label: 'Variety $i',
|
label: 'Variety $i',
|
||||||
|
|
@ -43,11 +43,12 @@ void main() {
|
||||||
sw.stop();
|
sw.stop();
|
||||||
|
|
||||||
expect(view.items, hasLength(count));
|
expect(view.items, hasLength(count));
|
||||||
// Generous ceiling for CI; typical local runs are well under 500ms. The
|
// Generous ceiling for CI (the point is to catch an N+1 regression, not to
|
||||||
// point is to catch an accidental N+1 regression, not to micro-benchmark.
|
// micro-benchmark). Includes the ~250ms debounce on the first emit; typical
|
||||||
|
// local runs are well under 2s for 10k rows with the v14 indexes.
|
||||||
expect(
|
expect(
|
||||||
sw.elapsedMilliseconds,
|
sw.elapsedMilliseconds,
|
||||||
lessThan(3000),
|
lessThan(6000),
|
||||||
reason: 'inventory view took ${sw.elapsedMilliseconds}ms for $count rows',
|
reason: 'inventory view took ${sw.elapsedMilliseconds}ms for $count rows',
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -11,19 +11,19 @@ void main() {
|
||||||
verifier = SchemaVerifier(GeneratedHelper());
|
verifier = SchemaVerifier(GeneratedHelper());
|
||||||
});
|
});
|
||||||
|
|
||||||
test('freshly created database matches the exported schema v13', () async {
|
test('freshly created database matches the exported schema v14', () async {
|
||||||
final schema = await verifier.schemaAt(13);
|
final schema = await verifier.schemaAt(14);
|
||||||
final db = AppDatabase(schema.newConnection());
|
final db = AppDatabase(schema.newConnection());
|
||||||
await verifier.migrateAndValidate(db, 13);
|
await verifier.migrateAndValidate(db, 14);
|
||||||
await db.close();
|
await db.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
// Every historical version upgrades cleanly to the current schema (v13).
|
// Every historical version upgrades cleanly to the current schema (v14).
|
||||||
for (var from = 1; from <= 12; from++) {
|
for (var from = 1; from <= 13; from++) {
|
||||||
test('upgrades v$from → v13 and matches the fresh schema', () async {
|
test('upgrades v$from → v14 and matches the fresh schema', () async {
|
||||||
final connection = await verifier.startAt(from);
|
final connection = await verifier.startAt(from);
|
||||||
final db = AppDatabase(connection);
|
final db = AppDatabase(connection);
|
||||||
await verifier.migrateAndValidate(db, 13);
|
await verifier.migrateAndValidate(db, 14);
|
||||||
await db.close();
|
await db.close();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ import 'schema_v10.dart' as v10;
|
||||||
import 'schema_v11.dart' as v11;
|
import 'schema_v11.dart' as v11;
|
||||||
import 'schema_v12.dart' as v12;
|
import 'schema_v12.dart' as v12;
|
||||||
import 'schema_v13.dart' as v13;
|
import 'schema_v13.dart' as v13;
|
||||||
|
import 'schema_v14.dart' as v14;
|
||||||
|
|
||||||
class GeneratedHelper implements SchemaInstantiationHelper {
|
class GeneratedHelper implements SchemaInstantiationHelper {
|
||||||
@override
|
@override
|
||||||
|
|
@ -48,10 +49,12 @@ class GeneratedHelper implements SchemaInstantiationHelper {
|
||||||
return v12.DatabaseAtV12(db);
|
return v12.DatabaseAtV12(db);
|
||||||
case 13:
|
case 13:
|
||||||
return v13.DatabaseAtV13(db);
|
return v13.DatabaseAtV13(db);
|
||||||
|
case 14:
|
||||||
|
return v14.DatabaseAtV14(db);
|
||||||
default:
|
default:
|
||||||
throw MissingSchemaException(version, versions);
|
throw MissingSchemaException(version, versions);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const versions = const [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13];
|
static const versions = const [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2248
apps/app_seeds/test/db/schema/schema_v14.dart
Normal file
2248
apps/app_seeds/test/db/schema/schema_v14.dart
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -105,7 +105,7 @@ void main() {
|
||||||
seeded = await seedShowcase(db, repo, locale);
|
seeded = await seedShowcase(db, repo, locale);
|
||||||
});
|
});
|
||||||
final child = switch (name) {
|
final child = switch (name) {
|
||||||
'home' => const HomeScreen(marketEnabled: true),
|
'home' => HomeScreen(sharing: newTestSharingSwitch()),
|
||||||
'inventory' => const InventoryListScreen(),
|
'inventory' => const InventoryListScreen(),
|
||||||
'market' => marketWidget(locale),
|
'market' => marketWidget(locale),
|
||||||
'calendar' => const CalendarScreen(initialMonth: 4),
|
'calendar' => const CalendarScreen(initialMonth: 4),
|
||||||
|
|
@ -156,7 +156,11 @@ class _SeededOffersCubit extends OffersCubit {
|
||||||
/// A transport that is present (so the market reads as online) but never used.
|
/// A transport that is present (so the market reads as online) but never used.
|
||||||
class _NoopOfferTransport implements OfferTransport {
|
class _NoopOfferTransport implements OfferTransport {
|
||||||
@override
|
@override
|
||||||
Stream<Offer> discover(DiscoveryQuery query) => const Stream.empty();
|
Stream<Offer> discover(DiscoveryQuery query, {int? since}) =>
|
||||||
|
const Stream.empty();
|
||||||
|
@override
|
||||||
|
Future<OfferPage> discoverPage(DiscoveryQuery query) async =>
|
||||||
|
const OfferPage(offers: []);
|
||||||
@override
|
@override
|
||||||
Future<PublishResult> publish(Offer offer) => throw UnimplementedError();
|
Future<PublishResult> publish(Offer offer) => throw UnimplementedError();
|
||||||
@override
|
@override
|
||||||
|
|
|
||||||
41
apps/app_seeds/test/services/i18n_pt_br_locale_test.dart
Normal file
41
apps/app_seeds/test/services/i18n_pt_br_locale_test.dart
Normal file
|
|
@ -0,0 +1,41 @@
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:tane/i18n/strings.g.dart';
|
||||||
|
|
||||||
|
/// Brazilian Portuguese (`pt_BR`) is the first locale in the app to carry a
|
||||||
|
/// region code alongside a base language that already has its own locale
|
||||||
|
/// (`pt`, European Portuguese) — a case slang and the settings picker had
|
||||||
|
/// never exercised before. These tests pin that both variants are wired
|
||||||
|
/// distinctly and neither silently falls back to the other.
|
||||||
|
void main() {
|
||||||
|
test('pt and pt_BR are both supported, as distinct locales', () {
|
||||||
|
expect(
|
||||||
|
AppLocaleUtils.supportedLocales,
|
||||||
|
containsAll([const Locale('pt'), const Locale('pt', 'BR')]),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('core strings resolve in Brazilian Portuguese', () {
|
||||||
|
final ptBr = AppLocale.ptBr.buildSync();
|
||||||
|
expect(ptBr.menu.inventory, 'Inventário');
|
||||||
|
expect(ptBr.common.save, 'Salvar');
|
||||||
|
expect(ptBr.settings.langPtBr, 'Português (Brasil)');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('pt_BR wording diverges from pt where Brazilian usage differs', () {
|
||||||
|
final pt = AppLocale.pt.buildSync();
|
||||||
|
final ptBr = AppLocale.ptBr.buildSync();
|
||||||
|
// European Portuguese uses "Guardar"; Brazilian software uses "Salvar".
|
||||||
|
expect(pt.common.save, 'Guardar');
|
||||||
|
expect(ptBr.common.save, 'Salvar');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('pt_BR translates a key added after the initial pt rollout', () {
|
||||||
|
final en = AppLocale.en.buildSync();
|
||||||
|
final ptBr = AppLocale.ptBr.buildSync();
|
||||||
|
// savedSearches was a later addition; if pt_BR were missing it, this
|
||||||
|
// would silently surface the English fallback instead.
|
||||||
|
expect(ptBr.savedSearches.title, isNot(en.savedSearches.title));
|
||||||
|
expect(ptBr.savedSearches.title, isNotEmpty);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -45,11 +45,13 @@ void main() {
|
||||||
required List<FakeChannel> opened,
|
required List<FakeChannel> opened,
|
||||||
Stream<bool>? online,
|
Stream<bool>? online,
|
||||||
bool Function()? fail,
|
bool Function()? fail,
|
||||||
|
List<Duration>? retrySchedule,
|
||||||
}) =>
|
}) =>
|
||||||
SocialConnection(
|
SocialConnection(
|
||||||
social: social,
|
social: social,
|
||||||
settings: settings,
|
settings: settings,
|
||||||
online: online,
|
online: online,
|
||||||
|
retrySchedule: retrySchedule,
|
||||||
open: (_) async {
|
open: (_) async {
|
||||||
if (fail?.call() ?? false) throw StateError('unreachable');
|
if (fail?.call() ?? false) throw StateError('unreachable');
|
||||||
final ch = FakeChannel();
|
final ch = FakeChannel();
|
||||||
|
|
@ -106,6 +108,69 @@ void main() {
|
||||||
await online.close();
|
await online.close();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test(
|
||||||
|
'started connection retries by itself after a failed first attempt, '
|
||||||
|
'without any connectivity event', () async {
|
||||||
|
// The fresh-install case: device online the whole time, but the very first
|
||||||
|
// connect fails (cold DNS/TLS). The connectivity stream never fires, so
|
||||||
|
// only the backoff retry can bring the market up without a manual Retry.
|
||||||
|
final opened = <FakeChannel>[];
|
||||||
|
var down = true;
|
||||||
|
final conn = make(
|
||||||
|
opened: opened,
|
||||||
|
online: const Stream.empty(), // connectivity never speaks
|
||||||
|
fail: () => down,
|
||||||
|
retrySchedule: const [Duration(milliseconds: 5)],
|
||||||
|
);
|
||||||
|
final emitted = <SocialSession?>[];
|
||||||
|
conn.sessions.listen(emitted.add);
|
||||||
|
|
||||||
|
conn.start();
|
||||||
|
await Future<void>.delayed(Duration.zero);
|
||||||
|
expect(conn.current, isNull); // first attempt failed
|
||||||
|
|
||||||
|
down = false; // network path recovers
|
||||||
|
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||||
|
expect(conn.current, isNotNull, reason: 'backoff retry reconnected');
|
||||||
|
expect(opened, hasLength(1));
|
||||||
|
expect(emitted.last, isNotNull, reason: 'recovery announced on sessions');
|
||||||
|
|
||||||
|
await conn.dispose();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('a plain session() failure schedules no retry when never started',
|
||||||
|
() async {
|
||||||
|
// Widget tests build cubits against an un-started connection; a failed
|
||||||
|
// one-shot session() must not leave a pending retry timer behind.
|
||||||
|
final opened = <FakeChannel>[];
|
||||||
|
final conn = make(
|
||||||
|
opened: opened,
|
||||||
|
fail: () => true,
|
||||||
|
retrySchedule: const [Duration(milliseconds: 5)],
|
||||||
|
);
|
||||||
|
expect(await conn.session(), isNull);
|
||||||
|
await Future<void>.delayed(const Duration(milliseconds: 50));
|
||||||
|
expect(opened, isEmpty); // no background retry fired
|
||||||
|
await conn.dispose();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('dispose cancels a pending backoff retry', () async {
|
||||||
|
final opened = <FakeChannel>[];
|
||||||
|
var down = true;
|
||||||
|
final conn = make(
|
||||||
|
opened: opened,
|
||||||
|
online: const Stream.empty(),
|
||||||
|
fail: () => down,
|
||||||
|
retrySchedule: const [Duration(milliseconds: 20)],
|
||||||
|
);
|
||||||
|
conn.start();
|
||||||
|
await Future<void>.delayed(Duration.zero); // first attempt fails
|
||||||
|
await conn.dispose(); // cancels the scheduled retry
|
||||||
|
down = false;
|
||||||
|
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||||
|
expect(opened, isEmpty, reason: 'no reconnect after dispose');
|
||||||
|
});
|
||||||
|
|
||||||
test('returns null when the relay is unreachable, and retries later',
|
test('returns null when the relay is unreachable, and retries later',
|
||||||
() async {
|
() async {
|
||||||
final opened = <FakeChannel>[];
|
final opened = <FakeChannel>[];
|
||||||
|
|
@ -116,4 +181,70 @@ void main() {
|
||||||
expect(await conn.session(), isNotNull); // succeeds on retry
|
expect(await conn.session(), isNotNull); // succeeds on retry
|
||||||
await conn.dispose();
|
await conn.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('start is idempotent: a second call adds no second connect', () async {
|
||||||
|
// Joining sharing calls start() while bootstrap may already have, so a
|
||||||
|
// repeat must not stack another connectivity subscription or dial again.
|
||||||
|
final opened = <FakeChannel>[];
|
||||||
|
final online = StreamController<bool>.broadcast();
|
||||||
|
final conn = make(opened: opened, online: online.stream);
|
||||||
|
|
||||||
|
conn.start();
|
||||||
|
await conn.session();
|
||||||
|
conn.start();
|
||||||
|
await Future<void>.delayed(Duration.zero);
|
||||||
|
expect(opened, hasLength(1));
|
||||||
|
|
||||||
|
// One subscription, so one drop — not two competing reactions.
|
||||||
|
online.add(false);
|
||||||
|
await Future<void>.delayed(Duration.zero);
|
||||||
|
expect(conn.current, isNull);
|
||||||
|
expect(opened.first.closed, isTrue);
|
||||||
|
|
||||||
|
await conn.dispose();
|
||||||
|
await online.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('stop goes offline now, not at the next launch', () async {
|
||||||
|
// Turning sharing off used to leave the live session open until restart.
|
||||||
|
final opened = <FakeChannel>[];
|
||||||
|
final online = StreamController<bool>.broadcast();
|
||||||
|
final conn = make(opened: opened, online: online.stream);
|
||||||
|
final emitted = <SocialSession?>[];
|
||||||
|
conn.sessions.listen(emitted.add);
|
||||||
|
|
||||||
|
conn.start();
|
||||||
|
expect(await conn.session(), isNotNull);
|
||||||
|
|
||||||
|
await conn.stop();
|
||||||
|
await Future<void>.delayed(Duration.zero); // let the drop be announced
|
||||||
|
expect(conn.current, isNull);
|
||||||
|
expect(opened.single.closed, isTrue);
|
||||||
|
expect(emitted.last, isNull);
|
||||||
|
|
||||||
|
// And it stays off: a connectivity event must not resurrect it.
|
||||||
|
online.add(true);
|
||||||
|
await Future<void>.delayed(Duration.zero);
|
||||||
|
expect(conn.current, isNull);
|
||||||
|
expect(opened, hasLength(1));
|
||||||
|
|
||||||
|
await conn.dispose();
|
||||||
|
await online.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('stop leaves the connection usable: start brings it back', () async {
|
||||||
|
final opened = <FakeChannel>[];
|
||||||
|
final online = StreamController<bool>.broadcast();
|
||||||
|
final conn = make(opened: opened, online: online.stream);
|
||||||
|
conn.start();
|
||||||
|
await conn.session();
|
||||||
|
await conn.stop();
|
||||||
|
|
||||||
|
conn.start();
|
||||||
|
await Future<void>.delayed(Duration.zero);
|
||||||
|
expect(conn.current, isNotNull);
|
||||||
|
expect(opened, hasLength(2));
|
||||||
|
await conn.dispose();
|
||||||
|
await online.close();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -101,4 +101,34 @@ void main() {
|
||||||
{SocialSettings.offerKey('ab' * 32, 'tomate-1')},
|
{SocialSettings.offerKey('ab' * 32, 'tomate-1')},
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
group('sharing opt-in', () {
|
||||||
|
test('starts unanswered, then round-trips', () async {
|
||||||
|
expect(await settings.sharingEnabled(), isNull);
|
||||||
|
await settings.setSharingEnabled(true);
|
||||||
|
expect(await settings.sharingEnabled(), isTrue);
|
||||||
|
await settings.setSharingEnabled(false);
|
||||||
|
expect(await settings.sharingEnabled(), isFalse);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('an install that had been through the intro keeps sharing on',
|
||||||
|
() async {
|
||||||
|
// The upgrade path that must not regress: these people were on a build
|
||||||
|
// that connected at launch, so they keep messaging, sync and alerts.
|
||||||
|
expect(await settings.migrateSharingEnabled(introSeen: true), isTrue);
|
||||||
|
expect(await settings.sharingEnabled(), isTrue);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('a fresh install starts offline', () async {
|
||||||
|
expect(await settings.migrateSharingEnabled(introSeen: false), isFalse);
|
||||||
|
expect(await settings.sharingEnabled(), isFalse);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('migration never overwrites an answer already given', () async {
|
||||||
|
await settings.setSharingEnabled(false);
|
||||||
|
// Later launches see the intro as seen; the recorded "no" must survive.
|
||||||
|
expect(await settings.migrateSharingEnabled(introSeen: true), isFalse);
|
||||||
|
expect(await settings.sharingEnabled(), isFalse);
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,11 @@ import 'package:tane/data/variety_repository.dart';
|
||||||
import 'package:tane/db/enums.dart';
|
import 'package:tane/db/enums.dart';
|
||||||
import 'package:tane/services/discovery_area.dart';
|
import 'package:tane/services/discovery_area.dart';
|
||||||
import 'package:tane/services/offer_mapper.dart';
|
import 'package:tane/services/offer_mapper.dart';
|
||||||
|
import 'package:nostr/nostr.dart';
|
||||||
import 'package:tane/services/offer_outbox.dart';
|
import 'package:tane/services/offer_outbox.dart';
|
||||||
|
import 'package:tane/services/social_connection.dart';
|
||||||
|
import 'package:tane/services/social_service.dart';
|
||||||
|
import 'package:tane/services/social_settings.dart';
|
||||||
import 'package:tane/state/offers_cubit.dart';
|
import 'package:tane/state/offers_cubit.dart';
|
||||||
|
|
||||||
import '../support/test_support.dart';
|
import '../support/test_support.dart';
|
||||||
|
|
@ -25,7 +29,7 @@ class FakeOfferTransport implements OfferTransport {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Stream<Offer> discover(DiscoveryQuery query) {
|
Stream<Offer> discover(DiscoveryQuery query, {int? since}) {
|
||||||
final controller = StreamController<Offer>();
|
final controller = StreamController<Offer>();
|
||||||
for (final o in _offers) {
|
for (final o in _offers) {
|
||||||
if (o.approxGeohash.startsWith(query.geohashPrefix)) controller.add(o);
|
if (o.approxGeohash.startsWith(query.geohashPrefix)) controller.add(o);
|
||||||
|
|
@ -33,6 +37,15 @@ class FakeOfferTransport implements OfferTransport {
|
||||||
return controller.stream; // left open (live), like a real subscription
|
return controller.stream; // left open (live), like a real subscription
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<OfferPage> discoverPage(DiscoveryQuery query) async {
|
||||||
|
final matches = [
|
||||||
|
for (final o in _offers)
|
||||||
|
if (o.approxGeohash.startsWith(query.geohashPrefix)) o,
|
||||||
|
];
|
||||||
|
return OfferPage(offers: matches); // short page → nothing older to load
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> retract(String offerId) async =>
|
Future<void> retract(String offerId) async =>
|
||||||
_offers.removeWhere((o) => o.id == offerId);
|
_offers.removeWhere((o) => o.id == offerId);
|
||||||
|
|
@ -54,7 +67,7 @@ class DuplicatingOfferTransport implements OfferTransport {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Stream<Offer> discover(DiscoveryQuery query) {
|
Stream<Offer> discover(DiscoveryQuery query, {int? since}) {
|
||||||
final controller = StreamController<Offer>();
|
final controller = StreamController<Offer>();
|
||||||
for (final o in _offers) {
|
for (final o in _offers) {
|
||||||
if (o.approxGeohash.startsWith(query.geohashPrefix)) {
|
if (o.approxGeohash.startsWith(query.geohashPrefix)) {
|
||||||
|
|
@ -65,6 +78,17 @@ class DuplicatingOfferTransport implements OfferTransport {
|
||||||
return controller.stream;
|
return controller.stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<OfferPage> discoverPage(DiscoveryQuery query) async {
|
||||||
|
// The stored copy (deduped at relay level); the live echo (the duplicate)
|
||||||
|
// still arrives via [discover], so the cubit's dedup is what's under test.
|
||||||
|
final matches = [
|
||||||
|
for (final o in _offers)
|
||||||
|
if (o.approxGeohash.startsWith(query.geohashPrefix)) o,
|
||||||
|
];
|
||||||
|
return OfferPage(offers: matches);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> retract(String offerId) async =>
|
Future<void> retract(String offerId) async =>
|
||||||
_offers.removeWhere((o) => o.id == offerId);
|
_offers.removeWhere((o) => o.id == offerId);
|
||||||
|
|
@ -73,6 +97,59 @@ class DuplicatingOfferTransport implements OfferTransport {
|
||||||
Future<void> close() async {}
|
Future<void> close() async {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A transport that serves offers in `until`-cursored pages (like a relay's
|
||||||
|
/// stored events), so the cubit's pagination and memory cap can be exercised.
|
||||||
|
/// Each seeded offer gets a descending createdAt; [discover] (live) is empty.
|
||||||
|
class PaginatingOfferTransport implements OfferTransport {
|
||||||
|
PaginatingOfferTransport(int count, {this.geohash = 'sp3e9'}) {
|
||||||
|
// Newest (highest createdAt) first: offer 0 is newest.
|
||||||
|
for (var i = 0; i < count; i++) {
|
||||||
|
_byCreatedAt.add((
|
||||||
|
createdAt: 1000000 - i,
|
||||||
|
offer: Offer(
|
||||||
|
id: 'o$i',
|
||||||
|
authorPubkeyHex: 'ab' * 32,
|
||||||
|
summary: 'offer $i',
|
||||||
|
type: OfferType.gift,
|
||||||
|
approxGeohash: geohash,
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final String geohash;
|
||||||
|
final List<({int createdAt, Offer offer})> _byCreatedAt = [];
|
||||||
|
|
||||||
|
@override
|
||||||
|
Stream<Offer> discover(DiscoveryQuery query, {int? since}) =>
|
||||||
|
const Stream.empty();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<OfferPage> discoverPage(DiscoveryQuery query) async {
|
||||||
|
final matched = _byCreatedAt
|
||||||
|
.where((e) => e.offer.approxGeohash.startsWith(query.geohashPrefix))
|
||||||
|
.where((e) => query.until == null || e.createdAt <= query.until!)
|
||||||
|
.toList()
|
||||||
|
..sort((a, b) => b.createdAt.compareTo(a.createdAt));
|
||||||
|
final page = matched.take(query.limit).toList();
|
||||||
|
final nextCursor = page.length >= query.limit && page.isNotEmpty
|
||||||
|
? page.last.createdAt - 1
|
||||||
|
: null;
|
||||||
|
return OfferPage(
|
||||||
|
offers: [for (final e in page) e.offer],
|
||||||
|
nextCursor: nextCursor,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<PublishResult> publish(Offer offer) async =>
|
||||||
|
PublishResult(accepted: true, transportRef: offer.id);
|
||||||
|
@override
|
||||||
|
Future<void> retract(String offerId) async {}
|
||||||
|
@override
|
||||||
|
Future<void> close() async {}
|
||||||
|
}
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
group('OfferMapper', () {
|
group('OfferMapper', () {
|
||||||
test('maps local sharing intent to the network offer type', () {
|
test('maps local sharing intent to the network offer type', () {
|
||||||
|
|
@ -701,4 +778,172 @@ void main() {
|
||||||
await cubit.close();
|
await cubit.close();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
group('OffersCubit pagination', () {
|
||||||
|
test('discover loads the first page and exposes a next-page cursor',
|
||||||
|
() async {
|
||||||
|
final cubit = OffersCubit(PaginatingOfferTransport(250));
|
||||||
|
await cubit.discover('sp3');
|
||||||
|
await pumpEventQueue();
|
||||||
|
// One page (default limit 100) — not the whole 250 — is kept in memory.
|
||||||
|
expect(cubit.state.offers, hasLength(100));
|
||||||
|
expect(cubit.state.canLoadMore, isTrue);
|
||||||
|
expect(cubit.state.searching, isFalse);
|
||||||
|
await cubit.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('loadNextPage accumulates older offers until the source is exhausted',
|
||||||
|
() async {
|
||||||
|
final cubit = OffersCubit(PaginatingOfferTransport(250));
|
||||||
|
await cubit.discover('sp3');
|
||||||
|
await pumpEventQueue();
|
||||||
|
|
||||||
|
await cubit.loadNextPage();
|
||||||
|
expect(cubit.state.offers, hasLength(200));
|
||||||
|
expect(cubit.state.canLoadMore, isTrue);
|
||||||
|
|
||||||
|
await cubit.loadNextPage();
|
||||||
|
// Only 250 exist: the third page is short, so there is nothing older.
|
||||||
|
expect(cubit.state.offers, hasLength(250));
|
||||||
|
expect(cubit.state.canLoadMore, isFalse);
|
||||||
|
|
||||||
|
// Paging past the end is a harmless no-op.
|
||||||
|
await cubit.loadNextPage();
|
||||||
|
expect(cubit.state.offers, hasLength(250));
|
||||||
|
await cubit.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('the in-memory list is capped and paging stops at the cap', () async {
|
||||||
|
final cubit = OffersCubit(PaginatingOfferTransport(600));
|
||||||
|
await cubit.discover('sp3');
|
||||||
|
await pumpEventQueue();
|
||||||
|
// Keep paging until the cubit says there is no more.
|
||||||
|
var guard = 0;
|
||||||
|
while (cubit.state.canLoadMore && guard++ < 20) {
|
||||||
|
await cubit.loadNextPage();
|
||||||
|
}
|
||||||
|
expect(cubit.state.offers, hasLength(OffersCubit.maxOffersKept));
|
||||||
|
expect(cubit.state.canLoadMore, isFalse);
|
||||||
|
await cubit.close();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('offers are de-duplicated across pages by (author, id)', () async {
|
||||||
|
// Two pages that overlap on the boundary id must not double it.
|
||||||
|
final cubit = OffersCubit(PaginatingOfferTransport(150));
|
||||||
|
await cubit.discover('sp3');
|
||||||
|
await pumpEventQueue();
|
||||||
|
await cubit.loadNextPage();
|
||||||
|
final ids = cubit.state.offers.map((o) => o.id).toList();
|
||||||
|
expect(ids.toSet(), hasLength(ids.length)); // no duplicates
|
||||||
|
expect(cubit.state.offers, hasLength(150));
|
||||||
|
await cubit.close();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
group('connection recovery (fresh-install fix)', () {
|
||||||
|
const seedHex =
|
||||||
|
'000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f';
|
||||||
|
|
||||||
|
late SocialService social;
|
||||||
|
late SocialSettings settings;
|
||||||
|
|
||||||
|
setUp(() async {
|
||||||
|
social = await SocialService.fromRootSeedHex(seedHex);
|
||||||
|
settings = SocialSettings(InMemorySecretStore());
|
||||||
|
});
|
||||||
|
|
||||||
|
SocialConnection makeConnection({
|
||||||
|
required bool Function() down,
|
||||||
|
Stream<bool>? online,
|
||||||
|
}) =>
|
||||||
|
SocialConnection(
|
||||||
|
social: social,
|
||||||
|
settings: settings,
|
||||||
|
online: online ?? const Stream.empty(),
|
||||||
|
retrySchedule: const [Duration(milliseconds: 5)],
|
||||||
|
open: (_) async {
|
||||||
|
if (down()) throw StateError('unreachable');
|
||||||
|
return SocialSession(_NoopChannel());
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
test('comes online by itself when the shared connection connects later',
|
||||||
|
() async {
|
||||||
|
var down = true;
|
||||||
|
final conn = makeConnection(down: () => down);
|
||||||
|
final cubit = await createOffersCubit(conn);
|
||||||
|
expect(cubit.isOnline, isFalse); // built while unreachable
|
||||||
|
|
||||||
|
final epochBefore = cubit.state.connectionEpoch;
|
||||||
|
conn.start();
|
||||||
|
down = false; // network path recovers; backoff retry reconnects
|
||||||
|
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||||
|
|
||||||
|
expect(cubit.isOnline, isTrue, reason: 'no manual Retry needed');
|
||||||
|
expect(cubit.state.connectionEpoch, greaterThan(epochBefore),
|
||||||
|
reason: 'a state was emitted so the UI re-reads isOnline');
|
||||||
|
|
||||||
|
await cubit.close();
|
||||||
|
await conn.dispose();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('re-runs the last discovery when the connection recovers', () async {
|
||||||
|
var down = true;
|
||||||
|
final conn = makeConnection(down: () => down);
|
||||||
|
final cubit = await createOffersCubit(conn);
|
||||||
|
|
||||||
|
await cubit.discover('sp3e9'); // offline → error, but the wish is kept
|
||||||
|
expect(cubit.state.error, 'offline');
|
||||||
|
|
||||||
|
conn.start();
|
||||||
|
down = false;
|
||||||
|
await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||||
|
|
||||||
|
expect(cubit.isOnline, isTrue);
|
||||||
|
expect(cubit.state.areaGeohash, 'sp3e9', reason: 'discovery re-ran');
|
||||||
|
expect(cubit.state.hasSearched, isTrue);
|
||||||
|
expect(cubit.state.error, isNull, reason: 'offline error cleared');
|
||||||
|
|
||||||
|
await cubit.close();
|
||||||
|
await conn.dispose();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('goes offline (and tells the UI) when the session drops', () async {
|
||||||
|
final online = StreamController<bool>.broadcast();
|
||||||
|
final conn = makeConnection(down: () => false, online: online.stream);
|
||||||
|
conn.start();
|
||||||
|
await pumpEventQueue();
|
||||||
|
final cubit = await createOffersCubit(conn);
|
||||||
|
expect(cubit.isOnline, isTrue);
|
||||||
|
|
||||||
|
final epochBefore = cubit.state.connectionEpoch;
|
||||||
|
online.add(false); // network lost
|
||||||
|
await pumpEventQueue();
|
||||||
|
|
||||||
|
expect(cubit.isOnline, isFalse);
|
||||||
|
expect(cubit.state.connectionEpoch, greaterThan(epochBefore));
|
||||||
|
|
||||||
|
await cubit.close();
|
||||||
|
await conn.dispose();
|
||||||
|
await online.close();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A no-op [NostrChannel]: just enough to build a [SocialSession] whose offer
|
||||||
|
/// transport answers with empty results.
|
||||||
|
class _NoopChannel implements NostrChannel {
|
||||||
|
@override
|
||||||
|
String get privateKeyHex => '00' * 32;
|
||||||
|
@override
|
||||||
|
String get publicKeyHex => 'ab' * 32;
|
||||||
|
@override
|
||||||
|
Future<({bool accepted, String message})> publish(Event event) async =>
|
||||||
|
(accepted: true, message: '');
|
||||||
|
@override
|
||||||
|
Stream<Event> subscribe(Filter filter) => const Stream.empty();
|
||||||
|
@override
|
||||||
|
Future<List<Event>> reqOnce(Filter filter) async => const [];
|
||||||
|
@override
|
||||||
|
Future<void> close() async {}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ import 'package:tane/db/database.dart';
|
||||||
import 'package:tane/i18n/strings.g.dart';
|
import 'package:tane/i18n/strings.g.dart';
|
||||||
import 'package:tane/security/secret_store.dart';
|
import 'package:tane/security/secret_store.dart';
|
||||||
import 'package:tane/services/onboarding_store.dart';
|
import 'package:tane/services/onboarding_store.dart';
|
||||||
|
import 'package:tane/services/sharing_switch.dart';
|
||||||
|
import 'package:tane/services/social_settings.dart';
|
||||||
import 'package:tane/app.dart' show materialLocaleFor;
|
import 'package:tane/app.dart' show materialLocaleFor;
|
||||||
import 'package:tane/state/inventory_cubit.dart';
|
import 'package:tane/state/inventory_cubit.dart';
|
||||||
import 'package:tane/state/variety_detail_cubit.dart';
|
import 'package:tane/state/variety_detail_cubit.dart';
|
||||||
|
|
@ -59,6 +61,14 @@ OnboardingStore newTestOnboardingStore({bool introSeen = true}) {
|
||||||
return OnboardingStore(store);
|
return OnboardingStore(store);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// A [SharingSwitch] over in-memory storage and no relay connection, for
|
||||||
|
/// screens that only care whether sharing is on. Defaults to on, which is what
|
||||||
|
/// most screen tests want (the social entries live, nothing dialled).
|
||||||
|
SharingSwitch newTestSharingSwitch({bool enabled = true}) => SharingSwitch(
|
||||||
|
settings: SocialSettings(InMemorySecretStore()),
|
||||||
|
enabled: enabled,
|
||||||
|
);
|
||||||
|
|
||||||
/// Wraps [child] with the providers a screen expects (repository, inventory
|
/// Wraps [child] with the providers a screen expects (repository, inventory
|
||||||
/// cubit) plus i18n and Material localizations, pinned to [locale].
|
/// cubit) plus i18n and Material localizations, pinned to [locale].
|
||||||
Widget wrapScreen({
|
Widget wrapScreen({
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,18 @@ import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:tane/app.dart';
|
import 'package:tane/app.dart';
|
||||||
import 'package:tane/i18n/strings.g.dart';
|
import 'package:tane/i18n/strings.g.dart';
|
||||||
|
import 'package:tane/services/sharing_switch.dart';
|
||||||
|
|
||||||
import '../support/test_support.dart';
|
import '../support/test_support.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
Widget app(db) => TranslationProvider(
|
/// The everyday case: the social layer exists and sharing is already on.
|
||||||
|
Widget app(db, {SharingSwitch? sharing}) => TranslationProvider(
|
||||||
child: TaneApp(
|
child: TaneApp(
|
||||||
repository: newTestRepository(db),
|
repository: newTestRepository(db),
|
||||||
species: newTestSpeciesRepository(db),
|
species: newTestSpeciesRepository(db),
|
||||||
onboarding: newTestOnboardingStore(),
|
onboarding: newTestOnboardingStore(),
|
||||||
|
sharing: sharing ?? newTestSharingSwitch(),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -24,7 +27,8 @@ void main() {
|
||||||
|
|
||||||
expect(find.text('Your inventory'), findsOneWidget);
|
expect(find.text('Your inventory'), findsOneWidget);
|
||||||
expect(find.text('Market'), findsOneWidget);
|
expect(find.text('Market'), findsOneWidget);
|
||||||
expect(find.text('COMING SOON'), findsOneWidget); // market is Block 2
|
// "Coming soon" is gone for good: everything on this screen is built.
|
||||||
|
expect(find.textContaining('COMING SOON'), findsNothing);
|
||||||
|
|
||||||
// Redesign copy: tagline + the two destination subtitles.
|
// Redesign copy: tagline + the two destination subtitles.
|
||||||
expect(find.text('Share and grow local seeds'), findsOneWidget);
|
expect(find.text('Share and grow local seeds'), findsOneWidget);
|
||||||
|
|
@ -49,8 +53,9 @@ void main() {
|
||||||
await tester.tap(find.byIcon(Icons.menu)); // hamburger
|
await tester.tap(find.byIcon(Icons.menu)); // hamburger
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
// Social destinations are shown but disabled.
|
// With sharing on, the social destinations are live.
|
||||||
expect(find.text('Your profile'), findsOneWidget);
|
expect(find.text('Your profile'), findsOneWidget);
|
||||||
|
expect(find.byIcon(Icons.lock_outline), findsNothing);
|
||||||
|
|
||||||
await tester.tap(find.text('Inventory')); // active drawer item
|
await tester.tap(find.text('Inventory')); // active drawer item
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|
@ -84,6 +89,62 @@ void main() {
|
||||||
await disposeTree(tester);
|
await disposeTree(tester);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testWidgets('sharing off: market stays open, the rest wears a padlock',
|
||||||
|
(tester) async {
|
||||||
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
||||||
|
final db = newTestDatabase();
|
||||||
|
addTearDown(db.close);
|
||||||
|
|
||||||
|
await tester.pumpWidget(
|
||||||
|
app(db, sharing: newTestSharingSwitch(enabled: false)),
|
||||||
|
);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
// The market card is the door into sharing, so it must stay reachable.
|
||||||
|
expect(find.byKey(const Key('home.market')), findsOneWidget);
|
||||||
|
|
||||||
|
await tester.tap(find.byIcon(Icons.menu));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
// Market live; the social entries are visible but padlocked — and tapping
|
||||||
|
// one invites the person in rather than doing nothing.
|
||||||
|
expect(find.text('Your profile'), findsOneWidget);
|
||||||
|
expect(find.byIcon(Icons.lock_outline), findsWidgets);
|
||||||
|
|
||||||
|
await tester.tap(find.text('Your profile'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(find.text('This wakes up when you start sharing'), findsOneWidget);
|
||||||
|
await disposeTree(tester);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('no social layer: the market and its friends are not drawn',
|
||||||
|
(tester) async {
|
||||||
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
||||||
|
final db = newTestDatabase();
|
||||||
|
addTearDown(db.close);
|
||||||
|
|
||||||
|
await tester.pumpWidget(
|
||||||
|
TranslationProvider(
|
||||||
|
child: TaneApp(
|
||||||
|
repository: newTestRepository(db),
|
||||||
|
species: newTestSpeciesRepository(db),
|
||||||
|
onboarding: newTestOnboardingStore(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
// Nothing here can be switched on, so it is hidden rather than teased.
|
||||||
|
expect(find.byKey(const Key('home.market')), findsNothing);
|
||||||
|
expect(find.text('Your inventory'), findsOneWidget);
|
||||||
|
|
||||||
|
await tester.tap(find.byIcon(Icons.menu));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(find.text('Your profile'), findsNothing);
|
||||||
|
expect(find.byIcon(Icons.lock_outline), findsNothing);
|
||||||
|
await disposeTree(tester);
|
||||||
|
});
|
||||||
|
|
||||||
testWidgets('drawer Settings opens the settings screen', (tester) async {
|
testWidgets('drawer Settings opens the settings screen', (tester) async {
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
45
apps/app_seeds/test/ui/inventory_list_lazy_test.dart
Normal file
45
apps/app_seeds/test/ui/inventory_list_lazy_test.dart
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:tane/ui/inventory_list_screen.dart';
|
||||||
|
|
||||||
|
import '../support/test_support.dart';
|
||||||
|
|
||||||
|
/// The inventory list must render lazily: with a large catalogue only the tiles
|
||||||
|
/// near the viewport are built, not one widget per row. Guards the regression
|
||||||
|
/// from `ListView(children: …)` (every tile built upfront) back in.
|
||||||
|
void main() {
|
||||||
|
testWidgets('builds only the on-screen tiles for a large inventory',
|
||||||
|
(tester) async {
|
||||||
|
final db = newTestDatabase();
|
||||||
|
final repo = newTestRepository(db);
|
||||||
|
// Enough rows that an eager list would build hundreds of tiles at once.
|
||||||
|
for (var i = 0; i < 300; i++) {
|
||||||
|
await repo.addQuickVariety(
|
||||||
|
label: 'Variety ${i.toString().padLeft(3, '0')}',
|
||||||
|
category: i.isEven ? 'Poaceae' : 'Fabaceae',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
await tester.pumpWidget(
|
||||||
|
wrapScreen(repository: repo, child: const InventoryListScreen()),
|
||||||
|
);
|
||||||
|
// Let the debounced inventory stream emit and the async load resolve
|
||||||
|
// (bounded pumps — the screen holds a live Drift stream, so pumpAndSettle
|
||||||
|
// would hang; see testing.md).
|
||||||
|
await tester.pump();
|
||||||
|
await tester.pump(const Duration(milliseconds: 400));
|
||||||
|
await tester.pump(const Duration(milliseconds: 100));
|
||||||
|
|
||||||
|
// Every variety tile is a ListTile; a lazy list builds only a viewport-worth.
|
||||||
|
final built = find.byType(ListTile).evaluate().length;
|
||||||
|
expect(built, greaterThan(0), reason: 'the list rendered some tiles');
|
||||||
|
expect(
|
||||||
|
built,
|
||||||
|
lessThan(50),
|
||||||
|
reason: 'lazy list should build ~a screenful, not all 300 ($built built)',
|
||||||
|
);
|
||||||
|
|
||||||
|
await disposeTree(tester);
|
||||||
|
await db.close();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -3,12 +3,17 @@ import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
import 'package:tane/i18n/strings.g.dart';
|
import 'package:tane/i18n/strings.g.dart';
|
||||||
import 'package:tane/services/onboarding_store.dart';
|
import 'package:tane/services/onboarding_store.dart';
|
||||||
|
import 'package:tane/services/sharing_switch.dart';
|
||||||
import 'package:tane/ui/market_gate.dart';
|
import 'package:tane/ui/market_gate.dart';
|
||||||
|
|
||||||
import '../support/test_support.dart';
|
import '../support/test_support.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
Widget host(OnboardingStore store, void Function(bool) onResult) =>
|
Widget host(
|
||||||
|
OnboardingStore store,
|
||||||
|
void Function(bool) onResult, {
|
||||||
|
SharingSwitch? sharing,
|
||||||
|
}) =>
|
||||||
TranslationProvider(
|
TranslationProvider(
|
||||||
child: MaterialApp(
|
child: MaterialApp(
|
||||||
localizationsDelegates: GlobalMaterialLocalizations.delegates,
|
localizationsDelegates: GlobalMaterialLocalizations.delegates,
|
||||||
|
|
@ -16,7 +21,13 @@ void main() {
|
||||||
builder: (context) => Center(
|
builder: (context) => Center(
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
onResult(await ensureMarketRulesAccepted(context, store));
|
onResult(
|
||||||
|
await ensureMarketRulesAccepted(
|
||||||
|
context,
|
||||||
|
store,
|
||||||
|
sharing: sharing,
|
||||||
|
),
|
||||||
|
);
|
||||||
},
|
},
|
||||||
child: const Text('enter'),
|
child: const Text('enter'),
|
||||||
),
|
),
|
||||||
|
|
@ -87,5 +98,52 @@ void main() {
|
||||||
expect(find.text('Treat people well — no spam, no abuse'), findsOneWidget);
|
expect(find.text('Treat people well — no spam, no abuse'), findsOneWidget);
|
||||||
expect(find.textContaining('public'), findsWidgets);
|
expect(find.textContaining('public'), findsWidgets);
|
||||||
expect(find.text('Privacy & rules'), findsOneWidget);
|
expect(find.text('Privacy & rules'), findsOneWidget);
|
||||||
|
// The sheet is also where Tane says it is about to go online for the first
|
||||||
|
// time — the reviewer's complaint was that this was never stated.
|
||||||
|
expect(find.textContaining('community servers'), findsOneWidget);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('agreeing is what turns sharing on', (tester) async {
|
||||||
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
||||||
|
final store = OnboardingStore(InMemorySecretStore());
|
||||||
|
final sharing = newTestSharingSwitch(enabled: false);
|
||||||
|
|
||||||
|
await tester.pumpWidget(host(store, (_) {}, sharing: sharing));
|
||||||
|
await tester.tap(find.text('enter'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(sharing.on.value, isFalse, reason: 'still offline while asking');
|
||||||
|
|
||||||
|
await tester.tap(find.text('I agree'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(sharing.on.value, isTrue);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('declining leaves the app offline', (tester) async {
|
||||||
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
||||||
|
final store = OnboardingStore(InMemorySecretStore());
|
||||||
|
final sharing = newTestSharingSwitch(enabled: false);
|
||||||
|
|
||||||
|
await tester.pumpWidget(host(store, (_) {}, sharing: sharing));
|
||||||
|
await tester.tap(find.text('enter'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.tap(find.text('Not now'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
expect(sharing.on.value, isFalse);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('someone who agreed long ago but switched sharing off is asked '
|
||||||
|
'nothing, yet comes back online', (tester) async {
|
||||||
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
||||||
|
final store = OnboardingStore(InMemorySecretStore());
|
||||||
|
await store.markMarketRulesAccepted();
|
||||||
|
final sharing = newTestSharingSwitch(enabled: false);
|
||||||
|
|
||||||
|
await tester.pumpWidget(host(store, (_) {}, sharing: sharing));
|
||||||
|
await tester.tap(find.text('enter'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
expect(find.text('Before you join the market'), findsNothing);
|
||||||
|
expect(sharing.on.value, isTrue);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,8 +84,9 @@ void main() {
|
||||||
findsOneWidget);
|
findsOneWidget);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('MarketScreen with no relays configured degrades to offline',
|
testWidgets(
|
||||||
(tester) async {
|
'a fresh install (no area, unreachable) asks for the area first, '
|
||||||
|
'not the connection', (tester) async {
|
||||||
final social = await SocialService.fromRootSeedHex('00' * 32);
|
final social = await SocialService.fromRootSeedHex('00' * 32);
|
||||||
final settings = SocialSettings(InMemorySecretStore());
|
final settings = SocialSettings(InMemorySecretStore());
|
||||||
await settings.setRelayUrls(const []); // offline: don't hit the network
|
await settings.setRelayUrls(const []); // offline: don't hit the network
|
||||||
|
|
@ -94,7 +95,23 @@ void main() {
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
expect(find.text('Seeds near you'), findsOneWidget); // app bar title
|
expect(find.text('Seeds near you'), findsOneWidget); // app bar title
|
||||||
expect(find.text('Retry'), findsOneWidget); // can't-reach state offers retry
|
// Setting a zone works offline and is the first step — the connection
|
||||||
|
// error must not bury it.
|
||||||
|
expect(find.text('Set your area'), findsOneWidget);
|
||||||
|
expect(find.text('Retry'), findsNothing);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('with an area set, unreachable servers degrade to retry',
|
||||||
|
(tester) async {
|
||||||
|
final social = await SocialService.fromRootSeedHex('00' * 32);
|
||||||
|
final settings = SocialSettings(InMemorySecretStore());
|
||||||
|
await settings.setRelayUrls(const []); // offline: don't hit the network
|
||||||
|
await settings.setAreaGeohash('ezsn9');
|
||||||
|
|
||||||
|
await tester.pumpWidget(_wrapMarket(social, settings));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
expect(find.text('Retry'), findsOneWidget);
|
||||||
});
|
});
|
||||||
|
|
||||||
testWidgets('the range selector persists the chosen search precision',
|
testWidgets('the range selector persists the chosen search precision',
|
||||||
|
|
@ -148,6 +165,36 @@ void main() {
|
||||||
expect(tester.widget<CheckboxListTile>(find.byKey(firstKey)).value, isTrue);
|
expect(tester.widget<CheckboxListTile>(find.byKey(firstKey)).value, isTrue);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testWidgets('the config sheet Save button stays above the system nav bar',
|
||||||
|
(tester) async {
|
||||||
|
// Edge-to-edge Android: a 50-logical-px gesture/nav bar at the bottom.
|
||||||
|
tester.view.padding = const FakeViewPadding(bottom: 150); // physical px
|
||||||
|
tester.view.viewPadding = const FakeViewPadding(bottom: 150);
|
||||||
|
addTearDown(tester.view.reset);
|
||||||
|
|
||||||
|
final social = await SocialService.fromRootSeedHex('00' * 32);
|
||||||
|
final settings = SocialSettings(InMemorySecretStore());
|
||||||
|
await settings.setRelayUrls(const []); // offline: don't hit the network
|
||||||
|
|
||||||
|
await tester.pumpWidget(_wrapMarket(social, settings));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.tap(find.byKey(const Key('market.config')));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
final save = find.byKey(const Key('market.save'));
|
||||||
|
await tester.ensureVisible(save);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
final screenHeight = tester.view.physicalSize.height /
|
||||||
|
tester.view.devicePixelRatio; // 600 on the default test surface
|
||||||
|
const navBarLogical = 150 / 3.0; // FakeViewPadding is physical px
|
||||||
|
expect(
|
||||||
|
tester.getRect(save).bottom,
|
||||||
|
lessThanOrEqualTo(screenHeight - navBarLogical + 0.1),
|
||||||
|
reason: 'Save must not sit under the system navigation bar',
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
testWidgets('"use my location" fills the area with a coarse geohash',
|
testWidgets('"use my location" fills the area with a coarse geohash',
|
||||||
(tester) async {
|
(tester) async {
|
||||||
final social = await SocialService.fromRootSeedHex('00' * 32);
|
final social = await SocialService.fromRootSeedHex('00' * 32);
|
||||||
|
|
|
||||||
92
apps/app_seeds/test/ui/sharing_invite_sheet_test.dart
Normal file
92
apps/app_seeds/test/ui/sharing_invite_sheet_test.dart
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
import 'package:tane/i18n/strings.g.dart';
|
||||||
|
import 'package:tane/services/onboarding_store.dart';
|
||||||
|
import 'package:tane/services/sharing_switch.dart';
|
||||||
|
import 'package:tane/ui/sharing_invite_sheet.dart';
|
||||||
|
|
||||||
|
import '../support/test_support.dart';
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
Widget host(OnboardingStore store, SharingSwitch sharing) =>
|
||||||
|
TranslationProvider(
|
||||||
|
child: MaterialApp(
|
||||||
|
localizationsDelegates: GlobalMaterialLocalizations.delegates,
|
||||||
|
home: Builder(
|
||||||
|
builder: (context) => Center(
|
||||||
|
child: ElevatedButton(
|
||||||
|
onPressed: () => showSharingInvite(
|
||||||
|
context,
|
||||||
|
onboarding: store,
|
||||||
|
sharing: sharing,
|
||||||
|
),
|
||||||
|
child: const Text('tap a locked entry'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
testWidgets('the invite says what lights up and that it needs a connection',
|
||||||
|
(tester) async {
|
||||||
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
||||||
|
await tester.pumpWidget(
|
||||||
|
TranslationProvider(
|
||||||
|
child: const MaterialApp(
|
||||||
|
localizationsDelegates: GlobalMaterialLocalizations.delegates,
|
||||||
|
home: Scaffold(body: SharingInviteSheet()),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
await tester.pump();
|
||||||
|
|
||||||
|
expect(find.text('This wakes up when you start sharing'), findsOneWidget);
|
||||||
|
expect(find.text('Write to whoever has seeds near you'), findsOneWidget);
|
||||||
|
expect(find.text('Keep the offers you like'), findsOneWidget);
|
||||||
|
expect(find.text('Your circle of people you trust'), findsOneWidget);
|
||||||
|
// The honest part: it is not free of consequences.
|
||||||
|
expect(find.textContaining('go online'), findsOneWidget);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('"Not now" leaves the app exactly as offline as it was',
|
||||||
|
(tester) async {
|
||||||
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
||||||
|
final store = OnboardingStore(InMemorySecretStore());
|
||||||
|
final sharing = newTestSharingSwitch(enabled: false);
|
||||||
|
|
||||||
|
await tester.pumpWidget(host(store, sharing));
|
||||||
|
await tester.tap(find.text('tap a locked entry'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
await tester.tap(find.byKey(const Key('sharingInvite.notNow')));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
expect(sharing.on.value, isFalse);
|
||||||
|
expect(await store.marketRulesAccepted(), isFalse);
|
||||||
|
});
|
||||||
|
|
||||||
|
testWidgets('accepting the invite goes through the community rules once',
|
||||||
|
(tester) async {
|
||||||
|
LocaleSettings.setLocaleSync(AppLocale.en);
|
||||||
|
final store = OnboardingStore(InMemorySecretStore());
|
||||||
|
final sharing = newTestSharingSwitch(enabled: false);
|
||||||
|
|
||||||
|
await tester.pumpWidget(host(store, sharing));
|
||||||
|
await tester.tap(find.text('tap a locked entry'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
await tester.tap(find.byKey(const Key('sharingInvite.start')));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
// Same single consent surface the market uses — not a second one.
|
||||||
|
expect(find.text('Before you join the market'), findsOneWidget);
|
||||||
|
expect(sharing.on.value, isFalse, reason: 'not online until they agree');
|
||||||
|
|
||||||
|
await tester.tap(find.text('I agree'));
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
expect(sharing.on.value, isTrue);
|
||||||
|
expect(await store.marketRulesAccepted(), isTrue);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -93,7 +93,7 @@ void main() {
|
||||||
wrapScreen(
|
wrapScreen(
|
||||||
repository: newTestRepository(db),
|
repository: newTestRepository(db),
|
||||||
locale: locale,
|
locale: locale,
|
||||||
child: const HomeScreen(marketEnabled: true),
|
child: HomeScreen(sharing: newTestSharingSwitch()),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
await disposeTree(tester);
|
await disposeTree(tester);
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ Estas fijan `schemaVersion = 1` y el arranque técnico:
|
||||||
|
|
||||||
- **Paquete legal + moderación mínima — DECIDIDO/IMPLEMENTADO (2026-07-13).** Se escribe la capa legal completa en [`docs/legal/`](../legal/README.md): política de privacidad, condiciones de uso, normas de la comunidad y aviso sobre legalidad de semillas (masters en inglés + espejo es), más docs internos de cumplimiento (Play Data Safety/UGC, notas Apple, memoria jurídica con calendario de revisión — el PRM europeo sigue en trílogos). Decisiones que fija: **(a)** consentimiento único **al entrar al mercado por primera vez** (hoja modal con las normas; el inventario local no pide nada — progressive disclosure), con la misma bandera guardando también publicar-oferta y primer DM; **(b)** **bloqueo local** de claves (keystore, sin migración de esquema): filtra ofertas, chats y DMs entrantes; **(c)** **denuncias estándar NIP-56** (kind 1984) publicadas a los relays + ocultación local; en `relay.comunes.org` (nuestro) se actúa sobre ellas — esa es la historia de "moderación con respuesta" para la revisión de Play; **(d)** se reafirma **cero comisiones** sobre semillas y **Ğ1 solo como etiqueta de precio** (sin flujos de pago in-app, precedente Damus/Apple); **(e)** borrado honesto: NIP-09 es best-effort y así se cuenta al usuario. Metadata de tienda en `fastlane/metadata/android/` (la reutiliza F-Droid).
|
- **Paquete legal + moderación mínima — DECIDIDO/IMPLEMENTADO (2026-07-13).** Se escribe la capa legal completa en [`docs/legal/`](../legal/README.md): política de privacidad, condiciones de uso, normas de la comunidad y aviso sobre legalidad de semillas (masters en inglés + espejo es), más docs internos de cumplimiento (Play Data Safety/UGC, notas Apple, memoria jurídica con calendario de revisión — el PRM europeo sigue en trílogos). Decisiones que fija: **(a)** consentimiento único **al entrar al mercado por primera vez** (hoja modal con las normas; el inventario local no pide nada — progressive disclosure), con la misma bandera guardando también publicar-oferta y primer DM; **(b)** **bloqueo local** de claves (keystore, sin migración de esquema): filtra ofertas, chats y DMs entrantes; **(c)** **denuncias estándar NIP-56** (kind 1984) publicadas a los relays + ocultación local; en `relay.comunes.org` (nuestro) se actúa sobre ellas — esa es la historia de "moderación con respuesta" para la revisión de Play; **(d)** se reafirma **cero comisiones** sobre semillas y **Ğ1 solo como etiqueta de precio** (sin flujos de pago in-app, precedente Damus/Apple); **(e)** borrado honesto: NIP-09 es best-effort y así se cuenta al usuario. Metadata de tienda en `fastlane/metadata/android/` (la reutiliza F-Droid).
|
||||||
|
|
||||||
|
- **Distribución en F-Droid — HECHO (2026-07-28).** Tane está publicada en el repo oficial de F-Droid (<https://f-droid.org/packages/org.comunes.tane/>, v0.1.16) **sin antifeatures**: la MR de inclusión ([43144](https://gitlab.com/fdroid/fdroiddata/-/merge_requests/43144)) se aceptó el 2026-07-25. Lo que lo desbloqueó: **(a)** build **reproducible y firmada por nosotros** (`AllowedAPKSigningKeys` + `binary:` por ABI ⇒ misma firma que Play, se puede cambiar de tienda sin reinstalar); **(b)** APK libre de Google (sin GMS) con splits por ABI; **(c)** **red opt-in** desde v0.1.16 — la app no abre ningún socket hasta que la persona activa compartir, lo que sostuvo el rechazo de `NonFreeNet`/`TetheredNet` (protocolo abierto, relays configurables). Consecuencia operativa: cada versión nueva solo requiere subir los `versionCode` por ABI en la receta de `fdroiddata`. → [release.md](../release.md)
|
||||||
|
|
||||||
## C) Puede esperar (no bloquea nada ahora)
|
## C) Puede esperar (no bloquea nada ahora)
|
||||||
|
|
||||||
- Negación plausible / bóveda señuelo; modo discreto. → security-privacy
|
- Negación plausible / bóveda señuelo; modo discreto. → security-privacy
|
||||||
|
|
|
||||||
|
|
@ -15,87 +15,135 @@ AutoName: Tane
|
||||||
RepoType: git
|
RepoType: git
|
||||||
Repo: https://git.comunes.org/comunes/tane.git
|
Repo: https://git.comunes.org/comunes/tane.git
|
||||||
|
|
||||||
# Reproducible, developer-signed builds: F-Droid rebuilds from source and, if the
|
|
||||||
# output matches our own signed APK on git.comunes.org byte-for-byte, publishes
|
|
||||||
# OUR APK. Same signature as the Google Play build, so users move between stores
|
|
||||||
# without reinstalling. The fingerprint below is the SHA-256 of the tane-upload
|
|
||||||
# signing certificate (public value); the keystore/passwords never leave CI.
|
|
||||||
AllowedAPKSigningKeys: ddfae432091b8248a8a4a1b353487fa626301f4357ef835e94ec312f69418e38
|
|
||||||
|
|
||||||
# One build entry per ABI: `flutter build --split-per-abi` yields smaller APKs and
|
|
||||||
# each split carries a distinct versionCode (gradle: versionCode*10 + {arm-v7a:1,
|
|
||||||
# arm64:2, x86_64:3}), so v0.1.2 (+4) -> 41/42/43. The `binary:` is the reference
|
|
||||||
# APK F-Droid verifies against, uploaded to the Forgejo release by
|
|
||||||
# .forgejo/workflows/release.yml on the `v*` tag.
|
|
||||||
Builds:
|
Builds:
|
||||||
- versionName: 0.1.3
|
- versionName: 0.1.16
|
||||||
versionCode: 51
|
versionCode: 181
|
||||||
commit: v0.1.3
|
commit: 954dc2caae10c373c4bdfcbd5dfb3d6c3906b598
|
||||||
subdir: apps/app_seeds
|
subdir: apps/app_seeds
|
||||||
sudo:
|
|
||||||
- apt-get update
|
|
||||||
- apt-get install -y git unzip xz-utils
|
|
||||||
- git clone --depth 1 -b 3.41.9 https://github.com/flutter/flutter.git /opt/flutter
|
|
||||||
- chown -R vagrant:vagrant /opt/flutter
|
|
||||||
output: build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
|
output: build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk
|
||||||
binary: https://git.comunes.org/comunes/tane/releases/download/v%v/app-armeabi-v7a-release.apk
|
binary:
|
||||||
|
https://git.comunes.org/comunes/tane/releases/download/v%v/app-armeabi-v7a-release.apk
|
||||||
|
srclibs:
|
||||||
|
- flutter@stable
|
||||||
|
- tesseract4android@4.9.0
|
||||||
prebuild:
|
prebuild:
|
||||||
- export PATH="/opt/flutter/bin:$PATH"
|
- export flutterVersion=$(sed -n -E 's,.*cirruslabs/flutter:([0-9.]+).*,\1,p'
|
||||||
- git config --global --add safe.directory /opt/flutter
|
../../.forgejo/workflows/release.yml | head -1)
|
||||||
- flutter config --no-analytics
|
- '[[ $flutterVersion ]]'
|
||||||
- flutter pub get
|
- git -C $$flutter$$ checkout -f $flutterVersion
|
||||||
- dart run slang
|
- cd ../..
|
||||||
- dart run build_runner build --delete-conflicting-outputs
|
- export PUB_CACHE=$(pwd)/.pub-cache
|
||||||
|
- $$flutter$$/bin/flutter config --no-analytics
|
||||||
|
- $$flutter$$/bin/flutter pub get --enforce-lockfile
|
||||||
|
- sed -i '/^buildscript {/,/^}/d' $PUB_CACHE/hosted/pub.dev/flutter_tesseract_ocr-*/android/build.gradle
|
||||||
|
- echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g" >> apps/app_seeds/android/gradle.properties
|
||||||
|
- echo "org.gradle.daemon=false" >> apps/app_seeds/android/gradle.properties
|
||||||
|
- cd apps/app_seeds
|
||||||
|
- $$flutter$$/bin/dart run slang
|
||||||
|
- $$flutter$$/bin/dart run build_runner build --delete-conflicting-outputs
|
||||||
|
scandelete:
|
||||||
|
- .pub-cache
|
||||||
build:
|
build:
|
||||||
- export PATH="/opt/flutter/bin:$PATH"
|
- export PUB_CACHE=$(cd ../.. && pwd)/.pub-cache
|
||||||
- flutter build apk --release --split-per-abi --target-platform=android-arm
|
- pushd $$tesseract4android$$/tesseract4android
|
||||||
|
- gradle --no-daemon assembleStandardRelease
|
||||||
|
- popd
|
||||||
|
- cp
|
||||||
|
$$tesseract4android$$/tesseract4android/build/outputs/aar/tesseract4android-standard-release.aar
|
||||||
|
$PUB_CACHE/hosted/pub.dev/flutter_tesseract_ocr-0.4.31/android/libs/tesseract4android-release.aar
|
||||||
|
- $$flutter$$/bin/flutter build apk --release --split-per-abi --target-platform=android-arm
|
||||||
|
|
||||||
- versionName: 0.1.3
|
- versionName: 0.1.16
|
||||||
versionCode: 52
|
versionCode: 182
|
||||||
commit: v0.1.3
|
commit: 954dc2caae10c373c4bdfcbd5dfb3d6c3906b598
|
||||||
subdir: apps/app_seeds
|
subdir: apps/app_seeds
|
||||||
sudo:
|
|
||||||
- apt-get update
|
|
||||||
- apt-get install -y git unzip xz-utils
|
|
||||||
- git clone --depth 1 -b 3.41.9 https://github.com/flutter/flutter.git /opt/flutter
|
|
||||||
- chown -R vagrant:vagrant /opt/flutter
|
|
||||||
output: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
|
output: build/app/outputs/flutter-apk/app-arm64-v8a-release.apk
|
||||||
binary: https://git.comunes.org/comunes/tane/releases/download/v%v/app-arm64-v8a-release.apk
|
binary:
|
||||||
|
https://git.comunes.org/comunes/tane/releases/download/v%v/app-arm64-v8a-release.apk
|
||||||
|
srclibs:
|
||||||
|
- flutter@stable
|
||||||
|
- tesseract4android@4.9.0
|
||||||
prebuild:
|
prebuild:
|
||||||
- export PATH="/opt/flutter/bin:$PATH"
|
- export flutterVersion=$(sed -n -E 's,.*cirruslabs/flutter:([0-9.]+).*,\1,p'
|
||||||
- git config --global --add safe.directory /opt/flutter
|
../../.forgejo/workflows/release.yml | head -1)
|
||||||
- flutter config --no-analytics
|
- '[[ $flutterVersion ]]'
|
||||||
- flutter pub get
|
- git -C $$flutter$$ checkout -f $flutterVersion
|
||||||
- dart run slang
|
- cd ../..
|
||||||
- dart run build_runner build --delete-conflicting-outputs
|
- export PUB_CACHE=$(pwd)/.pub-cache
|
||||||
|
- $$flutter$$/bin/flutter config --no-analytics
|
||||||
|
- $$flutter$$/bin/flutter pub get --enforce-lockfile
|
||||||
|
- sed -i '/^buildscript {/,/^}/d' $PUB_CACHE/hosted/pub.dev/flutter_tesseract_ocr-*/android/build.gradle
|
||||||
|
- echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g" >> apps/app_seeds/android/gradle.properties
|
||||||
|
- echo "org.gradle.daemon=false" >> apps/app_seeds/android/gradle.properties
|
||||||
|
- cd apps/app_seeds
|
||||||
|
- $$flutter$$/bin/dart run slang
|
||||||
|
- $$flutter$$/bin/dart run build_runner build --delete-conflicting-outputs
|
||||||
|
scandelete:
|
||||||
|
- .pub-cache
|
||||||
build:
|
build:
|
||||||
- export PATH="/opt/flutter/bin:$PATH"
|
- export PUB_CACHE=$(cd ../.. && pwd)/.pub-cache
|
||||||
- flutter build apk --release --split-per-abi --target-platform=android-arm64
|
- pushd $$tesseract4android$$/tesseract4android
|
||||||
|
- gradle --no-daemon assembleStandardRelease
|
||||||
|
- popd
|
||||||
|
- cp
|
||||||
|
$$tesseract4android$$/tesseract4android/build/outputs/aar/tesseract4android-standard-release.aar
|
||||||
|
$PUB_CACHE/hosted/pub.dev/flutter_tesseract_ocr-0.4.31/android/libs/tesseract4android-release.aar
|
||||||
|
- $$flutter$$/bin/flutter build apk --release --split-per-abi --target-platform=android-arm64
|
||||||
|
|
||||||
- versionName: 0.1.3
|
- versionName: 0.1.16
|
||||||
versionCode: 53
|
versionCode: 183
|
||||||
commit: v0.1.3
|
commit: 954dc2caae10c373c4bdfcbd5dfb3d6c3906b598
|
||||||
subdir: apps/app_seeds
|
subdir: apps/app_seeds
|
||||||
sudo:
|
|
||||||
- apt-get update
|
|
||||||
- apt-get install -y git unzip xz-utils
|
|
||||||
- git clone --depth 1 -b 3.41.9 https://github.com/flutter/flutter.git /opt/flutter
|
|
||||||
- chown -R vagrant:vagrant /opt/flutter
|
|
||||||
output: build/app/outputs/flutter-apk/app-x86_64-release.apk
|
output: build/app/outputs/flutter-apk/app-x86_64-release.apk
|
||||||
binary: https://git.comunes.org/comunes/tane/releases/download/v%v/app-x86_64-release.apk
|
binary:
|
||||||
|
https://git.comunes.org/comunes/tane/releases/download/v%v/app-x86_64-release.apk
|
||||||
|
srclibs:
|
||||||
|
- flutter@stable
|
||||||
|
- tesseract4android@4.9.0
|
||||||
prebuild:
|
prebuild:
|
||||||
- export PATH="/opt/flutter/bin:$PATH"
|
- export flutterVersion=$(sed -n -E 's,.*cirruslabs/flutter:([0-9.]+).*,\1,p'
|
||||||
- git config --global --add safe.directory /opt/flutter
|
../../.forgejo/workflows/release.yml | head -1)
|
||||||
- flutter config --no-analytics
|
- '[[ $flutterVersion ]]'
|
||||||
- flutter pub get
|
- git -C $$flutter$$ checkout -f $flutterVersion
|
||||||
- dart run slang
|
- cd ../..
|
||||||
- dart run build_runner build --delete-conflicting-outputs
|
- export PUB_CACHE=$(pwd)/.pub-cache
|
||||||
|
- $$flutter$$/bin/flutter config --no-analytics
|
||||||
|
- $$flutter$$/bin/flutter pub get --enforce-lockfile
|
||||||
|
- sed -i '/^buildscript {/,/^}/d' $PUB_CACHE/hosted/pub.dev/flutter_tesseract_ocr-*/android/build.gradle
|
||||||
|
- echo "org.gradle.jvmargs=-Xmx4g -XX:MaxMetaspaceSize=1g" >> apps/app_seeds/android/gradle.properties
|
||||||
|
- echo "org.gradle.daemon=false" >> apps/app_seeds/android/gradle.properties
|
||||||
|
- cd apps/app_seeds
|
||||||
|
- $$flutter$$/bin/dart run slang
|
||||||
|
- $$flutter$$/bin/dart run build_runner build --delete-conflicting-outputs
|
||||||
|
scandelete:
|
||||||
|
- .pub-cache
|
||||||
build:
|
build:
|
||||||
- export PATH="/opt/flutter/bin:$PATH"
|
- export PUB_CACHE=$(cd ../.. && pwd)/.pub-cache
|
||||||
- flutter build apk --release --split-per-abi --target-platform=android-x64
|
- pushd $$tesseract4android$$/tesseract4android
|
||||||
|
- gradle --no-daemon assembleStandardRelease
|
||||||
|
- popd
|
||||||
|
- cp
|
||||||
|
$$tesseract4android$$/tesseract4android/build/outputs/aar/tesseract4android-standard-release.aar
|
||||||
|
$PUB_CACHE/hosted/pub.dev/flutter_tesseract_ocr-0.4.31/android/libs/tesseract4android-release.aar
|
||||||
|
- $$flutter$$/bin/flutter build apk --release --split-per-abi --target-platform=android-x64
|
||||||
|
|
||||||
|
# Reproducible, developer-signed: F-Droid rebuilds each split and, if it matches
|
||||||
|
# our own signed APK on the git.comunes.org release byte-for-byte, publishes OUR
|
||||||
|
# APK (same signature as the Play build). Value is the SHA-256 of the tane-upload
|
||||||
|
# signing certificate (public).
|
||||||
|
# Note: `commit:` must be a full commit hash (not a tag) per F-Droid review, so
|
||||||
|
# it can only be filled in once the tag exists; it is synced here and in the
|
||||||
|
# fdroiddata fork right after tagging, before the fork's pipeline runs.
|
||||||
|
# 954dc2caae10c373c4bdfcbd5dfb3d6c3906b598 is the commit tag v0.1.16 points to.
|
||||||
|
AllowedAPKSigningKeys: ddfae432091b8248a8a4a1b353487fa626301f4357ef835e94ec312f69418e38
|
||||||
|
|
||||||
AutoUpdateMode: Version
|
AutoUpdateMode: Version
|
||||||
UpdateCheckMode: Tags v[\d.]+
|
UpdateCheckMode: Tags v[\d.]+
|
||||||
UpdateCheckData: apps/app_seeds/pubspec.yaml|version:\s*[\d.]+\+(\d+)|apps/app_seeds/pubspec.yaml|version:\s*([\d.]+)\+
|
VercodeOperation:
|
||||||
CurrentVersion: 0.1.3
|
- '%c * 10 + 1'
|
||||||
CurrentVersionCode: 53
|
- '%c * 10 + 2'
|
||||||
|
- '%c * 10 + 3'
|
||||||
|
UpdateCheckData:
|
||||||
|
apps/app_seeds/pubspec.yaml|version:\s*[\d.]+\+(\d+)|apps/app_seeds/pubspec.yaml|version:\s*([\d.]+)\+
|
||||||
|
CurrentVersion: 0.1.16
|
||||||
|
CurrentVersionCode: 183
|
||||||
|
|
|
||||||
69
docs/legal/pt/aviso-sobre-sementes.md
Normal file
69
docs/legal/pt/aviso-sobre-sementes.md
Normal file
|
|
@ -0,0 +1,69 @@
|
||||||
|
# Tane — Aviso sobre a Legalidade de Trocar Sementes e Mudas
|
||||||
|
|
||||||
|
**Versão 1.0 — 13 de julho de 2026**
|
||||||
|
|
||||||
|
O Tane ajuda pessoas a guardar e partilhar sementes e mudas tradicionais. As leis sobre sementes
|
||||||
|
diferem muito entre países, e distinguem claramente entre **dar ou
|
||||||
|
trocar** e **vender**. Este aviso é informação geral, não aconselhamento jurídico; tu
|
||||||
|
és responsável por cumprir a lei onde vives e para onde vão as tuas sementes ou plantas.
|
||||||
|
|
||||||
|
## Oferecer e trocar entre amadores
|
||||||
|
|
||||||
|
Trocar sementes **sem fins comerciais** — ofertas, trocas, bancos de sementes comunitários,
|
||||||
|
redes de conservação — é amplamente reconhecido e legal na maioria dos lugares:
|
||||||
|
|
||||||
|
- **União Europeia.** A legislação da UE sobre comercialização de sementes regula a *comercialização*
|
||||||
|
de sementes. A troca em espécie entre particulares, e o trabalho de redes de conservação e
|
||||||
|
bancos de germoplasma, ficam fora ou estão expressamente isentos; a reforma do material
|
||||||
|
de reprodução vegetal em curso (proposta COM(2023) 414) mantém isenções para amadores e redes
|
||||||
|
de conservação, desde que a atividade não seja comercial.
|
||||||
|
- **Espanha.** A Ley 30/2006 regula o comércio *comercial* de sementes; a troca não comercial
|
||||||
|
entre amadores e a troca orientada para a conservação são prática reconhecida (art. 24).
|
||||||
|
- **Estados Unidos.** Após a alteração de 2016 à Recommended Uniform State Seed
|
||||||
|
Law, a maioria dos estados isenta a **partilha não comercial de sementes** (bancos de sementes comunitários, trocas) dos
|
||||||
|
requisitos comerciais de rotulagem e ensaio.
|
||||||
|
|
||||||
|
## Vender sementes
|
||||||
|
|
||||||
|
Vender é diferente. Na UE e em muitas outras jurisdições, **comercializar semente de
|
||||||
|
variedades não registadas num catálogo oficial pode estar restringido ou proibido**,
|
||||||
|
e as quantidades, rotulagem ou espécies podem ser reguladas mesmo para pequenos vendedores.
|
||||||
|
Existem isenções para variedades de conservação e quantidades de amador, mas variam. Se
|
||||||
|
usares a opção do Tane para pedir um preço, **verifica primeiro as regras do teu país** — a app não
|
||||||
|
o pode fazer por ti.
|
||||||
|
|
||||||
|
## Variedades protegidas
|
||||||
|
|
||||||
|
Variedades cobertas por **direitos de obtentor (DOV) ou patentes** não podem ser
|
||||||
|
propagadas ou vendidas sem autorização do titular — isto pode aplicar-se mesmo a semente
|
||||||
|
que compraste legalmente. As variedades tradicionais e antigas geralmente não são protegidas,
|
||||||
|
mas as variedades comerciais modernas normalmente são. Em caso de dúvida, não a ofereças.
|
||||||
|
|
||||||
|
## Enviar sementes através de fronteiras
|
||||||
|
|
||||||
|
A maioria dos países restringe a importação de sementes: aplicam-se frequentemente **certificados
|
||||||
|
fitossanitários**, listas de espécies proibidas e regras de quarentena — mesmo a pequenos envelopes entre
|
||||||
|
particulares, e também **dentro** da UE para certas espécies (regras de passaporte fitossanitário).
|
||||||
|
Antes de enviares sementes para outro país, verifica as regras do país de destino.
|
||||||
|
As trocas mais seguras são as locais — que é para isso que o Tane foi desenhado.
|
||||||
|
|
||||||
|
## Mudas e plantas vivas
|
||||||
|
|
||||||
|
Os mesmos princípios aplicam-se a mudas, estacas, bolbos e outro material vegetal vivo —
|
||||||
|
mas as plantas vivas costumam ser reguladas **de forma mais estrita** do que a semente. Regras
|
||||||
|
fitossanitárias, requisitos de passaporte fitossanitário dentro da UE, e quarentena na
|
||||||
|
importação aplicam-se frequentemente a plantas vivas mesmo quando a semente equivalente está isenta. Mantém
|
||||||
|
as trocas de mudas locais, e verifica as regras fitossanitárias antes de deslocares plantas vivas
|
||||||
|
entre regiões ou através de fronteiras.
|
||||||
|
|
||||||
|
## Espécies invasoras e protegidas
|
||||||
|
|
||||||
|
Algumas espécies podem não poder ser trocadas de todo em certas regiões, seja porque são
|
||||||
|
**invasoras** ali, seja porque são **protegidas**. As listas são regionais; verifica a tua.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*O Tane não cobra comissão, não intermedeia nenhuma transação, e não verifica nenhuma oferta: as trocas
|
||||||
|
são negócios privados entre as pessoas envolvidas (ver os
|
||||||
|
[Termos de uso](terms-of-use.md)). Este aviso existe para que esses negócios sejam
|
||||||
|
informados.*
|
||||||
42
docs/legal/pt/normas-da-comunidade.md
Normal file
42
docs/legal/pt/normas-da-comunidade.md
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
# Tane — Regras da Comunidade
|
||||||
|
|
||||||
|
**Versão 1.0 — 13 de julho de 2026**
|
||||||
|
|
||||||
|
O mercado e as mensagens no Tane são espaços partilhados construídos sobre a confiança entre vizinhos.
|
||||||
|
Estas regras são o que todos aceitam antes de participar. Também definem o que conta como
|
||||||
|
conteúdo que pode ser denunciado e removido dos servidores que operamos.
|
||||||
|
|
||||||
|
## As regras
|
||||||
|
|
||||||
|
1. **Sê honesto sobre as tuas sementes.** Descreve o que realmente tens: a variedade tal como a
|
||||||
|
conheces, o ano de colheita, tudo o que for relevante sobre como foi cultivada. Não inventes
|
||||||
|
proveniência.
|
||||||
|
2. **Partilha apenas o que podes partilhar.** Não ofereças:
|
||||||
|
- semente de **variedades protegidas comercialmente** (direitos de obtentor, patentes)
|
||||||
|
a não ser que estejas autorizado;
|
||||||
|
- **espécies invasoras ou protegidas** onde a sua troca esteja proibida;
|
||||||
|
- qualquer outra coisa que seja ilegal partilhar ou vender onde tu ou o destinatário vivem.
|
||||||
|
3. **Sementes e mudas, nada mais.** O mercado é para sementes, mudas e outro
|
||||||
|
material de reprodução vegetal (estacas, bolbos, tubérculos) no espírito da app.
|
||||||
|
Não é um quadro de classificados geral.
|
||||||
|
4. **Respeita as pessoas.** Sem assédio, ameaças, ódio ou discriminação — em ofertas,
|
||||||
|
perfis, avaliações ou mensagens.
|
||||||
|
5. **Sem spam nem burlas.** Sem publicações repetidas, ofertas enganosas, phishing, ou
|
||||||
|
pressão para levar as pessoas a negócios duvidosos.
|
||||||
|
6. **Reputação honesta.** Avaliza apenas pessoas com quem te encontraste ou trocaste
|
||||||
|
realmente; avalia apenas experiências reais. Não manipules o sistema de confiança.
|
||||||
|
|
||||||
|
## O que acontece se alguém as quebrar
|
||||||
|
|
||||||
|
- Qualquer pessoa te pode **bloquear** — as tuas ofertas e mensagens desaparecem para ela.
|
||||||
|
- Qualquer pessoa pode **denunciar** uma oferta ou uma pessoa. As denúncias viajam para os servidores que transportam
|
||||||
|
o conteúdo; no relé operado pela Comunes (`relay.comunes.org`), conteúdo e chaves
|
||||||
|
que quebrem estas regras são removidos. Outros servidores aplicam as suas próprias políticas.
|
||||||
|
- Não há recursos nem suspensões de conta porque não há contas: a
|
||||||
|
rede simplesmente deixa de transportar e mostrar o que quebra as regras.
|
||||||
|
|
||||||
|
## Uma nota sobre boa-fé
|
||||||
|
|
||||||
|
A maior parte da partilha de sementes é entre amadores, em pequenas quantidades, pelo prazer de manter
|
||||||
|
variedades vivas. Em caso de dúvida, prefere **oferecer e trocar** em vez de vender, identifica
|
||||||
|
as coisas claramente, e pergunta. É assim que sempre se fez.
|
||||||
89
docs/legal/pt/politica-de-privacidade.md
Normal file
89
docs/legal/pt/politica-de-privacidade.md
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
# Tane — Política de Privacidade
|
||||||
|
|
||||||
|
**Versão 1.0 — 13 de julho de 2026**
|
||||||
|
|
||||||
|
O Tane é publicado pela **Asociación Comunes** (Espanha) — <https://comunes.org> —
|
||||||
|
contacto: <info@comunes.org>. O Tane é software livre (AGPL-3.0); o seu código-fonte é
|
||||||
|
público, por isso tudo o que aqui se descreve pode ser verificado.
|
||||||
|
|
||||||
|
## A versão curta
|
||||||
|
|
||||||
|
- O Tane funciona **sem conta**. Não sabemos quem és.
|
||||||
|
- Tudo o que registas fica **no teu aparelho, cifrado**. Não temos servidores que
|
||||||
|
o recebam, e não temos forma de o ler.
|
||||||
|
- Nada sai do teu aparelho a não ser que **tu** decidas partilhá-lo (uma oferta, uma
|
||||||
|
mensagem, o teu perfil). O que partilhas viaja por servidores geridos pela comunidade, que não controlamos.
|
||||||
|
- **Sem análises, sem publicidade, sem rastreadores.** O Tane não recolhe nada sobre ti.
|
||||||
|
|
||||||
|
## 1. Sem contas, sem recolha por nossa parte
|
||||||
|
|
||||||
|
O Tane não pede o teu nome, e-mail ou número de telefone. Não há registo nem
|
||||||
|
nenhum servidor central do Tane. A tua identidade na app é uma chave criptográfica criada no teu
|
||||||
|
aparelho e guardada no cofre seguro do sistema do teu aparelho. A Asociación Comunes não recolhe,
|
||||||
|
recebe nem processa os teus dados pessoais através da app.
|
||||||
|
|
||||||
|
## 2. Dados guardados no teu aparelho
|
||||||
|
|
||||||
|
O teu inventário de sementes (variedades, quantidades, notas, fotos), as tuas mensagens, os
|
||||||
|
avales e avaliações dos teus contactos, e as tuas chaves ficam guardados **apenas no teu aparelho**, numa
|
||||||
|
base de dados cifrada (SQLCipher). A chave de cifra vive no cofre seguro do sistema do teu
|
||||||
|
aparelho. As cópias de segurança que crias também são cifradas; escolhes onde as guardar, e
|
||||||
|
nunca passam por nós.
|
||||||
|
|
||||||
|
## 3. Dados que saem do teu aparelho — só quando escolheres
|
||||||
|
|
||||||
|
Nada é publicado automaticamente. Cada uma destas ações só acontece por tua ação explícita:
|
||||||
|
|
||||||
|
- **Ofertas.** Quando ofereces sementes ou mudas, a app publica o título da oferta, a descrição,
|
||||||
|
a foto opcional, o preço opcional, e uma **zona aproximada** (uma área de cerca de 2–80 km,
|
||||||
|
como a configurares — nunca a tua morada ou localização precisa). As ofertas são públicas.
|
||||||
|
- **Perfil.** Se o preencheres, o teu nome escolhido, biografia e avatar são públicos.
|
||||||
|
- **Mensagens.** As mensagens diretas são **cifradas de ponta a ponta**: só tu e a pessoa
|
||||||
|
a quem escreves as podem ler. Os servidores que as transportam só veem envelopes cifrados.
|
||||||
|
- **Avales e avaliações.** Se avalizares ou avaliares alguém, essa declaração é pública
|
||||||
|
e assinada pela tua chave.
|
||||||
|
- **Sincronização entre os teus aparelhos.** Se ligares um segundo aparelho, os teus dados viajam entre
|
||||||
|
eles cifrados, para que só os teus aparelhos os possam ler.
|
||||||
|
|
||||||
|
## 4. Para onde vão os dados partilhados: relés da comunidade
|
||||||
|
|
||||||
|
As funcionalidades sociais do Tane usam servidores abertos, geridos pela comunidade ("relés"). Por predefinição a app
|
||||||
|
usa um pequeno conjunto que inclui `relay.comunes.org` (operado pela Asociación Comunes) e
|
||||||
|
relés públicos bem conhecidos; podes alterar esta lista, ou esvaziá-la para desligar a rede
|
||||||
|
completamente. Os relés diferentes de `relay.comunes.org` são **infraestrutura de terceiros**:
|
||||||
|
os seus operadores decidem as suas próprias políticas de retenção, e esta política não os cobre.
|
||||||
|
|
||||||
|
## 5. Eliminação — uma nota honesta
|
||||||
|
|
||||||
|
Podes eliminar qualquer coisa local instantaneamente, e podes retirar uma oferta a qualquer momento.
|
||||||
|
Quando retiras ou eliminas algo que tinhas publicado, a app pede aos relés que o
|
||||||
|
eliminem também. Relés que não operamos podem manter cópias apesar desse pedido, e publicações
|
||||||
|
públicas podem ter sido copiadas para outro lado enquanto estavam visíveis. **Trata tudo o que
|
||||||
|
publicares como potencialmente permanente.** No `relay.comunes.org` respeitamos os pedidos de eliminação.
|
||||||
|
|
||||||
|
## 6. Permissões do aparelho
|
||||||
|
|
||||||
|
- **Fotos / câmara** — só quando anexas uma imagem a uma variedade, oferta ou perfil.
|
||||||
|
- **Localização aproximada** (opcional) — só se usares "definir a minha zona a partir de onde estou",
|
||||||
|
para escolher a tua zona de partilha aproximada. O Tane nunca pede localização precisa.
|
||||||
|
- **Notificações** (opcional) — para te avisar sobre novas mensagens.
|
||||||
|
|
||||||
|
## 7. Os teus direitos
|
||||||
|
|
||||||
|
Como os teus dados vivem no teu aparelho sob o teu controlo, exerces a maioria dos direitos
|
||||||
|
tu mesmo: ler, corrigir, exportar ou eliminar tudo dentro da app. Para dados no
|
||||||
|
`relay.comunes.org`, ou qualquer questão sobre esta política, escreve para <info@comunes.org>.
|
||||||
|
Se estiveres na UE, tens também o direito de apresentar reclamação junto da tua autoridade de
|
||||||
|
proteção de dados (em Espanha, a AEPD).
|
||||||
|
|
||||||
|
## 8. Crianças
|
||||||
|
|
||||||
|
O inventário de sementes pode ser usado por qualquer pessoa. As funcionalidades de mercado e mensagens não
|
||||||
|
são dirigidas a crianças; ao usá-las confirmas que tens idade suficiente para usar funcionalidades sociais
|
||||||
|
segundo as leis do teu país.
|
||||||
|
|
||||||
|
## 9. Alterações
|
||||||
|
|
||||||
|
Atualizaremos esta política se o comportamento do Tane mudar, e assinalaremos as alterações nas
|
||||||
|
notas de lançamento da app. A versão atual vive sempre em
|
||||||
|
<https://tane.comunes.org/legal/privacy>, com o histórico no repositório público.
|
||||||
75
docs/legal/pt/termos-de-uso.md
Normal file
75
docs/legal/pt/termos-de-uso.md
Normal file
|
|
@ -0,0 +1,75 @@
|
||||||
|
# Tane — Termos de Uso
|
||||||
|
|
||||||
|
**Versão 1.0 — 13 de julho de 2026**
|
||||||
|
|
||||||
|
Estes termos cobrem o uso da aplicação Tane, publicada pela **Asociación Comunes**
|
||||||
|
(Espanha) — <https://comunes.org>, contacto <info@comunes.org>. Ao usares as funcionalidades de partilha
|
||||||
|
do Tane (o mercado e as mensagens) aceitas estes termos e as
|
||||||
|
[Regras da comunidade](community-rules.md).
|
||||||
|
|
||||||
|
## 1. O que o Tane é — e o que não é
|
||||||
|
|
||||||
|
O Tane é uma **ferramenta pessoal**: um inventário de sementes que vive no teu aparelho, mais uma forma de
|
||||||
|
descobrir pessoas perto de ti que partilham sementes e mudas. O Tane **não é operador de mercado, não é
|
||||||
|
loja, e não é parte em nenhuma troca**:
|
||||||
|
|
||||||
|
- Não hospedamos anúncios — as ofertas são publicadas por ti, sob a tua própria chave, para
|
||||||
|
relés geridos pela comunidade.
|
||||||
|
- Não cobramos **nenhuma comissão** e não processamos pagamentos. Qualquer troca, oferta ou venda é
|
||||||
|
combinada e realizada diretamente entre as pessoas envolvidas.
|
||||||
|
- Não verificamos sementes, utilizadores nem ofertas, e não podemos remover conteúdo de servidores
|
||||||
|
que não operamos.
|
||||||
|
|
||||||
|
## 2. As tuas responsabilidades
|
||||||
|
|
||||||
|
Tu és o único responsável por:
|
||||||
|
|
||||||
|
- **O que ofereces e trocas.** Certifica-te de que tens permissão para partilhar ou vender as
|
||||||
|
sementes que anuncias. As regras diferem por país — ver o
|
||||||
|
[Aviso sobre legalidade das sementes](seed-legality-notice.md). Em particular, vender semente de
|
||||||
|
variedades não registadas pode estar restringido onde vives, e propagar
|
||||||
|
variedades protegidas comercialmente sem autorização é ilegal na maioria dos países.
|
||||||
|
- **O envio.** Enviar sementes através de fronteiras é frequentemente restringido (regras fitossanitárias).
|
||||||
|
Verifica antes de enviares qualquer coisa para o estrangeiro.
|
||||||
|
- **O que publicas.** As ofertas, o teu perfil, avales e avaliações são públicos e
|
||||||
|
assinados por ti. Segue as [Regras da comunidade](community-rules.md).
|
||||||
|
- **As tuas chaves e cópias de segurança.** Não há recuperação de conta: se perderes o teu aparelho e
|
||||||
|
o teu código de recuperação, não podemos restaurar nada.
|
||||||
|
|
||||||
|
## 3. Sem garantias
|
||||||
|
|
||||||
|
O Tane é fornecido **"tal como está"**, sem garantia de nenhum tipo, como software livre sob a
|
||||||
|
[licença AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.html). Em particular, ninguém —
|
||||||
|
nem a Comunes, nem as pessoas com quem trocas através da app — garante a
|
||||||
|
**identidade, pureza, germinação, saúde ou legalidade** de nenhuma semente ou planta trocada. A
|
||||||
|
informação de cultivo mostrada na app (calendários, dicas de guardar semente, estimativas de viabilidade) é
|
||||||
|
orientação geral, não aconselhamento profissional.
|
||||||
|
|
||||||
|
## 4. Litígios entre utilizadores
|
||||||
|
|
||||||
|
As trocas são negócios privados entre as pessoas envolvidas. A Comunes não é mediadora
|
||||||
|
e não aceita responsabilidade por trocas falhadas, disputas de qualidade ou perdas delas
|
||||||
|
resultantes. As funcionalidades de aval e avaliação existem para que as comunidades possam construir a sua própria confiança.
|
||||||
|
|
||||||
|
## 5. Moderação
|
||||||
|
|
||||||
|
Não há moderação central: a tua app filtra o que vês através das pessoas em quem
|
||||||
|
confias, e podes **bloquear** qualquer pessoa e **denunciar** ofertas ou pessoas dentro da
|
||||||
|
app. As denúncias são partilhadas com os servidores envolvidos; no relé que operamos
|
||||||
|
(`relay.comunes.org`), o conteúdo que quebra as regras da comunidade é removido. Relés geridos
|
||||||
|
por outros aplicam as suas próprias políticas.
|
||||||
|
|
||||||
|
## 6. Responsabilidade
|
||||||
|
|
||||||
|
Na medida máxima permitida por lei, a responsabilidade total da Asociación Comunes decorrente
|
||||||
|
da app está limitada ao valor que pagaste por ela (o Tane é gratuito: zero). Nada
|
||||||
|
nestes termos limita responsabilidade que não possa ser limitada por lei, nem os teus direitos legais
|
||||||
|
como consumidor.
|
||||||
|
|
||||||
|
## 7. Geral
|
||||||
|
|
||||||
|
Se alguma parte destes termos for considerada inválida, o resto mantém-se em vigor. Estes termos são
|
||||||
|
regidos pela lei espanhola e da UE, sem te privar das proteções da lei do teu
|
||||||
|
país de residência. Podemos atualizar estes termos; alterações relevantes serão assinaladas nas
|
||||||
|
notas de lançamento da app, e a versão atual vive sempre em
|
||||||
|
<https://tane.comunes.org/legal/terms>.
|
||||||
|
|
@ -1,139 +0,0 @@
|
||||||
# Ecorred: Encuentro Estatal (Piloña) y financiación RCF
|
|
||||||
|
|
||||||
> Nota interna (sin trackear). Preparada el 18-07-2026. **El formulario cierra el lunes 21 de julio.**
|
|
||||||
|
|
||||||
## 1. El encuentro
|
|
||||||
|
|
||||||
**Encuentro Estatal de Comunidades Regenerativas** — [ecorred.es/encuentro-comunidades-regenerativas](https://www.ecorred.es/encuentro-comunidades-regenerativas/)
|
|
||||||
|
|
||||||
- **Cuándo**: 24–27 de septiembre de 2026.
|
|
||||||
- **Dónde**: La Benéfica de Piloña, L'Infiestu (Asturias).
|
|
||||||
- **Qué incluye**: alojamiento compartido (3 noches), comidas de los 3 días, ayuda de viaje de hasta 100 €/persona.
|
|
||||||
- **Programa**: jueves llegada y "pasillo de la fama" (espacio expositivo de iniciativas); viernes sesión estratégica entre redes; sábado jornada pública del Día Europeo de las Comunidades Sostenibles, con diálogo institucional; domingo visitas opcionales a proyectos locales.
|
|
||||||
- **Reuniones preparatorias online**: 1 y 8 de septiembre.
|
|
||||||
- **Plazos**: formulario de interés hasta el **21 de julio**; selección comunicada **antes del 31 de julio**. Plazas limitadas; seleccionan buscando diversidad de territorios, enfoques y perfiles.
|
|
||||||
- **Formulario**: https://forms.gle/bcizx2eXHPFigZZp7 (lo gestiona Altekio S.Coop.Mad.)
|
|
||||||
|
|
||||||
**Por qué encaja Tane**: priorizan iniciativas de alimentación y agroecología, y el formulario pregunta literalmente *"¿Qué traéis al encuentro? Un aprendizaje, una herramienta, una experiencia concreta que otras iniciativas podrían necesitar escuchar"*. Tane es exactamente eso: una herramienta libre y ya disponible. Además, el encuentro reúne al público ideal (redes de semillas, grupos agroecológicos, bancos comunitarios) para pilotos y difusión.
|
|
||||||
|
|
||||||
## 2. Financiación en Ecorred más allá del encuentro
|
|
||||||
|
|
||||||
Ecorred es el nodo español del **Regenerative Communities Fund (RCF)** de ECOLISE (2025–2027), financiado por la UE dentro de "Funding Fairer Futures" (programa DEAR). Nodos hermanos en Croacia, Finlandia, Francia y Portugal. Dos líneas:
|
|
||||||
|
|
||||||
### Pathfinder / Comunidades Emergentes — la oportunidad real
|
|
||||||
|
|
||||||
- **4.000 €** por iniciativa + formación, acompañamiento, visitas a iniciativas demostrativas, apoyo en captación de fondos y comunicación. Presupuesto total del proyecto entre 1.000 y 10.000 € (cofinanciación no obligatoria).
|
|
||||||
- La **3ª convocatoria cerró el 26-01-2026** (42 solicitudes en España; resolución hacia finales de septiembre de 2026, ~10 seleccionadas por país).
|
|
||||||
- **Habrá una 4ª convocatoria a mediados de 2026** para otras 50 comunidades. **Esta es la ventana para Tane** — y el encuentro de Piloña, el sitio donde enterarse de las fechas y conocer al equipo de Ecorredes (que forma parte del comité de selección).
|
|
||||||
|
|
||||||
**Elegibilidad** (según las [bases de la 3ª convocatoria](https://ecolise.eu/wp-content/uploads/2025/11/CfP-Regenerative-Communities-Fund-%E2%80%93-Cycle-III-2025-Pathfinder-Communities.pdf), previsiblemente similares en la 4ª):
|
|
||||||
|
|
||||||
- Puede solicitar una **entidad sin ánimo de lucro registrada** (CSO) **o un grupo no registrado** con entidad fiscal de acogida. La asociación serviría como vehículo legal, sin protagonismo.
|
|
||||||
- Establecida y trabajando en España ✓; no haber recibido fondos DEAR ✓.
|
|
||||||
- **Punto de fricción**: piden iniciativas *"pequeñas, arraigadas localmente"* que *"trabajen con comunidades locales de un territorio concreto"* (escala barrio/pueblo). Una app, por sí sola, encaja regular.
|
|
||||||
- **Encaje recomendado**: presentar un **proyecto local y concreto** — un piloto con una red de intercambio de semillas o banco comunitario de un territorio (talleres, inventariado colectivo del banco local, trueques con la app, formación intergeneracional) — donde Tane es la herramienta, no el fin. Ahí el encaje es bueno: soberanía alimentaria, empoderamiento comunitario, participación de mayores y jóvenes (criterio de relevancia, 30 % de la nota, prima colectivos infrarrepresentados).
|
|
||||||
- Solicitud en inglés (la propuesta narrativa puede ir en castellano + copia en inglés). Informes narrativos, sin informes financieros.
|
|
||||||
- Obligaciones si seleccionan: ejecutar el proyecto (13 meses), participar en formaciones, organizar un **diálogo local con la administración** durante el Día Europeo de las Comunidades Sostenibles, y compartir la historia en los canales de ECOLISE.
|
|
||||||
- Contacto: rcf@ecolise.eu (indicar SPAIN en el asunto).
|
|
||||||
|
|
||||||
**Conclusión**: buscar antes del verano/otoño una **comunidad local aliada** dispuesta a co-presentar el piloto. El encuentro de Piloña es el mejor sitio para encontrarla.
|
|
||||||
|
|
||||||
### Demonstrator / Iniciativas Demostrativas
|
|
||||||
|
|
||||||
Para iniciativas consolidadas que sirven de modelo a otras (15 ya seleccionadas en las dos primeras convocatorias). Requisitos y cuantías no publicados en la web de Ecorred. **Preguntar en el encuentro** si habrá nuevas convocatorias y si una herramienta con comunidad de uso podría entrar más adelante.
|
|
||||||
|
|
||||||
### Fuentes
|
|
||||||
|
|
||||||
- [Fondo en ecorred.es](https://www.ecorred.es/fondo-de-comunidades-regenerativas/)
|
|
||||||
- [Bases 3ª convocatoria Pathfinder (PDF, ECOLISE)](https://ecolise.eu/wp-content/uploads/2025/11/CfP-Regenerative-Communities-Fund-%E2%80%93-Cycle-III-2025-Pathfinder-Communities.pdf)
|
|
||||||
- [Anuncio de la convocatoria (ECOLISE)](https://ecolise.eu/regenerative-communities-fund-apply-call-for-pathfinder-communities/)
|
|
||||||
- [Nota en economiasolidaria.org](https://www.economiasolidaria.org/noticias/convocatoria-de-comunidades-emergentes-pathfinder-del-fondo-para-comunidades-regenerativas/) · [Red de Transición](https://www.reddetransicion.org/abierta-la-convocatoria-de-comunidades-emergentes-pathfinder-del-fondo-para-comunidades-regenerativas/)
|
|
||||||
|
|
||||||
## 3. Borrador de respuestas al formulario de interés
|
|
||||||
|
|
||||||
Listo para copiar y pegar. Los campos `[RELLENAR]` son personales. Límites de palabras respetados con margen.
|
|
||||||
|
|
||||||
### Datos personales
|
|
||||||
|
|
||||||
| Campo | Respuesta |
|
|
||||||
|---|---|
|
|
||||||
| Nombre y apellidos | `[RELLENAR]` |
|
|
||||||
| Correo electrónico | `[RELLENAR]` (sugerencia: vjrj@comunes.org) |
|
|
||||||
| Teléfono de contacto | `[RELLENAR]` |
|
|
||||||
| ¿Cómo has conocido este encuentro? | `[RELLENAR]` (opciones: RCF y Ecorredes / Red o entidad en la que participo / Redes sociales / Otro) |
|
|
||||||
|
|
||||||
### Red, organización o iniciativa
|
|
||||||
|
|
||||||
| Campo | Respuesta |
|
|
||||||
|---|---|
|
|
||||||
| Nombre | **Tane** |
|
|
||||||
| Territorio donde opera | `[CONFIRMAR]` (p. ej. tu municipio/comunidad como base, aclarando que la herramienta se usa en todo el estado) |
|
|
||||||
| Año de inicio | `[CONFIRMAR: 2025 o 2026]` |
|
|
||||||
| Web o redes sociales | https://tane.comunes.org |
|
|
||||||
| Ámbito principal de trabajo | **alimentación y agroecología** |
|
|
||||||
|
|
||||||
**Describe brevemente qué hacéis, cómo y para quién** *(máx. 200 palabras; el borrador tiene ~170)*:
|
|
||||||
|
|
||||||
> Tane es una aplicación libre y gratuita para guardar, organizar e intercambiar semillas tradicionales. Cada persona lleva su banco de semillas en el bolsillo: qué variedades tiene, de dónde vienen, cuándo se sembraron, si siguen germinando bien y a quién se han dado, para que las variedades locales no se pierdan.
|
|
||||||
>
|
|
||||||
> Funciona sin internet, sin cuentas y sin servidores centrales: los datos se quedan cifrados en el dispositivo de cada persona. Cuando hay conexión, se puede publicar lo que se ofrece y conversar con otras personas para intercambiar. Nadie hace negocio con los datos ni con las semillas.
|
|
||||||
>
|
|
||||||
> Está pensada para hortelanas y hortelanos de cualquier edad, redes de intercambio y bancos comunitarios de semillas: es muy simple de entrada (basta apuntar el nombre de una variedad) y ofrece profundidad a quien la busca: pruebas de germinación, calendario de siembra, consejos para producir semilla de cada cultivo, avisos cuando una semilla envejece.
|
|
||||||
>
|
|
||||||
> Es software libre, multilingüe (cualquiera puede ayudar a traducirla) y está disponible gratis en Google Play y F-Droid.
|
|
||||||
|
|
||||||
### Impacto y representatividad
|
|
||||||
|
|
||||||
**¿Qué representa vuestra iniciativa en el ecosistema regenerativo?** *(máx. 150 palabras; ~130)*:
|
|
||||||
|
|
||||||
> Tane es una herramienta común de reciente creación: infraestructura digital al servicio de las redes de semillas, los bancos comunitarios y los grupos agroecológicos, construida como bien colectivo y no como plataforma comercial.
|
|
||||||
>
|
|
||||||
> Es descentralizada por diseño, y eso se nota en algo poco habitual: no sabemos quién la usa ni cuántas personas somos, porque no existe ningún registro central ni recopilamos dato alguno. Igual que las semillas pasan de mano en mano, la aplicación funciona directamente entre las personas, sin pasar por ningún servidor nuestro. Esa renuncia deliberada a controlar es nuestra manera de entender la tecnología para el procomún.
|
|
||||||
>
|
|
||||||
> Venimos del mundo del software libre y estamos en contacto con comunidades que ya se intercambian semillas de mano en mano. Queremos hacer de puente entre quienes guardan semillas y quienes construyen tecnología comunitaria, y tejer en este encuentro las alianzas que un proyecto joven necesita.
|
|
||||||
|
|
||||||
**¿Qué traéis al encuentro?** *(máx. 150 palabras; ~100)*:
|
|
||||||
|
|
||||||
> Una herramienta concreta, libre y gratuita que cualquier iniciativa puede empezar a usar hoy mismo: sirve para inventariar un banco comunitario de semillas, organizar trueques y no perder la memoria de cada variedad (de dónde viene, quién la ha cuidado, cómo germina).
|
|
||||||
>
|
|
||||||
> Y una experiencia que creemos útil compartir: cómo construir tecnología al servicio de las comunidades y no al revés — sin recopilar datos, sin publicidad, funcionando incluso sin internet, traducida por su propia comunidad. Podemos enseñarla en directo, escuchar qué le falta y adaptarla a lo que las redes de semillas necesiten de verdad.
|
|
||||||
|
|
||||||
**¿Qué buscáis?** *(máx. 150 palabras; ~90)*:
|
|
||||||
|
|
||||||
> Alianzas con redes de intercambio de semillas, bancos comunitarios y grupos agroecológicos que quieran probar la herramienta en su día a día y decirnos qué mejorar: pilotos reales con personas reales, especialmente con quienes llevan décadas guardando semillas y con gente joven que empieza.
|
|
||||||
>
|
|
||||||
> También queremos entender cómo sostener un proyecto así sin traicionarlo (sin vender datos ni cobrar por lo básico), y conocer de cerca el Fondo de Comunidades Regenerativas y la próxima convocatoria de comunidades emergentes, idealmente de la mano de una comunidad local con la que presentar un proyecto conjunto.
|
|
||||||
|
|
||||||
**¿Qué conversación queréis tener con las administraciones?** *(máx. 150 palabras; ~105)*:
|
|
||||||
|
|
||||||
> Con humildad: somos un proyecto joven y no venimos a pedir nada para nosotros, sino a escuchar y a acompañar lo que las redes de semillas llevan años planteando — que conservar e intercambiar variedades tradicionales siga siendo posible para personas y colectivos, no solo para empresas, también en la revisión europea de la normativa de semillas que está en curso.
|
|
||||||
>
|
|
||||||
> Y una idea sencilla que sí es nuestra: cuando las administraciones apoyen la digitalización del mundo rural y comunitario, que cuenten con herramientas libres y respetuosas con los datos, que funcionen incluso con mala conexión, en lugar de atar a las comunidades a plataformas comerciales.
|
|
||||||
|
|
||||||
### Diversidad e inclusión
|
|
||||||
|
|
||||||
| Campo | Respuesta |
|
|
||||||
|---|---|
|
|
||||||
| Género | `[RELLENAR]` |
|
|
||||||
| Edad | `[RELLENAR]` |
|
|
||||||
| ¿Trabajáis prioritariamente con jóvenes, migrantes o colectivos vulnerables? | Sugerencia: **Parcialmente** (la app está pensada para cualquier edad, 10–80 años, con especial cuidado de mayores y gente sin soltura digital) — `[DECIDIR]` |
|
|
||||||
| ¿Participáis en el Consejo Estratégico de Ecorredes o en el RCF? | **No** |
|
|
||||||
|
|
||||||
### Logística
|
|
||||||
|
|
||||||
| Campo | Respuesta |
|
|
||||||
|---|---|
|
|
||||||
| ¿Puedes asistir a las reuniones preparatorias online? (1 y/o 8 sept) | `[RELLENAR]` (opciones: Ambas / Solo la primera / Solo la segunda / Ninguna) |
|
|
||||||
| ¿Necesitas apoyo económico para el desplazamiento? | `[RELLENAR]` (Sí / Sería de ayuda, pero podría cubrirlo / No es necesario) |
|
|
||||||
| ¿Participarías igualmente costeando viaje y alojamiento? | `[RELLENAR]` (Sí, probablemente / No me sería posible) |
|
|
||||||
| ¿Necesidad especial para no compartir habitación? | `[RELLENAR]` |
|
|
||||||
| ¿Restricción alimentaria o accesibilidad? | `[RELLENAR]` |
|
|
||||||
| ¿Comentario adicional? | Sugerencia: ofrecer una demostración en vivo de Tane en el "pasillo de la fama" del jueves. |
|
|
||||||
|
|
||||||
## 4. Lista de tareas
|
|
||||||
|
|
||||||
- [ ] **Antes del lunes 21-07**: rellenar y enviar el formulario (respuestas de arriba + campos personales).
|
|
||||||
- [ ] Antes del 31-07: llegará la respuesta de selección.
|
|
||||||
- [ ] Si seleccionan: apuntar reuniones preparatorias del **1 y 8 de septiembre**; preparar material para el pasillo de la fama (cartel con QR de descarga, capturas localizadas ya existentes de los golden tests, móvil/tablet con la app, sobres de semillas de muestra).
|
|
||||||
- [ ] **Vigilar la 4ª convocatoria Pathfinder** (mediados de 2026, 4.000 € + acompañamiento): suscribirse a la [lista de FFF](https://ecolise.eu/) o preguntar en el encuentro; buscar comunidad local aliada para co-presentar un piloto.
|
|
||||||
- [ ] Preguntar en el encuentro por la línea Demonstrator (requisitos, próximas convocatorias).
|
|
||||||
|
|
@ -1,292 +0,0 @@
|
||||||
# Tane — NGI Fediversity (NLnet) application draft
|
|
||||||
|
|
||||||
> **Working document, NOT tracked in git.** Ready-to-submit draft for the NLnet
|
|
||||||
> NGI Fediversity call (nlnet.nl/propose). Deadline **1 Aug 2026, 12:00 CEST** (confirmed on the site).
|
|
||||||
> Derived from `VISION.md`, `PLAN.md`, `docs/design/*` and `docs/notes/modelos-financiacion.md`.
|
|
||||||
> Written in English (the proposal must be in English; VISION.md is the Spanish source).
|
|
||||||
> **Updated 2026-07-17** to reflect the shipped state: app live on Google Play (v0.1.1), site at
|
|
||||||
> tane.comunes.org, most of the social layer already built. The ask now funds the *remaining*
|
|
||||||
> federated-infrastructure work, not a from-scratch build.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Part A — Strategy & framing (for us, NOT for the form)
|
|
||||||
|
|
||||||
### The new, stronger story: we shipped, now we complete the federated infrastructure
|
|
||||||
Since the first draft, the project advanced a lot. This is now a **track-record application**, not a
|
|
||||||
promise:
|
|
||||||
- **Live on Google Play** (v0.1.1, `org.comunes.tane`), **GMS-free build** ready for F-Droid.
|
|
||||||
- **Public site** at **tane.comunes.org**, translated via Weblate (translate.comunes.org).
|
|
||||||
- **Block 1 (inventory) shipped**, and **most of Block 2 (the social layer) already shipped**: offers
|
|
||||||
(NIP-99), private metadata-hiding messaging (NIP-17), a Duniter-style egocentric web of trust
|
|
||||||
(kind 30777), ratings (kind 30778), profiles + multi-account identity, Plantaré pledges, saved-search
|
|
||||||
alerts. All transports live in the reusable `commons_core` engine, with ~131 test files and CI.
|
|
||||||
|
|
||||||
NLnet weighs **technical feasibility (30%)** and **value for money (30%)**: a shipped, tested,
|
|
||||||
in-store app de-risks both. Lead with that.
|
|
||||||
|
|
||||||
### Fit with Fediversity — now genuine, not a stretch
|
|
||||||
The Fediversity fund leans to the *hosting stack / self-hosting* side. The **work that remains is
|
|
||||||
exactly that side**, which is why the fit is now real:
|
|
||||||
1. **Self-hostable community relay** — `relay.comunes.org` is **already deployed and running**. The
|
|
||||||
remaining Fediversity-shaped work is turning it into a **reproducible, documented recipe any seed
|
|
||||||
network can self-host**, plus moderation tooling (NIP-56 reports, key-blocking) and operational
|
|
||||||
hardening — so the network is owned by communities, not a single instance.
|
|
||||||
2. **Multi-device sync** — the encrypted `SyncTransport` landed (NIP-78, relay sees only ciphertext);
|
|
||||||
the app-level `SyncService` that replicates your inventory across your own devices is **pending**.
|
|
||||||
This is data portability + self-custody, a Fediversity theme.
|
|
||||||
3. **Interoperability & portability** — open, versioned export/import already exists; add opt-in
|
|
||||||
**Darwin Core / GBIF** export so agrobiodiversity data can flow to open biodiversity atlases.
|
|
||||||
4. **`commons_core` as reusable federated infrastructure** — Tane is a seed app wrapped around a generic
|
|
||||||
Nostr + CRDT + web-of-trust + messaging engine; seeds are the first app, others can follow.
|
|
||||||
|
|
||||||
Framing in one line: **bringing federation beyond social media, into the physical commons — and we
|
|
||||||
already have a working app to prove it.**
|
|
||||||
|
|
||||||
### Plan B — don't bet everything on this call
|
|
||||||
Honest odds: the fit is now decent (the remaining work IS hosting/portability-shaped) but Fediversity
|
|
||||||
reviewers may still read "mobile app on Nostr" as adjacent to their ActivityPub/NixOS hosting focus.
|
|
||||||
Mitigation, at near-zero extra cost:
|
|
||||||
- **Submit to Fediversity anyway** (short form, strong track record, real infra milestones) — worst case
|
|
||||||
is a rejection with feedback.
|
|
||||||
- **Reuse this same dossier for NGI Zero Commons / Core when regular calls reopen after summer 2026** —
|
|
||||||
Tane as commons infrastructure is arguably a *better* fit there (`commons_core`, open protocols,
|
|
||||||
community-run relays). Keep this file as the master; only the fund-specific framing paragraph changes.
|
|
||||||
- Meanwhile, keep the **Goteo matchfunding** (Red de Semillas) track as the community-round complement.
|
|
||||||
|
|
||||||
### NLnet requirements checklist
|
|
||||||
- [x] **FOSS licence** — code AGPL-3.0; docs/assets CC-BY-SA.
|
|
||||||
- [x] **Open standards** — Nostr NIPs (99/17/44/78/56), Duniter-style WoT, open data formats, Darwin Core.
|
|
||||||
- [x] **European dimension** — EC-LLD (23 European seed networks), Red de Semillas, EU seed-law (PRM) context.
|
|
||||||
- [x] **Milestone-based, verifiable deliverables** — see Part C.
|
|
||||||
- [x] **Sustainability after funding** — local-first, open data/code, cheap community relays; never per-transaction fees.
|
|
||||||
- [ ] **Generative-AI disclosure** — declared honestly and minimally (see §13 + the log template below).
|
|
||||||
- [ ] **Privacy statement** — tick the acknowledgement of NLnet's privacy statement on the form.
|
|
||||||
|
|
||||||
### The AI concern (read before submitting)
|
|
||||||
NLnet has a formal **Generative AI policy** (nlnet.nl/foundation/policies/generativeAI/). It does **not**
|
|
||||||
forbid AI, but imposes real obligations, and reviewers value **substance over marketing**. Three things,
|
|
||||||
don't conflate them:
|
|
||||||
1. **Prompt provenance log (required):** if GenAI is used in the application process, you must keep a
|
|
||||||
log of prompts/outputs. → the Appendix table below.
|
|
||||||
2. **Public disclosure (required for substantive use):** any GenAI use that materially affects the
|
|
||||||
output must be disclosed so evaluators understand how the proposal was produced. → §13.
|
|
||||||
3. **Purely-AI outcomes are NOT payable, and must be FLOSS-clean:** "Outcomes purely generated by AI are
|
|
||||||
not allowed to be submitted as work eligible for payment." → this hits the **milestones (M1–M5)**, not
|
|
||||||
just the application: the delivered code/docs must be **human-authored** (AI-assisted is fine; you must
|
|
||||||
also verify outputs don't reproduce copyrighted/licence-incompatible material). **Non-compliance can
|
|
||||||
mean rejection of the proposal or termination of a running grant.**
|
|
||||||
|
|
||||||
Plus the softer risk: an application that *reads* as AI slop scores worse. Fix for all of it = make the
|
|
||||||
text genuinely yours.
|
|
||||||
|
|
||||||
**Action for vjrj — rewrite §3, §4, §5 in your own voice** (that's what a reviewer reads first; the rest
|
|
||||||
is technical scaffolding). Add first-person specifics only you can write: Kokopelli, the 2009 paper
|
|
||||||
Plantare you originated, why the whole seed sector refuses per-transaction fees, your Ğ1nkgo/Duniter
|
|
||||||
background, and the fact the app is already in people's hands.
|
|
||||||
|
|
||||||
**De-"slop" pass:** cut the tells — em-dashes everywhere, rule-of-three lists, heavy bold,
|
|
||||||
"not X but Y" constructions, brochure cadence. Rougher, more technical, more personal = better here.
|
|
||||||
|
|
||||||
### Process notes
|
|
||||||
- Submit several days early — "deadlines are hard". Draft offline (this file), paste at the end.
|
|
||||||
- Plain text is preferred; keep formatting light. Attachments ≤ 50 MB total.
|
|
||||||
- You may submit multiple independent proposals in one round; do not double-submit via FundingBox + NLnet.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Part B — Form answers (the actual draft, English)
|
|
||||||
|
|
||||||
### Current status (facts to weave in — all verifiable)
|
|
||||||
- **Live:** Google Play v0.1.1 (`org.comunes.tane`); site **tane.comunes.org**; community Nostr relay
|
|
||||||
**relay.comunes.org running**; source public (AGPL-3.0).
|
|
||||||
- **F-Droid:** GMS-free build + recipe ready (awaiting registry upload).
|
|
||||||
- **Languages:** 7 (en, es, pt, fr, ast, de, ja); RTL + CJK fonts bundled; translated on Weblate.
|
|
||||||
- **Engine:** `commons_core` (pure Dart) — identity derivation, HLC, CRDT, geohash, all Nostr transports.
|
|
||||||
- **Tests/CI:** ~131 test files; Forgejo Actions runs analyze + test on both packages.
|
|
||||||
|
|
||||||
### 1. Contact / Organisation / Country
|
|
||||||
- **Applicant organisation:** Comunes (registered non-profit association), Spain / EU.
|
|
||||||
- **Project lead:** Vicente J. Ruiz Jurado (vjrj) — technical lead.
|
|
||||||
- **Package id / namespace:** `org.comunes.tane`.
|
|
||||||
- **Contact:** vjrj@comunes.org.
|
|
||||||
- **Project page:** https://tane.comunes.org · source repository public (AGPL-3.0) · live on Google Play.
|
|
||||||
|
|
||||||
### 2. Project name
|
|
||||||
**Tane — self-hostable, local-first infrastructure for seed-sharing communities.** (種, "seed"; from
|
|
||||||
*tanemaki*, "to sow".)
|
|
||||||
|
|
||||||
### 3. Abstract (a few sentences)
|
|
||||||
> ✍️ **vjrj: rewrite in your own voice.** Scaffolding below — keep the meaning, drop the polished cadence.
|
|
||||||
|
|
||||||
Tane lets communities run their own seed-sharing network end to end: a local-first mobile app, a
|
|
||||||
self-hostable relay, and identity and data the user fully owns and can take anywhere — no account, no
|
|
||||||
central server, no company in the middle. The app is already live on Google Play in seven languages;
|
|
||||||
offers, private messaging, reputation and encrypted device sync ride on open federated protocols
|
|
||||||
(Nostr NIPs) and a Duniter-style web of trust, implemented in a reusable engine (`commons_core`) where
|
|
||||||
seeds are only the first application. What remains — and what this grant funds — is the hosting and
|
|
||||||
portability side: a **reproducible relay recipe any collective can self-host** (our reference instance
|
|
||||||
already runs), **completion of encrypted multi-device sync**, **open-standards data portability**
|
|
||||||
(Darwin Core / GBIF export), and production hardening — so a seed network can operate the whole stack
|
|
||||||
without depending on us, or on anyone.
|
|
||||||
|
|
||||||
### 4. Can you explain the whole project and its expected outcome?
|
|
||||||
> ✍️ **vjrj: rewrite in your own voice.** Add first-person specifics (Kokopelli, the 2009 paper Plantare,
|
|
||||||
> Ğ1nkgo). Scaffolding below.
|
|
||||||
|
|
||||||
A handful of corporations control most of the world's seed supply, and traditional varieties — and the
|
|
||||||
knowledge to grow them — are being lost. Sharing seeds has even become legally suspect (e.g. Kokopelli
|
|
||||||
fined in France). Seed networks resist with notebooks and spreadsheets; there was no friendly, free,
|
|
||||||
decentralised tool for them.
|
|
||||||
|
|
||||||
Tane is built in **layers, each useful alone**, and most are **already shipped**:
|
|
||||||
1. **Inventory (local-first) — shipped.** Encrypted seed bank on your phone (SQLite + SQLCipher), fully
|
|
||||||
offline, no account; backup + printed recovery; 7 languages.
|
|
||||||
2. **Offer status — shipped.** Per item: private / gift / exchange / sale.
|
|
||||||
3. **Local sharing (federated) — shipped.** Offers as signed Nostr events (NIP-99), discovered by
|
|
||||||
**coarse geohash** (~2.4 km, never your address); private DMs (NIP-17); ratings; Plantaré pledges;
|
|
||||||
saved-search alerts. No central operator can censor, sell data, or charge a fee.
|
|
||||||
4. **Trust — shipped.** Egocentric Duniter-style web of trust (you vouch for people you've met); spam
|
|
||||||
from unknown keys is filtered with no central moderator.
|
|
||||||
|
|
||||||
A de-risking spike proved the whole social happy-path on vetted pure-Dart libraries, and it is now
|
|
||||||
**production code in people's hands**. **What this grant funds is the hosting and portability layer that
|
|
||||||
makes the network genuinely community-owned** (see Part C): turning our running relay into a
|
|
||||||
**reproducible, self-hostable recipe with moderation tooling**; completing **encrypted multi-device
|
|
||||||
sync** (the transport already landed; the relay only ever sees ciphertext); **open-standards data
|
|
||||||
portability** (opt-in Darwin Core / GBIF export toward public biodiversity atlases); plus trust
|
|
||||||
cold-start for real seed fairs, optional Ğ1 price tags, and messaging/offers hardening.
|
|
||||||
|
|
||||||
**Expected outcome:** any seed collective in Europe can **self-host the entire stack from a documented
|
|
||||||
recipe** — relay, moderation, app, data — with identity and data fully portable and **zero dependency on
|
|
||||||
Comunes or any single operator**. And because the hard parts live in the generic `commons_core` engine,
|
|
||||||
the same infrastructure is reusable for other physical-commons networks (tool libraries are the next
|
|
||||||
candidate).
|
|
||||||
|
|
||||||
### 5. Compare your own project with existing or historical efforts
|
|
||||||
> ✍️ **vjrj: rewrite in your own voice.** You know this sector first-hand — say why it refuses
|
|
||||||
> per-transaction fees, and tell the Plantare story as its originator. Scaffolding below.
|
|
||||||
|
|
||||||
- **Seed Savers Exchange, Graines de Troc, Arche Noah, Red de Semillas** — valuable, but each is a
|
|
||||||
**centralised web platform**: single operator, an account, a server that can go dark, no local-first
|
|
||||||
offline app, not federated, not self-hostable.
|
|
||||||
- **Garden/inventory apps** — mostly **proprietary and extractive**; none do decentralised sharing or trust.
|
|
||||||
- **Marketplaces (Wallapop-style)** — a central intermediary that takes a commission and can censor.
|
|
||||||
Tellingly, **no seed-exchange platform anywhere charges per-transaction fees** — the whole sector uses
|
|
||||||
gift/exchange/membership. We follow that, by design.
|
|
||||||
- **Historical precedent — the Plantare (2009).** A paper "seed promissory note" already solved
|
|
||||||
decentralised trust and reciprocity *socially* (a bearer instrument, both parties hold a copy, the
|
|
||||||
ledger distributed across drawers). We digitise it without a central register.
|
|
||||||
|
|
||||||
**Why it's needed / why existing solutions don't answer it:** none combines local-first, federation over
|
|
||||||
open standards, self-hostability, identity/data portability, and a spam-resistant web of trust — while
|
|
||||||
staying free and non-extractive. Tane already does, in production; the engine is reusable for other
|
|
||||||
physical-commons networks.
|
|
||||||
|
|
||||||
### 6. Significant technical challenges (the remaining work)
|
|
||||||
- **Self-hostable relay + moderation** — `relay.comunes.org` already runs; the challenge is making it a
|
|
||||||
reproducible recipe others can run, with NIP-56 report handling and key-blocking, so moderation is
|
|
||||||
"with a response" but not centralised.
|
|
||||||
- **Multi-device sync at the app level** — wire `SyncService` onto the landed encrypted `SyncTransport`:
|
|
||||||
serialise inventory, push on mutation, idempotent LWW import on receipt, stable per-install device id,
|
|
||||||
rare-conflict UI. Relay only ever sees ciphertext.
|
|
||||||
- **Interoperability / portability** — opt-in Darwin Core / GBIF export of agrobiodiversity (blurred
|
|
||||||
location, collective-bank level, one-way) — exactly the data those atlases lack.
|
|
||||||
- **Messaging/offers hardening** — NIP-44 interop-exact test vectors, offline DM delivery/retry, offer
|
|
||||||
expiry & revocation on already-replicated relays.
|
|
||||||
- **Trust cold-start** — bootstrap the web of trust at real fairs / Ğ1 seed groups (QR, no network).
|
|
||||||
- **Portable derived identity** — one root seed, one-way HKDF secp256k1 subkey for Nostr, one printable
|
|
||||||
QR backs up everything (already implemented; polish + docs).
|
|
||||||
|
|
||||||
### 7. Project ecosystem & stakeholder engagement
|
|
||||||
- **Seed networks:** Red de Semillas (Spain), **EC-LLD / Let's Liberate Diversity** (23 European seed
|
|
||||||
networks) for European reach; Arche Noah as a policy ally.
|
|
||||||
- **Free-money communities (Ğ1/Duniter):** first pilots — existing identity, existing web of trust,
|
|
||||||
aligned values.
|
|
||||||
- **Seed fairs and markets:** where trust bootstraps face to face.
|
|
||||||
- **Translators & contributors:** already active via Weblate; code and docs public.
|
|
||||||
|
|
||||||
### 8. Relevant prior experience & track record
|
|
||||||
- **Shipped, in production:** Tane is **live on Google Play** (v0.1.1), GMS-free build ready for F-Droid,
|
|
||||||
site at tane.comunes.org, 7 languages via Weblate, RTL+CJK support, a full legal package, automated
|
|
||||||
store publishing (Fastlane) and CI (Forgejo Actions, ~131 test files). Block 1 + most of Block 2 done.
|
|
||||||
- **vjrj** authored **Ğ1nkgo**, a Duniter/Ğ1 wallet in Flutter/Dart; Tane reuses its cryptographic
|
|
||||||
primitives (secp256k1, HKDF, Duniter identity) — no reinvention.
|
|
||||||
- **vjrj originated the Plantare concept** (BAH-Semillero, 2009, CC-BY-SA) and wrote *"Las semillas del
|
|
||||||
conocimiento libre"* (2005) — a decade of domain authority in seed commons.
|
|
||||||
- **Comunes** — registered association, stable legal counterpart for milestone accountability.
|
|
||||||
|
|
||||||
### 9. Requested amount
|
|
||||||
**€32,000.**
|
|
||||||
|
|
||||||
### 10. Budget usage / task breakdown
|
|
||||||
See Part C. Milestone-based; each milestone is an independent, verifiable deliverable with a CI-gated
|
|
||||||
test suite where applicable. NLnet pays on verification of each milestone.
|
|
||||||
|
|
||||||
### 11. Other funding sources (past and present)
|
|
||||||
- Built so far with **volunteer work**; **no prior grant funding**; no overlapping funding for this scope.
|
|
||||||
- Complementary community funding (e.g. Goteo matchfunding with Red de Semillas) is a *future*
|
|
||||||
sustainability avenue, not a duplicate of this request.
|
|
||||||
|
|
||||||
### 12. Sustainability after the grant
|
|
||||||
- **Local-first:** useful even with no servers and no maintainer — utility does not expire.
|
|
||||||
- **Open code & data (AGPL-3.0, open export):** anyone can continue, fork, or **self-host the relay**.
|
|
||||||
- **Cheap, community-run relays** (collectives / Comunes), plus opportunistic app-as-relay and
|
|
||||||
physical-proximity exchange at fairs.
|
|
||||||
- **Non-extractive revenue only, never on the seed:** voluntary association membership (Seed Savers
|
|
||||||
model), optional managed services for institutional seed banks. No per-transaction commission — legally
|
|
||||||
prudent (EU PRM in trilogue) and coherent with the commons.
|
|
||||||
|
|
||||||
### 13. Compliance & disclosure
|
|
||||||
- **Licence:** AGPL-3.0 (code); CC-BY-SA (docs/assets). Compatible with the reused Duniter/Ğ1nkgo stack.
|
|
||||||
- **Privacy statement:** acknowledged.
|
|
||||||
- **Generative-AI disclosure (honest & minimal — paste into the form):**
|
|
||||||
> An AI assistant was used only as a drafting aid for this application text: to translate and structure
|
|
||||||
> an initial English outline from our pre-existing Spanish design documents (VISION.md, PLAN.md,
|
|
||||||
> docs/design/*), which predate and are independent of this application. All technical claims,
|
|
||||||
> architecture, milestones and budget are the applicant's own; the project lead rewrote and verified
|
|
||||||
> the text, and no AI output was submitted unedited. A prompt provenance log is available on request.
|
|
||||||
> The funded deliverables (M1–M5) will be human-authored (AI-assisted at most), released under
|
|
||||||
> AGPL-3.0, with no purely-AI-generated outcomes submitted for payment.
|
|
||||||
|
|
||||||
*Adjust to match what you actually did before sending. If you rewrite §3–§5 yourself (recommended),
|
|
||||||
this statement stays true and strong.*
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Part C — Milestones & budget (€32,000)
|
|
||||||
|
|
||||||
Milestones reflect the **real remaining work** (Block 1 + most of Block 2 are already shipped). They are
|
|
||||||
ordered by theme: **M1–M3 are the federated-hosting core** (self-hosting, sync, portability); **M4–M5
|
|
||||||
harden and bootstrap it**. Each is an independent, verifiable deliverable; NLnet pays on verification.
|
|
||||||
|
|
||||||
| # | Milestone | Verifiable deliverable | € |
|
|
||||||
|---|-----------|------------------------|---|
|
|
||||||
| **M1** | **Self-hostable relay recipe + moderation** | `relay.comunes.org` already runs; deliver a **reproducible, documented recipe** any seed network can self-host, plus NIP-56 report handling + key-blocking moderation tooling and an operator manual | 6,000 |
|
|
||||||
| **M2** | **Multi-device sync (app `SyncService`)** | Inventory replication across a user's own devices over the landed encrypted `SyncTransport` (NIP-78): serialise + push on mutation, idempotent LWW import, stable per-install device id, conflict UI; tests (relay sees only ciphertext) | 8,000 |
|
|
||||||
| **M3** | **Interoperability & data portability** | Opt-in Darwin Core / GBIF export of agrobiodiversity (blurred location, collective-bank level, one-way); polished open export/import + identity portability docs | 5,000 |
|
|
||||||
| **M4** | **Messaging & offers hardening** | NIP-44 interop-exact test vectors, offline DM delivery/retry queue, offer expiry + revocation on replicated relays, spam-filter polish; CI-gated | 7,000 |
|
|
||||||
| **M5** | **Trust cold-start + Ğ1 price integration + docs/release** | WoT cold-start flows for fairs / Ğ1 groups (QR, offline); Ğ1 price tag + deep-link to wallets (no in-app payment); contributor architecture guide + multilingual user guide; F-Droid release | 6,000 |
|
|
||||||
| | **Total** | | **32,000** |
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Submission checklist (before nlnet.nl/propose)
|
|
||||||
1. Cross-check every field above against the live form + Guide for Applicants.
|
|
||||||
2. Fit test: does the abstract + §4 opening read "federation / portability / self-hosting" *before* "seeds"?
|
|
||||||
3. Budget: milestones independent & verifiable, effort realistic, sum = €32,000.
|
|
||||||
4. Compliance: FOSS licence stated, privacy statement acknowledged, **AI-disclosure + provenance log ready**.
|
|
||||||
5. Confirm the 1 Aug 2026 deadline on the site; submit with several days' margin.
|
|
||||||
6. Language pass: rewrite §3–§5 in vjrj's voice; clear, technical English throughout.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
## Appendix — AI-use log (keep, attach or provide on request)
|
|
||||||
Fill as you go so the disclosure is accurate and verifiable.
|
|
||||||
|
|
||||||
| Date | Tool / model | Prompt (verbatim) | What the output was used for | Kept unedited? |
|
|
||||||
|------|--------------|-------------------|------------------------------|----------------|
|
|
||||||
| 2026-07-10 | Claude Code (Opus 4.8) | "Me ayudas a presentar tane a esta convocatoria? qué pedirías…" | Initial English draft/outline from repo docs | No — to be rewritten & verified by lead |
|
|
||||||
| 2026-07-17 | Claude Code (Opus 4.8) | "He avanzado mucho en el desarrollo, puedes actualizar la application?…" | Updated draft to reflect shipped status + new milestones | No — to be rewritten & verified by lead |
|
|
||||||
|
|
||||||
> Keep the raw session transcript alongside this table. If §3–§5 are rewritten by hand, note that here too.
|
|
||||||
85
docs/o-que-e-tane.md
Normal file
85
docs/o-que-e-tane.md
Normal file
|
|
@ -0,0 +1,85 @@
|
||||||
|
# Tane — o que é
|
||||||
|
|
||||||
|
**Tane** (種) significa "semente" em japonês; o nome completo, *tanemaki* (種まき), significa "semear / espalhar sementes".
|
||||||
|
|
||||||
|
## Numa frase
|
||||||
|
|
||||||
|
Uma app simples e livre para **guardares as tuas sementes e as partilhares** com quem quiseres. Funciona
|
||||||
|
**sem internet** e sem nenhuma empresa pelo meio.
|
||||||
|
|
||||||
|
## Porque é preciso
|
||||||
|
|
||||||
|
Hoje, um punhado de empresas controla grande parte das sementes do mundo. Muitas sementes são feitas para
|
||||||
|
não servirem outra vez: dão uma colheita, mas as suas sementes não germinam bem, por isso é preciso
|
||||||
|
**comprá-las de novo todos os anos**. Entretanto, as variedades tradicionais — cultivadas e melhoradas
|
||||||
|
ao longo de milhares de anos — estão a perder-se, e com elas o conhecimento de como as cultivar.
|
||||||
|
|
||||||
|
Partilhar sementes é uma das coisas mais antigas e naturais que há, e ainda assim em alguns sítios
|
||||||
|
tornou-se complicado ou até foi multado (em França uma associação foi penalizada por distribuir
|
||||||
|
variedades que não estavam na lista oficial aprovada). E quem cuida de sementes continua a fazê-lo
|
||||||
|
com cadernos e folhas de cálculo.
|
||||||
|
|
||||||
|
## O que faz, tornado simples
|
||||||
|
|
||||||
|
- **Guardar** — o teu inventário de sementes: o que tens, de que ano, quanto, de onde
|
||||||
|
veio, com **o nome que usas** (sem precisar de latim). Tanto faz se tens quatro
|
||||||
|
pacotes numa gaveta ou um grupo com centenas de variedades.
|
||||||
|
- **Partilhar** — dizes o que ofereces; alguém perto vê-o e escreve-te, para **dar,
|
||||||
|
trocar ou vender** se quiseres. Fechas o negócio tu mesmo, diretamente. Nenhuma empresa
|
||||||
|
entra nem cobra comissão.
|
||||||
|
|
||||||
|
## Porque é diferente
|
||||||
|
|
||||||
|
- **É livre e pertence a todos.** Não é propriedade de nenhuma empresa: qualquer pessoa pode usar,
|
||||||
|
copiar, traduzir ou melhorar, de forma livre e para sempre. É mais uma *receita que se partilha*
|
||||||
|
do que um produto fechado — chama-se **software livre**. E quem o melhora fica obrigado a
|
||||||
|
partilhar essas melhorias igualmente livres, para que ninguém o possa "fechar" depois (é isso o
|
||||||
|
**copyleft**).
|
||||||
|
- **Funciona sem ligação.** O essencial funciona mesmo no campo sem sinal.
|
||||||
|
- **Os teus dados são teus.** A tua informação fica guardada no **teu próprio telemóvel**, protegida com uma
|
||||||
|
chave, não nos computadores de nenhuma empresa. Não a vendemos nem a colocamos em lado nenhum. Sem publicidade.
|
||||||
|
- **Ninguém o pode desligar ou controlar.** Não há nenhum computador central por onde tudo passa:
|
||||||
|
o que partilhas viaja por **servidores da comunidade**, mantidos por pessoas e coletivos —
|
||||||
|
há vários e qualquer pessoa pode acrescentar o seu — pelo que nenhum deles é um centro
|
||||||
|
a partir do qual censurar ou cobrar para o usares, como quem passa sementes de mão em mão
|
||||||
|
(é isso que significa ser **descentralizado**).
|
||||||
|
- **Confias de boca em boca.** Lidas com pessoas que conheces e com as que são avalizadas
|
||||||
|
por pessoas em quem confias — como sempre funcionou numa aldeia ou numa feira — sem
|
||||||
|
teres de dar o teu nome verdadeiro ou o teu telefone a não ser que queiras.
|
||||||
|
- **Em muitas línguas.** Para qualquer parte do mundo, não para um único país. Voluntários
|
||||||
|
traduzem-no.
|
||||||
|
|
||||||
|
## Para quem é
|
||||||
|
|
||||||
|
Grupos e redes de sementes, hortas e coletivos, agricultores… e qualquer pessoa com uns pacotes
|
||||||
|
guardados. Para todas as idades, dos 10 aos 99.
|
||||||
|
|
||||||
|
## Um nome japonês
|
||||||
|
|
||||||
|
**Tane** significa "semente" (種); *tanemaki* (種まき) significa "semear sementes". E não é por acaso
|
||||||
|
que o nome é japonês. Séculos atrás, no Japão, tiras de papel impressas que prometiam
|
||||||
|
arroz passavam de mão em mão: eram emitidas por templos, comerciantes e armazéns de arroz —
|
||||||
|
não por um banco ou uma autoridade central — e as pessoas aceitavam-nas confiando nessa promessa.
|
||||||
|
Uma rede de trocas sem centro, sustentada pela confiança, onde um pedaço de papel bastava
|
||||||
|
para pôr o arroz em movimento. Séculos depois, essa mesma ideia inspirou redes modernas como
|
||||||
|
o *sistema WAT* do Japão (2000): uma nota que qualquer pessoa pode imprimir e passar adiante, sem banco nem centro.
|
||||||
|
|
||||||
|
O Tane herda esse espírito. Quando partilhas sementes podes anexar um [**Plantaré**](https://plantare.ourproject.org). O nome
|
||||||
|
faz um jogo com o espanhol *pagaré* — uma promessa de pagamento, literalmente "pagarei" — trocando *pagar* por
|
||||||
|
*plantar*: não "pagarei" mas "plantarei". É uma promessa de devolver, quando puderes, uma
|
||||||
|
quantidade semelhante de semente livre. Não é uma compra nem uma obrigação — é um compromisso de
|
||||||
|
manter a semente viva e em movimento. E como devolvê-la significa cultivá-la, e cultivar
|
||||||
|
multiplica-a, cada gesto faz os comuns crescer em vez de os encolher.
|
||||||
|
|
||||||
|
## Onde está e como ajudar
|
||||||
|
|
||||||
|
Ainda dá os primeiros passos. Podes ajudar experimentando-o num grupo de sementes real, [traduzindo-o](https://translate.comunes.org/projects/tane/),
|
||||||
|
partilhando o que sabes sobre as variedades, ou programando. Não tem preço e nunca terá: é
|
||||||
|
sustentado por voluntários, pelas próprias comunidades, e por financiamento público para projetos
|
||||||
|
de interesse comum.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
> *A ideia por trás disto: as sementes tradicionais são um património da humanidade — de todos e de
|
||||||
|
> ninguém. Contra quem as queira privatizar, o Tane procura tornar fácil guardá-las,
|
||||||
|
> multiplicá-las e mantê-las em movimento.*
|
||||||
|
|
@ -41,9 +41,10 @@ con libretas y hojas de cálculo.
|
||||||
clave, no en los ordenadores de una empresa. No la vendemos ni la subimos a ningún sitio.
|
clave, no en los ordenadores de una empresa. No la vendemos ni la subimos a ningún sitio.
|
||||||
Sin publicidad.
|
Sin publicidad.
|
||||||
- **Nadie la puede apagar ni controlar.** No hay un ordenador central por el que pase todo:
|
- **Nadie la puede apagar ni controlar.** No hay un ordenador central por el que pase todo:
|
||||||
las personas se comunican **directamente entre sí**, como quien se pasa unas semillas de
|
lo que compartes viaja por **servidores de la comunidad**, mantenidos por personas y
|
||||||
mano en mano. Por eso nadie puede censurarla ni cobrarte por usarla (eso es que sea
|
colectivos — hay varios y cualquiera puede añadir el suyo — así que ninguno es un centro
|
||||||
**descentralizada**).
|
desde el que censurarla o cobrarte por usarla, como quien se pasa unas semillas de mano
|
||||||
|
en mano (eso es que sea **descentralizada**).
|
||||||
- **Te fías por el boca a boca.** Te relacionas con gente que conoces y con quien te
|
- **Te fías por el boca a boca.** Te relacionas con gente que conoces y con quien te
|
||||||
recomienda gente de confianza —como siempre se ha hecho en un pueblo o en una feria— sin
|
recomienda gente de confianza —como siempre se ha hecho en un pueblo o en una feria— sin
|
||||||
tener que dar tu nombre real ni tu teléfono si no quieres.
|
tener que dar tu nombre real ni tu teléfono si no quieres.
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,11 @@ git tag v0.1.0 && git push origin v0.1.0
|
||||||
```
|
```
|
||||||
|
|
||||||
Forgejo Actions ([`../.forgejo/workflows/release.yml`](../.forgejo/workflows/release.yml))
|
Forgejo Actions ([`../.forgejo/workflows/release.yml`](../.forgejo/workflows/release.yml))
|
||||||
builds the signed AAB/APK and uploads to Play's **internal** track. No passwords are typed.
|
builds the signed AAB/APK and uploads to Play's **production** track at **100%
|
||||||
|
rollout**. No passwords are typed. Because a tag now publishes to everyone
|
||||||
|
(subject to Google review), run the [manual smoke test](#manual-smoke-test-before-shipping)
|
||||||
|
**before** tagging. To stage on the internal track first, run
|
||||||
|
`bundle exec fastlane deploy_internal` by hand.
|
||||||
|
|
||||||
## Versioning
|
## Versioning
|
||||||
|
|
||||||
|
|
@ -123,13 +127,42 @@ listing (titles, descriptions, changelogs, screenshots) is read straight from
|
||||||
`fastlane/metadata/android/`. Data Safety and content-rating answers:
|
`fastlane/metadata/android/`. Data Safety and content-rating answers:
|
||||||
[`legal/internal/play-compliance.md`](legal/internal/play-compliance.md).
|
[`legal/internal/play-compliance.md`](legal/internal/play-compliance.md).
|
||||||
|
|
||||||
|
Lanes:
|
||||||
|
- `deploy_play` — upload the AAB to **production** at 100% (what CI runs on tag).
|
||||||
|
- `deploy_internal` — same AAB to the **internal** test track (manual QA safety net).
|
||||||
|
- `deploy_metadata` — push only the store listing (no binary).
|
||||||
|
- `promote_production` — promote an internal release to production without a rebuild.
|
||||||
|
|
||||||
|
### Country/region availability (Play Console, not this repo)
|
||||||
|
|
||||||
|
Which countries the app is offered in is **not** in the repo and `fastlane supply`
|
||||||
|
does not manage it — it's a Play Console setting. To add countries:
|
||||||
|
**Play Console → (Tane) → Production → Countries / regions → Add countries/regions**
|
||||||
|
(under "Availability"). Play asks you to pick countries when you first move a
|
||||||
|
release to production; widen the list there for new markets.
|
||||||
|
|
||||||
|
Note: the locales under `fastlane/metadata/android/<locale>` (`en-US`, `es-ES`)
|
||||||
|
are **listing languages**, not countries — adding a locale improves the store
|
||||||
|
page but does not by itself make the app available in a new country.
|
||||||
|
|
||||||
## Publish to F-Droid (official repo)
|
## Publish to F-Droid (official repo)
|
||||||
|
|
||||||
|
**Tane is live in F-Droid** since 2026-07-28 (v0.1.16, no antifeatures):
|
||||||
|
<https://f-droid.org/packages/org.comunes.tane/>. The inclusion MR
|
||||||
|
([43144](https://gitlab.com/fdroid/fdroiddata/-/merge_requests/43144)) was merged
|
||||||
|
on 2026-07-25; from now on each release only needs the recipe in `fdroiddata`
|
||||||
|
master bumped, not a new inclusion request. Note that publication lags the green
|
||||||
|
build by a day or two — check `repo/status/build.json` before assuming breakage.
|
||||||
|
|
||||||
F-Droid builds from source after a merge request to `fdroiddata`. The build recipe
|
F-Droid builds from source after a merge request to `fdroiddata`. The build recipe
|
||||||
is kept in-repo at [`fdroid/org.comunes.tane.yml`](fdroid/org.comunes.tane.yml).
|
is kept in-repo at [`fdroid/org.comunes.tane.yml`](fdroid/org.comunes.tane.yml).
|
||||||
Copy it to `metadata/org.comunes.tane.yml` in a fork of fdroiddata, validate with
|
Copy it to `metadata/org.comunes.tane.yml` in a fork of fdroiddata, validate with
|
||||||
`fdroid lint` / `fdroid build -l org.comunes.tane`, then open the MR
|
`fdroid lint` / `fdroid build -l org.comunes.tane`, then open the MR.
|
||||||
([43144](https://gitlab.com/fdroid/fdroiddata/-/merge_requests/43144)).
|
|
||||||
|
Every version bump **must** advance the recipe's per-ABI `versionCode`s
|
||||||
|
(`build × 10 + ABI offset`) together with the `pubspec.yaml` bump — otherwise the
|
||||||
|
`fdroid_reference` job fails, and a bad tag cannot be fixed by re-tagging (Play
|
||||||
|
rejects a reused versionCode): cut the next version instead.
|
||||||
|
|
||||||
**Reproducible, developer-signed.** The recipe pins `AllowedAPKSigningKeys` (the
|
**Reproducible, developer-signed.** The recipe pins `AllowedAPKSigningKeys` (the
|
||||||
SHA-256 of the tane-upload certificate) and a `binary:` URL per ABI. F-Droid
|
SHA-256 of the tane-upload certificate) and a `binary:` URL per ABI. F-Droid
|
||||||
|
|
|
||||||
|
|
@ -39,9 +39,10 @@ still do it with notebooks and spreadsheets.
|
||||||
- **Your data is yours.** Your information is kept on **your own phone**, protected with a
|
- **Your data is yours.** Your information is kept on **your own phone**, protected with a
|
||||||
key, not on some company's computers. We don't sell it or upload it anywhere. No ads.
|
key, not on some company's computers. We don't sell it or upload it anywhere. No ads.
|
||||||
- **No one can shut it down or control it.** There's no central computer that everything
|
- **No one can shut it down or control it.** There's no central computer that everything
|
||||||
passes through: people communicate **directly with each other**, like passing seeds from
|
passes through: what you share travels over **community servers**, run by people and
|
||||||
hand to hand. So no one can censor it or charge you to use it (that's what being
|
collectives — there are many, and anyone can add their own — so none of them is a center
|
||||||
**decentralized** means).
|
that could censor it or charge you to use it, like passing seeds from hand to hand
|
||||||
|
(that's what being **decentralized** means).
|
||||||
- **You trust by word of mouth.** You deal with people you know and with those vouched for
|
- **You trust by word of mouth.** You deal with people you know and with those vouched for
|
||||||
by people you trust — the way it's always worked in a village or at a fair — without
|
by people you trust — the way it's always worked in a village or at a fair — without
|
||||||
having to give your real name or phone number unless you want to.
|
having to give your real name or phone number unless you want to.
|
||||||
|
|
|
||||||
89
fdroid-ci/config.yml
Normal file
89
fdroid-ci/config.yml
Normal file
|
|
@ -0,0 +1,89 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
repo_url: "https://f-droid.org/repo"
|
||||||
|
repo_maxage: 14
|
||||||
|
repo_web_base_url: "https://f-droid.org/packages"
|
||||||
|
|
||||||
|
# needed until this is fixed: https://gitlab.com/fdroid/fdroidserver/-/issues/1143
|
||||||
|
repo_name: "F-Droid"
|
||||||
|
|
||||||
|
archive_older: 3
|
||||||
|
|
||||||
|
repo_keyalias: ciarang
|
||||||
|
repo_key_sha256: 43238d512c1e5eb2d6569f4a3afbf5523418b82e0a3ed1552770abb9a9c9ccab
|
||||||
|
repo_pubkey: 3082035e30820246a00302010202044c49cd00300d06092a864886f70d01010505003071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b73301e170d3130303732333137313032345a170d3337313230383137313032345a3071310b300906035504061302554b3110300e06035504081307556e6b6e6f776e3111300f0603550407130857657468657262793110300e060355040a1307556e6b6e6f776e3110300e060355040b1307556e6b6e6f776e311930170603550403131043696172616e2047756c746e69656b7330820122300d06092a864886f70d01010105000382010f003082010a028201010096d075e47c014e7822c89fd67f795d23203e2a8843f53ba4e6b1bf5f2fd0e225938267cfcae7fbf4fe596346afbaf4070fdb91f66fbcdf2348a3d92430502824f80517b156fab00809bdc8e631bfa9afd42d9045ab5fd6d28d9e140afc1300917b19b7c6c4df4a494cf1f7cb4a63c80d734265d735af9e4f09455f427aa65a53563f87b336ca2c19d244fcbba617ba0b19e56ed34afe0b253ab91e2fdb1271f1b9e3c3232027ed8862a112f0706e234cf236914b939bcf959821ecb2a6c18057e070de3428046d94b175e1d89bd795e535499a091f5bc65a79d539a8d43891ec504058acb28c08393b5718b57600a211e803f4a634e5c57f25b9b8c4422c6fd90203010001300d06092a864886f70d0101050500038201010008e4ef699e9807677ff56753da73efb2390d5ae2c17e4db691d5df7a7b60fc071ae509c5414be7d5da74df2811e83d3668c4a0b1abc84b9fa7d96b4cdf30bba68517ad2a93e233b042972ac0553a4801c9ebe07bf57ebe9a3b3d6d663965260e50f3b8f46db0531761e60340a2bddc3426098397fda54044a17e5244549f9869b460ca5e6e216b6f6a2db0580b480ca2afe6ec6b46eedacfa4aa45038809ece0c5978653d6c85f678e7f5a2156d1bedd8117751e64a4b0dcd140f3040b021821a8d93aed8d01ba36db6c82372211fed714d9a32607038cdfd565bd529ffc637212aaa2c224ef22b603eccefb5bf1e085c191d4b24fe742b17ab3f55d4e6f05ef
|
||||||
|
|
||||||
|
gpgkey: 37D2C98789D8311948394E3E41E7044E1DBA2E89
|
||||||
|
gpghome: {env: gpghome}
|
||||||
|
|
||||||
|
keystore: {env: keystore}
|
||||||
|
keydname: "CN=FDroid, OU=FDroid, O=fdroid.org, L=ORG, S=ORG, C=UK"
|
||||||
|
keystorepass: {env: keystorepass}
|
||||||
|
keypass: {env: keypass}
|
||||||
|
|
||||||
|
serverwebroot: {env: serverwebroot}
|
||||||
|
nonstandardwebroot: true
|
||||||
|
|
||||||
|
deploy_process_logs: true
|
||||||
|
keep_when_not_allowed: true
|
||||||
|
make_current_version_link: false
|
||||||
|
refresh_scanner: true
|
||||||
|
|
||||||
|
binary_transparency_remote: git@gitlab.com:fdroid/f-droid.org-transparency-log.git
|
||||||
|
|
||||||
|
keyaliases:
|
||||||
|
com.ghostsq.commander.samba: '@com.ghostsq.commander'
|
||||||
|
com.nextcloud.talk2: '@com.nextcloud.client'
|
||||||
|
com.termux.api: '@com.termux'
|
||||||
|
com.termux.boot: '@com.termux'
|
||||||
|
com.termux.gui: '@com.termux'
|
||||||
|
com.termux.styling: '@com.termux'
|
||||||
|
com.termux.tasker: '@com.termux'
|
||||||
|
com.termux.widget: '@com.termux'
|
||||||
|
com.termux.window: '@com.termux'
|
||||||
|
org.fdroid.fdroid.privileged: 'ciarang'
|
||||||
|
org.fdroid.fdroid: 'ciarang'
|
||||||
|
|
||||||
|
# APKs signed by publicly available private signing keys are not
|
||||||
|
# allowed to be included in this repo, even if they are reproducible.
|
||||||
|
#
|
||||||
|
# Hash calculated with `openssl x509 -in <pem file> -outform der | sha256sum`
|
||||||
|
apk_signing_key_block_list:
|
||||||
|
# https://android.googlesource.com/platform/build/+/refs/heads/main/target/product/security
|
||||||
|
- a6ccc500ff0e7421200eb66a7fe174ef1b00e52ca91727070cbedf061ff76c35 # AOSP bluetooth.x509.pem
|
||||||
|
- ce7b2b47ae2b7552c8f92cc29124279883041fb623a5f194a82c9bf15d492aa0 # AOSP cts_uicc_2021.x509.pem
|
||||||
|
- 465983f7791f2abeb43ea2cbdc7f21a8260b72bc08a55c839fc1a43bc741a81e # AOSP media.x509.pem
|
||||||
|
- e1dbadce60dc080d15b58a014b0dcf9400e24de23fa00b287a5a982bfebda2ee # AOSP networkstack.x509.pem
|
||||||
|
- fae9122a8721d6e2a196d2224dffcf773c9127e2bb956cbddb40b009192ffdfd # AOSP nfc.x509.pem
|
||||||
|
- c8a2e9bccf597c2fb6dc66bee293fc13f2fc47ec77bc6b2b0d52c11f51192ab8 # AOSP platform.x509.pem
|
||||||
|
- abf21f9e2af1d881cc673fddcefa6ed9c269a437bd64b279cf45844cfd589126 # AOSP sdk_sandbox.x509.pem
|
||||||
|
- 28bbfe4a7b97e74681dc55c2fbb6ccb8d6c74963733f6af6ae74d8c3a6e879fd # AOSP shared.x509.pem
|
||||||
|
- a40da80a59d170caa950cf15c18c454d47a39b26989d8b640ecd745ba71bf5dc # AOSP testkey.x509.pem
|
||||||
|
# Leaked Platform Certificates https://bugs.chromium.org/p/apvi/issues/detail?id=100
|
||||||
|
- 2464ddfefa071f268ea7667123df05ead2293272ff2a64d9cee021c38b46c6af
|
||||||
|
- 2bfa22964760a25d99ab9a14910e44fe2063b51d5b4ac2e4282573ce94996aa3
|
||||||
|
- 34df0e7a9f1cf1892e45c056b4973cd81ccf148a4050d11aea4ac5a65f900a42
|
||||||
|
- 369c38b18401ea16785f11720e37d7a2bc5a4d209e76955c0858ea469ad62fdf
|
||||||
|
- 4274243d7a954ac6482866f0cc67ca1843ca94d68a0ee53f837d6740a8134421
|
||||||
|
- 5304915c4bb7baca28776231993996fde1baffcbbe6500fb0fc7f2d3a2888cb7
|
||||||
|
- 9200c550f2374706eff37e3a8674bc03aeba8b25c052de638972ab94365af0a2
|
||||||
|
- 9fc510e167d8d312e758273285414e77edac9fed944741f5682be92501f095d4
|
||||||
|
- a7a0e10a61a5af93624376df60e9def9436358f50aa6174e5423633b856e2be1
|
||||||
|
- b01dcea669eefdd991fc6a24678a8b6e6a6d0ad8986950328c69d0eea1dec0d5
|
||||||
|
# publicly available in https://github.com/esabook/auzen-android
|
||||||
|
- 30d7eef6321f81f43c008665abc46f680006be6e89961481ed4e1d6981b8e5a0
|
||||||
|
# publicly available in https://github.com/Goooler/LawnchairRelease
|
||||||
|
- 8f5b1353db08cd9287f8ecc6bad2eb9be2668d476af90415bd7bfdff257840e4
|
||||||
|
# publicly available in https://github.com/jkas-dbt/AndroidPE
|
||||||
|
- f1881e27ceb9b4341a0fc00db27bf5f46a38e4c0c1884353f76b0fe4b0e4dccf
|
||||||
|
# publicly available in https://github.com/iebb/NekokoLPA
|
||||||
|
- 6966004ad0161165335f9204f8f5a52df49fe068c9545c0c589c23221af8d3a4
|
||||||
|
- 4139278AACCE8338C03DC9A6B0172C1880E0A4949FF3E05292C2E781765026FA
|
||||||
|
# publicly available in https://github.com/MaYiFei1995/PackageViewer
|
||||||
|
- 24117de73612bcfeaf2a6a24bd044f2e33e52d41965f504d74177f4fe255eb26
|
||||||
|
# publicly available in https://github.com/teambtcmap/btcmap-android
|
||||||
|
- 37cdf8e8fdff2252681c1f7d68f3850f916f05607442c6762f86f6a23a7c1ad0
|
||||||
|
# publicly available in https://github.com/Ashinch/ReadYou/blob/0.11.1/signature/keystore.properties
|
||||||
|
- 715696914a35366d98fa45312af96811f7e6de4085b5e4709f4c1e74f8bde4d0
|
||||||
|
# Privacy QR Scanner leaked key
|
||||||
|
- 2529f2fd61ac279806b7bc423daef5b36fdac496c87ff9fa36c8bdeead12acaa
|
||||||
2
fdroid-ci/srclibs/flutter.yml
Normal file
2
fdroid-ci/srclibs/flutter.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
RepoType: git
|
||||||
|
Repo: https://github.com/flutter/flutter.git
|
||||||
2
fdroid-ci/srclibs/tesseract4android.yml
Normal file
2
fdroid-ci/srclibs/tesseract4android.yml
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
RepoType: git
|
||||||
|
Repo: https://github.com/adaptech-cz/Tesseract4Android
|
||||||
|
|
@ -13,10 +13,12 @@ class NostrOfferTransport implements OfferTransport {
|
||||||
final NostrChannel _conn;
|
final NostrChannel _conn;
|
||||||
final Nip99Codec _codec = Nip99Codec();
|
final Nip99Codec _codec = Nip99Codec();
|
||||||
|
|
||||||
Filter _filter(DiscoveryQuery q) => Filter(
|
Filter _filter(DiscoveryQuery q, {int? since}) => Filter(
|
||||||
kinds: const [Nip99Codec.kindActive],
|
kinds: const [Nip99Codec.kindActive],
|
||||||
tagFilters: {'g': [q.geohashPrefix]},
|
tagFilters: {'g': [q.geohashPrefix]},
|
||||||
limit: q.limit,
|
limit: q.limit,
|
||||||
|
since: since,
|
||||||
|
until: q.until,
|
||||||
);
|
);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
@ -37,11 +39,35 @@ class NostrOfferTransport implements OfferTransport {
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Stream<Offer> discover(DiscoveryQuery query) => _conn
|
Stream<Offer> discover(DiscoveryQuery query, {int? since}) => _conn
|
||||||
.subscribe(_filter(query))
|
.subscribe(_filter(query, since: since))
|
||||||
.map(_codec.decode)
|
.map(_codec.decode)
|
||||||
.where((o) => query.types.isEmpty || query.types.contains(o.type));
|
.where((o) => query.types.isEmpty || query.types.contains(o.type));
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<OfferPage> discoverPage(DiscoveryQuery query) async {
|
||||||
|
// Newest first; the relays dedup within themselves and reqOnce dedups
|
||||||
|
// across them, but order is not guaranteed, so sort here — on a copy, as
|
||||||
|
// the channel may hand out an unmodifiable list.
|
||||||
|
final events = [...await _conn.reqOnce(_filter(query))]
|
||||||
|
..sort((a, b) => b.createdAt.compareTo(a.createdAt));
|
||||||
|
final offers = <Offer>[];
|
||||||
|
for (final e in events) {
|
||||||
|
final offer = _codec.decode(e);
|
||||||
|
if (_matchesType(offer, query)) offers.add(offer);
|
||||||
|
}
|
||||||
|
// A full page means more may exist older than the oldest event we saw; a
|
||||||
|
// short page means we've reached the end. Base the cursor on ALL events
|
||||||
|
// (not just type-matched ones) so type filtering never makes us re-fetch.
|
||||||
|
final nextCursor = events.length >= query.limit && events.isNotEmpty
|
||||||
|
? events.last.createdAt - 1
|
||||||
|
: null;
|
||||||
|
return OfferPage(offers: offers, nextCursor: nextCursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool _matchesType(Offer o, DiscoveryQuery q) =>
|
||||||
|
q.types.isEmpty || q.types.contains(o.type);
|
||||||
|
|
||||||
/// Collects matches up to EOSE (tests/one-shot browse).
|
/// Collects matches up to EOSE (tests/one-shot browse).
|
||||||
Future<List<Offer>> discoverUntilEose(DiscoveryQuery query) async {
|
Future<List<Offer>> discoverUntilEose(DiscoveryQuery query) async {
|
||||||
final events = await _conn.reqOnce(_filter(query));
|
final events = await _conn.reqOnce(_filter(query));
|
||||||
|
|
|
||||||
|
|
@ -26,19 +26,32 @@ class RelayPool implements NostrChannel {
|
||||||
/// Number of relays currently connected (for diagnostics/tests).
|
/// Number of relays currently connected (for diagnostics/tests).
|
||||||
int get relayCount => _connections.length;
|
int get relayCount => _connections.length;
|
||||||
|
|
||||||
/// Connects to each of [relayUrls], skipping any that fail. Throws
|
/// Connects to each of [relayUrls], skipping any that fail or take longer
|
||||||
/// [StateError] only when NONE are reachable, so the caller can treat that as
|
/// than [connectTimeout] — a relay on a silently-filtering network would
|
||||||
/// "offline".
|
/// otherwise hang the whole pool for minutes. Throws [StateError] only when
|
||||||
|
/// NONE are reachable, so the caller can treat that as "offline".
|
||||||
static Future<RelayPool> connect(
|
static Future<RelayPool> connect(
|
||||||
List<String> relayUrls, {
|
List<String> relayUrls, {
|
||||||
required NostrIdentity identity,
|
required NostrIdentity identity,
|
||||||
|
Duration connectTimeout = const Duration(seconds: 10),
|
||||||
}) async {
|
}) async {
|
||||||
final connections = <NostrConnection>[];
|
final connections = <NostrConnection>[];
|
||||||
await Future.wait(
|
await Future.wait(
|
||||||
relayUrls.map((url) async {
|
relayUrls.map((url) async {
|
||||||
try {
|
try {
|
||||||
|
final attempt = NostrConnection.connect(url, identity: identity);
|
||||||
connections.add(
|
connections.add(
|
||||||
await NostrConnection.connect(url, identity: identity),
|
await attempt.timeout(
|
||||||
|
connectTimeout,
|
||||||
|
onTimeout: () {
|
||||||
|
// Abandon the hung attempt; if it ever completes, close it so
|
||||||
|
// the socket doesn't leak.
|
||||||
|
unawaited(
|
||||||
|
attempt.then((c) => c.close()).catchError((_) {}),
|
||||||
|
);
|
||||||
|
throw TimeoutException('relay connect timed out', connectTimeout);
|
||||||
|
},
|
||||||
|
),
|
||||||
);
|
);
|
||||||
} catch (_) {
|
} catch (_) {
|
||||||
// Unreachable relay — skip it, keep the rest.
|
// Unreachable relay — skip it, keep the rest.
|
||||||
|
|
|
||||||
|
|
@ -88,10 +88,28 @@ class DiscoveryQuery {
|
||||||
required this.geohashPrefix,
|
required this.geohashPrefix,
|
||||||
this.types = const {},
|
this.types = const {},
|
||||||
this.limit = 100,
|
this.limit = 100,
|
||||||
|
this.until,
|
||||||
});
|
});
|
||||||
|
|
||||||
/// Coarse geohash prefix to search near (e.g. "u09" ≈ tens of km).
|
/// Coarse geohash prefix to search near (e.g. "u09" ≈ tens of km).
|
||||||
final String geohashPrefix;
|
final String geohashPrefix;
|
||||||
final Set<OfferType> types;
|
final Set<OfferType> types;
|
||||||
final int limit;
|
final int limit;
|
||||||
|
|
||||||
|
/// Pagination cursor (NIP-01 `until`): return only offers published at or
|
||||||
|
/// before this Unix time (seconds). Null asks for the newest page. Comes from
|
||||||
|
/// the previous page's [OfferPage.nextCursor].
|
||||||
|
final int? until;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// One page of discovered offers plus the cursor to fetch the next (older) page.
|
||||||
|
class OfferPage {
|
||||||
|
const OfferPage({required this.offers, this.nextCursor});
|
||||||
|
|
||||||
|
/// The page's offers, newest first.
|
||||||
|
final List<Offer> offers;
|
||||||
|
|
||||||
|
/// Pass as the next query's [DiscoveryQuery.until] to page further back. Null
|
||||||
|
/// when the relays returned less than a full page — there is nothing older.
|
||||||
|
final int? nextCursor;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,16 @@ abstract interface class OfferTransport {
|
||||||
Future<PublishResult> publish(Offer offer);
|
Future<PublishResult> publish(Offer offer);
|
||||||
|
|
||||||
/// Streams offers matching [query]: stored matches first, then live ones,
|
/// Streams offers matching [query]: stored matches first, then live ones,
|
||||||
/// until the caller cancels the subscription.
|
/// until the caller cancels the subscription. Pass [since] (Unix seconds) to
|
||||||
Stream<Offer> discover(DiscoveryQuery query);
|
/// stream only offers published after it — used to keep a live subscription
|
||||||
|
/// for NEW offers while older ones are browsed via [discoverPage].
|
||||||
|
Stream<Offer> discover(DiscoveryQuery query, {int? since});
|
||||||
|
|
||||||
|
/// Fetches ONE page of stored offers matching [query] (up to EOSE), newest
|
||||||
|
/// first, with a cursor to page further back. Bounded — unlike [discover] it
|
||||||
|
/// does not hold a live subscription — so the UI can scroll a large result
|
||||||
|
/// set without accumulating every offer in memory.
|
||||||
|
Future<OfferPage> discoverPage(DiscoveryQuery query);
|
||||||
|
|
||||||
/// Retracts a previously published offer (relays that already replicated it
|
/// Retracts a previously published offer (relays that already replicated it
|
||||||
/// drop it over time).
|
/// drop it over time).
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,109 @@
|
||||||
|
import 'package:commons_core/commons_core.dart';
|
||||||
|
import 'package:nostr/nostr.dart';
|
||||||
|
import 'package:test/test.dart';
|
||||||
|
|
||||||
|
/// A stand-in relay channel: [reqOnce] honours the filter's `until` and `limit`
|
||||||
|
/// (newest first), like a relay serving stored events, so [discoverPage]'s
|
||||||
|
/// ordering and cursor maths can be asserted deterministically.
|
||||||
|
class _FakeChannel implements NostrChannel {
|
||||||
|
_FakeChannel(this._events);
|
||||||
|
|
||||||
|
final List<Event> _events;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Future<List<Event>> reqOnce(Filter filter) async {
|
||||||
|
final until = filter.until;
|
||||||
|
final matched = _events
|
||||||
|
.where((e) => until == null || e.createdAt <= until)
|
||||||
|
.toList()
|
||||||
|
..sort((a, b) => b.createdAt.compareTo(a.createdAt));
|
||||||
|
return matched.take(filter.limit ?? matched.length).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String get privateKeyHex => '00' * 32;
|
||||||
|
@override
|
||||||
|
String get publicKeyHex => 'ab' * 32;
|
||||||
|
@override
|
||||||
|
Future<({bool accepted, String message})> publish(Event event) async =>
|
||||||
|
(accepted: true, message: '');
|
||||||
|
@override
|
||||||
|
Stream<Event> subscribe(Filter filter) => const Stream.empty();
|
||||||
|
@override
|
||||||
|
Future<void> close() async {}
|
||||||
|
}
|
||||||
|
|
||||||
|
Event _evt(String id, int createdAt, {String type = 'gift'}) => Event(
|
||||||
|
'evt-$id',
|
||||||
|
'ab' * 32,
|
||||||
|
createdAt,
|
||||||
|
Nip99Codec.kindActive,
|
||||||
|
[
|
||||||
|
['d', id],
|
||||||
|
['g', 'sp3e9'],
|
||||||
|
['offer_type', type],
|
||||||
|
['title', 'offer $id'],
|
||||||
|
],
|
||||||
|
'offer $id',
|
||||||
|
'00' * 64,
|
||||||
|
verify: false,
|
||||||
|
);
|
||||||
|
|
||||||
|
void main() {
|
||||||
|
group('NostrOfferTransport.discoverPage', () {
|
||||||
|
test('returns offers newest-first with a cursor to the older page',
|
||||||
|
() async {
|
||||||
|
final transport = NostrOfferTransport(_FakeChannel([
|
||||||
|
_evt('a', 100), // oldest
|
||||||
|
_evt('c', 300), // newest
|
||||||
|
_evt('b', 200),
|
||||||
|
]));
|
||||||
|
|
||||||
|
final page1 = await transport.discoverPage(
|
||||||
|
const DiscoveryQuery(geohashPrefix: 'sp3e9', limit: 2),
|
||||||
|
);
|
||||||
|
// A full page (2 of the 3) sorted newest-first, with a cursor set.
|
||||||
|
expect(page1.offers.map((o) => o.id), ['c', 'b']);
|
||||||
|
expect(page1.nextCursor, 199, reason: 'oldest kept (200) minus one');
|
||||||
|
|
||||||
|
final page2 = await transport.discoverPage(
|
||||||
|
DiscoveryQuery(geohashPrefix: 'sp3e9', limit: 2, until: page1.nextCursor),
|
||||||
|
);
|
||||||
|
// Only the last one remains — a short page, so nothing older.
|
||||||
|
expect(page2.offers.map((o) => o.id), ['a']);
|
||||||
|
expect(page2.nextCursor, isNull);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('a short first page reports no next cursor', () async {
|
||||||
|
final transport = NostrOfferTransport(_FakeChannel([
|
||||||
|
_evt('a', 100),
|
||||||
|
_evt('b', 200),
|
||||||
|
]));
|
||||||
|
final page = await transport.discoverPage(
|
||||||
|
const DiscoveryQuery(geohashPrefix: 'sp3e9', limit: 100),
|
||||||
|
);
|
||||||
|
expect(page.offers, hasLength(2));
|
||||||
|
expect(page.nextCursor, isNull);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('type filtering narrows the offers but not the cursor', () async {
|
||||||
|
// A full page of gifts with one sale mixed in; asking for sales only must
|
||||||
|
// still advance the cursor by the oldest EVENT seen, not the oldest match,
|
||||||
|
// so paging never skips unmatched offers.
|
||||||
|
final transport = NostrOfferTransport(_FakeChannel([
|
||||||
|
_evt('g1', 300),
|
||||||
|
_evt('s1', 200, type: 'sale'),
|
||||||
|
_evt('g2', 100),
|
||||||
|
]));
|
||||||
|
final page = await transport.discoverPage(
|
||||||
|
const DiscoveryQuery(
|
||||||
|
geohashPrefix: 'sp3e9',
|
||||||
|
limit: 3,
|
||||||
|
types: {OfferType.sale},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
expect(page.offers.map((o) => o.id), ['s1']);
|
||||||
|
expect(page.nextCursor, 99, reason: 'oldest event (100) minus one');
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'dart:io';
|
||||||
import 'dart:typed_data';
|
import 'dart:typed_data';
|
||||||
|
|
||||||
import 'package:commons_core/commons_core.dart';
|
import 'package:commons_core/commons_core.dart';
|
||||||
|
|
@ -58,6 +59,38 @@ void main() {
|
||||||
await r1.stop();
|
await r1.stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('a hung relay cannot stall the pool past the connect timeout', () async {
|
||||||
|
// A server that accepts TCP but never answers the WebSocket handshake —
|
||||||
|
// the shape of a silently-filtered network, where connect hangs for minutes.
|
||||||
|
final hang = await ServerSocket.bind(InternetAddress.loopbackIPv4, 0);
|
||||||
|
final held = <Socket>[];
|
||||||
|
hang.listen(held.add);
|
||||||
|
final r1 = await MiniRelay.start();
|
||||||
|
final alice = await idFor(5);
|
||||||
|
|
||||||
|
final sw = Stopwatch()..start();
|
||||||
|
final pool = await RelayPool.connect(
|
||||||
|
[r1.url, 'ws://127.0.0.1:${hang.port}'],
|
||||||
|
identity: alice,
|
||||||
|
connectTimeout: const Duration(milliseconds: 500),
|
||||||
|
);
|
||||||
|
sw.stop();
|
||||||
|
|
||||||
|
expect(pool.relayCount, 1, reason: 'the live relay is kept');
|
||||||
|
expect(
|
||||||
|
sw.elapsed,
|
||||||
|
lessThan(const Duration(seconds: 5)),
|
||||||
|
reason: 'the hung relay must not stall the whole pool',
|
||||||
|
);
|
||||||
|
|
||||||
|
await pool.close();
|
||||||
|
for (final s in held) {
|
||||||
|
s.destroy();
|
||||||
|
}
|
||||||
|
await hang.close();
|
||||||
|
await r1.stop();
|
||||||
|
});
|
||||||
|
|
||||||
test('throws when no relay is reachable (caller treats as offline)', () async {
|
test('throws when no relay is reachable (caller treats as offline)', () async {
|
||||||
final alice = await idFor(4);
|
final alice = await idFor(4);
|
||||||
expect(
|
expect(
|
||||||
|
|
|
||||||
|
|
@ -71,15 +71,65 @@ a { color: var(--green); }
|
||||||
}
|
}
|
||||||
.site-nav a { color: #fff; text-decoration: none; opacity: .95; white-space: nowrap; }
|
.site-nav a { color: #fff; text-decoration: none; opacity: .95; white-space: nowrap; }
|
||||||
.site-nav a:hover { text-decoration: underline; }
|
.site-nav a:hover { text-decoration: underline; }
|
||||||
.lang-switch { display: inline-flex; gap: .6rem; font-size: .92rem; white-space: nowrap; }
|
/* A typical globe+code language menu (<details>/<summary>, no JS) instead of
|
||||||
.lang-switch .current { opacity: .7; }
|
spelling out every language name in the header — scales past 3 languages
|
||||||
.lang-switch a.lang { color: #fff; }
|
without crowding the About/Legal links. */
|
||||||
|
.lang-switch {
|
||||||
|
position: relative;
|
||||||
|
font-size: .9rem;
|
||||||
|
}
|
||||||
|
.lang-switch summary {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: .35rem;
|
||||||
|
cursor: pointer;
|
||||||
|
list-style: none;
|
||||||
|
padding: .3rem .6rem;
|
||||||
|
border-radius: 999px;
|
||||||
|
border: 1px solid rgba(255, 255, 255, .4);
|
||||||
|
color: #fff;
|
||||||
|
}
|
||||||
|
.lang-switch summary::-webkit-details-marker { display: none; }
|
||||||
|
.lang-switch summary::after { content: "▾"; font-size: .7em; opacity: .85; }
|
||||||
|
.lang-switch[open] summary::after { content: "▴"; }
|
||||||
|
.lang-switch summary:hover { border-color: #fff; }
|
||||||
|
.lang-code { font-weight: 600; letter-spacing: .02em; }
|
||||||
|
.lang-menu {
|
||||||
|
position: absolute;
|
||||||
|
inset-inline-end: 0;
|
||||||
|
top: calc(100% + .4rem);
|
||||||
|
margin: 0;
|
||||||
|
padding: .35rem;
|
||||||
|
list-style: none;
|
||||||
|
min-width: 9rem;
|
||||||
|
background: #fff;
|
||||||
|
color: var(--title);
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
.lang-menu li + li { margin-top: .1rem; }
|
||||||
|
.lang-menu a.lang,
|
||||||
|
.lang-menu span.current {
|
||||||
|
display: block;
|
||||||
|
padding: .45rem .6rem;
|
||||||
|
border-radius: 6px;
|
||||||
|
text-decoration: none;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
.lang-menu a.lang { color: var(--title); }
|
||||||
|
.lang-menu a.lang:hover { background: var(--container); }
|
||||||
|
.lang-menu span.current { color: var(--muted); font-weight: 600; }
|
||||||
|
|
||||||
/* Narrow phones: brand on its own row, nav wraps beneath it, left-aligned. */
|
/* Narrow phones: shrink a bit, but only wrap the nav below the brand if it
|
||||||
|
actually stops fitting — the language menu is a compact pill now, not
|
||||||
|
three spelled-out language names, so it fits alongside "About Legal" down
|
||||||
|
to fairly small widths. flex-wrap on .site-header handles the overflow
|
||||||
|
case on its own; no need to force it. */
|
||||||
@media (max-width: 560px) {
|
@media (max-width: 560px) {
|
||||||
.site-header { gap: .5rem; }
|
.site-header { gap: .5rem; }
|
||||||
.brand { font-size: 1.15rem; }
|
.brand { font-size: 1.15rem; }
|
||||||
.site-nav { width: 100%; gap: .4rem 1rem; font-size: .95rem; }
|
.site-nav { gap: .4rem 1rem; font-size: .95rem; }
|
||||||
}
|
}
|
||||||
|
|
||||||
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
|
main { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2rem); }
|
||||||
|
|
@ -169,7 +219,14 @@ h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--green-dark); }
|
||||||
.values li { margin: .45rem 0; }
|
.values li { margin: .45rem 0; }
|
||||||
|
|
||||||
.get-it { text-align: center; }
|
.get-it { text-align: center; }
|
||||||
.store-badges { margin-top: 1.2rem; }
|
.store-badges {
|
||||||
|
margin-top: 1.2rem;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: .6rem;
|
||||||
|
justify-content: inherit;
|
||||||
|
}
|
||||||
|
.get-it .store-badges { justify-content: center; }
|
||||||
.coming-soon { color: var(--muted); font-style: italic; }
|
.coming-soon { color: var(--muted); font-style: italic; }
|
||||||
.badge {
|
.badge {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
@ -181,6 +238,14 @@ h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); color: var(--green-dark); }
|
||||||
margin: .3rem;
|
margin: .3rem;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
|
/* Store links: same pill, one-colour icon so Play and F-Droid read apart. */
|
||||||
|
.badge-store {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: .55rem;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.badge-store .store-icon { flex: none; }
|
||||||
|
|
||||||
/* Legal docs */
|
/* Legal docs */
|
||||||
.doc { padding: 2rem 0 3rem; max-width: 760px; }
|
.doc { padding: 2rem 0 3rem; max-width: 760px; }
|
||||||
|
|
|
||||||
|
|
@ -11,12 +11,12 @@ site_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
legal_src="$(cd "$site_dir/../docs/legal" && pwd)"
|
legal_src="$(cd "$site_dir/../docs/legal" && pwd)"
|
||||||
out="$site_dir/content/legal"
|
out="$site_dir/content/legal"
|
||||||
|
|
||||||
# slug | English master | Spanish mirror | menu weight
|
# slug | English master | Spanish mirror | Portuguese mirror | menu weight
|
||||||
rows=(
|
rows=(
|
||||||
"privacy|privacy-policy.md|politica-de-privacidad.md|1"
|
"privacy|privacy-policy.md|politica-de-privacidad.md|politica-de-privacidade.md|1"
|
||||||
"terms|terms-of-use.md|condiciones-de-uso.md|2"
|
"terms|terms-of-use.md|condiciones-de-uso.md|termos-de-uso.md|2"
|
||||||
"rules|community-rules.md|normas-de-la-comunidad.md|3"
|
"rules|community-rules.md|normas-de-la-comunidad.md|normas-da-comunidade.md|3"
|
||||||
"seeds|seed-legality-notice.md|aviso-sobre-semillas.md|4"
|
"seeds|seed-legality-notice.md|aviso-sobre-semillas.md|aviso-sobre-sementes.md|4"
|
||||||
)
|
)
|
||||||
|
|
||||||
emit() { # <src-md> <out-md> <slug> <weight>
|
emit() { # <src-md> <out-md> <slug> <weight>
|
||||||
|
|
@ -40,9 +40,10 @@ emit() { # <src-md> <out-md> <slug> <weight>
|
||||||
}
|
}
|
||||||
|
|
||||||
for row in "${rows[@]}"; do
|
for row in "${rows[@]}"; do
|
||||||
IFS='|' read -r slug en es weight <<<"$row"
|
IFS='|' read -r slug en es pt weight <<<"$row"
|
||||||
emit "$legal_src/$en" "$out/$slug.en.md" "$slug" "$weight"
|
emit "$legal_src/$en" "$out/$slug.en.md" "$slug" "$weight"
|
||||||
emit "$legal_src/es/$es" "$out/$slug.es.md" "$slug" "$weight"
|
emit "$legal_src/es/$es" "$out/$slug.es.md" "$slug" "$weight"
|
||||||
|
emit "$legal_src/pt/$pt" "$out/$slug.pt.md" "$slug" "$weight"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "Generated legal pages in $out"
|
echo "Generated legal pages in $out"
|
||||||
|
|
@ -69,3 +70,5 @@ emit_about "$docs_dir/que-es-tane.md" "$site_dir/content/about.es.md" \
|
||||||
"Qué es Tane" "Tane explicada para todos los públicos."
|
"Qué es Tane" "Tane explicada para todos los públicos."
|
||||||
emit_about "$docs_dir/what-is-tane.md" "$site_dir/content/about.en.md" \
|
emit_about "$docs_dir/what-is-tane.md" "$site_dir/content/about.en.md" \
|
||||||
"What is Tane" "Tane explained for everyone."
|
"What is Tane" "Tane explained for everyone."
|
||||||
|
emit_about "$docs_dir/o-que-e-tane.md" "$site_dir/content/about.pt.md" \
|
||||||
|
"O que é o Tane" "O Tane explicado para todos."
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue