Skip to content

Commit

Permalink
Merge branch 'worker' into main
Browse files Browse the repository at this point in the history
* worker: (60 commits)
  Cleanup: update README
  Cleanup: add Worker.Session tests
  Cleanup: elm-review
  Cleanup: use console.debug to trace actions in dev mode
  Cleanup: update npm dependencies
  Worker: don't try to tell an uninitialized worker the view is ready
  Worker: only send id of Tasks to delete when DeleteAndAdding
  Worker: TaskItemsRemoved -> TaskItemsDeleted (consistent naming)
  Worker: update typescript types
  Worker: only update changed tasks when markdown file is updated
  Worker: only need add and delete at the moment (update can come later)
  Worker: use sift3 string distance to help determine TaskItem edits
  Worker: basic TaskItem comparisons
  Worker: save complete task (& subtask/notes) text
  Worker: TaskItem.originalText -> originalLine
  Cleanup: TaskItem fields in alphabetical order
  Undo: add link to blog post to TODO
  Worker: basic checking for markdown updates (tasks added/deleted)
  Worker: no need to expose TaskList.parser (fromMarkdown is wot is used)
  Worker: use remove then add logic for updating tasks
  ...
  • Loading branch information
roovo committed Feb 25, 2024
2 parents 9e0d742 + 92f993e commit fa0dc41
Show file tree
Hide file tree
Showing 42 changed files with 3,812 additions and 1,351 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ index.html
main.js
node_modules/
src/Main/index.d.ts
src/Worker/index.d.ts
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ To get up and running:

```
npm install # install dependencies
npm run generate # generate ts type definitions for elm ports
npm run generate # generate ts type definitions for the main app
npm run generate-worker # generate ts type definitions for the worker app
npm run dev # run dev build
```

## Release Checklist
- run ts generators
- elm-review
- elm-test
- elm-coverage
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,9 @@ An [Obsidian](https://obsidian.md/) plugin to make working with tasks a pleasure
- Tag based (use `#tags` to define columns).

## New
- Due dates can be edited on the board - right click on a card
to bring up the context menu. See the [Editing due date section](#editing-due-date).


- No new features: I have split out some of the internal workings in preparation
for drag and drop - hopefully managed this without introducing any bugs or
performance issues.

## Installation
Please install via the regular Community Plugins setting tab within Obsidian.
Expand Down
38 changes: 38 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
- column sorting
- title, due date, path
- do I want to introduce priority at this point?

STEP 3
------
- V: maintains (via W) file(s) to hold the order of cards
W needs to maintain the files as it needs keeping up to date
irrespcetive of whether the view is active
V needs to read the file at startup so it puts cards in the right places
if user DnDs then V sends postion changes to W which writes them to the file
hmmmmmmm


- compare somne different forms of taskItem serialisation
- basic TsEncode/Decode
- can I make the taskItem encoding a bit more compact -> specially encoding Union types!
- original strings and parse to decode
- TaskItemFields -> make alphabetical (contents is at the end atm)
- perhaps when I am removing taskItems from the view I could request a reload of all if
the taskItem I am deleting doesn't exist
- howabout when adding taskItems communicating the expected total and if this doesn't match
what the view has it can request a reload.
- do I need the same states in the view now that I am not loading markdown?
- typescipt tidying -> am I using async only where I need to?

- can I make it so I load any settings at startup but save the latest version
when I get them back from elm?
- do I want to deal with Settings (as in ensure they are the latest version) in the worker?
- bug: if a file is deleted and it includes something which is shown in the completed
column then a blank item is added at the end as I do not render the markdown for
the newly added card.
- I get an error in the js console if I click on the command icon when the
cardboard view is visible

---
- touch events - iPad ??
- show errors on settings pane ??

# Cleanups
- do I need TaskItem.originalLine as it's the first line of originalBlock
would need a bit of work as there is no originalBlock for subtasks atm
- simplify parsing as per typing tutor
- replace regex stuff in TaskItem.toToggledSting with some form of token parsing
- if something is on a board because of a subtask tag and that line also has a due date on it, should I use
Expand Down Expand Up @@ -62,6 +99,7 @@
- undo buffer
- for toggling completion
- for deletion
- see: https://erkal.github.io/UndoRedo/index.html
- could/should I use some taskpaper tags:
@defer(date) - defer until date, e.g. 2016-04-19 5pm or next Thursday -3d
@estimate(time span) - time estimate, e.g. 2h for 2 hours or 3w for 3 weeks.
Expand Down
8 changes: 2 additions & 6 deletions elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"justinmimbs/time-extra": "1.1.1",
"mpizenberg/elm-pointer-events": "5.0.0",
"pzp1997/assoc-list": "1.0.0",
"rluiten/stringdistance": "1.0.4",
"robinheghan/fnv1a": "1.0.0",
"rtfeldman/elm-iso8601-date-strings": "1.1.4",
"tripokey/elm-fuzzy": "5.2.1"
Expand All @@ -42,12 +43,7 @@
"elm-explorations/test": "2.1.2"
},
"indirect": {
"elm/project-metadata-utils": "1.0.2",
"elm/random": "1.0.0",
"miniBill/elm-unicode": "1.0.3",
"rtfeldman/elm-hex": "1.0.0",
"stil4m/elm-syntax": "7.3.2",
"stil4m/structured-writer": "1.0.3"
"elm/random": "1.0.0"
}
}
}
Loading

0 comments on commit fa0dc41

Please sign in to comment.