Case studies
#powershell#debugging#windows#electron#docker#pterodactyl#python#csharp#wpf#bash#security#cpp#git#performance#ci#nodejs#pyside6#react-native
13 posts · #csharp
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
·6 min read

TaskPad · Story
TaskPad icons would not line up: one shared frame, then the checkbox column
AvalonEdit puts inline elements at the top of the line, so badges and checkboxes drifted. Two commits fixed it: a shared vertical frame, then a horizontal column.
In short
- AvalonEdit places inline elements at the top of the text line, and a line's top depends on its tallest element, so icons of different heights drifted vertically.
- Commit 525a0a8 added Align.Host, one shared frame for every inline icon, centred on the middle of the capital letters; commit 270faef then made tag icons share the checkbox's three-cell column.
- To do that the parser's tag token now swallows one trailing space, so the text starts at the fifth cell, like [ ] text.
#wpf#avalonedit#csharp#ui-alignment
·4 min read

TaskPad · Story
TaskPad comment editing threw because WPF panels do not allow Children[i] = x
The edit button swapped a TextBlock for a TextBox by assigning into a panel's Children by index. WPF throws on that. RemoveAt then Insert fixed it, and copy plus a right-click menu came along.
In short
- Comment editing replaced a TextBlock with a TextBox by assigning into the panel's Children collection by index, which WPF does not allow.
- The fix removes the old element at its index and inserts the box at the same index, which keeps the position.
- While in there I moved delete into a local function so a toolbar button and a new right-click menu share one code path, and added copy with a short check mark as feedback.
#wpf#csharp#desktop#bugfix#ui
·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