Launch the default agent from the agents widget right-click (#6759)
This commit is contained in:
@@ -59,6 +59,11 @@ Panel {
|
|||||||
usage.refreshAll(true)
|
usage.refreshAll(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function launchAgent() {
|
||||||
|
if (root.bar) root.bar.run("omarchy-agent --pick")
|
||||||
|
root.close()
|
||||||
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------- limits
|
// ---------------------------------------------------------------- limits
|
||||||
//
|
//
|
||||||
// Both providers report the same two shapes: a short rolling session window
|
// Both providers report the same two shapes: a short rolling session window
|
||||||
@@ -337,7 +342,7 @@ Panel {
|
|||||||
text: ""
|
text: ""
|
||||||
active: root.alarming
|
active: root.alarming
|
||||||
onPressed: function(buttonCode) {
|
onPressed: function(buttonCode) {
|
||||||
if (buttonCode === Qt.RightButton) root.refreshNow()
|
if (buttonCode === Qt.RightButton) root.launchAgent()
|
||||||
else if (buttonCode === Qt.MiddleButton) root.selectProvider(root.providerIndex + 1)
|
else if (buttonCode === Qt.MiddleButton) root.selectProvider(root.providerIndex + 1)
|
||||||
else root.toggle()
|
else root.toggle()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ only adds the meter and the spent-of-funded line under the real figure.
|
|||||||
|
|
||||||
## Interactions
|
## Interactions
|
||||||
|
|
||||||
- Bar icon: left = panel, right = refresh, middle = next subscription.
|
- Bar icon: left = panel, right = launch agent, middle = next subscription.
|
||||||
- Panel: `h`/`l` switch subscription, `j`/`k` scroll, `r` or Enter refresh,
|
- Panel: `h`/`l` switch subscription, `j`/`k` scroll, `r` or Enter refresh,
|
||||||
Tab moves to the neighboring bar panel, Esc closes.
|
Tab moves to the neighboring bar panel, Esc closes.
|
||||||
- IPC: `omarchy-shell omarchy.agents <open|close|toggle|refresh|next>`.
|
- IPC: `omarchy-shell omarchy.agents <open|close|toggle|refresh|next>`.
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ Example `shell.json` (bar subtree only shown):
|
|||||||
| `omarchy.audio` | Volume icon + popup with master slider, output-device picker, per-app mixer | left = popup · right = mute · middle = popup · scroll = volume |
|
| `omarchy.audio` | Volume icon + popup with master slider, output-device picker, per-app mixer | left = popup · right = mute · middle = popup · scroll = volume |
|
||||||
| `omarchy.network` | Wi-Fi/Ethernet icon + popup with Wi-Fi scan, signal, connect, DNS provider selection | left = popup · right = nmtui |
|
| `omarchy.network` | Wi-Fi/Ethernet icon + popup with Wi-Fi scan, signal, connect, DNS provider selection | left = popup · right = nmtui |
|
||||||
| `omarchy.tailscale` | Tailscale status, connection switcher, machine browser, and copy actions | left = popup · right = toggle · middle = refresh |
|
| `omarchy.tailscale` | Tailscale status, connection switcher, machine browser, and copy actions | left = popup · right = toggle · middle = refresh |
|
||||||
| `omarchy.agents` | AI coding agent limits with pace, today, last week, and all-time model breakdown | left = panel · right = refresh · middle = next subscription |
|
| `omarchy.agents` | AI coding agent limits with pace, today, last week, and all-time model breakdown | left = panel · right = launch agent · middle = next subscription |
|
||||||
| `omarchy.power` | Battery/AC icon + popup with battery stats, power profiles, and system info | left = popup · right = toggle percentage |
|
| `omarchy.power` | Battery/AC icon + popup with battery stats, power profiles, and system info | left = popup · right = toggle percentage |
|
||||||
| `omarchy.bluetooth` | Bluetooth icon + popup with device list, connect/disconnect, battery | left = popup · right = toggle radio · middle = bluetoothctl TUI |
|
| `omarchy.bluetooth` | Bluetooth icon + popup with device list, connect/disconnect, battery | left = popup · right = toggle radio · middle = bluetoothctl TUI |
|
||||||
| `omarchy.monitor` | Brightness and laptop display controls | left = popup |
|
| `omarchy.monitor` | Brightness and laptop display controls | left = popup |
|
||||||
|
|||||||
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
|
||||||
|
|
||||||
|
run_node_test <<'JS'
|
||||||
|
const fs = require('fs')
|
||||||
|
const panelSource = fs.readFileSync(root + '/shell/plugins/agents/Panel.qml', 'utf8')
|
||||||
|
|
||||||
|
assert(/function launchAgent\(\)/.test(panelSource), 'agents panel launches the default agent')
|
||||||
|
assert(/root\.bar\.run\("omarchy-agent --pick"\)/.test(panelSource), 'agents panel uses the desktop agent launcher')
|
||||||
|
assert(/if \(buttonCode === Qt\.RightButton\) root\.launchAgent\(\)/.test(panelSource), 'agents right click launches the agent')
|
||||||
|
assert(/else if \(buttonCode === Qt\.MiddleButton\) root\.selectProvider\(root\.providerIndex \+ 1\)/.test(panelSource), 'agents middle click still advances the subscription')
|
||||||
|
assert(/else root\.toggle\(\)/.test(panelSource), 'agents left click still toggles the panel')
|
||||||
|
assert(!/if \(buttonCode === Qt\.RightButton\) root\.refreshNow\(\)/.test(panelSource), 'agents right click no longer refreshes')
|
||||||
|
JS
|
||||||
Reference in New Issue
Block a user