<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[AK Dev]]></title><description><![CDATA[Notes from a developer building small Windows tools, PowerToys extensions, and open-source side projects.]]></description><link>https://akblog.hashnode.dev</link><image><url>https://cdn.hashnode.com/uploads/logos/6afbec6fba611ce8e5b075e1/0940a351-94f5-43e4-892f-ef0708780901.png</url><title>AK Dev</title><link>https://akblog.hashnode.dev</link></image><generator>RSS for Node</generator><lastBuildDate>Wed, 18 Nov 2026 14:06:45 GMT</lastBuildDate><atom:link href="https://akblog.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Three list pages and a paste: what shipping a PowerToys Command Palette extension takes]]></title><description><![CDATA[Three list pages, a self-contained clipboard thread, and the paste that has to land in the right window: what building this extension actually took.]]></description><link>https://akblog.hashnode.dev/three-list-pages-and-a-paste-what-shipping-a-powertoys-command-palette-extension-takes</link><guid isPermaLink="true">https://akblog.hashnode.dev/three-list-pages-and-a-paste-what-shipping-a-powertoys-command-palette-extension-takes</guid><category><![CDATA[Windows]]></category><category><![CDATA[C#]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[powertoys]]></category><dc:creator><![CDATA[Azad Kshitij]]></dc:creator><pubDate>Tue, 17 Nov 2026 07:54:25 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afbec6fba611ce8e5b075e1/5d168317-8e80-4ec6-854c-511a5cc5ee48.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Windows has a clipboard history. It is called Win+V, it is off by default, and it
forgets the unpinned history when the machine restarts. Windows also has Sticky
Notes, which is a separate window, a separate app, and a separate thing to
remember.</p>
<p>I wanted both in the palette I already open all day. PowerToys ships a Command
Palette with an extension model, so I wrote NanoNotes as an extension rather
than another tray app. This is the list of things that were harder than they
looked, in the order I hit them.</p>
<p><img src="https://cdn.hashnode.com/uploads/og-images/6afbec6fba611ce8e5b075e1/a40f101c-670b-450d-bf36-4db9eccd427f.png" alt="NanoNotes commands in the PowerToys Command Palette" /></p>
<p><em>Search, notes, clipboard history and the notes file, all from the same palette.</em></p>
<h2>The SDK gives you less than you expect</h2>
<p>The package is <code>Microsoft.CommandPalette.Extensions</code>. A page is a
<code>DynamicListPage</code>, and you feed it items; the host owns rendering, keyboard
handling and the window chrome. That is a good trade for a small extension, but
it means the things you would normally do with a <code>ListView</code> are not yours to do.</p>
<p>I have three pages: search, notes, clipboard. Each one builds its rows from the
same item factory, so a note looks like a note in every list, and a clipboard
entry looks like a clipboard entry.</p>
<p><img src="https://cdn.hashnode.com/uploads/og-images/6afbec6fba611ce8e5b075e1/911d199e-88b9-41ad-a53a-0be900c42a34.png" alt="The notes page with the detail pane open" /></p>
<p><em>The detail pane is built by the same item factory as every other row.</em></p>
<p>The gap that cost me an evening: there is no selection API. When you delete the
selected row, the host rebuilds the list and the selection jumps to the top. The
workaround is a tombstone row plus a suppressed refresh, which keeps the list
looking stable. It is a hack, it is documented in the repo, and I would remove
it the day the SDK exposes selection.</p>
<h2>Put the data where the user can see it</h2>
<p>A packaged Windows app writes to <code>AppData</code> by default, and <code>AppData</code> is where
data goes to be forgotten. Notes are the one thing in this app that a user might
want to back up, edit or read with <code>notepad</code>, so they live in Documents:</p>
<pre><code class="language-text">Documents\Notes\
  notes.json
  clipboard.json
  Images\
    2026-11-15-231204-1a2b.png
