feat(terra): luna voice-mode readout in quickshell

Top-left under the rail: whether the mic is open, whether she is
thinking, and whether she is talking — the states a 5s reply makes you
want to see. No avatar yet; the meter is a placeholder for it, and the
states and their colours are the part that has to read correctly first.

LunaIndicator is Item-rooted so render.sh can shoot all five states
offscreen (tests/LunaIndicatorHeadless.qml); LunaCall is the thin
PanelWindow. Beside the notification stack rather than among the modals:
it never takes the keyboard and raises no scrim, so it is deliberately
absent from `modalOpen`.

LunaState is read-only — the toggle runs the CLI — and treats a missing
socket as normal, since the daemon is a user service that may start after
the shell or not be installed at all.

Two things measurement decided rather than reasoning. ExclusionMode
.Ignore put it OVER the bar (it ignores other surfaces' zones, not just
its own), and switching to Normal was not enough either: the rail's
exclusive zone still left it at y=8 against a bar occupying 0..147. So
the shell passes bar.contentHeight down, the same value the backdrop
already reads. And the card is one chamfered path rather than a
rectangle with a triangle over its corner, which left the square border
showing underneath and read as an artifact.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-20 23:38:01 +02:00
co-authored by Claude Opus 5
parent 67dd30eb72
commit ef1be8a7d9
5 changed files with 470 additions and 0 deletions
@@ -0,0 +1,60 @@
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Wayland
import qs.HyprChrome.Widgets.Luna
// Voice-mode surface: top-left, directly under the rail.
//
// Thin by design — the visuals are all in LunaIndicator so they stay
// headless-renderable. Anchoring top+left is enough to sit under the bar:
// the rail sets an exclusiveZone of its collapsed height, so the compositor
// places this below it without either surface knowing the other's metrics.
//
// NOT a modal. She never takes the keyboard — the whole point is that you
// keep working while talking — so this does not join the shell's `modalOpen`
// and raises no scrim.
PanelWindow {
id: window
required property var state
required property var targetScreen
// The rail's settled height, from the shell. Not the compositor's job
// here: the bar's exclusive zone leaves this surface at the top of the
// output, so the gap is opened by hand.
required property real barHeight
screen: window.targetScreen
visible: window.state.active
anchors { top: true; left: true }
margins { left: 8; top: window.barHeight + 8 }
implicitWidth: indicator.implicitWidth
implicitHeight: indicator.implicitHeight
color: "transparent"
// Below the rail's own layer: this is a readout, not a surface that
// should ever cover the bar.
WlrLayershell.layer: WlrLayer.Top
// A readout that stole focus would break typing the moment she answered.
WlrLayershell.keyboardFocus: WlrKeyboardFocus.None
// Normal with a zero zone: reserve nothing of our own, but still RESPECT
// the rail's exclusion so the compositor places this under it. Ignore
// would skip other surfaces' zones too, which put it over the bar.
exclusionMode: ExclusionMode.Normal
exclusiveZone: 0
LunaIndicator {
id: indicator
anchors.fill: parent
state: window.state.state
active: window.state.active
connected: window.state.connected
rms: window.state.rms
userText: window.state.userText
lunaText: window.state.lunaText
}
}