From 9b4975d3a58e70506e8de5f573e114c433e8ae79 Mon Sep 17 00:00:00 2001 From: Erudition Date: Fri, 29 Sep 2023 03:11:47 -0500 Subject: [PATCH] Start improving UI of projects screen --- BACKEND OPTIONS.md | 8 ++++-- README.md | 22 ++++++++++++++ capacitor.config.ts | 2 +- elm/Task/Assignable.elm | 4 +++ elm/TaskList.elm | 64 ++++++++++++++++++++++++++++++++++++++--- 5 files changed, 93 insertions(+), 7 deletions(-) diff --git a/BACKEND OPTIONS.md b/BACKEND OPTIONS.md index 6999564c..9d49fc3a 100644 --- a/BACKEND OPTIONS.md +++ b/BACKEND OPTIONS.md @@ -3,14 +3,18 @@ For now we just need a simple append-only log for our RON frames, that replicates to other devices with NAT hole-punching included. All non-internet sync methods are welcome, especially something like local Bluetooth sync. ## WebNative -- Uses IPFS +- Uses IPFS, custom block-sync solution (not Helia) - has a public+private filesystem, Webnative File System, where private is encrypted - adds auth and account sharing, adding devices ## OrbitDb -- Uses IPFS +- Uses IPFS, now Helia - Berty uses it +## Peerbit +- Uses LibP2P, custom block-sync solution (not Helia) +- Designed to be super low latency + ## Berty Protocol - On top of orbitDb, details are settled - IPFS transport includes Bluetooth! diff --git a/README.md b/README.md index ca874fb8..43e0e79f 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +[![Awesome Humane Tech](https://raw.githubusercontent.com/humanetech-community/awesome-humane-tech/main/humane-tech-badge.svg?sanitize=true)](https://github.com/humanetech-community/awesome-humane-tech) + # Minder The ultimate assistant for ADHD. Keeps track of what you _should be doing_ and sends effective reminders (including zaps) if you're off task. @@ -37,3 +39,23 @@ Much later, seeing the power of NativeScript to easily handle my local notificat - But that "export" of data from Elm still needs to be triggered from elm somehow. I tried triggering it on every `update` ever (like `updateWithTime` and `updateWithStorage`), but it wasn't working, and we really only need it when the values are changed anyway. So now I have it trigger whenever the activity is changed! Still need a way to trigger it at launch though, without taking up the launch URL. - Android notifs can only have one vibe pattern per channel? Fine, guess I'll have multiple channels then. - Seems like "global" variables can't be read or changed from within the worker. For once that makes sense since the workers are supposed to be totally isolated. So I put the storing of the ViewModel update in the main thread (app.js) and just told the worker to let the main thread know. Works well. + + + + +== Using GitHub Under Protest == + +This project is currently hosted on GitHub. This is not ideal; GitHub is a +proprietary, trade-secret system that is not Free, Libre, Open Souce Software +(FLO). We are deeply concerned about using a proprietary system like GitHub +to develop our FOSS project. In the long term, we may make the move to Nest, powered by Pijul. +We urge you to read about the +[Give up GitHub](https://GiveUpGitHub.org) campaign from +[the Software Freedom Conservancy](https://sfconservancy.org) to understand +some of the reasons why GitHub is not a good place to host FLOSS projects. + +Any use of this project's code by GitHub Copilot, past or present, is done +without our permission. We do not consent to GitHub's use of this project's +code in Copilot. + +![Logo of the GiveUpGitHub campaign](https://sfconservancy.org/img/GiveUpGitHub.png) \ No newline at end of file diff --git a/capacitor.config.ts b/capacitor.config.ts index 3d66ff91..2c97dd2d 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -6,7 +6,7 @@ const config: CapacitorConfig = { webDir: 'dist', server: { allowNavigation: ["erudition.github.io"], // don't add "localhost" here - // url: "https://localhost/", // default is https://localhost, but setting this to ANYTHING prevent navigation to localhost... + // url: "https://localhost/", // default is https://localhost, but setting this to ANYTHING prevents navigation to localhost... //url: "https://erudition.github.io/minder-preview/Erudition/Minder/branch/master/", hostname: 'minder-localhost', // can't be localhost because service worker is blocked in android webview. https://stackoverflow.com/a/76373851/8645412 can't be erudition.github.io or else online requests will become local requests. diff --git a/elm/Task/Assignable.elm b/elm/Task/Assignable.elm index 55f0aecd..0c4f1b53 100644 --- a/elm/Task/Assignable.elm +++ b/elm/Task/Assignable.elm @@ -181,3 +181,7 @@ setActivityID newActivityID (Assignable metaAssignable) = children (Assignable metaAssignable) = (Reg.latest metaAssignable.reg).children + + +parent (Assignable metaAssignable) = + metaAssignable.project diff --git a/elm/TaskList.elm b/elm/TaskList.elm index e5cb3fbd..3479ae55 100644 --- a/elm/TaskList.elm +++ b/elm/TaskList.elm @@ -287,6 +287,9 @@ viewAssignable profile ( time, timeZone ) trackedTaskMaybe assignable = viewAssignableTitle = [ text <| Assignable.title assignable ] + project = + Assignable.parent assignable + viewSubAssignables = List.map viewSubAssignable (RepList.listValues (Assignable.children assignable)) @@ -317,14 +320,67 @@ viewAssignable profile ( time, timeZone ) trackedTaskMaybe assignable = [] , node "ion-button" [ attribute "fill" "clear", onClick (AddAssignment assignable) ] [ node "ion-icon" [ name "add-circle-outline" ] [], text "assign" ] ] + + presentActionSheet = + ActionSheet.actionSheet + [ ActionSheet.header <| Maybe.withDefault "This project" (Project.title project) + , ActionSheet.trigger sheetButtonID + ] + [ ActionSheet.deleteButton (Toast "NYI: Delete Project") + , ActionSheet.button "Rename" (Toast "clicked Continue!") + ] + |> SH.fromUnstyled + + sheetButtonID = + "actionsheet-trigger-for-assignable-" ++ Assignable.idString assignable in - div - [ class "assignments" ] - [ node "ion-card-title" [ onDoubleClick (PromptRename (Assignable.title assignable) (\t -> Assignable.setTitle t assignable)) ] (viewAssignableTitle ++ viewSubAssignables) - , div [ css [ displayFlex, overflowX scroll ] ] viewAssignments + node "ion-item-sliding" + [] + [ node "ion-item" + [ classList [] + , attribute "data-flip-key" ("assignable-" ++ Assignable.idString assignable) + ] + [ -- node "ion-thumbnail" + -- [ class "project-image" + -- , attribute "slot" "start" + -- , css + -- [ backgroundColor <| Css.hsl 0 0 0.5 + -- , Css.height (pct 100) + -- ] + -- ] + -- [ --img [ src "https://ionicframework.com/docs/img/demos/thumbnail.svg" ] [] + -- SH.fromUnstyled <| identicon "100%" (RepList.handleString rootEntryItem) + -- ] + div [ css [ Css.width (pct 100) ] ] + [ node "ion-label" + [ onDoubleClick (PromptRename (Project.title project |> Maybe.withDefault "Untitled Project") (\t -> Project.setTitle (Just t) project)) ] + [ text (Project.title (Assignable.parent assignable) |> Maybe.withDefault "") + ] + , node "ion-label" + [ onDoubleClick (PromptRename (Assignable.title assignable) (\t -> Project.setTitle (Just t) project)) ] + [ text (Assignable.title assignable) + ] + , div [] [ text (String.fromInt (List.length assignments) ++ "assignments") ] + , viewMenuButton sheetButtonID + ] + ] + , node "ion-item-options" + [] + [ node "ion-item-option" [ attribute "color" "danger" ] [ text "delete" ] + , node "ion-item-option" [ attribute "color" "primary", onClick (AddAssignable project) ] [ text "add assignable" ] + ] + , presentActionSheet ] + +-- div +-- [ class "assignments" ] +-- [ node "ion-card-title" [ onDoubleClick (PromptRename (Assignable.title assignable) (\t -> Assignable.setTitle t assignable)) ] (viewAssignableTitle ++ viewSubAssignables) +-- , div [ css [ displayFlex, overflowX scroll ] ] viewAssignments +-- ] + + viewAssignment : ( Moment, Zone ) -> Maybe AssignmentID -> Int -> Assignment -> Html Msg viewAssignment ( time, timeZone ) trackedTaskMaybe index assignment = let