rvlib-shipkit 2.8.0 → 2.10.0
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/CHANGELOG.md +16 -0
- package/package.json +1 -1
- package/src/checks/SK005-rvlib-versions.check.ts +17 -11
- package/src/cli/cmd_Fleet.ts +8 -5
- package/src/cli/cmd_Review.ts +2 -1
- package/src/core/update-policy.ts +6 -0
- package/src/fleet/commit-bump.ts +123 -0
- package/src/fleet/push-fleet.ts +9 -3
- package/src/fleet/update-fleet.ts +38 -9
- package/src/review/cells.ts +548 -0
- package/src/review/format.ts +1 -1
- package/src/review/model.ts +29 -4
- package/src/review/previews.ts +124 -0
- package/src/review/routes.ts +82 -45
- package/src/review/store.ts +6 -5
- package/src/serve/hub-app/auto-text.tsx +52 -0
- package/src/serve/hub-app/hub.css +2 -0
- package/src/serve/hub-app/media-view.tsx +3 -11
- package/src/serve/hub-app/review/kind-view.tsx +21 -22
- package/src/serve/hub-app/review/kit.tsx +11 -12
- package/src/serve/hub-app/review/review-board.tsx +15 -13
- package/src/serve/hub-app/review/review-cells.tsx +241 -0
- package/src/serve/hub-app/review/review-kit.ts +79 -0
- package/src/serve/hub-app/review/review-list.tsx +87 -122
- package/src/serve/hub-app/review/review-page.tsx +25 -66
- package/src/serve/hub-app/review/review-st.ts +269 -668
- package/src/serve/hub-app/review/review-thread.tsx +301 -0
- package/src/serve/hub-app/review/review-views.tsx +372 -234
- package/src/serve/hub-app/review/thread-st.ts +770 -0
- package/src/serve/hub-app/review/trailer-page.tsx +5 -4
- package/src/serve/hub-app/review.css +252 -90
- package/src/serve/hub-app/review/review-answer.tsx +0 -248
|
@@ -1,248 +0,0 @@
|
|
|
1
|
-
// the review page's right column: the card's header (title, state pill, what), a kind's facts, the linked cards, what
|
|
2
|
-
// goes to the agent, the verdicts (the phone's in a bar under the thumb), then the thread's conversation and his reply
|
|
3
|
-
// box. When the page reads in one column the header sits over the views instead (review-views.tsx)
|
|
4
|
-
import { observer } from 'mobx-react-lite'
|
|
5
|
-
import { Icon, ICON } from '../icons.tsx'
|
|
6
|
-
import { laneOf, placeText, STATUS_LABEL, stateOf, verdictOf, viewName, withdrawnOf, type ReviewItem, type ReviewStatus } from '../../../review/model.ts'
|
|
7
|
-
import { renderMd } from '../md.ts'
|
|
8
|
-
import { AutoTag, blurOnEscape, Empty, LaneTag, Listeners, REACTIONS, Rework, secs, short, SIDE_LABEL, ThumbOf, toneOf, VERDICTS } from './kit.tsx'
|
|
9
|
-
import { AnimPanel, KindView } from './kind-view.tsx'
|
|
10
|
-
import type { ReviewSt } from './review-st.ts'
|
|
11
|
-
|
|
12
|
-
export const ReviewForm = observer(({ rv }: { rv: ReviewSt }) => {
|
|
13
|
-
const x = rv.open
|
|
14
|
-
if (!x) return <Empty text="The open card, its comment and its answer." />
|
|
15
|
-
const r = x.item
|
|
16
|
-
const draft = rv.draft
|
|
17
|
-
const sent = verdictOf(x)
|
|
18
|
-
return (
|
|
19
|
-
<div className="rv-form">
|
|
20
|
-
{rv.headInViews ? null : <CardHead rv={rv} x={x} />}
|
|
21
|
-
<KindView app={rv} x={x} />
|
|
22
|
-
<AnimPanel app={rv} x={x} />
|
|
23
|
-
{rv.newer.map((y) => <Linked key={y.item.id} rv={rv} label="replaced by" id={y.item.id} item={y} />)}
|
|
24
|
-
{r.supersedes && rv.history.length === 0 ? <Linked rv={rv} label="replaces" id={r.supersedes} item={null} /> : null}
|
|
25
|
-
{rv.answered.map((y) => <Linked key={y.item.id} rv={rv} label="answers" id={y.item.id} item={y} />)}
|
|
26
|
-
{rv.answeredBy ? <Linked rv={rv} label="answered by" id={rv.answeredBy.item.id} item={rv.answeredBy} /> : null}
|
|
27
|
-
{rv.history.length > 0 ? <div className="rv-divider">earlier versions</div> : null}
|
|
28
|
-
{rv.history.map((y, i) => <Linked key={y.item.id} rv={rv} label={`v${rv.history.length - i}`} id={y.item.id} item={y} />)}
|
|
29
|
-
<Outgoing rv={rv} />
|
|
30
|
-
<Messages rv={rv} />
|
|
31
|
-
<div className="rv-formfoot">
|
|
32
|
-
<button className="ghost" onClick={() => rv.nextPending()}>next waiting (N)</button>
|
|
33
|
-
{rv.dirty && sent ? <button className="ghost" onClick={() => rv.dropDraft()}>back to the answer sent</button> : null}
|
|
34
|
-
</div>
|
|
35
|
-
{sent && rv.dirty ? <div className="rv-dim">The changes are not sent yet: a verdict sends them.</div> : null}
|
|
36
|
-
{!sent && rv.dirty ? <div className="rv-dim">Draft kept in this browser until it is sent.</div> : null}
|
|
37
|
-
{rv.error ? <div className="rv-err rv-pre">{rv.error}</div> : null}
|
|
38
|
-
</div>
|
|
39
|
-
)
|
|
40
|
-
})
|
|
41
|
-
|
|
42
|
-
const RAISED_NOW: Record<string, string> = {
|
|
43
|
-
new: 'waiting for a dispatcher',
|
|
44
|
-
question: 'a question for you',
|
|
45
|
-
blocked: 'blocked: it waits on your decision',
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/** where the item stands, in a few words beside its pill: when it was sent or answered, who holds a raised item */
|
|
49
|
-
function stateWords(x: ReviewItem): string {
|
|
50
|
-
const o = x.item.origin
|
|
51
|
-
if (o.by !== 'agent') {
|
|
52
|
-
const st = stateOf(x, false)
|
|
53
|
-
const by = o.by === 'player' ? `by ${o.player}` : o.by === 'auto' ? `by the rule ${o.rule}` : 'by you'
|
|
54
|
-
const now =
|
|
55
|
-
st.state === 'open' ? `sent to ${st.topic ?? 'a topic'}`
|
|
56
|
-
: st.state === 'claimed' ? `taken by ${st.worker ?? 'an agent'}`
|
|
57
|
-
: st.state === 'closed' ? (st.why === 'wontfix' ? 'closed, not done' : st.why === 'superseded' ? 'replaced by a card' : st.why === 'rated' ? 'rated' : 'done')
|
|
58
|
-
: RAISED_NOW[st.state] ?? st.state
|
|
59
|
-
return `raised ${by} ${short(x.item.created)} · ${now}`
|
|
60
|
-
}
|
|
61
|
-
const fb = verdictOf(x)
|
|
62
|
-
if (fb) return `answered ${short(fb.at)} · ${fb.seen ? 'read by the agent' : 'not read yet'}`
|
|
63
|
-
const withdrawn = withdrawnOf(x)
|
|
64
|
-
if (withdrawn !== undefined) return `withdrawn: ${withdrawn}`
|
|
65
|
-
return x.item.wip ? 'the agent works on it' : `sent ${short(x.item.created)}`
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
/** the card's header, for every card: the title, one tight line (the state as the list's pill, the lane, when, the
|
|
69
|
-
* commit, the button that copies the card for an agent), then what the agent says. No subject row: the list's row names it, a kind's facts say the
|
|
70
|
-
* rest; no id row: the url carries it. Under it the four verdicts (on the phone they ride the bar under the thumb)
|
|
71
|
-
* and his overall comment, on every card and in every layout */
|
|
72
|
-
export const CardHead = observer(({ rv, x }: { rv: ReviewSt; x: ReviewItem }) => {
|
|
73
|
-
const r = x.item
|
|
74
|
-
const draft = rv.draft
|
|
75
|
-
const status = rv.statusOf(x)
|
|
76
|
-
const sent = verdictOf(x)
|
|
77
|
-
const lane = laneOf(x)
|
|
78
|
-
return (
|
|
79
|
-
<div className="rv-head">
|
|
80
|
-
<h3 className="rv-title">{r.title}</h3>
|
|
81
|
-
<div className="rv-meta">
|
|
82
|
-
<span className={`rv-badge ${toneOf(status)}`}>{STATUS_LABEL[status]}</span>
|
|
83
|
-
{lane ? <LaneTag lane={lane} /> : null}
|
|
84
|
-
{r.origin.by === 'auto' ? <AutoTag rule={r.origin.rule} /> : null}
|
|
85
|
-
<span>{stateWords(x)}</span>
|
|
86
|
-
{r.commit ? <span className="rv-mono" title={`commit ${r.commit}`}>@{r.commit.slice(0, 9)}</span> : null}
|
|
87
|
-
<button className="rv-copyid ghost" title={`copy this card for an agent (C): its title, its repo, sk review show ${r.id}, its link`} aria-label="copy this card for an agent" onClick={() => void rv.copyCard()}>
|
|
88
|
-
<Icon d={ICON.copy} />
|
|
89
|
-
</button>
|
|
90
|
-
</div>
|
|
91
|
-
<Rework rv={rv} x={x} />
|
|
92
|
-
{r.views.length > 0 && r.what ? <div className="md rv-what" dangerouslySetInnerHTML={{ __html: renderMd(r.what) }} /> : null}
|
|
93
|
-
{r.keeps ? <div className="rv-keeps"><b>keeps:</b> {r.keeps}</div> : null}
|
|
94
|
-
{r.why ? <div className="rv-pre rv-why">another subject: {r.why}</div> : null}
|
|
95
|
-
{!rv.phone.on && !r.wip && r.origin.by === 'agent' ? (
|
|
96
|
-
<div className="rv-headverdicts">
|
|
97
|
-
{VERDICTS.map((v) => <VerdictButton key={v.status} v={v} sent={sent?.status} busy={rv.busy} send={() => void rv.submit(v.status)} />)}
|
|
98
|
-
<Listeners rv={rv} cards={[x]} />
|
|
99
|
-
</div>
|
|
100
|
-
) : null}
|
|
101
|
-
<textarea className="rv-comment" rows={2} placeholder="your overall word (a verdict sends it)" value={draft.comment} onKeyDown={blurOnEscape} onChange={(e) => rv.setComment(e.currentTarget.value)} />
|
|
102
|
-
</div>
|
|
103
|
-
)
|
|
104
|
-
})
|
|
105
|
-
|
|
106
|
-
/** one verdict: plain until one is sent, then the chosen one filled and the others dimmed */
|
|
107
|
-
const VerdictButton = ({ v, sent, busy, send }: { v: (typeof VERDICTS)[number]; sent: ReviewStatus | undefined; busy: boolean; send: () => void }) => (
|
|
108
|
-
<button className={`rv-verdict ${toneOf(v.status)}${sent === v.status ? ' chosen' : ''}${sent && sent !== v.status ? ' off' : ''}`} disabled={busy} onClick={send} title={`${v.label} (${v.key})`}>
|
|
109
|
-
<span className="rv-vglyph">{sent === v.status ? '✓' : v.glyph}</span> {v.short} ({v.key})
|
|
110
|
-
</button>
|
|
111
|
-
)
|
|
112
|
-
|
|
113
|
-
/** the phone's verdicts: one row stuck to the bottom of the open card, under the thumb */
|
|
114
|
-
export const VerdictBar = observer(({ rv }: { rv: ReviewSt }) => {
|
|
115
|
-
const x = rv.open
|
|
116
|
-
if (!x || x.item.wip || x.item.origin.by !== 'agent') return null
|
|
117
|
-
const sent = verdictOf(x)?.status
|
|
118
|
-
return (
|
|
119
|
-
<div className="rv-verdictbar">
|
|
120
|
-
{VERDICTS.map((v) => (
|
|
121
|
-
<button key={v.status} className={`rv-verdict ${toneOf(v.status)}${sent === v.status ? ' chosen' : ''}${sent && sent !== v.status ? ' off' : ''}`} disabled={rv.busy}
|
|
122
|
-
onClick={() => void rv.submit(v.status)}>
|
|
123
|
-
{sent === v.status ? '✓' : v.glyph} {v.short}
|
|
124
|
-
</button>
|
|
125
|
-
))}
|
|
126
|
-
</div>
|
|
127
|
-
)
|
|
128
|
-
})
|
|
129
|
-
|
|
130
|
-
/** the card this one replaces, or the one replacing it: a click opens it, its answer shown here */
|
|
131
|
-
const Linked = observer(({ rv, label, id, item }: { rv: ReviewSt; label: string; id: string; item: ReviewItem | null }) => {
|
|
132
|
-
if (!item) return <div className="rv-err">{label} {id}: not found</div>
|
|
133
|
-
const status = rv.statusOf(item)
|
|
134
|
-
const fb = verdictOf(item)
|
|
135
|
-
return (
|
|
136
|
-
<div className={`rv-linked ${toneOf(status)}`}>
|
|
137
|
-
<div className="rv-linkedrow">
|
|
138
|
-
<div className="rv-thumb xs" onClick={() => rv.pick(item.item.id)}><ThumbOf rv={rv} x={item} /></div>
|
|
139
|
-
<span className="rv-dim">{label}</span>
|
|
140
|
-
<a className="rv-linkedtitle" onClick={() => rv.pick(item.item.id)}>{item.item.title}</a>
|
|
141
|
-
<span className="rv-badge">{STATUS_LABEL[status]}</span>
|
|
142
|
-
</div>
|
|
143
|
-
{fb?.comment ? <div className="rv-pre rv-small">{fb.comment}</div> : null}
|
|
144
|
-
{fb?.rects.map((q, i) => (q.comment ? (
|
|
145
|
-
<div key={i} className="rv-dim rv-small">{i + 1}{q.side ? ` ${SIDE_LABEL[q.side]}` : ''}{q.t !== undefined ? ` · ${secs(q.t)}` : ''}: {q.comment}</div>
|
|
146
|
-
) : null))}
|
|
147
|
-
</div>
|
|
148
|
-
)
|
|
149
|
-
})
|
|
150
|
-
|
|
151
|
-
/** scrolls the middle column to a view, or to one tile of a gallery */
|
|
152
|
-
function jumpTo(view: number, tile?: number): void {
|
|
153
|
-
document.getElementById(tile === undefined ? `review-view-${view}` : `review-tile-${view}-${tile}`)?.scrollIntoView({ behavior: 'smooth', block: tile === undefined ? 'start' : 'center' })
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/** « what goes to the agent »: every reaction to a view or a tile, then every rectangle, each by its view's label; a
|
|
157
|
-
* click on its badge scrolls to it, its comment edits in place, the cross removes it */
|
|
158
|
-
const Outgoing = observer(({ rv }: { rv: ReviewSt }) => {
|
|
159
|
-
const x = rv.open
|
|
160
|
-
if (!x) return null
|
|
161
|
-
const views = x.item.views
|
|
162
|
-
const draft = rv.draft
|
|
163
|
-
const reactions = rv.outgoingReactions
|
|
164
|
-
const empty = reactions.length === 0 && draft.rects.length === 0 && draft.pick === undefined
|
|
165
|
-
return (
|
|
166
|
-
<div className="rv-outgoing">
|
|
167
|
-
<div className="rv-divider">what goes to the agent</div>
|
|
168
|
-
{empty ? (
|
|
169
|
-
<div className="rv-dim rv-small">
|
|
170
|
-
{rv.choice && rv.rows
|
|
171
|
-
? 'Score the options (stars, or ⇧1 to ⇧5 on the one playing), a word on one with ✎, then pick one (P): the pick is your answer.'
|
|
172
|
-
: rv.rows
|
|
173
|
-
? 'Play each one (1 to 9), then OK, fix or no on a row, or a word with ✎.'
|
|
174
|
-
: rv.clipKey
|
|
175
|
-
? 'React to a view (OK, fix, no, a word), or drag on the clip to circle a detail: it pauses, the rectangle keeps its moment.'
|
|
176
|
-
: rv.phone.on
|
|
177
|
-
? 'React to a view (OK, fix, no, a word), or turn « Circle » on above the image, then drag to circle a detail.'
|
|
178
|
-
: 'React to a view (OK, fix, no, a word), or drag on the image to circle a detail.'}
|
|
179
|
-
</div>
|
|
180
|
-
) : null}
|
|
181
|
-
{draft.pick !== undefined ? (
|
|
182
|
-
<div className="rv-outrow">
|
|
183
|
-
<button className="rv-outbadge re-approved on" title="see the option you picked" onClick={() => { rv.setView(draft.pick ?? 0); jumpTo(draft.pick ?? 0) }}>
|
|
184
|
-
✓ picked {viewName(views[draft.pick], draft.pick)}
|
|
185
|
-
</button>
|
|
186
|
-
</div>
|
|
187
|
-
) : null}
|
|
188
|
-
{reactions.map((q) => {
|
|
189
|
-
const o = REACTIONS.find((r) => r.status === q.status)
|
|
190
|
-
return (
|
|
191
|
-
<div key={`${q.view}/${q.tile ?? ''}`} className="rv-outrow">
|
|
192
|
-
<button className={`rv-outbadge${q.status ? ` re-${q.status} on` : ''}`} title="see this image" onClick={() => { rv.setView(q.view); jumpTo(q.view, q.tile) }}>
|
|
193
|
-
{o?.glyph ?? (q.stars ? '' : '·')}{q.stars ? `★${q.stars}` : ''} {placeText(q, views).slice(1, -1)}
|
|
194
|
-
</button>
|
|
195
|
-
<textarea rows={1} placeholder={o ? `${o.label}, with no word` : 'a word'} value={q.comment} onKeyDown={blurOnEscape}
|
|
196
|
-
onChange={(e) => rv.setReactionComment(q.view, q.tile, e.currentTarget.value)} />
|
|
197
|
-
<button className="ghost rv-x" aria-label="remove this reaction" onClick={() => rv.removeReaction(q.view, q.tile)}>✕</button>
|
|
198
|
-
</div>
|
|
199
|
-
)
|
|
200
|
-
})}
|
|
201
|
-
{draft.rects.map((q, i) => (
|
|
202
|
-
<div key={`rect${i}`} className="rv-outrow">
|
|
203
|
-
<button className={`rv-outbadge rect${rv.rect === i ? ' on' : ''}`} title="see this rectangle" onClick={() => { rv.pickRect(i); jumpTo(q.view ?? 0) }}>
|
|
204
|
-
⬚ {i + 1}{views.length > 1 ? ` · ${viewName(views[q.view ?? 0], q.view ?? 0)}` : ''}{q.side ? ` ${SIDE_LABEL[q.side]}` : ''}{q.t !== undefined ? ` · ${secs(q.t)}` : ''}
|
|
205
|
-
</button>
|
|
206
|
-
<textarea rows={1} placeholder="what is wrong here" value={q.comment} onFocus={() => rv.pickRect(i)} onKeyDown={blurOnEscape}
|
|
207
|
-
onChange={(e) => rv.setRectComment(i, e.currentTarget.value)} />
|
|
208
|
-
<button className="ghost rv-x" aria-label="delete this rectangle" onClick={() => rv.removeRect(i)}>✕</button>
|
|
209
|
-
</div>
|
|
210
|
-
))}
|
|
211
|
-
</div>
|
|
212
|
-
)
|
|
213
|
-
})
|
|
214
|
-
|
|
215
|
-
/** the thread's conversation, every version's and every answered item's messages in time order, then his reply box
|
|
216
|
-
* (⌘Enter sends) */
|
|
217
|
-
const Messages = observer(({ rv }: { rv: ReviewSt }) => {
|
|
218
|
-
const conv = rv.conversation
|
|
219
|
-
const versions = rv.openThread?.versions ?? []
|
|
220
|
-
const vOf = (id: string): number => versions.length - versions.findIndex((x) => x.item.id === id)
|
|
221
|
-
const multi = new Set(conv.map((m) => m.on)).size > 1
|
|
222
|
-
return (
|
|
223
|
-
<div className="rv-messages">
|
|
224
|
-
<div className="rv-divider">talk</div>
|
|
225
|
-
{conv.length === 0 ? <div className="rv-dim rv-small">No message. An agent answers with sk review reply.</div> : null}
|
|
226
|
-
{conv.map((m) => {
|
|
227
|
-
const mine = m.who === 'owner'
|
|
228
|
-
return (
|
|
229
|
-
<div key={`${m.on}/${m.id}`} className={`rv-msg${mine ? ' mine' : ''}`}>
|
|
230
|
-
<div className="rv-dim rv-small">{mine ? 'you' : m.who} · {short(m.at)}{multi ? ` · v${vOf(m.on)}` : ''}</div>
|
|
231
|
-
<div className="rv-pre">{m.text}</div>
|
|
232
|
-
{m.image ? (
|
|
233
|
-
<a href={rv.threadImageUrl(m.on, m.image)} target="_blank" rel="noreferrer"><img className="rv-msgimg" src={rv.threadImageUrl(m.on, m.image)} alt="" /></a>
|
|
234
|
-
) : null}
|
|
235
|
-
</div>
|
|
236
|
-
)
|
|
237
|
-
})}
|
|
238
|
-
<textarea className="rv-reply" rows={2} placeholder="Answer the agent (⌘Enter sends)" value={rv.reply} onChange={(e) => rv.setReply(e.currentTarget.value)}
|
|
239
|
-
onKeyDown={(e) => {
|
|
240
|
-
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) {
|
|
241
|
-
e.preventDefault()
|
|
242
|
-
void rv.sendReply()
|
|
243
|
-
} else blurOnEscape(e)
|
|
244
|
-
}} />
|
|
245
|
-
<div className="rv-replyrow"><button className="primary" disabled={!rv.reply.trim() || rv.busy} onClick={() => void rv.sendReply()}>Reply</button></div>
|
|
246
|
-
</div>
|
|
247
|
-
)
|
|
248
|
-
})
|