Compare commits

...
Author SHA1 Message Date
kristianwindandClaude Opus 5.5 3c43f6181e test(e2e): klokkeslættet læses i kontoens zone, ikke i prøveprocessens
CI-runneren kører i UTC, så 09:00 i København blev læst som 08.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:40:32 +01:00
kristianwindandClaude Opus 5.5 ed30eb4c36 fix(hurtig tilføjelse): fire ting, der blev læst forkert eller tabt i stilhed
Fundet under arbejdet med genopbygnings-prompten, hvor den rigtige parser
blev kørt over en tabel af sætninger.

- "at" før et 12-timers klokkeslæt blev stående i titlen: "file the VAT
  return tomorrow at 10am" blev opgaven "file the VAT return at". Markøren
  (at, kl, klokken) hører nu med til tiden, også foran "7:30 pm".
- "køb 1/2 liter fløde" fik forfaldsdato 1. februar. En d/m efterfulgt af en
  mængdeenhed (liter, dl, kg, stk, tsk, kop, del, …) er en mængde. Uden enhed
  er det stadig en dato — "3/4" alene, "møde 3/4 med Anders" og også "3/4
  kage", fordi intet i "kage" skiller tredje april fra tre fjerdedele, og en
  dato, der stille forsvinder, er værre end en, man selv sletter.
- Et "#navn" eller "/navn", der ikke fandtes, blev klippet ud af titlen, og
  opgaven landede et andet sted uden et ord. Serveren har længe sendt
  unknown_project og unknown_section; fladen siger dem nu i en besked, også
  når en underopgave beholder sin opgaves projekt.
- Titlen i opgaveruden blev læst om, men gentagelsen blev læst under
  `parsed.recurrence`, et felt der ikke findes, så "hver mandag" forsvandt.
  Den læser nu `recurrence_rule` og tager også klokkeslæt, projekt og alarm
  med, og siger gentagelsen på læserens sprog i stedet for et fast
  "gentagelse". Alarmen lægges før rettelsen, så den skrevne ikke stables
  oven på standardalarmen.

Prøver: to nye Go-prøver i quickadd og to e2e-prøver. Fem plantede fejl,
hver fanget af sin egen prøve.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 00:32:16 +01:00
Kristian Wind ec5cf8f9f9 Merge pull request #108 from kristianwind/app-shell
CI / OpenAPI is valid (push) Successful in 11s
CI / End-to-end (push) Successful in 16m4s
CI / Docker image builds (push) Successful in 3m1s
CI / Go (push) Failing after 26m23s
feat(app): iOS-skallen — Capacitor, Xcode-projektet og et CI-job, der bygger den
2026-10-23 14:33:23 +02:00
Kristian Wind 4ddc41632b Merge pull request #107 from kristianwind/app-base
CI / OpenAPI is valid (push) Successful in 12s
CI / End-to-end (push) Failing after 16m41s
CI / Docker image builds (push) Successful in 2m50s
CI / Go (push) Failing after 26m54s
feat(app): fladen kan tale med en valgfri server, med sessionen som bearer
2026-10-23 14:28:20 +02:00
Kristian Wind 2e9a92996e Merge pull request #106 from kristianwind/app-cors
CI / OpenAPI is valid (push) Successful in 13s
CI / Go (push) Failing after 26m32s
CI / End-to-end (push) Successful in 15m7s
CI / Docker image builds (push) Successful in 2m30s
feat(app): CORS for appen, en billet til live-synk, og /ping siger hvad den er
2026-10-23 14:23:48 +02:00
kristianwindandClaude Opus 5.5 ce1e12417b feat(app): iOS-skallen — Capacitor, Xcode-projektet og et CI-job, der bygger den
Femte trin mod iOS-appen. Fladen fra trin 3 pakket ind i en rigtig app.

- `app/`: Capacitor 8 med SPM (ingen CocoaPods). `npm run sync` bygger web
  med VERDANDE_TARGET=app og kopierer det ind i Xcode-projektet; `npm run
  open` åbner det på en Mac. Bundle-id `dk.nolimit.verdande`.
- `app/ios/` er committet. Webbygget og den genererede konfiguration i det er
  ikke — sync lægger dem der.
- `NSAllowsLocalNetworking`: en hjemmeserver uden certifikat kan nås med http
  på det lokale net; alt på internettet skal stadig være https.
- Ikon og opstartsbillede tegnes fra web/static/icon.svg
  (scripts/generate-ios-assets.js). Kvadratisk og uden gennemsigtighed, fordi
  iOS runder hjørnerne selv.
- CI-jobbet "iOS app shell" bygger og synker på Linux og tjekker, at
  app-bygget ikke registrerer en service worker. Ingen Xcode i CI; det dækker
  alt op til den.
- docs/ios.md: hvordan appen adskiller sig fra en browser, hvordan den bygges,
  hvad der er ejerens skridt (Apple-konto, signering, TestFlight), og hvad der
  mangler — notifikationer via APNs venter på en beslutning om en relay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 14:21:44 +02:00
