It’s weird, sometimes making myself write a devlog gives me the push I need to make progress on this project, and other times it just feels like a hassle that gets in the way of development. Today it feels more like the latter, so I’m just gonna phone it in with dot points.

Anyway, we’re introducing a Task model into the system.

Jottings I

  • Decided to make a “task list node” that represents a single line of the task “source” text
    • Either an actual task or a comment
  • Giving tasks dependencies, automatic reverse accessors are pretty cool
    • CLI prototype needed to maintain separate lists of a task’s dependencies and dependents, but we get dependents for free (just give the dependencies field a related_name of dependents)
  • Design-wise, sadly going to have to backtrack on automatically updating task text Google Docs-style
    • Task text (“source”) on the server now needs to be consistent with the rendered task objects
    • We’ll throw a syntax error if the task text isn’t formatted correctly
  • Screw it, we’re doing HTMX
    • Installation trivial :-)
    • Warmup: add renaming of task lists
      • This is literally just the Click to Edit pattern
      • URL scheme isn’t very organised, but hopefully we can refactor it later…
      • DRY: moving segments of the templates that we serve over HTMX into their own files
      • (getting stuck on things too embarrassing to admit)
      • CSRF broken cuz of the form making a PUT request, not a POST request
      • OK, frontend is ugly as sin but it works! Remind me to autofocus the form field
    • The actual job: edit/render workflow
      • Wow, I am not going very fast. Took me a while to figure out you need to give a textarea a name in order for its contents to be sent as form data
        • VanillaJS AJAX worked slightly differently and I didn’t run into this problem until using HTMX. But all good now
      • Would be nice to have client-side warning that changes to textarea are unsaved

Interlude - janky “temporary” UI

A possible hazard of having very janky frontend UI with the intent of fixing it later is that I might get too used to the jank and see less of a need to fix it. I feel like this is something a lot of open source projects run into? Unintuitive UI notoriously plagues open source projects. Hopefully I can get someone who really appreciates software usability and accessibility to set me straight down the line.

Same goes for performance. Some of the views are slower than I’d like, but I’m probably going to move a lot of things around on the backend so it doesn’t make sense to optimise this early. But that begs the question of when is the right time to optimise…

Jottings II

  • Continuing getting edit/render tasks working with HTMX
    • Busting out the old command line parser. Code quality not great. Maybe I should refactor it? Needs to give more helpful error messages w/r/t syntax errors
    • Wow! Parsing a text format that I made up without a formal specification is kind of hard!
  • Weird quirk – a Django template can include itself, but only if inside an “if” statement, not an “else” statement
    • Or maybe I did something wrong idk
  • Bootstrap 5 – setting a custom background opacity doesn’t seem to work for the -subtle colour variants
    • But this is ok, since you can use the standard variants

Demo

After doing a bunch of boring dev work that I left out from the second set of jottings above, we can now “render” task lists that look like the following…

- Plan out project
* Case stream
  - Design case
  - 3D print case
* Electronics stream
  - Buy prototyping materials
  * A stream
    - Design schematic A
    - Prototype schematic A
  * B stream
    * Learn BCode
      # good tutorials for BCode??
    * Design schematic B
    - Prototype schematic B
  - Integration testing for prototypes A and B
  - Buy production materials
  - Place order for PCBs A and B
  - Solder components
  - Flash BCode onto PCB B
- Install PCBs in case
- Test

…into a frontend that looks like the following…

A graphical representation of a somewhat complicated (20-item) todo list for an electronics project.

Completed tasks, incomplete tasks and comments are all rendered differently. You’ll also notice that tasks that may be completed right now are highlighted in blue. (Actually, there’s a bug that highlights some tasks incorrectly, but whatever.)

Next up

Make it possible to mark tasks as complete and add tasks without touching the source editor. Also, a global user settings page, maybe.

Ok whatever

It’s the 31st of December. Screw this, I am getting drunk. See you next year.