Add Nocturne Glucose Sparkline on Taskbar mod#4601
Conversation
Version 0.1.0. Renders a glucose sparkline with predicted glucose, loop status (IOB/COB) and server alerts on the Windows 11 taskbar, auto-positioned to track the centred app icons. Reads a local V4 summary JSON written by the Nocturne desktop companion.
- Settings: remove a colon-space from the dataPath $description so the settings block parses as valid YAML. - Symbol hooks: rename the hook array to taskbarViewHooks and add a target module comment (Taskbar.View.dll, ExplorerExtensions.dll).
Submission reviewNote: This review was done by Claude, and then refined manually. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding. Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them. 1. The global std::thread* g_readerThread = nullptr; // trivial dtor; intentionally leaked at shutdown
// StartReader: g_readerThread = new std::thread(ReaderLoop);
// StopReader: g_running.store(false);
// if (g_readerThread) { if (g_readerThread->joinable()) g_readerThread->join();
// delete g_readerThread; g_readerThread = nullptr; }The same shutdown path also runs the destructors of the other globals with non-trivial destructors ( 2. The tile is never removed when the mod is disabled (reversibility). A core Windhawk principle is that a mod's effects disappear when it is disabled. Here the tile is intentionally left behind (per the 3. BOOL Wh_ModSettingsChanged(BOOL* bReload) {
*bReload = TRUE; // rebuild the tile (and re-read geometry) via the reload path
return TRUE;
}— the reload re-runs 4. Add a screenshot/GIF to the README. The mod has an obvious visual effect (a taskbar tile), but the README has no image. Adding one ( 5. Minimal JSON parser optional suggestion: Consider using WinRT API instead of parsing manually. You can use the |
- Reader thread: move from a global std::thread (value) to a heap pointer with a trivial destructor, so DLL_PROCESS_DETACH (where Wh_ModUninit is not called) can't hit ~std::thread() on a still-joinable thread -> std::terminate. The real join+delete stays in Wh_ModUninit. - winrt globals (g_dispatcher, g_borderStoryboard): heap-leak via reference so their COM destructors never run at process shutdown; release them on the UI thread during normal teardown instead. - Reversibility: add Wh_ModBeforeUninit that synchronously removes the tile (dispatch to the UI thread and wait) while the apartment is still alive, so a plain disable leaves no stale widget. Capture rootGrid for the removal. - Settings: switch to Wh_ModSettingsChanged(BOOL* bReload) with *bReload = TRUE so geometry-at-construction settings (fontSize, lineThickness, sparkline width/height) take effect by rebuilding the tile.
|
Thanks for the detailed review. Addressed the required items in 484554b: 1. Shutdown crash from the global 2. Reversibility. Added 3. Geometry settings not applying. Switched to On the optional items: I'll look at adding a screenshot to the README. The manual JSON parser I'll keep for now (the summary file is small and the parse path is |
New mod: Nocturne Glucose Sparkline on Taskbar (
nocturne-glucose-sparkline), version 0.1.0.Renders a glucose sparkline directly on the Windows 11 taskbar — recent CGM readings as a solid line, the predicted-glucose continuation as a dashed line, plus the current value, trend arrow, an optional loop-status line (IOB/COB), and a pulsing border on active server alarms. The tile auto-positions just left of the centred app icons and slides as apps open/close.
It reads a local
V4SummaryResponseJSON written by the Nocturne desktop companion / packaged widget (default%LOCALAPPDATA%\Nocturne\glucose.json). There is no network access fromexplorer.exe— the mod only ever reads that file.TaskbarFrame::OnTaskbarLayoutChildBoundsChangedinTaskbar.View.dll.@githubmatches the PR author (https://github.com/ryceg).