Kristian Wind 3867467f24 Merge pull request #105 from kristianwind/app-login
CI / OpenAPI is valid (push) Successful in 14s
CI / End-to-end (push) Failing after 5m50s
CI / Docker image builds (push) Successful in 3m32s
CI / Go (push) Failing after 26m58s
feat(login): appen kan logge ind og bære sin session som bearer
2026-10-23 14:08:41 +02:00
34 changed files with 2378 additions and 13 deletions
+34
View File
@@ -51,6 +51,40 @@ jobs:
- name: Build
run: CGO_ENABLED=0 go build ./...
# The iOS app's shell: the interface built the way the app carries it, and
# copied into the Xcode project. No Xcode here — that build happens on a Mac —
# but a config the CLI cannot read, a webDir that moved, or an app build that
# stopped compiling all fail at this step rather than on the day somebody sits
# down to ship.
app:
name: iOS app shell
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22"
- name: Install
run: |
(cd web && npm ci)
(cd app && npm ci)
- name: Build and sync
working-directory: app
run: npm run sync
# The app build must not register the service worker — WKWebView has none
# for the app's own scheme. The browser build registers it from index.html.
- name: No service worker in the app build
run: |
if grep -qF 'serviceWorker.register' web/build/index.html; then
echo "The app build registers a service worker in index.html."
exit 1
fi
test -f app/ios/App/App/public/index.html
echo "App build in the Xcode project: $(find app/ios/App/App/public -type f | wc -l) files."
spec:
name: OpenAPI is valid
runs-on: ubuntu-latest
+9
View File
@@ -0,0 +1,9 @@
{
"appId": "dk.nolimit.verdande",
"appName": "Verdande",
"webDir": "../web/build",
"ios": {
"contentInset": "never",
"scheme": "Verdande"
}
}
+13
View File
@@ -0,0 +1,13 @@
App/build
App/Pods
App/output
App/App/public
DerivedData
xcuserdata
# Cordova plugins for Capacitor
capacitor-cordova-ios-plugins
# Generated Config files
App/App/capacitor.config.json
App/App/config.xml
+380
View File
@@ -0,0 +1,380 @@
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 60;
objects = {
/* Begin PBXBuildFile section */
2FAD9763203C412B000D30F8 /* config.xml in Resources */ = {isa = PBXBuildFile; fileRef = 2FAD9762203C412B000D30F8 /* config.xml */; };
4D22ABE92AF431CB00220026 /* CapApp-SPM in Frameworks */ = {isa = PBXBuildFile; productRef = 4D22ABE82AF431CB00220026 /* CapApp-SPM */; };
50379B232058CBB4000EE86E /* capacitor.config.json in Resources */ = {isa = PBXBuildFile; fileRef = 50379B222058CBB4000EE86E /* capacitor.config.json */; };
504EC3081FED79650016851F /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 504EC3071FED79650016851F /* AppDelegate.swift */; };
504EC30D1FED79650016851F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30B1FED79650016851F /* Main.storyboard */; };
504EC30F1FED79650016851F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 504EC30E1FED79650016851F /* Assets.xcassets */; };
504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 504EC3101FED79650016851F /* LaunchScreen.storyboard */; };
50B271D11FEDC1A000F3C39B /* public in Resources */ = {isa = PBXBuildFile; fileRef = 50B271D01FEDC1A000F3C39B /* public */; };
9582B6832FE993A70072D4E8 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9582B6822FE993A50072D4E8 /* SceneDelegate.swift */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
2FAD9762203C412B000D30F8 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = config.xml; sourceTree = "<group>"; };
50379B222058CBB4000EE86E /* capacitor.config.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = capacitor.config.json; sourceTree = "<group>"; };
504EC3041FED79650016851F /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
504EC3071FED79650016851F /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
504EC30C1FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
504EC30E1FED79650016851F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
504EC3111FED79650016851F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
504EC3131FED79650016851F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
50B271D01FEDC1A000F3C39B /* public */ = {isa = PBXFileReference; lastKnownFileType = folder; path = public; sourceTree = "<group>"; };
9582B6822FE993A50072D4E8 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
958DCC722DB07C7200EA8C5F /* debug.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = debug.xcconfig; path = ../debug.xcconfig; sourceTree = SOURCE_ROOT; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
504EC3011FED79650016851F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4D22ABE92AF431CB00220026 /* CapApp-SPM in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
504EC2FB1FED79650016851F = {
isa = PBXGroup;
children = (
958DCC722DB07C7200EA8C5F /* debug.xcconfig */,
504EC3061FED79650016851F /* App */,
504EC3051FED79650016851F /* Products */,
);
sourceTree = "<group>";
};
504EC3051FED79650016851F /* Products */ = {
isa = PBXGroup;
children = (
504EC3041FED79650016851F /* App.app */,
);
name = Products;
sourceTree = "<group>";
};
504EC3061FED79650016851F /* App */ = {
isa = PBXGroup;
children = (
9582B6822FE993A50072D4E8 /* SceneDelegate.swift */,
50379B222058CBB4000EE86E /* capacitor.config.json */,
504EC3071FED79650016851F /* AppDelegate.swift */,
504EC30B1FED79650016851F /* Main.storyboard */,
504EC30E1FED79650016851F /* Assets.xcassets */,
504EC3101FED79650016851F /* LaunchScreen.storyboard */,
504EC3131FED79650016851F /* Info.plist */,
2FAD9762203C412B000D30F8 /* config.xml */,
50B271D01FEDC1A000F3C39B /* public */,
);
path = App;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
504EC3031FED79650016851F /* App */ = {
isa = PBXNativeTarget;
buildConfigurationList = 504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */;
buildPhases = (
504EC3001FED79650016851F /* Sources */,
504EC3011FED79650016851F /* Frameworks */,
504EC3021FED79650016851F /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = App;
packageProductDependencies = (
4D22ABE82AF431CB00220026 /* CapApp-SPM */,
);
productName = App;
productReference = 504EC3041FED79650016851F /* App.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
504EC2FC1FED79650016851F /* Project object */ = {
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0920;
TargetAttributes = {
504EC3031FED79650016851F = {
CreatedOnToolsVersion = 9.2;
LastSwiftMigration = 1100;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */;
compatibilityVersion = "Xcode 8.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 504EC2FB1FED79650016851F;
packageReferences = (
D4C12C0A2AAA248700AAC8A2 /* XCLocalSwiftPackageReference "CapApp-SPM" */,
);
productRefGroup = 504EC3051FED79650016851F /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
504EC3031FED79650016851F /* App */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
504EC3021FED79650016851F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
504EC3121FED79650016851F /* LaunchScreen.storyboard in Resources */,
50B271D11FEDC1A000F3C39B /* public in Resources */,
504EC30F1FED79650016851F /* Assets.xcassets in Resources */,
50379B232058CBB4000EE86E /* capacitor.config.json in Resources */,
504EC30D1FED79650016851F /* Main.storyboard in Resources */,
2FAD9763203C412B000D30F8 /* config.xml in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
504EC3001FED79650016851F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
504EC3081FED79650016851F /* AppDelegate.swift in Sources */,
9582B6832FE993A70072D4E8 /* SceneDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
504EC30B1FED79650016851F /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
504EC30C1FED79650016851F /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
504EC3101FED79650016851F /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
504EC3111FED79650016851F /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
504EC3141FED79650016851F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 958DCC722DB07C7200EA8C5F /* debug.xcconfig */;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
};
name = Debug;
};
504EC3151FED79650016851F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
VALIDATE_PRODUCT = YES;
};
name = Release;
};
504EC3171FED79650016851F /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 958DCC722DB07C7200EA8C5F /* debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
OTHER_SWIFT_FLAGS = "$(inherited) \"-D\" \"COCOAPODS\" \"-DDEBUG\"";
PRODUCT_BUNDLE_IDENTIFIER = dk.nolimit.verdande;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
504EC3181FED79650016851F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = App/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = dk.nolimit.verdande;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
504EC2FF1FED79650016851F /* Build configuration list for PBXProject "App" */ = {
isa = XCConfigurationList;
buildConfigurations = (
504EC3141FED79650016851F /* Debug */,
504EC3151FED79650016851F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
504EC3161FED79650016851F /* Build configuration list for PBXNativeTarget "App" */ = {
isa = XCConfigurationList;
buildConfigurations = (
504EC3171FED79650016851F /* Debug */,
504EC3181FED79650016851F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCLocalSwiftPackageReference section */
D4C12C0A2AAA248700AAC8A2 /* XCLocalSwiftPackageReference "CapApp-SPM" */ = {
isa = XCLocalSwiftPackageReference;
relativePath = "CapApp-SPM";
};
/* End XCLocalSwiftPackageReference section */
/* Begin XCSwiftPackageProductDependency section */
4D22ABE82AF431CB00220026 /* CapApp-SPM */ = {
isa = XCSwiftPackageProductDependency;
package = D4C12C0A2AAA248700AAC8A2 /* XCLocalSwiftPackageReference "CapApp-SPM" */;
productName = "CapApp-SPM";
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 504EC2FC1FED79650016851F /* Project object */;
}
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
+44
View File
@@ -0,0 +1,44 @@
import UIKit
import Capacitor
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
func application(_ application: UIApplication,
configurationForConnecting connectingSceneSession: UISceneSession,
options: UIScene.ConnectionOptions) -> UISceneConfiguration {
let config = UISceneConfiguration(name: "Default Configuration",
sessionRole: connectingSceneSession.role)
config.delegateClass = SceneDelegate.self
return config
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

@@ -0,0 +1,14 @@
{
"images" : [
{
"filename" : "AppIcon-512@2x.png",
"idiom" : "universal",
"platform" : "ios",
"size" : "1024x1024"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
@@ -0,0 +1,23 @@
{
"images" : [
{
"idiom" : "universal",
"filename" : "splash-2732x2732-2.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "splash-2732x2732-1.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "splash-2732x2732.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17132" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<device id="retina4_7" orientation="portrait" appearance="light"/>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17105"/>
<capability name="System colors in document resources" minToolsVersion="11.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<imageView key="view" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="Splash" id="snD-IY-ifK">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask"/>
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
</imageView>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
<resources>
<image name="Splash" width="1366" height="1366"/>
<systemColor name="systemBackgroundColor">
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</systemColor>
</resources>
</document>
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="14111" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
</dependencies>
<scenes>
<!--Bridge View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="CAPBridgeViewController" customModule="Capacitor" sceneMemberID="viewController"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
+79
View File
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CAPACITOR_DEBUG</key>
<string>$(CAPACITOR_DEBUG)</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>Verdande</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<!-- A self-hosted Verdande on a home network may have no certificate:
http://192.168.1.20:8080 or http://verdande.local. This allows plain
http to local addresses only; anything on the internet must still be
https. -->
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<false/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).SceneDelegate</string>
<key>UISceneStoryboardFile</key>
<string>Main</string>
</dict>
</array>
</dict>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<true/>
</dict>
</plist>
+24
View File
@@ -0,0 +1,24 @@
import UIKit
import Capacitor
class SceneDelegate: UIResponder, UIWindowSceneDelegate {
var window: UIWindow?
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
guard let windowScene = scene as? UIWindowScene else { return }
window = UIWindow(windowScene: windowScene)
window?.rootViewController = CAPBridgeViewController()
window?.makeKeyAndVisible()
SceneDelegateProxy.shared.scene(scene, willConnectTo: session, options: connectionOptions)
}
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
SceneDelegateProxy.shared.scene(scene, openURLContexts: URLContexts)
}
func scene(_ scene: UIScene, continue userActivity: NSUserActivity) {
SceneDelegateProxy.shared.scene(scene, continue: userActivity)
}
}
+9
View File
@@ -0,0 +1,9 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/config/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
+25
View File
@@ -0,0 +1,25 @@
// swift-tools-version: 5.9
import PackageDescription
// DO NOT MODIFY THIS FILE - managed by Capacitor CLI commands
let package = Package(
name: "CapApp-SPM",
platforms: [.iOS(.v15)],
products: [
.library(
name: "CapApp-SPM",
targets: ["CapApp-SPM"])
],
dependencies: [
.package(url: "https://github.com/ionic-team/capacitor-swift-pm.git", exact: "8.5.3")
],
targets: [
.target(
name: "CapApp-SPM",
dependencies: [
.product(name: "Capacitor", package: "capacitor-swift-pm"),
.product(name: "Cordova", package: "capacitor-swift-pm")
]
)
]
)
+5
View File
@@ -0,0 +1,5 @@
# CapApp-SPM
This package is used to host SPM dependencies for your Capacitor project
Do not modify the contents of it or there may be unintended consequences.
@@ -0,0 +1 @@
public let isCapacitorApp = true
+1
View File
@@ -0,0 +1 @@
CAPACITOR_DEBUG = true
+1239
View File
File diff suppressed because it is too large Load Diff
+22
View File
@@ -0,0 +1,22 @@
{
"name": "verdande-app",
"version": "0.1.0",
"private": true,
"description": "The iOS app: the web interface bundled into a native shell.",
"type": "module",
"scripts": {
"build": "cd ../web && VERDANDE_TARGET=app npm run build",
"sync": "npm run build && cap sync ios",
"open": "cap open ios"
},
"dependencies": {
"@capacitor/core": "^8.5.3",
"@capacitor/ios": "^8.5.3"
},
"devDependencies": {
"@capacitor/cli": "^8.5.3"
},
"engines": {
"node": ">=22.12"
}
}
+88
View File
@@ -0,0 +1,88 @@
# The iOS app
The iOS app is the web interface bundled into a native shell with
[Capacitor](https://capacitorjs.com). It is not a second interface: the same
Svelte build runs in both, and everything that differs between a browser and the
app lives in `web/src/lib/platform.js`.
It talks to **any** Verdande server. The first screen asks for the address, checks
it with `/api/v1/ping`, and then signs in there.
## How the app differs from a browser
| | Browser | App |
|---|---|---|
| Where the interface comes from | the server | inside the app, `capacitor://localhost` |
| Which server | the one it was loaded from | the one its owner typed in |
| Session | httpOnly cookie | a session token, sent as `Authorization: Bearer` |
| Live sync | WebSocket with the cookie | WebSocket opened with a one-use ticket (`POST /ws-ticket`) |
| Pictures and downloads | plain `<img>` and links | fetched with the token and shown from a blob (`nativemedia.js`) |
| Service worker, Web Push | yes | no — WKWebView has neither |
| Passkeys | yes | not yet — a passkey is bound to the server's domain |
| Creating the first account | yes | no — done in a browser, then sign in from the app |
The server side of this is `client: "app"` on `/auth/login`, the
`capacitor://localhost` CORS rule, and the ticket. All three are in
`docs/openapi.yaml`.
An app session slides: every use moves its end forward, up to
`VERDANDE_APP_SESSION_TTL` (180 days) unused. It is listed under *Enheder* in
settings with the name the app gave itself, and can be signed out from there.
## Building
Everything up to Xcode runs anywhere, and runs in CI (`iOS app shell`):
```sh
cd app
npm ci
npm run sync # builds web with VERDANDE_TARGET=app, copies it into ios/
```
On a Mac with Xcode:
```sh
npm run open # opens ios/App/App.xcodeproj
```
Choose a simulator and press Run. In the app, type the address of a Verdande —
`http://localhost:8080` reaches a dev server on the same Mac from the simulator.
Plain `http` is allowed to **local** addresses only (`NSAllowsLocalNetworking` in
`Info.plist`), so a home server without a certificate works on the same network;
anything on the internet has to be `https`.
`app/ios/` is committed. The web build inside it (`App/App/public`) and the
generated config are not — `npm run sync` puts them there.
The icon and launch image come from `web/static/icon.svg`:
```sh
cd web && node scripts/generate-ios-assets.js
```
## Putting it on a phone
These steps are the account owner's — they involve Apple's terms, a payment and
signing keys.
1. **Apple Developer Program** membership (99 USD a year) on the Apple ID that
should own the app.
2. In Xcode → *Signing & Capabilities*: choose that team. The bundle id is
`dk.nolimit.verdande`; it can change until the first upload and never after.
3. *Product → Archive*, then *Distribute App → TestFlight*.
4. In App Store Connect, add testers to the TestFlight build.
## Not yet
- **Notifications.** Web Push does not exist in the app. Notifications on an
iPhone go through Apple's APNs, and the key that sends them is bound to the
app's bundle id — so it cannot live on every self-hosted server. That means a
small relay run by the app's publisher, which every instance with an app user
would talk to. That is a new connection from other people's servers, and it
waits on a decision before it is built.
- **The session token in the Keychain.** It is in the WebView's own storage for
now, behind one object in `platform.js` so the Keychain plugin can replace it
without anything else changing.
- **Passkeys** in the app.
- **Share sheet** (share text or a link *into* Verdande from another app).
+45 -8
View File
@@ -304,22 +304,28 @@ func extractPriority(input string, spans []Span) (int, []Span) {
var (
// An explicit marker: "kl 10", "kl. 10:30", "klokken 16", "at 9.15".
reTimeMarked = regexp.MustCompile(`(?i)(?:^|\s)(kl\.?|klokken|at)\s*(\d{1,2})(?:[:.](\d{2}))?\s*(am|pm)?(?:\s|$)`)
// A 12-hour suffix carries its own marker: "10am", "7:30 pm".
reTimeMeridiem = regexp.MustCompile(`(?i)(?:^|\s)(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s|$)`)
// A 12-hour suffix carries its own marker: "10am", "7:30 pm" — and may still
// be written after one, "at 10am", "kl 7 pm". The marker is part of the time:
// left behind, "tomorrow at 10am" became the title "… at".
reTimeMeridiem = regexp.MustCompile(`(?i)(?:^|\s)((?:at|kl\.?|klokken)\s*)?(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s|$)`)
// A bare colon time: "16:30". Only ':' — never '.', because "15.3" is a date.
reTimeColon = regexp.MustCompile(`(?:^|\s)(\d{1,2}):(\d{2})(?:\s|$)`)
)
func extractTime(input string, spans []Span, locale string) (int, int, bool, []Span) {
if m := reTimeMeridiem.FindStringSubmatchIndex(input); m != nil {
hour := atoi(input, m[2], m[3])
hour := atoi(input, m[4], m[5])
minute := 0
if m[4] >= 0 {
minute = atoi(input, m[4], m[5])
if m[6] >= 0 {
minute = atoi(input, m[6], m[7])
}
hour = applyMeridiem(hour, strings.ToLower(input[m[6]:m[7]]))
hour = applyMeridiem(hour, strings.ToLower(input[m[8]:m[9]]))
if valid(hour, minute) {
return hour, minute, true, append(spans, Span{Start: m[2], End: m[7], Kind: KindTime})
start := m[4]
if m[2] >= 0 {
start = m[2]
}
return hour, minute, true, append(spans, Span{Start: start, End: m[9], Kind: KindTime})
}
}
@@ -429,6 +435,37 @@ var (
reNumeric = regexp.MustCompile(`(?:^|\s)(\d{1,2})[/.](\d{1,2})(?:[-/](\d{2,4}))?(?:\s|$)`)
)
// fractionUnits are the words that make "3/4" a quantity rather than a day.
//
// "køb 1/2 liter fløde" is half a litre, not the first of February — and it is
// the ordinary shape of a shopping list or a recipe. Without a unit after it the
// slash form stays a date: "3/4" alone, "møde 3/4 med Anders", and also
// "3/4 kage", because nothing in "kage" tells the third of April from three
// quarters, and a date quietly dropped is worse than one somebody removes.
var fractionUnits = map[string]bool{
"l": true, "liter": true, "dl": true, "cl": true, "ml": true,
"kg": true, "g": true, "gram": true, "pund": true,
"tsk": true, "spsk": true, "kop": true, "kopper": true, "glas": true,
"stk": true, "stk.": true, "del": true, "dele": true, "pakke": true, "pakker": true,
"time": true, "timer": true, "km": true, "m": true, "cm": true,
"cup": true, "cups": true, "tsp": true, "tbsp": true, "lb": true, "oz": true,
}
// firstNumericDate is the first "d/m" in the input that is not a quantity — see
// fractionUnits. A written year always makes it a date.
func firstNumericDate(input string) []int {
for _, m := range reNumeric.FindAllStringSubmatchIndex(input, -1) {
if m[6] < 0 {
rest := strings.Fields(input[m[5]:])
if len(rest) > 0 && fractionUnits[strings.ToLower(rest[0])] {
continue
}
}
return m
}
return nil
}
func extractDate(input string, spans []Span, now time.Time) (time.Time, bool, []Span) {
today := time.Date(now.Year(), now.Month(), now.Day(), 0, 0, 0, 0, now.Location())
@@ -441,7 +478,7 @@ func extractDate(input string, spans []Span, now time.Time) (time.Time, bool, []
}
}
if m := reNumeric.FindStringSubmatchIndex(input); m != nil {
if m := firstNumericDate(input); m != nil {
day, mo := atoi(input, m[2], m[3]), atoi(input, m[4], m[5])
year := today.Year()
explicitYear := m[6] >= 0
+47
View File
@@ -784,3 +784,50 @@ func TestImpossibleReminderClockIsNotKept(t *testing.T) {
t.Errorf("ReminderOffsetMin = %d, want none", *got.ReminderOffsetMin)
}
}
// A marker written before a 12-hour time belongs to the time. Left behind, it
// became the end of the title: "file the VAT return tomorrow at 10am" was the
// task "file the VAT return at".
func TestMarkerBeforeAMeridiemTimeIsConsumed(t *testing.T) {
now := ref(t)
for _, tc := range []struct{ in, content, due, time string }{
{"file the VAT return tomorrow at 10am", "file the VAT return", "2026-03-11", "10:00"},
{"call at 7:30 pm", "call", "2026-03-10", "19:30"},
{"call the dentist tomorrow at 9am remind me an hour before", "call the dentist", "2026-03-11", "09:00"},
{"møde i morgen kl 7 pm", "møde", "2026-03-11", "19:00"},
// Control: a meridiem time with no marker still works, and "at" that is
// not in front of a time is a word.
{"standup tomorrow 9am", "standup", "2026-03-11", "09:00"},
{"look at the report tomorrow", "look at the report", "2026-03-11", ""},
} {
got := Parse(tc.in, now, "en")
if got.Content != tc.content || got.DueDate != tc.due || got.DueTime != tc.time {
t.Errorf("%q → %q %s %s, want %q %s %s", tc.in, got.Content, got.DueDate, got.DueTime,
tc.content, tc.due, tc.time)
}
}
}
// "1/2 liter" is half a litre. A day/month followed by a unit is a quantity and
// stays in the title; without a unit it is still a date, because "3/4" alone and
// "møde 3/4 med Anders" are the third of April.
func TestAFractionWithAUnitIsNotADate(t *testing.T) {
now := ref(t)
for _, tc := range []struct{ in, content, due string }{
{"køb 1/2 liter fløde", "køb 1/2 liter fløde", ""},
{"tilsæt 3/4 dl mælk", "tilsæt 3/4 dl mælk", ""},
{"bag med 1/2 kg mel i morgen", "bag med 1/2 kg mel", "2026-03-11"},
// A quantity first, a real date after it: the date is still found.
{"køb 1/2 liter fløde 15/3", "køb 1/2 liter fløde", "2026-03-15"},
// Controls: no unit, or a year — a date.
{"møde 3/4", "møde", "2026-04-03"},
{"møde 3/4 med Anders", "møde med Anders", "2026-04-03"},
{"halvdelen 3/4 kage", "halvdelen kage", "2026-04-03"},
{"frist 1/2-2027 liter", "frist liter", "2027-02-01"},
} {
got := Parse(tc.in, now, "da")
if got.Content != tc.content || got.DueDate != tc.due {
t.Errorf("%q → %q %q, want %q %q", tc.in, got.Content, got.DueDate, tc.content, tc.due)
}
}
}
+1
View File
@@ -56,6 +56,7 @@ nav:
- Opening links: links.md
- Filters: filters.md
- Importing from Todoist: import.md
- The iOS app: ios.md
- Connecting things:
- Calendar: calendar.md
- Feeds and CalDAV: caldav.md
+79
View File
@@ -6089,3 +6089,82 @@ test('knappen findes ikke i urd-ansigtet', async ({ page }) => {
await page.goto('/');
await expect(page.getByRole('button', { name: 'Tal en opgave ind' })).toBeVisible();
});
/** Calls the API as the signed-in page does, and returns the parsed body. */
async function apiCall(page, method, path, body) {
return page.evaluate(
async ({ method, path, body }) => {
const init = { method, credentials: 'include', headers: { 'Sec-Fetch-Site': 'same-origin' } };
if (body !== undefined) {
init.headers['Content-Type'] = 'application/json';
init.body = JSON.stringify(body);
}
const r = await fetch('/api/v1' + path, init);
return r.status === 204 ? null : r.json();
},
{ method, path, body }
);
}
/**
* Et "#navn", der ikke findes, er klippet ud af titlen af parseren og lagt et
* andet sted af serveren. Uden en besked forsvandt ordet bare.
*/
test('et ukendt projekt i hurtig tilføjelse bliver sagt højt', async ({ page }) => {
await page.goto('/');
const name = `Findesikke${Date.now()}`;
const box = page.getByLabel('Ny opgave');
await box.fill(`køb mælk i dag #${name}`);
await box.press('Enter');
await expect(page.locator('.toast').filter({ hasText: name })).toContainText(
'Der er intet projekt'
);
await expect(page.locator('.toast').filter({ hasText: name })).toContainText('Indbakke');
});
/**
* At skrive i en opgaves titel læses som hurtig tilføjelse læser: dato,
* klokkeslæt, gentagelse, projekt og alarm. Gentagelsen blev engang læst under
* et felt, der ikke findes, og forsvandt.
*/
test('en titel, der rettes i opgaveruden, tager gentagelse, tid, projekt og alarm med', async ({
page
}) => {
await page.goto('/');
const project = await apiCall(page, 'POST', '/projects', { name: `Titelprojekt ${Date.now()}` });
const task = await apiCall(page, 'POST', '/tasks', { content: 'omskriv titel' });
await page.goto('/opgave/' + task.id);
const drawer = page.getByRole('complementary', { name: 'Opgave' });
const title = drawer.getByLabel('Opgavens tekst');
await expect(title).toHaveValue('omskriv titel');
const saved = opgaveGemt(page);
await title.fill(`omskriv titel hver mandag kl 9 #"${project.name}" mind mig en time før`);
await title.press('Enter');
await saved;
await expect(title).toHaveValue('omskriv titel');
await expect(page.locator('.toast').filter({ hasText: 'Læst som' })).toBeVisible();
// Målt på serveren, ikke på skærmen: det er dér, det skal stå.
await expect
.poll(async () => (await apiCall(page, 'GET', '/tasks/' + task.id)).recurrence_rule)
.toBe('FREQ=WEEKLY;BYDAY=MO');
const after = await apiCall(page, 'GET', '/tasks/' + task.id);
expect(after.content).toBe('omskriv titel');
expect(after.project_id).toBe(project.id);
// I kontoens zone, ikke i den proces, prøven kører i: en CI-runner i UTC læser
// 09:00 i København som 08.
const local = new Intl.DateTimeFormat('en-GB', {
timeZone: 'Europe/Copenhagen',
weekday: 'short',
hour: '2-digit',
minute: '2-digit',
hourCycle: 'h23'
}).format(new Date(after.due_datetime));
expect(local).toBe('Mon 09:00');
const { reminders } = await apiCall(page, 'GET', `/tasks/${task.id}/reminders`);
expect(reminders.map((r) => r.offset_min)).toEqual([-60]);
});
+45
View File
@@ -0,0 +1,45 @@
/**
* Renders the iOS app's icon and launch image from static/icon.svg.
*
* node scripts/generate-ios-assets.js
*
* Same reasoning as generate-icons.js: a script, not a test, run when the icon
* changes, with Chromium as the SVG renderer because it is already here.
*
* Two things differ from the web icons, and both are Apple's rules rather than
* taste. The app icon is square with no transparency — iOS draws the rounded
* corners itself, and rounded corners already in the image show as a dark ring
* inside its own mask — so the tile's `rx` is dropped and the result flattened.
* And the launch image is the rune small on the tile colour, the size
* Capacitor's template asks for, so the app opens on the colour it is about to
* draw instead of on white.
*/
import { chromium } from '@playwright/test';
import { readFileSync, writeFileSync } from 'node:fs';
const ICONS = '../app/ios/App/App/Assets.xcassets';
const svg = readFileSync('static/icon.svg', 'utf8').replace(/ rx="[^"]*"/, '');
const tile = /<rect[^>]*fill="(#[0-9a-fA-F]{6})"/.exec(svg)?.[1];
if (!tile) throw new Error('static/icon.svg has no tile colour to paint the launch image with');
const browser = await chromium.launch();
const page = await browser.newPage();
async function render(file, size, markSize) {
await page.setViewportSize({ width: size, height: size });
await page.setContent(
`<style>html,body{margin:0;padding:0;background:${tile}}` +
`div{width:${size}px;height:${size}px;display:grid;place-items:center}` +
`svg{display:block;width:${markSize}px;height:${markSize}px}</style><div>${svg}</div>`
);
writeFileSync(file, await page.locator('div').screenshot({ omitBackground: false }));
console.log(`${file} ${size}×${size}`);
}
await render(`${ICONS}/AppIcon.appiconset/AppIcon-512@2x.png`, 1024, 1024);
// Capacitor's template names three files for the one launch image; all the same.
for (const name of ['splash-2732x2732.png', 'splash-2732x2732-1.png', 'splash-2732x2732-2.png']) {
await render(`${ICONS}/Splash.imageset/${name}`, 2732, 640);
}
await browser.close();
+66 -5
View File
@@ -14,7 +14,7 @@
import { app, projectName, clockOf } from '$lib/stores.svelte.js';
import { focusOnMount } from '$lib/focus.js';
import { t, tag } from '$lib/i18n.svelte.js';
import { REPEATS, reminderOffsetLabel } from '$lib/when.js';
import { REPEATS, reminderOffsetLabel, repeatLabel, shortDate } from '$lib/when.js';
import { readList } from '$lib/pastelist.js';
let { task, onclose } = $props();
@@ -215,24 +215,83 @@
const patch = { content: trimmed };
const took = [];
// Det, der ikke kan stå i en PATCH: alarmen er sin egen række.
let reminder = null;
if (parsed && parsed.content && parsed.content !== trimmed) {
patch.content = parsed.content;
// Samme felter som hurtig tilføjelse læser, og med de navne serveren
// sender dem under. Feltet hedder `recurrence_rule`; det læste en gang
// `parsed.recurrence`, som aldrig findes, så "hver mandag" i en titel
// forsvandt fra titlen og blev ingen steder.
if (parsed.due_date) {
patch.due_date = parsed.due_date;
took.push(parsed.due_date);
took.push(shortDate(parsed.due_date));
}
// Parseren fylder altid datoen ud, når den har læst et klokkeslæt, så
// due_date er sat ovenfor, når due_time er.
if (parsed.due_time) {
patch.due_time = parsed.due_time;
took.push(parsed.due_time);
}
if (parsed.priority && parsed.priority < 4) {
patch.priority = parsed.priority;
took.push(`P${parsed.priority}`);
}
if (parsed.recurrence) {
patch.recurrence_rule = parsed.recurrence;
took.push('gentagelse');
if (parsed.recurrence_rule) {
patch.recurrence_rule = parsed.recurrence_rule;
took.push(repeatLabel(parsed.recurrence_rule, parsed.recurrence_text));
}
if (parsed.labels?.length) {
patch.labels = [...new Set([...(task.labels ?? []), ...parsed.labels])];
took.push(parsed.labels.map((l) => `@${l}`).join(' '));
}
if (parsed.project) {
// Navnet slås op som hurtig tilføjelse gør: uden forskel på store og
// små bogstaver. Et navn, der ikke findes, siges højt — det er klippet
// ud af titlen, og uden en besked var ordet bare væk.
const wanted = parsed.project.toLowerCase();
const found = app.projects.find((p) => p.name.toLowerCase() === wanted);
if (!found) {
app.toast(
t('task.unknownProject', {
name: parsed.project,
where: projectName(app.projectById(task.project_id))
})
);
} else if (found.id !== task.project_id && !task.parent_id) {
patch.project_id = found.id;
took.push(`#${found.name}`);
}
}
if (parsed.reminder_at) {
// Vægurstid i læserens zone, ligesom feltet nedenfor giver den.
reminder = { remind_at: new Date(parsed.reminder_at).toISOString() };
} else if (parsed.reminder_offset_min !== undefined && parsed.reminder_offset_min !== null) {
// En forskydning regnes fra klokkeslættet. Uden et ville rækken aldrig
// ringe, og intet bagefter ville afsløre det.
if (patch.due_time || task.due_datetime) {
reminder = { offset_min: parsed.reminder_offset_min };
} else {
app.toast(t('task.alarmNeedsATime'));
}
}
}
// Alarmen før rettelsen: får opgaven sit klokkeslæt i samme gemning, lægger
// serveren standardalarmen på — medmindre opgaven allerede har en. Den,
// der blev skrevet, skal være den, og ikke stå oven på standarden.
if (reminder) {
try {
const created = await api.createReminder(task.id, reminder);
reminders = [...reminders, created];
took.push(
reminder.offset_min !== undefined
? reminderOffsetLabel(reminder.offset_min)
: parsed.reminder_at.slice(11)
);
} catch (e) {
app.toast(humanMessage(e));
}
}
await save(patch);
@@ -244,6 +303,8 @@
if (took.length) {
content = patch.content;
if (patch.due_date) dueDate = patch.due_date;
if (patch.due_time) dueTime = patch.due_time;
if (patch.project_id) projectId = patch.project_id;
if (patch.priority) priority = patch.priority;
if (patch.recurrence_rule) recurrence = patch.recurrence_rule;
if (patch.labels) labels = patch.labels.join(', ');
+3
View File
@@ -272,6 +272,9 @@ export const da = {
// Diktat, ikke tale: programmet laver ingen talegenkendelse, det stiller
// feltet frem, så tastaturets egen mikrofon kan bruges. Hjælpelinjen siger
// det, fordi en knap med en mikrofon på lover noget andet.
'task.unknownProject': 'Der er intet projekt, der hedder "{name}". Opgaven ligger i {where}.',
'task.unknownSection': 'Der er ingen sektion, der hedder "{name}" i {where}. Opgaven ligger uden sektion.',
'task.subtaskKeepsProject': 'En underopgave ligger i sin opgaves projekt, {where} — "{name}" blev ikke brugt.',
'task.alarmNeedsATime':
'Opgaven er oprettet. Alarmen er ikke — "en time før" skal have et klokkeslæt at regne tilbage fra.',
'task.speak': 'Tal en opgave ind',
+3
View File
@@ -266,6 +266,9 @@ export const en = {
'task.pastedAdd': 'Add {n} tasks',
'task.pastedCancel': 'Cancel',
'task.new': 'New task',
'task.unknownProject': 'There is no project called "{name}". The task is in {where}.',
'task.unknownSection': 'There is no section called "{name}" in {where}. The task has no section.',
'task.subtaskKeepsProject': 'A sub-task stays in its task\'s project, {where} — "{name}" was not used.',
'task.alarmNeedsATime':
'The task is created. The alarm is not — "an hour before" needs a time to count back from.',
'task.speak': 'Speak a task',
+14
View File
@@ -729,6 +729,20 @@ class AppState {
// slags påmindelse, hvis fejl intet bagefter afslører — der står ingen
// række at savne, og man opdager den først, da den ikke ringede.
if (task?.reminder_not_set) this.toast(t('task.alarmNeedsATime'));
// Et "#navn" eller "/navn", der ikke ramte noget, er klippet ud af titlen
// af parseren og lagt et andet sted af serveren. Uden de her linjer
// forsvandt ordet bare, og opgaven lå et sted, ingen havde bedt om.
const where = projectName(this.projectById(task?.project_id));
if (task?.unknown_project) {
this.toast(
parentId
? t('task.subtaskKeepsProject', { name: task.unknown_project, where })
: t('task.unknownProject', { name: task.unknown_project, where })
);
}
if (task?.unknown_section) {
this.toast(t('task.unknownSection', { name: task.unknown_section, where }));
}
return task;
} catch (e) {
this.toast(humanMessage(e));