</code></pre>
<p>Two decisions came out of that.</p>
<p>First, a corrupt file must not eat the good one. The store only treats a
<code>JsonException</code> as corruption, and only then renames the file to <code>.bad</code>. A
locked file, a half-written file, a transient IO error: those refuse the save and
say so. The earlier version moved the file aside on any read error, which is a
great way to lose a year of notes to a virus scanner holding a handle.</p>
<p>Second, if the file is editable, people will edit it. Hand-written JSON arrives
with missing ids, missing timestamps and text that is not text. The loader fills
the gaps and refuses to sort a note into the year 1.</p>
<p>Saving runs on a timer and on shutdown. Clipboard writes can arrive several
times a second, so the file is written when the data settles, not per keystroke.</p>
<h2>The clipboard is a shared resource with sharp edges</h2>
<p>The clipboard is a single system-wide thing owned by a window station, and
touching it from the UI thread is how you get a frozen palette. NanoNotes runs
one dedicated STA thread and puts every clipboard read and write through it, so
the monitor and the writer cannot race each other.</p>
<p><img src="https://cdn.hashnode.com/uploads/og-images/6afbec6fba611ce8e5b075e1/9fca7432-0834-4a5f-84fe-8b9727c8364e.png" alt="Clipboard history with text and image entries" /></p>
<p><em>The action bar shows Copy, Paste (Ctrl+Enter) and More on every row.</em></p>
<p>Then the guards, because a clipboard monitor without them is a disk filler:</p>
<ul>
<li>Text over 100,000 characters is skipped. Nobody wants a 4 MB log line in a
search list.</li>
<li>A decoded image over 64 MB is dropped.</li>
<li>The same picture copied twice points at one PNG. Deleting one entry cannot
delete the file while another entry still references it.</li>
<li>An orphan sweep removes PNGs nobody references, but leaves anything younger
than ten minutes alone, because a file can be written before its entry is
saved.</li>
</ul>
<p>The app also marks its own copies. Without that, pasting a note puts the same
text back into clipboard history as a new entry, and the list fills with copies
of itself.</p>
<h2>Making paste land in the right window</h2>
<p>Copy is easy. Paste is the hard part, and it is the feature people notice.</p>
<p>The palette takes focus when it opens. By the time the user picks a row, the
window they came from is behind it, and <code>SendInput</code> sends keys to whatever has
focus now. Send it too early and the text lands in the palette's own search box,
which is a spectacular way to corrupt a note. Here is the whole path, from
polling to the keystroke:</p>
<p><img src="https://cdn.hashnode.com/uploads/og-images/6afbec6fba611ce8e5b075e1/c42c3506-ea30-4183-b2d0-2c3353ed6cdc.png" alt="How Paste lands in the right window" /></p>
<p>The sequence that works:</p>
<ol>
<li>A background tracker polls the foreground window every 100 ms and keeps the
last app that was not the palette, plus the focused control inside it. Focus
events are not delivered to an extension, so polling does the job.</li>
<li>The row's paste action writes the clipboard and asks the palette to close.</li>
<li>Wait for focus to return to that window.</li>
<li>Send Ctrl+V as real keyboard input.</li>
</ol>
<p>If focus never returns, nothing is typed. Failing silently is better than
pasting a password into a search box.</p>
<p>The limitation is real: <code>SendInput</code> cannot deliver into an elevated window. Copy
works there, paste does not, and the app says so rather than pretending.</p>
<h2>Details panes are a performance trap</h2>
<p>The selected row shows a preview: full text, when it was saved or copied, line
and word counts. The naive version rebuilt that pane for every row on every
keystroke, which made typing in the search box feel heavy on a long history.
Finished panes are now cached, and the line wrapping no longer copies the string
once per wrapped line.</p>
<h2>Packaging is the part nobody warns you about</h2>
<p>The extension is an MSIX. For the GitHub releases I signed it with a self-signed
certificate, which means every user has to trust that certificate once before
Windows will install the package. That is a terrible first-run experience for a
free utility, and no amount of README explaining fixes it.</p>
<p>The Store removes that step entirely, and it gives you <code>winget install</code> for
free, because Store packages are resolvable from the <code>msstore</code> source. If I
started again, I would ship to the Store first and treat the signed MSIX as the
offline fallback.</p>
<h2>What I would do differently</h2>
<ul>
<li>Store first. Self-signed side-loading is a developer convenience, not a
distribution plan.</li>
<li>Write the clipboard thread before the first page. Retrofitting it means
auditing every call site.</li>
<li>Keep the storage layer free of UI types from day one. The notes page and the
search page both want the same rows, and the item factory only stayed small
because the store knows nothing about XAML.</li>
</ul>
<p>The app is free, GPL-3, and the source is at
<a href="https://github.com/AzadKshitij/NanoNotes">github.com/AzadKshitij/NanoNotes</a>.
It needs PowerToys with Command Palette enabled. If you have shipped one of
these extensions and solved the selection problem properly, I would like to read
that code.</p>
<p>If you are writing your own Command Palette extension, the source is small and
the issues list is honest about the parts that are held together with tape:
<a href="https://github.com/AzadKshitij/NanoNotes">https://github.com/AzadKshitij/NanoNotes</a></p>
]]></content:encoded></item><item><title><![CDATA[Win+V forgets your clipboard when Windows restarts. Here is what I use instead.]]></title><description><![CDATA[A free PowerToys Command Palette extension keeps notes and clipboard history across restarts, in plain files on your PC.]]></description><link>https://akblog.hashnode.dev/win-v-forgets-your-clipboard-when-windows-restarts-here-is-what-i-use-instead</link><guid isPermaLink="true">https://akblog.hashnode.dev/win-v-forgets-your-clipboard-when-windows-restarts-here-is-what-i-use-instead</guid><category><![CDATA[Windows]]></category><category><![CDATA[Open Source]]></category><category><![CDATA[Productivity]]></category><category><![CDATA[powertoys]]></category><dc:creator><![CDATA[Azad Kshitij]]></dc:creator><pubDate>Tue, 17 Nov 2026 06:47:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/6afbec6fba611ce8e5b075e1/f5b226bd-a7a9-4b18-8f8d-d005145b9c1d.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Almost everyone has done this. Copy a phone number, a sentence from an email, a link, a tracking code, meaning to come back to it later. Then something else happens and the copy is forgotten. Twenty minutes later the text is needed, and it is still in the clipboard, so all is well.</p>
<p>The next morning it is gone.</p>
<p>Windows was not built to hold on to copied text. Win+V gives you a clipboard history, but a restart clears it, except for the items you pinned. The conventional answer is to install a clipboard manager: another app, another tray icon, another thing to learn.</p>
<p>There is a different answer if you already use PowerToys. Its Command Palette is the keyboard launcher you open with Win+Alt+Space. Type a few letters, pick a result, keep working. A free extension called NanoNotes puts two things in that launcher: a clipboard history that survives restarts, and a place for quick notes.</p>
<p>So you get what a clipboard manager does, plus somewhere to put a thought, in a window you already open all day.</p>
<p>Command Palette can already show the Win+V list. NanoNotes keeps its own copy on disk, so a clip is still there tomorrow.</p>
<img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/ls5gshpebdvhypjcazkm.png" alt="NanoNotes: quick notes and clipboard history for the PowerToys Command Palette" style="display:block;margin:0 auto" />

