Extract shell logic into modules Node can test #9

Closed
opened 2026-08-16 22:10:10 +01:00 by joshquinlan · 1 comment
Owner

11.7k lines of QML and no .js: the least testable part of the
system.

Omarchy keeps plugin logic in plain .js ending in a guarded
module.exports, so QML imports it and Node unit-tests it without a
compositor. FuzzyMatch, LuaTable, NotificationRules, Levels and
WorkspaceSnapshot are pure functions wearing a QML costume.

11.7k lines of QML and no .js: the least testable part of the system. Omarchy keeps plugin logic in plain .js ending in a guarded module.exports, so QML imports it and Node unit-tests it without a compositor. FuzzyMatch, LuaTable, NotificationRules, Levels and WorkspaceSnapshot are pure functions wearing a QML costume.
Author
Owner

FuzzyMatch, LuaTable, NotificationRules, Levels and WorkspaceSnapshot each keep their Quickshell singleton as a facade over a plain QtObject in services/logic that imports nothing but QtQuick. Ranking, LuaLiteral, NotificationMatch, VolumeCurve and WorkspaceFacts.

Tested with Qt Quick Test rather than Node: ./test/qml runs the tst_*.qml cases through qmltestrunner-qt6 headless, so no compositor is involved and nothing opens on screen. 50 cases passing.

Writing them turned up a real bug: LuaLiteral wrote a JavaScript null straight into a Lua table literal. It writes nil now.

Landed in cf4cbc5. Note that Levels.wordFor, Levels.readout and Levels.volumeWords have no caller anywhere in the shell; they are covered rather than deleted, but they either want wiring up or removing.

FuzzyMatch, LuaTable, NotificationRules, Levels and WorkspaceSnapshot each keep their Quickshell singleton as a facade over a plain QtObject in services/logic that imports nothing but QtQuick. Ranking, LuaLiteral, NotificationMatch, VolumeCurve and WorkspaceFacts. Tested with Qt Quick Test rather than Node: ./test/qml runs the tst_*.qml cases through qmltestrunner-qt6 headless, so no compositor is involved and nothing opens on screen. 50 cases passing. Writing them turned up a real bug: LuaLiteral wrote a JavaScript null straight into a Lua table literal. It writes nil now. Landed in cf4cbc5. Note that Levels.wordFor, Levels.readout and Levels.volumeWords have no caller anywhere in the shell; they are covered rather than deleted, but they either want wiring up or removing.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
joshquinlan/dotfiles#9
No description provided.