Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
7 posts · #wpf
Clear filters·5 min read

In TaskPad a star is a marker, so Markdown needed a translation layer
Markdown bullets collide with TaskPad's own markers. Import respects code fences, export maps states to Markdown and turns comments into footnotes.
In short
- TaskPad has its own line syntax with markers like !, ?, and [ ], so Markdown cannot go in or out as plain text without translation.
- Import is a line-by-line pass that respects code fences and rewrites and + bullets to -; export maps every marker, turns comment threads into footnotes and forces hard line breaks.
- Export refuses to write over the note's own file, and a plain-text export exists for places where Markdown would be noise.
#csharp#wpf#markdown#parsing
·5 min read

A .task note is a zip: one file for text and images, saved by swapping a temp file
A TaskPad note that keeps its screenshots: a zip with note.txt and images/, a per-path cache while open, and the guards a zero-byte file and hostile entry names needed.
In short
- A .task file is a ZIP holding note.txt, an images/ folder and a one-byte format marker, so a note and its pictures travel as one file.
- While a note is open it is unpacked to a per-path cache folder; saving first copies stray images in, then writes a temp file and swaps it over the original.
- The edge cases that needed code: a zero-byte file created by Explorer, duplicate image names, and entries that try to climb out of the cache folder.
#csharp#wpf#file-format#zip
·5 min read

TaskPad reminders: a time window instead of a flag, and a five-way hotkey fallback
TaskPad rings deadlines from the tray every 30 seconds. The design choice was to ask which deadlines fell inside the last tick, not which are overdue, plus a global hotkey that falls back through five shortcuts.
In short
- Reminders check a half-open window (last tick, now], so a deadline rings once, when it arrives, and old overdue tasks stay quiet.
- Timed deadlines get a second notification 15 minutes ahead, tracked in an in-memory set keyed by file, text and time.
- The quick-capture hotkey tries five combinations in order and uses the first one Windows lets it register.
#csharp#wpf#win32#notifications#design
·5 min read

TaskPad hot exit: debounced backups, an atomic session file, splits as text
Closing TaskPad never asks to save. How Session.cs keeps unsaved text across a crash: a two second debounce, a temp-file swap, ordered cleanup and a layout string like (H 0 (V 1 2)).
In short
- Session.cs writes a small tab-separated session file plus one backup-N.txt per document that has unsaved or untitled text, debounced two seconds after each edit.
- The session file is written to a temp file and swapped in with File.Replace, and stale backups are deleted only after the new file is in place.
- Window splits are saved as a tiny text language, for example (H 0 (V 1 2)), and a parse failure falls back to one empty group instead of throwing.
#csharp#wpf#persistence#editor#reliability
·5 min read

TaskPad deadlines: why due:+3d becomes a date as you type, and date-only means 23:59:59
TaskPad draws due:2026-10-10 as a live countdown pill. Relative tokens like due:+3d are rewritten into absolute dates while typing, so a deadline never drifts, and date-only means the end of that day.
In short
- A due token holds only an absolute date or time; relative forms like due:+3d or due:friday are rewritten into dates when you press space or Enter, so a deadline cannot drift.
- Date-only means the end of that day (23:59:59), and the countdown is computed at draw time and refreshed by a 30 second timer.
- Scanning is kept cheap by a plain substring check for "due" before any regex runs, and the caret line shows raw text so editing stays possible.
#csharp#wpf#avalonedit#datetime#text-editor
·5 min read

TaskPad setup quits the running copy over its own named pipe, not with Kill
The installer used to leave the old TaskPad running, so updates waited for a restart. Setup now sends a quit message through the single-instance pipe, so tabs and unsaved text survive.
In short
- Setup now asks the running TaskPad to quit over the named pipe the app already uses for single-instance handoff, then falls back to closing windows and, only if allowed, killing the process.
- A quit request saves the session and closes windows without prompts, so tabs and unsaved text survive the reinstall.
- The interactive installer asks before forcing; the silent installer forces after 15 seconds, because nobody is there to answer.
#csharp#wpf#named-pipes#installer#windows
·11 min read

TaskPad: a 1 MB WPF task editor that installs and updates itself
Notepad is too plain and VS Code is too heavy for a to-do list. I built TaskPad in C# as one 1 MB exe, and shipped 29 releases in about eleven hours. Here is what broke along the way.
In short
- The whole app is one exe: AvalonEdit is embedded as a resource and loaded through an AssemblyResolve handler, so there is no DLL next to it. The v1.9.4 build is 1,079,296 bytes.
- The same file is the portable app, the per-user installer (it detects "setup" in its own file name) and the updater, which swaps a running exe by renaming it to .old.
- Comments are stored as CriticMarkup inside the text file, so a note with a full discussion still opens in any editor.
#csharp#wpf#windows#desktop