<h3>What you need from it</h3>
<p>One place that opens from the keyboard. Type a thought, press Enter, it is saved. Later, search in one box and find both the thought and the thing you copied. Put either one back where you were working, without switching windows.</p>
<p>Nothing in the cloud. No account to create. Nothing that needs to sync before it works.</p>
<h3>NanoNotes</h3>
<p>It is a free extension for the PowerToys Command Palette. PowerToys is free software from Microsoft, and Command Palette is its launcher. NanoNotes adds quick notes and its own clipboard history to it.</p>
<p>Here is the whole routine.</p>
<ol>
<li>Press Win+Alt+Space and type a thought. Press Enter. It is saved.</li>
<li>Later, type a word you remember. One search shows your notes and the things you copied, newest first, each row labelled so you know which is which.</li>
<li>Press Enter to copy a row. Ctrl+Enter pastes it straight back into the app you came from, whether that is a form, a document, an email or a canvas.</li>
</ol>
<img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/mkyysf13kanvnvswyn6f.png" alt="The notes list, newest first, with the full note on the right" style="display:block;margin:0 auto" />

<p>It also keeps the images you copy, if you want it to. A screenshot from two days ago shows up in the same search.</p>
<img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/428qonzws147mo2k02rp.png" alt="Clipboard history with text and image entries" style="display:block;margin:0 auto" />

