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
|
@@ -2,15 +2,19 @@ import QtQuick
|
|
|
2
2
|
import QtQuick.Layouts
|
|
3
3
|
import "board.js" as Board
|
|
4
4
|
import "ticket.js" as Ticket
|
|
5
|
+
import "hiding.js" as Hiding
|
|
6
|
+
import QtQuick.Shapes
|
|
5
7
|
|
|
6
8
|
// The Ticket style's session list: the kitchen rail. A dark shift report
|
|
7
9
|
// heads it with the plan usage; under it every session is a small ticket
|
|
8
|
-
// clipped to one rail, five at most, waiting ones
|
|
9
|
-
// you see them
|
|
10
|
-
// on
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
// the list opens
|
|
10
|
+
// clipped to one rail, five at most, newest first, waiting ones hanging
|
|
11
|
+
// lower so you see them, and every waiting one on the first page
|
|
12
|
+
// (Ticket.rail, VIA-PARITY §28). The rest sit on the spike at the end of the
|
|
13
|
+
// rail; a click on it swaps the next five onto the rail. A ticket whose place
|
|
14
|
+
// changes slides there and swings again from its magnet.
|
|
15
|
+
// Nothing is picked when the list opens. A click on a ticket unclips it: the
|
|
16
|
+
// full ticket (TicketDetail.qml) drops below the rails. Hiding asks first
|
|
17
|
+
// (§29): the tickets it would take get a dashed red outline and WILL HIDE.
|
|
14
18
|
ColumnLayout {
|
|
15
19
|
id: list
|
|
16
20
|
// The most the list may take; past that the picked session's panel
|
|
@@ -21,47 +25,83 @@ ColumnLayout {
|
|
|
21
25
|
property string usageAgent: "claude"
|
|
22
26
|
property var spend: null
|
|
23
27
|
property bool shortcuts: false
|
|
24
|
-
property string undoLabel: ""
|
|
25
28
|
property string iconFont: ""
|
|
26
29
|
signal hovered(string sessionId)
|
|
27
30
|
signal hideFolder(var session)
|
|
28
31
|
signal hidePrompt(var session)
|
|
29
|
-
signal undoRequested()
|
|
30
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()
|
|
31
37
|
signal quitRequested()
|
|
32
38
|
signal startRequested()
|
|
33
39
|
|
|
34
|
-
// Every session,
|
|
35
|
-
readonly property var everyone:
|
|
40
|
+
// Every session, newest first, five to a page; the rail shows one page.
|
|
41
|
+
readonly property var everyone: sessions
|
|
36
42
|
readonly property int perRail: 5
|
|
37
|
-
readonly property
|
|
43
|
+
readonly property var shownRail: Ticket.rail(everyone, page, perRail)
|
|
44
|
+
readonly property int pages: shownRail.pages
|
|
38
45
|
property int page: 0
|
|
39
46
|
onPagesChanged: if (page >= pages) page = 0
|
|
40
|
-
readonly property var rows:
|
|
47
|
+
readonly property var rows: shownRail.rows
|
|
41
48
|
readonly property bool spiked: everyone.length > perRail
|
|
42
|
-
// How many wait on the spike:
|
|
43
|
-
|
|
44
|
-
|
|
49
|
+
// How many wait on the spike: every ticket not on this page.
|
|
50
|
+
readonly property int onSpike: shownRail.onSpike
|
|
51
|
+
// Where each ticket hung before this change of rows, so one that moves
|
|
52
|
+
// slides from there. Taken after the tickets have read it.
|
|
53
|
+
property var places: ({})
|
|
54
|
+
function notePlaces() {
|
|
55
|
+
const next = {};
|
|
56
|
+
rows.forEach((s, i) => next[s.id] = i);
|
|
57
|
+
places = next;
|
|
58
|
+
}
|
|
59
|
+
onRowsChanged: Qt.callLater(notePlaces)
|
|
45
60
|
readonly property var items: rows.concat(spiked ? [{ spike: true }] : [])
|
|
46
61
|
property string selectedId: ""
|
|
47
62
|
readonly property var selected: rows.find(s => s.id === selectedId) || null
|
|
48
63
|
readonly property var selectedRequest: selected ? Board.pendingFor(selected.id, client.approvals, client.questions) : null
|
|
49
64
|
|
|
50
|
-
function pickWaiting() {
|
|
51
|
-
const waiting = rows.find(s => Board.pendingFor(s.id, client.approvals, client.questions) !== null);
|
|
52
|
-
if (waiting) selectedId = waiting.id;
|
|
53
|
-
}
|
|
54
|
-
Component.onCompleted: pickWaiting()
|
|
55
65
|
// Opened again: start over, as a fresh look at the rail.
|
|
56
66
|
function reset() {
|
|
57
67
|
selectedId = "";
|
|
58
68
|
page = 0;
|
|
59
|
-
|
|
69
|
+
hideAsk = null;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// A hide asked from the picked ticket, not yet confirmed: { folder, text,
|
|
73
|
+
// sessionId }. It recounts on every snapshot (every session, not only this
|
|
74
|
+
// page) and goes with its session; picking another ticket, KEEP, Esc or the
|
|
75
|
+
// list closing drop it.
|
|
76
|
+
property var hideAsk: null
|
|
77
|
+
readonly property var hideRule: hideAsk ? Hiding.question(hideAsk, hideAsk.sessionId, everyone) : null
|
|
78
|
+
onSelectedIdChanged: hideAsk = null
|
|
79
|
+
function askHide(folder) {
|
|
80
|
+
if (!selected) return;
|
|
81
|
+
hideAsk = { folder: folder, text: folder ? selected.cwd || "" : selected.title || "", sessionId: selected.id };
|
|
82
|
+
}
|
|
83
|
+
function confirmHide() {
|
|
84
|
+
const session = selected;
|
|
85
|
+
const ask = hideAsk;
|
|
86
|
+
hideAsk = null;
|
|
87
|
+
if (!session || !ask) return;
|
|
88
|
+
selectedId = "";
|
|
89
|
+
if (ask.folder) list.hideFolder(session);
|
|
90
|
+
else list.hidePrompt(session);
|
|
91
|
+
}
|
|
92
|
+
function cancelHide() {
|
|
93
|
+
if (!hideRule) return false;
|
|
94
|
+
hideAsk = null;
|
|
95
|
+
return true;
|
|
60
96
|
}
|
|
61
|
-
onRowsChanged: if (!selected) pickWaiting()
|
|
62
97
|
|
|
63
98
|
readonly property var keyed: client.questions.length > 0 ? client.questions[0] : client.approvals[0] || null
|
|
64
99
|
|
|
100
|
+
// ⌃Y ⌃N ⌃A from the host: the picked ticket's stamp, when it shows that request.
|
|
101
|
+
function stampKey(approvalId, decision) {
|
|
102
|
+
return detail.visible && detail.stampKey(approvalId, decision);
|
|
103
|
+
}
|
|
104
|
+
|
|
65
105
|
// ⌃1…⌃9: the first question's option, its ticket picked so you see it stamped.
|
|
66
106
|
function pick(index, label) {
|
|
67
107
|
const question = client.questions[0];
|
|
@@ -69,8 +109,8 @@ ColumnLayout {
|
|
|
69
109
|
// Its ticket may hang on another page: go there first. The id goes
|
|
70
110
|
// first so the page change doesn't pick another waiting ticket.
|
|
71
111
|
selectedId = question.sessionId;
|
|
72
|
-
const at =
|
|
73
|
-
if (at >= 0) page =
|
|
112
|
+
const at = Ticket.pageOf(everyone, question.sessionId, perRail);
|
|
113
|
+
if (at >= 0) page = at;
|
|
74
114
|
detail.pick(index, label);
|
|
75
115
|
}
|
|
76
116
|
|
|
@@ -150,6 +190,12 @@ ColumnLayout {
|
|
|
150
190
|
color: "#e9e6dc"
|
|
151
191
|
Layout.fillWidth: true
|
|
152
192
|
}
|
|
193
|
+
// The speaker flips Sounds; a host that has them turns it on.
|
|
194
|
+
HeadKey {
|
|
195
|
+
visible: list.iconFont !== "" && list.soundSwitch
|
|
196
|
+
text: list.soundsOn ? "volume_up" : "volume_off"
|
|
197
|
+
onClicked: list.soundsToggled()
|
|
198
|
+
}
|
|
153
199
|
HeadKey {
|
|
154
200
|
visible: list.iconFont !== ""
|
|
155
201
|
text: "settings"
|
|
@@ -222,7 +268,8 @@ ColumnLayout {
|
|
|
222
268
|
elide: Text.ElideRight
|
|
223
269
|
horizontalAlignment: Text.AlignRight
|
|
224
270
|
Layout.fillWidth: planLine.row.percent === -1 && planLine.row.value === ""
|
|
225
|
-
|
|
271
|
+
// A hint (no reading yet) takes the dashed bar's room, so it's never cut.
|
|
272
|
+
Layout.maximumWidth: planLine.row.percent === -1 || planLine.row.percent === null ? -1 : 190
|
|
226
273
|
}
|
|
227
274
|
}
|
|
228
275
|
}
|
|
@@ -280,7 +327,36 @@ ColumnLayout {
|
|
|
280
327
|
readonly property var request: session ? Board.pendingFor(session.id, list.client.approvals, list.client.questions) : null
|
|
281
328
|
readonly property bool chosen: session !== null && list.selectedId === session.id
|
|
282
329
|
readonly property bool waits: request !== null
|
|
330
|
+
readonly property bool caught: session !== null && list.hideRule !== null && list.hideRule.caught.indexOf(session.id) >= 0
|
|
283
331
|
readonly property real tilt: [-2.5, 2, -1.5, 3, -2][place % 5]
|
|
332
|
+
// Another ticket took this slot: one that hung elsewhere on the rail
|
|
333
|
+
// slides over from there and swings again, as if taken off and hung
|
|
334
|
+
// back up (VIA-PARITY §28).
|
|
335
|
+
readonly property string sessionId: session ? session.id || "" : ""
|
|
336
|
+
property string shownId: ""
|
|
337
|
+
onSessionIdChanged: {
|
|
338
|
+
const from = list.places[sessionId];
|
|
339
|
+
if (shownId !== "" && sessionId !== "" && from !== undefined && from !== place) {
|
|
340
|
+
slide.stop();
|
|
341
|
+
shift.x = (from - place) * (list.miniWidth + list.gap);
|
|
342
|
+
slide.restart();
|
|
343
|
+
swingIn.restart();
|
|
344
|
+
}
|
|
345
|
+
shownId = sessionId;
|
|
346
|
+
}
|
|
347
|
+
Component.onCompleted: shownId = sessionId
|
|
348
|
+
transform: Translate {
|
|
349
|
+
id: shift
|
|
350
|
+
}
|
|
351
|
+
NumberAnimation {
|
|
352
|
+
id: slide
|
|
353
|
+
target: shift
|
|
354
|
+
property: "x"
|
|
355
|
+
to: 0
|
|
356
|
+
duration: 480
|
|
357
|
+
easing.type: Easing.OutBack
|
|
358
|
+
easing.overshoot: 1.6
|
|
359
|
+
}
|
|
284
360
|
width: list.miniWidth
|
|
285
361
|
implicitHeight: face.implicitHeight + (waits ? 22 : 0) + (chosen ? 10 : 0)
|
|
286
362
|
|
|
@@ -361,6 +437,7 @@ ColumnLayout {
|
|
|
361
437
|
angle: 0
|
|
362
438
|
}
|
|
363
439
|
SequentialAnimation {
|
|
440
|
+
id: swingIn
|
|
364
441
|
running: true
|
|
365
442
|
PropertyAction { target: swing; property: "angle"; value: 9 }
|
|
366
443
|
PauseAnimation { duration: mini.place * 70 }
|
|
@@ -405,20 +482,41 @@ ColumnLayout {
|
|
|
405
482
|
implicitHeight: tagText.implicitHeight + 2
|
|
406
483
|
color: "transparent"
|
|
407
484
|
border.width: 2
|
|
408
|
-
border.color: Ticket.tagInk(mini.session)
|
|
485
|
+
border.color: mini.caught ? Ticket.red : Ticket.tagInk(mini.session)
|
|
409
486
|
rotation: -4
|
|
410
487
|
opacity: mini.waits && blink.dim ? 0.35 : 1
|
|
411
488
|
Mono {
|
|
412
489
|
id: tagText
|
|
413
490
|
anchors.centerIn: parent
|
|
414
|
-
text: Ticket.tag(mini.session)
|
|
415
|
-
color: Ticket.tagInk(mini.session)
|
|
491
|
+
text: mini.caught ? "WILL HIDE" : Ticket.tag(mini.session)
|
|
492
|
+
color: mini.caught ? Ticket.red : Ticket.tagInk(mini.session)
|
|
416
493
|
font.weight: Font.Bold
|
|
417
494
|
font.letterSpacing: 1
|
|
418
495
|
}
|
|
419
496
|
}
|
|
420
497
|
}
|
|
421
498
|
|
|
499
|
+
// A ticket the open hide question would take: a dashed red outline.
|
|
500
|
+
Shape {
|
|
501
|
+
visible: mini.caught
|
|
502
|
+
x: -4
|
|
503
|
+
y: -4
|
|
504
|
+
width: face.width + 8
|
|
505
|
+
height: face.height + 8
|
|
506
|
+
ShapePath {
|
|
507
|
+
strokeColor: Ticket.red
|
|
508
|
+
strokeWidth: 2
|
|
509
|
+
strokeStyle: ShapePath.DashLine
|
|
510
|
+
dashPattern: [4, 3]
|
|
511
|
+
fillColor: "transparent"
|
|
512
|
+
startX: 0; startY: 0
|
|
513
|
+
PathLine { x: face.width + 8; y: 0 }
|
|
514
|
+
PathLine { x: face.width + 8; y: face.height + 8 }
|
|
515
|
+
PathLine { x: 0; y: face.height + 8 }
|
|
516
|
+
PathLine { x: 0; y: 0 }
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
|
|
422
520
|
HoverHandler {
|
|
423
521
|
id: hover
|
|
424
522
|
cursorShape: Qt.PointingHandCursor
|
|
@@ -536,7 +634,7 @@ ColumnLayout {
|
|
|
536
634
|
TicketDetail {
|
|
537
635
|
id: detail
|
|
538
636
|
// What's left under the rail or the rows, less what sits below it.
|
|
539
|
-
maxHeight: list.maxHeight - y - (
|
|
637
|
+
maxHeight: list.maxHeight - y - (jumpErrorText.visible ? jumpErrorText.height + list.spacing : 0)
|
|
540
638
|
visible: list.selected !== null
|
|
541
639
|
client: list.client
|
|
542
640
|
session: list.selected
|
|
@@ -559,8 +657,12 @@ ColumnLayout {
|
|
|
559
657
|
lift = 0;
|
|
560
658
|
}
|
|
561
659
|
}
|
|
562
|
-
|
|
563
|
-
|
|
660
|
+
hideQuestion: list.hideRule ? Hiding.questionText(list.hideRule, "ticket") : ""
|
|
661
|
+
hideCount: list.hideRule ? list.hideRule.caught.length : 0
|
|
662
|
+
onHideFolder: list.askHide(true)
|
|
663
|
+
onHidePrompt: list.askHide(false)
|
|
664
|
+
onHideConfirmed: list.confirmHide()
|
|
665
|
+
onHideKept: list.hideAsk = null
|
|
564
666
|
onCloseRequested: list.selectedId = ""
|
|
565
667
|
// Each pick drops in from the rail.
|
|
566
668
|
transform: Scale {
|
|
@@ -591,30 +693,6 @@ ColumnLayout {
|
|
|
591
693
|
easing.type: Easing.OutBack
|
|
592
694
|
}
|
|
593
695
|
|
|
594
|
-
// Undo for the last 86.
|
|
595
|
-
Paper {
|
|
596
|
-
id: undoStrip
|
|
597
|
-
visible: list.undoLabel !== ""
|
|
598
|
-
Layout.fillWidth: true
|
|
599
|
-
implicitHeight: 44 + tooth
|
|
600
|
-
shadow: false
|
|
601
|
-
RowLayout {
|
|
602
|
-
x: 12
|
|
603
|
-
width: parent.width - 24
|
|
604
|
-
height: 44
|
|
605
|
-
Mono {
|
|
606
|
-
text: "86'd · " + list.undoLabel.replace(/^Hidden: /, "")
|
|
607
|
-
elide: Text.ElideRight
|
|
608
|
-
Layout.fillWidth: true
|
|
609
|
-
}
|
|
610
|
-
Stamp {
|
|
611
|
-
label: "Undo"
|
|
612
|
-
ink: Ticket.red
|
|
613
|
-
onClicked: list.undoRequested()
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
|
|
618
696
|
Text {
|
|
619
697
|
id: jumpErrorText
|
|
620
698
|
visible: list.client.jumpError !== ""
|
|
@@ -90,6 +90,9 @@ Scope {
|
|
|
90
90
|
signal jumpAsked(string sessionId)
|
|
91
91
|
|
|
92
92
|
function jump(sessionId) {
|
|
93
|
+
// A jump still running wins: asking now would close the host's windows
|
|
94
|
+
// for a jump that jumpNow() then drops.
|
|
95
|
+
if (jumper.running) return;
|
|
93
96
|
if (askBeforeJump) {
|
|
94
97
|
jumpAsked(sessionId);
|
|
95
98
|
return;
|
package/shell/core/board.js
CHANGED
|
@@ -53,7 +53,7 @@ function statusWord(session, kind, reminding) {
|
|
|
53
53
|
|
|
54
54
|
// The status color's name on Theme for a word.
|
|
55
55
|
function statusTone(word) {
|
|
56
|
-
if (word === "DELAYED" || word === "SECURITY" || word === "DENIED" || word === "BLOCKED") return "reminder";
|
|
56
|
+
if (word === "DELAYED" || word === "SECURITY" || word === "DENIED" || word === "BLOCKED" || word === "HIDE?") return "reminder";
|
|
57
57
|
if (word === "WAITING" || word === "QUESTION") return "waiting";
|
|
58
58
|
if (word === "ARRIVED" || word === "CLEARED" || word === "ANSWERED" || word === "ALLOWED" || word === "ALWAYS" || word === "AUTO") return "done";
|
|
59
59
|
if (word === "BOARDING") return "working";
|
|
@@ -118,21 +118,15 @@ function instant(question) {
|
|
|
118
118
|
return asked.length === 1 && !asked[0].multiSelect;
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
// The board's rows: waiting sessions first, then working, done, idle, each
|
|
122
|
-
// group newest first, as the daemon sends them.
|
|
123
|
-
function ordered(sessions) {
|
|
124
|
-
var rank = { waiting: 0, working: 1, done: 2, idle: 3 };
|
|
125
|
-
return (sessions || []).map(function (s, i) { return { s: s, i: i }; })
|
|
126
|
-
.sort(function (a, b) {
|
|
127
|
-
var ra = rank[a.s.status] == null ? 3 : rank[a.s.status];
|
|
128
|
-
var rb = rank[b.s.status] == null ? 3 : rank[b.s.status];
|
|
129
|
-
return ra - rb || a.i - b.i;
|
|
130
|
-
})
|
|
131
|
-
.map(function (x) { return x.s; });
|
|
132
|
-
}
|
|
133
|
-
|
|
134
121
|
// Seconds left before the risk gate blocks a request on its own (25 s).
|
|
135
122
|
var gateSeconds = 25;
|
|
136
123
|
function gateLeft(approval, now) {
|
|
137
124
|
return Math.max(0, gateSeconds - Math.floor((now - approval.createdAt) / 1000));
|
|
138
125
|
}
|
|
126
|
+
|
|
127
|
+
// How tall a list may grow in its window: 85% of the area, less what sits
|
|
128
|
+
// above it. The list always hangs from the top, so its top never depends on
|
|
129
|
+
// its height.
|
|
130
|
+
function listRoom(areaHeight, top) {
|
|
131
|
+
return Math.floor(areaHeight * 0.85) - top;
|
|
132
|
+
}
|
package/shell/core/hiding.js
CHANGED
|
@@ -27,3 +27,42 @@ function added(list, entry) {
|
|
|
27
27
|
function removed(list, entry) {
|
|
28
28
|
return list.filter(function (e) { return e !== entry; });
|
|
29
29
|
}
|
|
30
|
+
|
|
31
|
+
// What "Hide prompts like it" stores for a prompt: trimmed, without the "…"
|
|
32
|
+
// a cut title ends in, so the rest still matches the full prompt.
|
|
33
|
+
function promptRule(prompt) {
|
|
34
|
+
var text = String(prompt == null ? "" : prompt).trim();
|
|
35
|
+
if (text.slice(-1) === "\u2026") text = text.slice(0, -1).trim();
|
|
36
|
+
return text;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Hiding asks first (VIA-PARITY §29). A hide the user asked for from a row
|
|
40
|
+
// or a ticket: `rule` is { folder: true, text: <cwd> } or { folder: false,
|
|
41
|
+
// text: <prompt> }. Returns { folder, text, sessionId, caught }, `caught`
|
|
42
|
+
// being every listed session the rule would take off, in list order, found
|
|
43
|
+
// with the same matching the filter uses; null when the rule wouldn't catch
|
|
44
|
+
// `sessionId` itself (it's gone, or has no prompt yet). Ask it again with a
|
|
45
|
+
// newer list to recount.
|
|
46
|
+
function question(rule, sessionId, sessions) {
|
|
47
|
+
var text = rule.folder ? String(rule.text || "") : promptRule(rule.text);
|
|
48
|
+
if (text === "") return null;
|
|
49
|
+
var folders = rule.folder ? [text] : [];
|
|
50
|
+
var prompts = rule.folder ? [] : [text];
|
|
51
|
+
var caught = (sessions || []).filter(function (s) { return isHidden(s, folders, prompts); })
|
|
52
|
+
.map(function (s) { return s.id; });
|
|
53
|
+
if (caught.indexOf(sessionId) < 0) return null;
|
|
54
|
+
return { folder: rule.folder, text: text, sessionId: sessionId, caught: caught };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// "Hide 2 tickets in web-app, and any new one there?" `unit` names what the
|
|
58
|
+
// style lists: session (Classic), row (Board) or ticket (Kitchen).
|
|
59
|
+
function questionText(q, unit) {
|
|
60
|
+
var count = q.caught.length;
|
|
61
|
+
var noun = count === 1 ? unit : unit + "s";
|
|
62
|
+
if (q.folder) {
|
|
63
|
+
var parts = q.text.split("/").filter(function (p) { return p !== ""; });
|
|
64
|
+
return "Hide " + count + " " + noun + " in " + (parts.length > 0 ? parts[parts.length - 1] : q.text) + ", and any new one there?";
|
|
65
|
+
}
|
|
66
|
+
var short = q.text.length > 28 ? q.text.slice(0, 27) + "\u2026" : q.text;
|
|
67
|
+
return "Hide " + count + " " + noun + " that start like \u201c" + short + "\u201d, and any new one?";
|
|
68
|
+
}
|
package/shell/core/ticket.js
CHANGED
|
@@ -70,6 +70,14 @@ function orderNumber(id) {
|
|
|
70
70
|
return "#" + digits;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
+
// The stamp a card shortcut presses (⌃Y ⌃N ⌃A), so a key slams and tears
|
|
74
|
+
// like a click: a gated command's stamps are Run it and Block.
|
|
75
|
+
function stampFor(decision, gated) {
|
|
76
|
+
if (decision === "allow") return gated ? "run" : "allow";
|
|
77
|
+
if (decision === "deny") return gated ? "block" : "deny";
|
|
78
|
+
return decision;
|
|
79
|
+
}
|
|
80
|
+
|
|
73
81
|
// The word a stamp leaves on the paper once you've pressed it.
|
|
74
82
|
function stampWord(action, label) {
|
|
75
83
|
var words = { allow: "ALLOWED", deny: "DENIED", always: "ALWAYS", auto: "AUTO", block: "BLOCKED", run: "ALLOWED", spike: "SPIKED", jump: "ON THE WAY" };
|
|
@@ -129,3 +137,34 @@ function planRows(usage, agent, spend, connected, nowSeconds) {
|
|
|
129
137
|
return { label: w[0] + " PLAN", percent: used, value: used + "%", note: timeLeft(window.resetsAt, nowSeconds) };
|
|
130
138
|
});
|
|
131
139
|
}
|
|
140
|
+
|
|
141
|
+
// One page of the rail, `perRail` tickets at most (VIA-PARITY §28): the
|
|
142
|
+
// sessions come newest first and the rail keeps that order. Every session
|
|
143
|
+
// waiting for an answer goes on the first page (the newest `perRail` of
|
|
144
|
+
// them), so none waits unseen on the spike; the newest of the rest fill it
|
|
145
|
+
// up, and the others page through the spike. A page that's gone starts over.
|
|
146
|
+
// { rows, onSpike (how many aren't on this page), pages }.
|
|
147
|
+
function rail(sessions, page, perRail) {
|
|
148
|
+
var all = sessions || [];
|
|
149
|
+
var front = {};
|
|
150
|
+
var waiting = all.filter(function (s) { return s.status === "waiting"; }).slice(0, perRail);
|
|
151
|
+
waiting.forEach(function (s) { front[s.id] = true; });
|
|
152
|
+
all.filter(function (s) { return s.status !== "waiting"; }).slice(0, perRail - waiting.length)
|
|
153
|
+
.forEach(function (s) { front[s.id] = true; });
|
|
154
|
+
var first = all.filter(function (s) { return front[s.id]; });
|
|
155
|
+
var rest = all.filter(function (s) { return !front[s.id]; });
|
|
156
|
+
var pages = 1 + Math.ceil(rest.length / perRail);
|
|
157
|
+
var at = page < pages ? page : 0;
|
|
158
|
+
var rows = at === 0 ? first : rest.slice((at - 1) * perRail, at * perRail);
|
|
159
|
+
return { rows: rows, onSpike: all.length - rows.length, pages: pages };
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// The rail page a session's ticket hangs on, or -1.
|
|
163
|
+
function pageOf(sessions, id, perRail) {
|
|
164
|
+
var r = rail(sessions, 0, perRail);
|
|
165
|
+
for (var p = 0; p < r.pages; p++) {
|
|
166
|
+
var rows = p === 0 ? r.rows : rail(sessions, p, perRail).rows;
|
|
167
|
+
for (var i = 0; i < rows.length; i++) if (rows[i].id === id) return p;
|
|
168
|
+
}
|
|
169
|
+
return -1;
|
|
170
|
+
}
|
|
@@ -56,6 +56,7 @@ PluginComponent {
|
|
|
56
56
|
onInteractionActiveChanged: if (!interactionActive) {
|
|
57
57
|
finishedId = "";
|
|
58
58
|
showAll = false;
|
|
59
|
+
hideAsk = null;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
// "Sessions shown": the list draws that many rows, plus every waiting
|
|
@@ -150,27 +151,17 @@ PluginComponent {
|
|
|
150
151
|
Binding { target: client; property: "hiddenFolders"; value: root.hiddenFolders }
|
|
151
152
|
Binding { target: client; property: "hiddenPrompts"; value: root.hiddenPrompts }
|
|
152
153
|
|
|
153
|
-
//
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}
|
|
154
|
+
// Hiding asks first (VIA-PARITY §29): a hide asked from a row, not yet
|
|
155
|
+
// confirmed, { folder, text, sessionId }. It recounts on every snapshot
|
|
156
|
+
// and goes with its session, Keep, or the popout closing. There's no
|
|
157
|
+
// Undo: Settings lists every entry with a ✕.
|
|
158
|
+
property var hideAsk: null
|
|
159
|
+
readonly property var hideRule: hideAsk ? Hiding.question(hideAsk, hideAsk.sessionId, root.listed) : null
|
|
160
160
|
|
|
161
|
-
function hide(key, entry
|
|
161
|
+
function hide(key, entry) {
|
|
162
162
|
if (entry === "") return;
|
|
163
163
|
const list = key === "hiddenFolders" ? root.hiddenFolders : root.hiddenPrompts;
|
|
164
164
|
PluginService.savePluginData("topside", key, Hiding.added(list, entry));
|
|
165
|
-
root.undo = { key: key, entry: entry, label: label };
|
|
166
|
-
undoTimer.restart();
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
function undoHide() {
|
|
170
|
-
if (!root.undo) return;
|
|
171
|
-
const list = root.undo.key === "hiddenFolders" ? root.hiddenFolders : root.hiddenPrompts;
|
|
172
|
-
PluginService.savePluginData("topside", root.undo.key, Hiding.removed(list, root.undo.entry));
|
|
173
|
-
root.undo = null;
|
|
174
165
|
}
|
|
175
166
|
|
|
176
167
|
// The row under the pointer, for ⌃J.
|
|
@@ -398,6 +389,14 @@ PluginComponent {
|
|
|
398
389
|
Layout.fillWidth: true
|
|
399
390
|
}
|
|
400
391
|
|
|
392
|
+
// Flips Sounds, as the speaker on the Mac's header does.
|
|
393
|
+
DActionButton {
|
|
394
|
+
iconName: root.sounds ? "volume_up" : "volume_off"
|
|
395
|
+
iconColor: Topside.Theme.fgDim
|
|
396
|
+
tooltipText: root.sounds ? "Sounds on" : "Sounds off"
|
|
397
|
+
onClicked: PluginService.savePluginData("topside", "sounds", !root.sounds)
|
|
398
|
+
}
|
|
399
|
+
|
|
401
400
|
DActionButton {
|
|
402
401
|
iconName: "settings"
|
|
403
402
|
iconColor: Topside.Theme.fgDim
|
|
@@ -472,11 +471,20 @@ PluginComponent {
|
|
|
472
471
|
required property var modelData
|
|
473
472
|
session: modelData
|
|
474
473
|
canHide: true
|
|
474
|
+
hideQuestion: root.hideRule && root.hideRule.sessionId === modelData.id ? Hiding.questionText(root.hideRule, "session") : ""
|
|
475
|
+
hideCount: root.hideRule ? root.hideRule.caught.length : 0
|
|
476
|
+
willHide: root.hideRule !== null && root.hideRule.caught.indexOf(modelData.id) >= 0
|
|
475
477
|
Layout.fillWidth: true
|
|
476
478
|
onActivated: root.jumpTo(modelData.id)
|
|
477
479
|
onHoveredChanged: if (hovered) root.hoveredSession = modelData.id; else if (root.hoveredSession === modelData.id) root.hoveredSession = ""
|
|
478
|
-
onHideFolder: root.
|
|
479
|
-
onHidePrompt: root.
|
|
480
|
+
onHideFolder: root.hideAsk = { folder: true, text: modelData.cwd || "", sessionId: modelData.id }
|
|
481
|
+
onHidePrompt: root.hideAsk = { folder: false, text: modelData.title || "", sessionId: modelData.id }
|
|
482
|
+
onHideKept: root.hideAsk = null
|
|
483
|
+
onHideConfirmed: {
|
|
484
|
+
const q = root.hideRule;
|
|
485
|
+
root.hideAsk = null;
|
|
486
|
+
if (q) root.hide(q.folder ? "hiddenFolders" : "hiddenPrompts", q.text);
|
|
487
|
+
}
|
|
480
488
|
}
|
|
481
489
|
}
|
|
482
490
|
}
|
|
@@ -496,32 +504,6 @@ PluginComponent {
|
|
|
496
504
|
}
|
|
497
505
|
}
|
|
498
506
|
|
|
499
|
-
// Undo for the last hide, for 6 s.
|
|
500
|
-
Rectangle {
|
|
501
|
-
visible: root.undo !== null
|
|
502
|
-
Layout.fillWidth: true
|
|
503
|
-
implicitHeight: 32
|
|
504
|
-
radius: 8
|
|
505
|
-
color: Topside.Theme.bgRaised
|
|
506
|
-
RowLayout {
|
|
507
|
-
anchors.fill: parent
|
|
508
|
-
anchors.leftMargin: 12
|
|
509
|
-
anchors.rightMargin: 6
|
|
510
|
-
Text {
|
|
511
|
-
text: root.undo ? root.undo.label : ""
|
|
512
|
-
color: Topside.Theme.fgDim
|
|
513
|
-
font.pixelSize: Topside.Theme.content
|
|
514
|
-
elide: Text.ElideRight
|
|
515
|
-
Layout.fillWidth: true
|
|
516
|
-
}
|
|
517
|
-
Topside.CardButton {
|
|
518
|
-
label: "Undo"
|
|
519
|
-
implicitHeight: 24
|
|
520
|
-
onClicked: root.undoHide()
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
}
|
|
524
|
-
|
|
525
507
|
Text {
|
|
526
508
|
visible: client.jumpError !== ""
|
|
527
509
|
text: client.jumpError
|
|
@@ -558,7 +540,7 @@ PluginComponent {
|
|
|
558
540
|
|
|
559
541
|
Text {
|
|
560
542
|
visible: client.sessions.length === 0
|
|
561
|
-
text: client.connected ? "No sessions yet. Start
|
|
543
|
+
text: client.connected ? "No sessions yet. Start claude, codex, pi or omp in a terminal." : "Topside is off."
|
|
562
544
|
color: Topside.Theme.fgDim
|
|
563
545
|
font.pixelSize: Topside.Theme.s(13)
|
|
564
546
|
horizontalAlignment: Text.AlignHCenter
|
package/shell/pill.qml
CHANGED
|
@@ -269,7 +269,7 @@ ShellRoot {
|
|
|
269
269
|
|
|
270
270
|
Text {
|
|
271
271
|
visible: root.open && client.sessions.length === 0
|
|
272
|
-
text: client.connected ? "Start
|
|
272
|
+
text: client.connected ? "Start claude, codex, pi or omp in a terminal." : "Run: systemctl --user start topside"
|
|
273
273
|
color: Theme.fgDim
|
|
274
274
|
font.pixelSize: Theme.content
|
|
275
275
|
}
|
|
@@ -17,7 +17,7 @@ Item {
|
|
|
17
17
|
// On a lying bar, Style: Board shows flaps and Style: Ticket a little
|
|
18
18
|
// receipt printer, in place of the mascot and dots.
|
|
19
19
|
readonly property bool flaps: service !== null && service.style === "board" && !host.bar.vertical
|
|
20
|
-
readonly property bool printer: service !== null && service.style === "
|
|
20
|
+
readonly property bool printer: service !== null && service.style === "kitchen" && !host.bar.vertical
|
|
21
21
|
readonly property bool own: flaps || printer
|
|
22
22
|
|
|
23
23
|
// No tooltip: the entry already says it (flaps, printer, dots), and one
|
|
@@ -65,7 +65,6 @@ Item {
|
|
|
65
65
|
length: 6
|
|
66
66
|
cell: 11
|
|
67
67
|
color: !root.connected ? Topside.Theme.reminder : root.service && root.service.waitingCount > 0 ? Topside.Theme.waiting : "#f3efe2"
|
|
68
|
-
riffleOnStart: false
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
// Style: Ticket. A receipt printer: its light (amber while something
|