Compare commits
7
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3c43f6181e | ||
|
|
ed30eb4c36 | ||
|
|
ec5cf8f9f9 | ||
|
|
4ddc41632b | ||
|
|
2e9a92996e | ||
|
|
ce1e12417b | ||
|
|
3867467f24 |
@@ -51,6 +51,40 @@ jobs:
|
|||||||
- name: Build
|
- name: Build
|
||||||
run: CGO_ENABLED=0 go 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:
|
spec:
|
||||||
name: OpenAPI is valid
|
name: OpenAPI is valid
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"appId": "dk.nolimit.verdande",
|
||||||
|
"appName": "Verdande",
|
||||||
|
"webDir": "../web/build",
|
||||||
|
"ios": {
|
||||||
|
"contentInset": "never",
|
||||||
|
"scheme": "Verdande"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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>
|
||||||
@@ -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)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
.DS_Store
|
||||||
|
/.build
|
||||||
|
/Packages
|
||||||
|
/*.xcodeproj
|
||||||
|
xcuserdata/
|
||||||
|
DerivedData/
|
||||||
|
.swiftpm/config/registries.json
|
||||||
|
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
|
||||||
|
.netrc
|
||||||
@@ -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")
|
||||||
|
]
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
@@ -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
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
CAPACITOR_DEBUG = true
|
||||||
Generated
+1239
File diff suppressed because it is too large
Load Diff
@@ -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
@@ -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).
|
||||||
@@ -304,22 +304,28 @@ func extractPriority(input string, spans []Span) (int, []Span) {
|
|||||||
var (
|
var (
|
||||||
// An explicit marker: "kl 10", "kl. 10:30", "klokken 16", "at 9.15".
|
// 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|$)`)
|
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".
|
// A 12-hour suffix carries its own marker: "10am", "7:30 pm" — and may still
|
||||||
reTimeMeridiem = regexp.MustCompile(`(?i)(?:^|\s)(\d{1,2})(?::(\d{2}))?\s*(am|pm)(?:\s|$)`)
|
// 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.
|
// A bare colon time: "16:30". Only ':' — never '.', because "15.3" is a date.
|
||||||
reTimeColon = regexp.MustCompile(`(?:^|\s)(\d{1,2}):(\d{2})(?:\s|$)`)
|
reTimeColon = regexp.MustCompile(`(?:^|\s)(\d{1,2}):(\d{2})(?:\s|$)`)
|
||||||
)
|
)
|
||||||
|
|
||||||
func extractTime(input string, spans []Span, locale string) (int, int, bool, []Span) {
|
func extractTime(input string, spans []Span, locale string) (int, int, bool, []Span) {
|
||||||
if m := reTimeMeridiem.FindStringSubmatchIndex(input); m != nil {
|
if m := reTimeMeridiem.FindStringSubmatchIndex(input); m != nil {
|
||||||
hour := atoi(input, m[2], m[3])
|
hour := atoi(input, m[4], m[5])
|
||||||
minute := 0
|
minute := 0
|
||||||
if m[4] >= 0 {
|
if m[6] >= 0 {
|
||||||
minute = atoi(input, m[4], m[5])
|
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) {
|
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|$)`)
|
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) {
|
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())
|
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])
|
day, mo := atoi(input, m[2], m[3]), atoi(input, m[4], m[5])
|
||||||
year := today.Year()
|
year := today.Year()
|
||||||
explicitYear := m[6] >= 0
|
explicitYear := m[6] >= 0
|
||||||
|
|||||||
@@ -784,3 +784,50 @@ func TestImpossibleReminderClockIsNotKept(t *testing.T) {
|
|||||||
t.Errorf("ReminderOffsetMin = %d, want none", *got.ReminderOffsetMin)
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ nav:
|
|||||||
- Opening links: links.md
|
- Opening links: links.md
|
||||||
- Filters: filters.md
|
- Filters: filters.md
|
||||||
- Importing from Todoist: import.md
|
- Importing from Todoist: import.md
|
||||||
|
- The iOS app: ios.md
|
||||||
- Connecting things:
|
- Connecting things:
|
||||||
- Calendar: calendar.md
|
- Calendar: calendar.md
|
||||||
- Feeds and CalDAV: caldav.md
|
- Feeds and CalDAV: caldav.md
|
||||||
|
|||||||
@@ -6089,3 +6089,82 @@ test('knappen findes ikke i urd-ansigtet', async ({ page }) => {
|
|||||||
await page.goto('/');
|
await page.goto('/');
|
||||||
await expect(page.getByRole('button', { name: 'Tal en opgave ind' })).toBeVisible();
|
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]);
|
||||||
|
});
|
||||||
|
|||||||
@@ -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();
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
import { app, projectName, clockOf } from '$lib/stores.svelte.js';
|
import { app, projectName, clockOf } from '$lib/stores.svelte.js';
|
||||||
import { focusOnMount } from '$lib/focus.js';
|
import { focusOnMount } from '$lib/focus.js';
|
||||||
import { t, tag } from '$lib/i18n.svelte.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';
|
import { readList } from '$lib/pastelist.js';
|
||||||
|
|
||||||
let { task, onclose } = $props();
|
let { task, onclose } = $props();
|
||||||
@@ -215,24 +215,83 @@
|
|||||||
|
|
||||||
const patch = { content: trimmed };
|
const patch = { content: trimmed };
|
||||||
const took = [];
|
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) {
|
if (parsed && parsed.content && parsed.content !== trimmed) {
|
||||||
patch.content = parsed.content;
|
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) {
|
if (parsed.due_date) {
|
||||||
patch.due_date = 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) {
|
if (parsed.priority && parsed.priority < 4) {
|
||||||
patch.priority = parsed.priority;
|
patch.priority = parsed.priority;
|
||||||
took.push(`P${parsed.priority}`);
|
took.push(`P${parsed.priority}`);
|
||||||
}
|
}
|
||||||
if (parsed.recurrence) {
|
if (parsed.recurrence_rule) {
|
||||||
patch.recurrence_rule = parsed.recurrence;
|
patch.recurrence_rule = parsed.recurrence_rule;
|
||||||
took.push('gentagelse');
|
took.push(repeatLabel(parsed.recurrence_rule, parsed.recurrence_text));
|
||||||
}
|
}
|
||||||
if (parsed.labels?.length) {
|
if (parsed.labels?.length) {
|
||||||
patch.labels = [...new Set([...(task.labels ?? []), ...parsed.labels])];
|
patch.labels = [...new Set([...(task.labels ?? []), ...parsed.labels])];
|
||||||
took.push(parsed.labels.map((l) => `@${l}`).join(' '));
|
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);
|
await save(patch);
|
||||||
@@ -244,6 +303,8 @@
|
|||||||
if (took.length) {
|
if (took.length) {
|
||||||
content = patch.content;
|
content = patch.content;
|
||||||
if (patch.due_date) dueDate = patch.due_date;
|
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.priority) priority = patch.priority;
|
||||||
if (patch.recurrence_rule) recurrence = patch.recurrence_rule;
|
if (patch.recurrence_rule) recurrence = patch.recurrence_rule;
|
||||||
if (patch.labels) labels = patch.labels.join(', ');
|
if (patch.labels) labels = patch.labels.join(', ');
|
||||||
|
|||||||
@@ -272,6 +272,9 @@ export const da = {
|
|||||||
// Diktat, ikke tale: programmet laver ingen talegenkendelse, det stiller
|
// Diktat, ikke tale: programmet laver ingen talegenkendelse, det stiller
|
||||||
// feltet frem, så tastaturets egen mikrofon kan bruges. Hjælpelinjen siger
|
// feltet frem, så tastaturets egen mikrofon kan bruges. Hjælpelinjen siger
|
||||||
// det, fordi en knap med en mikrofon på lover noget andet.
|
// 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':
|
'task.alarmNeedsATime':
|
||||||
'Opgaven er oprettet. Alarmen er ikke — "en time før" skal have et klokkeslæt at regne tilbage fra.',
|
'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',
|
'task.speak': 'Tal en opgave ind',
|
||||||
|
|||||||
@@ -266,6 +266,9 @@ export const en = {
|
|||||||
'task.pastedAdd': 'Add {n} tasks',
|
'task.pastedAdd': 'Add {n} tasks',
|
||||||
'task.pastedCancel': 'Cancel',
|
'task.pastedCancel': 'Cancel',
|
||||||
'task.new': 'New task',
|
'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':
|
'task.alarmNeedsATime':
|
||||||
'The task is created. The alarm is not — "an hour before" needs a time to count back from.',
|
'The task is created. The alarm is not — "an hour before" needs a time to count back from.',
|
||||||
'task.speak': 'Speak a task',
|
'task.speak': 'Speak a task',
|
||||||
|
|||||||
@@ -729,6 +729,20 @@ class AppState {
|
|||||||
// slags påmindelse, hvis fejl intet bagefter afslører — der står ingen
|
// 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.
|
// række at savne, og man opdager den først, da den ikke ringede.
|
||||||
if (task?.reminder_not_set) this.toast(t('task.alarmNeedsATime'));
|
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;
|
return task;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.toast(humanMessage(e));
|
this.toast(humanMessage(e));
|
||||||
|
|||||||
Reference in New Issue
Block a user