<p>The clipboard history survives restarts. That is the point of it.</p>
<h3>Keyboard shortcuts</h3>
<p>Everything above starts from Win+Alt+Space. The clipboard command takes its own hotkey: give it one in Command Palette settings and it opens straight there. No mouse, no hunting for the command. Notes are just as quick: open the palette, type, press Enter.</p>
<h3>Where it helps in an ordinary day</h3>
<p>You copy a delivery tracking number on your phone and need it on the PC later. It is still there.</p>
<p>Someone reads out an address during a call. You open the palette, type it, press Enter, and keep listening.</p>
<p>You copy a paragraph from an email, then lose it when a tab closes. Search a word from it and it comes back.</p>
<p>You need an image you copied from a PDF yesterday. It sits in the same list as your text.</p>
<p>You remember writing something about "deploy on Tuesday" but not where. One search finds the note, and you can paste it straight into the message you were writing.</p>
<h3>Your data stays in a folder you can open</h3>
<p>This is the part that matters most.</p>
<p>Notes and clipboard history are plain files in <code>Documents\Notes</code>. Open them with Notepad. Copy them to a backup drive. Delete a file and the entry is gone. Read them five years from now even if the app no longer exists.</p>
<p>There is no sign-in, no sync, no analytics and no network code in the extension. It works on a plane. It does not know your name.</p>
<p>You choose how long clips are kept: 7 to 30 days, 14 by default, with a 500 entry limit. Image capture can be switched off.</p>
<h3>Who this is not for</h3>
<p>If you want your notes on your phone and your PC, this is the wrong tool. There is no account and no sync, on purpose.</p>
<p>If you want a different hotkey for every pinned snippet, a dedicated clipboard manager is still the better fit. Ditto and ClipClip are good at that. NanoNotes gives you a clipboard command you can hotkey, and Win+Alt+Space for everything else.</p>
<p>If you copy passwords out of a password manager, think before using any clipboard history, including this one. Whatever reaches the Windows clipboard can be recorded. Keep the retention short and clear the history if that bothers you.</p>
<h3>Install it</h3>
<p>It is free in the Microsoft Store, so Windows handles the install and the updates.</p>
<pre><code class="language-text">winget install NanoNotes
</code></pre>
<p>Or install it from the <a href="https://apps.microsoft.com/detail/9nw3g5pqwf51">Microsoft Store</a>.</p>
<p>You need PowerToys with Command Palette enabled, on Windows 10 (19041 or newer) or Windows 11. Press Win+Alt+Space, type <code>notes</code>, and the extension's commands show up.</p>
<img src="https://dev-to-uploads.s3.us-east-2.amazonaws.com/uploads/articles/uyz9mo08v2x8z4kw6s6k.png" alt="NanoNotes commands in the PowerToys Command Palette" style="display:block;margin:0 auto" />

<p>NanoNotes is open source under GPL-3, one person's project and not a Microsoft product. You can read every line of it.</p>
<p>Feedback goes to the <a href="https://github.com/AzadKshitij/NanoNotes/issues">project's GitHub issues</a>. The parts that get built next come from the people who use it.</p>
]]></content:encoded></item></channel></rss>