Last time, I described how I used Stardock's Clairvoyance to help fix several issues with the WinUIpad codebase. The next steps were obvious: Ask for another code quality check and then see what this AI pair programming solution could do about adding some new features to the app.
A second quality pass
After configuring Clairvoyance and Anthropic Claude Pro on a second laptop, I figured it wouldn't hurt to ask for another code review. Predictably, it didn't find as many issues, nor were most of them serious. But it did locate some issues, and I allowed Clairvoyance to fix each in turn, checking as I did throughout the first pass to make sure that the changes didn't break anything and that the app still worked.
Since I already described the interactions in detail last time, here I will be more concise. Clairvoyance found and then fixed the following issues in WinUIpad:
SaveMenu_Click() calls SaveAsMenu_Click() without awaiting it. I'm surprised there were any issues like this to begin with—the first Clairvoyance code review found a similar issue elsewhere—but this fixed one of the issues I'd been having when the app closes.
Go To Line splits on \r only. As with a similar issue found in the first pass, the code for Go To Line didn't handle Windows-style (\n) line breaks.
SaveDocument() silently returns false if the file was deleted externally. This is a rather obscure what-if scenario that I'm pretty sure I would have never even considered myself.
Beyond those, Clairvoyance listed out the instances in which I had stub (empty) methods for various features I intended to add later and two "minor code quality" issues. Neither of those seemed particularly important to me, so I figured it was time to see about adding features to the app (in some cases, adding back features that existed in previous versions of the app).
Adding new features
The first was one I had started working through in the WPF version of the app, .NETpad: A Recent submenu under the File menu that listed recently accessed documents and provided a way to clear that list, as per Notepad in Windows 11.
When I was working on this in .NETpad, I had researched various ways to store this information and decided that doing so via the Settings.settings file would likely be the easiest and work well. But for Clairvoyance and this Windows App SDK-based app, I was curious whether the options were different. So I asked it to create an Exhibit through which I could compare four or five different solutions.
This is what it created.
The first option mapped to what I had decided to do previously, while the JSON and SQLite versions were a lot less interesting. The Jump list option is actually interesting, too, but more as something to use in addition to the Recent files menu. But first things first. I asked it to implement the Settings.settings-based option.
I can't recall what I was expecting, but Clairvoyance got started and then finished surprisingly quickly. So...
With technology shaping our everyday lives, how could we not dig deeper?
Thurrott Premium delivers an honest and thorough perspective about the technologies we use and rely on everyday. Discover deeper content as a Premium member.