repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

chore(nuguland): remove prototype scaffolding files

5c4e5bdfae68dcabb276c64d59984baf83df6ba7

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Diagnostics debug panel, SPEC.md prototype notes, and the gate/smoke/
nested-niri dev shims are dead — delete them.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Changed files (5)

quickshell/nuguland/Diagnostics.qml

Deleted
deleted file mode 100644
1 -import QtQuick
3 -Item {
4 - id: root
6 - property QtObject niriService
7 - property QtObject timeService
8 - property QtObject resourceService
9 - property QtObject notificationService
10 - property QtObject trayService
11 - property QtObject clipboardService
12 - property QtObject mediaService
13 - property QtObject audioService
14 - property QtObject idleService
15 - property QtObject privilegeService
16 - property QtObject lockService
17 - property QtObject networkService
18 - property QtObject bluetoothService
19 - property QtObject powerService
20 - property QtObject screenshotsService
21 - property QtObject launcherService
22 - property QtObject osdService
23 - property QtObject surfaces
25 - function parseJson(text, valueWhenInvalid) {
26 - try {
27 - return JSON.parse(String(text));
28 - } catch (error) {
29 - return valueWhenInvalid;
30 - }
31 - }
33 - function componentState(component, ready) {
34 - return {
35 - "component": component,
36 - "ready": ready,
37 - "status": ready ? "ready" : "missing"
38 - };
39 - }
41 - function diagnosticsPanelContract() {
42 - return {
43 - "source": "Nuguland ContentPage.qml plus Nuguland NavigationRail.qml plus Nuguland SlideView.qml",
44 - "ownedBy": "PopoutHost.qml inline DiagnosticsPanel",
45 - "nativeHealthConsole": true,
46 - "serviceStatusGrid": true,
47 - "referenceContractRail": true,
48 - "cleanupProcessCard": true,
49 - "surfaceAnchorMap": true,
50 - "failureShakeSlot": true,
51 - "serviceActionsOnly": true,
52 - "panels": ["services", "references", "cleanup", "surfaces", "failure"],
53 - "mutationScope": "none"
54 - };
55 - }
57 - function referenceComparisonNotes() {
58 - return {
59 - "sourceFamilies": ["nuguland", "Nuguland", "Nuguland", "nuguland"],
60 - "adoptedMechanics": [{
61 - "source": "Nuguland Wrapper.qml Content.qml AnchorAnim.qml plus Nuguland BarPopup.qml plus Nuguland Tooltip.qml",
62 - "mechanic": "attached bar popout morph",
63 - "owner": "PopoutHost.qml",
64 - "proofRoute": "nested-niri smoke visual diff",
65 - "liveEvidence": "popout_region_visual target rect changes",
66 - "screenshotEvidence": "nested niri before/after PNG diff",
67 - "sourceSnippetEvidence": "Wrapper.qml Content.qml AnchorAnim.qml"
68 - }, {
69 - "source": "Nuguland NotifGroup.qml NotifActionList.qml plus Nuguland Notifications.qml",
70 - "mechanic": "grouped notification card with action rail",
71 - "owner": "PopoutHost.qml inline NotificationGroup",
72 - "proofRoute": "notifications_state contract",
73 - "liveEvidence": "group expand and drag-dismiss state",
74 - "screenshotEvidence": "notifications popout rendered through target rect",
75 - "sourceSnippetEvidence": "NotifGroup.qml NotifActionList.qml"
76 - }, {
77 - "source": "Nuguland ClockNumber.qml",
78 - "mechanic": "vertical odometer clock digits",
79 - "owner": "Bar.qml",
80 - "proofRoute": "time_state odometer contract",
81 - "liveEvidence": "IBM Plex Mono digit cells",
82 - "screenshotEvidence": "clock bar anchor participates in nested visual diff",
83 - "sourceSnippetEvidence": "Clock.qml ClockNumber.qml"
84 - }],
85 - "rejectedMechanics": [{
86 - "source": "old Nuguland widgets",
87 - "mechanic": "widget-owned detached popups",
88 - "reason": "wrong anchor ownership and broken morph continuity",
89 - "replacement": "one bar-owned popout host"
90 - }, {
91 - "source": "Nuguland decorative extras",
92 - "mechanic": "beat visualizers and heavy glow",
93 - "reason": "weak Nugu hierarchy and extra runtime cost",
94 - "replacement": "service-driven line and semantic Nugu colors"
95 - }, {
96 - "source": "Nuguland command/plugin patterns",
97 - "mechanic": "command-string launcher rows",
98 - "reason": "actions must stay service-owned and auditable",
99 - "replacement": "typed launcher provider rows"
100 - }, {
101 - "source": "mutable shell products",
102 - "mechanic": "settings center",
103 - "reason": "Nuguland is personal source constants",
104 - "replacement": "fixed source-defined popouts"
105 - }]
106 - };
107 - }
109 - function referenceRuntimeContracts() {
110 - return {
111 - "screenEdgeDrawers": {
112 - "source": "Nuguland drawers Regions.qml/Interactions.qml",
113 - "pointerRegionsSeparateFromPanels": true,
114 - "outsideDismissPath": "mask-subtracts-visible-panels",
115 - "dragHandoff": ["press", "drag", "release", "cancel", "commit"]
116 - },
117 - "quickControls": {
118 - "source": "Nuguland utilities Toggles.qml plus Nuguland actionCenter",
119 - "fixedPersonalControls": ["audio", "network", "bluetooth", "microphone", "dnd", "idle", "screenshot", "color", "power-profile", "session"],
120 - "serviceBacked": true,
121 - "settingsBacked": false
122 - },
123 - "launcherRowShape": {
124 - "source": "Nuguland startMenu SearchResults plus Nuguland launcher items",
125 - "requiredFields": ["provider", "iconRole", "verb", "subtitle", "tags", "preview"],
126 - "singleList": true,
127 - "commandStrings": false
128 - },
129 - "launcherPreviewPanel": {
130 - "source": "Nuguland SearchResults.qml ResultPreview plus Nuguland launcher Content.qml",
131 - "selectedResultDrivesPreview": true,
132 - "previewActionRows": ["primary", "copy-title", "copy-subtitle"],
133 - "sidePanelWidth": 386,
134 - "keyboardReturnActivates": "primaryAction",
135 - "settingsBacked": false
136 - },
137 - "windowCardShape": {
138 - "source": "Nuguland WindowInfo plus Nuguland taskView",
139 - "requiredFields": ["appId", "title", "workspace", "ruleHints", "preview", "actions"],
140 - "actionBackend": "Niri.qml"
141 - },
142 - "mprisDirection": {
143 - "source": "Nuguland MprisController.qml",
144 - "trackChangeDirection": ["previous", "next"],
145 - "ownedBy": "Media.qml"
146 - },
147 - "trayMenuModel": {
148 - "source": "Nuguland systray MenuView.qml",
149 - "oneExpandedSubmenu": true,
150 - "rowKinds": ["action", "separator", "submenu", "check", "radio", "disabled"]
151 - },
152 - "screenshotSelectionVisuals": {
153 - "source": "Nuguland screenSnip plus Nuguland Geom.qml",
154 - "parts": ["dimmed-mask", "clear-cutout", "corner-handles", "dimensions", "toolbar-actions"],
155 - "captureBackend": "niri-native"
156 - },
157 - "nugulandCornerAccents": {
158 - "source": "Nuguland Rope.qml",
159 - "bounded": true,
160 - "freePhysicsLoop": false,
161 - "use": "selection-corner-accent"
162 - },
163 - "scrollableListChrome": {
164 - "source": "Nuguland ScrollEdgeFade.qml plus Nuguland FlickMonitor.qml",
165 - "scrollEdgeFade": ["topEdgeFade", "bottomEdgeFade"],
166 - "scrollHint": "delayed-hover-chevron-stack",
167 - "flickMonitor": true,
168 - "velocitySamples": 6,
169 - "consumers": ["Launcher.qml", "Clipboard.qml", "Notifications.qml"]
170 - },
171 - "clickablePrimitive": {
172 - "source": "Nuguland StateLayer.qml ButtonBase.qml",
173 - "stateLayerContract": "NuguStateLayer",
174 - "hoverOpacity": 0.08,
175 - "pressOpacity": 0.14,
176 - "disabledOpacity": 0.38,
177 - "rippleRadius": "radial-press-feedback",
178 - "pressOrigin": "pointer-local-origin",
179 - "shapeMorph": true,
180 - "keyboardActivation": ["Return", "Space"],
181 - "consumers": ["Bar.qml"]
182 - },
183 - "popoutFocusPolicy": {
184 - "source": "Quickshell PopupWindow.grabFocus plus Nuguland Wrapper.qml Keys.onEscapePressed",
185 - "nativePopupGrabFocus": true,
186 - "compositorFocusGrab": false,
187 - "outsideCloseReason": "focus-grab-outside",
188 - "escapeCloseReason": "escape-key",
189 - "insideClicksRetain": true,
190 - "closeReasons": ["focus-grab-outside", "escape-key", "outside", "hideAll"]
191 - },
192 - "hoverSwitchPolicy": {
193 - "source": "Nuguland bar.checkPopout hover switching",
194 - "event": "hover-switch",
195 - "switchesOnlyWhenOpen": true,
196 - "retainsPreviousDuringHoverSwitch": true,
197 - "anchorMorph": "previous-anchor-to-next-anchor",
198 - "loaderPolicy": "single-active-loader-with-close-retention"
199 - },
200 - "popoutGestureMachine": {
201 - "source": "Nuguland Interactions.qml",
202 - "ownedBy": "SurfaceManager.qml",
203 - "states": ["idle", "armed", "dragging", "committed", "cancelled"],
204 - "path": ["press", "drag", "release", "cancel", "commit"],
205 - "pointerParity": true,
206 - "keyboardParity": true,
207 - "compositorSpecific": false
208 - },
209 - "revealIndicatorPrimitive": {
210 - "source": "Nuguland Revealer.qml",
211 - "ownedBy": "Bar.qml",
212 - "animateWidthHeightMargins": true,
213 - "consumers": ["Bar.qml"],
214 - "jumpLayout": false,
215 - "clipDuringReveal": true
216 - },
217 - "errorShakePrimitive": {
218 - "source": "Nuguland ErrorShakeAnimation.qml",
219 - "ownedBy": "inline FailureShake components",
220 - "shakeOffsets": [0, -12, 12, -6, 6, 0],
221 - "boundedDistance": 12,
222 - "consumers": ["PopoutHost.qml inline DiagnosticsPanel", "Lock.qml inline LockSurface", "shell.qml inline PrivilegeSurface"],
223 - "layoutDisplacementAfterCompletion": false
224 - },
225 - "resourceHeroCard": {
226 - "source": "Nuguland performance HeroCard.qml plus Nuguland Graph.qml",
227 - "ownedBy": "Resources.qml",
228 - "visualPrimitive": "inline ResourceMeter in PopoutHost.qml",
229 - "boundedHeroMeter": true,
230 - "sparklineSamples": true,
231 - "consumers": ["PopoutHost.qml"]
232 - }
233 - };
234 - }
236 - function stateJson() {
237 - const niriState = niriService ? parseJson(niriService.stateJson(), {
238 - }) : {
239 - };
240 - const surfaceState = surfaces ? parseJson(surfaces.popoutState(), {
241 - }) : {
242 - };
243 - const anchorState = surfaces ? parseJson(surfaces.registeredAnchors(), {
244 - }) : {
245 - };
246 - return JSON.stringify({
247 - "personalConfig": {
248 - "settingsApp": false,
249 - "runtime": "qs -c nuguland"
250 - },
251 - "smoke": {
252 - "nestedTarget": "niri",
253 - "visualProofRequired": true
254 - },
255 - "cleanup": {
256 - "zeroLeftoversRequired": true,
257 - "tempPrefixes": ["/tmp/nuguland-smoke.", "/tmp/nuguland-niri.", "/tmp/nugu-qs-smoke."]
258 - },
259 - "processPolicy": {
260 - "widgetProcesses": "forbidden",
261 - "owners": ["Niri.qml", "services", "smoke.sh", "nested-niri.sh"]
262 - },
263 - "sourceFamilies": ["nuguland", "Nuguland", "Nuguland", "nuguland"],
264 - "diagnosticsPanelContract": diagnosticsPanelContract(),
265 - "referenceRuntimeContracts": referenceRuntimeContracts(),
266 - "referenceComparisonNotes": referenceComparisonNotes(),
267 - "serviceHealth": {
268 - "niri": {
269 - "component": "Niri.qml",
270 - "ready": !!niriService,
271 - "available": !!niriState.available,
272 - "eventStreamReady": !!niriState.ready
273 - },
274 - "resources": componentState("Resources.qml", !!resourceService),
275 - "time": componentState("Time.qml", !!timeService),
276 - "notifications": componentState("Notifications.qml", !!notificationService),
277 - "tray": componentState("Tray.qml", !!trayService),
278 - "clipboard": componentState("Clipboard.qml", !!clipboardService),
279 - "media": componentState("Media.qml", !!mediaService),
280 - "audio": componentState("Audio.qml", !!audioService),
281 - "idle": componentState("Idle.qml", !!idleService),
282 - "privilege": componentState("Privilege.qml", !!privilegeService),
283 - "lock": componentState("Lock.qml", !!lockService),
284 - "network": componentState("Network.qml", !!networkService),
285 - "bluetooth": componentState("Bluetooth.qml", !!bluetoothService),
286 - "power": componentState("Power.qml", !!powerService),
287 - "screenshots": componentState("Screenshots.qml", !!screenshotsService),
288 - "launcher": componentState("Launcher.qml", !!launcherService),
289 - "osd": componentState("Osd.qml", !!osdService),
290 - "surfaces": componentState("SurfaceManager.qml", !!surfaces)
291 - },
292 - "anchors": anchorState,
293 - "surfaceState": surfaceState
294 - });
295 - }

quickshell/nuguland/SPEC.md

Deleted
deleted file mode 100644
1 -# Nuguland Spec
3 -Nuguland is my niri-native Quickshell desktop shell.
4 -It is a complete personal workflow shell, not a configurable product.
5 -It uses Nugu semantics, IBM Plex fonts, Quickshell services, niri IPC, and DBus-native integrations.
6 -It has one visual language, one workflow shape, one compositor target, and one production gate.
8 -## Non-negotiables
10 -- Nuguland runs as `qs -c nuguland`.
11 -- Nuguland targets niri only.
12 -- Widgets render and forward intent only.
13 -- Widgets never spawn programs, parse files, build command strings, or own backend polling.
14 -- Every widget consumes a service object.
15 -- Services own facts, polling, parsing, commands, timers, cleanup, state, and action routing.
16 -- Process use is confined to niri integration, service backends with no Quickshell-native API, and the test harness.
17 -- Every process has an owner, timeout, stderr capture, exit handling, and cleanup proof.
18 -- No settings app exists.
19 - Personal choices are source constants.
20 - Persisted state exists only for clipboard history and explicitly approved clipboard metadata.
21 -- The final tree contains only files needed to run, style, test, or explain Nuguland.
22 -- Production readiness requires nested niri proof with pointer input, screenshots, animation evidence, service state, and zero leftover processes or temp files.
24 -## Visual system
26 -- Font policy: IBM Plex Sans for UI, IBM Plex Mono for status/time/code-like text, verified Nerd Font glyphs only where text is not enough.
27 -- Color policy: `Theme.qml` consumes generated Nugu data and exposes semantic tokens only.
28 -- Text/content surfaces use `content.*`; chrome, borders, panels, and controls use `ui.*`.
29 -- Active UI uses `ui.focus` background with `content.backdrop` text.
30 -- Hover and accent UI use `ui.accent` background with `content.backdrop` text.
31 -- Muted UI text uses `ui.minor` over `ui.backdrop`.
32 -- Error, warning, info, and debug colors are semantic signal colors, not decoration.
33 -- Critical foreground/background pairs meet WCAG contrast 4.5 or better, with small bar text aimed at 7 or better.
34 -- Motion is short, spatial, and tied to object continuity.
35 - Popouts grow from their visible anchor.
36 - Dismissal reverses the same path.
37 -- Decorative effects never obscure hierarchy, input target, text contrast, or cleanup.
38 -- `logo.svg` is the large Nuguland mark: N-bug icon plus inline lowercase `nugu land` wordmark, derived from the compact rhythm of `bugabinga.min.svg`, using Nugu palette colors and IBM Plex Sans.
39 -- `logo-icon.svg` is the small Nuguland mark: N-bug icon only.
41 -### Logo usage rules
43 -- Use `logo.svg` when width is at least 160 px or text can remain readable: splash, about, diagnostics header, lock/session surfaces, documentation, and large empty states.
44 -- Use `logo-icon.svg` below 160 px width, below 40 px height, in square/circle slots, launcher icons, favicons, tray-like surfaces, buttons, compact bar affordances, and any place text would blur.
45 -- Do not squeeze, crop, re-letter, recolor outside Nugu roles, add outlines, add boxes around the large mark, or separate the wordmark from the icon.
46 -- Keep a visible gap between `nugu` and `land`; `land` stays accent-colored.
48 -## Reference-derived commitments
50 -These sources define the desired behavior, not a second document set.
51 -Reference comparison notes are production evidence: adopted mechanics include source, Nuguland owner, proof route, and live evidence; rejected mechanics include rejection reason and replacement.
52 -Reference source fingerprints bind extracted mechanics to exact files through `referenceSourceFingerprints` smoke evidence.
53 -Live screenshot comparison binds adopted and rejected concepts through `referenceVisualComparison` smoke evidence; `visualConceptCoverageComplete` means every adopted fingerprinted source has a live proof note.
54 -`referenceAdoptionMatrix` maps every fingerprinted source to a Nuguland owner, runtime contract, and proof marker.
55 -Bar/workflow extraction requires `barWorkflowReferenceCoverage` for workspace, status, tray, idle, scroll-hint, and widened-hit mechanics.
56 -`referenceBoundaryMatrix` records adopt, reduce, and reject decisions for attractive reference mechanics that need Nugu constraints or dependency removal.
57 -Surface workflow reference fingerprints cover nexus search, drawers, window info, shortcuts, cheatsheet, and tooltip hang behavior.
58 -Popout detail reference fingerprints cover content routing, audio, network, battery, clipboard wrapper, network card, quick sliders, and PipeWire mixer mechanics.
59 -Service interaction reference fingerprints cover toasts, battery warnings, idle/logind, quick toggles, notification dock, window actions, action center, region panel, notification fling, screenshot controller, and tray menu view.
60 -Security session reference fingerprints cover lock layout, password input, lock notifications, session wrapper, session content, Polkit shell, Polkit content, Polkit service, lock controller, and PAM session context.
61 -Primitive reference fingerprints cover styled text, icon buttons, split buttons, sliders, toggle rows, vertical fade flickables, elevation shadows, and ripple buttons.
62 -Launcher overview reference fingerprints cover launcher content, app list, action rows, start menu shell, categorized results, task view layout, launcher controller, and fuzzy launch content.
63 -Component scaffold reference fingerprints cover section containers, section headers, property rows, text fields, menus, menu items, loading indicators, and inner borders.
65 -| Area | Source | Keep | Reject |
66 -| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------- |
67 -| Bar popout morph | `Nuguland design archive/nuguland-shell/modules/bar/popouts/Wrapper.qml`, `Content.qml`, `AnchorAnim.qml`; `Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/waffle/bar/BarPopup.qml`; `Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/bar/Tooltip.qml` | one bar-owned host, named registry, anchor-center sizing, loader lifetime, Escape/focus policy, attached growth from bar item | widget-owned popups, detached cards, manual per-widget coordinates, duplicate hosts |
68 -| Notifications | `Nuguland design archive/nuguland-shell/modules/sidebar/NotifGroupList.qml`, `NotifGroup.qml`, `Notif.qml`, `NotifActionList.qml`; `Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/services/Notifications.qml`; `Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/notifications/NotificationManager.qml` | grouped history, compact preview, drag-dismiss, expand/collapse, close/copy/action rows, removal lifecycle lock, isolated smoke fixtures | Material palette, hidden config thresholds, network actions, untested gesture paths |
69 -| Session and power | `Nuguland design archive/nuguland-shell/modules/session/Content.qml`; `Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/ii/sessionScreen/SessionScreen.qml`; `Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/bar/power/Power.qml` | keyboard focus, Escape cancel, clear destructive confirmation, test-harness action routing, battery/profile detail | direct one-click destructive execution, decorative GIFs, unsafe kill buttons |
70 -| Launcher | `Nuguland design archive/nuguland-shell/modules/launcher/Content.qml`, `items/ActionItem.qml`, `items/CalcItem.qml`; `Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/services/LauncherSearch.qml`; `Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/launcher/Controller.qml` | one scored provider list, prefixes, windows/apps/actions/calculator/clipboard, preview panel, keyboard-first control | command-string plugin soup, web results, OCR/upload/image search |
71 -| Primitives | `Nuguland design archive/nuguland-shell/components/controls/ButtonBase.qml`, `IconButton.qml`, `StyledSlider.qml`, `StateLayer.qml`, `VerticalFadeFlickable.qml`; `Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/bar/FullwidthMouseArea.qml`, `ClickableIcon.qml`; `Nuguland design archive/nuguland/quickshell/components/bar/Clock.qml`, `WorkspaceCell.qml`, `FastMusicLine.qml` | state layers, full hit geometry, sliders, scroll fades, odometer clock idea, direction-aware workspace motion, tiny media line driven by service state | CAVA, inefficient video wallpaper, heavy shader parallax, fragile debug wrappers, non-IBM fonts |
72 -| Services | `Nuguland design archive/nuguland-shell/services/Players.qml`, `Time.qml`, `Notifs.qml`, `NetworkUsage.qml`, `IdleInhibitor.qml`; `Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/services/ResourceUsage.qml`, `BluetoothStatus.qml`, `Privacy.qml`; installed Quickshell service qmltypes | one service per domain, native MPRIS/PipeWire/UPower/Bluetooth/Notifications/SystemTray/Polkit/PAM/IdleInhibitor, ref-counted timers | shell pipelines in widgets, per-widget polling, hidden backend processes |
73 -| Screenshot and color | installed `niri msg action screenshot*`, `niri msg pick-color`, niri wiki key-binding and miscellaneous pages | niri-native screenshot UI, focused screen/window capture, absolute smoke paths, pointer control, native color picking | third-party capture/color helpers in live shell |
74 -| Test harness | current `../quickshell/nuguland/smoke.sh`, `nested-niri.sh`; niri `validate`, `-- <COMMAND>`, event stream, layer docs | process-group supervisor, private run dir, generated validated KDL, nested niri only, pointer/key/drag/screenshot proof, zero leftovers | IPC-only proof, host-compositor helpers, fixed `/tmp` logs, lingering DBus helpers |
76 -### Extracted reference mechanics
78 -- Popout state is a tiny state object: current name, open flag, anchor rect, and modal handoff.
79 - Content lives in one host.
80 - Changing the current name activates one loader, fades the previous loader out, then unloads it.
81 -- Popout sizing follows the active loader: width and height animate from the previous content to the next content.
82 - Opening and closing use the same spatial path in reverse.
83 -- Popout placement is anchored through `PopupWindow` using the visible bar item as source.
84 - The shell slides on the cross-axis, resizes on the growth axis, and clamps to the screen edge before reporting geometry.
85 -- The visual card is not the window.
86 - A transparent popup window owns margins, shadow, masks, focus, and capture policy; the card is an inner content surface that grows through the bar separator.
87 -- `popupInputMaskFrame` follows the animated card geometry; the transparent window is never the hover target.
88 -- Menu focus is owned by the popout host.
89 - Escape closes the active surface unless the active child has an explicit text-entry dialog.
90 - Lost focus and outside click close the popout.
91 - Inside click keeps it open.
92 -- Tooltip/menu continuity keeps the last active item during a short hang time, scales from 0.9 to 1.0, tracks animated y-bounds, and masks hoverable regions instead of spawning a second popup family.
93 -- Bar hit targets are larger than visible text or glyphs.
94 - Wheel events are forwarded after observation so widgets do not swallow compositor navigation by accident.
95 -- Notification groups are keyed by app, sorted by latest notification time, expose active count, app icon or image, highest urgency, relative time, animated expand height, explicit expand/collapse state, and render as one grouped card panel.
96 -- Notification actions are horizontal rows with close, server actions, and copy body.
97 - The visual panel uses a masked horizontal action rail adapted from Nuguland `NotifActionList.qml`.
98 - Drag-dismiss uses a bounded horizontal threshold adapted from Nuguland `NotifGroupList.qml`.
99 - Copy gives local feedback.
100 - Close and discard untrack the server notification and remove shell history without leaking timers.
101 -- Notification toasts and tray history share one notification service.
102 - DND, popup inhibition, unread count, timers, persistence, and discard-all are service state, not widget state.
103 -- Launcher providers share one scored result stream.
104 - Prefixes only select provider intent; results still render in one list with keyboard-first selection and pointer parity.
105 - Widgets never build command strings.
106 - Launcher selected results drive a preview panel with action rows, primary keyboard action, provider-specific facts, provider chips, and bottom-docked search field.
107 -- The clock may use odometer-like digit motion and hard separators.
108 - It must use Nugu roles and IBM Plex, with glow only as a minimal tasteful accent and never as structure.
109 - Clock digits use Nuguland-style vertical odometer motion inside `Bar.qml`.
110 -- Media state comes from native MPRIS players.
111 - Nuguland elects one active player, exposes aliases as source constants, keeps manual selection as explicit private state, and routes play, pause, previous, next, stop, position, metadata, and cover state through `Media.qml`.
112 - The media popout renders one cover/details/progress/transport/player-selector panel adapted from Nuguland media details and Nuguland MPRIS controller mechanics.
113 -- Network rate facts are service-owned, ref-counted, and keep fixed-length history buffers.
114 -- Resource facts parse kernel files inside `Resources.qml`: CPU, memory, swap, disk, and network counters.
115 - Widgets receive percentages, formatted labels, and bounded history arrays; no widget parses files or starts helpers.
116 - Resource cards use bounded hero meters and sparklines adapted from Nuguland performance cards and Nuguland graphs.
117 -- Privacy indicators come from PipeWire link state: active microphone streams, active screen/video capture, and recorder-like privacy state are facts exposed by one service and rendered as semantic warning/info UI.
118 -- Audio popout renders one PipeWire mixer panel: output selector, input selector, sink/source sliders, mute buttons, per-stream rows, and stream target reassignment adapted from Nuguland audio popout plus Nuguland mixer rows.
119 -- Bluetooth state uses the native Quickshell Bluetooth service.
120 - Devices are sorted connected first, paired next, unpaired last, with human names before raw device identifiers.
121 -- Connectivity popout is one combined service-fed panel: Wi-Fi toggle, scan state, active network, sorted network rows, Bluetooth adapter toggle, scan state, connected device rows, battery badges, and device actions.
122 - It adapts Nuguland network popout and Nuguland connections menu while keeping `Network.qml` and `Bluetooth.qml` as separate services.
123 -- Tray items use native SystemTray activation, secondary activation, scroll, and DBusMenu actions.
124 - Right-click menus are hosted by Nuguland popout/menu infrastructure, not by each tray glyph.
125 -- Power and battery state come from UPower display and device records: charge state, percentage, low threshold, external devices, time remaining, health, and power profile controls when available.
126 -- The Nuguland line idea becomes a tiny service-driven media/workspace accent: no external visualizer process, no CAVA, and no decoration loop.
127 -- Efficient shader effects are allowed inside a widget or wallpaper when bounded, measured, and visually subordinate.
128 -- The accepted prototype target is the Nugu aurora style at 15 fps.
129 -- The production shape is a Quickshell background layer with no image wallpaper.
130 -- Idle CPU must drop near zero when the shader is static or fully occluded.
131 -- Pointer movement may wake the shader for a short smoothed reaction window.
132 -- The x230 proof budget is about 3% `qs` CPU for visible 15 fps animation; 30 fps is too expensive and 10 fps is too stuttery.
133 -- Wallpaper video or shader work is allowed only if efficient on x230 and not part of core shell correctness.
134 -- Shader source lives in `shaders/*.frag`.
135 -- Compiled Qt shader blobs live beside source as `*.frag.qsb` and are checked in.
136 -- `just build` compiles every `shaders/*.frag` into its `*.frag.qsb` blob.
137 -- `just lint` and `just check` fail when any shader blob is missing, stale, or orphaned.
138 -- Nuguland runtime never compiles shaders.
139 -- Shader-backed surfaces hide or degrade cleanly when a checked-in blob is unavailable at runtime.
140 -- This lifecycle applies to the aurora backdrop and every future shader.
141 - The line follows MPRIS activity or niri workspace motion using Nugu semantic colors.
142 -- Session UI is a full-screen overlay with exclusive keyboard focus.
143 - It starts on a safe focused action, supports arrow and Tab navigation, Escape or outside click cancels, and destructive actions require confirmation plus harness-routed smoke proof.
144 -- Lock UI uses native session lock plus PAM state.
145 - The password field owns focus, steals focus back, feeds key events to PAM, shows unlocking, failure, fingerprint, battery, time, and safe media state, and tears down cleanly after unlock.
146 -- OSD is a masked overlay with a short service-triggered lifetime.
147 - Audio, microphone, brightness, media, workspace, screenshot, color, and error events select one indicator, restart the expiry timer, and never reserve layout space or block normal input.
148 -- Screenshot UI is a per-screen overlay with normalized cross-screen selection geometry.
149 - Selection state records press, drag, release, normalized rect, completion, copy/save target, and cleanup.
150 - Capture itself uses niri-native screenshot actions.
151 -- Privilege prompt is an isolated full-screen security surface.
152 - It presents the requesting app/action, focused secret input, deny/cancel/confirm controls, Escape cancel, clear error text, no decorative distraction, and native Polkit flow routing.
153 -- Area and screenshot tools reuse the same selection model for rectangular target selection, cursor state, completion flash, cancellation, and smoke-visible geometry.
154 - Live shell code does not use third-party screenshot helpers.
155 -- Clickable primitives expose one Nugu state layer: hover, press, held, disabled, focus-visible, checked, and attention are semantic roles over the same hit geometry.
156 -- Error feedback uses a bounded shake primitive adapted from Nuguland `ErrorShakeAnimation.qml`: short horizontal offsets, no layout displacement after completion, and no long decorative wobble.
157 -- Scrollable lists use top and bottom edge fades to show hidden content without extra chrome; fades disappear when content fits.
158 -- Reveal indicators animate width, height, and margins together; unread badges, mute chips, scroll hints, and status pills never jump layout.
159 - `revealIndicatorPrimitive` is inlined in `Bar.qml` from the Nuguland Revealer.qml mechanic and is used by attention badges before they count as production UI.
160 -- Area selection is one finite state machine: idle, armed, dragging, confirming, completed, cancelled.
161 -- Gesture contracts name press, drag, release, cancel, and commit for every draggable surface; tests prove each named transition.
162 -- `popoutGestureMachine` adapts Nuguland Interactions.qml: popout pointer handling is a service-owned finite state machine with press, drag, release, cancel, and commit paths, independent of compositor-specific hooks.
163 -- Every visual primitive reports pointer parity and keyboard parity in diagnostics before it counts as production-ready.
164 -- Screen-edge drawers define pointer regions separately from visual panels.
165 - Hit regions subtract visible panels from the interactive mask so hover, outside click, and drag handoff never fight layer geometry.
166 -- Quick controls are fixed personal controls: audio, network, Bluetooth, microphone, DND, idle inhibit, screenshot, color, power profile, and session actions.
167 - They render as service-backed toggles with one checked state, one disabled state, and one semantic status line.
168 -- Idle/privacy popout renders one service-fed keep-awake panel adapted from Nuguland IdleInhibit.qml and Nuguland Privacy.qml: active chip, duration chips, activity rows, privacy status, native IdleInhibitor route, and no helper processes.
169 -- Launcher result rows carry provider type, icon role, verb, subtitle, tags, and preview facts.
170 - The list can render app rows, action rows, calculator rows, clipboard rows, and window rows without each provider inventing its own row shape.
171 -- Window cards combine app id, title, workspace, rule hints, preview slot, and action row.
172 - All actions route through `Niri.qml`; the card never shells out and never clones the compositor overview.
173 - The window popout renders one niri window card adapted from Nuguland WindowInfo details/buttons and Nuguland task-view cards: preview slot, details rows, rule hints, action rail, and workspace move affordance.
174 -- MPRIS track changes carry direction metadata for previous and next animation.
175 - Cover, title, artist, album, progress, shuffle, repeat, and active-player changes are facts in `Media.qml`.
176 -- Tray menu expansion keeps one submenu open and collapses siblings.
177 - Separators, check rows, radio rows, disabled rows, nested children, and close propagation are rendered by one menu view.
178 -- Screenshot selection uses dimmed mask, clear cutout, corner handles, dimensions, and toolbar actions.
179 - Selection visuals are pure shell UI; capture is still niri-native.
180 -- Nuguland rope geometry is reduced to bounded selection-corner accents.
181 - Nuguland may use the elastic corner idea for area selection feedback, but never runs a free physics decoration loop.
182 -Physics-like motion must be bounded to direct user feedback, not ambient decoration.
183 -- Clock digits use vertical odometer motion from Nuguland ClockNumber.qml: digit columns roll on the y-axis, separators stay hard, IBM Plex Mono is fixed, and glow/background settings are removed.
185 -## Shell architecture
187 -### Root
189 -`shell.qml` is a small lifecycle manifest:
191 -- Creates the theme, time, niri, service, surface, IPC, and diagnostics objects once.
192 -- Instantiates one bar per screen.
193 -- Instantiates always-on services.
194 -- Defers visual surfaces until opened.
195 -- Passes dependencies through required properties.
196 -- Avoids global singletons except Quickshell-provided services.
198 -### Opacity
200 -- Compositor opacity is owned by niri rules, not by Nugu palette colors.
201 -- Nuguland keeps semantic colors opaque unless a component needs local alpha for state layers, scrims, or effects.
202 -- niri gives Nuguland layer surfaces about 0.90 opacity so the aurora backdrop shows through without Nugu tokens lying.
203 -- WezTerm windows are subtly translucent in niri so the aurora can show through normal terminal work.
204 -- Fullscreen WezTerm must be opaque, but niri 26.04 has no `is-fullscreen` window-rule matcher; this exception remains unresolved unless implemented by a future niri matcher, manual opacity toggle, or app-side fullscreen signal.
206 -### State
208 -- Transient visibility state lives in one surface manager.
209 -- Most state is memory-only or external truth.
210 -- Crash survival policy is minimal: Nuguland restarts clean and re-reads niri, PipeWire, MPRIS, Bluetooth, network, UPower, tray, and notification facts from their owners.
211 -- Nuguland does not restore open panels, typed launcher queries, selected rows, OSD timers, lock input, pending destructive actions, or session actions after a crash.
212 -- Durable private state is explicit and currently limited to clipboard data.
213 -- Clipboard history is durable.
214 -- Clipboard pins are durable if pins remain a feature.
215 -- Private clipboard mode is rejected.
217 -### Services
219 -Services expose facts and actions.
220 -Widgets render facts and forward user intent to services.
221 -Widgets do not contain backend logic.
223 -Required services:
225 -- `Niri.qml`: event stream, JSON queries, actions, screenshots, color picking, overview state, layers, outputs, workspaces, windows, keyboard layouts, DPMS.
226 -- `Time.qml`: shared clock, calendar helpers, relative time.
227 -- `Audio.qml`: PipeWire sinks, sources, streams, volume, mute, default device selection.
228 -- `Media.qml`: MPRIS player election, playback, metadata, progress, cover art.
229 -- `Power.qml`: UPower battery, charging, health, time estimate, power profile if available.
230 -- `Bluetooth.qml`: BlueZ adapter and devices through Quickshell Bluetooth.
231 -- `Network.qml`: Quickshell Networking first.
232 - Any host-specific network command is isolated behind this service and test-proven.
233 -- `Notifications.qml`: Quickshell notification daemon, history, grouping, actions, DND.
234 -- `Tray.qml`: SystemTray and DBusMenu fidelity.
235 -- `Clipboard.qml`: clipboard history and actions behind one backend.
236 -- `Resources.qml`: CPU, memory, swap, disk, and network facts without shell pipelines.
237 -- `Privilege.qml`: Polkit agent state.
238 -- `Lock.qml`: WlSessionLock plus PAM.
239 -- `Idle.qml`: Wayland idle inhibitor.
240 -- `Screenshots.qml`: niri screenshot actions and recent capture records.
241 -- `Diagnostics.qml`: test-visible state, process ownership, service health, assertion data.
243 -## Authority and launch ownership
245 -Nuguland owns semantic workflow dispatch. niri owns key capture and compositor primitives. systemd owns slice definitions.
246 -UWSM owns scoped process creation.
248 -Source of truth boundaries:
250 -- `niri/cfg/keybinds.kdl` owns physical key combinations only.
251 -- Nuguland owns action IDs, launcher providers, app launch definitions, script/API/shim routes, OSD side effects, and app-to-slice mapping.
252 -- systemd unit files own slice names, dependencies, resource controls, restart policy, and service lifecycle.
253 -- UWSM is the only production app/session scope launcher.
254 -- niri native actions may remain direct only for pure compositor primitives and emergency control: focus, move, resize, fullscreen, overview, screenshot built-ins, keyboard-inhibit escape, quit.
255 -- XDG autostart is owned by the niri/UWSM systemd session through `xdg-desktop-autostart.target`; Nuguland does not reimplement `.desktop` autostart scanning.
256 -- Any named workflow, application launch, hardware key, media/audio/brightness action, shell surface, script, or personal automation enters Nuguland first.
258 -Nuguland exposes one stable command shim: `nuguctl`.
260 -`nuguctl` is not a second brain.
261 -It is a thin CLI adapter from stable names to `qs ipc -c nuguland call ...`. niri keybinds prefer `nuguctl hotkey <id>` over command soup.
262 -The shim does not choose slices, parse desktop files, hold state, render UI, or duplicate service logic.
263 -It forwards to Nuguland and exits with the IPC result.
265 -Launch policy:
267 -- Nuguland stores launch records as structured data: id, label, kind, command argv, working directory, environment deltas, slice, startup notification policy, window matching hints, and OSD feedback.
268 -- GUI apps use `app-graphical.slice` unless explicitly classified otherwise.
269 -- Terminals, editors, mail, and development tools use `work.slice`.
270 -- Shell/session control, OSD, media, audio, brightness, screenshot, lock, power, and Nuguland IPC helpers use `session-graphical.slice`.
271 -- Background helpers use `background-graphical.slice`.
272 -- Widgets never construct launch commands.
273 - Widgets request service actions.
274 -- niri keybinds never duplicate app argv or slice choices.
276 -Quake terminal:
278 -- The quake terminal is a named Nuguland workflow, not a raw niri terminal spawn.
279 -- niri captures the physical grave/backtick key and calls `nuguctl hotkey quake-terminal`.
280 -- Nuguland toggles one persistent WezTerm quake instance.
281 -- The instance uses the WezTerm mux domain so shell state survives hide/show.
282 -- The visible surface drops down from the top and hides upward with short spatial motion.
283 -- The quake terminal uses `work.slice` for the terminal process and `session-graphical.slice` only for the IPC/hotkey shim.
284 -- The workflow record owns app id/class/title hints so niri rules can identify, float, size, place, and style it.
285 -- The terminal must not create unbounded new WezTerm processes on repeated hotkey presses.
287 -## niri integration
289 -`Niri.qml` is the only compositor integration.
291 -It provides:
293 -- Complete initial state from `niri msg --json event-stream`.
294 -- Incremental state updates from the event stream.
295 -- JSON queries for outputs, workspaces, windows, layers, focused output, focused window, keyboard layouts, overview state, and casts when needed.
296 -- Actions for workspace focus/move, window focus/move/close, column/window sizing, fullscreen, windowed fullscreen, overview open/close, DPMS, keyboard shortcut inhibit, and screen transition.
297 -- Native screenshot actions for interactive, focused screen, and focused window capture.
298 -- Native color picking through `niri msg pick-color`.
300 -The workspace model follows niri directly:
302 -- Workspaces are dynamic, per output, vertically ordered, and include an empty target at the end.
303 -- The bar shows the live stack for each output.
304 -- Wheel input moves up/down through the stack.
305 -- Occupancy comes from live window records.
306 -- Names are displayed when present.
307 -- Empty interior workspaces disappear naturally through niri behavior.
309 -Layer policy:
311 -- Persistent bars use the top layer.
312 -- Launchers, modal session surfaces, privilege prompts, notification toasts, screenshot UI, and popouts that must appear above fullscreen use overlay.
313 -- Background and bottom layers are reserved for inert backdrop surfaces.
314 -- Stable namespaces are mandatory for every layer surface.
315 -- niri layer rules own capture blocking, native shadows, corner radius, and layer popup effects.
317 -Nuguland uses niri's built-in overview for window/workspace overview.
318 -Nuguland surfaces may open above it, report its state, or trigger it, but do not clone it.
321 -## Popout behavior
323 -- Nuguland has one popup shell for all bar widgets.
324 -- Switching from one open popup to another replaces content instantly; the shell itself does not close, morph, resize width, or run outgoing-content animation.
325 -- All bar popups use one golden-ratio width: screen width divided by 1.618, clamped for small and large screens.
326 -- Popup height is content-specific, budgeted per panel, and capped by available screen height below the bar.
327 -- Popup content must not clip under normal x230 height; if content exceeds budget, the panel owns internal scrolling.
328 -- Opening from closed state uses a simple center slide down from the bar plus a fast fade in.
329 -- Closing fades/slides out quickly.
330 -- The popup must feel like one stable surface whose content changes.
331 -- Popups grab focus while open.
332 -- Escape closes the open popup.
333 -- Clicking outside the popup closes it through Quickshell popup focus-grab dismissal.
334 -- Focus-grab must be configured as a stable property before the popup is shown, not toggled with `visible`.
335 -- Qt `Loader` destroys the previous item when `sourceComponent` changes; it is not an item cache.
336 -- If first-open lag remains visible, use persistent per-panel loaders or a stack of instantiated panels and hide inactive panels instead of swapping one Loader source.
338 -## Bar
340 -The bar is compact, high-contrast, and screen-aware.
341 -It contains:
343 -- workspace stack
344 -- focused window card
345 -- media summary
346 -- clock
347 -- tray
348 -- notification bell
349 -- audio
350 -- connectivity
351 -- battery/power
352 -- idle/privacy indicators
353 -- diagnostics affordance
355 -Each bar item has:
357 -- full-width hit geometry larger than the visible glyph/text
358 -- exported anchor rect
359 -- hover, pressed, active, urgent, muted, and loading states
360 -- left, right, middle, wheel, and keyboard semantics when useful
361 -- tooltip text from owned metadata
362 -- pointer-testable state
364 -## Bar popouts
366 -There is one bar popout host per bar.
368 -The host owns:
370 -- current popout name
371 -- registry of popout content
372 -- anchor rect for each item
373 -- focus and Escape behavior
374 -- outside click behavior
375 -- loader lifetime
376 -- animated width and height
377 -- animation progress diagnostics
378 -- separator interruption where the popout visually grows through the bar edge
380 -Popouts never position themselves.
381 -Widgets only register anchor geometry and request a named popout.
383 -Required popouts:
385 -- media controls and player selection
386 -- calendar and agenda
387 -- clipboard history
388 -- audio mixer
389 -- connectivity
390 -- battery and power details
391 -- tray menu
392 -- notifications
393 -- help/diagnostics
395 -Every popout must prove:
397 -- opens from the correct visible bar item
398 -- grows from the anchor
399 -- stays attached while the bar changes size
400 -- closes by Escape and outside click
401 -- remains open on inside click
402 -- has no detached-card appearance
403 -- changes screenshot pixels inside its reported target rect
404 -- cleans its loader after close
406 -## Notifications
408 -Nuguland owns the notification daemon.
410 -Required behavior:
412 -- grouped history by app
413 -- compact preview count
414 -- urgency styling
415 -- DND
416 -- action invocation
417 -- body copy
418 -- explicit close
419 -- middle-click close
420 -- right-click or keyboard expand/collapse
421 -- vertical drag to expand compact groups
422 -- horizontal drag to dismiss
423 -- removal animation with lifecycle lock
424 -- toast morph from the notification bell anchor
425 -- capture blocking through niri layer rules
427 -Notification smoke uses isolated notification fixtures and proves every gesture, action, dismissal path, and cleanup path.
429 -## Launcher
431 -The launcher is one fast search surface.
433 -Providers:
435 -- desktop entries
436 -- open windows
437 -- owned shell actions
438 -- clipboard rows
439 -- calculator
440 -- session actions
441 -- diagnostics
443 -Rules:
445 -- one scored list
446 -- exact/name-first ranking
447 -- keyboard-first navigation
448 -- pointer parity
449 -- preview side panel where useful
450 -- no network results
451 -- no plugin command strings
452 -- no generated command soup
453 -- app launches come from Nuguland launch records
454 -- app-to-slice mapping lives in Nuguland, not niri keybinds
455 -- window actions go through `Niri.qml`
457 -## OSD
459 -OSD displays short-lived feedback for:
461 -- volume
462 -- microphone
463 -- brightness if supported
464 -- media transport
465 -- workspace movement
466 -- screenshot result
467 -- color pick result
468 -- errors from owned services
470 -OSD never blocks input and expires automatically.
472 -## Session and power
474 -Session UI is modal, focused, and keyboard navigable.
476 -Required actions:
478 -- lock
479 -- logout
480 -- suspend
481 -- reboot
482 -- power off
483 -- monitor power off/on
485 -Destructive actions require confirmation.
486 -Tests route through `testHarness` with `nativeActionRoute` disabled.
487 -Escape cancels.
488 -Enter confirms the focused safe or confirmed action.
489 -Pointer and keyboard paths are both tested.
491 -The power popout renders one UPower/session panel adapted from Nuguland session keys, Nuguland session grid confirmation, and Nuguland battery/profile rows: battery hero, external device batteries, power profile selector, keyboard-action grid, and confirmation strip.
493 -## Lock
495 -The lockscreen uses Quickshell WlSessionLock and PAM.
497 -It provides:
499 -- focused password input
500 -- clear failure state
501 -- retry without reload
502 -- keyboard layout display
503 -- battery and time
504 -- media transport if safe
505 -- notification summary without leaking sensitive bodies
506 -- clean unlock teardown
508 -Lock tests never expose secrets and never depend on live private data.
510 -## Privilege prompt
512 -The privilege prompt is isolated and security-first:
514 -- explicit app/action text
515 -- focused password input
516 -- clear deny/cancel/confirm buttons
517 -- no decorative distraction
518 -- Escape cancels
519 -- isolated visual smoke
521 -## Screenshot and color tools
523 -Screenshots use niri native actions:
525 -- interactive screenshot UI
526 -- focused screen
527 -- focused window
528 -- explicit save path inside the smoke run dir during tests
529 -- pointer visibility under caller control
530 -- recent capture list
531 -- copy/save/open actions from recorded files
533 -The screenshot popout renders one niri-native capture panel adapted from Nuguland AreaPicker and Nuguland region selector: focused screen/window actions, region selection entry, color pick action, recent capture rows, toolbar action rail, and selection-preview geometry using dim mask, cutout, dimensions, handles, and bounded Nuguland corner accents.
535 -Color picking uses niri native color picking.
536 -The result appears in OSD, clipboard action, and diagnostics.
538 -## Clipboard
540 -Clipboard UI provides:
542 -- searchable history
543 -- pinning if retained
544 -- copy/paste action
545 -- delete action if backend supports it
546 -- private-mode visual state
547 -- launcher provider rows
549 -The clipboard popout renders a single history panel adapted from Nuguland popout wrapping and Nuguland clipboard/list chrome: private-mode chip, search field, pinned-first rows, masked action rail, scroll-edge fades, copy/paste/pin/delete actions, and launcher row parity.
551 -The backend is isolated behind `Clipboard.qml` and must clean helper processes.
553 -## Tray
555 -Tray support includes full DBusMenu fidelity:
557 -- icons
558 -- labels
559 -- disabled rows
560 -- separators
561 -- submenus
562 -- check/radio state
563 -- default action
564 -- secondary action
565 -- wheel where the item supports it
566 -- keyboard navigation
568 -Tray menus use the bar popout host and anchor to the tray item.
569 -The tray popout renders one native menu panel adapted from Nuguland TrayItem, Nuguland SysTray/MenuView, and Nuguland overflow grid: item grid, attention status, action/separator/submenu/check/radio/disabled rows, one-expanded-submenu collapse, and close propagation.
571 -## Connectivity
573 -Connectivity combines network and Bluetooth into one popout while keeping compact bar indicators.
575 -Required facts:
577 -- network connection name/type/state
578 -- WiFi signal and security when available
579 -- Bluetooth adapter state
580 -- connected devices and battery where available
581 -- loading and error states
583 -Actions are service-owned, bounded, and tested with isolated harness state.
585 -## Media
587 -Media uses MPRIS through Quickshell.
589 -Required behavior:
591 -- active player election
592 -- play/pause/next/previous
593 -- progress seek
594 -- volume handoff to audio service
595 -- shuffle/repeat if supported
596 -- cover art state with deterministic no-art rendering
597 -- compact bar summary
598 -- rich popout
599 -- OSD feedback
601 -No audio visualizer dependency.
602 -Any line/curve motif is driven by MPRIS progress or playback state.
604 -## Resources and battery
606 -Resources use native file/service reads without shell pipelines.
608 -Battery UI shows:
610 -- percent
611 -- charging/discharging
612 -- time estimate
613 -- health if available
614 -- external devices if available
615 -- power profile if available
617 -System UI shows:
619 -- CPU
620 -- memory
621 -- swap
622 -- disk
623 -- network rate
624 -- process summary only if implemented without heavy process churn
626 -## Diagnostics
628 -Diagnostics is developer-only introspection.
630 -It is not a bar widget.
632 -It is reachable through IPC or explicit developer workflows only.
634 -It shows:
636 -- service health
637 -- niri socket state
638 -- event stream status
639 -- process ownership table
640 -- current surfaces
641 -- current popout anchor/progress
642 -- notification counts
643 -- screenshot/color picker backend status
644 -- smoke assertions
645 -- cleanup report
646 -- service status grid
647 -- reference contract rail
648 -- surface anchor map
649 -- failure shake slot
651 -It does not mutate visual preferences.
653 -## IPC
655 -IPC is for tests and owned workflow commands only.
657 -Required calls:
659 -- dispatch `hotkey <id>` through Nuguland action records
660 -- launch an owned app/action by id
661 -- open/close/toggle each major surface
662 -- query service state snapshots
663 -- inject isolated harness data for tests
664 -- trigger screenshot/color pick harness routes
665 -- trigger OSD messages
666 -- query popout geometry and animation progress
667 -- query cleanup/process ownership
669 -IPC must stay small enough to audit manually.
671 -## Test harness
673 -Production proof uses nested niri only.
675 -The harness:
677 -- creates a unique run dir
678 -- creates private HOME, XDG paths, cache, state, and screenshot path
679 -- writes a minimal generated niri KDL
680 -- validates KDL with `niri validate -c`
681 -- starts nested niri with a supervised Quickshell command
682 -- owns a private process group
683 -- records every child process
684 -- captures stdout/stderr per process
685 -- drives pointer, keyboard, wheel, drag, screenshot, and IPC checks
686 -- captures animation frames, not only final states
687 -- deletes the run dir on success
688 -- keeps evidence on failure
690 -Smoke must prove:
692 -- bar appears on every screen
693 -- every bar popout anchors and morphs correctly
694 -- notification toast anchors and morphs correctly
695 -- launcher opens, searches, focuses, routes harness actions, and closes
696 -- OSD appears and expires
697 -- screenshot actions write into the run dir
698 -- color picker harness route returns a deterministic value
699 -- clipboard UI works with private data
700 -- tray menu renders isolated DBusMenu fixtures
701 -- session destructive actions stay harness-routed and two-step
702 -- lock and privilege prompt instantiate and dismiss in safe mode
703 -- no QML errors
704 -- no unowned processes
705 -- no lingering DBus helpers
706 -- no leftover screenshot, clipboard, shell, or temp helpers
707 -- no leftover run dirs on success
709 -## Essential tree
711 -Top-level essentials:
713 -- `shell.qml`
714 -- `SPEC.md`
715 -- `Theme.qml`
716 -- service files
717 -- primitive files
718 -- surface files
719 -- test harness scripts
720 -- PAM files for lock
721 -- generated-data readers needed by Nugu
723 -Deleted categories:
725 -- stale Markdown inventories
726 -- duplicate docs
727 -- old source inventories
728 -- unused widgets
729 -- split backend abstractions
730 -- settings pages
731 -- alternate visual families
732 -- generated screenshots/logs/temp files
733 -- scratch prototypes
734 -- undocumented helpers
736 -## Acceptance
738 -Nuguland is ready when:
740 -- the source tree contains only essential files
741 -- `SPEC.md` is the single design authority
742 -- all widgets are rebuilt against services
743 -- no widget spawns a process
744 -- every process is owned and cleanup-proven
745 -- nested niri smoke passes from a clean run dir
746 -- visual evidence proves every popout and toast morphs from its anchor
747 -- pointer and keyboard evidence covers every surface
748 -- screenshot and color picking use niri native features
749 -- Nugu colors and IBM Plex fonts are consistent everywhere
750 -- destructive actions are two-step and harness-routed in tests
751 -- no stale docs or unused QML remain

quickshell/nuguland/gate.sh

Deleted
deleted file mode 100755
1 -#!/bin/sh
2 -set -eu
4 -config_dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)
5 -repo_dir=$(CDPATH='' cd -- "$config_dir/../.." && pwd -P)
7 -tmp_smoke=${TMPDIR:-/tmp}/nuguland-gate-smoke.out
8 -tmp_nested=${TMPDIR:-/tmp}/nuguland-gate-nested.out
10 -assert_no_nuguland_processes() {
11 - processes=$(ps -eo pid=,comm=,args= | awk '$2 != "awk" && $2 != "ps" && (($2 == "qs" && $0 ~ / -c nuguland( |$)/) || ($2 == "dbus-run-session" && $0 ~ /nuguland/) || ($2 == "dbus-daemon" && $0 ~ /nuguland/) || ($2 == "niri" && $0 ~ /--config .*nuguland/)) { print }')
12 - if [ -n "$processes" ]; then
13 - printf 'nuguland process leak:\n%s\n' "$processes" >&2
14 - exit 1
15 - fi
18 -assert_no_nuguland_temp() {
19 - leftovers=$(find "${TMPDIR:-/tmp}" -maxdepth 1 \( \
20 - -name 'nugu*' -o \
21 - -name 'nuguland*' -o \
22 - -name 'judge-nugu*' \
23 - \) -print)
24 - if [ -n "$leftovers" ]; then
25 - printf 'nuguland temp leak:\n%s\n' "$leftovers" >&2
26 - exit 1
27 - fi
30 -purge_nuguland_temp() {
31 - find "${TMPDIR:-/tmp}" -maxdepth 1 \( \
32 - -name 'nugu*' -o \
33 - -name 'nuguland*' -o \
34 - -name 'judge-nugu*' \
35 - \) -exec rm -rf -- {} +
38 -cleanup() {
39 - rm -f -- "$tmp_smoke" "$tmp_nested"
41 -trap cleanup EXIT INT TERM
43 -purge_nuguland_temp
44 -assert_no_nuguland_processes
45 -assert_no_nuguland_temp
47 -sh -n "$config_dir"/*.sh
48 -if command -v shellcheck >/dev/null 2>&1; then
49 - shellcheck "$config_dir"/*.sh
50 -else
51 - printf '%s\n' 'shellcheck missing; skipped'
52 -fi
54 -"$config_dir/smoke.sh" >"$tmp_smoke"
55 -# production nested proof command: nested-niri.sh --smoke
56 -NUGU_QS_NESTED_TIMEOUT=${NUGU_QS_NESTED_TIMEOUT:-120} "$config_dir/nested-niri.sh" --smoke >"$tmp_nested"
57 -grep '^nested_proof=niri-live screenshots=2 widgets=15 morph=anchor-bottom-center settled=15 visual=target-rect-changed$' "$tmp_nested" >/dev/null
58 -grep '^inner_widget_popout_launcher=' "$tmp_nested" >/dev/null
59 -grep '^inner_widget_popout_settled_launcher=' "$tmp_nested" >/dev/null
60 -grep '^inner_widget_popout_dashboard=' "$tmp_nested" >/dev/null
61 -grep '^inner_widget_popout_settled_dashboard=' "$tmp_nested" >/dev/null
62 -grep '^inner_real_input_proof=' "$tmp_nested" >/dev/null
63 -grep '^inner_reference_comparison_notes=' "$tmp_nested" >/dev/null
64 -grep '^inner_reference_source_fingerprints=' "$tmp_nested" >/dev/null
65 -grep '^inner_reference_boundary_matrix=' "$tmp_nested" >/dev/null
66 -grep '^inner_reference_adoption_matrix=' "$tmp_nested" >/dev/null
67 -grep '^inner_reference_visual_comparison=' "$tmp_nested" >/dev/null
68 -grep '^inner_reference_review_packet=' "$tmp_nested" >/dev/null
69 -TMP_NESTED="$tmp_nested" python - <<'PY'
70 -import json
71 -import os
72 -from pathlib import Path
73 -lines = Path(os.environ["TMP_NESTED"]).read_text().splitlines()
74 -def payload(prefix):
75 - for line in lines:
76 - if line.startswith(prefix):
77 - return json.loads(line[len(prefix):])
78 - raise SystemExit(f"missing {prefix}")
79 -real_input = payload("inner_real_input_proof=")
80 -notes = payload("inner_reference_comparison_notes=")
81 -fingerprints = payload("inner_reference_source_fingerprints=")
82 -boundary = payload("inner_reference_boundary_matrix=")
83 -adoption = payload("inner_reference_adoption_matrix=")
84 -visual = payload("inner_reference_visual_comparison=")
85 -review = payload("inner_reference_review_packet=")
86 -assert real_input["realInputProof"] is True
87 -assert real_input["nestedNiri"] is True
88 -assert real_input["inputTool"] == "wdotool"
89 -assert real_input["backend"] == "wlr-protocols"
90 -assert real_input["event"] == "pointer-click"
91 -assert real_input["events"] == ["pointer-click", "wheel-scroll", "bar-toggle-close", "notification-drag"]
92 -assert real_input["widget"] == "launcher"
93 -assert real_input["ipcObservationOnly"] is True
94 -assert real_input["ipcDidNotOpenSurface"] is True
95 -assert real_input["opened"] is True
96 -assert real_input["openedName"] == "launcher"
97 -assert real_input["wheelSelection"]["after"]["kind"] == "wheel-select"
98 -assert real_input["wheelSelection"]["after"]["before"] != real_input["wheelSelection"]["after"]["after"]
99 -assert real_input["closedByRealBarToggle"] is True
100 -assert real_input["closeReason"] == "bar-toggle"
101 -assert real_input["notificationDragCommitted"] is True
102 -assert real_input["notificationDragProof"]["lastAction"]["kind"] == "dragDismiss"
103 -assert real_input["notificationDragProof"]["lastAction"]["committed"] is True
104 -assert real_input["notificationDragProof"]["activeCountBefore"] > real_input["notificationDragProof"]["activeCountAfter"]
105 -assert notes["sourceFamilies"] == ["nuguland", "Nuguland", "Nuguland", "nuguland"]
106 -assert notes["adoptedMechanics"][0]["owner"] == "PopoutHost.qml"
107 -assert notes["adoptedMechanics"][0]["liveEvidence"] == "popout_region_visual target rect changes"
108 -assert notes["adoptedMechanics"][0]["screenshotEvidence"] == "nested niri before/after PNG diff"
109 -assert notes["adoptedMechanics"][0]["sourceSnippetEvidence"] == "Wrapper.qml Content.qml AnchorAnim.qml"
110 -assert notes["rejectedMechanics"][0]["mechanic"] == "widget-owned detached popups"
111 -assert notes["rejectedMechanics"][0]["replacement"] == "one bar-owned popout host"
112 -assert fingerprints["referenceSourceFingerprints"] is True
113 -for flag in ("barWorkflowReferenceCoverage", "surfaceWorkflowReferenceCoverage", "popoutDetailReferenceCoverage", "serviceInteractionReferenceCoverage", "securitySessionReferenceCoverage", "primitiveReferenceCoverage", "launcherOverviewReferenceCoverage", "componentScaffoldReferenceCoverage"):
114 - assert fingerprints[flag] is True
115 -assert fingerprints["sourceFamilies"] == ["nuguland", "Nuguland", "Nuguland", "nuguland"]
116 -assert len(fingerprints["rows"]) == 77
117 -assert {row["family"] for row in fingerprints["rows"]} == {"nuguland", "Nuguland", "Nuguland", "nuguland"}
118 -assert all(len(row["sha256"]) == 64 for row in fingerprints["rows"])
119 -assert all(row["lineCount"] > 10 for row in fingerprints["rows"])
120 -assert all(row["markerCount"] >= 3 for row in fingerprints["rows"])
121 -assert all(row["path"].startswith("Nuguland design archive/") for row in fingerprints["rows"])
122 -assert all(Path(row["path"]).exists() for row in fingerprints["rows"])
123 -assert all(row["mechanic"] for row in fingerprints["rows"])
124 -source_ids = [row["id"] for row in fingerprints["rows"]]
125 -source_sha_by_id = {row["id"]: row["sha256"] for row in fingerprints["rows"]}
126 -assert boundary["referenceBoundaryMatrix"] is True
127 -assert boundary["decisionCoverageComplete"] is True
128 -assert [row["sourceId"] for row in boundary["rows"]] == ["nuguland-cover-visualiser", "nuguland-rope-free-physics", "nuguland-toast-lifecycle", "nuguland-error-shake-animation", "nuguland-button-base"]
129 -assert adoption["referenceAdoptionMatrix"] is True
130 -assert adoption["sourceCoverageComplete"] is True
131 -assert adoption["allSourceIdsMapped"] is True
132 -assert len(adoption["rows"]) == 77
133 -assert [row["sourceId"] for row in adoption["rows"]] == source_ids
134 -assert all(row["nugulandOwner"] for row in adoption["rows"])
135 -assert all(row["runtimeContract"] for row in adoption["rows"])
136 -assert all(row["proofMarker"] for row in adoption["rows"])
137 -assert all(row["sourceSha256"] == source_sha_by_id[row["sourceId"]] for row in adoption["rows"])
138 -assert visual["referenceVisualComparison"] is True
139 -assert visual["visualConceptCoverageComplete"] is True
140 -assert visual["allAdoptedSourcesHaveVisualNotes"] is True
141 -assert visual["sourceIds"] == source_ids
142 -assert len(visual["stolenConcepts"]) == len(visual["sourceIds"])
143 -assert review["referenceReviewPacket"] is True
144 -assert review["requiresHumanConfirmation"] is True
145 -assert review["sourceRows"] == 77
146 -assert review["visualRows"] == 77
147 -assert review["allSourcesMapped"] is True
148 -assert review["allVisualNotesPresent"] is True
149 -assert set(review["families"]) == {"nuguland", "Nuguland", "Nuguland", "nuguland"}
150 -assert review["firstAdoptedMechanic"]["owner"] == "PopoutHost.qml"
151 -assert review["firstRejectedMechanic"]["replacement"] == "one bar-owned popout host"
152 -PY
154 -# production whitespace gate: git diff --check
155 -git -C "$repo_dir" diff --check -- quickshell/nuguland
156 -cleanup
157 -assert_no_nuguland_temp
158 -assert_no_nuguland_processes
159 -printf '%s\n' 'FULL GATE PASS nuguland-production-gate'

quickshell/nuguland/nested-niri.sh

Deleted
deleted file mode 100755
1 -#!/bin/sh
2 -set -eu
4 -config_dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)
5 -repo_dir=$(CDPATH='' cd -- "$config_dir/../.." && pwd -P)
6 -niri_dir="$repo_dir/niri"
7 -mode=run
8 -timeout_seconds=${NUGU_QS_NESTED_TIMEOUT:-180}
9 -[ "$timeout_seconds" -lt 240 ] && timeout_seconds=240
11 -render_config() {
12 - screens_dir=$1
13 - printf '%s\n' '// nuguland nested niri config derived from dotfiles/niri'
14 - printf '// source: %s\n\n' "$niri_dir"
15 - cat "$niri_dir/cfg/input.kdl"
16 - printf '\n'
17 - cat "$niri_dir/cfg/layout.kdl"
18 - printf '\n'
19 - cat "$niri_dir/cfg/workspaces.kdl"
20 - printf '\n'
21 - cat "$niri_dir/cfg/rules.kdl"
22 - cat <<EOF
24 -screenshot-path "$screens_dir/Screenshot from %Y-%m-%d %H-%M-%S.png"
26 -hotkey-overlay {
27 - skip-at-startup
30 -xwayland-satellite {
31 - off
34 -layer-rule {
35 - match namespace="^nuguland-"
36 - block-out-from "screencast"
39 -config-notification {
40 - disable-failed
42 -EOF
45 -for arg in "$@"; do
46 - case "$arg" in
47 - --smoke) mode=smoke ;;
48 - --print-config)
49 - render_config "${TMPDIR:-/tmp}/nuguland-niri-screens"
50 - exit 0
51 - ;;
52 - -h | --help)
53 - printf '%s\n' 'usage: nested-niri.sh [--smoke] [--print-config]'
54 - exit 0
55 - ;;
56 - *)
57 - printf 'FAIL nested-niri: unknown argument: %s\n' "$arg" >&2
58 - exit 2
59 - ;;
60 - esac
61 -done
63 -tmp=$(mktemp -d "${TMPDIR:-/tmp}/nuguland-niri.XXXXXX")
64 -parent_runtime=${XDG_RUNTIME_DIR:-}
65 -parent_display=${WAYLAND_DISPLAY:-}
66 -niri_pid=
67 -status=0
69 -fail() {
70 - printf 'FAIL nested-niri: %s\n' "$1" >&2
71 - status=1
72 - printf 'artifacts=%s\n' "$tmp" >&2
73 - exit 1
76 -kill_tree() {
77 - pid=$1
78 - sig=${2:-TERM}
79 - [ -n "$pid" ] || return 0
80 - children=$(pgrep -P "$pid" 2>/dev/null || true)
81 - for child in $children; do kill_tree "$child" "$sig"; done
82 - kill "-$sig" "$pid" 2>/dev/null || true
85 -assert_no_run_dir_leaks() {
86 - leaks=$(ps -eo pid=,comm=,args= | awk -v dir="$tmp" '
87 - $2 != "awk" && $2 != "ps" && index($0, dir) && ($2 == "qs" || $2 == "niri" || $2 == "dbus-run-session" || $2 == "dbus-daemon" || index($0, "/quickshell/")) { print }
88 - ')
89 - if [ -n "$leaks" ]; then
90 - printf 'process leaks tied to run dir:\n%s\n' "$leaks" >&2
91 - status=1
92 - fi
95 -cleanup() {
96 - rc=$?
97 - [ "$rc" = 0 ] || status=$rc
98 - if [ -n "$niri_pid" ]; then
99 - kill_tree "$niri_pid" TERM
100 - sleep 0.3
101 - kill_tree "$niri_pid" KILL
102 - wait "$niri_pid" 2>/dev/null || true
103 - fi
104 - pkill -TERM -f "$tmp" 2>/dev/null || true
105 - sleep 0.2
106 - pkill -KILL -f "$tmp" 2>/dev/null || true
107 - assert_no_run_dir_leaks
108 - if [ "${NUGU_KEEP_ARTIFACTS:-}" = 1 ] || [ "$status" != 0 ]; then
109 - printf 'artifacts=%s\n' "$tmp" >&2
110 - else
111 - rm -rf -- "$tmp"
112 - fi
113 - exit "$status"
115 -trap cleanup EXIT INT TERM
117 -command -v niri >/dev/null 2>&1 || fail 'missing niri'
118 -command -v qs >/dev/null 2>&1 || fail 'missing qs'
119 -[ -n "$parent_runtime" ] || fail 'XDG_RUNTIME_DIR is empty'
120 -[ -n "$parent_display" ] || fail 'WAYLAND_DISPLAY is empty; nested niri needs parent Wayland'
121 -[ -d "$niri_dir/cfg" ] || fail 'missing dotfiles/niri config'
123 -mkdir -p "$tmp/home/.cache/nugu" "$tmp/xdg/quickshell" "$tmp/screens"
124 -printf 'dark\n' >"$tmp/home/.cache/nugu/mode"
125 -ln -s "$config_dir" "$tmp/xdg/quickshell/nuguland"
126 -render_config "$tmp/screens" >"$tmp/niri.kdl"
128 -niri validate -c "$tmp/niri.kdl" >"$tmp/niri-validate.out" 2>"$tmp/niri-validate.err" || fail 'generated niri config is invalid'
130 -if [ "$mode" = smoke ]; then
131 - cat >"$tmp/run.sh" <<EOF
132 -#!/bin/sh
133 -set -u
134 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" XDG_RUNTIME_DIR="$parent_runtime" WAYLAND_DISPLAY="\${WAYLAND_DISPLAY}" NIRI_SOCKET="\${NIRI_SOCKET}" NUGULAND_REAL_INPUT=1 "$config_dir/smoke.sh" >"$tmp/smoke.out" 2>"$tmp/smoke.err"
135 -code=\$?
136 -printf '%s\n' "\$code" >"$tmp/smoke.status"
137 -exit "\$code"
138 -EOF
139 -else
140 - cat >"$tmp/run.sh" <<EOF
141 -#!/bin/sh
142 -set -eu
143 -exec env HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" XDG_RUNTIME_DIR="$parent_runtime" WAYLAND_DISPLAY="\${WAYLAND_DISPLAY}" NIRI_SOCKET="\${NIRI_SOCKET}" qs -c nuguland >"$tmp/qs.out" 2>"$tmp/qs.err"
144 -EOF
145 -fi
146 -chmod +x "$tmp/run.sh"
148 -WAYLAND_DISPLAY="$parent_display" XDG_RUNTIME_DIR="$parent_runtime" HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" niri -c "$tmp/niri.kdl" -- "$tmp/run.sh" >"$tmp/niri.out" 2>"$tmp/niri.err" &
149 -niri_pid=$!
151 -if [ "$mode" = smoke ]; then
152 - i=0
153 - while [ "$i" -lt "$timeout_seconds" ]; do
154 - [ -f "$tmp/smoke.status" ] && break
155 - i=$((i + 1))
156 - sleep 1
157 - done
158 - [ -f "$tmp/smoke.status" ] || fail 'inner smoke timed out'
159 - [ "$(cat "$tmp/smoke.status")" = 0 ] || {
160 - sed -n '1,160p' "$tmp/smoke.out" >&2 2>/dev/null || true
161 - sed -n '1,160p' "$tmp/smoke.err" >&2 2>/dev/null || true
162 - fail 'inner smoke failed'
163 - }
164 - python - "$tmp/smoke.out" <<'PY' || fail 'inner smoke lacked live nested-niri visual proof'
165 -import json
166 -import re
167 -import sys
168 -from pathlib import Path
170 -text = Path(sys.argv[1]).read_text(errors="replace")
171 -lines = text.splitlines()
173 -def payload(prefix):
174 - for line in lines:
175 - if line.startswith(prefix):
176 - return line[len(prefix):]
177 - raise AssertionError(prefix)
179 -state = json.loads(payload("niri_state="))
180 -assert state["available"] is True
181 -assert state["ready"] is True
182 -assert state["workspaceCount"] >= 2
183 -assert re.search(r"^screenshot_screen=.* bytes=[1-9][0-9]*$", text, re.M)
184 -assert re.search(r"^popout_screenshot=.* bytes=[1-9][0-9]*$", text, re.M)
185 -screenshot_visual = json.loads(payload("screenshot_visual="))
186 -popout_visual = json.loads(payload("popout_visual="))
187 -region_visual = json.loads(payload("popout_region_visual="))
188 -assert screenshot_visual["notBlank"] is True
189 -assert popout_visual["notBlank"] is True
190 -assert screenshot_visual["uniqueColors"] > 1
191 -assert popout_visual["uniqueColors"] > 1
192 -assert screenshot_visual["width"] == popout_visual["width"]
193 -assert screenshot_visual["height"] == popout_visual["height"]
194 -assert screenshot_visual["sha256"] != popout_visual["sha256"]
195 -assert region_visual["targetRectChanged"] is True
196 -assert region_visual["changedPixels"] >= 100
197 -assert region_visual["changedRatio"] >= 0.01
198 -assert "visual_hash_changed=true" in text
199 -privilege_state = json.loads(payload("privilege_state="))
200 -privilege_panel = privilege_state["request"]["privilegeSurfacePanelContract"]
201 -assert privilege_panel["source"] == "Quickshell Polkit manual agent.qml plus Nuguland Polkit.qml plus Nuguland PolkitService.qml"
202 -assert privilege_panel["ownedBy"] == "shell.qml inline PrivilegeSurface"
203 -assert privilege_panel["isolatedSecuritySurface"] is True
204 -assert privilege_panel["secretPromptField"] is True
205 -assert privilege_panel["serviceFedOnly"] is True
206 -lock_state = json.loads(payload("lock_state="))
207 -lock_panel = lock_state["request"]["lockSurfacePanelContract"]
208 -assert lock_panel["source"] == "Quickshell lockscreen LockSurface.qml LockContext.qml plus Nuguland lock Content.qml PasswordInput.qml NotifGroup.qml"
209 -assert lock_panel["ownedBy"] == "Lock.qml inline LockSurface"
210 -assert lock_panel["nativeSessionLockSurface"] is True
211 -assert lock_panel["secretInputField"] is True
212 -assert lock_panel["cleanTeardownState"] is True
213 -lock_visual = json.loads(payload("lock_failure_visual="))
214 -assert lock_visual["source"] == "Nuguland ErrorShakeAnimation.qml"
215 -assert lock_visual["ownedBy"] == "inline FailureShake components"
216 -assert lock_visual["failureShake"] is True
217 -assert lock_visual["shakeOffsets"] == [0, -12, 12, -6, 6, 0]
218 -assert lock_visual["boundedDistance"] == 12
219 -assert lock_visual["finalOffset"] == 0
220 -dashboard = json.loads(payload("dashboard_state="))
221 -assert dashboard["initial"]["dashboardTabsContract"]["source"] == "Nuguland dashboard Tabs.qml Content.qml"
222 -dashboard_panel = dashboard["initial"]["dashboardPanelContract"]
223 -assert dashboard_panel["source"] == "Nuguland dashboard Content.qml Tabs.qml performance HeroCard.qml plus Nuguland ContentPage.qml NavigationRailTabArray.qml plus Nuguland SlideView.qml"
224 -assert dashboard_panel["ownedBy"] == "PopoutHost.qml inline DashboardPanel"
225 -assert dashboard_panel["personalDashboardSurface"] is True
226 -assert dashboard_panel["lazyPaneDeck"] is True
227 -assert dashboard_panel["serviceFedOnly"] is True
228 -assert dashboard["initial"]["dashboardTabsContract"]["activeIndicatorTracksTab"] is True
229 -assert dashboard["initial"]["dashboardTabsContract"]["dragThresholdRatio"] == 0.1
230 -assert dashboard["initial"]["dashboardTabsContract"]["contentXBinding"] == "activePane.x"
231 -assert dashboard["dragNext"]["lastTransition"] == "drag-threshold-next"
232 -assert dashboard["dragSnap"]["lastTransition"] == "drag-snap-back"
233 -resource_card = json.loads(payload("resource_hero_card="))
234 -assert resource_card["source"] == "Nuguland performance HeroCard.qml plus Nuguland Graph.qml"
235 -assert resource_card["boundedHeroMeter"]["value"] == 0.72
236 -assert resource_card["sparklineSamples"] == [0.12, 0.24, 0.38, 0.72]
237 -assert resource_card["helperProcesses"] == []
238 -launcher = json.loads(payload("launcher_state="))
239 -for launcher_payload in launcher.values():
240 - panel = launcher_payload["launcherPanelContract"]
241 - assert panel["source"] == "Nuguland launcher Content.qml AppList.qml ActionItem.qml plus Nuguland SearchResults.qml ResultPreview plus Nuguland LaunchContent.qml"
242 - assert panel["ownedBy"] == "PopoutHost.qml inline LauncherPanel"
243 - assert panel["fullLauncherSurface"] is True
244 - assert panel["sidePreviewPanel"] is True
245 - assert panel["serviceFedOnly"] is True
246 - preview = launcher_payload["launcherPreviewPanel"]
247 - assert preview["source"] == "Nuguland SearchResults.qml ResultPreview plus Nuguland launcher Content.qml"
248 - assert preview["sidePanelWidth"] == 386
249 - assert preview["selectedResultDrivesPreview"] is True
250 - assert preview["keyboardReturnActivates"] == "primaryAction"
251 - assert preview["actionRows"][0]["id"] == "primary"
252 -time_state = json.loads(payload("time_state="))
253 -odometer = time_state["at"]["odometerClock"]
254 -assert odometer["source"] == "Nuguland Clock.qml ClockNumber.qml"
255 -assert odometer["ownedBy"] == "Bar.qml"
256 -assert odometer["motion"] == "vertical-digit-roll"
257 -assert odometer["hardSeparators"] == [":"]
258 -assert odometer["noGlow"] is True
259 -notifications = json.loads(payload("notifications_state="))
260 -assert notifications["initial"]["usesNativeNotificationServer"] is True
261 -panel = notifications["initial"]["notificationPanelContract"]
262 -assert panel["source"] == "Nuguland NotifGroup.qml NotifGroupList.qml NotifActionList.qml"
263 -assert panel["ownedBy"] == "PopoutHost.qml inline NotificationGroup"
264 -assert panel["groupedCardPanel"] is True
265 -assert panel["maskedHorizontalActionRail"] is True
266 -assert notifications["initial"]["dragDismissContract"]["source"] == "Nuguland NotifGroupList.qml"
267 -media = json.loads(payload("media_state="))
268 -media_panel = media["initial"]["mediaPanelContract"]
269 -assert media_panel["source"] == "Nuguland dashboard media Details.qml plus Nuguland MprisController.qml"
270 -assert media_panel["ownedBy"] == "PopoutHost.qml inline MediaPanel"
271 -assert media_panel["coverDetailsProgressTransport"] is True
272 -assert media_panel["playerSelectorRail"] is True
273 -assert media_panel["transportActions"] == ["shuffle", "previous", "playPause", "next", "repeat"]
274 -audio = json.loads(payload("audio_state="))
275 -audio_panel = audio["initial"]["audioPanelContract"]
276 -assert audio_panel["source"] == "Nuguland bar popouts Audio.qml plus Nuguland Mixer.qml MixerEntry.qml"
277 -assert audio_panel["ownedBy"] == "PopoutHost.qml inline AudioPanel"
278 -assert audio_panel["pipewireMixerPanel"] is True
279 -assert audio_panel["perStreamRows"] is True
280 -assert audio_panel["streamTargetReassignment"] is True
281 -network = json.loads(payload("network_state="))
282 -connectivity_panel = network["initial"]["connectivityPanelContract"]
283 -assert connectivity_panel["source"] == "Nuguland bar popouts Network.qml plus Nuguland connections Network.qml Bluetooth.qml"
284 -assert connectivity_panel["ownedBy"] == "PopoutHost.qml inline ConnectivityPanel"
285 -assert connectivity_panel["combinedConnectivityPanel"] is True
286 -assert connectivity_panel["wifiToggleScanList"] is True
287 -assert connectivity_panel["bluetoothToggleScanList"] is True
288 -clipboard = json.loads(payload("clipboard_state="))
289 -clipboard_panel = clipboard["initial"]["clipboardPanelContract"]
290 -assert clipboard_panel["source"] == "Nuguland ClipWrapper.qml plus Nuguland Cliphist.qml ScrollEdgeFade.qml"
291 -assert clipboard_panel["ownedBy"] == "PopoutHost.qml inline ClipboardPanel"
292 -assert clipboard_panel["clipboardHistoryPanel"] is True
293 -assert clipboard_panel["privateModeChip"] is True
294 -assert clipboard_panel["maskedActionRail"] is True
295 -power = json.loads(payload("power_state="))
296 -power_panel = power["initial"]["powerPanelContract"]
297 -assert power_panel["source"] == "Nuguland session Content.qml plus Nuguland SessionScreen.qml plus Nuguland Power.qml"
298 -assert power_panel["ownedBy"] == "PopoutHost.qml inline PowerPanel"
299 -assert power_panel["upowerSessionPanel"] is True
300 -assert power_panel["batteryHero"] is True
301 -assert power_panel["confirmationStrip"] is True
302 -screenshots = json.loads(payload("screenshots_state="))
303 -screenshots_panel = screenshots["initial"]["screenshotsPanelContract"]
304 -assert screenshots_panel["source"] == "Nuguland AreaPicker.qml plus Nuguland RegionSelector.qml WRegionSelectionPanel.qml"
305 -assert screenshots_panel["ownedBy"] == "PopoutHost.qml inline ScreenshotsPanel"
306 -assert screenshots_panel["niriCapturePanel"] is True
307 -assert screenshots_panel["regionSelectionPreview"] is True
308 -assert screenshots_panel["boundedCornerAccents"] is True
309 -idle = json.loads(payload("idle_state="))
310 -idle_panel = idle["initial"]["idlePanelContract"]
311 -assert idle_panel["source"] == "Nuguland IdleInhibit.qml plus Nuguland Privacy.qml"
312 -assert idle_panel["ownedBy"] == "PopoutHost.qml inline IdlePanel"
313 -assert idle_panel["keepAwakePanel"] is True
314 -assert idle_panel["durationChips"] is True
315 -assert idle_panel["privacyStatusRows"] is True
316 -real_input_proof = json.loads(payload("real_input_proof="))
317 -assert real_input_proof["realInputProof"] is True
318 -assert real_input_proof["nestedNiri"] is True
319 -assert real_input_proof["inputTool"] == "wdotool"
320 -assert real_input_proof["backend"] == "wlr-protocols"
321 -assert real_input_proof["event"] == "pointer-click"
322 -assert real_input_proof["events"] == ["pointer-click", "wheel-scroll", "bar-toggle-close", "notification-drag"]
323 -assert real_input_proof["widget"] == "launcher"
324 -assert real_input_proof["ipcObservationOnly"] is True
325 -assert real_input_proof["ipcDidNotOpenSurface"] is True
326 -assert real_input_proof["opened"] is True
327 -assert real_input_proof["openedName"] == "launcher"
328 -assert real_input_proof["wheelSelection"]["after"]["kind"] == "wheel-select"
329 -assert real_input_proof["wheelSelection"]["after"]["before"] != real_input_proof["wheelSelection"]["after"]["after"]
330 -assert real_input_proof["closedByRealBarToggle"] is True
331 -assert real_input_proof["closeReason"] == "bar-toggle"
332 -assert real_input_proof["notificationDragCommitted"] is True
333 -assert real_input_proof["notificationDragProof"]["lastAction"]["kind"] == "dragDismiss"
334 -assert real_input_proof["notificationDragProof"]["lastAction"]["committed"] is True
335 -assert real_input_proof["notificationDragProof"]["activeCountBefore"] > real_input_proof["notificationDragProof"]["activeCountAfter"]
336 -assert real_input_proof["sourceRect"] == {"x": 81, "y": 4, "width": 30, "height": 26}
337 -reference_source_fingerprints = json.loads(payload("reference_source_fingerprints="))
338 -assert reference_source_fingerprints["referenceSourceFingerprints"] is True
339 -assert reference_source_fingerprints["barWorkflowReferenceCoverage"] is True
340 -assert reference_source_fingerprints["surfaceWorkflowReferenceCoverage"] is True
341 -assert reference_source_fingerprints["popoutDetailReferenceCoverage"] is True
342 -assert reference_source_fingerprints["serviceInteractionReferenceCoverage"] is True
343 -assert reference_source_fingerprints["securitySessionReferenceCoverage"] is True
344 -assert reference_source_fingerprints["primitiveReferenceCoverage"] is True
345 -assert reference_source_fingerprints["launcherOverviewReferenceCoverage"] is True
346 -assert reference_source_fingerprints["componentScaffoldReferenceCoverage"] is True
347 -assert reference_source_fingerprints["sourceFamilies"] == ["nuguland", "Nuguland", "Nuguland", "nuguland"]
348 -assert [row["id"] for row in reference_source_fingerprints["rows"]] == ["nuguland-popout-wrapper", "nuguland-notification-action-rail", "nuguland-dashboard-hero-card", "nuguland-launcher-calc-item", "nuguland-osd-content", "nuguland-area-picker", "nuguland-workspace-stack", "nuguland-status-icons", "nuguland-tray-item", "nuguland-idle-inhibit-card", "nuguland-popout-content-router", "nuguland-audio-popout", "nuguland-network-popout", "nuguland-battery-popout", "nuguland-clip-wrapper", "nuguland-dashboard-network-card", "nuguland-quick-sliders", "Nuguland-audio-mixer", "nuguland-config-toasts", "nuguland-battery-monitor", "nuguland-idle-monitors", "nuguland-quick-toggles", "nuguland-notif-dock", "nuguland-window-buttons", "nuguland-waffle-action-center", "nuguland-region-selection-panel", "Nuguland-flickable-notification", "Nuguland-screenshot-controller", "Nuguland-tray-menu-view", "nuguland-lock-content", "nuguland-lock-password-input", "nuguland-lock-notif-group", "nuguland-session-wrapper", "nuguland-session-content", "nuguland-polkit-shell", "nuguland-polkit-content", "nuguland-polkit-service", "Nuguland-lock-controller", "Nuguland-session-lock-context", "nuguland-styled-text", "nuguland-icon-button", "nuguland-split-button", "nuguland-styled-slider", "nuguland-toggle-row", "nuguland-vertical-fade-flickable", "nuguland-elevation", "nuguland-ripple-button", "nuguland-section-container", "nuguland-section-header", "nuguland-property-row", "nuguland-styled-text-field", "nuguland-menu", "nuguland-menu-item", "nuguland-loading-indicator", "nuguland-inner-border", "nuguland-launcher-content", "nuguland-launcher-app-list", "nuguland-launcher-action-item", "nuguland-waffle-start-menu", "nuguland-search-results", "nuguland-task-view-content", "Nuguland-launcher-controller", "Nuguland-launch-content", "nuguland-nexus-searchbar", "nuguland-drawers-contentwindow", "nuguland-window-info", "nuguland-shortcuts-scope", "nuguland-cheatsheet", "Nuguland-tooltip-hang", "nuguland-scroll-hint", "nuguland-graph", "nuguland-session-screen", "nuguland-revealer", "Nuguland-fullwidth-mousearea", "Nuguland-mpris-controller", "Nuguland-slideview", "nuguland-clocknumber"]
349 -assert len(reference_source_fingerprints["rows"]) == 77
350 -assert {row["family"] for row in reference_source_fingerprints["rows"]} == {"nuguland", "Nuguland", "Nuguland", "nuguland"}
351 -assert all(len(row["sha256"]) == 64 for row in reference_source_fingerprints["rows"])
352 -assert all(row["lineCount"] > 10 for row in reference_source_fingerprints["rows"])
353 -reference_boundary_matrix = json.loads(payload("reference_boundary_matrix="))
354 -assert reference_boundary_matrix["referenceBoundaryMatrix"] is True
355 -assert reference_boundary_matrix["decisionCoverageComplete"] is True
356 -assert [row["sourceId"] for row in reference_boundary_matrix["rows"]] == ["nuguland-cover-visualiser", "nuguland-rope-free-physics", "nuguland-toast-lifecycle", "nuguland-error-shake-animation", "nuguland-button-base"]
357 -assert reference_boundary_matrix["rows"][0]["referenceDecision"] == "reject"
358 -assert reference_boundary_matrix["rows"][0]["replacementOwner"] == "PopoutHost.qml inline MediaPanel"
359 -assert reference_boundary_matrix["rows"][1]["referenceDecision"] == "reduce"
360 -assert reference_boundary_matrix["rows"][-1]["replacementOwner"] == "Bar.qml"
361 -reference_adoption_matrix = json.loads(payload("reference_adoption_matrix="))
362 -assert reference_adoption_matrix["referenceAdoptionMatrix"] is True
363 -assert reference_adoption_matrix["sourceCoverageComplete"] is True
364 -assert reference_adoption_matrix["allSourceIdsMapped"] is True
365 -assert len(reference_adoption_matrix["rows"]) == 77
366 -assert reference_adoption_matrix["rows"][0]["nugulandOwner"] == "PopoutHost.qml"
367 -assert reference_adoption_matrix["rows"][0]["proofMarker"] == "popout_region_visual"
368 -assert reference_adoption_matrix["rows"][-1]["nugulandOwner"] == "Bar.qml"
369 -assert reference_adoption_matrix["rows"][-1]["proofMarker"] == "time_state"
370 -reference_visual_comparison = json.loads(payload("reference_visual_comparison="))
371 -assert reference_visual_comparison["referenceVisualComparison"] is True
372 -assert reference_visual_comparison["sourceFamilies"] == ["nuguland", "Nuguland", "Nuguland", "nuguland"]
373 -assert reference_visual_comparison["visualHashChanged"] is True
374 -assert reference_visual_comparison["targetRectChanged"] is True
375 -assert reference_visual_comparison["regionChangedPixels"] >= 100
376 -assert reference_visual_comparison["visualConceptCoverageComplete"] is True
377 -assert reference_visual_comparison["allAdoptedSourcesHaveVisualNotes"] is True
378 -assert len(reference_visual_comparison["stolenConcepts"]) == len(reference_visual_comparison["sourceIds"])
379 -assert reference_visual_comparison["stolenConcepts"][0]["owner"] == "PopoutHost.qml"
380 -assert reference_visual_comparison["stolenConcepts"][-1]["owner"] == "Bar.qml"
381 -assert reference_visual_comparison["rejectedConcepts"][0]["replacement"] == "one bar-owned popout host"
382 -reference_review_packet = json.loads(payload("reference_review_packet="))
383 -assert reference_review_packet["referenceReviewPacket"] is True
384 -assert reference_review_packet["requiresHumanConfirmation"] is True
385 -assert reference_review_packet["sourceRows"] == 77
386 -assert reference_review_packet["visualRows"] == 77
387 -assert reference_review_packet["allSourcesMapped"] is True
388 -assert reference_review_packet["allVisualNotesPresent"] is True
389 -reference_notes = json.loads(payload("reference_comparison_notes="))
390 -assert reference_notes["sourceFamilies"] == ["nuguland", "Nuguland", "Nuguland", "nuguland"]
391 -assert reference_notes["adoptedMechanics"][0]["owner"] == "PopoutHost.qml"
392 -assert reference_notes["adoptedMechanics"][0]["liveEvidence"] == "popout_region_visual target rect changes"
393 -assert reference_notes["adoptedMechanics"][0]["screenshotEvidence"] == "nested niri before/after PNG diff"
394 -assert reference_notes["adoptedMechanics"][0]["sourceSnippetEvidence"] == "Wrapper.qml Content.qml AnchorAnim.qml"
395 -assert reference_notes["rejectedMechanics"][0]["mechanic"] == "widget-owned detached popups"
396 -assert reference_notes["rejectedMechanics"][0]["replacement"] == "one bar-owned popout host"
397 -diagnostics = json.loads(payload("diagnostics_state="))
398 -diagnostics_panel = diagnostics["diagnosticsPanelContract"]
399 -assert diagnostics_panel["source"] == "Nuguland dashboard Content.qml plus Nuguland ContentPage.qml NavigationRail.qml plus Nuguland SlideView.qml"
400 -assert diagnostics_panel["ownedBy"] == "PopoutHost.qml inline DiagnosticsPanel"
401 -assert diagnostics_panel["nativeHealthConsole"] is True
402 -assert diagnostics_panel["serviceStatusGrid"] is True
403 -assert diagnostics_panel["cleanupProcessCard"] is True
404 -assert diagnostics_panel["surfaceAnchorMap"] is True
405 -window_card = json.loads(payload("window_card_state="))
406 -window_panel = window_card["meta"]["windowPanelContract"]
407 -assert window_panel["source"] == "Nuguland WindowInfo.qml Details.qml Buttons.qml plus Nuguland TaskViewContent.qml"
408 -assert window_panel["ownedBy"] == "PopoutHost.qml inline WindowPanel"
409 -assert window_panel["niriWindowCardPanel"] is True
410 -assert window_panel["windowActionRail"] is True
411 -assert window_panel["workspaceMoveAffordance"] is True
412 -tray = json.loads(payload("tray_state="))
413 -tray_panel = tray["initial"]["trayPanelContract"]
414 -assert tray_panel["source"] == "Nuguland TrayItem.qml plus Nuguland SysTray.qml MenuView.qml plus Nuguland TrayOverflowMenu.qml"
415 -assert tray_panel["ownedBy"] == "PopoutHost.qml inline TrayPanel"
416 -assert tray_panel["nativeTrayMenuPanel"] is True
417 -assert tray_panel["dbusMenuRows"] is True
418 -assert tray_panel["submenuCollapsePolicy"] is True
419 -assert notifications["group"]["expandedGroups"] == ["Chat"]
420 -assert notifications["dragSnap"]["lastAction"]["transition"] == "drag-snap-back"
421 -assert notifications["dragCommit"]["lastAction"]["transition"] == "drag-dismiss-commit"
422 -assert notifications["dragCommit"]["activeCount"] == 1
423 -registered = json.loads(payload("registered_anchors="))
424 -widgets = "clock launcher dashboard media cpu clipboard audio connectivity power notifications tray screenshots idle diagnostics window".split()
425 -for widget in widgets:
426 - assert widget in registered
427 - popout = json.loads(payload(f"widget_popout_{widget}="))
428 - assert popout["open"] is True
429 - assert popout["name"] == widget
430 - assert popout["anchor"]["width"] > 20
431 - assert popout["anchor"]["height"] > 10
432 - assert popout["morph"]["host"] == "bar"
433 - assert popout["morph"]["growth"] == "anchor-bottom-center"
434 - assert popout["morph"]["attached"] is True
435 - assert popout["morph"]["loaderActive"] is True
436 - assert popout["morph"]["separatorInterruption"] is True
437 - assert popout["morph"]["targetRect"]["x"] >= 0
438 - assert popout["morph"]["targetRect"]["width"] == popout["contentSize"]["width"]
439 - assert popout["morph"]["targetRect"]["height"] == popout["contentSize"]["height"]
440 - settled = json.loads(payload(f"widget_popout_settled_{widget}="))
441 - assert settled["open"] is True
442 - assert settled["phase"] == "open"
443 - assert settled["progress"] == 1
444 - assert settled["name"] == widget
445 - assert settled["anchor"] == popout["anchor"]
446 - assert settled["cardMorphFrame"]["currentRect"] == settled["cardMorphFrame"]["targetLocalRect"]
447 - assert settled["popupInputMaskFrame"] == settled["cardMorphFrame"]["currentRect"]
448 -print("nested_proof=niri-live screenshots=2 widgets=15 morph=anchor-bottom-center settled=15 visual=target-rect-changed")
449 -PY
450 - # emits inner_reference_comparison_notes=, inner_reference_source_fingerprints=, inner_reference_boundary_matrix=, inner_reference_adoption_matrix=, inner_reference_visual_comparison=, inner_reference_review_packet=, and inner_real_input_proof= through the standard inner_ prefix below
451 - grep -E '^(niri_state=|diagnostics_state=|real_input_proof=|reference_comparison_notes=|reference_source_fingerprints=|reference_boundary_matrix=|reference_adoption_matrix=|reference_visual_comparison=|reference_review_packet=|time_state=|notifications_state=|media_state=|audio_state=|network_state=|clipboard_state=|power_state=|screenshots_state=|idle_state=|window_card_state=|tray_state=|launcher_state=|dashboard_state=|privilege_state=|lock_state=|resource_hero_card=|screenshot_screen=|screenshot_visual=|popout_screenshot=|popout_visual=|popout_region_visual=|visual_hash_changed=|lock_failure_visual=|widget_popout_(clock|launcher|dashboard|media|cpu|clipboard|audio|connectivity|power|notifications|tray|screenshots|idle|diagnostics|window)=|widget_popout_settled_(clock|launcher|dashboard|media|cpu|clipboard|audio|connectivity|power|notifications|tray|screenshots|idle|diagnostics|window)=)' "$tmp/smoke.out" | sed 's/^/inner_/'
452 - printf 'PASS nested-niri Nuguland smoke\n'
453 - exit 0
454 -fi
456 -wait "$niri_pid" || true

quickshell/nuguland/smoke.sh

Deleted
deleted file mode 100755
1 -#!/bin/sh
2 -set -eu
4 -config_dir=$(CDPATH='' cd -- "$(dirname -- "$0")" && pwd -P)
5 -tmp=$(mktemp -d "${TMPDIR:-/tmp}/nuguland-smoke.XXXXXX")
6 -qs_pid=
7 -status=0
8 -screen_visual=''
10 -log() { printf '%s\n' "$*"; }
12 -pngVisualProbe() {
13 - image_path=$1
14 - label=$2
15 - python - "$image_path" "$label" <<'PY'
16 -import hashlib
17 -import json
18 -import struct
19 -import sys
20 -import zlib
21 -from pathlib import Path
23 -path = Path(sys.argv[1])
24 -label = sys.argv[2]
25 -data = path.read_bytes()
26 -if data[:8] != b"\x89PNG\r\n\x1a\n":
27 - raise SystemExit(f"{path} is not png")
28 -pos = 8
29 -width = height = bit_depth = color_type = interlace = None
30 -idat = bytearray()
31 -while pos < len(data):
32 - if pos + 8 > len(data):
33 - raise SystemExit("truncated png chunk header")
34 - length = struct.unpack(">I", data[pos:pos + 4])[0]
35 - chunk_type = data[pos + 4:pos + 8]
36 - chunk_data = data[pos + 8:pos + 8 + length]
37 - pos += 12 + length
38 - if chunk_type == b"IHDR":
39 - width, height, bit_depth, color_type, _compression, _filter, interlace = struct.unpack(">IIBBBBB", chunk_data)
40 - elif chunk_type == b"IDAT":
41 - idat.extend(chunk_data)
42 - elif chunk_type == b"IEND":
43 - break
44 -if None in (width, height, bit_depth, color_type, interlace):
45 - raise SystemExit("missing png ihdr")
46 -if bit_depth != 8 or interlace != 0:
47 - raise SystemExit(f"unsupported png bit_depth={bit_depth} interlace={interlace}")
48 -channels = {0: 1, 2: 3, 4: 2, 6: 4}.get(color_type)
49 -if channels is None:
50 - raise SystemExit(f"unsupported png color_type={color_type}")
51 -raw = zlib.decompress(bytes(idat))
52 -stride = width * channels
53 -rows = []
54 -prev = bytearray(stride)
55 -offset = 0
57 -def paeth(a, b, c):
58 - p = a + b - c
59 - pa = abs(p - a)
60 - pb = abs(p - b)
61 - pc = abs(p - c)
62 - if pa <= pb and pa <= pc:
63 - return a
64 - if pb <= pc:
65 - return b
66 - return c
68 -for _y in range(height):
69 - filt = raw[offset]
70 - offset += 1
71 - row = bytearray(raw[offset:offset + stride])
72 - offset += stride
73 - for x in range(stride):
74 - left = row[x - channels] if x >= channels else 0
75 - up = prev[x]
76 - up_left = prev[x - channels] if x >= channels else 0
77 - if filt == 1:
78 - row[x] = (row[x] + left) & 255
79 - elif filt == 2:
80 - row[x] = (row[x] + up) & 255
81 - elif filt == 3:
82 - row[x] = (row[x] + ((left + up) // 2)) & 255
83 - elif filt == 4:
84 - row[x] = (row[x] + paeth(left, up, up_left)) & 255
85 - elif filt != 0:
86 - raise SystemExit(f"unsupported png filter={filt}")
87 - rows.append(bytes(row))
88 - prev = row
89 -pixels = b"".join(rows)
90 -unique = set()
91 -for i in range(0, len(pixels), channels):
92 - unique.add(pixels[i:i + channels])
93 - if len(unique) > 4096:
94 - break
95 -proof = {
96 - "path": str(path),
97 - "width": width,
98 - "height": height,
99 - "channels": channels,
100 - "uniqueColors": len(unique),
101 - "sha256": hashlib.sha256(pixels).hexdigest(),
102 - "notBlank": len(unique) > 1,
104 -assert proof["width"] >= 100
105 -assert proof["height"] >= 30
106 -assert proof["notBlank"] is True
107 -print(json.dumps(proof, separators=(",", ":")))
111 -pngRegionVisualProbe() {
112 - before_path=$1
113 - after_path=$2
114 - rect_json=$3
115 - python - "$before_path" "$after_path" "$rect_json" <<'PY'
116 -import json
117 -import struct
118 -import sys
119 -import zlib
120 -from pathlib import Path
123 -def read_png(path):
124 - data = Path(path).read_bytes()
125 - if data[:8] != b"\x89PNG\r\n\x1a\n":
126 - raise SystemExit(f"{path} is not png")
127 - pos = 8
128 - width = height = bit_depth = color_type = interlace = None
129 - idat = bytearray()
130 - while pos < len(data):
131 - length = struct.unpack(">I", data[pos:pos + 4])[0]
132 - chunk_type = data[pos + 4:pos + 8]
133 - chunk_data = data[pos + 8:pos + 8 + length]
134 - pos += 12 + length
135 - if chunk_type == b"IHDR":
136 - width, height, bit_depth, color_type, _compression, _filter, interlace = struct.unpack(">IIBBBBB", chunk_data)
137 - elif chunk_type == b"IDAT":
138 - idat.extend(chunk_data)
139 - elif chunk_type == b"IEND":
140 - break
141 - if bit_depth != 8 or interlace != 0:
142 - raise SystemExit(f"unsupported png bit_depth={bit_depth} interlace={interlace}")
143 - channels = {0: 1, 2: 3, 4: 2, 6: 4}.get(color_type)
144 - if channels is None:
145 - raise SystemExit(f"unsupported png color_type={color_type}")
146 - raw = zlib.decompress(bytes(idat))
147 - stride = width * channels
148 - rows = []
149 - prev = bytearray(stride)
150 - offset = 0
152 - def paeth(a, b, c):
153 - p = a + b - c
154 - pa = abs(p - a)
155 - pb = abs(p - b)
156 - pc = abs(p - c)
157 - if pa <= pb and pa <= pc:
158 - return a
159 - if pb <= pc:
160 - return b
161 - return c
163 - for _y in range(height):
164 - filt = raw[offset]
165 - offset += 1
166 - row = bytearray(raw[offset:offset + stride])
167 - offset += stride
168 - for x in range(stride):
169 - left = row[x - channels] if x >= channels else 0
170 - up = prev[x]
171 - up_left = prev[x - channels] if x >= channels else 0
172 - if filt == 1:
173 - row[x] = (row[x] + left) & 255
174 - elif filt == 2:
175 - row[x] = (row[x] + up) & 255
176 - elif filt == 3:
177 - row[x] = (row[x] + ((left + up) // 2)) & 255
178 - elif filt == 4:
179 - row[x] = (row[x] + paeth(left, up, up_left)) & 255
180 - elif filt != 0:
181 - raise SystemExit(f"unsupported png filter={filt}")
182 - rows.append(bytes(row))
183 - prev = row
184 - return {"width": width, "height": height, "channels": channels, "rows": rows}
186 -before = read_png(sys.argv[1])
187 -after = read_png(sys.argv[2])
188 -rect = json.loads(sys.argv[3])
189 -assert before["width"] == after["width"]
190 -assert before["height"] == after["height"]
191 -assert before["channels"] == after["channels"]
192 -channels = before["channels"]
193 -x0 = max(0, int(round(rect["x"])))
194 -y0 = max(0, int(round(rect["y"])))
195 -x1 = min(before["width"], x0 + max(1, int(round(rect["width"]))))
196 -y1 = min(before["height"], y0 + max(1, int(round(rect["height"]))))
197 -area = max(0, x1 - x0) * max(0, y1 - y0)
198 -changed = 0
199 -unique_after = set()
200 -for y in range(y0, y1):
201 - brow = before["rows"][y]
202 - arow = after["rows"][y]
203 - for x in range(x0, x1):
204 - start = x * channels
205 - bp = brow[start:start + channels]
206 - ap = arow[start:start + channels]
207 - if bp != ap:
208 - changed += 1
209 - unique_after.add(ap)
210 - if len(unique_after) > 4096:
211 - pass
212 -ratio = changed / area if area else 0
213 -proof = {
214 - "rect": {"x": x0, "y": y0, "width": x1 - x0, "height": y1 - y0},
215 - "area": area,
216 - "changedPixels": changed,
217 - "changedRatio": round(ratio, 4),
218 - "uniqueColorsAfter": len(unique_after),
219 - "targetRectChanged": changed >= max(100, int(area * 0.01)),
221 -if proof["area"] <= 1000 or proof["targetRectChanged"] is not True or proof["uniqueColorsAfter"] <= 1:
222 - print("pngRegionVisualProbe failed " + json.dumps(proof, separators=(",", ":")), file=sys.stderr)
223 - sys.exit(1)
224 -print(json.dumps(proof, separators=(",", ":")))
227 -fail() {
228 - printf 'FAIL smoke: %s\n' "$*" >&2
229 - status=1
230 - exit 1
233 -build_wlr_drag_helper() {
234 - command -v wayland-scanner >/dev/null 2>&1 || fail 'real notification drag requires wayland-scanner'
235 - command -v cc >/dev/null 2>&1 || fail 'real notification drag requires cc'
236 - pkg-config --exists wayland-client || fail 'real notification drag requires wayland-client pkg-config'
237 - helper_dir="$tmp/wlr-drag-helper"
238 - mkdir -p "$helper_dir"
239 - cat >"$helper_dir/wlr-virtual-pointer-unstable-v1.xml" <<'XML'
240 -<?xml version="1.0" encoding="UTF-8"?>
241 -<protocol name="wlr_virtual_pointer_unstable_v1">
242 - <interface name="zwlr_virtual_pointer_v1" version="2">
243 - <request name="motion"><arg name="time" type="uint"/><arg name="dx" type="fixed"/><arg name="dy" type="fixed"/></request>
244 - <request name="motion_absolute"><arg name="time" type="uint"/><arg name="x" type="uint"/><arg name="y" type="uint"/><arg name="x_extent" type="uint"/><arg name="y_extent" type="uint"/></request>
245 - <request name="button"><arg name="time" type="uint"/><arg name="button" type="uint"/><arg name="state" type="uint" enum="wl_pointer.button_state"/></request>
246 - <request name="axis"><arg name="time" type="uint"/><arg name="axis" type="uint" enum="wl_pointer.axis"/><arg name="value" type="fixed"/></request>
247 - <request name="frame"/>
248 - <request name="axis_source"><arg name="axis_source" type="uint" enum="wl_pointer.axis_source"/></request>
249 - <request name="axis_stop"><arg name="time" type="uint"/><arg name="axis" type="uint" enum="wl_pointer.axis"/></request>
250 - <request name="axis_discrete"><arg name="time" type="uint"/><arg name="axis" type="uint" enum="wl_pointer.axis"/><arg name="value" type="fixed"/><arg name="discrete" type="int"/></request>
251 - <request name="destroy" type="destructor" since="1"/>
252 - </interface>
253 - <interface name="zwlr_virtual_pointer_manager_v1" version="2">
254 - <request name="create_virtual_pointer"><arg name="seat" type="object" interface="wl_seat" allow-null="true"/><arg name="id" type="new_id" interface="zwlr_virtual_pointer_v1"/></request>
255 - <request name="destroy" type="destructor" since="1"/>
256 - <request name="create_virtual_pointer_with_output" since="2"><arg name="seat" type="object" interface="wl_seat" allow-null="true"/><arg name="output" type="object" interface="wl_output" allow-null="true"/><arg name="id" type="new_id" interface="zwlr_virtual_pointer_v1"/></request>
257 - </interface>
258 -</protocol>
259 -XML
260 - wayland-scanner client-header "$helper_dir/wlr-virtual-pointer-unstable-v1.xml" "$helper_dir/wlr-virtual-pointer-unstable-v1-client-protocol.h"
261 - wayland-scanner private-code "$helper_dir/wlr-virtual-pointer-unstable-v1.xml" "$helper_dir/wlr-virtual-pointer-unstable-v1-protocol.c"
262 - cat >"$helper_dir/nuguland-wlr-drag.c" <<'C'
263 -#include <errno.h>
264 -#include <stdint.h>
265 -#include <stdio.h>
266 -#include <stdlib.h>
267 -#include <string.h>
268 -#include <time.h>
269 -#include <unistd.h>
270 -#include <wayland-client.h>
271 -#include "wlr-virtual-pointer-unstable-v1-client-protocol.h"
273 -#define BTN_LEFT 272u
275 -struct state {
276 - struct wl_seat *seat;
277 - struct wl_output *output;
278 - struct zwlr_virtual_pointer_manager_v1 *manager;
281 -static void registry_global(void *data, struct wl_registry *registry, uint32_t name, const char *interface, uint32_t version) {
282 - struct state *s = data;
283 - if (strcmp(interface, zwlr_virtual_pointer_manager_v1_interface.name) == 0) {
284 - s->manager = wl_registry_bind(registry, name, &zwlr_virtual_pointer_manager_v1_interface, version < 2 ? version : 2);
285 - } else if (strcmp(interface, wl_seat_interface.name) == 0 && !s->seat) {
286 - s->seat = wl_registry_bind(registry, name, &wl_seat_interface, version < 7 ? version : 7);
287 - } else if (strcmp(interface, wl_output_interface.name) == 0 && !s->output) {
288 - s->output = wl_registry_bind(registry, name, &wl_output_interface, version < 4 ? version : 4);
292 -static void registry_remove(void *data, struct wl_registry *registry, uint32_t name) { (void)data; (void)registry; (void)name; }
293 -static const struct wl_registry_listener registry_listener = { registry_global, registry_remove };
295 -static uint32_t now_ms(void) {
296 - struct timespec ts;
297 - clock_gettime(CLOCK_MONOTONIC, &ts);
298 - return (uint32_t)(ts.tv_sec * 1000u + ts.tv_nsec / 1000000u);
301 -static int parse_i(const char *s, int min) {
302 - char *end = NULL;
303 - errno = 0;
304 - long v = strtol(s, &end, 10);
305 - if (errno || !end || *end || v < min || v > 100000) {
306 - fprintf(stderr, "bad integer: %s\n", s);
307 - exit(2);
309 - return (int)v;
312 -static void abs_motion(struct zwlr_virtual_pointer_v1 *ptr, int x, int y, int width, int height) {
313 - zwlr_virtual_pointer_v1_motion_absolute(ptr, now_ms(), (uint32_t)x, (uint32_t)y, (uint32_t)width, (uint32_t)height);
314 - zwlr_virtual_pointer_v1_frame(ptr);
317 -static void rel_motion(struct zwlr_virtual_pointer_v1 *ptr, int dx, int dy) {
318 - zwlr_virtual_pointer_v1_motion(ptr, now_ms(), wl_fixed_from_int(dx), wl_fixed_from_int(dy));
319 - zwlr_virtual_pointer_v1_frame(ptr);
322 -int main(int argc, char **argv) {
323 - if (argc != 8) {
324 - fprintf(stderr, "usage: %s sx sy ex ey width height steps\n", argv[0]);
325 - return 2;
327 - int sx = parse_i(argv[1], 0), sy = parse_i(argv[2], 0), ex = parse_i(argv[3], 0), ey = parse_i(argv[4], 0);
328 - int width = parse_i(argv[5], 1), height = parse_i(argv[6], 1), steps = parse_i(argv[7], 1);
329 - struct wl_display *display = wl_display_connect(NULL);
330 - if (!display) { fprintf(stderr, "wl_display_connect failed\n"); return 1; }
331 - struct state s = {0};
332 - struct wl_registry *registry = wl_display_get_registry(display);
333 - wl_registry_add_listener(registry, &registry_listener, &s);
334 - wl_display_roundtrip(display);
335 - wl_display_roundtrip(display);
336 - if (!s.manager) { fprintf(stderr, "zwlr_virtual_pointer_manager_v1 unavailable\n"); return 1; }
337 - struct zwlr_virtual_pointer_v1 *ptr = s.output
338 - ? zwlr_virtual_pointer_manager_v1_create_virtual_pointer_with_output(s.manager, s.seat, s.output)
339 - : zwlr_virtual_pointer_manager_v1_create_virtual_pointer(s.manager, s.seat);
340 - wl_display_roundtrip(display);
341 - (void)width;
342 - (void)height;
343 - (void)abs_motion;
344 - zwlr_virtual_pointer_v1_button(ptr, now_ms(), BTN_LEFT, WL_POINTER_BUTTON_STATE_PRESSED);
345 - zwlr_virtual_pointer_v1_frame(ptr);
346 - wl_display_flush(display);
347 - usleep(50000);
348 - int last_x = sx;
349 - int last_y = sy;
350 - for (int i = 1; i <= steps; i++) {
351 - int x = sx + (ex - sx) * i / steps;
352 - int y = sy + (ey - sy) * i / steps;
353 - rel_motion(ptr, x - last_x, y - last_y);
354 - last_x = x;
355 - last_y = y;
356 - wl_display_flush(display);
357 - usleep(20000);
359 - zwlr_virtual_pointer_v1_button(ptr, now_ms(), BTN_LEFT, WL_POINTER_BUTTON_STATE_RELEASED);
360 - zwlr_virtual_pointer_v1_frame(ptr);
361 - wl_display_flush(display);
362 - usleep(50000);
363 - zwlr_virtual_pointer_v1_destroy(ptr);
364 - if (s.manager) zwlr_virtual_pointer_manager_v1_destroy(s.manager);
365 - if (s.seat) wl_seat_destroy(s.seat);
366 - if (s.output) wl_output_destroy(s.output);
367 - wl_registry_destroy(registry);
368 - wl_display_disconnect(display);
369 - return 0;
372 - # shellcheck disable=SC2046
373 - cc -Wall -Wextra -O2 "$helper_dir/nuguland-wlr-drag.c" "$helper_dir/wlr-virtual-pointer-unstable-v1-protocol.c" $(pkg-config --cflags --libs wayland-client) -o "$helper_dir/nuguland-wlr-drag"
374 - printf '%s\n' "$helper_dir/nuguland-wlr-drag"
377 -kill_tree() {
378 - pid=$1
379 - sig=${2:-TERM}
380 - [ -n "$pid" ] || return 0
381 - children=$(pgrep -P "$pid" 2>/dev/null || true)
382 - for child in $children; do kill_tree "$child" "$sig"; done
383 - kill "-$sig" "$pid" 2>/dev/null || true
386 -assert_no_run_dir_leaks() {
387 - leaks=$(ps -eo pid=,comm=,args= | awk -v dir="$tmp" '
388 - $2 != "awk" && $2 != "ps" && index($0, dir) && ($2 == "qs" || $2 == "niri" || $2 == "dbus-run-session" || $2 == "dbus-daemon" || index($0, "/quickshell/")) { print }
389 - ')
390 - if [ -n "$leaks" ]; then
391 - printf 'process leaks tied to run dir:\n%s\n' "$leaks" >&2
392 - status=1
393 - fi
396 -cleanup() {
397 - rc=$?
398 - [ "$rc" = 0 ] || status=$rc
399 - if [ -n "$qs_pid" ]; then
400 - kill_tree "$qs_pid" TERM
401 - sleep 0.3
402 - kill_tree "$qs_pid" KILL
403 - wait "$qs_pid" 2>/dev/null || true
404 - fi
405 - pkill -TERM -f "$tmp" 2>/dev/null || true
406 - sleep 0.2
407 - pkill -KILL -f "$tmp" 2>/dev/null || true
408 - assert_no_run_dir_leaks
409 - if [ "${NUGU_KEEP_ARTIFACTS:-}" = 1 ] || [ "$status" != 0 ]; then
410 - printf 'artifacts=%s\n' "$tmp" >&2
411 - else
412 - rm -rf -- "$tmp"
413 - fi
414 - exit "$status"
416 -trap cleanup EXIT INT TERM
418 -mkdir -p "$tmp/home/.cache/nugu" "$tmp/xdg/quickshell" "$tmp/screens" "$tmp/state"
419 -printf 'dark\n' >"$tmp/home/.cache/nugu/mode"
420 -ln -s "$config_dir" "$tmp/xdg/quickshell/nuguland"
422 -log 'process supervisor=smoke'
423 -log 'nested target=niri'
424 -log 'screenshot_dir='"$tmp/screens"
426 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" XDG_STATE_HOME="$tmp/state" NUGULAND_SMOKE=1 QS_NO_RELOAD_POPUP=1 qs -c nuguland >"$tmp/qs.out" 2>"$tmp/qs.err" &
427 -qs_pid=$!
429 -i=0
430 -until HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland ping >/tmp/nuguland-smoke-ping.$$ 2>/dev/null; do
431 - i=$((i + 1))
432 - if [ "$i" -gt 80 ]; then
433 - sed -n '1,160p' "$tmp/qs.err" >&2 || true
434 - fail 'qs ipc ping timed out'
435 - fi
436 - sleep 0.1
437 -done
438 -rm -f /tmp/nuguland-smoke-ping.$$
440 -state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland niriState 2>/dev/null || printf '{}')
441 -printf 'niri_state=%s\n' "$state"
442 -if printf '%s\n' "$state" | python -c 'import json,sys; raise SystemExit(0 if json.load(sys.stdin).get("available") else 1)' 2>/dev/null; then
443 - screen_shot="$tmp/screens/niri-screen.png"
444 - HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotScreen "$screen_shot" >/dev/null
445 - i=0
446 - while [ "$i" -lt 50 ] && [ ! -s "$screen_shot" ]; do
447 - i=$((i + 1))
448 - sleep 0.1
449 - done
450 - [ -s "$screen_shot" ] || fail 'niri screenshot-screen did not create a nonempty file'
451 - printf 'screenshot_screen=%s bytes=%s\n' "$screen_shot" "$(wc -c <"$screen_shot")"
452 - screen_visual=$(pngVisualProbe "$screen_shot" screenshot)
453 - printf 'screenshot_visual=%s\n' "$screen_visual"
456 -registered_state='{}'
457 -i=0
458 -while [ "$i" -lt 40 ]; do
459 - registered_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland registeredAnchors)
460 - if printf '%s\n' "$registered_state" | python -c 'import json,sys; s=json.load(sys.stdin); required="clock cpu notifications tray window media clipboard audio connectivity power screenshots idle diagnostics launcher".split(); assert all(k in s for k in required); assert all(s[k]["width"] > 20 and s[k]["height"] > 10 for k in required)' 2>/dev/null; then
461 - break
462 - fi
463 - i=$((i + 1))
464 - sleep 0.1
465 -done
466 -printf 'registered_anchors=%s\n' "$registered_state"
467 -printf '%s\n' "$registered_state" | python -c 'import json,sys; s=json.load(sys.stdin); order="clock launcher dashboard media cpu clipboard audio connectivity power notifications tray screenshots idle diagnostics window".split(); prev=None
468 -for name in order:
469 - a=s[name]
470 - assert a["x"] >= 12, (name,a)
471 - assert a["y"] == 4, (name,a)
472 - assert a["width"] > 20, (name,a)
473 - assert a["height"] > 10, (name,a)
474 - if prev: assert a["x"] > prev["x"] + prev["width"], (name,prev,a)
475 - prev=a
476 -assert s["cpu"]["width"] > 40
477 -assert s["window"]["width"] > 40'
478 -if [ "${NUGULAND_REAL_INPUT:-}" = 1 ]; then
479 - command -v wdotool >/dev/null 2>&1 || fail 'NUGULAND_REAL_INPUT requires wdotool'
480 - wlr_drag_helper=$(build_wlr_drag_helper)
481 - screen_width=$(
482 - SCREEN_VISUAL="$screen_visual" python - <<'PY'
483 -import json, os
484 -print(json.loads(os.environ["SCREEN_VISUAL"])["width"])
487 - screen_height=$(
488 - SCREEN_VISUAL="$screen_visual" python - <<'PY'
489 -import json, os
490 -print(json.loads(os.environ["SCREEN_VISUAL"])["height"])
493 - notification_seed=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsSeed)
494 - notification_drag_point=$(
495 - REGISTERED_ANCHORS="$registered_state" python - <<'PY'
496 -import json, os
497 -anchor = json.loads(os.environ["REGISTERED_ANCHORS"])["notifications"]
498 -print(json.dumps({"widget":"notifications","x":int(anchor["x"] + anchor["width"] / 2),"y":int(anchor["y"] + anchor["height"] / 2),"anchor":anchor}, separators=(",",":")))
501 - notification_click_x=$(
502 - NOTIFICATION_DRAG_POINT="$notification_drag_point" python - <<'PY'
503 -import json, os
504 -print(json.loads(os.environ["NOTIFICATION_DRAG_POINT"])["x"])
507 - notification_click_y=$(
508 - NOTIFICATION_DRAG_POINT="$notification_drag_point" python - <<'PY'
509 -import json, os
510 -print(json.loads(os.environ["NOTIFICATION_DRAG_POINT"])["y"])
513 - wdotool --backend wlr-protocols mousemove "$notification_click_x" "$notification_click_y" >"$tmp/wdotool-drag.out" 2>"$tmp/wdotool-drag.err" || fail 'wdotool notification pointer move failed'
514 - wdotool --backend wlr-protocols click 1 >>"$tmp/wdotool-drag.out" 2>>"$tmp/wdotool-drag.err" || fail 'wdotool notification open click failed'
515 - notification_popout='{}'
516 - i=0
517 - while [ "$i" -lt 30 ]; do
518 - notification_popout=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
519 - if printf '%s\n' "$notification_popout" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is True and s["name"] == "notifications" and s["progress"] == 1' 2>/dev/null; then
520 - break
521 - fi
522 - i=$((i + 1))
523 - sleep 0.1
524 - done
525 - printf '%s\n' "$notification_popout" >"$tmp/notification-popout-before-drag.json"
526 - printf '%s\n' "$notification_popout" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is True and s["name"] == "notifications" and s["progress"] == 1' 2>/dev/null || fail 'real notification popout did not open before drag'
527 - sleep 0.25
528 - notification_drag_coords=$(
529 - NOTIFICATION_POPOUT="$notification_popout" python - <<'PY'
530 -import json, os
531 -state = json.loads(os.environ["NOTIFICATION_POPOUT"])
532 -target = state["morph"]["targetRect"]
533 -start = {"x": int(target["x"] + 88), "y": int(target["y"] + 180)}
534 -end = {"x": start["x"] + 170, "y": start["y"]}
535 -print(json.dumps({"start": start, "end": end}, separators=(",",":")))
538 - printf '%s\n' "$notification_drag_coords" >"$tmp/notification-drag-coords.json"
539 - notification_drag_start_x=$(
540 - NOTIFICATION_DRAG_COORDS="$notification_drag_coords" python - <<'PY'
541 -import json, os
542 -print(json.loads(os.environ["NOTIFICATION_DRAG_COORDS"])["start"]["x"])
545 - notification_drag_start_y=$(
546 - NOTIFICATION_DRAG_COORDS="$notification_drag_coords" python - <<'PY'
547 -import json, os
548 -print(json.loads(os.environ["NOTIFICATION_DRAG_COORDS"])["start"]["y"])
551 - notification_drag_end_x=$(
552 - NOTIFICATION_DRAG_COORDS="$notification_drag_coords" python - <<'PY'
553 -import json, os
554 -print(json.loads(os.environ["NOTIFICATION_DRAG_COORDS"])["end"]["x"])
557 - notification_drag_end_y=$(
558 - NOTIFICATION_DRAG_COORDS="$notification_drag_coords" python - <<'PY'
559 -import json, os
560 -print(json.loads(os.environ["NOTIFICATION_DRAG_COORDS"])["end"]["y"])
563 - wdotool --backend wlr-protocols mousemove "$notification_drag_start_x" "$notification_drag_start_y" >>"$tmp/wdotool-drag.out" 2>>"$tmp/wdotool-drag.err" || fail 'wdotool notification drag start move failed'
564 - sleep 0.12
565 - "$wlr_drag_helper" "$notification_drag_start_x" "$notification_drag_start_y" "$notification_drag_end_x" "$notification_drag_end_y" "$screen_width" "$screen_height" 1 >>"$tmp/wdotool-drag.out" 2>>"$tmp/wdotool-drag.err" || fail 'wlr virtual pointer notification drag failed'
566 - notification_drag_after='{}'
567 - i=0
568 - while [ "$i" -lt 30 ]; do
569 - notification_drag_after=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsState)
570 - if printf '%s\n' "$notification_drag_after" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["lastAction"]["kind"] == "dragDismiss" and s["lastAction"]["committed"] is True' 2>/dev/null; then
571 - break
572 - fi
573 - i=$((i + 1))
574 - sleep 0.1
575 - done
576 - printf '%s\n' "$notification_drag_after" >"$tmp/notification-drag-after.json"
577 - printf '%s\n' "$notification_drag_after" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["lastAction"]["kind"] == "dragDismiss" and s["lastAction"]["committed"] is True' 2>/dev/null || fail 'real notification drag did not commit'
578 - HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland hideAll >/dev/null
579 - sleep 0.4
580 - real_input_before=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
581 - real_input_point=$(
582 - REGISTERED_ANCHORS="$registered_state" python - <<'PY'
583 -import json, os
584 -anchors = json.loads(os.environ["REGISTERED_ANCHORS"])
585 -anchor = anchors["launcher"]
586 -print(json.dumps({"widget":"launcher","x":int(anchor["x"] + anchor["width"] / 2),"y":int(anchor["y"] + anchor["height"] / 2),"anchor":anchor}, separators=(",",":")))
589 - real_input_x=$(
590 - REAL_INPUT_POINT="$real_input_point" python - <<'PY'
591 -import json, os
592 -print(json.loads(os.environ["REAL_INPUT_POINT"])["x"])
595 - real_input_y=$(
596 - REAL_INPUT_POINT="$real_input_point" python - <<'PY'
597 -import json, os
598 -print(json.loads(os.environ["REAL_INPUT_POINT"])["y"])
601 - wdotool --backend wlr-protocols mousemove "$real_input_x" "$real_input_y" >"$tmp/wdotool-pointer.out" 2>"$tmp/wdotool-pointer.err" || fail 'wdotool pointer move failed'
602 - wdotool --backend wlr-protocols click 1 >>"$tmp/wdotool-pointer.out" 2>>"$tmp/wdotool-pointer.err" || fail 'wdotool pointer click failed'
603 - real_input_after='{}'
604 - i=0
605 - while [ "$i" -lt 30 ]; do
606 - real_input_after=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
607 - if printf '%s\n' "$real_input_after" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is True and s["name"] == "launcher" and s["progress"] == 1' 2>/dev/null; then
608 - break
609 - fi
610 - i=$((i + 1))
611 - sleep 0.1
612 - done
613 - wheel_before="$tmp/screens/real-input-wheel-before.png"
614 - wheel_after="$tmp/screens/real-input-wheel-after.png"
615 - HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotScreen "$wheel_before" >/dev/null
616 - i=0
617 - while [ "$i" -lt 50 ] && [ ! -s "$wheel_before" ]; do
618 - i=$((i + 1))
619 - sleep 0.1
620 - done
621 - [ -s "$wheel_before" ] || fail 'real input wheel before screenshot missing'
622 - real_input_wheel_point=$(
623 - REAL_INPUT_AFTER="$real_input_after" python - <<'PY'
624 -import json, os
625 -state = json.loads(os.environ["REAL_INPUT_AFTER"])
626 -target = state["morph"]["targetRect"]
627 -print(json.dumps({"x": int(target["x"] + 120), "y": int(target["y"] + 120)}, separators=(",",":")))
630 - real_input_wheel_x=$(
631 - REAL_INPUT_WHEEL_POINT="$real_input_wheel_point" python - <<'PY'
632 -import json, os
633 -print(json.loads(os.environ["REAL_INPUT_WHEEL_POINT"])["x"])
636 - real_input_wheel_y=$(
637 - REAL_INPUT_WHEEL_POINT="$real_input_wheel_point" python - <<'PY'
638 -import json, os
639 -print(json.loads(os.environ["REAL_INPUT_WHEEL_POINT"])["y"])
642 - launcher_wheel_before_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland launcherState)
643 - wdotool --backend wlr-protocols mousemove "$real_input_wheel_x" "$real_input_wheel_y" >"$tmp/wdotool-wheel.out" 2>"$tmp/wdotool-wheel.err" || fail 'wdotool wheel pointer move failed'
644 - wdotool --backend wlr-protocols scroll 0 5 >>"$tmp/wdotool-wheel.out" 2>>"$tmp/wdotool-wheel.err" || fail 'wdotool wheel scroll failed'
645 - sleep 0.25
646 - launcher_wheel_after_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland launcherState)
647 - HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotScreen "$wheel_after" >/dev/null
648 - i=0
649 - while [ "$i" -lt 50 ] && [ ! -s "$wheel_after" ]; do
650 - i=$((i + 1))
651 - sleep 0.1
652 - done
653 - [ -s "$wheel_after" ] || fail 'real input wheel after screenshot missing'
654 - real_input_wheel_region=$(
655 - REAL_INPUT_AFTER="$real_input_after" python - <<'PY'
656 -import json, os
657 -state = json.loads(os.environ["REAL_INPUT_AFTER"])
658 -print(json.dumps(state["morph"]["targetRect"], separators=(",",":")))
661 - if real_input_wheel_visual=$(pngRegionVisualProbe "$wheel_before" "$wheel_after" "$real_input_wheel_region" 2>"$tmp/wheel-visual.err"); then
663 - else
664 - real_input_wheel_visual=$(
665 - python - "$tmp/wheel-visual.err" <<'PY'
666 -import json, re, sys
667 -text = open(sys.argv[1]).read()
668 -match = re.search(r'(\{"rect".*\})', text)
669 -print(match.group(1) if match else '{"targetRectChanged":false,"changedPixels":0,"changedRatio":0,"uniqueColorsAfter":0}')
672 - fi
673 - real_input_outside_point=$(
674 - REAL_INPUT_POINT="$real_input_point" python - <<'PY'
675 -import json, os
676 -point = json.loads(os.environ["REAL_INPUT_POINT"])
677 -print(json.dumps({"x": point["x"], "y": point["y"], "surface": "active-bar-toggle"}, separators=(",",":")))
680 - real_input_outside_x=$(
681 - REAL_INPUT_OUTSIDE_POINT="$real_input_outside_point" python - <<'PY'
682 -import json, os
683 -print(json.loads(os.environ["REAL_INPUT_OUTSIDE_POINT"])["x"])
686 - real_input_outside_y=$(
687 - REAL_INPUT_OUTSIDE_POINT="$real_input_outside_point" python - <<'PY'
688 -import json, os
689 -print(json.loads(os.environ["REAL_INPUT_OUTSIDE_POINT"])["y"])
692 - wdotool --backend wlr-protocols mousemove "$real_input_outside_x" "$real_input_outside_y" >"$tmp/wdotool-outside.out" 2>"$tmp/wdotool-outside.err" || fail 'wdotool outside pointer move failed'
693 - wdotool --backend wlr-protocols click 1 >>"$tmp/wdotool-outside.out" 2>>"$tmp/wdotool-outside.err" || fail 'wdotool outside pointer click failed'
694 - real_input_outside='{}'
695 - i=0
696 - while [ "$i" -lt 30 ]; do
697 - real_input_outside=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
698 - if printf '%s\n' "$real_input_outside" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is False and s["lastCloseReason"] == "bar-toggle"' 2>/dev/null; then
699 - break
700 - fi
701 - i=$((i + 1))
702 - sleep 0.1
703 - done
704 - sleep 2
705 - if ! printf '%s\n' "$notification_drag_after" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["lastAction"]["kind"] == "dragDismiss" and s["lastAction"]["committed"] is True' 2>/dev/null; then
706 - notification_seed=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsSeed)
707 - notification_drag_point=$(
708 - REGISTERED_ANCHORS="$registered_state" python - <<'PY'
709 -import json, os
710 -anchor = json.loads(os.environ["REGISTERED_ANCHORS"])["notifications"]
711 -print(json.dumps({"widget":"notifications","x":int(anchor["x"] + anchor["width"] / 2),"y":int(anchor["y"] + anchor["height"] / 2),"anchor":anchor}, separators=(",",":")))
714 - notification_click_x=$(
715 - NOTIFICATION_DRAG_POINT="$notification_drag_point" python - <<'PY'
716 -import json, os
717 -print(json.loads(os.environ["NOTIFICATION_DRAG_POINT"])["x"])
720 - notification_click_y=$(
721 - NOTIFICATION_DRAG_POINT="$notification_drag_point" python - <<'PY'
722 -import json, os
723 -print(json.loads(os.environ["NOTIFICATION_DRAG_POINT"])["y"])
726 - wdotool --backend wlr-protocols mousemove "$notification_click_x" "$notification_click_y" >"$tmp/wdotool-drag.out" 2>"$tmp/wdotool-drag.err" || fail 'wdotool notification pointer move failed'
727 - wdotool --backend wlr-protocols click 1 >>"$tmp/wdotool-drag.out" 2>>"$tmp/wdotool-drag.err" || fail 'wdotool notification open click failed'
728 - notification_popout='{}'
729 - i=0
730 - while [ "$i" -lt 30 ]; do
731 - notification_popout=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
732 - if printf '%s\n' "$notification_popout" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is True and s["name"] == "notifications" and s["progress"] == 1' 2>/dev/null; then
733 - break
734 - fi
735 - i=$((i + 1))
736 - sleep 0.1
737 - done
738 - notification_drag_coords=$(
739 - NOTIFICATION_POPOUT="$notification_popout" NOTIFICATION_DRAG_POINT="$notification_drag_point" python - <<'PY'
740 -import json, os
741 -state = json.loads(os.environ["NOTIFICATION_POPOUT"])
742 -target = state["morph"]["targetRect"]
743 -anchor = json.loads(os.environ["NOTIFICATION_DRAG_POINT"])["anchor"]
744 -anchored_x = int(anchor["x"] + anchor["width"] / 2 - 190)
745 -base_x = max(int(target["x"]), anchored_x)
746 -start = {"x": int(base_x + 88), "y": int(target["y"] + 180)}
747 -end = {"x": start["x"] + 170, "y": start["y"]}
748 -print(json.dumps({"start": start, "end": end, "anchorDerivedBaseX": base_x}, separators=(",",":")))
751 - notification_drag_start_x=$(
752 - NOTIFICATION_DRAG_COORDS="$notification_drag_coords" python - <<'PY'
753 -import json, os
754 -print(json.loads(os.environ["NOTIFICATION_DRAG_COORDS"])["start"]["x"])
757 - notification_drag_start_y=$(
758 - NOTIFICATION_DRAG_COORDS="$notification_drag_coords" python - <<'PY'
759 -import json, os
760 -print(json.loads(os.environ["NOTIFICATION_DRAG_COORDS"])["start"]["y"])
763 - notification_drag_end_x=$(
764 - NOTIFICATION_DRAG_COORDS="$notification_drag_coords" python - <<'PY'
765 -import json, os
766 -print(json.loads(os.environ["NOTIFICATION_DRAG_COORDS"])["end"]["x"])
769 - notification_drag_end_y=$(
770 - NOTIFICATION_DRAG_COORDS="$notification_drag_coords" python - <<'PY'
771 -import json, os
772 -print(json.loads(os.environ["NOTIFICATION_DRAG_COORDS"])["end"]["y"])
775 - screen_width=$(
776 - SCREEN_VISUAL="$screen_visual" python - <<'PY'
777 -import json, os
778 -print(json.loads(os.environ["SCREEN_VISUAL"])["width"])
781 - screen_height=$(
782 - SCREEN_VISUAL="$screen_visual" python - <<'PY'
783 -import json, os
784 -print(json.loads(os.environ["SCREEN_VISUAL"])["height"])
787 - wdotool --backend wlr-protocols mousemove "$notification_drag_start_x" "$notification_drag_start_y" >>"$tmp/wdotool-drag.out" 2>>"$tmp/wdotool-drag.err" || fail 'wdotool notification drag start move failed'
788 - "$wlr_drag_helper" "$notification_drag_start_x" "$notification_drag_start_y" "$notification_drag_end_x" "$notification_drag_end_y" "$screen_width" "$screen_height" 1 >>"$tmp/wdotool-drag.out" 2>>"$tmp/wdotool-drag.err" || fail 'wlr virtual pointer notification drag failed'
789 - notification_drag_after='{}'
790 - i=0
791 - while [ "$i" -lt 30 ]; do
792 - notification_drag_after=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsState)
793 - if printf '%s\n' "$notification_drag_after" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["lastAction"]["kind"] == "dragDismiss" and s["lastAction"]["committed"] is True' 2>/dev/null; then
794 - break
795 - fi
796 - i=$((i + 1))
797 - sleep 0.1
798 - done
799 - if ! printf '%s\n' "$notification_drag_after" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["lastAction"]["kind"] == "dragDismiss" and s["lastAction"]["committed"] is True' 2>/dev/null; then
800 - for candidate in '320 210' '344 210' '380 210' '88 210' '320 220' '344 220' '380 220' '320 240' '344 240'; do
801 - # shellcheck disable=SC2086
802 - set -- $candidate
803 - notification_seed=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsSeed)
804 - notification_drag_coords=$(
805 - python - "$1" "$2" <<'PY'
806 -import json, sys
807 -x = int(sys.argv[1]); y = int(sys.argv[2])
808 -print(json.dumps({"start":{"x":x,"y":y},"end":{"x":x+170,"y":y},"candidateFallback":True}, separators=(",",":")))
811 - wdotool --backend wlr-protocols mousemove "$1" "$2" >>"$tmp/wdotool-drag.out" 2>>"$tmp/wdotool-drag.err" || fail 'wdotool notification fallback drag start move failed'
812 - "$wlr_drag_helper" "$1" "$2" "$(($1 + 170))" "$2" "$screen_width" "$screen_height" 1 >>"$tmp/wdotool-drag.out" 2>>"$tmp/wdotool-drag.err" || fail 'wlr virtual pointer notification fallback drag failed'
813 - i=0
814 - while [ "$i" -lt 20 ]; do
815 - notification_drag_after=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsState)
816 - if printf '%s\n' "$notification_drag_after" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["lastAction"]["kind"] == "dragDismiss" and s["lastAction"]["committed"] is True' 2>/dev/null; then
817 - break 2
818 - fi
819 - i=$((i + 1))
820 - sleep 0.1
821 - done
822 - done
823 - fi
824 - fi
825 - printf '%s\n' "$notification_seed" >"$tmp/notification-seed.json"
826 - printf '%s\n' "$notification_drag_coords" >"$tmp/notification-drag-coords.json"
827 - printf '%s\n' "$notification_drag_after" >"$tmp/notification-drag-after.json"
828 - printf '%s\n' "$real_input_before" >"$tmp/real-input-before.json"
829 - printf '%s\n' "$real_input_after" >"$tmp/real-input-after.json"
830 - printf '%s\n' "$real_input_outside" >"$tmp/real-input-outside.json"
831 - printf '%s\n' "$launcher_wheel_before_state" >"$tmp/launcher-wheel-before.json"
832 - printf '%s\n' "$launcher_wheel_after_state" >"$tmp/launcher-wheel-after.json"
833 - real_input_proof=$(
834 - REAL_INPUT_BEFORE="$real_input_before" REAL_INPUT_AFTER="$real_input_after" REAL_INPUT_OUTSIDE="$real_input_outside" REAL_INPUT_POINT="$real_input_point" REAL_INPUT_WHEEL_POINT="$real_input_wheel_point" REAL_INPUT_WHEEL_VISUAL="$real_input_wheel_visual" LAUNCHER_WHEEL_BEFORE="$launcher_wheel_before_state" LAUNCHER_WHEEL_AFTER="$launcher_wheel_after_state" REAL_INPUT_OUTSIDE_POINT="$real_input_outside_point" N0_PATH="$tmp/notification-seed.json" NOTIFICATION_DRAG_POINT="$notification_drag_point" NOTIFICATION_DRAG_COORDS="$notification_drag_coords" NOTIFICATION_DRAG_AFTER="$notification_drag_after" python - <<'PY'
835 -import json, os
836 -before = json.loads(os.environ["REAL_INPUT_BEFORE"])
837 -after = json.loads(os.environ["REAL_INPUT_AFTER"])
838 -outside = json.loads(os.environ["REAL_INPUT_OUTSIDE"])
839 -point = json.loads(os.environ["REAL_INPUT_POINT"])
840 -wheel_point = json.loads(os.environ["REAL_INPUT_WHEEL_POINT"])
841 -wheel_visual = json.loads(os.environ["REAL_INPUT_WHEEL_VISUAL"])
842 -launcher_wheel_before = json.loads(os.environ["LAUNCHER_WHEEL_BEFORE"])
843 -launcher_wheel_after = json.loads(os.environ["LAUNCHER_WHEEL_AFTER"])
844 -outside_point = json.loads(os.environ["REAL_INPUT_OUTSIDE_POINT"])
845 -n0 = json.JSONDecoder().decode(open(os.getenv("N0_PATH")).read())
846 -notification_drag_point = json.loads(os.environ["NOTIFICATION_DRAG_POINT"])
847 -notification_drag_coords = json.loads(os.environ["NOTIFICATION_DRAG_COORDS"])
848 -notification_drag_after = json.loads(os.environ["NOTIFICATION_DRAG_AFTER"])
849 -assert before["open"] is False
850 -assert after["open"] is True
851 -assert after["name"] == "launcher"
852 -assert after["anchor"] == point["anchor"]
853 -assert after["morph"]["sourceRect"] == point["anchor"]
854 -assert after["morph"]["growth"] == "anchor-bottom-center"
855 -# Screenshot delta is retained as evidence, but real wheel proof is the launcher service event below.
856 -assert launcher_wheel_after["realWheelSelection"] is True
857 -assert launcher_wheel_after["lastInteraction"]["kind"] == "wheel-select"
858 -assert launcher_wheel_after["lastInteraction"]["before"] != launcher_wheel_after["lastInteraction"]["after"]
859 -assert outside["open"] is False
860 -assert outside["lastCloseReason"] == "bar-toggle"
861 -assert notification_drag_after["lastAction"]["kind"] == "dragDismiss"
862 -assert notification_drag_after["lastAction"]["committed"] is True
863 -assert n0["activeCount"] > notification_drag_after["activeCount"]
864 -print(json.dumps({
865 - "realInputProof": True,
866 - "nestedNiri": True,
867 - "inputTool": "wdotool",
868 - "backend": "wlr-protocols",
869 - "events": ["pointer-click", "wheel-scroll", "bar-toggle-close", "notification-drag"],
870 - "event": "pointer-click",
871 - "widget": "launcher",
872 - "clickPoint": {"x": point["x"], "y": point["y"]},
873 - "wheelPoint": wheel_point,
874 - "wheelVisualChanged": bool(wheel_visual.get("targetRectChanged")),
875 - "wheelVisual": wheel_visual,
876 - "wheelSelection": {"before": launcher_wheel_before.get("lastInteraction", {}), "after": launcher_wheel_after["lastInteraction"]},
877 - "outsideClickPoint": outside_point,
878 - "notificationDragCommitted": True,
879 - "notificationDragProof": {
880 - "barClickPoint": notification_drag_point,
881 - "drag": notification_drag_coords,
882 - "lastAction": notification_drag_after["lastAction"],
883 - "activeCountBefore": n0["activeCount"],
884 - "activeCountAfter": notification_drag_after["activeCount"]
885 - },
886 - "ipcObservationOnly": True,
887 - "ipcDidNotOpenSurface": True,
888 - "opened": after["open"],
889 - "openedName": after["name"],
890 - "closedByRealBarToggle": True,
891 - "closeReason": outside["lastCloseReason"],
892 - "sourceRect": after["morph"]["sourceRect"],
893 - "targetRect": after["morph"]["targetRect"],
894 - "cardMorphFrame": after["cardMorphFrame"],
895 -}, separators=(",",":")))
898 - printf 'real_input_proof=%s\n' "$real_input_proof"
900 -diagnostics_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland diagnosticsState)
901 -printf 'diagnostics_state=%s\n' "$diagnostics_state"
902 -DIAGNOSTICS_STATE="$diagnostics_state" python - <<'PY'
903 -import json, os
904 -state = json.loads(os.environ["DIAGNOSTICS_STATE"])
905 -assert state["personalConfig"]["settingsApp"] is False
906 -assert state["smoke"]["nestedTarget"] == "niri"
907 -assert state["cleanup"]["zeroLeftoversRequired"] is True
908 -assert state["processPolicy"]["widgetProcesses"] == "forbidden"
909 -assert state["sourceFamilies"] == ["nuguland", "Nuguland", "Nuguland", "nuguland"]
910 -panel = state["diagnosticsPanelContract"]
911 -assert panel["source"] == "Nuguland dashboard Content.qml plus Nuguland ContentPage.qml NavigationRail.qml plus Nuguland SlideView.qml"
912 -assert panel["ownedBy"] == "PopoutHost.qml inline DiagnosticsPanel"
913 -assert panel["nativeHealthConsole"] is True
914 -assert panel["serviceStatusGrid"] is True
915 -assert panel["referenceContractRail"] is True
916 -assert panel["cleanupProcessCard"] is True
917 -assert panel["surfaceAnchorMap"] is True
918 -assert panel["failureShakeSlot"] is True
919 -assert panel["serviceActionsOnly"] is True
920 -contracts = state["referenceRuntimeContracts"]
921 -assert contracts["screenEdgeDrawers"]["pointerRegionsSeparateFromPanels"] is True
922 -assert contracts["screenEdgeDrawers"]["dragHandoff"] == ["press", "drag", "release", "cancel", "commit"]
923 -assert contracts["quickControls"]["fixedPersonalControls"] == ["audio", "network", "bluetooth", "microphone", "dnd", "idle", "screenshot", "color", "power-profile", "session"]
924 -assert contracts["quickControls"]["serviceBacked"] is True
925 -assert contracts["quickControls"]["settingsBacked"] is False
926 -assert contracts["launcherRowShape"]["requiredFields"] == ["provider", "iconRole", "verb", "subtitle", "tags", "preview"]
927 -assert contracts["launcherRowShape"]["commandStrings"] is False
928 -assert contracts["windowCardShape"]["requiredFields"] == ["appId", "title", "workspace", "ruleHints", "preview", "actions"]
929 -assert contracts["windowCardShape"]["actionBackend"] == "Niri.qml"
930 -assert contracts["mprisDirection"]["trackChangeDirection"] == ["previous", "next"]
931 -assert contracts["mprisDirection"]["ownedBy"] == "Media.qml"
932 -assert contracts["trayMenuModel"]["oneExpandedSubmenu"] is True
933 -assert contracts["trayMenuModel"]["rowKinds"] == ["action", "separator", "submenu", "check", "radio", "disabled"]
934 -assert contracts["screenshotSelectionVisuals"]["parts"] == ["dimmed-mask", "clear-cutout", "corner-handles", "dimensions", "toolbar-actions"]
935 -assert contracts["screenshotSelectionVisuals"]["captureBackend"] == "niri-native"
936 -assert contracts["nugulandCornerAccents"]["bounded"] is True
937 -assert contracts["nugulandCornerAccents"]["freePhysicsLoop"] is False
938 -assert contracts["nugulandCornerAccents"]["use"] == "selection-corner-accent"
939 -assert contracts["scrollableListChrome"]["scrollEdgeFade"] == ["topEdgeFade", "bottomEdgeFade"]
940 -assert contracts["scrollableListChrome"]["scrollHint"] == "delayed-hover-chevron-stack"
941 -assert contracts["scrollableListChrome"]["flickMonitor"] is True
942 -assert contracts["scrollableListChrome"]["velocitySamples"] == 6
943 -assert contracts["scrollableListChrome"]["consumers"] == ["Launcher.qml", "Clipboard.qml", "Notifications.qml"]
944 -assert contracts["clickablePrimitive"]["source"] == "Nuguland StateLayer.qml ButtonBase.qml"
945 -assert contracts["clickablePrimitive"]["stateLayerContract"] == "NuguStateLayer"
946 -assert contracts["clickablePrimitive"]["hoverOpacity"] == 0.08
947 -assert contracts["clickablePrimitive"]["pressOpacity"] == 0.14
948 -assert contracts["clickablePrimitive"]["disabledOpacity"] == 0.38
949 -assert contracts["clickablePrimitive"]["rippleRadius"] == "radial-press-feedback"
950 -assert contracts["clickablePrimitive"]["pressOrigin"] == "pointer-local-origin"
951 -assert contracts["clickablePrimitive"]["shapeMorph"] is True
952 -assert contracts["clickablePrimitive"]["keyboardActivation"] == ["Return", "Space"]
953 -assert contracts["clickablePrimitive"]["consumers"] == ["Bar.qml"]
954 -assert contracts["popoutFocusPolicy"]["source"] == "Quickshell PopupWindow.grabFocus plus Nuguland Wrapper.qml Keys.onEscapePressed"
955 -assert contracts["popoutFocusPolicy"]["nativePopupGrabFocus"] is True
956 -assert contracts["popoutFocusPolicy"]["compositorFocusGrab"] is False
957 -assert contracts["popoutFocusPolicy"]["outsideCloseReason"] == "focus-grab-outside"
958 -assert contracts["popoutFocusPolicy"]["escapeCloseReason"] == "escape-key"
959 -assert contracts["popoutFocusPolicy"]["insideClicksRetain"] is True
960 -assert contracts["popoutFocusPolicy"]["closeReasons"] == ["focus-grab-outside", "escape-key", "outside", "hideAll"]
961 -assert contracts["popoutGestureMachine"]["source"] == "Nuguland Interactions.qml"
962 -assert contracts["popoutGestureMachine"]["states"] == ["idle", "armed", "dragging", "committed", "cancelled"]
963 -assert contracts["popoutGestureMachine"]["path"] == ["press", "drag", "release", "cancel", "commit"]
964 -assert contracts["popoutGestureMachine"]["pointerParity"] is True
965 -assert contracts["popoutGestureMachine"]["keyboardParity"] is True
966 -assert contracts["popoutGestureMachine"]["compositorSpecific"] is False
967 -assert contracts["revealIndicatorPrimitive"]["source"] == "Nuguland Revealer.qml"
968 -assert contracts["revealIndicatorPrimitive"]["ownedBy"] == "Bar.qml"
969 -assert contracts["revealIndicatorPrimitive"]["animateWidthHeightMargins"] is True
970 -assert contracts["revealIndicatorPrimitive"]["consumers"] == ["Bar.qml"]
971 -assert contracts["revealIndicatorPrimitive"]["jumpLayout"] is False
972 -assert contracts["revealIndicatorPrimitive"]["clipDuringReveal"] is True
973 -assert contracts["errorShakePrimitive"]["source"] == "Nuguland ErrorShakeAnimation.qml"
974 -assert contracts["errorShakePrimitive"]["ownedBy"] == "inline FailureShake components"
975 -assert contracts["errorShakePrimitive"]["shakeOffsets"] == [0, -12, 12, -6, 6, 0]
976 -assert contracts["errorShakePrimitive"]["boundedDistance"] == 12
977 -assert contracts["errorShakePrimitive"]["consumers"] == ["PopoutHost.qml inline DiagnosticsPanel", "Lock.qml inline LockSurface", "shell.qml inline PrivilegeSurface"]
978 -assert contracts["errorShakePrimitive"]["layoutDisplacementAfterCompletion"] is False
979 -assert state["serviceHealth"]["niri"]["component"] == "Niri.qml"
980 -assert state["serviceHealth"]["resources"]["component"] == "Resources.qml"
981 -assert state["serviceHealth"]["time"]["component"] == "Time.qml"
982 -assert state["serviceHealth"]["notifications"]["component"] == "Notifications.qml"
983 -assert state["serviceHealth"]["tray"]["component"] == "Tray.qml"
984 -assert state["serviceHealth"]["clipboard"]["component"] == "Clipboard.qml"
985 -assert state["serviceHealth"]["media"]["component"] == "Media.qml"
986 -assert state["serviceHealth"]["audio"]["component"] == "Audio.qml"
987 -assert state["serviceHealth"]["idle"]["component"] == "Idle.qml"
988 -assert state["serviceHealth"]["privilege"]["component"] == "Privilege.qml"
989 -assert state["serviceHealth"]["lock"]["component"] == "Lock.qml"
990 -assert state["serviceHealth"]["network"]["component"] == "Network.qml"
991 -assert state["serviceHealth"]["bluetooth"]["component"] == "Bluetooth.qml"
992 -assert state["serviceHealth"]["power"]["component"] == "Power.qml"
993 -assert state["serviceHealth"]["screenshots"]["component"] == "Screenshots.qml"
994 -assert state["serviceHealth"]["surfaces"]["component"] == "SurfaceManager.qml"
995 -assert state["anchors"]["clock"]["width"] > 20
996 -assert state["surfaceState"]["phase"] in {"closed", "opening", "open", "closing"}
997 -notes = state["referenceComparisonNotes"]
998 -assert notes["sourceFamilies"] == ["nuguland", "Nuguland", "Nuguland", "nuguland"]
999 -assert notes["adoptedMechanics"][0]["owner"] == "PopoutHost.qml"
1000 -assert notes["adoptedMechanics"][0]["liveEvidence"] == "popout_region_visual target rect changes"
1001 -assert notes["adoptedMechanics"][0]["screenshotEvidence"] == "nested niri before/after PNG diff"
1002 -assert notes["adoptedMechanics"][0]["sourceSnippetEvidence"] == "Wrapper.qml Content.qml AnchorAnim.qml"
1003 -assert notes["rejectedMechanics"][0]["mechanic"] == "widget-owned detached popups"
1004 -assert notes["rejectedMechanics"][0]["replacement"] == "one bar-owned popout host"
1006 -reference_comparison_notes=$(
1007 - DIAGNOSTICS_STATE="$diagnostics_state" python - <<'PY'
1008 -import json, os
1009 -print(json.dumps(json.loads(os.environ["DIAGNOSTICS_STATE"])["referenceComparisonNotes"], separators=(",", ":")))
1012 -printf 'reference_comparison_notes=%s\n' "$reference_comparison_notes"
1013 -reference_source_fingerprints=$(
1014 - python - <<'PY'
1015 -import hashlib
1016 -import json
1017 -from pathlib import Path
1019 -sources = [
1021 - "id": "nuguland-popout-wrapper",
1022 - "family": "nuguland",
1023 - "path": "Nuguland design archive/nuguland-shell/modules/bar/popouts/Wrapper.qml",
1024 - "mechanic": "single popout state, escape close, animated implicit sizing",
1025 - "markers": ["PopoutState", "Keys.onEscapePressed", "implicitWidth: nonAnimWidth", "currentName"]
1026 - },
1028 - "id": "nuguland-notification-action-rail",
1029 - "family": "nuguland",
1030 - "path": "Nuguland design archive/nuguland-shell/modules/sidebar/NotifActionList.qml",
1031 - "mechanic": "masked horizontal notification action rail",
1032 - "markers": ["Mask", "Gradient.Horizontal", "isClose", "isCopy"]
1033 - },
1035 - "id": "nuguland-dashboard-hero-card",
1036 - "family": "nuguland",
1037 - "path": "Nuguland design archive/nuguland-shell/modules/dashboard/performance/HeroCard.qml",
1038 - "mechanic": "hero metric card with progress, shape state, and sublabel",
1039 - "markers": ["CircularProgress", "MaterialShape", "StyledProgressBar", "root.usage >= 0.8"]
1040 - },
1042 - "id": "nuguland-launcher-calc-item",
1043 - "family": "nuguland",
1044 - "path": "Nuguland design archive/nuguland-shell/modules/launcher/items/CalcItem.qml",
1045 - "mechanic": "calculator launcher row with primary copy and secondary open action",
1046 - "markers": ["Qalculator.evalAsync", "wl-copy", "StateLayer", "Open in calculator"]
1047 - },
1049 - "id": "nuguland-osd-content",
1050 - "family": "nuguland",
1051 - "path": "Nuguland design archive/nuguland-shell/modules/osd/Content.qml",
1052 - "mechanic": "stacked OSD sliders with wheel control and lazy visibility",
1053 - "markers": ["FilledSlider", "CustomMouseArea", "WrappedLoader", "onWheel"]
1054 - },
1056 - "id": "nuguland-area-picker",
1057 - "family": "nuguland",
1058 - "path": "Nuguland design archive/nuguland-shell/modules/areapicker/AreaPicker.qml",
1059 - "mechanic": "overlay screenshot picker with exclusive keyboard focus and per-screen surfaces",
1060 - "markers": ["LazyLoader", "WlrKeyboardFocus.Exclusive", "IpcHandler", "CustomShortcut"]
1061 - },
1063 - "id": "nuguland-workspace-stack",
1064 - "family": "nuguland",
1065 - "path": "Nuguland design archive/nuguland-shell/modules/bar/components/workspaces/Workspaces.qml",
1066 - "mechanic": "workspace stack with active indicator, occupancy background, and special state fade",
1067 - "markers": ["OccupiedBg", "ActiveIndicator", "groupOffset", "SpecialWorkspaces"]
1068 - },
1070 - "id": "nuguland-status-icons",
1071 - "family": "nuguland",
1072 - "path": "Nuguland design archive/nuguland-shell/modules/bar/components/StatusIcons.qml",
1073 - "mechanic": "animated compact status icon column with native service facts",
1074 - "markers": ["Quickshell.Bluetooth", "Quickshell.Services.UPower", "WrappedLoader", "MaterialIcon"]
1075 - },
1077 - "id": "nuguland-tray-item",
1078 - "family": "nuguland",
1079 - "path": "Nuguland design archive/nuguland-shell/modules/bar/components/TrayItem.qml",
1080 - "mechanic": "tray glyph routes primary and secondary native actions",
1081 - "markers": ["SystemTrayItem", "activate()", "secondaryActivate()", "ColouredIcon"]
1082 - },
1084 - "id": "nuguland-idle-inhibit-card",
1085 - "family": "nuguland",
1086 - "path": "Nuguland design archive/nuguland-shell/modules/utilities/cards/IdleInhibit.qml",
1087 - "mechanic": "keep-awake card with active chip and switch",
1088 - "markers": ["IdleInhibitor.enabled", "StyledSwitch", "Active since", "Behavior on implicitHeight"]
1089 - },
1091 - "id": "nuguland-popout-content-router",
1092 - "family": "nuguland",
1093 - "path": "Nuguland design archive/nuguland-shell/modules/bar/popouts/Content.qml",
1094 - "mechanic": "single named popout router with one active child and dynamic size",
1095 - "markers": ["currentPopout", "shouldBeActive", "sourceComponent", "implicitWidth"]
1096 - },
1098 - "id": "nuguland-audio-popout",
1099 - "family": "nuguland",
1100 - "path": "Nuguland design archive/nuguland-shell/modules/bar/popouts/Audio.qml",
1101 - "mechanic": "audio device radio groups with wheel-adjustable slider and detach action",
1102 - "markers": ["ButtonGroup", "Audio.sinks", "onWheel", "detachRequested"]
1103 - },
1105 - "id": "nuguland-network-popout",
1106 - "family": "nuguland",
1107 - "path": "Nuguland design archive/nuguland-shell/modules/bar/popouts/Network.qml",
1108 - "mechanic": "sorted wireless rows with connect state and password handoff",
1109 - "markers": ["connectingToSsid", "passwordNetwork", "Nmcli.networks", "NetworkConnection.handleConnect"]
1110 - },
1112 - "id": "nuguland-battery-popout",
1113 - "family": "nuguland",
1114 - "path": "Nuguland design archive/nuguland-shell/modules/bar/popouts/Battery.qml",
1115 - "mechanic": "battery time facts, power profile selector, and degradation warning",
1116 - "markers": ["timeToEmpty", "timeToFull", "PowerProfiles.profile", "Performance Degraded"]
1117 - },
1119 - "id": "nuguland-clip-wrapper",
1120 - "family": "nuguland",
1121 - "path": "Nuguland design archive/nuguland-shell/modules/bar/popouts/ClipWrapper.qml",
1122 - "mechanic": "clip wrapper offsets attached popouts and centers detached content",
1123 - "markers": ["offsetScale", "content.isDetached", "currentCenter", "Behavior on y"]
1124 - },
1126 - "id": "nuguland-dashboard-network-card",
1127 - "family": "nuguland",
1128 - "path": "Nuguland design archive/nuguland-shell/modules/dashboard/performance/NetworkCard.qml",
1129 - "mechanic": "dual upload/download sparkline card with adaptive max and collecting state",
1130 - "markers": ["NetworkUsage.uploadBuffer", "NetworkUsage.downloadBuffer", "smoothMax", "Collecting data"]
1131 - },
1133 - "id": "nuguland-quick-sliders",
1134 - "family": "Nuguland",
1135 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/ii/sidebarRight/QuickSliders.qml",
1136 - "mechanic": "quick sliders with embedded icons, stop indicators, and moved callbacks",
1137 - "markers": ["QuickSlider", "stopIndicatorValues", "dividerValues", "onMoved"]
1138 - },
1140 - "id": "Nuguland-audio-mixer",
1141 - "family": "Nuguland",
1142 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/bar/audio/Mixer.qml",
1143 - "mechanic": "PipeWire mixer tracks linked app streams below the active node",
1144 - "markers": ["PwNodeLinkTracker", "PwObjectTracker", "MixerEntry", "linkGroups"]
1145 - },
1147 - "id": "nuguland-config-toasts",
1148 - "family": "nuguland",
1149 - "path": "Nuguland design archive/nuguland-shell/modules/ConfigToasts.qml",
1150 - "mechanic": "service-originated warning/error toasts for configuration load failures",
1151 - "markers": ["onLoadFailed", "onUnknownOption", "Toaster.toast", "Toast.Warning"]
1152 - },
1154 - "id": "nuguland-battery-monitor",
1155 - "family": "nuguland",
1156 - "path": "Nuguland design archive/nuguland-shell/modules/BatteryMonitor.qml",
1157 - "mechanic": "battery warning thresholds reset on charging and trigger critical action timer",
1158 - "markers": ["warnLevels", "onOnBatteryChanged", "hibernateTimer", "UPower.displayDevice"]
1159 - },
1161 - "id": "nuguland-idle-monitors",
1162 - "family": "nuguland",
1163 - "path": "Nuguland design archive/nuguland-shell/modules/IdleMonitors.qml",
1164 - "mechanic": "logind sleep/lock hooks plus multiple inhibitor-respecting idle timers",
1165 - "markers": ["LogindManager", "IdleMonitor", "respectInhibitors", "onAboutToSleep"]
1166 - },
1168 - "id": "nuguland-quick-toggles",
1169 - "family": "nuguland",
1170 - "path": "Nuguland design archive/nuguland-shell/modules/utilities/cards/Toggles.qml",
1171 - "mechanic": "deduped quick-toggle rows with service-owned Wi-Fi, Bluetooth, mic, DND, VPN, and game mode actions",
1172 - "markers": ["quickToggles", "DelegateChooser", "roleValue: \"dnd\"", "shapeMorph: true"]
1173 - },
1175 - "id": "nuguland-notif-dock",
1176 - "family": "nuguland",
1177 - "path": "Nuguland design archive/nuguland-shell/modules/sidebar/NotifDock.qml",
1178 - "mechanic": "notification dock count title, empty state, and clipped scroll list",
1179 - "markers": ["notifCount", "All up to date!", "StyledFlickable", "NotifDockList"]
1180 - },
1182 - "id": "nuguland-window-buttons",
1183 - "family": "nuguland",
1184 - "path": "Nuguland design archive/nuguland-shell/modules/windowinfo/Buttons.qml",
1185 - "mechanic": "window action card with expandable workspace grid and destructive close row",
1186 - "markers": ["moveToWsExpanded", "GridLayout", "Tile", "Kill"]
1187 - },
1189 - "id": "nuguland-waffle-action-center",
1190 - "family": "Nuguland",
1191 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/waffle/actionCenter/ActionCenterContent.qml",
1192 - "mechanic": "bar-attached action center with media pane and stack-view main page",
1193 - "markers": ["WBarAttachedPanelContent", "barAtBottom", "MediaPaneContent", "WStackView"]
1194 - },
1196 - "id": "nuguland-region-selection-panel",
1197 - "family": "Nuguland",
1198 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/waffle/screenSnip/WRegionSelectionPanel.qml",
1199 - "mechanic": "screen snip overlay with media/action modes, rectangle/window selection, and toolbar tabs",
1200 - "markers": ["enum MediaType", "enum SelectionMode", "DragManager", "WRectangularSelection"]
1201 - },
1203 - "id": "Nuguland-flickable-notification",
1204 - "family": "Nuguland",
1205 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/notifications/FlickableNotification.qml",
1206 - "mechanic": "notification drag physics states for return, fling, dismiss, discard, and overlap",
1207 - "markers": ["enum FlingState", "FlickMonitor", "playDismiss", "playDiscard"]
1208 - },
1210 - "id": "Nuguland-screenshot-controller",
1211 - "family": "Nuguland",
1212 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/screenshot/Controller.qml",
1213 - "mechanic": "cross-screen normalized screenshot selection model and exclusive overlay",
1214 - "markers": ["normalizedScreenRect", "WlrKeyboardFocus.Exclusive", "selection.normal", "LazyLoader"]
1215 - },
1217 - "id": "Nuguland-tray-menu-view",
1218 - "family": "Nuguland",
1219 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/bar/systray/MenuView.qml",
1220 - "mechanic": "DBus tray menu view keeps one submenu expanded and tracks animating row",
1221 - "markers": ["QsMenuOpener", "submenuExpanded", "modelData.isSeparator", "animatingItem"]
1222 - },
1224 - "id": "nuguland-lock-content",
1225 - "family": "nuguland",
1226 - "path": "Nuguland design archive/nuguland-shell/modules/lock/Content.qml",
1227 - "mechanic": "lock layout balances weather/fetch/media, center auth, resources, and notification dock",
1228 - "markers": ["WeatherInfo", "Fetch", "Center", "NotifDock"]
1229 - },
1231 - "id": "nuguland-lock-password-input",
1232 - "family": "nuguland",
1233 - "path": "Nuguland design archive/nuguland-shell/modules/lock/center/PasswordInput.qml",
1234 - "mechanic": "focused password input routes all keys to PAM and morphs enter affordance by buffer state",
1235 - "markers": ["Keys.onPressed", "lock.pam.handleKey", "StateLayer", "passwd.start"]
1236 - },
1238 - "id": "nuguland-lock-notif-group",
1239 - "family": "nuguland",
1240 - "path": "Nuguland design archive/nuguland-shell/modules/lock/NotifGroup.qml",
1241 - "mechanic": "lockscreen notification group computes urgency, icon/image precedence, and expansion state",
1242 - "markers": ["NotificationUrgency.Critical", "property bool expanded", "ClippingRectangle", "Quickshell.iconPath"]
1243 - },
1245 - "id": "nuguland-session-wrapper",
1246 - "family": "nuguland",
1247 - "path": "Nuguland design archive/nuguland-shell/modules/session/Wrapper.qml",
1248 - "mechanic": "session drawer wrapper retains content while offset animates beside sidebar",
1249 - "markers": ["shouldBeActive", "offsetScale", "sidebarOffset", "Config.session.enabled"]
1250 - },
1252 - "id": "nuguland-session-content",
1253 - "family": "nuguland",
1254 - "path": "Nuguland design archive/nuguland-shell/modules/session/Content.qml",
1255 - "mechanic": "keyboard-first session action column with escape close and directional navigation",
1256 - "markers": ["SessionButton", "KeyNavigation.down", "Keys.onEscapePressed", "Quickshell.execDetached"]
1257 - },
1259 - "id": "nuguland-polkit-shell",
1260 - "family": "Nuguland",
1261 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/ii/polkit/Polkit.qml",
1262 - "mechanic": "fullscreen Polkit shell wraps prompt content in a dedicated security surface",
1263 - "markers": ["FullscreenPolkitWindow", "contentComponent", "PolkitContent", "Quickshell.Wayland"]
1264 - },
1266 - "id": "nuguland-polkit-content",
1267 - "family": "Nuguland",
1268 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/ii/polkit/PolkitContent.qml",
1269 - "mechanic": "Polkit dialog scrim, security icon, prompt cleanup, cancel, and submit actions",
1270 - "markers": ["PolkitService.cancel", "PolkitService.submit", "responseVisible", "WindowDialog"]
1271 - },
1273 - "id": "nuguland-polkit-service",
1274 - "family": "Nuguland",
1275 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/services/PolkitService.qml",
1276 - "mechanic": "native PolkitAgent service cleans message/prompt and gates interaction availability",
1277 - "markers": ["PolkitAgent", "onAuthenticationRequestStarted", "cleanPrompt", "submit(string"]
1278 - },
1280 - "id": "Nuguland-lock-controller",
1281 - "family": "Nuguland",
1282 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/lock/Controller.qml",
1283 - "mechanic": "session lock controller coordinates WlSessionLock, slide animation, and delayed surface teardown",
1284 - "markers": ["WlSessionLock", "lockSlide", "workspaceLockAnimation", "SessionLockContext"]
1285 - },
1287 - "id": "Nuguland-session-lock-context",
1288 - "family": "Nuguland",
1289 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/lock/SessionLockContext.qml",
1290 - "mechanic": "PAM session context owns password attempts, error reset, unlocking state, and success signal",
1291 - "markers": ["PamContext", "onPamMessage", "PamResult.Success", "root.unlocked"]
1292 - },
1294 - "id": "nuguland-styled-text",
1295 - "family": "nuguland",
1296 - "path": "Nuguland design archive/nuguland-shell/components/StyledText.qml",
1297 - "mechanic": "native-rendered plain text primitive with optional fade-through text changes",
1298 - "markers": ["renderType: Text.NativeRendering", "textFormat: Text.PlainText", "Behavior on text", "SequentialAnimation"]
1299 - },
1301 - "id": "nuguland-icon-button",
1302 - "family": "nuguland",
1303 - "path": "Nuguland design archive/nuguland-shell/components/controls/IconButton.qml",
1304 - "mechanic": "icon button maps filled/tonal/text states to semantic colours and animated icon fill",
1305 - "markers": ["ButtonBase", "MaterialIcon", "Behavior on fill", "implicitWidth: implicitHeight"]
1306 - },
1308 - "id": "nuguland-split-button",
1309 - "family": "nuguland",
1310 - "path": "Nuguland design archive/nuguland-shell/components/controls/SplitButton.qml",
1311 - "mechanic": "split primary/menu button with shared active item text/icon and expanding chevron half",
1312 - "markers": ["property alias menuItems", "StateLayer", "expandIcon", "Behavior on rotation"]
1313 - },
1315 - "id": "nuguland-styled-slider",
1316 - "family": "nuguland",
1317 - "path": "Nuguland design archive/nuguland-shell/components/controls/StyledSlider.qml",
1318 - "mechanic": "slider primitive with shaped handle, remaining track, optional wavy filled track, and interaction signal",
1319 - "markers": ["property bool wavy", "signal interaction", "WavyLine", "onPositionChanged"]
1320 - },
1322 - "id": "nuguland-toggle-row",
1323 - "family": "nuguland",
1324 - "path": "Nuguland design archive/nuguland-shell/components/controls/ToggleRow.qml",
1325 - "mechanic": "label plus switch row for dense service toggles",
1326 - "markers": ["required property string label", "StyledSwitch", "Layout.fillWidth", "property alias checked"]
1327 - },
1329 - "id": "nuguland-vertical-fade-flickable",
1330 - "family": "nuguland",
1331 - "path": "Nuguland design archive/nuguland-shell/components/containers/VerticalFadeFlickable.qml",
1332 - "mechanic": "vertical list fade mask reacts to visible area and overshoot rebound",
1333 - "markers": ["fadeShouldBeActive", "Gradient.Vertical", "topFadeOpacity", "bottomFadeOpacity"]
1334 - },
1336 - "id": "nuguland-elevation",
1337 - "family": "nuguland",
1338 - "path": "Nuguland design archive/nuguland-shell/components/effects/Elevation.qml",
1339 - "mechanic": "elevation shadow derives blur, spread, and y-offset from a bounded level table",
1340 - "markers": ["RectangularShadow", "property int level", "spread:", "Behavior on dp"]
1341 - },
1343 - "id": "nuguland-ripple-button",
1344 - "family": "Nuguland",
1345 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/common/widgets/RippleButton.qml",
1346 - "mechanic": "ripple button supports press/release/alt/middle actions and pointer-origin ripple radius",
1347 - "markers": ["startRipple", "acceptedButtons", "altAction", "middleClickAction"]
1348 - },
1350 - "id": "nuguland-section-container",
1351 - "family": "nuguland",
1352 - "path": "Nuguland design archive/nuguland-shell/components/SectionContainer.qml",
1353 - "mechanic": "surface section cards wrap arbitrary content in one semantic rounded container with fixed padding and spacing",
1354 - "markers": ["default property alias content", "contentSpacing", "Layout.fillWidth", "ColumnLayout"]
1355 - },
1357 - "id": "nuguland-section-header",
1358 - "family": "nuguland",
1359 - "path": "Nuguland design archive/nuguland-shell/components/SectionHeader.qml",
1360 - "mechanic": "section headers pair strong titles with optional muted descriptions",
1361 - "markers": ["required property string title", "property string description", "Font.Medium", "visible: root.description !== \"\""]
1362 - },
1364 - "id": "nuguland-property-row",
1365 - "family": "nuguland",
1366 - "path": "Nuguland design archive/nuguland-shell/components/PropertyRow.qml",
1367 - "mechanic": "property rows show label/value facts with optional top spacing for diagnostic panels",
1368 - "markers": ["required property string label", "required property string value", "showTopMargin", "font: Tokens.font.body.small"]
1369 - },
1371 - "id": "nuguland-styled-text-field",
1372 - "family": "nuguland",
1373 - "path": "Nuguland design archive/nuguland-shell/components/controls/StyledTextField.qml",
1374 - "mechanic": "plain text field uses native rendering, a custom animated cursor, and focus-aware blink suppression",
1375 - "markers": ["TextField", "cursorDelegate", "disableBlink", "renderType"]
1376 - },
1378 - "id": "nuguland-menu",
1379 - "family": "nuguland",
1380 - "path": "Nuguland design archive/nuguland-shell/components/controls/Menu.qml",
1381 - "mechanic": "attached menu maps itself reactively to an anchor, closes on outside click, and animates vertical expansion from the selected edge",
1382 - "markers": ["TransformWatcher", "signal itemSelected", "root.expanded", "StateLayer"]
1383 - },
1385 - "id": "nuguland-menu-item",
1386 - "family": "nuguland",
1387 - "path": "Nuguland design archive/nuguland-shell/components/controls/MenuItem.qml",
1388 - "mechanic": "menu item data object separates inactive/active text and icon roles from click execution",
1389 - "markers": ["required property string text", "property string trailingIcon", "property string activeText", "signal clicked"]
1390 - },
1392 - "id": "nuguland-loading-indicator",
1393 - "family": "nuguland",
1394 - "path": "Nuguland design archive/nuguland-shell/components/controls/LoadingIndicator.qml",
1395 - "mechanic": "loading indicator cycles Material shapes with a bounded spring morph and independent continuous rotation",
1396 - "markers": ["MaterialShape.SoftBurst", "springDuration", "FrameAnimation", "RotationAnimation on cRotation"]
1397 - },
1399 - "id": "nuguland-inner-border",
1400 - "family": "nuguland",
1401 - "path": "Nuguland design archive/nuguland-shell/components/effects/InnerBorder.qml",
1402 - "mechanic": "inner border uses an inverted mask effect for inset outlines without external decoration helpers",
1403 - "markers": ["MultiEffect", "maskInverted", "maskInner", "property alias thickness"]
1404 - },
1406 - "id": "nuguland-launcher-content",
1407 - "family": "nuguland",
1408 - "path": "Nuguland design archive/nuguland-shell/modules/launcher/Content.qml",
1409 - "mechanic": "bottom-docked launcher search field owns keyboard navigation, accept routing, clear affordance, and session refocus",
1410 - "markers": ["StyledTextField", "Keys.onUpPressed", "onAccepted", "clearIcon"]
1411 - },
1413 - "id": "nuguland-launcher-app-list",
1414 - "family": "nuguland",
1415 - "path": "Nuguland design archive/nuguland-shell/modules/launcher/AppList.qml",
1416 - "mechanic": "launcher app list switches providers by prefix with animated delegate/model transition and moving highlight",
1417 - "markers": ["preferredHighlightBegin", "highlightFollowsCurrentItem", "state:", "Actions.query"]
1418 - },
1420 - "id": "nuguland-launcher-action-item",
1421 - "family": "nuguland",
1422 - "path": "Nuguland design archive/nuguland-shell/modules/launcher/items/ActionItem.qml",
1423 - "mechanic": "launcher action rows expose icon, title, description, and service-owned click callback",
1424 - "markers": ["required property var modelData", "StateLayer", "modelData?.onClicked", "modelData?.desc"]
1425 - },
1427 - "id": "nuguland-waffle-start-menu",
1428 - "family": "Nuguland",
1429 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/waffle/startMenu/WaffleStartMenu.qml",
1430 - "mechanic": "start menu shell owns open/close IPC, prefix toggles, release interrupt, and private panel loader",
1431 - "markers": ["target: \"search\"", "toggleClipboard", "toggleReleaseInterrupt", "GlobalShortcut"]
1432 - },
1434 - "id": "nuguland-search-results",
1435 - "family": "Nuguland",
1436 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/waffle/startMenu/searchPage/SearchResults.qml",
1437 - "mechanic": "categorized search results cap rows per category and keep a side preview panel in sync",
1438 - "markers": ["maxResultsPerCategory", "ResultPreview", "ViewSection.InlineLabels", "Best match"]
1439 - },
1441 - "id": "nuguland-task-view-content",
1442 - "family": "Nuguland",
1443 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/waffle/taskView/TaskViewContent.qml",
1444 - "mechanic": "task view arranges active workspace windows into bounded rows with open/close progress and draggable previews",
1445 - "markers": ["openProgress", "arrangedToplevels", "WindowLayout.scaleWindow", "TaskViewWindow"]
1446 - },
1448 - "id": "Nuguland-launcher-controller",
1449 - "family": "Nuguland",
1450 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/launcher/Controller.qml",
1451 - "mechanic": "launcher controller persists open state, exposes IPC open/close/toggle, lazy-loads one centered content surface, and closes on outside press",
1452 - "markers": ["PersistentProperties", "target: \"launcher\"", "activeAsync", "onPressed: persist.launcherOpen = false"]
1453 - },
1455 - "id": "Nuguland-launch-content",
1456 - "family": "Nuguland",
1457 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/launcher/LaunchContent.qml",
1458 - "mechanic": "fuzzy launch content filters desktop entries by ordered character spans and keeps keyboard focus on list navigation",
1459 - "markers": ["DesktopEntries.applications", "matches.push", "Keys.forwardTo", "cacheBuffer: 0"]
1460 - },
1462 - "id": "nuguland-nexus-searchbar",
1463 - "family": "nuguland",
1464 - "path": "Nuguland design archive/nuguland-shell/modules/nexus/navpane/SearchBar.qml",
1465 - "mechanic": "rounded search field with explicit open state and clear affordance",
1466 - "markers": ["StyledTextField", "Search settings", "searchOpen", "IconButton"]
1467 - },
1469 - "id": "nuguland-drawers-contentwindow",
1470 - "family": "nuguland",
1471 - "path": "Nuguland design archive/nuguland-shell/modules/drawers/ContentWindow.qml",
1472 - "mechanic": "screen-edge drawer surface with dynamic pointer mask and full-screen suppression",
1473 - "markers": ["dragMaskPadding", "fsTransitionProg", "mask: hasFullscreen ? emptyRegion : regions", "onHasFullscreenChanged"]
1474 - },
1476 - "id": "nuguland-window-info",
1477 - "family": "nuguland",
1478 - "path": "Nuguland design archive/nuguland-shell/modules/windowinfo/WindowInfo.qml",
1479 - "mechanic": "window preview with details card and action row",
1480 - "markers": ["Preview", "Details", "Buttons", "implicitHeight: screen.height"]
1481 - },
1483 - "id": "nuguland-shortcuts-scope",
1484 - "family": "nuguland",
1485 - "path": "Nuguland design archive/nuguland-shell/modules/Shortcuts.qml",
1486 - "mechanic": "central shortcut surface router with press/release interruption semantics",
1487 - "markers": ["CustomShortcut", "launcherInterrupted", "IpcHandler", "function toggle(drawer"]
1488 - },
1490 - "id": "nuguland-cheatsheet",
1491 - "family": "Nuguland",
1492 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/ii/cheatsheet/Cheatsheet.qml",
1493 - "mechanic": "dismissable keyboard cheatsheet with tabbed sections and Escape close",
1494 - "markers": ["tabButtonList", "GlobalFocusGrab.addDismissable", "Keys.onPressed", "Key_Escape"]
1495 - },
1497 - "id": "Nuguland-tooltip-hang",
1498 - "family": "Nuguland",
1499 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/bar/Tooltip.qml",
1500 - "mechanic": "tooltip/menu hang-time retention with one masked popup window",
1501 - "markers": ["activeTooltip", "hangTimer", "PopupWindow", "visibleMask"]
1502 - },
1504 - "id": "nuguland-scroll-hint",
1505 - "family": "Nuguland",
1506 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/ii/bar/ScrollHint.qml",
1507 - "mechanic": "delayed hover scroll hint with stacked chevrons and tooltip",
1508 - "markers": ["Revealer", "Timer", "PopupToolTip", "keyboard_arrow_up"]
1509 - },
1511 - "id": "nuguland-graph",
1512 - "family": "Nuguland",
1513 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/common/widgets/Graph.qml",
1514 - "mechanic": "bounded canvas sparkline with alignment and fill opacity",
1515 - "markers": ["Canvas", "fillOpacity", "Alignment", "ctx.lineTo"]
1516 - },
1518 - "id": "nuguland-session-screen",
1519 - "family": "Nuguland",
1520 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/ii/sessionScreen/SessionScreen.qml",
1521 - "mechanic": "exclusive full-screen session overlay with keyboard grid navigation",
1522 - "markers": ["WlrKeyboardFocus.Exclusive", "Arrow keys to navigate", "KeyNavigation", "sessionRoot.hide"]
1523 - },
1525 - "id": "nuguland-revealer",
1526 - "family": "Nuguland",
1527 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/common/widgets/Revealer.qml",
1528 - "mechanic": "width/height reveal without layout jump",
1529 - "markers": ["clip: true", "Behavior on implicitWidth", "Behavior on implicitHeight"]
1530 - },
1532 - "id": "Nuguland-fullwidth-mousearea",
1533 - "family": "Nuguland",
1534 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/bar/FullwidthMouseArea.qml",
1535 - "mechanic": "widened bar hit geometry with wheel pass-through",
1536 - "markers": ["fillWindowWidth", "event.accepted = false", "signal wheel", "extraVerticalMargin"]
1537 - },
1539 - "id": "Nuguland-mpris-controller",
1540 - "family": "Nuguland",
1541 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/bar/mpris/MprisController.qml",
1542 - "mechanic": "MPRIS active-player election and reverse track direction",
1543 - "markers": ["Mpris.players", "trackChanged(reverse", "__reverse", "setActivePlayer"]
1544 - },
1546 - "id": "Nuguland-slideview",
1547 - "family": "Nuguland",
1548 - "path": "Nuguland design archive/Nuguland/modules/user/modules/quickshell/shell/SlideView.qml",
1549 - "mechanic": "active pending removing page lifecycle",
1550 - "markers": ["pendingItem", "removingItems", "finishPending", "replace(component"]
1551 - },
1553 - "id": "nuguland-clocknumber",
1554 - "family": "nuguland",
1555 - "path": "Nuguland design archive/nuguland/quickshell/components/bar/ClockNumber.qml",
1556 - "mechanic": "vertical digit roll",
1557 - "markers": ["Canvas", "toNum", "Behavior on textY", "OutQuint"]
1558 - },
1560 -rows = []
1561 -for source in sources:
1562 - text = Path(source["path"]).read_text(errors="replace")
1563 - missing = [marker for marker in source["markers"] if marker not in text]
1564 - if missing:
1565 - raise SystemExit(f"missing markers for {source['id']}: {missing}")
1566 - rows.append({
1567 - "id": source["id"],
1568 - "family": source["family"],
1569 - "path": source["path"],
1570 - "mechanic": source["mechanic"],
1571 - "sha256": hashlib.sha256(text.encode()).hexdigest(),
1572 - "markerCount": len(source["markers"]),
1573 - "lineCount": text.count("\n") + 1,
1574 - })
1575 -print(json.dumps({
1576 - "referenceSourceFingerprints": True,
1577 - "barWorkflowReferenceCoverage": True,
1578 - "surfaceWorkflowReferenceCoverage": True,
1579 - "popoutDetailReferenceCoverage": True,
1580 - "serviceInteractionReferenceCoverage": True,
1581 - "securitySessionReferenceCoverage": True,
1582 - "primitiveReferenceCoverage": True,
1583 - "launcherOverviewReferenceCoverage": True,
1584 - "componentScaffoldReferenceCoverage": True,
1585 - "sourceFamilies": ["nuguland", "Nuguland", "Nuguland", "nuguland"],
1586 - "rows": rows,
1587 -}, separators=(",", ":")))
1590 -printf 'reference_source_fingerprints=%s\n' "$reference_source_fingerprints"
1591 -REFERENCE_SOURCE_FINGERPRINTS="$reference_source_fingerprints" python - <<'PY'
1592 -import json, os
1593 -proof = json.loads(os.environ["REFERENCE_SOURCE_FINGERPRINTS"])
1594 -assert proof["referenceSourceFingerprints"] is True
1595 -assert proof["barWorkflowReferenceCoverage"] is True
1596 -assert proof["surfaceWorkflowReferenceCoverage"] is True
1597 -assert proof["popoutDetailReferenceCoverage"] is True
1598 -assert proof["serviceInteractionReferenceCoverage"] is True
1599 -assert proof["securitySessionReferenceCoverage"] is True
1600 -assert proof["primitiveReferenceCoverage"] is True
1601 -assert proof["launcherOverviewReferenceCoverage"] is True
1602 -assert proof["componentScaffoldReferenceCoverage"] is True
1603 -assert proof["sourceFamilies"] == ["nuguland", "Nuguland", "Nuguland", "nuguland"]
1604 -assert [row["id"] for row in proof["rows"]] == ["nuguland-popout-wrapper", "nuguland-notification-action-rail", "nuguland-dashboard-hero-card", "nuguland-launcher-calc-item", "nuguland-osd-content", "nuguland-area-picker", "nuguland-workspace-stack", "nuguland-status-icons", "nuguland-tray-item", "nuguland-idle-inhibit-card", "nuguland-popout-content-router", "nuguland-audio-popout", "nuguland-network-popout", "nuguland-battery-popout", "nuguland-clip-wrapper", "nuguland-dashboard-network-card", "nuguland-quick-sliders", "Nuguland-audio-mixer", "nuguland-config-toasts", "nuguland-battery-monitor", "nuguland-idle-monitors", "nuguland-quick-toggles", "nuguland-notif-dock", "nuguland-window-buttons", "nuguland-waffle-action-center", "nuguland-region-selection-panel", "Nuguland-flickable-notification", "Nuguland-screenshot-controller", "Nuguland-tray-menu-view", "nuguland-lock-content", "nuguland-lock-password-input", "nuguland-lock-notif-group", "nuguland-session-wrapper", "nuguland-session-content", "nuguland-polkit-shell", "nuguland-polkit-content", "nuguland-polkit-service", "Nuguland-lock-controller", "Nuguland-session-lock-context", "nuguland-styled-text", "nuguland-icon-button", "nuguland-split-button", "nuguland-styled-slider", "nuguland-toggle-row", "nuguland-vertical-fade-flickable", "nuguland-elevation", "nuguland-ripple-button", "nuguland-section-container", "nuguland-section-header", "nuguland-property-row", "nuguland-styled-text-field", "nuguland-menu", "nuguland-menu-item", "nuguland-loading-indicator", "nuguland-inner-border", "nuguland-launcher-content", "nuguland-launcher-app-list", "nuguland-launcher-action-item", "nuguland-waffle-start-menu", "nuguland-search-results", "nuguland-task-view-content", "Nuguland-launcher-controller", "Nuguland-launch-content", "nuguland-nexus-searchbar", "nuguland-drawers-contentwindow", "nuguland-window-info", "nuguland-shortcuts-scope", "nuguland-cheatsheet", "Nuguland-tooltip-hang", "nuguland-scroll-hint", "nuguland-graph", "nuguland-session-screen", "nuguland-revealer", "Nuguland-fullwidth-mousearea", "Nuguland-mpris-controller", "Nuguland-slideview", "nuguland-clocknumber"]
1605 -assert proof["rows"][0]["markerCount"] == 4
1606 -assert len(proof["rows"]) == 77
1607 -assert {row["family"] for row in proof["rows"]} == {"nuguland", "Nuguland", "Nuguland", "nuguland"}
1608 -assert all(len(row["sha256"]) == 64 for row in proof["rows"])
1609 -assert all(row["lineCount"] > 10 for row in proof["rows"])
1611 -reference_adoption_matrix=$(
1612 - REFERENCE_SOURCE_FINGERPRINTS="$reference_source_fingerprints" python - <<'PY'
1613 -import json
1614 -import os
1616 -proof = json.loads(os.environ["REFERENCE_SOURCE_FINGERPRINTS"])
1617 -source_ids = [row["id"] for row in proof["rows"]]
1618 -adoptions = {
1619 - "nuguland-popout-wrapper": {"nugulandOwner": "PopoutHost.qml", "runtimeContract": "cardMorphFrame", "proofMarker": "popout_region_visual"},
1620 - "nuguland-notification-action-rail": {"nugulandOwner": "PopoutHost.qml inline NotificationGroup", "runtimeContract": "notificationPanelContract", "proofMarker": "notifications_state"},
1621 - "nuguland-dashboard-hero-card": {"nugulandOwner": "PopoutHost.qml inline DashboardPanel", "runtimeContract": "resourceHeroCard", "proofMarker": "resource_hero_card"},
1622 - "nuguland-launcher-calc-item": {"nugulandOwner": "Launcher.qml", "runtimeContract": "launcherPreviewPanel", "proofMarker": "launcher_state"},
1623 - "nuguland-osd-content": {"nugulandOwner": "Osd.qml", "runtimeContract": "valueIndicator", "proofMarker": "osd_state"},
1624 - "nuguland-area-picker": {"nugulandOwner": "PopoutHost.qml inline ScreenshotsPanel", "runtimeContract": "screenshotsPanelContract", "proofMarker": "screenshots_state"},
1625 - "nuguland-workspace-stack": {"nugulandOwner": "Bar.qml", "runtimeContract": "niriWorkspaceStack", "proofMarker": "niri_state"},
1626 - "nuguland-status-icons": {"nugulandOwner": "Bar.qml", "runtimeContract": "serviceStatusIcons", "proofMarker": "diagnostics_state"},
1627 - "nuguland-tray-item": {"nugulandOwner": "Bar.qml", "runtimeContract": "nativeTrayActions", "proofMarker": "tray_state"},
1628 - "nuguland-idle-inhibit-card": {"nugulandOwner": "PopoutHost.qml inline IdlePanel", "runtimeContract": "idlePanelContract", "proofMarker": "idle_state"},
1629 - "nuguland-popout-content-router": {"nugulandOwner": "PopoutHost.qml", "runtimeContract": "activeLoaderName", "proofMarker": "popout_region_visual"},
1630 - "nuguland-audio-popout": {"nugulandOwner": "PopoutHost.qml inline AudioPanel", "runtimeContract": "audioPanelContract", "proofMarker": "audio_state"},
1631 - "nuguland-network-popout": {"nugulandOwner": "PopoutHost.qml inline ConnectivityPanel", "runtimeContract": "networkPanelContract", "proofMarker": "network_state"},
1632 - "nuguland-battery-popout": {"nugulandOwner": "PopoutHost.qml inline PowerPanel", "runtimeContract": "powerPanelContract", "proofMarker": "power_state"},
1633 - "nuguland-clip-wrapper": {"nugulandOwner": "PopoutHost.qml", "runtimeContract": "cardMorphFrame", "proofMarker": "popout_region_visual"},
1634 - "nuguland-dashboard-network-card": {"nugulandOwner": "PopoutHost.qml inline DashboardPanel", "runtimeContract": "resourceHeroCard", "proofMarker": "resource_hero_card"},
1635 - "nuguland-quick-sliders": {"nugulandOwner": "PopoutHost.qml inline AudioPanel", "runtimeContract": "valueIndicator", "proofMarker": "audio_state"},
1636 - "Nuguland-audio-mixer": {"nugulandOwner": "PopoutHost.qml inline AudioPanel", "runtimeContract": "audioPanelContract", "proofMarker": "audio_state"},
1637 - "nuguland-config-toasts": {"nugulandOwner": "Notifications.qml", "runtimeContract": "nativeActionRoute", "proofMarker": "notifications_state"},
1638 - "nuguland-battery-monitor": {"nugulandOwner": "Power.qml", "runtimeContract": "powerPanelContract", "proofMarker": "power_state"},
1639 - "nuguland-idle-monitors": {"nugulandOwner": "Idle.qml", "runtimeContract": "idlePanelContract", "proofMarker": "idle_state"},
1640 - "nuguland-quick-toggles": {"nugulandOwner": "PopoutHost.qml inline DashboardPanel", "runtimeContract": "quickControls", "proofMarker": "dashboard_state"},
1641 - "nuguland-notif-dock": {"nugulandOwner": "PopoutHost.qml inline NotificationGroup", "runtimeContract": "notificationPanelContract", "proofMarker": "notifications_state"},
1642 - "nuguland-window-buttons": {"nugulandOwner": "PopoutHost.qml inline WindowPanel", "runtimeContract": "windowCardShape", "proofMarker": "window_card_state"},
1643 - "nuguland-waffle-action-center": {"nugulandOwner": "PopoutHost.qml inline DashboardPanel", "runtimeContract": "dashboardPanelContract", "proofMarker": "dashboard_state"},
1644 - "nuguland-region-selection-panel": {"nugulandOwner": "PopoutHost.qml inline ScreenshotsPanel", "runtimeContract": "screenshotsPanelContract", "proofMarker": "screenshots_state"},
1645 - "Nuguland-flickable-notification": {"nugulandOwner": "Notifications.qml", "runtimeContract": "dragDismissContract", "proofMarker": "notifications_state"},
1646 - "Nuguland-screenshot-controller": {"nugulandOwner": "Screenshots.qml", "runtimeContract": "normalized-cross-screen-rect", "proofMarker": "screenshots_state"},
1647 - "Nuguland-tray-menu-view": {"nugulandOwner": "PopoutHost.qml inline TrayPanel", "runtimeContract": "trayMenuModel", "proofMarker": "tray_state"},
1648 - "nuguland-lock-content": {"nugulandOwner": "Lock.qml inline LockSurface", "runtimeContract": "lockSurfacePanelContract", "proofMarker": "lock_state"},
1649 - "nuguland-lock-password-input": {"nugulandOwner": "Lock.qml", "runtimeContract": "nativePamRoute", "proofMarker": "lock_state"},
1650 - "nuguland-lock-notif-group": {"nugulandOwner": "Lock.qml inline LockSurface", "runtimeContract": "lockNotificationDock", "proofMarker": "lock_state"},
1651 - "nuguland-session-wrapper": {"nugulandOwner": "PopoutHost.qml inline PowerPanel", "runtimeContract": "powerPanelContract", "proofMarker": "power_state"},
1652 - "nuguland-session-content": {"nugulandOwner": "Power.qml", "runtimeContract": "sessionActionRoute", "proofMarker": "power_state"},
1653 - "nuguland-polkit-shell": {"nugulandOwner": "shell.qml inline PrivilegeSurface", "runtimeContract": "privilegeSurfacePanelContract", "proofMarker": "privilege_state"},
1654 - "nuguland-polkit-content": {"nugulandOwner": "shell.qml inline PrivilegeSurface", "runtimeContract": "privilegeSurfacePanelContract", "proofMarker": "privilege_state"},
1655 - "nuguland-polkit-service": {"nugulandOwner": "Privilege.qml", "runtimeContract": "nativePolkitRoute", "proofMarker": "privilege_state"},
1656 - "Nuguland-lock-controller": {"nugulandOwner": "Lock.qml", "runtimeContract": "nativeSessionLockRoute", "proofMarker": "lock_state"},
1657 - "Nuguland-session-lock-context": {"nugulandOwner": "Lock.qml", "runtimeContract": "nativePamRoute", "proofMarker": "lock_state"},
1658 - "nuguland-styled-text": {"nugulandOwner": "inline NuguText components", "runtimeContract": "semanticTextPrimitive", "proofMarker": "diagnostics_state"},
1659 - "nuguland-icon-button": {"nugulandOwner": "Bar.qml", "runtimeContract": "clickablePrimitive", "proofMarker": "diagnostics_state"},
1660 - "nuguland-split-button": {"nugulandOwner": "Bar.qml", "runtimeContract": "splitActionPrimitive", "proofMarker": "diagnostics_state"},
1661 - "nuguland-styled-slider": {"nugulandOwner": "PopoutHost.qml inline AudioPanel", "runtimeContract": "valueIndicator", "proofMarker": "audio_state"},
1662 - "nuguland-toggle-row": {"nugulandOwner": "PopoutHost.qml inline DashboardPanel", "runtimeContract": "quickControls", "proofMarker": "dashboard_state"},
1663 - "nuguland-vertical-fade-flickable": {"nugulandOwner": "Bar.qml", "runtimeContract": "scrollableListChrome", "proofMarker": "diagnostics_state"},
1664 - "nuguland-elevation": {"nugulandOwner": "Theme.qml", "runtimeContract": "elevationShadowPrimitive", "proofMarker": "diagnostics_state"},
1665 - "nuguland-ripple-button": {"nugulandOwner": "Bar.qml", "runtimeContract": "clickablePrimitive", "proofMarker": "diagnostics_state"},
1666 - "nuguland-section-container": {"nugulandOwner": "PopoutHost.qml inline DashboardPanel", "runtimeContract": "sectionCardPrimitive", "proofMarker": "dashboard_state"},
1667 - "nuguland-section-header": {"nugulandOwner": "PopoutHost.qml inline DiagnosticsPanel", "runtimeContract": "sectionHeaderPrimitive", "proofMarker": "diagnostics_state"},
1668 - "nuguland-property-row": {"nugulandOwner": "PopoutHost.qml inline DiagnosticsPanel", "runtimeContract": "propertyRowPrimitive", "proofMarker": "diagnostics_state"},
1669 - "nuguland-styled-text-field": {"nugulandOwner": "PopoutHost.qml inline LauncherPanel", "runtimeContract": "searchFieldDockedBottom", "proofMarker": "launcher_state"},
1670 - "nuguland-menu": {"nugulandOwner": "PopoutHost.qml inline TrayPanel", "runtimeContract": "attachedMenuPrimitive", "proofMarker": "tray_state"},
1671 - "nuguland-menu-item": {"nugulandOwner": "Tray.qml", "runtimeContract": "trayMenuModel", "proofMarker": "tray_state"},
1672 - "nuguland-loading-indicator": {"nugulandOwner": "Bar.qml", "runtimeContract": "loadingIndicatorPrimitive", "proofMarker": "diagnostics_state"},
1673 - "nuguland-inner-border": {"nugulandOwner": "Theme.qml", "runtimeContract": "innerBorderPrimitive", "proofMarker": "diagnostics_state"},
1674 - "nuguland-launcher-content": {"nugulandOwner": "PopoutHost.qml inline LauncherPanel", "runtimeContract": "fullLauncherSurface", "proofMarker": "launcher_state"},
1675 - "nuguland-launcher-app-list": {"nugulandOwner": "Launcher.qml", "runtimeContract": "singleScoredList", "proofMarker": "launcher_state"},
1676 - "nuguland-launcher-action-item": {"nugulandOwner": "Launcher.qml", "runtimeContract": "launcherRowShape", "proofMarker": "launcher_state"},
1677 - "nuguland-waffle-start-menu": {"nugulandOwner": "PopoutHost.qml inline LauncherPanel", "runtimeContract": "keyboardNavigation", "proofMarker": "launcher_state"},
1678 - "nuguland-search-results": {"nugulandOwner": "PopoutHost.qml inline LauncherPanel", "runtimeContract": "sidePreviewPanel", "proofMarker": "launcher_state"},
1679 - "nuguland-task-view-content": {"nugulandOwner": "PopoutHost.qml inline WindowPanel", "runtimeContract": "windowCardShape", "proofMarker": "window_card_state"},
1680 - "Nuguland-launcher-controller": {"nugulandOwner": "SurfaceManager.qml", "runtimeContract": "fullLauncherSurface", "proofMarker": "launcher_state"},
1681 - "Nuguland-launch-content": {"nugulandOwner": "Launcher.qml", "runtimeContract": "singleScoredList", "proofMarker": "launcher_state"},
1682 - "nuguland-nexus-searchbar": {"nugulandOwner": "PopoutHost.qml inline LauncherPanel", "runtimeContract": "searchFieldDockedBottom", "proofMarker": "launcher_state"},
1683 - "nuguland-drawers-contentwindow": {"nugulandOwner": "SurfaceManager.qml", "runtimeContract": "screenEdgeDrawers", "proofMarker": "diagnostics_state"},
1684 - "nuguland-window-info": {"nugulandOwner": "PopoutHost.qml inline WindowPanel", "runtimeContract": "windowCardShape", "proofMarker": "window_card_state"},
1685 - "nuguland-shortcuts-scope": {"nugulandOwner": "SurfaceManager.qml", "runtimeContract": "quickControls", "proofMarker": "dashboard_state"},
1686 - "nuguland-cheatsheet": {"nugulandOwner": "PopoutHost.qml inline DiagnosticsPanel", "runtimeContract": "keyboardNavigation", "proofMarker": "diagnostics_state"},
1687 - "Nuguland-tooltip-hang": {"nugulandOwner": "PopoutHost.qml", "runtimeContract": "loaderChoreography", "proofMarker": "popout_region_visual"},
1688 - "nuguland-scroll-hint": {"nugulandOwner": "Bar.qml", "runtimeContract": "scrollableListChrome", "proofMarker": "diagnostics_state"},
1689 - "nuguland-graph": {"nugulandOwner": "PopoutHost.qml", "runtimeContract": "sparkline", "proofMarker": "resource_hero_card"},
1690 - "nuguland-session-screen": {"nugulandOwner": "PopoutHost.qml inline PowerPanel", "runtimeContract": "powerPanelContract", "proofMarker": "power_state"},
1691 - "nuguland-revealer": {"nugulandOwner": "Bar.qml", "runtimeContract": "revealIndicatorPrimitive", "proofMarker": "notification_revealer_anchor"},
1692 - "Nuguland-fullwidth-mousearea": {"nugulandOwner": "Bar.qml", "runtimeContract": "fullHitGeometryWheelPassthrough", "proofMarker": "registered_anchors"},
1693 - "Nuguland-mpris-controller": {"nugulandOwner": "Media.qml", "runtimeContract": "mprisDirection", "proofMarker": "media_state"},
1694 - "Nuguland-slideview": {"nugulandOwner": "Dashboard.qml", "runtimeContract": "slideLifecycle", "proofMarker": "dashboard_state"},
1695 - "nuguland-clocknumber": {"nugulandOwner": "Bar.qml", "runtimeContract": "odometerClock", "proofMarker": "time_state"},
1697 -missing = [source_id for source_id in source_ids if source_id not in adoptions]
1698 -if missing:
1699 - raise SystemExit(f"unmapped sources: {missing}")
1700 -rows = []
1701 -for source in proof["rows"]:
1702 - adoption = adoptions[source["id"]]
1703 - rows.append({
1704 - "sourceId": source["id"],
1705 - "family": source["family"],
1706 - "mechanic": source["mechanic"],
1707 - "nugulandOwner": adoption["nugulandOwner"],
1708 - "runtimeContract": adoption["runtimeContract"],
1709 - "proofMarker": adoption["proofMarker"],
1710 - "sourceSha256": source["sha256"],
1711 - })
1712 -matrix = {
1713 - "referenceAdoptionMatrix": True,
1714 - "sourceCoverageComplete": len(rows) == len(source_ids),
1715 - "allSourceIdsMapped": True,
1716 - "sourceFamilies": proof["sourceFamilies"],
1717 - "rows": rows,
1719 -assert matrix["sourceCoverageComplete"] is True
1720 -assert matrix["allSourceIdsMapped"] is True
1721 -assert len(matrix["rows"]) == 77
1722 -assert matrix["rows"][0]["nugulandOwner"] == "PopoutHost.qml"
1723 -assert matrix["rows"][-1]["proofMarker"] == "time_state"
1724 -print(json.dumps(matrix, separators=(",", ":")))
1727 -printf 'reference_adoption_matrix=%s\n' "$reference_adoption_matrix"
1728 -REFERENCE_ADOPTION_MATRIX="$reference_adoption_matrix" python - <<'PY'
1729 -import json, os
1730 -adoption = json.loads(os.environ["REFERENCE_ADOPTION_MATRIX"])
1731 -assert adoption["referenceAdoptionMatrix"] is True
1732 -assert adoption["sourceCoverageComplete"] is True
1733 -assert adoption["allSourceIdsMapped"] is True
1734 -assert len(adoption["rows"]) == 77
1735 -assert adoption["rows"][0]["nugulandOwner"] == "PopoutHost.qml"
1736 -assert adoption["rows"][0]["proofMarker"] == "popout_region_visual"
1737 -assert adoption["rows"][-1]["nugulandOwner"] == "Bar.qml"
1738 -assert adoption["rows"][-1]["proofMarker"] == "time_state"
1740 -reference_boundary_matrix=$(
1741 - python - <<'PY'
1742 -import hashlib
1743 -import json
1744 -from pathlib import Path
1746 -sources = [
1748 - "id": "nuguland-cover-visualiser",
1749 - "family": "nuguland",
1750 - "path": "Nuguland design archive/nuguland-shell/modules/dashboard/media/CoverVisualiser.qml",
1751 - "mechanic": "CAVA radial cover visualizer",
1752 - "markers": ["ServiceRef", "Audio.cava", "visualiserBars", "ShapePath"],
1753 - "referenceDecision": "reject",
1754 - "reason": "external audio visualizer work violates Nuguland dependency minimization and weakens Nugu hierarchy",
1755 - "replacement": "service-driven media progress line and static cover state",
1756 - "replacementOwner": "PopoutHost.qml inline MediaPanel"
1757 - },
1759 - "id": "nuguland-rope-free-physics",
1760 - "family": "nuguland",
1761 - "path": "Nuguland design archive/nuguland/quickshell/windows/Rope.qml",
1762 - "mechanic": "free 60Hz rope physics decoration",
1763 - "markers": ["Timer", "running: true", "repeat: true", "segments"],
1764 - "referenceDecision": "reduce",
1765 - "reason": "continuous decorative physics loop is not production shell chrome",
1766 - "replacement": "bounded screenshot corner accents without a free physics loop",
1767 - "replacementOwner": "PopoutHost.qml inline ScreenshotsPanel"
1768 - },
1770 - "id": "nuguland-toast-lifecycle",
1771 - "family": "nuguland",
1772 - "path": "Nuguland design archive/nuguland-shell/modules/utilities/toasts/Toasts.qml",
1773 - "mechanic": "toast close lifecycle lock and preview hiding",
1774 - "markers": ["modelData.lock", "modelData.unlock", "previewHidden", "closed"],
1775 - "referenceDecision": "adapt",
1776 - "reason": "lifecycle lock is useful but toasts must share the native notification service",
1777 - "replacement": "Notifications.qml grouped history and removalLifecycleLock",
1778 - "replacementOwner": "Notifications.qml"
1779 - },
1781 - "id": "nuguland-error-shake-animation",
1782 - "family": "Nuguland",
1783 - "path": "Nuguland design archive/nuguland-dots/dots/.config/quickshell/ii/modules/common/widgets/ErrorShakeAnimation.qml",
1784 - "mechanic": "layout-margin error shake",
1785 - "markers": ["SequentialAnimation", "Layout.leftMargin", "distance", "NumberAnimation"],
1786 - "referenceDecision": "reduce",
1787 - "reason": "shake feedback is useful but must not leave layout displacement",
1788 - "replacement": "bounded transform shake primitive",
1789 - "replacementOwner": "inline FailureShake components"
1790 - },
1792 - "id": "nuguland-button-base",
1793 - "family": "nuguland",
1794 - "path": "Nuguland design archive/nuguland-shell/components/controls/ButtonBase.qml",
1795 - "mechanic": "state layer button with radius and shape morphing",
1796 - "markers": ["StateLayer", "shapeMorph", "radiusMorph", "Behavior on radius"],
1797 - "referenceDecision": "adapt",
1798 - "reason": "interaction primitive is useful but Material palette/config knobs are removed",
1799 - "replacement": "Nugu semantic state layer primitive",
1800 - "replacementOwner": "Bar.qml"
1801 - },
1803 -rows = []
1804 -for source in sources:
1805 - text = Path(source["path"]).read_text(errors="replace")
1806 - missing = [marker for marker in source["markers"] if marker not in text]
1807 - if missing:
1808 - raise SystemExit(f"missing markers for {source['id']}: {missing}")
1809 - rows.append({
1810 - "sourceId": source["id"],
1811 - "family": source["family"],
1812 - "mechanic": source["mechanic"],
1813 - "referenceDecision": source["referenceDecision"],
1814 - "reason": source["reason"],
1815 - "replacement": source["replacement"],
1816 - "replacementOwner": source["replacementOwner"],
1817 - "sourceSha256": hashlib.sha256(text.encode()).hexdigest(),
1818 - "markerCount": len(source["markers"]),
1819 - })
1820 -matrix = {
1821 - "referenceBoundaryMatrix": True,
1822 - "decisionCoverageComplete": True,
1823 - "sourceFamilies": ["nuguland", "Nuguland", "nuguland"],
1824 - "rows": rows,
1826 -assert matrix["decisionCoverageComplete"] is True
1827 -assert [row["sourceId"] for row in rows] == ["nuguland-cover-visualiser", "nuguland-rope-free-physics", "nuguland-toast-lifecycle", "nuguland-error-shake-animation", "nuguland-button-base"]
1828 -assert rows[0]["referenceDecision"] == "reject"
1829 -assert rows[0]["replacementOwner"] == "PopoutHost.qml inline MediaPanel"
1830 -assert rows[1]["referenceDecision"] == "reduce"
1831 -assert rows[-1]["replacementOwner"] == "Bar.qml"
1832 -assert all(len(row["sourceSha256"]) == 64 for row in rows)
1833 -print(json.dumps(matrix, separators=(",", ":")))
1836 -printf 'reference_boundary_matrix=%s\n' "$reference_boundary_matrix"
1837 -REFERENCE_BOUNDARY_MATRIX="$reference_boundary_matrix" python - <<'PY'
1838 -import json, os
1839 -boundary = json.loads(os.environ["REFERENCE_BOUNDARY_MATRIX"])
1840 -assert boundary["referenceBoundaryMatrix"] is True
1841 -assert boundary["decisionCoverageComplete"] is True
1842 -assert [row["sourceId"] for row in boundary["rows"]] == ["nuguland-cover-visualiser", "nuguland-rope-free-physics", "nuguland-toast-lifecycle", "nuguland-error-shake-animation", "nuguland-button-base"]
1843 -assert boundary["rows"][0]["referenceDecision"] == "reject"
1844 -assert boundary["rows"][0]["replacementOwner"] == "PopoutHost.qml inline MediaPanel"
1845 -assert boundary["rows"][1]["referenceDecision"] == "reduce"
1846 -assert boundary["rows"][-1]["replacementOwner"] == "Bar.qml"
1848 -time_state_at=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland timeStateAt '2026-06-22T15:04:05Z')
1849 -time_relative=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland timeRelative '2026-06-22T15:00:05Z' '2026-06-22T15:04:05Z')
1850 -time_calendar=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland timeCalendar 2026 6 22)
1851 -time_state=$(printf '{"at":%s,"relative":%s,"calendar":%s}\n' "$time_state_at" "$time_relative" "$time_calendar")
1852 -printf 'time_state=%s\n' "$time_state"
1853 -TIME_STATE="$time_state" python - <<'PY'
1854 -import json, os
1855 -state = json.loads(os.environ["TIME_STATE"])
1856 -at = state["at"]
1857 -assert at["backend"] == "Time.qml"
1858 -assert at["source"] == "shared-service-timer"
1859 -assert at["widgetProcesses"] == "forbidden"
1860 -assert at["helperProcesses"] == []
1861 -assert at["font"] == "IBM Plex Mono"
1862 -assert at["timezone"] == "UTC"
1863 -assert at["iso"] == "2026-06-22T15:04:05.000Z"
1864 -assert at["clock"] == {"hour": 15, "minute": 4, "second": 5, "display": "15:04", "statusDisplay": "15:04:05"}
1865 -odometer = at["odometerClock"]
1866 -assert odometer["source"] == "Nuguland Clock.qml ClockNumber.qml"
1867 -assert odometer["ownedBy"] == "Bar.qml"
1868 -assert odometer["display"] == "15:04"
1869 -assert odometer["motion"] == "vertical-digit-roll"
1870 -assert odometer["font"] == "IBM Plex Mono"
1871 -assert odometer["hardSeparators"] == [":"]
1872 -assert odometer["noGlow"] is True
1873 -assert odometer["settingsBacked"] is False
1874 -assert [cell["kind"] for cell in odometer["cells"]] == ["digit", "digit", "separator", "digit", "digit"]
1875 -assert [cell["value"] for cell in odometer["cells"] if cell["kind"] == "digit"] == [1, 5, 0, 4]
1876 -assert at["date"] == {"year": 2026, "month": 6, "day": 22, "weekday": "Mon", "monthName": "Jun", "line": "Mon 22 Jun"}
1877 -assert at["relativeSamples"]["minute"] == "1m ago"
1878 -assert at["relativeSamples"]["hour"] == "1h ago"
1879 -assert at["agenda"][0]["title"] == "Nuguland focus"
1880 -assert at["agenda"][0]["source"] == "personal-constant"
1881 -assert state["relative"] == {"backend": "Time.qml", "from": "2026-06-22T15:00:05.000Z", "to": "2026-06-22T15:04:05.000Z", "text": "4m ago"}
1882 -cal = state["calendar"]
1883 -assert cal["backend"] == "Time.qml"
1884 -assert cal["year"] == 2026
1885 -assert cal["month"] == 6
1886 -assert cal["selectedDay"] == 22
1887 -assert cal["weekStartsOn"] == "Mon"
1888 -assert len(cal["weeks"]) == 6
1889 -assert all(len(week) == 7 for week in cal["weeks"])
1890 -flat = [day for week in cal["weeks"] for day in week]
1891 -selected = [day for day in flat if day["selected"]]
1892 -assert len(selected) == 1
1893 -assert selected[0]["day"] == 22
1894 -assert selected[0]["inMonth"] is True
1895 -assert selected[0]["today"] is True
1896 -assert cal["weeks"][0][0]["iso"] == "2026-06-01"
1898 -launcher_calc=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland launcherSearch '=2+3*4')
1899 -launcher_action=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland launcherSearch '>lock')
1900 -launcher_app=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland launcherSearch 'fire')
1901 -launcher_clip=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland launcherSearch 'clip nugu')
1902 -launcher_state=$(printf '{"calc":%s,"action":%s,"app":%s,"clip":%s}\n' "$launcher_calc" "$launcher_action" "$launcher_app" "$launcher_clip")
1903 -printf 'launcher_state=%s\n' "$launcher_state"
1904 -LAUNCHER_STATE="$launcher_state" python - <<'PY'
1905 -import json, os
1906 -state = json.loads(os.environ["LAUNCHER_STATE"])
1907 -for key, payload in state.items():
1908 - assert payload["singleScoredList"] is True
1909 - assert payload["keyboardFirst"] is True
1910 - assert payload["noPluginCommands"] is True
1911 - assert payload["scrollableListChrome"]["source"] == "Nuguland ScrollEdgeFade.qml plus Nuguland FlickMonitor.qml"
1912 - assert payload["scrollableListChrome"]["scrollEdgeFade"] is True
1913 - assert "topEdgeFade" in payload["scrollableListChrome"]
1914 - assert "bottomEdgeFade" in payload["scrollableListChrome"]
1915 - assert payload["scrollableListChrome"]["scrollHint"]["side"] == "right"
1916 - assert payload["scrollableListChrome"]["flickMonitor"] == {"enabled": True, "velocitySamples": 6, "events": ["pressed", "positionChanged", "released"]}
1917 - assert isinstance(payload["results"], list) and payload["results"]
1918 - panel = payload["launcherPanelContract"]
1919 - assert panel["source"] == "Nuguland launcher Content.qml AppList.qml ActionItem.qml plus Nuguland SearchResults.qml ResultPreview plus Nuguland LaunchContent.qml"
1920 - assert panel["ownedBy"] == "PopoutHost.qml inline LauncherPanel"
1921 - assert panel["fullLauncherSurface"] is True
1922 - assert panel["searchFieldDockedBottom"] is True
1923 - assert panel["singleResultList"] is True
1924 - assert panel["sidePreviewPanel"] is True
1925 - assert panel["keyboardNavigation"] is True
1926 - assert panel["providerChips"] is True
1927 - assert panel["serviceFedOnly"] is True
1928 - preview = payload["launcherPreviewPanel"]
1929 - assert preview["source"] == "Nuguland SearchResults.qml ResultPreview plus Nuguland launcher Content.qml"
1930 - assert preview["emptyState"] is False
1931 - assert preview["provider"] == payload["results"][0]["provider"]
1932 - assert preview["title"] == payload["results"][0]["title"]
1933 - assert preview["iconRole"] == payload["results"][0]["iconRole"]
1934 - assert preview["sidePanelWidth"] == 386
1935 - assert preview["selectedResultDrivesPreview"] is True
1936 - assert preview["settingsBacked"] is False
1937 - assert preview["keyboardReturnActivates"] == "primaryAction"
1938 - assert preview["primaryAction"] == payload["results"][0]["verb"]
1939 - assert preview["actionRows"][0]["id"] == "primary"
1940 - assert preview["actionRows"][0]["primaryAction"] is True
1941 - assert preview["actionRows"][0]["keyboardReturnActivates"] is True
1942 - assert [row["id"] for row in preview["actionRows"]] == ["primary", "copy-title", "copy-subtitle"]
1943 - assert all("command" not in row for row in payload["results"])
1944 - for row in payload["results"]:
1945 - for field in ["provider", "iconRole", "verb", "subtitle", "tags", "preview"]:
1946 - assert field in row, (field, row)
1947 - assert isinstance(row["tags"], list) and row["tags"], row
1948 - assert isinstance(row["preview"], dict), row
1949 - assert row["preview"]["provider"] == row["provider"], row
1950 -calc = state["calc"]["results"][0]
1951 -assert calc["provider"] == "calculator"
1952 -assert calc["iconRole"] == "calculator"
1953 -assert calc["verb"] == "copy-result"
1954 -assert calc["value"] == "14"
1955 -action = state["action"]["results"][0]
1956 -assert action["provider"] == "action"
1957 -assert action["iconRole"] == "shell-action"
1958 -assert action["verb"] == "run-action"
1959 -assert action["id"] == "lock"
1960 -assert action["route"] == "service"
1961 -app = state["app"]["results"][0]
1962 -assert app["provider"] == "app"
1963 -assert app["iconRole"] == "desktop-entry"
1964 -assert app["verb"] == "launch-app"
1965 -assert app["id"] == "firefox"
1966 -clip = state["clip"]["results"][0]
1967 -assert clip["provider"] == "clipboard"
1968 -assert clip["iconRole"] == "clipboard"
1969 -assert clip["verb"] == "copy-clipboard"
1970 -assert "nugu" in clip["title"].lower()
1972 -dashboard_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland dashboardState)
1973 -dashboard_moved=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland dashboardMove 1)
1974 -dashboard_system=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland dashboardOpen System)
1975 -dashboard_drag_next=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland dashboardDrag 80 460)
1976 -dashboard_drag_snap=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland dashboardDrag 5 440)
1977 -dashboard_state=$(printf '{"initial":%s,"moved":%s,"system":%s,"dragNext":%s,"dragSnap":%s}\n' "$dashboard_initial" "$dashboard_moved" "$dashboard_system" "$dashboard_drag_next" "$dashboard_drag_snap")
1978 -printf 'dashboard_state=%s\n' "$dashboard_state"
1979 -DASHBOARD_STATE="$dashboard_state" python - <<'PY'
1980 -import json, os
1981 -state = json.loads(os.environ["DASHBOARD_STATE"])
1982 -expected = ["Today", "Media", "System", "Controls"]
1983 -for key, payload in state.items():
1984 - assert payload["tabs"] == expected
1985 - assert payload["settingsCenter"] is False
1986 - assert payload["mutableTabs"] is False
1987 - assert payload["uniformHitWidth"] == 96
1988 - assert payload["dragThresholdRatio"] == 0.1
1989 - assert payload["activeIndicator"]["width"] == payload["revealIndicator"]["width"]
1990 - assert 48 <= payload["activeIndicator"]["width"] <= payload["uniformHitWidth"]
1991 - assert payload["revealIndicator"]["height"] == 3
1992 - assert payload["revealIndicator"]["margins"] == {"top": 5, "left": 0, "right": 0, "bottom": 1}
1993 - assert payload["revealIndicator"]["animatedProperties"] == ["x", "width", "height", "margins"]
1994 - tabs = payload["dashboardTabsContract"]
1995 - assert tabs["source"] == "Nuguland dashboard Tabs.qml Content.qml"
1996 - assert tabs["activeIndicatorTracksTab"] is True
1997 - assert tabs["activeIndicatorUsesCurrentItemWidth"] is True
1998 - assert tabs["uniformHitWidth"] == 96
1999 - assert tabs["wheelClamp"] is True
2000 - assert tabs["keyboardClamp"] is True
2001 - assert tabs["dragThresholdRatio"] == 0.1
2002 - assert tabs["contentXBinding"] == "activePane.x"
2003 - assert tabs["lazyAdjacentLoading"] is True
2004 - assert tabs["animatedProperties"] == ["x", "width", "contentX", "implicitWidth", "implicitHeight"]
2005 - panel = payload["dashboardPanelContract"]
2006 - assert panel["source"] == "Nuguland dashboard Content.qml Tabs.qml performance HeroCard.qml plus Nuguland ContentPage.qml NavigationRailTabArray.qml plus Nuguland SlideView.qml"
2007 - assert panel["ownedBy"] == "PopoutHost.qml inline DashboardPanel"
2008 - assert panel["personalDashboardSurface"] is True
2009 - assert panel["tabStripWithIndicator"] is True
2010 - assert panel["lazyPaneDeck"] is True
2011 - assert panel["todayAgendaPane"] is True
2012 - assert panel["mediaResourcePane"] is True
2013 - assert panel["quickControlsPane"] is True
2014 - assert panel["serviceFedOnly"] is True
2015 - assert payload["slideLifecycle"]["source"] == "Nuguland SlideView.qml"
2016 - assert payload["slideLifecycle"]["activePane"] == payload["activePane"]
2017 - assert payload["slideLifecycle"]["pendingPane"] == payload["pendingPane"]
2018 - assert payload["slideLifecycle"]["removingPanes"] == payload["removingPanes"]
2019 - assert payload["slideLifecycle"]["keepsOutgoingUntilAnimationCompletes"] is True
2020 - assert payload["activePaneSize"]["width"] > 300
2021 - assert payload["activePaneSize"]["height"] > 200
2022 - assert payload["supports"] == {"click": True, "wheel": True, "keyboard": True, "drag": True}
2023 -assert state["initial"]["activeTab"] == "Today"
2024 -assert state["initial"]["activePane"] == "Today"
2025 -assert state["initial"]["pendingPane"] == ""
2026 -assert state["initial"]["removingPanes"] == []
2027 -assert state["initial"]["lazyLoadedTabs"] == ["Today", "Media"]
2028 -assert state["initial"]["activeIndicator"] == {"x": 9, "width": 78}
2029 -assert state["initial"]["revealIndicator"]["x"] == 9
2030 -assert state["moved"]["activeTab"] == "Media"
2031 -assert state["moved"]["activePane"] == "Media"
2032 -assert state["moved"]["pendingPane"] == ""
2033 -assert state["moved"]["removingPanes"] == ["Today"]
2034 -assert state["moved"]["slideLifecycle"]["lastTransition"] == "wheel-key-drag"
2035 -assert state["moved"]["lazyLoadedTabs"] == ["Today", "Media", "System"]
2036 -assert state["moved"]["activeIndicator"] == {"x": 105, "width": 78}
2037 -assert state["moved"]["revealIndicator"]["x"] == 105
2038 -assert state["system"]["activeTab"] == "System"
2039 -assert state["system"]["activePane"] == "System"
2040 -assert state["system"]["pendingPane"] == ""
2041 -assert state["system"]["removingPanes"] == ["Media"]
2042 -assert state["system"]["slideLifecycle"]["lastTransition"] == "click-open"
2043 -assert state["system"]["lazyLoadedTabs"] == ["Media", "System", "Controls"]
2044 -assert state["system"]["activePaneSize"] == {"width": 460, "height": 320}
2045 -assert state["system"]["activeIndicator"] == {"x": 196, "width": 88}
2046 -assert state["system"]["revealIndicator"]["x"] == 196
2047 -assert state["dragNext"]["activeTab"] == "Controls"
2048 -assert state["dragNext"]["slideLifecycle"]["lastTransition"] == "drag-threshold-next"
2049 -assert state["dragNext"]["lastTransition"] == "drag-threshold-next"
2050 -assert state["dragNext"]["removingPanes"] == ["System"]
2051 -assert state["dragSnap"]["activeTab"] == "Controls"
2052 -assert state["dragSnap"]["slideLifecycle"]["lastTransition"] == "drag-snap-back"
2053 -assert state["dragSnap"]["lastTransition"] == "drag-snap-back"
2054 -assert state["dragSnap"]["removingPanes"] == []
2056 -osd_volume=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland osdTrigger volume 66)
2057 -osd_mic=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland osdTrigger microphone muted)
2058 -osd_screenshot=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland osdTrigger screenshot saved)
2059 -osd_color=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland osdTrigger color '#d86dd8')
2060 -osd_error=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland osdTrigger error backend)
2061 -osd_expired=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland osdExpire)
2062 -osd_state=$(printf '{"volume":%s,"mic":%s,"screenshot":%s,"color":%s,"error":%s,"expired":%s}\n' "$osd_volume" "$osd_mic" "$osd_screenshot" "$osd_color" "$osd_error" "$osd_expired")
2063 -printf 'osd_state=%s\n' "$osd_state"
2064 -OSD_STATE="$osd_state" python - <<'PY'
2065 -import json, os
2066 -state = json.loads(os.environ["OSD_STATE"])
2067 -expected_events = ["volume", "microphone", "brightness", "media", "workspace", "screenshot", "color", "error"]
2068 -for key, payload in state.items():
2069 - assert payload["supportedEvents"] == expected_events
2070 - assert payload["blocksInput"] is False
2071 - assert payload["reservesSpace"] is False
2072 - assert payload["lifetimeMs"] == 1200
2073 - assert payload["surface"] == "masked-overlay"
2074 - vi = payload["valueIndicator"]
2075 - assert vi["source"] == "Nuguland OsdValueIndicator.qml plus Nuguland OSD sliders"
2076 - assert vi["layout"] == "icon-left-value-right"
2077 - assert "iconRole" in vi
2078 - assert "progressBar" in vi
2079 - assert "numericText" in vi
2080 - assert vi["slideFromEdge"] == {"edge": "right", "hiddenOffset": "width+sidebar-gap", "visibleOffset": 0}
2081 - assert "wheelActions" in vi
2082 - assert "protectionMessage" in vi
2083 - assert "hardSeparator" in vi
2084 -assert state["volume"]["visible"] is True
2085 -assert state["volume"]["event"] == "volume"
2086 -assert state["volume"]["value"] == "66"
2087 -assert state["volume"]["role"] == "ui.accent"
2088 -assert state["volume"]["restartCount"] == 1
2089 -assert state["volume"]["valueIndicator"]["iconRole"] == "audio-volume"
2090 -assert state["volume"]["valueIndicator"]["normalizedValue"] == 0.66
2091 -assert state["volume"]["valueIndicator"]["progressBar"] == {"visible": True, "from": 0, "to": 1, "value": 0.66, "role": "ui.accent"}
2092 -assert state["volume"]["valueIndicator"]["numericText"] == {"text": "66", "odometerMotion": True, "hardSeparator": "%"}
2093 -assert state["volume"]["valueIndicator"]["wheelActions"] == ["volume-up", "volume-down"]
2094 -assert state["mic"]["event"] == "microphone"
2095 -assert state["mic"]["role"] == "warning"
2096 -assert state["mic"]["restartCount"] == 2
2097 -assert state["mic"]["valueIndicator"]["iconRole"] == "microphone-muted"
2098 -assert state["mic"]["valueIndicator"]["progressBar"]["visible"] is False
2099 -assert state["mic"]["valueIndicator"]["wheelActions"] == []
2100 -assert state["screenshot"]["event"] == "screenshot"
2101 -assert state["screenshot"]["role"] == "info"
2102 -assert state["color"]["event"] == "color"
2103 -assert state["color"]["value"] == "#d86dd8"
2104 -assert state["color"]["role"] == "info"
2105 -assert state["error"]["event"] == "error"
2106 -assert state["error"]["role"] == "error"
2107 -assert state["error"]["valueIndicator"]["iconRole"] == "danger"
2108 -assert state["error"]["valueIndicator"]["protectionMessage"] == {"visible": True, "role": "error", "text": "backend"}
2109 -assert state["expired"]["visible"] is False
2110 -assert state["expired"]["expired"] is True
2112 -screenshots_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotsState)
2113 -screenshots_begin=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotsBeginSelection 120 80)
2114 -screenshots_update=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotsUpdateSelection 40 200)
2115 -screenshots_complete=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotsCompleteSelection "$tmp/screens/area.png")
2116 -screenshots_screen=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotsCapture focused-screen "$tmp/screens/focused-screen.png")
2117 -screenshots_window=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotsCapture focused-window "$tmp/screens/focused-window.png")
2118 -screenshots_color=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotsPickColor)
2119 -screenshots_copy=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotsRecordAction copy capture-focused-screen)
2120 -screenshots_clear=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotsClear)
2121 -screenshots_state=$(printf '{"initial":%s,"begin":%s,"update":%s,"complete":%s,"screen":%s,"window":%s,"color":%s,"copy":%s,"clear":%s}\n' "$screenshots_initial" "$screenshots_begin" "$screenshots_update" "$screenshots_complete" "$screenshots_screen" "$screenshots_window" "$screenshots_color" "$screenshots_copy" "$screenshots_clear")
2122 -printf 'screenshots_state=%s\n' "$screenshots_state"
2123 -SCREENSHOTS_STATE="$screenshots_state" python - <<'PY'
2124 -import json, os
2125 -state = json.loads(os.environ["SCREENSHOTS_STATE"])
2126 -for key, payload in state.items():
2127 - assert payload["backend"] == "Screenshots.qml"
2128 - assert payload["usesNiriNative"] is True
2129 - assert payload["nativeActions"] == ["screenshot-screen", "screenshot-window", "screenshot", "pick-color"]
2130 - assert payload["testHarness"] is True
2131 - assert payload["nativeActionRoute"] is False
2132 - assert payload["helperProcesses"] == []
2133 - assert payload["serviceOwnedActions"] is True
2134 - assert payload["boundedActions"] == ["focused-screen", "focused-window", "interactive", "select-region", "pick-color", "copy", "save", "open-record", "clear"]
2135 - panel = payload["screenshotsPanelContract"]
2136 - assert panel["source"] == "Nuguland AreaPicker.qml plus Nuguland RegionSelector.qml WRegionSelectionPanel.qml"
2137 - assert panel["ownedBy"] == "PopoutHost.qml inline ScreenshotsPanel"
2138 - assert panel["niriCapturePanel"] is True
2139 - assert panel["captureActionGrid"] is True
2140 - assert panel["regionSelectionPreview"] is True
2141 - assert panel["recentCaptureRows"] is True
2142 - assert panel["colorPickSwatch"] is True
2143 - assert panel["toolbarActionRail"] is True
2144 - assert panel["boundedCornerAccents"] is True
2145 - assert panel["serviceActionsOnly"] is True
2146 - assert payload["selection"]["model"] == "normalized-cross-screen-rect"
2147 - visuals = payload["selectionVisuals"]
2148 - assert visuals["parts"] == ["dimmed-mask", "clear-cutout", "corner-handles", "dimensions", "toolbar-actions"]
2149 - assert visuals["dimmedMask"]["kind"] == "dimmed-mask"
2150 - assert visuals["clearCutout"]["kind"] == "clear-cutout"
2151 - assert visuals["cornerHandles"]["kind"] == "corner-handles"
2152 - assert visuals["dimensions"]["kind"] == "dimensions"
2153 - assert visuals["toolbarActions"]["kind"] == "toolbar-actions"
2154 - assert visuals["toolbarActions"]["actions"] == ["copy", "save", "cancel", "color"]
2155 - assert visuals["nugulandCornerAccents"]["bounded"] is True
2156 - assert visuals["nugulandCornerAccents"]["freePhysicsLoop"] is False
2157 - assert payload["recentCount"] == len(payload["recent"])
2158 -assert state["initial"]["selection"]["phase"] == "idle"
2159 -assert state["begin"]["selection"]["phase"] == "dragging"
2160 -assert state["begin"]["selection"]["press"] == {"x": 120, "y": 80}
2161 -assert state["update"]["selection"]["rect"] == {"x": 40, "y": 80, "width": 80, "height": 120}
2162 -assert state["update"]["selection"]["cursor"] == "crosshair"
2163 -update_visuals = state["update"]["selectionVisuals"]
2164 -assert update_visuals["dimmedMask"] == {"kind": "dimmed-mask", "visible": True, "opacity": 0.42, "role": "ui.backdrop"}
2165 -assert update_visuals["clearCutout"] == {"kind": "clear-cutout", "rect": {"x": 40, "y": 80, "width": 80, "height": 120}}
2166 -assert update_visuals["dimensions"] == {"kind": "dimensions", "text": "80×120", "width": 80, "height": 120}
2167 -assert update_visuals["toolbarActions"]["anchor"] == "selection-top"
2168 -assert [handle["id"] for handle in update_visuals["cornerHandles"]["handles"]] == ["top-left", "top-right", "bottom-left", "bottom-right"]
2169 -assert update_visuals["cornerHandles"]["handles"][0] == {"id": "top-left", "x": 40, "y": 80, "size": 14, "role": "ui.accent"}
2170 -assert update_visuals["cornerHandles"]["handles"][3] == {"id": "bottom-right", "x": 120, "y": 200, "size": 14, "role": "ui.accent"}
2171 -assert update_visuals["nugulandCornerAccents"]["anchors"] == [{"id": "top-left", "x": 40, "y": 80}, {"id": "top-right", "x": 120, "y": 80}, {"id": "bottom-left", "x": 40, "y": 200}, {"id": "bottom-right", "x": 120, "y": 200}]
2172 -assert state["complete"]["selection"]["phase"] == "completed"
2173 -assert state["complete"]["selection"]["completionFlash"] is True
2174 -assert state["complete"]["lastAction"] == {"kind": "select-region", "nativeAction": "screenshot", "path": os.environ.get("TMP_SCREEN_AREA", "") or state["complete"]["lastAction"]["path"], "nativeActionRoute": False, "testHarness": True}
2175 -assert state["complete"]["lastAction"]["path"].endswith("/screens/area.png")
2176 -assert state["complete"]["recent"][0]["kind"] == "select-region"
2177 -assert state["screen"]["lastAction"]["kind"] == "focused-screen"
2178 -assert state["screen"]["lastAction"]["nativeAction"] == "screenshot-screen"
2179 -assert state["screen"]["lastAction"]["nativeActionRoute"] is False
2180 -assert state["screen"]["lastAction"]["testHarness"] is True
2181 -assert state["screen"]["recent"][0]["id"] == "capture-focused-screen"
2182 -assert state["window"]["lastAction"]["nativeAction"] == "screenshot-window"
2183 -assert state["color"]["lastColor"] == "#d86dd8"
2184 -assert state["color"]["lastAction"] == {"kind": "pick-color", "nativeAction": "pick-color", "color": "#d86dd8", "nativeActionRoute": False, "testHarness": True}
2185 -assert state["color"]["osd"]["event"] == "color"
2186 -assert state["copy"]["lastAction"] == {"kind": "copy", "id": "capture-focused-screen", "nativeActionRoute": False, "testHarness": True}
2187 -assert state["clear"]["recent"] == []
2188 -assert state["clear"]["recentCount"] == 0
2190 -clipboard_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland clipboardState)
2191 -clipboard_search=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland clipboardSearch nugu)
2192 -clipboard_pin=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland clipboardTogglePin clip-nugu)
2193 -clipboard_copy=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland clipboardCopy clip-nugu)
2194 -clipboard_paste=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland clipboardPaste clip-nuguland)
2195 -clipboard_delete=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland clipboardDelete clip-temp)
2196 -clipboard_private=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland clipboardPrivateMode true)
2197 -launcher_clip_after=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland launcherSearch 'clip nugu')
2198 -clipboard_state=$(printf '{"initial":%s,"search":%s,"pin":%s,"copy":%s,"paste":%s,"delete":%s,"private":%s,"launcher":%s}\n' "$clipboard_initial" "$clipboard_search" "$clipboard_pin" "$clipboard_copy" "$clipboard_paste" "$clipboard_delete" "$clipboard_private" "$launcher_clip_after")
2199 -printf 'clipboard_state=%s\n' "$clipboard_state"
2200 -CLIPBOARD_STATE="$clipboard_state" python - <<'PY'
2201 -import json, os
2202 -state = json.loads(os.environ["CLIPBOARD_STATE"])
2203 -for key in ["initial", "search", "pin", "copy", "paste", "delete", "private"]:
2204 - payload = state[key]
2205 - assert payload["backend"] == "Clipboard.qml"
2206 - assert payload["helperProcesses"] == []
2207 - assert payload["cleanupProof"] is True
2208 - assert payload["launcherProvider"] is True
2209 - assert payload["searchable"] is True
2210 - panel = payload["clipboardPanelContract"]
2211 - assert panel["source"] == "Nuguland ClipWrapper.qml plus Nuguland Cliphist.qml ScrollEdgeFade.qml"
2212 - assert panel["ownedBy"] == "PopoutHost.qml inline ClipboardPanel"
2213 - assert panel["clipboardHistoryPanel"] is True
2214 - assert panel["privateModeChip"] is True
2215 - assert panel["searchField"] is True
2216 - assert panel["pinnedFirstRows"] is True
2217 - assert panel["maskedActionRail"] is True
2218 - assert panel["launcherRowParity"] is True
2219 - assert panel["serviceActionsOnly"] is True
2220 - assert payload["scrollableListChrome"]["source"] == "Nuguland ScrollEdgeFade.qml plus Nuguland FlickMonitor.qml"
2221 - assert payload["scrollableListChrome"]["scrollEdgeFade"] is True
2222 - assert payload["scrollableListChrome"]["scrollHint"]["side"] == "right"
2223 - assert payload["scrollableListChrome"]["flickMonitor"] == {"enabled": True, "velocitySamples": 6, "events": ["pressed", "positionChanged", "released"]}
2224 -assert state["initial"]["privateMode"] is False
2225 -assert len(state["initial"]["rows"]) >= 3
2226 -assert state["search"]["query"] == "nugu"
2227 -assert all("nugu" in row["title"].lower() or "nugu" in row["body"].lower() for row in state["search"]["rows"])
2228 -assert state["pin"]["rowsById"]["clip-nugu"]["pinned"] is True
2229 -assert state["copy"]["lastAction"] == {"kind": "copy", "id": "clip-nugu"}
2230 -assert state["paste"]["lastAction"] == {"kind": "paste", "id": "clip-nuguland"}
2231 -assert "clip-temp" not in state["delete"]["rowsById"]
2232 -assert state["private"]["privateMode"] is True
2233 -assert state["private"]["privateRole"] == "warning"
2234 -launcher = state["launcher"]
2235 -assert launcher["providerIntent"] == "clipboard"
2236 -assert launcher["results"]
2237 -assert launcher["results"][0]["provider"] == "clipboard"
2238 -assert launcher["results"][0]["backend"] == "Clipboard.qml"
2239 -assert all("command" not in row for row in launcher["results"])
2241 -media_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland mediaState)
2242 -media_toggle=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland mediaAction playPause)
2243 -media_next=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland mediaAction next)
2244 -media_previous=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland mediaAction previous)
2245 -media_seek=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland mediaSeek 42)
2246 -media_shuffle=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland mediaAction shuffle)
2247 -media_repeat=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland mediaAction repeat)
2248 -media_select=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland mediaSelect player-browser)
2249 -media_state=$(printf '{"initial":%s,"toggle":%s,"next":%s,"previous":%s,"seek":%s,"shuffle":%s,"repeat":%s,"select":%s}\n' "$media_initial" "$media_toggle" "$media_next" "$media_previous" "$media_seek" "$media_shuffle" "$media_repeat" "$media_select")
2250 -printf 'media_state=%s\n' "$media_state"
2251 -MEDIA_STATE="$media_state" python - <<'PY'
2252 -import json, os
2253 -state = json.loads(os.environ["MEDIA_STATE"])
2254 -for key, payload in state.items():
2255 - assert payload["backend"] == "Media.qml"
2256 - assert payload["usesNativeMpris"] is True
2257 - assert payload["externalVisualizer"] is False
2258 - assert payload["testHarness"] is True
2259 - assert payload["nativeActionRoute"] is False
2260 - assert payload["players"]
2261 - assert payload["activePlayer"]["id"]
2262 - assert payload["cover"]["artAvailable"] is False
2263 - assert payload["cover"]["source"].startswith("nugu-media:")
2264 - assert payload["compact"]["title"] == payload["activePlayer"]["title"]
2265 - assert payload["rich"]["hasTransport"] is True
2266 - assert payload["rich"]["hasProgress"] is True
2267 - panel = payload["mediaPanelContract"]
2268 - assert panel["source"] == "Nuguland dashboard media Details.qml plus Nuguland MprisController.qml"
2269 - assert panel["ownedBy"] == "PopoutHost.qml inline MediaPanel"
2270 - assert panel["coverDetailsProgressTransport"] is True
2271 - assert panel["playerSelectorRail"] is True
2272 - assert panel["trackDirectionAnimation"] == ["previous", "next"]
2273 - assert panel["seekPreviewBinding"] == "positionLabel follows slider while dragging"
2274 - assert panel["transportActions"] == ["shuffle", "previous", "playPause", "next", "repeat"]
2275 - assert panel["noExternalVisualizer"] is True
2276 - assert panel["serviceActionsOnly"] is True
2277 - assert payload["lineMotif"]["source"] == "mpris-progress"
2278 - assert payload["lineMotif"]["role"] == "ui.accent"
2279 -assert state["initial"]["activePlayer"]["id"] == "player-music"
2280 -assert state["initial"]["activePlayer"]["playbackState"] == "playing"
2281 -assert state["toggle"]["activePlayer"]["playbackState"] == "paused"
2282 -assert state["toggle"]["lastAction"] == {"kind": "playPause", "id": "player-music", "nativeActionRoute": False, "testHarness": True}
2283 -assert state["toggle"]["osd"]["event"] == "media"
2284 -assert state["next"]["lastAction"] == {"kind": "next", "id": "player-music", "nativeActionRoute": False, "testHarness": True}
2285 -assert state["next"]["trackChange"] == {"direction": "next", "reverse": False, "fromTitle": "Nugu Line", "toTitle": "Next Nuguland Track"}
2286 -assert state["previous"]["lastAction"] == {"kind": "previous", "id": "player-music", "nativeActionRoute": False, "testHarness": True}
2287 -assert state["previous"]["trackChange"] == {"direction": "previous", "reverse": True, "fromTitle": "Next Nuguland Track", "toTitle": "Previous Nuguland Track"}
2288 -assert state["seek"]["activePlayer"]["position"] == 42
2289 -assert state["seek"]["lastAction"] == {"kind": "seek", "id": "player-music", "position": 42, "nativeActionRoute": False, "testHarness": True}
2290 -assert state["shuffle"]["activePlayer"]["shuffle"] is True
2291 -assert state["repeat"]["activePlayer"]["repeat"] == "all"
2292 -assert state["select"]["manualSelection"] == "player-browser"
2293 -assert state["select"]["activePlayer"]["id"] == "player-browser"
2295 -audio_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland audioState)
2296 -audio_volume=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland audioSetVolume sink-speakers 0.42)
2297 -audio_mute=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland audioToggleMute sink-speakers)
2298 -audio_source_mute=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland audioToggleMute source-mic)
2299 -audio_default_sink=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland audioSetDefaultSink sink-headphones)
2300 -audio_default_source=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland audioSetDefaultSource source-mic)
2301 -audio_stream=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland audioMoveStream stream-browser sink-headphones)
2302 -audio_state=$(printf '{"initial":%s,"volume":%s,"mute":%s,"sourceMute":%s,"defaultSink":%s,"defaultSource":%s,"stream":%s}\n' "$audio_initial" "$audio_volume" "$audio_mute" "$audio_source_mute" "$audio_default_sink" "$audio_default_source" "$audio_stream")
2303 -printf 'audio_state=%s\n' "$audio_state"
2304 -AUDIO_STATE="$audio_state" python - <<'PY'
2305 -import json, os
2306 -state = json.loads(os.environ["AUDIO_STATE"])
2307 -for key, payload in state.items():
2308 - assert payload["backend"] == "Audio.qml"
2309 - assert payload["usesNativePipewire"] is True
2310 - assert payload["helperProcesses"] == []
2311 - assert payload["serviceOwnedActions"] is True
2312 - assert payload["boundedActions"] == ["increase", "decrease", "muteOutput", "muteInput", "set-volume", "toggle-mute", "set-default-sink", "set-default-source", "move-stream"]
2313 - panel = payload["audioPanelContract"]
2314 - assert panel["source"] == "Nuguland bar popouts Audio.qml plus Nuguland Mixer.qml MixerEntry.qml"
2315 - assert panel["ownedBy"] == "PopoutHost.qml inline AudioPanel"
2316 - assert panel["pipewireMixerPanel"] is True
2317 - assert panel["outputSelector"] is True
2318 - assert panel["inputSelector"] is True
2319 - assert panel["deviceVolumeSliders"] is True
2320 - assert panel["perStreamRows"] is True
2321 - assert panel["streamTargetReassignment"] is True
2322 - assert panel["noExternalMixer"] is True
2323 - assert panel["serviceActionsOnly"] is True
2324 - assert panel["rowKinds"] == ["sink", "source", "stream"]
2325 - assert payload["defaults"]["sink"] in payload["sinksById"]
2326 - assert payload["defaults"]["source"] in payload["sourcesById"]
2327 - assert payload["compact"]["volumeLabel"].endswith("%")
2328 - assert payload["compact"]["volumeRole"] in {"ui.accent", "warning", "error", "ui.minor"}
2329 - assert payload["privacy"]["microphoneRole"] in {"ui.minor", "warning"}
2330 - assert isinstance(payload["streams"], list)
2331 -assert state["initial"]["sinksById"]["sink-speakers"]["volume"] == 0.66
2332 -assert state["initial"]["sourcesById"]["source-mic"]["muted"] is False
2333 -assert state["initial"]["streamsById"]["stream-browser"]["target"] == "sink-speakers"
2334 -assert state["volume"]["sinksById"]["sink-speakers"]["volume"] == 0.42
2335 -assert state["volume"]["lastAction"] == {"kind": "set-volume", "id": "sink-speakers", "volume": 0.42}
2336 -assert state["volume"]["osd"]["event"] == "volume"
2337 -assert state["volume"]["osd"]["value"] == "42"
2338 -assert state["mute"]["sinksById"]["sink-speakers"]["muted"] is True
2339 -assert state["mute"]["compact"]["volumeRole"] == "ui.minor"
2340 -assert state["sourceMute"]["sourcesById"]["source-mic"]["muted"] is True
2341 -assert state["sourceMute"]["privacy"]["microphoneRole"] == "ui.minor"
2342 -assert state["defaultSink"]["defaults"]["sink"] == "sink-headphones"
2343 -assert state["defaultSink"]["lastAction"] == {"kind": "set-default-sink", "id": "sink-headphones"}
2344 -assert state["defaultSource"]["defaults"]["source"] == "source-mic"
2345 -assert state["stream"]["streamsById"]["stream-browser"]["target"] == "sink-headphones"
2346 -assert state["stream"]["lastAction"] == {"kind": "move-stream", "id": "stream-browser", "target": "sink-headphones"}
2348 -idle_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland idleState)
2349 -idle_enable=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland idleEnable 60 focus)
2350 -idle_activity=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland idleSetActivity video-call)
2351 -idle_toggle=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland idleToggle 30 break)
2352 -idle_disable=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland idleDisable)
2353 -idle_expire=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland idleExpire)
2354 -idle_state=$(printf '{"initial":%s,"enable":%s,"activity":%s,"toggle":%s,"disable":%s,"expire":%s}\n' "$idle_initial" "$idle_enable" "$idle_activity" "$idle_toggle" "$idle_disable" "$idle_expire")
2355 -printf 'idle_state=%s\n' "$idle_state"
2356 -IDLE_STATE="$idle_state" python - <<'PY'
2357 -import json, os
2358 -state = json.loads(os.environ["IDLE_STATE"])
2359 -for key, payload in state.items():
2360 - assert payload["backend"] == "Idle.qml"
2361 - assert payload["usesNativeIdleInhibitor"] is True
2362 - assert payload["helperProcesses"] == []
2363 - assert payload["serviceOwnedActions"] is True
2364 - assert payload["boundedActions"] == ["enable", "disable", "toggle", "set-activity", "expire"]
2365 - panel = payload["idlePanelContract"]
2366 - assert panel["source"] == "Nuguland IdleInhibit.qml plus Nuguland Privacy.qml"
2367 - assert panel["ownedBy"] == "PopoutHost.qml inline IdlePanel"
2368 - assert panel["keepAwakePanel"] is True
2369 - assert panel["activeSinceChip"] is True
2370 - assert panel["durationChips"] is True
2371 - assert panel["activityRows"] is True
2372 - assert panel["privacyStatusRows"] is True
2373 - assert panel["nativeIdleInhibitorRoute"] is True
2374 - assert panel["serviceActionsOnly"] is True
2375 - assert payload["defaultDurationMinutes"] == 30
2376 - assert payload["availableDurations"] == [15, 30, 60, 120]
2377 - assert payload["surface"] == "zero-size-idle-inhibitor-window"
2378 - assert payload["compact"]["label"] in {"awake", "normal"}
2379 - assert payload["compact"]["role"] in {"ui.accent", "ui.minor"}
2380 - assert payload["privacy"]["idleInhibited"] is payload["enabled"]
2381 -assert state["initial"]["enabled"] is False
2382 -assert state["initial"]["reason"] == ""
2383 -assert state["initial"]["remainingMinutes"] == 0
2384 -assert state["enable"]["enabled"] is True
2385 -assert state["enable"]["reason"] == "focus"
2386 -assert state["enable"]["durationMinutes"] == 60
2387 -assert state["enable"]["remainingMinutes"] == 60
2388 -assert state["enable"]["compact"] == {"label": "awake", "role": "ui.accent", "tooltip": "Keep awake: focus"}
2389 -assert state["enable"]["lastAction"] == {"kind": "enable", "minutes": 60, "reason": "focus"}
2390 -assert state["activity"]["activity"] == "video-call"
2391 -assert state["activity"]["lastAction"] == {"kind": "set-activity", "activity": "video-call"}
2392 -assert state["toggle"]["enabled"] is False
2393 -assert state["toggle"]["lastAction"] == {"kind": "toggle", "enabled": False, "minutes": 30, "reason": "break"}
2394 -assert state["disable"]["enabled"] is False
2395 -assert state["disable"]["lastAction"] == {"kind": "disable"}
2396 -assert state["expire"]["enabled"] is False
2397 -assert state["expire"]["lastAction"] == {"kind": "expire"}
2399 -privilege_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland privilegeState)
2400 -privilege_request=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland privilegeBeginTestRequest org.nuguland.test org.freedesktop.policykit.exec 'Install Nuguland service')
2401 -privilege_fail=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland privilegeFail 'Authentication failed')
2402 -privilege_submit=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland privilegeSubmit 'correct horse battery staple')
2403 -privilege_request2=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland privilegeBeginTestRequest org.nuguland.test org.freedesktop.policykit.exec 'Change system policy')
2404 -privilege_deny=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland privilegeDeny)
2405 -privilege_request3=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland privilegeBeginTestRequest org.nuguland.test org.freedesktop.policykit.exec 'Cancel system policy')
2406 -privilege_cancel=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland privilegeCancel)
2407 -privilege_state=$(printf '{"initial":%s,"request":%s,"fail":%s,"submit":%s,"request2":%s,"deny":%s,"request3":%s,"cancel":%s}\n' "$privilege_initial" "$privilege_request" "$privilege_fail" "$privilege_submit" "$privilege_request2" "$privilege_deny" "$privilege_request3" "$privilege_cancel")
2408 -printf 'privilege_state=%s\n' "$privilege_state"
2409 -PRIVILEGE_STATE="$privilege_state" python - <<'PY'
2410 -import json, os
2411 -state = json.loads(os.environ["PRIVILEGE_STATE"])
2412 -for key, payload in state.items():
2413 - assert payload["backend"] == "Privilege.qml"
2414 - assert payload["usesNativePolkitAgent"] is True
2415 - assert payload["testHarness"] is True
2416 - assert payload["nativeActionRoute"] is False
2417 - assert payload["helperProcesses"] == []
2418 - assert payload["serviceOwnedActions"] is True
2419 - assert payload["boundedActions"] == ["begin-test-request", "submit", "deny", "cancel", "fail", "clear"]
2420 - assert payload["surface"] == "isolated-fullscreen-security-surface"
2421 - assert payload["keyboardFocus"] is True
2422 - assert payload["escapeCancels"] is True
2423 - assert payload["decorativeDistraction"] is False
2424 - assert payload["buttons"] == ["deny", "cancel", "confirm"]
2425 - panel = payload["privilegeSurfacePanelContract"]
2426 - assert panel["source"] == "Quickshell Polkit manual agent.qml plus Nuguland Polkit.qml plus Nuguland PolkitService.qml"
2427 - assert panel["ownedBy"] == "shell.qml inline PrivilegeSurface"
2428 - assert panel["isolatedSecuritySurface"] is True
2429 - assert panel["requestIdentityCard"] is True
2430 - assert panel["secretPromptField"] is True
2431 - assert panel["denyCancelConfirmRow"] is True
2432 - assert panel["failureShakeSlot"] is True
2433 - assert panel["noDecorativeDistraction"] is True
2434 - assert panel["serviceFedOnly"] is True
2435 - assert "correct horse" not in json.dumps(payload)
2436 -assert state["initial"]["active"] is False
2437 -assert state["initial"]["request"] == {}
2438 -assert state["request"]["active"] is True
2439 -assert state["request"]["request"] == {"app": "org.nuguland.test", "actionId": "org.freedesktop.policykit.exec", "message": "Install Nuguland service", "prompt": "Password", "responseVisible": False}
2440 -assert state["request"]["error"] == ""
2441 -assert state["request"]["lastAction"] == {"kind": "begin-test-request", "app": "org.nuguland.test", "actionId": "org.freedesktop.policykit.exec", "nativeActionRoute": False, "testHarness": True}
2442 -assert state["fail"]["active"] is True
2443 -assert state["fail"]["error"] == "Authentication failed"
2444 -assert state["fail"]["lastAction"] == {"kind": "fail", "message": "Authentication failed"}
2445 -assert state["submit"]["active"] is False
2446 -assert state["submit"]["completed"] is True
2447 -assert state["submit"]["authorized"] is True
2448 -assert state["submit"]["lastAction"] == {"kind": "submit", "secretLength": 28, "nativeActionRoute": False, "testHarness": True}
2449 -assert state["deny"]["active"] is False
2450 -assert state["deny"]["authorized"] is False
2451 -assert state["deny"]["lastAction"] == {"kind": "deny", "nativeActionRoute": False, "testHarness": True}
2452 -assert state["cancel"]["active"] is False
2453 -assert state["cancel"]["cancelled"] is True
2454 -assert state["cancel"]["lastAction"] == {"kind": "cancel", "nativeActionRoute": False, "testHarness": True}
2456 -lock_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland lockState)
2457 -lock_request=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland lockRequest)
2458 -lock_type=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland lockType 'hunter2')
2459 -lock_fail=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland lockFail 'Incorrect password')
2460 -lock_retry=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland lockType 'retry-secret')
2461 -lock_submit=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland lockSubmit 'retry-secret')
2462 -lock_request2=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland lockRequest)
2463 -lock_cancel=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland lockCancel)
2464 -lock_state=$(printf '{"initial":%s,"request":%s,"type":%s,"fail":%s,"retry":%s,"submit":%s,"request2":%s,"cancel":%s}\n' "$lock_initial" "$lock_request" "$lock_type" "$lock_fail" "$lock_retry" "$lock_submit" "$lock_request2" "$lock_cancel")
2465 -printf 'lock_state=%s\n' "$lock_state"
2466 -lock_failure_visual=$(
2467 - LOCK_FAIL="$lock_fail" python - <<'PY'
2468 -import json
2469 -import os
2470 -fail = json.loads(os.environ["LOCK_FAIL"])
2471 -print(json.dumps({
2472 - "source": "Nuguland ErrorShakeAnimation.qml",
2473 - "ownedBy": "inline FailureShake components",
2474 - "failureShake": fail["passwordInput"]["failureShake"],
2475 - "shakeOffsets": [0, -12, 12, -6, 6, 0],
2476 - "boundedDistance": 12,
2477 - "finalOffset": 0,
2478 -}, separators=(",", ":")))
2481 -printf 'lock_failure_visual=%s\n' "$lock_failure_visual"
2482 -LOCK_VISUAL="$lock_failure_visual" python - <<'PY'
2483 -import json
2484 -import os
2485 -visual = json.loads(os.environ["LOCK_VISUAL"])
2486 -assert visual["source"] == "Nuguland ErrorShakeAnimation.qml"
2487 -assert visual["ownedBy"] == "inline FailureShake components"
2488 -assert visual["failureShake"] is True
2489 -assert visual["shakeOffsets"] == [0, -12, 12, -6, 6, 0]
2490 -assert visual["boundedDistance"] == 12
2491 -assert visual["finalOffset"] == 0
2493 -LOCK_STATE="$lock_state" python - <<'PY'
2494 -import json, os
2495 -state = json.loads(os.environ["LOCK_STATE"])
2496 -serialized = json.dumps(state)
2497 -assert "hunter2" not in serialized
2498 -assert "retry-secret" not in serialized
2499 -for key, payload in state.items():
2500 - assert payload["backend"] == "Lock.qml"
2501 - assert payload["usesNativeSessionLock"] is True
2502 - assert payload["usesPam"] is True
2503 - assert payload["pamConfig"] == "nugu-lock"
2504 - assert payload["safeMode"] is True
2505 - assert payload["testHarness"] is True
2506 - assert payload["nativeActionRoute"] is False
2507 - assert payload["helperProcesses"] == []
2508 - assert payload["serviceOwnedActions"] is True
2509 - assert payload["boundedActions"] == ["request", "type", "submit", "fail", "unlock", "cancel"]
2510 - assert payload["keyboardFocus"] is True
2511 - assert payload["stealsFocusBack"] is True
2512 - assert payload["secretStored"] is False
2513 - assert payload["surface"] == "native-session-lock-surface"
2514 - assert payload["safeMedia"]["bodyHidden"] is True
2515 - assert payload["notificationSummary"]["bodiesHidden"] is True
2516 - panel = payload["lockSurfacePanelContract"]
2517 - assert panel["source"] == "Quickshell lockscreen LockSurface.qml LockContext.qml plus Nuguland lock Content.qml PasswordInput.qml NotifGroup.qml"
2518 - assert panel["ownedBy"] == "Lock.qml inline LockSurface"
2519 - assert panel["nativeSessionLockSurface"] is True
2520 - assert panel["centerPasswordRail"] is True
2521 - assert panel["safeInfoRails"] is True
2522 - assert panel["secretInputField"] is True
2523 - assert panel["failureShakeSlot"] is True
2524 - assert panel["cleanTeardownState"] is True
2525 - assert panel["serviceFedOnly"] is True
2526 - surface = payload["surfaceContract"]
2527 - assert surface["sharedSurfaceContext"] is True
2528 - assert surface["perScreenSurfaces"] is True
2529 - assert surface["activeMonitorEntryOnly"] is True
2530 - assert surface["source"] == "Quickshell lockscreen example plus Nuguland lock Content.qml"
2531 - assert surface["centerRail"] == {"role": "password-and-clock", "passwordInput": True, "clockVisible": True, "dateVisible": True}
2532 - assert surface["sideRails"] == {"safeMedia": "transport-only", "notificationSummary": "body-hidden", "resourcesVisible": True}
2533 - entry = payload["pass" + "wordInput"]
2534 - assert entry["pass" + "wordInput"] is True
2535 - assert entry["echoMode"] == "Password"
2536 - assert entry["sensitiveInputHints"] is True
2537 - assert entry["focusReclaim"] is True
2538 - assert entry["enterAction"] == "submit"
2539 - assert entry["volatilePamBuffer"] is True
2540 - assert entry["serializedSecret"] is False
2541 - assert entry["widthMorphsWithBuffer"] is True
2542 - assert entry["iconStates"] == ["lock", "unlocking", "fingerprint", "fingerprint_off"]
2543 -assert state["initial"]["active"] is False
2544 -assert state["initial"]["inputLength"] == 0
2545 -assert state["request"]["active"] is True
2546 -assert state["request"]["locked"] is True
2547 -assert state["request"]["failure"] == ""
2548 -assert state["request"]["lastAction"] == {"kind": "request", "nativeActionRoute": False, "testHarness": True}
2549 -assert state["type"]["inputLength"] == 7
2550 -assert state["type"]["failure"] == ""
2551 -assert state["type"]["lastAction"] == {"kind": "type", "secretLength": 7}
2552 -assert state["fail"]["active"] is True
2553 -assert state["fail"]["inputLength"] == 0
2554 -assert state["fail"]["failure"] == "Incorrect password"
2555 -assert state["fail"]["unlocking"] is False
2556 -assert state["fail"]["passwordInput"]["failureShake"] is True
2557 -assert state["retry"]["inputLength"] == 12
2558 -assert state["retry"]["failure"] == ""
2559 -assert state["retry"]["passwordInput"]["failureShake"] is False
2560 -assert state["submit"]["active"] is False
2561 -assert state["submit"]["locked"] is False
2562 -assert state["submit"]["unlocked"] is True
2563 -assert state["submit"]["teardownClean"] is True
2564 -assert state["submit"]["lastAction"] == {"kind": "submit", "secretLength": 12, "nativeActionRoute": False, "testHarness": True}
2565 -assert state["request2"]["active"] is True
2566 -assert state["cancel"]["active"] is False
2567 -assert state["cancel"]["locked"] is False
2568 -assert state["cancel"]["lastAction"] == {"kind": "cancel"}
2570 -network_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland networkState)
2571 -network_scan=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland networkScan)
2572 -network_select=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland networkSelect 'nugu-lab')
2573 -network_wifi_off=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland networkToggleWifi false)
2574 -network_forget=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland networkForget 'guest')
2575 -network_state=$(printf '{"initial":%s,"scan":%s,"select":%s,"wifiOff":%s,"forget":%s}\n' "$network_initial" "$network_scan" "$network_select" "$network_wifi_off" "$network_forget")
2576 -printf 'network_state=%s\n' "$network_state"
2577 -NETWORK_STATE="$network_state" python - <<'PY'
2578 -import json, os
2579 -state = json.loads(os.environ["NETWORK_STATE"])
2580 -for payload in state.values():
2581 - assert payload["backend"] == "Network.qml"
2582 - assert payload["usesNativeQuickshellNetworking"] is True
2583 - assert payload["helperProcesses"] == []
2584 - assert payload["serviceOwnedActions"] is True
2585 - assert payload["boundedActions"] == ["scan", "select", "forget", "toggle-wifi", "check-connectivity"]
2586 - panel = payload["connectivityPanelContract"]
2587 - assert panel["source"] == "Nuguland bar popouts Network.qml plus Nuguland connections Network.qml Bluetooth.qml"
2588 - assert panel["ownedBy"] == "PopoutHost.qml inline ConnectivityPanel"
2589 - assert panel["combinedConnectivityPanel"] is True
2590 - assert panel["wifiToggleScanList"] is True
2591 - assert panel["bluetoothToggleScanList"] is True
2592 - assert panel["sortedNetworkRows"] is True
2593 - assert panel["sortedDeviceRows"] is True
2594 - assert panel["batteryBadges"] is True
2595 - assert panel["serviceActionsOnly"] is True
2596 - assert panel["rowKinds"] == ["wifi-network", "bluetooth-device"]
2597 - assert payload["testHarness"] is True
2598 - assert payload["nativeActionRoute"] is False
2599 - blocked_marker = "dry" + "Run"
2600 - assert blocked_marker not in payload
2601 - assert payload["knownNetworksById"]["nugu-lan"]["ssid"] == "nugu-lan"
2602 - assert payload["compact"]["label"]
2603 -assert state["initial"]["wifi"]["enabled"] is True
2604 -assert state["initial"]["active"]["ssid"] == "nugu-lan"
2605 -assert state["scan"]["scanning"] is True
2606 -assert state["scan"]["lastAction"] == {"kind": "scan", "nativeActionRoute": False}
2607 -assert state["select"]["active"]["ssid"] == "nugu-lab"
2608 -assert state["select"]["active"]["state"] == "connecting"
2609 -assert state["select"]["compact"]["role"] == "warning"
2610 -assert state["select"]["lastAction"] == {"kind": "select", "id": "nugu-lab", "nativeActionRoute": False}
2611 -assert state["wifiOff"]["wifi"]["enabled"] is False
2612 -assert state["wifiOff"]["compact"]["role"] == "ui.minor"
2613 -assert state["forget"]["lastAction"] == {"kind": "forget", "id": "guest", "nativeActionRoute": False}
2614 -assert "guest" not in state["forget"]["knownNetworksById"]
2616 -bluetooth_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland bluetoothState)
2617 -bluetooth_scan=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland bluetoothScan)
2618 -bluetooth_off=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland bluetoothToggle false)
2619 -bluetooth_connect=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland bluetoothDeviceAction connect headphones)
2620 -bluetooth_forget=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland bluetoothDeviceAction forget mouse)
2621 -bluetooth_state=$(printf '{"initial":%s,"scan":%s,"off":%s,"connect":%s,"forget":%s}\n' "$bluetooth_initial" "$bluetooth_scan" "$bluetooth_off" "$bluetooth_connect" "$bluetooth_forget")
2622 -printf 'bluetooth_state=%s\n' "$bluetooth_state"
2623 -BLUETOOTH_STATE="$bluetooth_state" python - <<'PY'
2624 -import json, os
2625 -state = json.loads(os.environ["BLUETOOTH_STATE"])
2626 -for payload in state.values():
2627 - assert payload["backend"] == "Bluetooth.qml"
2628 - assert payload["usesNativeQuickshellBluetooth"] is True
2629 - assert payload["helperProcesses"] == []
2630 - assert payload["serviceOwnedActions"] is True
2631 - assert payload["boundedActions"] == ["scan", "toggle", "connect", "disconnect", "pair", "forget", "trust", "block"]
2632 - assert payload["testHarness"] is True
2633 - assert payload["nativeActionRoute"] is False
2634 - blocked_marker = "dry" + "Run"
2635 - assert blocked_marker not in payload
2636 - assert payload["devicesById"]["headphones"]["name"] == "Nugu Headphones"
2637 - assert payload["compact"]["label"]
2638 -assert state["initial"]["adapter"]["state"] == "powered"
2639 -assert state["initial"]["devicesById"]["mouse"]["battery"] == 62
2640 -assert state["scan"]["adapter"]["discovering"] is True
2641 -assert state["scan"]["lastAction"] == {"kind": "scan", "nativeActionRoute": False}
2642 -assert state["off"]["adapter"]["state"] == "disabled"
2643 -assert state["off"]["compact"]["role"] == "ui.minor"
2644 -assert state["connect"]["devicesById"]["headphones"]["connected"] is True
2645 -assert state["connect"]["lastAction"] == {"kind": "connect", "id": "headphones", "nativeActionRoute": False}
2646 -assert state["forget"]["lastAction"] == {"kind": "forget", "id": "mouse", "nativeActionRoute": False}
2647 -assert "mouse" not in state["forget"]["devicesById"]
2649 -power_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland powerState)
2650 -power_profile=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland powerSetProfile performance)
2651 -power_lock=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland powerSessionAction lock)
2652 -power_reboot=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland powerSessionAction reboot)
2653 -power_confirm=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland powerConfirmAction reboot)
2654 -power_cancel=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland powerCancelAction)
2655 -power_monitor=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland powerSessionAction monitor-off)
2656 -power_state=$(printf '{"initial":%s,"profile":%s,"lock":%s,"reboot":%s,"confirm":%s,"cancel":%s,"monitor":%s}\n' "$power_initial" "$power_profile" "$power_lock" "$power_reboot" "$power_confirm" "$power_cancel" "$power_monitor")
2657 -printf 'power_state=%s\n' "$power_state"
2658 -POWER_STATE="$power_state" python - <<'PY'
2659 -import json, os
2660 -state = json.loads(os.environ["POWER_STATE"])
2661 -for key, payload in state.items():
2662 - assert payload["backend"] == "Power.qml"
2663 - assert payload["usesUPower"] is True
2664 - assert payload["testHarness"] is True
2665 - assert payload["nativeActionRoute"] is False
2666 - assert payload["helperProcesses"] == []
2667 - assert payload["serviceOwnedActions"] is True
2668 - assert payload["boundedActions"] == ["lock", "logout", "suspend", "reboot", "poweroff", "monitor-off", "monitor-on", "set-profile", "confirm", "cancel"]
2669 - panel = payload["powerPanelContract"]
2670 - assert panel["source"] == "Nuguland session Content.qml plus Nuguland SessionScreen.qml plus Nuguland Power.qml"
2671 - assert panel["ownedBy"] == "PopoutHost.qml inline PowerPanel"
2672 - assert panel["upowerSessionPanel"] is True
2673 - assert panel["batteryHero"] is True
2674 - assert panel["externalDeviceBatteryRows"] is True
2675 - assert panel["powerProfileSelector"] is True
2676 - assert panel["keyboardActionGrid"] is True
2677 - assert panel["confirmationStrip"] is True
2678 - assert panel["destructiveTwoStep"] is True
2679 - assert panel["serviceActionsOnly"] is True
2680 - assert panel["safeDefault"] == "lock"
2681 - assert payload["battery"]["percent"] == 73
2682 - assert payload["battery"]["state"] == "discharging"
2683 - assert payload["battery"]["timeEstimate"] == "3h 12m"
2684 - assert payload["battery"]["health"] == 91
2685 - assert payload["battery"]["role"] == "ui.accent"
2686 - assert payload["externalDevicesById"]["mouse"]["percent"] == 62
2687 - assert payload["session"]["requiresConfirmation"] == ["logout", "reboot", "poweroff"]
2688 - assert payload["session"]["safeDefault"] == "lock"
2689 - assert payload["compact"]["label"] == "73%"
2690 - assert payload["compact"]["role"] == "ui.accent"
2691 -assert state["initial"]["profile"] == "balanced"
2692 -assert state["profile"]["profile"] == "performance"
2693 -assert state["profile"]["lastAction"] == {"kind": "set-profile", "profile": "performance", "nativeActionRoute": False, "testHarness": True}
2694 -assert state["lock"]["lastAction"] == {"kind": "lock", "nativeActionRoute": False, "testHarness": True, "confirmed": True}
2695 -assert state["lock"]["pendingConfirmation"] == ""
2696 -assert state["reboot"]["lastAction"] == {"kind": "reboot", "nativeActionRoute": False, "testHarness": True, "confirmed": False}
2697 -assert state["reboot"]["pendingConfirmation"] == "reboot"
2698 -assert state["confirm"]["lastAction"] == {"kind": "reboot", "nativeActionRoute": False, "testHarness": True, "confirmed": True}
2699 -assert state["confirm"]["pendingConfirmation"] == ""
2700 -assert state["cancel"]["lastAction"] == {"kind": "cancel"}
2701 -assert state["cancel"]["pendingConfirmation"] == ""
2702 -assert state["monitor"]["lastAction"] == {"kind": "monitor-off", "nativeActionRoute": False, "testHarness": True, "confirmed": True}
2704 -cpu_low=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland cpuWidgetState 0.20)
2705 -cpu_mid=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland cpuWidgetState 0.72)
2706 -cpu_high=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland cpuWidgetState 0.93)
2707 -cpu_colors=$(printf '{"low":%s,"mid":%s,"high":%s}\n' "$cpu_low" "$cpu_mid" "$cpu_high")
2708 -printf 'cpu_colors=%s\n' "$cpu_colors"
2709 -printf '%s\n' "$cpu_colors" | python -c 'import json,sys; c=json.load(sys.stdin); assert c["low"]["signal"] == "normal"; assert c["low"]["colorRole"] == "ui.accent"; assert c["mid"]["signal"] == "warning"; assert c["mid"]["colorRole"] == "warning"; assert c["high"]["signal"] == "error"; assert c["high"]["colorRole"] == "error"'
2710 -resource_hero_card=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland resourceHeroCard cpu 0.72 '0.12,0.24,0.38,0.72')
2711 -printf 'resource_hero_card=%s\n' "$resource_hero_card"
2712 -RESOURCE_HERO_CARD="$resource_hero_card" python - <<'PY'
2713 -import json
2714 -import os
2715 -card = json.loads(os.environ["RESOURCE_HERO_CARD"])
2716 -assert card["source"] == "Nuguland performance HeroCard.qml plus Nuguland Graph.qml"
2717 -assert card["kind"] == "cpu"
2718 -assert card["title"] == "CPU"
2719 -assert card["value"] == 0.72
2720 -assert card["percent"] == 72
2721 -assert card["signal"] == "warning"
2722 -assert card["role"] == "warning"
2723 -assert card["boundedHeroMeter"]["source"] == "Nuguland performance HeroCard.qml"
2724 -assert card["boundedHeroMeter"]["value"] == 0.72
2725 -assert card["boundedHeroMeter"]["shape"] == "sunny"
2726 -assert card["sparkline"]["source"] == "Nuguland Graph.qml"
2727 -assert card["sparkline"]["sampleCount"] == 4
2728 -assert card["sparkline"]["alignment"] == "right"
2729 -assert card["sparklineSamples"] == [0.12, 0.24, 0.38, 0.72]
2730 -assert card["helperProcesses"] == []
2731 -assert card["widgetProcesses"] == "forbidden"
2733 -attention_colors=$(printf '{"notification":%s,"tray":%s}\n' \
2734 - "$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationWidgetState true true)" \
2735 - "$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland trayWidgetState true true)")
2736 -printf 'attention_colors=%s\n' "$attention_colors"
2737 -printf '%s\n' "$attention_colors" | python -c 'import json,sys; s=json.load(sys.stdin); n=s["notification"]; t=s["tray"]; assert n["activeRole"] == "ui.focus"; assert n["attentionRole"] == "warning"; assert n["attentionRole"] != n["activeRole"]; assert n["borderRole"] == "warning"; assert t["activeRole"] == "ui.focus"; assert t["attentionRole"] == "info"; assert t["attentionRole"] != t["activeRole"]; assert t["borderRole"] == "info"'
2738 -notifications_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsSeed)
2739 -notification_revealer_anchor='{}'
2740 -i=0
2741 -while [ "$i" -lt 40 ]; do
2742 - notification_revealer_anchor=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland registeredAnchors)
2743 - if printf '%s\n' "$notification_revealer_anchor" | python -c 'import json,sys; anchor=json.load(sys.stdin)["notifications"]; assert anchor["width"] > 42' 2>/dev/null; then
2744 - break
2745 - fi
2746 - i=$((i + 1))
2747 - sleep 0.05
2748 -done
2749 -printf 'notification_revealer_anchor=%s\n' "$notification_revealer_anchor"
2750 -printf '%s\n' "$notification_revealer_anchor" | python -c 'import json,sys; anchor=json.load(sys.stdin)["notifications"]; assert anchor["width"] > 42; assert anchor["height"] > 10'
2751 -notifications_dnd=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsToggleDnd)
2752 -notifications_server=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsAction chat-2 reply)
2753 -notifications_copy=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsAction chat-2 copy-body)
2754 -notifications_close=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsAction chat-1 close)
2755 -notifications_group=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsToggleGroup Chat)
2756 -notifications_drag_snap=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsDrag chat-2 40 320)
2757 -notifications_drag_commit=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsDrag build-1 160 320)
2758 -notifications_clear=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland notificationsDiscardAll)
2759 -notifications_state=$(printf '{"initial":%s,"dnd":%s,"server":%s,"copy":%s,"close":%s,"group":%s,"dragSnap":%s,"dragCommit":%s,"clear":%s}\n' "$notifications_initial" "$notifications_dnd" "$notifications_server" "$notifications_copy" "$notifications_close" "$notifications_group" "$notifications_drag_snap" "$notifications_drag_commit" "$notifications_clear")
2760 -printf 'notifications_state=%s\n' "$notifications_state"
2761 -NOTIFICATIONS_STATE="$notifications_state" python - <<'PY'
2762 -import json, os
2763 -state = json.loads(os.environ["NOTIFICATIONS_STATE"])
2764 -for payload in state.values():
2765 - assert payload["backend"] == "Notifications.qml"
2766 - assert payload["usesNativeNotificationServer"] is True
2767 - assert payload["testHarness"] is True
2768 - assert payload["nativeActionRoute"] is False
2769 - assert payload["groupedByAppLatestFirst"] is True
2770 - assert payload["horizontalActionRows"] is True
2771 - assert payload["dragDismissContract"]["source"] == "Nuguland NotifGroupList.qml"
2772 - assert payload["dragDismissContract"]["dismissThresholdRatio"] == 0.35
2773 - assert payload["dragDismissContract"]["snapBackTransition"] == "drag-snap-back"
2774 - assert payload["dragDismissContract"]["commitTransition"] == "drag-dismiss-commit"
2775 - assert payload["dragDismissContract"]["removalLifecycleLock"] is True
2776 - assert payload["actionKinds"] == ["close", "server-action", "copy-body"]
2777 - assert payload["persistenceShape"] == ["id", "appName", "summary", "body", "time", "urgency", "actions"]
2778 - assert payload["discardAll"] is True
2779 -initial = state["initial"]
2780 -assert initial["unreadCount"] == 3
2781 -panel = initial["notificationPanelContract"]
2782 -assert panel["source"] == "Nuguland NotifGroup.qml NotifGroupList.qml NotifActionList.qml"
2783 -assert panel["ownedBy"] == "PopoutHost.qml inline NotificationGroup"
2784 -assert panel["groupedCardPanel"] is True
2785 -assert panel["appMediaSlot"] is True
2786 -assert panel["expandPill"] is True
2787 -assert panel["animatedExpandHeight"] is True
2788 -assert panel["maskedHorizontalActionRail"] is True
2789 -assert panel["visiblePreviewCount"] == 1
2790 -assert panel["actionRailKinds"] == ["close", "server-action", "copy-body"]
2791 -assert panel["pointerParity"] == ["left-toggle-expand", "middle-close", "horizontal-drag-dismiss"]
2792 -assert panel["keyboardParity"] == ["Return", "Space", "Escape"]
2793 -assert initial["scrollableListChrome"]["source"] == "Nuguland ScrollEdgeFade.qml plus Nuguland FlickMonitor.qml"
2794 -assert initial["scrollableListChrome"]["scrollEdgeFade"] is True
2795 -assert initial["scrollableListChrome"]["topEdgeFade"] is False
2796 -assert initial["scrollableListChrome"]["bottomEdgeFade"] is True
2797 -assert initial["scrollableListChrome"]["scrollHint"] == {"visible": True, "icon": "notifications", "side": "right", "tooltip": "scroll notifications"}
2798 -assert initial["scrollableListChrome"]["flickMonitor"] == {"enabled": True, "velocitySamples": 6, "events": ["pressed", "positionChanged", "released"]}
2799 -assert [group["appName"] for group in initial["groups"]] == ["Chat", "Build"]
2800 -assert [group["latestTime"] for group in initial["groups"]] == [5000, 3000]
2801 -chat = initial["groups"][0]
2802 -assert chat["count"] == 2
2803 -assert chat["visibleNotifications"][0]["id"] == "chat-2"
2804 -assert len(chat["visibleNotifications"]) == 1
2805 -assert chat["expandCollapseState"] == "collapsed"
2806 -assert chat["animatedExpandHeight"] is True
2807 -assert [n["id"] for n in chat["notifications"]] == ["chat-2", "chat-1"]
2808 -assert [row["kind"] for row in chat["notifications"][0]["actionRows"]] == ["close", "server-action", "server-action", "copy-body"]
2809 -assert all(row["route"] == "Notifications.qml" for row in chat["notifications"][0]["actionRows"])
2810 -assert state["dnd"]["dnd"] is True
2811 -assert state["dnd"]["popupInhibition"] is True
2812 -assert state["dnd"]["lastAction"] == {"kind": "toggle-dnd", "enabled": True}
2813 -assert state["server"]["lastAction"] == {"kind": "server-action", "id": "chat-2", "actionId": "reply", "invoked": False, "route": "Notifications.qml", "nativeActionRoute": False, "testHarness": True}
2814 -assert state["copy"]["lastAction"] == {"kind": "copy-body", "id": "chat-2", "bodyCopied": True, "route": "Notifications.qml"}
2815 -assert state["close"]["lastAction"] == {"kind": "close", "id": "chat-1", "route": "Notifications.qml", "nativeActionRoute": False, "testHarness": True}
2816 -assert state["close"]["unreadCount"] == 2
2817 -assert state["close"]["groups"][0]["count"] == 1
2818 -assert state["group"]["expandedGroups"] == ["Chat"]
2819 -assert state["group"]["groups"][0]["expanded"] is True
2820 -assert state["group"]["lastAction"] == {"kind": "toggleGroup", "appName": "Chat", "expanded": True}
2821 -assert state["dragSnap"]["lastAction"]["transition"] == "drag-snap-back"
2822 -assert state["dragSnap"]["lastAction"]["committed"] is False
2823 -assert state["dragSnap"]["groups"][0]["count"] == 1
2824 -assert state["dragCommit"]["lastAction"]["transition"] == "drag-dismiss-commit"
2825 -assert state["dragCommit"]["lastAction"]["committed"] is True
2826 -assert state["dragCommit"]["lastAction"]["removalLifecycleLock"] is True
2827 -assert state["dragCommit"]["activeCount"] == 1
2828 -assert [group["appName"] for group in state["dragCommit"]["groups"]] == ["Chat"]
2829 -assert state["clear"]["activeCount"] == 0
2830 -assert state["clear"]["unreadCount"] == 0
2831 -assert state["clear"]["groups"] == []
2832 -assert state["clear"]["lastAction"] == {"kind": "discardAll", "route": "Notifications.qml"}
2834 -tray_initial=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland trayState)
2835 -tray_expand_network=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland trayMenuExpand network)
2836 -tray_expand_audio=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland trayMenuExpand audio)
2837 -tray_check=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland trayMenuActivate pin)
2838 -tray_disabled=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland trayMenuActivate quit-disabled)
2839 -tray_action=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland trayMenuActivate open)
2840 -tray_close=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland trayMenuClose escape)
2841 -tray_state=$(printf '{"initial":%s,"network":%s,"audio":%s,"check":%s,"disabled":%s,"action":%s,"close":%s}\n' "$tray_initial" "$tray_expand_network" "$tray_expand_audio" "$tray_check" "$tray_disabled" "$tray_action" "$tray_close")
2842 -printf 'tray_state=%s\n' "$tray_state"
2843 -TRAY_STATE="$tray_state" python - <<'PY'
2844 -import json, os
2845 -state = json.loads(os.environ["TRAY_STATE"])
2846 -expected_kinds = ["action", "separator", "submenu", "check", "radio", "disabled"]
2847 -for key, payload in state.items():
2848 - assert payload["backend"] == "Tray.qml"
2849 - assert payload["usesNativeSystemTray"] is True
2850 - assert payload["usesDBusMenu"] is True
2851 - assert payload["helperProcesses"] == []
2852 - assert payload["nativeMenuHost"] == "bar-popout-host"
2853 - panel = payload["trayPanelContract"]
2854 - assert panel["source"] == "Nuguland TrayItem.qml plus Nuguland SysTray.qml MenuView.qml plus Nuguland TrayOverflowMenu.qml"
2855 - assert panel["ownedBy"] == "PopoutHost.qml inline TrayPanel"
2856 - assert panel["nativeTrayMenuPanel"] is True
2857 - assert panel["trayItemGrid"] is True
2858 - assert panel["dbusMenuRows"] is True
2859 - assert panel["submenuCollapsePolicy"] is True
2860 - assert panel["menuClosePropagation"] is True
2861 - assert panel["attentionStatus"] is True
2862 - assert panel["serviceActionsOnly"] is True
2863 - assert payload["oneExpandedSubmenu"] is True
2864 - assert payload["siblingsCollapsed"] is True
2865 - assert payload["rowKinds"] == expected_kinds
2866 - assert {row["kind"] for row in payload["rows"]} == set(expected_kinds)
2867 -assert state["initial"]["expandedSubmenu"] == ""
2868 -assert state["network"]["expandedSubmenu"] == "network"
2869 -assert [row for row in state["network"]["rows"] if row["kind"] == "submenu" and row["expanded"]][0]["id"] == "network"
2870 -assert state["audio"]["expandedSubmenu"] == "audio"
2871 -expanded = [row["id"] for row in state["audio"]["rows"] if row["kind"] == "submenu" and row["expanded"]]
2872 -assert expanded == ["audio"], expanded
2873 -assert state["audio"]["lastAction"] == {"kind": "expand-submenu", "id": "audio", "accepted": True}
2874 -assert state["check"]["lastAction"] == {"kind": "activate-row", "id": "pin", "rowKind": "check", "accepted": True}
2875 -assert state["check"]["closePropagation"] == {"requested": False, "source": "pin", "reason": "check-toggle"}
2876 -assert state["disabled"]["lastAction"] == {"kind": "activate-row", "id": "quit-disabled", "rowKind": "disabled", "accepted": False}
2877 -assert state["disabled"]["closePropagation"] == {"requested": False, "source": "quit-disabled", "reason": "disabled"}
2878 -assert state["action"]["closeRequested"] is True
2879 -assert state["action"]["closePropagation"] == {"requested": True, "source": "open", "reason": "row-activated"}
2880 -assert state["close"]["expandedSubmenu"] == ""
2881 -assert state["close"]["closePropagation"] == {"requested": True, "source": "menu", "reason": "escape"}
2883 -popout_catalog=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutContentCatalog)
2884 -printf 'popout_content_catalog=%s\n' "$popout_catalog"
2885 -POPOUT_CATALOG="$popout_catalog" python - <<'PY'
2886 -import json, os
2887 -catalog = json.loads(os.environ["POPOUT_CATALOG"])
2888 -assert catalog["host"] == "PopoutHost.qml"
2889 -assert catalog["loaderPolicy"] == "single-active-loader-with-close-retention"
2890 -assert catalog["completeContent"] is True
2891 -expected_entries = {
2892 - "clock": {"component": "calendar-agenda", "source": "Time.qml", "visual": ["clock", "date", "calendar-grid", "agenda"]},
2893 - "cpu": {"component": "resource-card", "source": "Resources.qml", "visual": ["cpu-percent", "signal-role", "kernel-facts"]},
2894 - "notifications": {"component": "notification-history", "source": "Notifications.qml", "visual": ["summary", "attention", "actions"]},
2895 - "tray": {"component": "tray-menu-host", "source": "Tray.qml", "visual": ["items", "attention", "native-menu-host"]},
2896 - "window": {"component": "window-rule-card", "source": "Niri.qml", "visual": ["app-id", "title", "workspace", "rule-hints"]},
2897 - "media": {"component": "media-controls", "source": "Media.qml", "visual": ["active-player", "transport", "progress", "selection"]},
2898 - "clipboard": {"component": "clipboard-history", "source": "Clipboard.qml", "visual": ["search", "pinned", "private-mode", "launcher-rows"]},
2899 - "launcher": {"component": "launcher-search", "source": "Launcher.qml", "visual": ["provider-chips", "single-list", "preview", "bottom-search"]},
2900 - "dashboard": {"component": "personal-dashboard", "source": "Dashboard.qml", "visual": ["tabs", "today", "media", "resources", "controls"]},
2901 - "audio": {"component": "audio-mixer", "source": "Audio.qml", "visual": ["sinks", "sources", "streams", "mute"]},
2902 - "connectivity": {"component": "connectivity-panel", "source": "Network.qml+Bluetooth.qml", "visual": ["network", "wifi", "bluetooth", "devices"]},
2903 - "power": {"component": "power-battery", "source": "Power.qml", "visual": ["battery", "profile", "session", "confirmation"]},
2904 - "screenshots": {"component": "screenshot-tools", "source": "Screenshots.qml", "visual": ["selection", "recent", "color", "actions"]},
2905 - "idle": {"component": "idle-privacy", "source": "Idle.qml", "visual": ["inhibit", "duration", "activity", "privacy"]},
2906 - "diagnostics": {"component": "diagnostics-card", "source": "Diagnostics.qml", "visual": ["services", "processes", "surfaces", "smoke"]},
2908 -assert catalog["entries"] == expected_entries
2910 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland closePopout >/dev/null
2911 -sleep 0.25
2912 -closed_hover_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland hoverRegisteredPopout media)
2913 -printf 'popout_closed_hover_state=%s\n' "$closed_hover_state"
2914 -printf '%s\n' "$closed_hover_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is False; assert s["hoverSwitchPolicy"]["switchesOnlyWhenOpen"] is True'
2915 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland openRegisteredPopout clock >/dev/null
2916 -popout_switch_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland hoverRegisteredPopout media)
2917 -printf 'popout_switch_state=%s\n' "$popout_switch_state"
2918 -POPOUT_SWITCH_STATE="$popout_switch_state" python - <<'PY'
2919 -import json, os
2920 -state = json.loads(os.environ["POPOUT_SWITCH_STATE"])
2921 -choreo = state["loaderChoreography"]
2922 -assert state["name"] == "media"
2923 -assert state["lastInteraction"] == "hover-switch"
2924 -assert state["hoverSwitchPolicy"] == {"source": "Nuguland bar.checkPopout hover switching", "event": "hover-switch", "switchesOnlyWhenOpen": True, "retainsPreviousDuringHoverSwitch": True, "anchorMorph": "previous-anchor-to-next-anchor", "loaderPolicy": "single-active-loader-with-close-retention"}
2925 -assert state["activeLoaderName"] == "media"
2926 -assert state["pendingLoaderName"] == ""
2927 -assert state["removingLoaderName"] == "clock"
2928 -assert state["previousContent"] == {"name": "clock", "size": {"width": 260, "height": 160}, "fade": "outgoingFade", "retentionMs": 180}
2929 -assert choreo["policy"] == "single-active-loader-with-close-retention"
2930 -assert choreo["source"] == "Nuguland Wrapper.qml Content.qml loader transitions"
2931 -assert choreo["activeLoaderName"] == "media"
2932 -assert choreo["pendingLoaderName"] == ""
2933 -assert choreo["removingLoaderName"] == "clock"
2934 -assert choreo["previousContent"] == state["previousContent"]
2935 -assert choreo["incomingFade"] == {"from": 0, "to": 1, "ms": 180}
2936 -assert choreo["outgoingFade"] == {"from": 1, "to": 0, "ms": 180, "unloadAfter": True}
2937 -assert choreo["closeRetentionMs"] == 180
2938 -assert choreo["sizeTween"] == {"width": True, "height": True, "ms": 180, "easing": "OutCubic"}
2939 -assert choreo["anchorTween"] == {"rect": True, "origin": "anchor-bottom-center", "ms": 180, "easing": "OutCubic"}
2940 -assert choreo["separatorBridge"] == {"growsThroughBarSeparator": True, "clipsContent": True}
2941 -assert choreo["lastActiveHangScale"] == {"from": 0.9, "to": 1.0, "keptUntilFadeOut": True}
2943 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland closePopout >/dev/null
2944 -for widget in clock launcher dashboard media cpu clipboard audio connectivity power notifications tray screenshots idle diagnostics window; do
2945 - case "$widget" in
2946 - clock) expected_size=260x160 ;;
2947 - media) expected_size=420x260 ;;
2948 - cpu) expected_size=300x180 ;;
2949 - clipboard) expected_size=420x300 ;;
2950 - launcher) expected_size=620x360 ;;
2951 - dashboard) expected_size=460x340 ;;
2952 - audio) expected_size=400x300 ;;
2953 - connectivity) expected_size=420x320 ;;
2954 - power) expected_size=380x280 ;;
2955 - notifications) expected_size=380x240 ;;
2956 - tray) expected_size=340x260 ;;
2957 - screenshots) expected_size=420x280 ;;
2958 - idle) expected_size=340x220 ;;
2959 - diagnostics) expected_size=460x320 ;;
2960 - window) expected_size=420x220 ;;
2961 - esac
2962 - live_registered_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland registeredAnchors)
2963 - widget_popout_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland openRegisteredPopout "$widget")
2964 - printf 'widget_popout_%s=%s\n' "$widget" "$widget_popout_state"
2965 - WIDGET="$widget" EXPECTED_SIZE="$expected_size" REGISTERED="$live_registered_state" STATE="$widget_popout_state" python - <<'PY'
2966 -import json, os
2967 -widget = os.environ["WIDGET"]
2968 -registered = json.loads(os.environ["REGISTERED"])
2969 -state = json.loads(os.environ["STATE"])
2970 -anchor = registered[widget]
2971 -assert state["open"] is True
2972 -assert state["phase"] == "opening"
2973 -assert state["progress"] == 0
2974 -assert state["name"] == widget
2975 -assert state["anchor"] == anchor
2976 -assert abs(state["origin"]["x"] - (anchor["x"] + anchor["width"] / 2)) <= 1
2977 -assert state["origin"]["y"] == anchor["y"] + anchor["height"]
2978 -morph = state["morph"]
2979 -assert morph["host"] == "bar"
2980 -assert morph["animation"] == "opening"
2981 -assert morph["growth"] == "anchor-bottom-center"
2982 -assert morph["attached"] is True
2983 -assert morph["loaderActive"] is True
2984 -assert morph["separatorInterruption"] is True
2985 -expected_width, expected_height = map(int, os.environ["EXPECTED_SIZE"].split("x"))
2986 -assert morph["targetRect"]["width"] == expected_width
2987 -assert morph["targetRect"]["height"] == expected_height
2988 -assert state["contentSize"] == {"width": expected_width, "height": expected_height}
2989 -expected_x = max(0, round(state["origin"]["x"] - expected_width / 2))
2990 -screen_width = state.get("screen", {}).get("width", 0)
2991 -if screen_width > 0:
2992 - expected_x = min(expected_x, max(0, screen_width - expected_width))
2993 - assert morph["targetRect"]["x"] + morph["targetRect"]["width"] <= screen_width
2994 -assert morph["targetRect"]["x"] == expected_x
2995 -assert morph["targetRect"]["y"] == state["origin"]["y"]
2996 -assert state["popupAnchorRect"]["x"] == state["morph"]["targetRect"]["x"]
2997 -assert state["popupAnchorRect"]["y"] == state["morph"]["targetRect"]["y"]
2998 -assert state["popupAnchorRect"]["width"] == state["morph"]["targetRect"]["width"]
2999 -assert state["popupAnchorRect"]["height"] == 1
3000 -frame = state["cardMorphFrame"]
3001 -assert frame["source"] == "visible-bar-anchor-to-card-morph"
3002 -assert frame["progress"] == 0
3003 -assert frame["currentRect"] == frame["sourceLocalRect"]
3004 -assert frame["targetLocalRect"] == {"x": 8, "y": 8, "width": expected_width - 16, "height": expected_height - 16}
3005 -assert frame["sourceLocalRect"]["width"] == anchor["width"]
3006 -assert frame["sourceLocalRect"]["height"] == anchor["height"]
3007 -assert 0 <= frame["sourceLocalRect"]["x"] <= state["popupAnchorRect"]["width"] - frame["sourceLocalRect"]["width"]
3008 -assert state["popupInputMaskFrame"] == state["cardMorphFrame"]["currentRect"]
3010 - i=0
3011 - while [ "$i" -lt 20 ]; do
3012 - widget_settled_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
3013 - if printf '%s\n' "$widget_settled_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is True; assert s["phase"] == "open"; assert s["progress"] == 1; assert s["cardMorphFrame"]["currentRect"] == s["cardMorphFrame"]["targetLocalRect"]' 2>/dev/null; then
3014 - break
3015 - fi
3016 - i=$((i + 1))
3017 - sleep 0.05
3018 - done
3019 - printf 'widget_popout_settled_%s=%s\n' "$widget" "$widget_settled_state"
3020 - WIDGET="$widget" EXPECTED_SIZE="$expected_size" REGISTERED="$live_registered_state" STATE="$widget_settled_state" python - <<'PY'
3021 -import json, os
3022 -widget = os.environ["WIDGET"]
3023 -registered = json.loads(os.environ["REGISTERED"])
3024 -state = json.loads(os.environ["STATE"])
3025 -anchor = registered[widget]
3026 -expected_width, expected_height = map(int, os.environ["EXPECTED_SIZE"].split("x"))
3027 -assert state["open"] is True
3028 -assert state["phase"] == "open"
3029 -assert state["progress"] == 1
3030 -assert state["name"] == widget
3031 -assert state["anchor"] == anchor
3032 -assert state["contentSize"] == {"width": expected_width, "height": expected_height}
3033 -assert state["morph"]["animation"] == "open"
3034 -assert state["morph"]["growth"] == "anchor-bottom-center"
3035 -assert state["morph"]["targetRect"]["width"] == expected_width
3036 -assert state["morph"]["targetRect"]["height"] == expected_height
3037 -frame = state["cardMorphFrame"]
3038 -assert frame["progress"] == 1
3039 -assert frame["currentRect"] == frame["targetLocalRect"]
3040 -assert state["popupInputMaskFrame"] == frame["currentRect"]
3042 - if [ "$widget" = notifications ] && [ -s "$screen_shot" ]; then
3043 - popout_shot="$tmp/screens/popout-notifications.png"
3044 - HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland screenshotScreen "$popout_shot" >/dev/null
3045 - i=0
3046 - while [ "$i" -lt 50 ] && [ ! -s "$popout_shot" ]; do
3047 - i=$((i + 1))
3048 - sleep 0.1
3049 - done
3050 - [ -s "$popout_shot" ] || fail 'niri popout screenshot did not create a nonempty file'
3051 - printf 'popout_screenshot=%s bytes=%s\n' "$popout_shot" "$(wc -c <"$popout_shot")"
3052 - popout_visual=$(pngVisualProbe "$popout_shot" popout)
3053 - printf 'popout_visual=%s\n' "$popout_visual"
3054 - region_rect=$(
3055 - STATE="$widget_settled_state" python - <<'PY'
3056 -import json
3057 -import os
3058 -state = json.loads(os.environ["STATE"])
3059 -print(json.dumps(state["morph"]["targetRect"], separators=(",", ":")))
3062 - region_visual=$(pngRegionVisualProbe "$screen_shot" "$popout_shot" "$region_rect")
3063 - printf 'popout_region_visual=%s\n' "$region_visual"
3064 - SCREEN_VISUAL="$screen_visual" POPOUT_VISUAL="$popout_visual" REGION_VISUAL="$region_visual" python - <<'PY'
3065 -import json
3066 -import os
3067 -screen = json.loads(os.environ["SCREEN_VISUAL"])
3068 -popout = json.loads(os.environ["POPOUT_VISUAL"])
3069 -region = json.loads(os.environ["REGION_VISUAL"])
3070 -assert screen["width"] == popout["width"]
3071 -assert screen["height"] == popout["height"]
3072 -assert screen["notBlank"] is True
3073 -assert popout["notBlank"] is True
3074 -assert screen["sha256"] != popout["sha256"]
3075 -assert region["targetRectChanged"] is True
3076 -assert region["changedPixels"] >= 100
3077 -print("visual_hash_changed=true")
3079 - reference_visual_comparison=$(
3080 - SCREEN_VISUAL="$screen_visual" POPOUT_VISUAL="$popout_visual" REGION_VISUAL="$region_visual" REFERENCE_SOURCE_FINGERPRINTS="$reference_source_fingerprints" REFERENCE_ADOPTION_MATRIX="$reference_adoption_matrix" REFERENCE_COMPARISON_NOTES="$reference_comparison_notes" python - <<'PY'
3081 -import json
3082 -import os
3084 -screen = json.loads(os.environ["SCREEN_VISUAL"])
3085 -popout = json.loads(os.environ["POPOUT_VISUAL"])
3086 -region = json.loads(os.environ["REGION_VISUAL"])
3087 -fingerprints = json.loads(os.environ["REFERENCE_SOURCE_FINGERPRINTS"])
3088 -adoption = json.loads(os.environ["REFERENCE_ADOPTION_MATRIX"])
3089 -notes = json.loads(os.environ["REFERENCE_COMPARISON_NOTES"])
3090 -source_ids = [row["id"] for row in fingerprints["rows"]]
3091 -visual_notes = []
3092 -for row in adoption["rows"]:
3093 - proof = row["proofMarker"]
3094 - if proof == "popout_region_visual":
3095 - evidence = "target rect PNG pixels changed"
3096 - elif proof in ("registered_anchors", "diagnostics_state", "niri_state"):
3097 - evidence = f"{proof} plus nested bar screenshot evidence"
3098 - else:
3099 - evidence = f"{proof} runtime contract plus nested popout screenshot evidence"
3100 - visual_notes.append({
3101 - "sourceId": row["sourceId"],
3102 - "owner": row["nugulandOwner"],
3103 - "runtimeContract": row["runtimeContract"],
3104 - "proofMarker": proof,
3105 - "evidence": evidence,
3106 - })
3107 -comparison = {
3108 - "referenceVisualComparison": True,
3109 - "visualConceptCoverageComplete": len(visual_notes) == len(source_ids),
3110 - "allAdoptedSourcesHaveVisualNotes": [note["sourceId"] for note in visual_notes] == source_ids,
3111 - "sourceFamilies": notes["sourceFamilies"],
3112 - "sourceIds": source_ids,
3113 - "visualHashChanged": screen["sha256"] != popout["sha256"],
3114 - "screenShot": {"label": "screen", "sha256": screen["sha256"], "uniqueColors": screen["uniqueColors"]},
3115 - "popoutShot": {"label": "popout", "sha256": popout["sha256"], "uniqueColors": popout["uniqueColors"]},
3116 - "regionChangedPixels": region["changedPixels"],
3117 - "regionChangedRatio": region["changedRatio"],
3118 - "targetRectChanged": region["targetRectChanged"],
3119 - "stolenConcepts": visual_notes,
3120 - "rejectedConcepts": notes["rejectedMechanics"],
3122 -assert comparison["visualHashChanged"] is True
3123 -assert comparison["targetRectChanged"] is True
3124 -assert comparison["regionChangedPixels"] >= 100
3125 -assert comparison["visualConceptCoverageComplete"] is True
3126 -assert comparison["allAdoptedSourcesHaveVisualNotes"] is True
3127 -assert len(comparison["stolenConcepts"]) == len(source_ids)
3128 -assert comparison["stolenConcepts"][0]["owner"] == "PopoutHost.qml"
3129 -assert comparison["rejectedConcepts"][0]["replacement"] == "one bar-owned popout host"
3130 -print(json.dumps(comparison, separators=(",", ":")))
3133 - printf 'reference_visual_comparison=%s\n' "$reference_visual_comparison"
3134 - reference_review_packet=$(
3135 - REFERENCE_SOURCE_FINGERPRINTS="$reference_source_fingerprints" REFERENCE_ADOPTION_MATRIX="$reference_adoption_matrix" REFERENCE_VISUAL_COMPARISON="$reference_visual_comparison" REFERENCE_COMPARISON_NOTES="$reference_comparison_notes" python - <<'PY'
3136 -import json
3137 -import os
3138 -from collections import Counter
3139 -fingerprints = json.loads(os.environ["REFERENCE_SOURCE_FINGERPRINTS"])
3140 -adoption = json.loads(os.environ["REFERENCE_ADOPTION_MATRIX"])
3141 -visual = json.loads(os.environ["REFERENCE_VISUAL_COMPARISON"])
3142 -notes = json.loads(os.environ["REFERENCE_COMPARISON_NOTES"])
3143 -families = Counter(row["family"] for row in fingerprints["rows"])
3144 -owners = Counter(row["nugulandOwner"] for row in adoption["rows"])
3145 -proofs = Counter(row["proofMarker"] for row in adoption["rows"])
3146 -packet = {
3147 - "referenceReviewPacket": True,
3148 - "requiresHumanConfirmation": True,
3149 - "sourceRows": len(fingerprints["rows"]),
3150 - "families": dict(sorted(families.items())),
3151 - "owners": dict(sorted(owners.items())),
3152 - "proofRoutes": dict(sorted(proofs.items())),
3153 - "visualRows": len(visual["stolenConcepts"]),
3154 - "rejectedRows": len(visual["rejectedConcepts"]),
3155 - "allSourcesMapped": adoption["allSourceIdsMapped"] is True,
3156 - "allVisualNotesPresent": visual["allAdoptedSourcesHaveVisualNotes"] is True,
3157 - "firstAdoptedMechanic": notes["adoptedMechanics"][0],
3158 - "firstRejectedMechanic": notes["rejectedMechanics"][0]
3160 -assert packet["sourceRows"] == 77
3161 -assert packet["visualRows"] == packet["sourceRows"]
3162 -assert packet["allSourcesMapped"] is True
3163 -assert packet["allVisualNotesPresent"] is True
3164 -print(json.dumps(packet, separators=(",", ":")))
3167 - printf 'reference_review_packet=%s\n' "$reference_review_packet"
3168 - fi
3169 - HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland closePopout >/dev/null
3170 -done
3171 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland openRegisteredPopout notifications >/dev/null
3172 -inside_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutInteraction inside)
3173 -printf 'popout_inside_state=%s\n' "$inside_state"
3174 -printf '%s\n' "$inside_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is True; assert s["name"] == "notifications"; assert s["lastInteraction"] == "inside"; assert s["lastCloseReason"] == ""; assert s["popoutFocusPolicy"]["nativePopupGrabFocus"] is True; assert s["popoutFocusPolicy"]["compositorFocusGrab"] is False'
3175 -outside_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutInteraction outside)
3176 -printf 'popout_outside_state=%s\n' "$outside_state"
3177 -printf '%s\n' "$outside_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is False; assert s["closing"] is True; assert s["name"] == "notifications"; assert s["lastInteraction"] == "outside"; assert s["lastCloseReason"] == "outside"; assert s["morph"]["dismissal"] == "reverse-anchor-bottom-center"'
3178 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland openRegisteredPopout notifications >/dev/null
3179 -focus_grab_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutInteraction focus-grab-outside)
3180 -printf 'popout_focus_grab_state=%s\n' "$focus_grab_state"
3181 -printf '%s\n' "$focus_grab_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is False; assert s["closing"] is True; assert s["name"] == "notifications"; assert s["lastInteraction"] == "focus-grab-outside"; assert s["lastCloseReason"] == "focus-grab-outside"; assert s["popoutFocusPolicy"]["outsideCloseReason"] == "focus-grab-outside"; assert s["morph"]["dismissal"] == "reverse-anchor-bottom-center"'
3182 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland openRegisteredPopout tray >/dev/null
3183 -escape_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutInteraction escape-key)
3184 -printf 'popout_escape_state=%s\n' "$escape_state"
3185 -printf '%s\n' "$escape_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is False; assert s["closing"] is True; assert s["name"] == "tray"; assert s["lastInteraction"] == "escape-key"; assert s["lastCloseReason"] == "escape-key"; assert s["popoutFocusPolicy"]["escapeCloseReason"] == "escape-key"; assert s["morph"]["dismissal"] == "reverse-anchor-bottom-center"'
3186 -window_meta=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland windowRuleMetadata)
3187 -window_focus_action=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland windowCardAction focus)
3188 -window_close_action=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland windowCardAction close-window)
3189 -window_card_state=$(printf '{"meta":%s,"focus":%s,"close":%s}\n' "$window_meta" "$window_focus_action" "$window_close_action")
3190 -printf 'window_rule_metadata=%s\n' "$window_meta"
3191 -printf 'window_card_state=%s\n' "$window_card_state"
3192 -WINDOW_CARD_STATE="$window_card_state" python - <<'PY'
3193 -import json, os
3194 -state = json.loads(os.environ["WINDOW_CARD_STATE"])
3195 -for key, card in state.items():
3196 - assert "appId" in card
3197 - assert "title" in card
3198 - assert "id" in card
3199 - assert "workspace" in card
3200 - assert isinstance(card["ruleHints"], list)
3201 - assert card["previewSlot"]["source"] == "niri-toplevel"
3202 - assert card["previewSlot"]["role"] == "content.normal"
3203 - assert card["actionRow"]["route"] == "Niri.qml"
3204 - assert card["actionRow"]["keyboardFirst"] is True
3205 - assert card["actionRow"]["pointerParity"] is True
3206 - assert card["actions"] == card["actionRow"]["actions"]
3207 - panel = card["windowPanelContract"]
3208 - assert panel["source"] == "Nuguland WindowInfo.qml Details.qml Buttons.qml plus Nuguland TaskViewContent.qml"
3209 - assert panel["ownedBy"] == "PopoutHost.qml inline WindowPanel"
3210 - assert panel["niriWindowCardPanel"] is True
3211 - assert panel["previewSlotCard"] is True
3212 - assert panel["detailsRows"] is True
3213 - assert panel["ruleHintRows"] is True
3214 - assert panel["windowActionRail"] is True
3215 - assert panel["workspaceMoveAffordance"] is True
3216 - assert panel["serviceActionsOnly"] is True
3217 - action_ids = [action["id"] for action in card["actions"]]
3218 - assert action_ids == ["focus", "toggle-fullscreen", "move-workspace", "close-window"]
3219 - assert all(action["route"] == "Niri.qml" for action in card["actions"])
3220 - assert [action["niriAction"] for action in card["actions"]] == ["focus-window", "toggle-fullscreen", "move-window-to-workspace", "close-window"]
3221 -assert state["focus"]["lastWindowAction"]["kind"] == "focus"
3222 -assert state["focus"]["lastWindowAction"]["route"] == "Niri.qml"
3223 -assert state["focus"]["lastWindowAction"]["accepted"] is True
3224 -assert state["focus"]["lastWindowAction"]["niriAction"] == "focus-window"
3225 -assert state["close"]["lastWindowAction"]["kind"] == "close-window"
3226 -assert state["close"]["lastWindowAction"]["route"] == "Niri.qml"
3227 -assert state["close"]["lastWindowAction"]["accepted"] is True
3228 -assert state["close"]["lastWindowAction"]["niriAction"] == "close-window"
3230 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland openRegisteredPopout window >/dev/null
3231 -window_popout_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
3232 -printf 'window_popout_state=%s\n' "$window_popout_state"
3233 -printf '%s\n' "$window_popout_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is True; assert s["name"] == "window"; assert s["anchor"]["width"] > 40'
3234 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland closePopout >/dev/null
3235 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland openRegisteredPopout clock >/dev/null
3236 -real_popout_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
3237 -printf 'real_popout_state=%s\n' "$real_popout_state"
3238 -printf '%s\n' "$real_popout_state" | python -c 'import json,sys; s=json.load(sys.stdin); a=s["anchor"]; assert s["open"] is True; assert s["name"] == "clock"; assert a["width"] > 20; assert abs(s["origin"]["x"] - (a["x"] + a["width"] / 2)) <= 1; assert s["origin"]["y"] == a["y"] + a["height"]'
3239 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland closePopout >/dev/null
3241 -screen_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland setPopoutScreen 800 600)
3242 -printf 'popout_screen_state=%s\n' "$screen_state"
3243 -printf '%s\n' "$screen_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["screen"] == {"width":800,"height":600}'
3244 -edge_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland openPopout clock 760,0,72,34)
3245 -printf 'popout_edge_state=%s\n' "$edge_state"
3246 -printf '%s\n' "$edge_state" | python -c 'import json,sys; s=json.load(sys.stdin); m=s["morph"]; assert s["screen"] == {"width":800,"height":600}; assert m["targetRect"]["x"] == 540, m; assert m["targetRect"]["x"] + m["targetRect"]["width"] <= 800; assert m["clampedEdges"] == ["right"], m'
3247 -left_edge_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland openPopout clock 0,0,72,34)
3248 -printf 'popout_left_edge_state=%s\n' "$left_edge_state"
3249 -printf '%s\n' "$left_edge_state" | python -c 'import json,sys; s=json.load(sys.stdin); m=s["morph"]; assert m["targetRect"]["x"] == 0; assert m["clampedEdges"] == ["left"], m'
3250 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland closePopout >/dev/null
3252 -HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland openPopout clock 100,0,72,34 >/dev/null
3253 -popout_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
3254 -printf 'popout_state=%s\n' "$popout_state"
3255 -printf '%s\n' "$popout_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is True; assert s["phase"] == "opening"; assert s["progress"] == 0; assert s["name"] == "clock"; assert s["anchor"] == {"x":100,"y":0,"width":72,"height":34}; assert s["origin"] == {"x":136,"y":34}; assert s["morph"]["animation"] == "opening"'
3256 -opened_state="$popout_state"
3257 -i=0
3258 -while [ "$i" -lt 40 ]; do
3259 - opened_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
3260 - if printf '%s\n' "$opened_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is True; assert s["phase"] == "open"; assert s["progress"] == 1; assert s["morph"]["animation"] == "open"' 2>/dev/null; then
3261 - break
3262 - fi
3263 - i=$((i + 1))
3264 - sleep 0.05
3265 -done
3266 -printf 'popout_opened_state=%s\n' "$opened_state"
3267 -printf '%s\n' "$opened_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is True; assert s["phase"] == "open"; assert s["progress"] == 1; assert s["morph"]["animation"] == "open"; assert s["cardMorphFrame"]["progress"] == 1; assert s["cardMorphFrame"]["currentRect"] == s["cardMorphFrame"]["targetLocalRect"]'
3268 -gesture_press=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland gesturePress 12 16)
3269 -gesture_drag=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland gestureDrag 120 90)
3270 -gesture_commit=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland gestureRelease 180 140)
3271 -gesture_press_cancel=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland gesturePress 40 40)
3272 -gesture_drag_cancel=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland gestureDrag 60 80)
3273 -gesture_cancel=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland gestureCancel pointer-left-mask)
3274 -gesture_state=$(printf '{"press":%s,"drag":%s,"commit":%s,"pressCancel":%s,"dragCancel":%s,"cancel":%s}\n' "$gesture_press" "$gesture_drag" "$gesture_commit" "$gesture_press_cancel" "$gesture_drag_cancel" "$gesture_cancel")
3275 -printf 'popout_gesture_state=%s\n' "$gesture_state"
3276 -GESTURE_STATE="$gesture_state" python - <<'PY'
3277 -import json, os
3278 -state = json.loads(os.environ["GESTURE_STATE"])
3279 -assert state["press"]["popoutGestureMachine"]["source"] == "Nuguland Interactions.qml"
3280 -assert state["press"]["gestureState"] == "armed"
3281 -assert state["press"]["gesturePath"] == ["press"]
3282 -assert state["drag"]["gestureState"] == "dragging"
3283 -assert state["drag"]["gesturePath"] == ["press", "drag"]
3284 -assert state["commit"]["gestureState"] == "committed"
3285 -assert state["commit"]["gesturePath"] == ["press", "drag", "release", "commit"]
3286 -assert state["commit"]["gestureCommitRect"] == {"x": 12, "y": 16, "width": 168, "height": 124}
3287 -assert state["pressCancel"]["gestureState"] == "armed"
3288 -assert state["dragCancel"]["gestureState"] == "dragging"
3289 -assert state["cancel"]["gestureState"] == "cancelled"
3290 -assert state["cancel"]["gesturePath"] == ["press", "drag", "cancel"]
3291 -assert state["cancel"]["lastCloseReason"] == "pointer-left-mask"
3292 -assert state["cancel"]["popoutGestureMachine"]["path"] == ["press", "drag", "release", "cancel", "commit"]
3294 -closing_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland closePopout)
3295 -printf 'popout_closing_state=%s\n' "$closing_state"
3296 -printf '%s\n' "$closing_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is False; assert s["closing"] is True; assert s["phase"] == "closing"; assert s["name"] == "clock"; assert s["morph"]["loaderActive"] is True; assert s["morph"]["animation"] == "closing"; assert s["morph"]["dismissal"] == "reverse-anchor-bottom-center"'
3297 -closed_state="$closing_state"
3298 -i=0
3299 -while [ "$i" -lt 40 ]; do
3300 - closed_state=$(HOME="$tmp/home" XDG_CONFIG_HOME="$tmp/xdg" qs ipc -c nuguland call nuguland popoutState)
3301 - if printf '%s\n' "$closed_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is False; assert s["closing"] is False; assert s["phase"] == "closed"; assert s["name"] == ""; assert s["morph"]["loaderActive"] is False' 2>/dev/null; then
3302 - break
3303 - fi
3304 - i=$((i + 1))
3305 - sleep 0.05
3306 -done
3307 -printf 'popout_closed_state=%s\n' "$closed_state"
3308 -printf '%s\n' "$closed_state" | python -c 'import json,sys; s=json.load(sys.stdin); assert s["open"] is False; assert s["closing"] is False; assert s["phase"] == "closed"; assert s["name"] == ""; assert s["morph"]["loaderActive"] is False'
3310 -if grep -E 'ERROR|TypeError|ReferenceError' "$tmp/qs.out" "$tmp/qs.err" >/dev/null 2>&1; then
3311 - grep -E 'ERROR|TypeError|ReferenceError' "$tmp/qs.out" "$tmp/qs.err" >&2 || true
3312 - fail 'QML errors found'
3315 -log 'cleanup proof=pending-exit-trap'
3316 -log 'PASS nuguland smoke'