~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

Task boxes tick at once, by their text too, and strike through what is done

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:web/task-ticking

What changes

Ticking is instant. Before, a tick disabled every box until the save reached the PDS, so a click made meanwhile was dropped, and every box flashed grey. Now a tick shows at once and the boxes stay live. Each tick's body is saved behind them, one save at a time with the newest last, and the page is read anew once all are saved. A save that fails puts the boxes back as last saved and shows why under the thread.

The text ticks too. Clicking a task's text ticks its box, as a label would, unless the click is on a link or ends a text selection. For the author, the box and its text show a pointer.

Done tasks are struck through. A ticked task's own text is struck through and muted, up to any list nested under it, for everyone reading. Boxes in a loose list (items separated by blank lines, drawn inside a <p>) lose their bullet as the others do.

Why

Ticking off Basic forge features missing, from archive downloads to webhooks felt broken. Repeated clicks on one box went missing while each save ran, and the box was the only thing to aim at.

The struck-through text comes from a span.task-text the page wraps around each task's text, so CSS can strike only that text and not a nested list. Doing it in serve's Markdown rendering would also work without scripts. It would change every rendered body's HTML, though, for a style.

How it was checked

  • npm run check.
  • just look issue --as bob.test, clicking a task's text with editItem held: the box ticks and strikes while the save is pending, and the other boxes stay live. Also looked at signed out, where boxes are disabled but done tasks are still struck. Desktop light and phone dark.
  • The e2e flow "ticking a task in what was written" now also ticks by clicking a task's text while the first tick is still saving, and reads both ticks back from the PDS and the index.

Shortcomings

  • The strike-through shows once the page's scripts run. A page drawn on the server shows a ticked box without it for a moment.
  • Task lists in READMEs and release notes aren't wrapped, so they aren't struck through. Only issues, pulls and comments are.

🤖 Generated with Claude Code

held.png

Approved

This makes ticks instant: each tick is saved behind the boxes, one save at a time with the newest body last, and the page is read anew once all are saved. It also lets a click on a task's text tick its box, and strikes done tasks through using a span.task-text that the page wraps around each task's text.

I found nothing that must change. Here is what I traced:

  • Save loop: after a failed save, shown goes back to saved, so the loop ends and the boxes are reset from marks(saved).
  • Wrapping: wrap is idempotent, and the box is always the span's previousElementSibling, with or without the whitespace gap.
  • Failures: call throws on failure, so failed and problem get the server's message.
  • Loose lists: li > p:first-child is handled in the CSS.

Two small things, neither blocking:

  • problem isn't cleared when a later tick saves, so an old error can stay under the thread.
  • tasks.ts has its quotes and indentation reformatted (double to single quotes, spaces to tabs), which makes the diff look larger than the change. It looks like the repo's prettier style.

All seven checks were still queued or running when I looked, so I couldn't confirm the e2e and shots results. Please make sure both pass. If shots flags any page, add a Shots-moved: line to the body.

Merged as 0bbc4d1