topside-arch 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -12
- package/contrib/aur/.SRCINFO +20 -0
- package/contrib/aur/PKGBUILD +3 -3
- package/contrib/aur/topside-arch.install +9 -6
- package/dist/cli/commands.js +63 -11
- package/dist/cli/main.js +3 -3
- package/dist/daemon/session-state.js +7 -1
- package/dist/dms/setup.js +20 -9
- package/dist/hosts/hosts.js +2 -2
- package/dist/sekaipop/setup.js +63 -6
- package/dist/service/unit.js +77 -0
- package/dist/shared/qml-lib.js +2 -1
- package/package.json +1 -1
- package/shell/core/BoardDetail.qml +42 -2
- package/shell/core/BoardList.qml +67 -81
- package/shell/core/BoardNotice.qml +9 -7
- package/shell/core/FlapText.qml +21 -6
- package/shell/core/SessionRow.qml +41 -4
- package/shell/core/TicketDetail.qml +76 -7
- package/shell/core/TicketList.qml +133 -55
- package/shell/core/TopsideClient.qml +3 -0
- package/shell/core/board.js +8 -14
- package/shell/core/hiding.js +39 -0
- package/shell/core/ticket.js +39 -0
- package/shell/dms-plugin/TopsideWidget.qml +28 -46
- package/shell/pill.qml +1 -1
- package/shell/sekaipop-plugin/Bar.qml +1 -2
- package/shell/sekaipop-plugin/Card.qml +35 -30
- package/shell/sekaipop-plugin/Floating.qml +9 -18
- package/shell/sekaipop-plugin/ListWindow.qml +15 -15
- package/shell/sekaipop-plugin/Service.qml +29 -25
- package/shell/sekaipop-plugin/StyledCard.qml +23 -8
- package/shell/sekaipop-plugin/place.js +28 -0
- package/shell/sekaipop-plugin/plugin.json +2 -2
|
@@ -8,7 +8,8 @@ import "board.js" as Board
|
|
|
8
8
|
// one key per option; for a finished turn, your prompt and the reply; for
|
|
9
9
|
// any other session, your last prompt, what it does now, Jump and Hide.
|
|
10
10
|
// It answers through the client itself; hiding and dismissing are the
|
|
11
|
-
// host's, so they go out as signals.
|
|
11
|
+
// host's, so they go out as signals. Hiding asks first: with `hideQuestion`
|
|
12
|
+
// set, the question and HIDE N / KEEP take the keys' place (VIA-PARITY §29).
|
|
12
13
|
Rectangle {
|
|
13
14
|
id: panel
|
|
14
15
|
required property var client
|
|
@@ -29,6 +30,12 @@ Rectangle {
|
|
|
29
30
|
signal answered(string word)
|
|
30
31
|
signal hideFolder()
|
|
31
32
|
signal hidePrompt()
|
|
33
|
+
// An open hide question: its text ("Hide 2 rows in web-app, …?") and count.
|
|
34
|
+
property string hideQuestion: ""
|
|
35
|
+
property int hideCount: 0
|
|
36
|
+
readonly property bool asking: hideQuestion !== ""
|
|
37
|
+
signal hideConfirmed()
|
|
38
|
+
signal hideKept()
|
|
32
39
|
|
|
33
40
|
readonly property var approval: request && request.kind === "approval" ? request.item : null
|
|
34
41
|
readonly property var question: request && request.kind === "question" ? request.item : null
|
|
@@ -89,7 +96,7 @@ Rectangle {
|
|
|
89
96
|
Flickable {
|
|
90
97
|
id: scroller
|
|
91
98
|
Layout.fillWidth: true
|
|
92
|
-
Layout.preferredHeight: Math.min(info.implicitHeight, Math.max(60, panel.maxHeight - keyRow.implicitHeight - 2 * body.anchors.margins - body.spacing))
|
|
99
|
+
Layout.preferredHeight: Math.min(info.implicitHeight, Math.max(60, panel.maxHeight - (panel.asking ? askBox.implicitHeight : keyRow.implicitHeight) - 2 * body.anchors.margins - body.spacing))
|
|
93
100
|
contentHeight: info.implicitHeight
|
|
94
101
|
clip: true
|
|
95
102
|
boundsBehavior: Flickable.StopAtBounds
|
|
@@ -182,6 +189,7 @@ Rectangle {
|
|
|
182
189
|
|
|
183
190
|
RowLayout {
|
|
184
191
|
id: keyRow
|
|
192
|
+
visible: !panel.asking
|
|
185
193
|
// Every key as wide as the widest one shown, so they read as one set.
|
|
186
194
|
readonly property real keyWidth: {
|
|
187
195
|
let w = 0;
|
|
@@ -274,6 +282,38 @@ Rectangle {
|
|
|
274
282
|
onClicked: panel.client.jump(panel.session.id)
|
|
275
283
|
}
|
|
276
284
|
}
|
|
285
|
+
|
|
286
|
+
// The hide question, in place of the links and keys.
|
|
287
|
+
ColumnLayout {
|
|
288
|
+
id: askBox
|
|
289
|
+
visible: panel.asking
|
|
290
|
+
spacing: 8
|
|
291
|
+
Layout.topMargin: 4
|
|
292
|
+
Layout.fillWidth: true
|
|
293
|
+
Text {
|
|
294
|
+
text: panel.hideQuestion
|
|
295
|
+
color: Theme.reminder
|
|
296
|
+
font.family: Theme.monoFont
|
|
297
|
+
font.pixelSize: panel.size + 1
|
|
298
|
+
wrapMode: Text.Wrap
|
|
299
|
+
Layout.fillWidth: true
|
|
300
|
+
}
|
|
301
|
+
RowLayout {
|
|
302
|
+
spacing: 8
|
|
303
|
+
Item { Layout.fillWidth: true }
|
|
304
|
+
KeyCap {
|
|
305
|
+
size: panel.size
|
|
306
|
+
label: "Keep"
|
|
307
|
+
onClicked: panel.hideKept()
|
|
308
|
+
}
|
|
309
|
+
KeyCap {
|
|
310
|
+
size: panel.size
|
|
311
|
+
label: "Hide " + panel.hideCount
|
|
312
|
+
go: true
|
|
313
|
+
onClicked: panel.hideConfirmed()
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
}
|
|
277
317
|
}
|
|
278
318
|
|
|
279
319
|
function decide(decision, word) {
|
package/shell/core/BoardList.qml
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import QtQuick
|
|
2
2
|
import QtQuick.Layouts
|
|
3
3
|
import "board.js" as Board
|
|
4
|
+
import "hiding.js" as Hiding
|
|
4
5
|
|
|
5
6
|
// The departure board style's session list: one flap row per session (a
|
|
6
|
-
// lamp, its age, name, agent, status word and what it does now),
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
7
|
+
// lamp, its age, name, agent, status word and what it does now), newest
|
|
8
|
+
// first as the daemon sends them, the plan usage in the board's header. The
|
|
9
|
+
// rows are slots: when the order changes they stay put and their flaps
|
|
10
|
+
// riffle to the new text, like a real departure board. Nothing is picked
|
|
11
|
+
// when the list opens; a click on a row opens BoardDetail.qml under the
|
|
12
|
+
// board: a waiting session's request with its keys, any other's last prompt
|
|
13
|
+
// with Jump and Hide (VIA-PARITY §28). Hiding asks first (§29).
|
|
11
14
|
ColumnLayout {
|
|
12
15
|
id: list
|
|
13
16
|
// The most the list may take; past that the picked session's panel
|
|
@@ -21,36 +24,59 @@ ColumnLayout {
|
|
|
21
24
|
property string usageAgent: "claude"
|
|
22
25
|
property var spend: null
|
|
23
26
|
property bool shortcuts: false
|
|
24
|
-
// The host's last hide, undoable: its label, or "".
|
|
25
|
-
property string undoLabel: ""
|
|
26
27
|
property string iconFont: ""
|
|
27
28
|
signal moreRequested(bool all)
|
|
28
29
|
signal hovered(string sessionId)
|
|
29
30
|
signal hideFolder(var session)
|
|
30
31
|
signal hidePrompt(var session)
|
|
31
|
-
signal undoRequested()
|
|
32
32
|
signal settingsRequested()
|
|
33
|
+
// The speaker left of the gear: off unless the host has sounds to switch.
|
|
34
|
+
property bool soundSwitch: false
|
|
35
|
+
property bool soundsOn: false
|
|
36
|
+
signal soundsToggled()
|
|
33
37
|
signal quitRequested()
|
|
34
38
|
signal startRequested()
|
|
35
39
|
|
|
36
|
-
readonly property var rows:
|
|
40
|
+
readonly property var rows: sessions
|
|
41
|
+
// Bumped each time the list opens: every flap riffles as the board comes down.
|
|
42
|
+
property int riffleSerial: 0
|
|
37
43
|
property string selectedId: ""
|
|
38
44
|
readonly property var selected: rows.find(s => s.id === selectedId) || null
|
|
39
45
|
readonly property var selectedRequest: selected ? Board.pendingFor(selected.id, client.approvals, client.questions) : null
|
|
40
46
|
|
|
41
|
-
// Opening on a waiting session: its request is the first thing you see.
|
|
42
|
-
function pickWaiting() {
|
|
43
|
-
const waiting = rows.find(s => Board.pendingFor(s.id, client.approvals, client.questions) !== null);
|
|
44
|
-
if (waiting) selectedId = waiting.id;
|
|
45
|
-
}
|
|
46
|
-
Component.onCompleted: pickWaiting()
|
|
47
47
|
// Opened again: start over, as a fresh look at the board.
|
|
48
48
|
function reset() {
|
|
49
49
|
selectedId = "";
|
|
50
50
|
flashes = ({});
|
|
51
|
-
|
|
51
|
+
hideAsk = null;
|
|
52
|
+
riffleSerial++;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// A hide asked from the picked row, not yet confirmed: { folder, text,
|
|
56
|
+
// sessionId }. The question recounts on every snapshot and goes with its
|
|
57
|
+
// session; picking another row, KEEP, Esc or the list closing drop it.
|
|
58
|
+
property var hideAsk: null
|
|
59
|
+
readonly property var hideRule: hideAsk ? Hiding.question(hideAsk, hideAsk.sessionId, rows) : null
|
|
60
|
+
onSelectedIdChanged: hideAsk = null
|
|
61
|
+
function askHide(folder) {
|
|
62
|
+
if (!selected) return;
|
|
63
|
+
hideAsk = { folder: folder, text: folder ? selected.cwd || "" : selected.title || "", sessionId: selected.id };
|
|
64
|
+
}
|
|
65
|
+
function confirmHide() {
|
|
66
|
+
const session = selected;
|
|
67
|
+
const ask = hideAsk;
|
|
68
|
+
hideAsk = null;
|
|
69
|
+
if (!session || !ask) return;
|
|
70
|
+
selectedId = "";
|
|
71
|
+
if (ask.folder) list.hideFolder(session);
|
|
72
|
+
else list.hidePrompt(session);
|
|
73
|
+
}
|
|
74
|
+
// Esc: drops an open question first. True when there was one.
|
|
75
|
+
function cancelHide() {
|
|
76
|
+
if (!hideRule) return false;
|
|
77
|
+
hideAsk = null;
|
|
78
|
+
return true;
|
|
52
79
|
}
|
|
53
|
-
onRowsChanged: if (!selected) pickWaiting()
|
|
54
80
|
|
|
55
81
|
// The request the host's keys answer: the first question, else the first
|
|
56
82
|
// request (⌃Y ⌃N ⌃A, ⌃1…⌃9). Its keys show their shortcuts; no other's do.
|
|
@@ -109,29 +135,6 @@ ColumnLayout {
|
|
|
109
135
|
interval: 1400
|
|
110
136
|
onTriggered: list.flashes = ({})
|
|
111
137
|
}
|
|
112
|
-
// Hiding flips the row to HIDDEN first, then it goes.
|
|
113
|
-
QtObject {
|
|
114
|
-
id: hiding
|
|
115
|
-
property var session: null
|
|
116
|
-
property bool folder: true
|
|
117
|
-
}
|
|
118
|
-
Timer {
|
|
119
|
-
id: hideLater
|
|
120
|
-
interval: 650
|
|
121
|
-
onTriggered: {
|
|
122
|
-
if (!hiding.session) return;
|
|
123
|
-
if (hiding.folder) list.hideFolder(hiding.session);
|
|
124
|
-
else list.hidePrompt(hiding.session);
|
|
125
|
-
hiding.session = null;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
function hideSoon(session, folder) {
|
|
129
|
-
hiding.session = session;
|
|
130
|
-
hiding.folder = folder;
|
|
131
|
-
flash(session.id, "HIDDEN");
|
|
132
|
-
selectedId = "";
|
|
133
|
-
hideLater.restart();
|
|
134
|
-
}
|
|
135
138
|
readonly property var windows: [
|
|
136
139
|
{ label: "5H", window: usage ? usage.fiveHour : undefined },
|
|
137
140
|
{ label: "7D", window: usage ? usage.sevenDay : undefined },
|
|
@@ -205,6 +208,12 @@ ColumnLayout {
|
|
|
205
208
|
HeadText {
|
|
206
209
|
text: Qt.formatTime(new Date(list.now), "hh:mm")
|
|
207
210
|
}
|
|
211
|
+
// The speaker flips Sounds; a host that has them turns it on.
|
|
212
|
+
HeadKey {
|
|
213
|
+
visible: list.iconFont !== "" && list.soundSwitch
|
|
214
|
+
text: list.soundsOn ? "volume_up" : "volume_off"
|
|
215
|
+
onClicked: list.soundsToggled()
|
|
216
|
+
}
|
|
208
217
|
HeadKey {
|
|
209
218
|
visible: list.iconFont !== ""
|
|
210
219
|
text: "settings"
|
|
@@ -246,7 +255,9 @@ ColumnLayout {
|
|
|
246
255
|
required property int index
|
|
247
256
|
readonly property var modelData: list.rows[index] || ({})
|
|
248
257
|
readonly property var request: Board.pendingFor(modelData.id, list.client.approvals, list.client.questions)
|
|
249
|
-
|
|
258
|
+
// A session the open hide question would catch reads HIDE? in red, lamp included.
|
|
259
|
+
readonly property bool caught: list.hideRule !== null && list.hideRule.caught.indexOf(modelData.id) >= 0
|
|
260
|
+
readonly property string word: caught ? "HIDE?" : list.flashes[modelData.id] || Board.statusWord(modelData, request ? request.kind : "", false)
|
|
250
261
|
readonly property bool chosen: list.selectedId === modelData.id
|
|
251
262
|
// Picking a row puts the others in the dark, as a spotlight would;
|
|
252
263
|
// the pointer brings one halfway back.
|
|
@@ -292,12 +303,12 @@ ColumnLayout {
|
|
|
292
303
|
color: Theme[Board.statusTone(row.word)]
|
|
293
304
|
opacity: row.request && lampBlink.dim ? 0.3 : 1
|
|
294
305
|
}
|
|
295
|
-
FlapText { text: Board.age(row.modelData.startedAt, list.now); length: 3; cell: list.cell; color: "#9a9ca6";
|
|
296
|
-
FlapText { text: Board.sessionName(row.modelData); length: list.sessionLength; cell: list.cell; lit: row.chosen }
|
|
306
|
+
FlapText { riffleSerial: list.riffleSerial; text: Board.age(row.modelData.startedAt, list.now); length: 3; cell: list.cell; color: "#9a9ca6"; lit: row.chosen }
|
|
307
|
+
FlapText { riffleSerial: list.riffleSerial; text: Board.sessionName(row.modelData); length: list.sessionLength; cell: list.cell; lit: row.chosen }
|
|
297
308
|
AgentIcon { agent: row.modelData.agent; size: Math.round(list.cell * 1.1) }
|
|
298
|
-
FlapText { visible: list.wide; text: row.modelData.agent; length: 6; cell: list.cell; color: "#9a9ca6";
|
|
299
|
-
FlapText { text: row.word; length: 8; cell: list.cell; color: Theme[Board.statusTone(row.word)]; lit: row.chosen }
|
|
300
|
-
FlapText { text: Board.nowLine(row.modelData); length: list.nowLength; cell: list.cell; color: "#9a9ca6"; lit: row.chosen }
|
|
309
|
+
FlapText { riffleSerial: list.riffleSerial; visible: list.wide; text: row.modelData.agent; length: 6; cell: list.cell; color: "#9a9ca6"; lit: row.chosen }
|
|
310
|
+
FlapText { riffleSerial: list.riffleSerial; text: row.word; length: 8; cell: list.cell; color: Theme[Board.statusTone(row.word)]; lit: row.chosen }
|
|
311
|
+
FlapText { riffleSerial: list.riffleSerial; text: Board.nowLine(row.modelData); length: list.nowLength; cell: list.cell; color: "#9a9ca6"; lit: row.chosen }
|
|
301
312
|
}
|
|
302
313
|
|
|
303
314
|
HoverHandler {
|
|
@@ -316,8 +327,8 @@ ColumnLayout {
|
|
|
316
327
|
visible: list.rows.length === 0
|
|
317
328
|
spacing: 10
|
|
318
329
|
Layout.topMargin: 4
|
|
319
|
-
FlapText { text: list.client.connected ? "NO" : "TOPSIDE"; length: 10; cell: list.cell }
|
|
320
|
-
FlapText {
|
|
330
|
+
FlapText { riffleSerial: list.riffleSerial; text: list.client.connected ? "NO" : "TOPSIDE"; length: 10; cell: list.cell }
|
|
331
|
+
FlapText { riffleSerial: list.riffleSerial;
|
|
321
332
|
text: list.client.connected ? "DEPARTURES" : "STOPPED"
|
|
322
333
|
length: 10
|
|
323
334
|
cell: list.cell
|
|
@@ -349,7 +360,7 @@ ColumnLayout {
|
|
|
349
360
|
visible: list.moreCount > 0 || list.showingAll
|
|
350
361
|
Layout.fillWidth: true
|
|
351
362
|
Layout.topMargin: 4
|
|
352
|
-
FlapText {
|
|
363
|
+
FlapText { riffleSerial: list.riffleSerial;
|
|
353
364
|
text: list.showingAll ? "ALL SHOWN" : "+" + list.moreCount + " MORE"
|
|
354
365
|
length: 9
|
|
355
366
|
cell: Math.max(8, list.cell - 2)
|
|
@@ -378,7 +389,7 @@ ColumnLayout {
|
|
|
378
389
|
BoardDetail {
|
|
379
390
|
id: detail
|
|
380
391
|
// What's left under the rail or the rows, less what sits below it.
|
|
381
|
-
maxHeight: list.maxHeight - y - (
|
|
392
|
+
maxHeight: list.maxHeight - y - (jumpErrorText.visible ? jumpErrorText.height + list.spacing : 0)
|
|
382
393
|
visible: list.selected !== null
|
|
383
394
|
client: list.client
|
|
384
395
|
session: list.selected
|
|
@@ -386,40 +397,15 @@ ColumnLayout {
|
|
|
386
397
|
shortcuts: list.shortcuts && list.selectedRequest !== null && list.selectedRequest.item === list.keyed
|
|
387
398
|
canHide: true
|
|
388
399
|
Layout.fillWidth: true
|
|
389
|
-
|
|
390
|
-
|
|
400
|
+
hideQuestion: list.hideRule ? Hiding.questionText(list.hideRule, "row") : ""
|
|
401
|
+
hideCount: list.hideRule ? list.hideRule.caught.length : 0
|
|
402
|
+
onHideFolder: list.askHide(true)
|
|
403
|
+
onHidePrompt: list.askHide(false)
|
|
404
|
+
onHideConfirmed: list.confirmHide()
|
|
405
|
+
onHideKept: list.hideAsk = null
|
|
391
406
|
onAnswered: word => list.flash(list.selectedId, word)
|
|
392
407
|
}
|
|
393
408
|
|
|
394
|
-
// Undo for the last hide.
|
|
395
|
-
Rectangle {
|
|
396
|
-
id: undoStrip
|
|
397
|
-
visible: list.undoLabel !== ""
|
|
398
|
-
Layout.fillWidth: true
|
|
399
|
-
implicitHeight: 40
|
|
400
|
-
radius: 10
|
|
401
|
-
color: "#0c0d10"
|
|
402
|
-
border.color: "#2e3038"
|
|
403
|
-
RowLayout {
|
|
404
|
-
anchors.fill: parent
|
|
405
|
-
anchors.leftMargin: 12
|
|
406
|
-
anchors.rightMargin: 8
|
|
407
|
-
Text {
|
|
408
|
-
text: list.undoLabel
|
|
409
|
-
color: "#f3efe2"
|
|
410
|
-
font.family: Theme.monoFont
|
|
411
|
-
font.pixelSize: 11
|
|
412
|
-
elide: Text.ElideRight
|
|
413
|
-
Layout.fillWidth: true
|
|
414
|
-
}
|
|
415
|
-
KeyCap {
|
|
416
|
-
label: "Undo"
|
|
417
|
-
go: true
|
|
418
|
-
onClicked: list.undoRequested()
|
|
419
|
-
}
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
|
|
423
409
|
Text {
|
|
424
410
|
id: jumpErrorText
|
|
425
411
|
visible: list.client.jumpError !== ""
|
|
@@ -23,6 +23,8 @@ ColumnLayout {
|
|
|
23
23
|
// The most it may take: past that, the panel under the board scrolls
|
|
24
24
|
// inside and the board itself stays put.
|
|
25
25
|
property real maxHeight: 100000
|
|
26
|
+
// Bumped each time the board comes down again: every flap riffles.
|
|
27
|
+
property int riffleSerial: 0
|
|
26
28
|
signal closeRequested()
|
|
27
29
|
signal dismissed()
|
|
28
30
|
|
|
@@ -122,13 +124,13 @@ ColumnLayout {
|
|
|
122
124
|
|
|
123
125
|
RowLayout {
|
|
124
126
|
spacing: notice.gap
|
|
125
|
-
FlapText {
|
|
127
|
+
FlapText { riffleSerial: notice.riffleSerial;
|
|
126
128
|
text: notice.clock(notice.request ? notice.request.createdAt : notice.now)
|
|
127
129
|
length: 5
|
|
128
130
|
cell: notice.cell
|
|
129
131
|
color: "#9a9ca6"
|
|
130
132
|
}
|
|
131
|
-
FlapText {
|
|
133
|
+
FlapText { riffleSerial: notice.riffleSerial;
|
|
132
134
|
text: Board.sessionName(notice.session)
|
|
133
135
|
length: notice.nameLength
|
|
134
136
|
cell: notice.cell
|
|
@@ -137,7 +139,7 @@ ColumnLayout {
|
|
|
137
139
|
agent: notice.session ? notice.session.agent : "claude"
|
|
138
140
|
size: Math.round(notice.cell * 1.1)
|
|
139
141
|
}
|
|
140
|
-
FlapText {
|
|
142
|
+
FlapText { riffleSerial: notice.riffleSerial;
|
|
141
143
|
text: notice.word
|
|
142
144
|
length: 8
|
|
143
145
|
cell: notice.cell
|
|
@@ -146,7 +148,7 @@ ColumnLayout {
|
|
|
146
148
|
}
|
|
147
149
|
}
|
|
148
150
|
|
|
149
|
-
FlapText {
|
|
151
|
+
FlapText { riffleSerial: notice.riffleSerial;
|
|
150
152
|
text: notice.message
|
|
151
153
|
length: notice.messageLength
|
|
152
154
|
cell: notice.cell
|
|
@@ -163,10 +165,10 @@ ColumnLayout {
|
|
|
163
165
|
readonly property string word: Board.statusWord(waiting, modelData.kind, false)
|
|
164
166
|
opacity: 0.5
|
|
165
167
|
spacing: notice.gap
|
|
166
|
-
FlapText { text: notice.clock(modelData.createdAt); length: 5; cell: notice.cell; color: "#9a9ca6" }
|
|
167
|
-
FlapText { text: Board.sessionName(parent.waiting); length: notice.nameLength; cell: notice.cell }
|
|
168
|
+
FlapText { riffleSerial: notice.riffleSerial; text: notice.clock(modelData.createdAt); length: 5; cell: notice.cell; color: "#9a9ca6" }
|
|
169
|
+
FlapText { riffleSerial: notice.riffleSerial; text: Board.sessionName(parent.waiting); length: notice.nameLength; cell: notice.cell }
|
|
168
170
|
AgentIcon { agent: parent.waiting ? parent.waiting.agent : "claude"; size: Math.round(notice.cell * 1.1) }
|
|
169
|
-
FlapText { text: parent.word; length: 8; cell: notice.cell; color: notice.tone(parent.word) }
|
|
171
|
+
FlapText { riffleSerial: notice.riffleSerial; text: parent.word; length: 8; cell: notice.cell; color: notice.tone(parent.word) }
|
|
170
172
|
}
|
|
171
173
|
}
|
|
172
174
|
}
|
package/shell/core/FlapText.qml
CHANGED
|
@@ -3,7 +3,9 @@ import "board.js" as Board
|
|
|
3
3
|
|
|
4
4
|
// A run of split-flap cells, as on a departure board: `length` cells showing
|
|
5
5
|
// `text` in capitals. When the text changes, each cell that changes riffles
|
|
6
|
-
// through a few letters before it settles, the cells a beat apart.
|
|
6
|
+
// through a few letters before it settles, the cells a beat apart. When the
|
|
7
|
+
// board comes down (made, or `riffleSerial` bumped), every cell riffles
|
|
8
|
+
// after `startDelay`, once the board's fade-in is done (VIA-PARITY §27).
|
|
7
9
|
Row {
|
|
8
10
|
id: run
|
|
9
11
|
property string text: ""
|
|
@@ -11,7 +13,9 @@ Row {
|
|
|
11
13
|
property real cell: 16
|
|
12
14
|
property color color: "#f3efe2"
|
|
13
15
|
property bool blinking: false
|
|
14
|
-
|
|
16
|
+
// Bumped by the board each time it comes down again.
|
|
17
|
+
property int riffleSerial: 0
|
|
18
|
+
property int startDelay: 200
|
|
15
19
|
// The row you picked: its flaps light up.
|
|
16
20
|
property bool lit: false
|
|
17
21
|
|
|
@@ -57,16 +61,27 @@ Row {
|
|
|
57
61
|
}
|
|
58
62
|
|
|
59
63
|
function flip() {
|
|
60
|
-
turns =
|
|
64
|
+
turns = 4 + index % 9;
|
|
61
65
|
riffle.restart();
|
|
62
66
|
}
|
|
63
67
|
onTargetChanged: if (face !== target) flip()
|
|
64
|
-
// A board that just came down clacks into place too.
|
|
65
|
-
Component.onCompleted: if (
|
|
68
|
+
// A board that just came down clacks into place too, once it shows.
|
|
69
|
+
Component.onCompleted: if (target !== " ") later.restart()
|
|
70
|
+
Connections {
|
|
71
|
+
target: run
|
|
72
|
+
function onRiffleSerialChanged() {
|
|
73
|
+
if (flap.target !== " ") later.restart();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
Timer {
|
|
77
|
+
id: later
|
|
78
|
+
interval: run.startDelay
|
|
79
|
+
onTriggered: flap.flip()
|
|
80
|
+
}
|
|
66
81
|
|
|
67
82
|
Timer {
|
|
68
83
|
id: riffle
|
|
69
|
-
interval:
|
|
84
|
+
interval: 55
|
|
70
85
|
repeat: true
|
|
71
86
|
onTriggered: {
|
|
72
87
|
if (flap.turns <= 0) {
|
|
@@ -8,7 +8,10 @@ import Quickshell
|
|
|
8
8
|
// agent's mark, the terminal's icon and the age; the second your last prompt;
|
|
9
9
|
// the third the status, with a jump button on the right while the pointer is
|
|
10
10
|
// on the row. Under the pointer the row lights up; a click jumps to its
|
|
11
|
-
// terminal. Hovering the heading shows the folder.
|
|
11
|
+
// terminal. Hovering the heading shows the folder. Hiding asks first
|
|
12
|
+
// (VIA-PARITY §29): the row it was asked from shows the question with Keep
|
|
13
|
+
// and Hide N in its last line, and every row it would take is tinted red
|
|
14
|
+
// and reads "Will hide".
|
|
12
15
|
Item {
|
|
13
16
|
id: row
|
|
14
17
|
required property var session
|
|
@@ -17,6 +20,13 @@ Item {
|
|
|
17
20
|
signal hidePrompt()
|
|
18
21
|
// The host can hide sessions (the DMS widget); the pill can't yet.
|
|
19
22
|
property bool canHide: false
|
|
23
|
+
// An open hide question asked from this row: its text and count.
|
|
24
|
+
property string hideQuestion: ""
|
|
25
|
+
property int hideCount: 0
|
|
26
|
+
// The open hide question would take this row.
|
|
27
|
+
property bool willHide: false
|
|
28
|
+
signal hideConfirmed()
|
|
29
|
+
signal hideKept()
|
|
20
30
|
// What "hide like this" stores: the first prompt's first line, the title
|
|
21
31
|
// without the "…" a cut title ends in.
|
|
22
32
|
readonly property string promptKey: (session.title || "").replace(/…$/, "")
|
|
@@ -66,7 +76,8 @@ Item {
|
|
|
66
76
|
anchors.leftMargin: -10
|
|
67
77
|
anchors.rightMargin: -10
|
|
68
78
|
radius: Theme.rowRadius
|
|
69
|
-
color: Qt.rgba(Theme.
|
|
79
|
+
color: row.willHide ? Qt.rgba(Theme.reminder.r, Theme.reminder.g, Theme.reminder.b, 0.14)
|
|
80
|
+
: Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, row.hovered ? 0.07 : 0)
|
|
70
81
|
Behavior on color {
|
|
71
82
|
ColorAnimation { duration: 120 }
|
|
72
83
|
}
|
|
@@ -136,14 +147,16 @@ Item {
|
|
|
136
147
|
// The status, with the jump button on its right. As tall with the button
|
|
137
148
|
// as without, so a row doesn't grow under the pointer.
|
|
138
149
|
RowLayout {
|
|
150
|
+
visible: row.hideQuestion === ""
|
|
139
151
|
spacing: 6
|
|
140
152
|
Layout.fillWidth: true
|
|
141
153
|
Layout.preferredHeight: 20
|
|
142
154
|
|
|
143
155
|
Text {
|
|
144
156
|
font.family: Theme.font
|
|
145
|
-
text: row.hint !== "" ? row.hint : row.statusLine
|
|
157
|
+
text: row.hint !== "" ? row.hint : row.willHide ? "Will hide" : row.statusLine
|
|
146
158
|
color: row.hint !== "" ? Theme.fg
|
|
159
|
+
: row.willHide ? Theme.reminder
|
|
147
160
|
: row.session.status === "waiting" ? Qt.rgba(Theme.waiting.r, Theme.waiting.g, Theme.waiting.b, 0.85)
|
|
148
161
|
: row.session.status === "done" ? Theme.done
|
|
149
162
|
: Theme.fgFaint
|
|
@@ -178,6 +191,29 @@ Item {
|
|
|
178
191
|
onTapped: row.activated()
|
|
179
192
|
}
|
|
180
193
|
}
|
|
194
|
+
|
|
195
|
+
// The hide question asked from this row, in place of its status.
|
|
196
|
+
RowLayout {
|
|
197
|
+
visible: row.hideQuestion !== ""
|
|
198
|
+
spacing: 6
|
|
199
|
+
Layout.fillWidth: true
|
|
200
|
+
Text {
|
|
201
|
+
font.family: Theme.font
|
|
202
|
+
text: row.hideQuestion
|
|
203
|
+
color: Theme.reminder
|
|
204
|
+
font.pixelSize: Theme.content
|
|
205
|
+
wrapMode: Text.Wrap
|
|
206
|
+
Layout.fillWidth: true
|
|
207
|
+
}
|
|
208
|
+
RowButton {
|
|
209
|
+
glyph: "Keep"
|
|
210
|
+
onTapped: row.hideKept()
|
|
211
|
+
}
|
|
212
|
+
RowButton {
|
|
213
|
+
glyph: "Hide " + row.hideCount
|
|
214
|
+
onTapped: row.hideConfirmed()
|
|
215
|
+
}
|
|
216
|
+
}
|
|
181
217
|
}
|
|
182
218
|
|
|
183
219
|
HoverHandler {
|
|
@@ -196,11 +232,12 @@ Item {
|
|
|
196
232
|
signal tapped()
|
|
197
233
|
readonly property bool hovering: buttonHover.hovered
|
|
198
234
|
|
|
199
|
-
implicitWidth: 26
|
|
235
|
+
implicitWidth: Math.max(26, glyphText.implicitWidth + 12)
|
|
200
236
|
implicitHeight: 20
|
|
201
237
|
radius: Theme.chipRadius
|
|
202
238
|
color: Qt.rgba(Theme.fg.r, Theme.fg.g, Theme.fg.b, buttonHover.hovered ? 0.24 : 0.17)
|
|
203
239
|
Text {
|
|
240
|
+
id: glyphText
|
|
204
241
|
font.family: Theme.font
|
|
205
242
|
anchors.centerIn: parent
|
|
206
243
|
text: button.glyph
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import QtQuick
|
|
2
|
+
import QtQuick.Shapes
|
|
2
3
|
import QtQuick.Layouts
|
|
3
4
|
import "agents.js" as Agents
|
|
4
5
|
import "board.js" as Board
|
|
@@ -9,9 +10,11 @@ import "ticket.js" as Ticket
|
|
|
9
10
|
// rubber stamps that answer it. A pressed stamp slams its word onto the
|
|
10
11
|
// paper, the ticket is torn off (`leaving`), and only then does the answer
|
|
11
12
|
// go. For a finished turn it's ORDER UP! with your prompt and the reply; for
|
|
12
|
-
// any other session, your prompt, what it does now, JUMP, and quiet "
|
|
13
|
-
// links
|
|
14
|
-
//
|
|
13
|
+
// any other session, your prompt, what it does now, JUMP, and quiet "Hide"
|
|
14
|
+
// links. Hiding asks first: with `hideQuestion` set, a dashed red box with
|
|
15
|
+
// the question and HIDE N / KEEP stamps takes the links' place (VIA-PARITY
|
|
16
|
+
// §29). It answers through the client itself; hiding and dismissing are the
|
|
17
|
+
// host's, so they go out as signals.
|
|
15
18
|
Paper {
|
|
16
19
|
id: ticket
|
|
17
20
|
required property var client
|
|
@@ -39,6 +42,11 @@ Paper {
|
|
|
39
42
|
signal hideFolder()
|
|
40
43
|
signal hidePrompt()
|
|
41
44
|
signal closeRequested()
|
|
45
|
+
// An open hide question: its text ("Hide 2 tickets in web-app, …?") and count.
|
|
46
|
+
property string hideQuestion: ""
|
|
47
|
+
property int hideCount: 0
|
|
48
|
+
signal hideConfirmed()
|
|
49
|
+
signal hideKept()
|
|
42
50
|
|
|
43
51
|
// Stamped and being torn off: the holder lifts it away.
|
|
44
52
|
property bool leaving: false
|
|
@@ -133,6 +141,13 @@ Paper {
|
|
|
133
141
|
ticket.client.answer(q.id, answers);
|
|
134
142
|
});
|
|
135
143
|
}
|
|
144
|
+
// A card shortcut (⌃Y ⌃N ⌃A) for this ticket's request: the stamp its key
|
|
145
|
+
// is printed on, slam and tear included, as a click. True when it's ours.
|
|
146
|
+
function stampKey(approvalId, decision) {
|
|
147
|
+
if (!ticket.approval || ticket.approval.id !== approvalId) return false;
|
|
148
|
+
ticket.decide(Ticket.stampFor(decision, ticket.gated));
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
136
151
|
function decide(action) {
|
|
137
152
|
const a = ticket.approval;
|
|
138
153
|
const decision = action === "block" ? "deny" : action === "run" ? "allow" : action;
|
|
@@ -506,21 +521,75 @@ Paper {
|
|
|
506
521
|
}
|
|
507
522
|
}
|
|
508
523
|
|
|
509
|
-
// Hiding is a side door, not an answer: quiet text
|
|
524
|
+
// Hiding is a side door, not an answer: quiet text.
|
|
510
525
|
RowLayout {
|
|
511
|
-
visible: ticket.request === null && !ticket.finished && ticket.canHide
|
|
526
|
+
visible: ticket.request === null && !ticket.finished && ticket.canHide && ticket.hideQuestion === ""
|
|
512
527
|
spacing: 6
|
|
513
528
|
Layout.topMargin: Math.round(ticket.size * 0.4)
|
|
514
529
|
QuietLink {
|
|
515
|
-
text: "
|
|
530
|
+
text: "Hide this folder"
|
|
516
531
|
onClicked: ticket.hideFolder()
|
|
517
532
|
}
|
|
518
533
|
QuietLink {
|
|
519
534
|
visible: (ticket.session ? ticket.session.title || "" : "") !== ""
|
|
520
|
-
text: "·
|
|
535
|
+
text: "· Hide prompts like it"
|
|
521
536
|
onClicked: ticket.hidePrompt()
|
|
522
537
|
}
|
|
523
538
|
}
|
|
539
|
+
|
|
540
|
+
// The hide question, in a dashed red box where the links were.
|
|
541
|
+
Item {
|
|
542
|
+
id: askBox
|
|
543
|
+
visible: ticket.hideQuestion !== ""
|
|
544
|
+
Layout.fillWidth: true
|
|
545
|
+
Layout.topMargin: Math.round(ticket.size * 0.4)
|
|
546
|
+
implicitHeight: askColumn.implicitHeight + 20
|
|
547
|
+
Shape {
|
|
548
|
+
anchors.fill: parent
|
|
549
|
+
ShapePath {
|
|
550
|
+
strokeColor: Ticket.red
|
|
551
|
+
strokeWidth: 1.5
|
|
552
|
+
strokeStyle: ShapePath.DashLine
|
|
553
|
+
dashPattern: [4, 3]
|
|
554
|
+
fillColor: "transparent"
|
|
555
|
+
startX: 1; startY: 1
|
|
556
|
+
PathLine { x: askBox.width - 1; y: 1 }
|
|
557
|
+
PathLine { x: askBox.width - 1; y: askBox.height - 1 }
|
|
558
|
+
PathLine { x: 1; y: askBox.height - 1 }
|
|
559
|
+
PathLine { x: 1; y: 1 }
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
ColumnLayout {
|
|
563
|
+
id: askColumn
|
|
564
|
+
x: 10
|
|
565
|
+
y: 10
|
|
566
|
+
width: parent.width - 20
|
|
567
|
+
spacing: 8
|
|
568
|
+
Words {
|
|
569
|
+
text: ticket.hideQuestion
|
|
570
|
+
color: Ticket.red
|
|
571
|
+
wrapMode: Text.Wrap
|
|
572
|
+
Layout.fillWidth: true
|
|
573
|
+
}
|
|
574
|
+
RowLayout {
|
|
575
|
+
spacing: 10
|
|
576
|
+
Item { Layout.fillWidth: true }
|
|
577
|
+
Stamp {
|
|
578
|
+
size: ticket.size
|
|
579
|
+
label: "Keep"
|
|
580
|
+
tilt: -1.2
|
|
581
|
+
onClicked: ticket.hideKept()
|
|
582
|
+
}
|
|
583
|
+
Stamp {
|
|
584
|
+
size: ticket.size
|
|
585
|
+
label: "Hide " + ticket.hideCount
|
|
586
|
+
ink: Ticket.red
|
|
587
|
+
tilt: 1.2
|
|
588
|
+
onClicked: ticket.hideConfirmed()
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
524
593
|
}
|
|
525
594
|
|
|
526
595
|
Text {
|