rvlib-shipkit 2.32.0 → 2.34.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 +42 -0
- package/package.json +1 -1
- package/src/advisors/advisor-view.ts +29 -7
- package/src/advisors/edge/api.ts +1 -30
- package/src/advisors/project.ts +3 -3
- package/src/advisors/sync.ts +11 -4
- package/src/advisors/users-router.ts +13 -11
- package/src/cli/cmd_BackupTargets.ts +49 -8
- package/src/cli/cmd_Capacity.ts +6 -2
- package/src/cli/cmd_Ci.ts +2 -1
- package/src/cli/cmd_Media.ts +1 -1
- package/src/cli/cmd_Shot.ts +26 -4
- package/src/cli/cmd_Start.ts +3 -3
- package/src/cli.ts +13 -2
- package/src/core/admission.ts +268 -0
- package/src/core/code-lines.ts +36 -21
- package/src/core/machine-read.ts +5 -2
- package/src/core/memory-watch.ts +1 -1
- package/src/core/peer-sk.ts +8 -0
- package/src/gate/admit-heavy.ts +150 -0
- package/src/gate/check-runner.ts +6 -0
- package/src/gate/gate-checks.ts +7 -5
- package/src/gate/head-gate.ts +1 -1
- package/src/gate/job-run.ts +2 -1
- package/src/gate/pre-commit-discovery.ts +6 -3
- package/src/gate/run-check.ts +3 -0
- package/src/gate/run-ci.ts +4 -0
- package/src/home/backup-status.ts +41 -13
- package/src/home/backup-verdict.ts +1 -0
- package/src/home/daemon-jobs.ts +5 -0
- package/src/home/home-routes.ts +3 -2
- package/src/home/house-bucket.ts +14 -0
- package/src/home/run-daemon.ts +3 -1
- package/src/home/this-house.ts +68 -0
- package/src/home/via-hub.ts +2 -1
- package/src/hooks/commit-msg-run.ts +61 -0
- package/src/hooks/commit-run.ts +16 -166
- package/src/hooks/gate-outcome.ts +108 -0
- package/src/hooks/git-hook.ts +9 -9
- package/src/hooks/hook-config.ts +2 -1
- package/src/hooks/pre-commit-checks.ts +1 -1
- package/src/hooks/run-hooks.ts +2 -1
- package/src/hooks/shared-file.ts +3 -2
- package/src/hq/backup-targets.ts +58 -5
- package/src/hq/hq-local.ts +1 -1
- package/src/media-store/backup/bucket-target.ts +58 -0
- package/src/media-store/backup/target-send.ts +7 -4
- package/src/media-store/space.ts +2 -0
- package/src/plan/planner.ts +3 -2
- package/src/repo-config.ts +8 -1
- package/src/review/answer-kinds.ts +2 -0
- package/src/review/cells.ts +40 -9
- package/src/review/format.ts +1 -1
- package/src/review/model.ts +3 -3
- package/src/review/routes.ts +2 -28
- package/src/review/store-parties.ts +28 -0
- package/src/review/store.ts +11 -2
- package/src/review/thread-state.ts +9 -3
- package/src/scaffold/project-scaffold.ts +2 -2
- package/src/secrets/copy.ts +4 -4
- package/src/serve/hub-app/auto-text.tsx +3 -1
- package/src/serve/hub-app/dock-st.ts +1 -1
- package/src/serve/hub-app/review/question-views.tsx +28 -17
- package/src/serve/hub-app/review/review-host.ts +6 -2
- package/src/serve/hub-app/review/review-list.tsx +8 -5
- package/src/serve/hub-app/review/review-st.ts +2 -2
- package/src/serve/hub-app/review/review-thread.tsx +2 -1
- package/src/serve/hub-app/review/review-views.tsx +10 -7
- package/src/serve/hub-app/review/thread-st.ts +25 -11
- package/src/serve/hub-app/review/tone-bar.tsx +29 -24
- package/src/serve/hub-app/review/tones.ts +18 -0
- package/src/serve/hub-app/review.css +11 -2
- package/src/setup-house.ts +1 -7
- package/src/shot/client.ts +2 -1
- package/src/shot/on-place.ts +141 -0
- package/src/start-repo.ts +27 -30
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// the one constraint a reader breaks first: a control the role refuses is not drawn, never drawn disabled, and the
|
|
5
5
|
// page never reaches the owner's repo but through `owner`, null for an advisor
|
|
6
6
|
import type { ReactNode } from 'react'
|
|
7
|
+
import { OWNER_WAITS, type OwnerWait } from '../../../review/thread-state.ts'
|
|
7
8
|
import type { FrameCache } from '../frames-st.ts'
|
|
8
9
|
import type { LayoutSt } from '../layout-st.ts'
|
|
9
10
|
import type { RepoSt } from '../repo-st.ts'
|
|
@@ -15,7 +16,7 @@ export type ReviewRole = 'owner' | 'advisor'
|
|
|
15
16
|
/** every act a control of the page offers, by what it does */
|
|
16
17
|
export const REVIEW_ACTS = [
|
|
17
18
|
// an advisor's, each one an advice that waits for the owner
|
|
18
|
-
'approve', 'fix', 'reply', 'pick', 'files', 'start', 'read', 'search',
|
|
19
|
+
'approve', 'fix', 'reply', 'pick', 'files', 'start', 'read', 'search', 'must',
|
|
19
20
|
// the owner's alone
|
|
20
21
|
'reject', 'rects', 'react', 'close', 'snooze', 'reopen', 'stage', 'publish', 'action', 'apply', 'answer', 'secret',
|
|
21
22
|
'lane', 'share', 'reveal', 'holds', 'attach', 'note', 'filter', 'copy', 'trailer', 'social', 'live',
|
|
@@ -23,11 +24,14 @@ export const REVIEW_ACTS = [
|
|
|
23
24
|
] as const
|
|
24
25
|
export type ReviewAct = (typeof REVIEW_ACTS)[number]
|
|
25
26
|
|
|
26
|
-
const ADVISOR: ReadonlySet<ReviewAct> = new Set<ReviewAct>(['approve', 'fix', 'reply', 'pick', 'files', 'start', 'read', 'search'])
|
|
27
|
+
const ADVISOR: ReadonlySet<ReviewAct> = new Set<ReviewAct>(['approve', 'fix', 'reply', 'pick', 'files', 'start', 'read', 'search', 'must'])
|
|
27
28
|
|
|
28
29
|
/** whether a role may do an act: the owner every one, an advisor what becomes an advice */
|
|
29
30
|
export const canOf = (role: ReviewRole, act: ReviewAct): boolean => role === 'owner' || ADVISOR.has(act)
|
|
30
31
|
|
|
32
|
+
/** the verbs of « what I must do » a role reads: an advisor judges and answers, a step of the owner's hands is his alone */
|
|
33
|
+
export const waitsOf = (role: ReviewRole): readonly OwnerWait[] => (role === 'owner' ? OWNER_WAITS : OWNER_WAITS.filter((w) => w !== 'do'))
|
|
34
|
+
|
|
31
35
|
/** the home the page sits in: its frames, its columns, whether another tool frames it */
|
|
32
36
|
export interface ReviewHome {
|
|
33
37
|
readonly embedded: boolean
|
|
@@ -19,7 +19,8 @@ import { Icon, ICON } from '../icons.tsx'
|
|
|
19
19
|
import { SectionHead } from '../section-head.tsx'
|
|
20
20
|
import { ThreadRow as ThreadRowView, VerbGlyph } from '../thread-row.tsx'
|
|
21
21
|
import { tip } from '../tips.ts'
|
|
22
|
-
import { staleWorkingOf, waitingWords, type Band, isOwnerWait,
|
|
22
|
+
import { staleWorkingOf, waitingWords, type Band, isOwnerWait, type OwnerWait } from '../../../review/thread-state.ts'
|
|
23
|
+
import { waitsOf } from './review-host.ts'
|
|
23
24
|
|
|
24
25
|
const ALL = ''
|
|
25
26
|
|
|
@@ -48,10 +49,11 @@ export const ReviewList = observer(({ rv, place = 'left', tools, top }: { rv: Re
|
|
|
48
49
|
</Pop>
|
|
49
50
|
{tools}
|
|
50
51
|
</div> : rv.can('search') ? <div className="rv-filters">
|
|
51
|
-
<ListFilter value={rv.query} set={(v) => rv.setQuery(v)} keep={(el) => { rv.searchEl = el }} placeholder="search
|
|
52
|
+
<ListFilter value={rv.query} set={(v) => rv.setQuery(v)} keep={(el) => { rv.searchEl = el }} placeholder="search every version and message" label="search every version and message" />
|
|
53
|
+
<ListToggle on={rv.hideHandled} set={(v) => rv.setHideHandled(v)} icon={ICON.hideHandled} label="hide handled" says={rv.hideHandled ? 'hide handled: on, the threads you answered are hidden' : 'hide handled: off, every thread shows'} />
|
|
52
54
|
</div> : null}
|
|
53
55
|
<Everywhere rv={rv} />
|
|
54
|
-
{rv.can('
|
|
56
|
+
{rv.can('must') ? <MustDo rv={rv} /> : null}
|
|
55
57
|
{rv.can('start') && rv.newThread !== null && rv.newThread.starts.length > 0 ? <StartThread rv={rv} st={rv.newThread} /> : null}
|
|
56
58
|
{rv.since && rv.since.moved > 0 ? <div className="rv-since" {...tip(`${sinceWords(rv.since)}\nsince your last act here, ${new Date(rv.since.at).toLocaleString()}`)}><span className="sincelead">since you left: </span>{rv.since.moved}<span className="sincew"> moved</span>, <b>{rv.since.yours}<span className="sincew"> yours</span></b></div> : null}
|
|
57
59
|
</div>
|
|
@@ -93,11 +95,12 @@ const MustDo = observer(({ rv }: { rv: ReviewSt }) => {
|
|
|
93
95
|
const n = (w: OwnerWait): number => rv.page?.byWait[w] ?? 0
|
|
94
96
|
const says = (w: OwnerWait): string => `${w}${n(w) > 0 ? ` (${n(w)})` : ''}: ${MUST_SAYS[w]}`
|
|
95
97
|
const picked = rv.waits ?? []
|
|
98
|
+
const verbs = waitsOf(rv.host.role)
|
|
96
99
|
return (
|
|
97
100
|
<>
|
|
98
101
|
<div className="verbs seg" role="group" aria-label="what I must do">
|
|
99
102
|
<button className={rv.waits === null ? 'on' : ''} {...tip('every thread')} onClick={() => rv.setFilter({ waits: null })}>all</button>
|
|
100
|
-
{
|
|
103
|
+
{verbs.map((w) => (
|
|
101
104
|
<button key={w} className={picked.includes(w) ? 'on' : ''} aria-pressed={picked.includes(w)} aria-label={w} {...tip(says(w))} onClick={() => rv.toggleWait(w)}>
|
|
102
105
|
<VerbGlyph verb={w} says={says(w)} />
|
|
103
106
|
<span className="verbw">{w}</span>
|
|
@@ -111,7 +114,7 @@ const MustDo = observer(({ rv }: { rv: ReviewSt }) => {
|
|
|
111
114
|
{(close) => (
|
|
112
115
|
<>
|
|
113
116
|
<button type="button" className="rv-menuitem" data-check="must" data-wait="" aria-pressed={picked.length === 0} {...tip('every thread, whatever it waits on')} onClick={() => { close(); rv.setFilter({ waits: null }) }}>all</button>
|
|
114
|
-
{
|
|
117
|
+
{verbs.map((w) => (
|
|
115
118
|
<button key={w} type="button" className="rv-menuitem" data-check="must" data-wait={w} aria-pressed={picked.includes(w)} {...tip(MUST_SAYS[w])} onClick={() => { close(); rv.toggleWait(w) }}>
|
|
116
119
|
<span className="trverb"><Icon d={ICON[w]} /></span>
|
|
117
120
|
<span>{w}</span>
|
|
@@ -10,7 +10,7 @@ import { MOVE_LABEL, pasteBase, pasteBlock, STATUS_LABEL, type Move, type Review
|
|
|
10
10
|
import { cellCopy, type CopyCell } from '../../../review/cell-copy.ts'
|
|
11
11
|
import type { PasteHosts } from '../../../review/paste.ts'
|
|
12
12
|
import type { RepoSt } from '../repo-st.ts'
|
|
13
|
-
import { ADVISOR_WHO, type ReviewHost } from './review-host.ts'
|
|
13
|
+
import { ADVISOR_WHO, waitsOf, type ReviewHost } from './review-host.ts'
|
|
14
14
|
import { answeredAs, copyText, etagLoader, READ_MS, StoreWait, kept, threadPageLoader, postJson, TILE_H, ZOOMS, boxScale, isBoxZoom, type BoxZoom, type EtagLoader, type Zoom } from './review-kit.ts'
|
|
15
15
|
import { ThreadSt, type Draft } from './thread-st.ts'
|
|
16
16
|
import { HELD_THREADS, ThreadViews } from './thread-views.ts'
|
|
@@ -718,7 +718,7 @@ export class ReviewSt {
|
|
|
718
718
|
toggleWait(w: OwnerWait): void {
|
|
719
719
|
const on = this.waits ?? []
|
|
720
720
|
const next = on.includes(w) ? on.filter((x) => x !== w) : [...on, w]
|
|
721
|
-
this.setFilter({ waits: next.length ===
|
|
721
|
+
this.setFilter({ waits: next.length === waitsOf(this.host.role).length ? null : next })
|
|
722
722
|
}
|
|
723
723
|
|
|
724
724
|
// ── the address ──
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// them (every version, view, verdict and reply: a click scrolls there and unfolds it), and his answer box pinned under
|
|
4
4
|
// them: one word, sent with a verdict or as a reply, and nothing between the cells and the box; the arrows at the column's
|
|
5
5
|
// top count what waits above. The column opens scrolled to the newest cell
|
|
6
|
+
import { findLast } from '../../../core/es2022.ts'
|
|
6
7
|
import { observer } from 'mobx-react-lite'
|
|
7
8
|
import { WordRefsCtx } from '../word-refs.ts'
|
|
8
9
|
import { tagChoices, tagOf } from '../../../review/thread-query.ts'
|
|
@@ -250,7 +251,7 @@ const StageBar = observer(({ rv, thread, menu }: { rv: ReviewSt; thread: ThreadS
|
|
|
250
251
|
|
|
251
252
|
/** a thread that came from another repo says so at its head, quietly: « moved here from <repo> » */
|
|
252
253
|
const MovedLine = observer(({ thread }: { thread: ThreadSt }) => {
|
|
253
|
-
const t = thread.cells
|
|
254
|
+
const t = findLast(thread.cells, (c) => 'trace' in c && c.trace?.act === 'move')
|
|
254
255
|
const from = t && 'trace' in t ? /from (\S+) to /.exec(t.trace?.did ?? '')?.[1] : undefined
|
|
255
256
|
return from === undefined ? null : <span className="trm" data-check="moved-here" {...tip(t && 'summary' in t ? t.summary : '')}>moved here from {from}</span>
|
|
256
257
|
})
|
|
@@ -25,7 +25,7 @@ import { AnimPanel } from './kind-view.tsx'
|
|
|
25
25
|
import { KindBox, KindViewFrames } from './kind-states.tsx'
|
|
26
26
|
import { Lightbox } from './lightbox.tsx'
|
|
27
27
|
import { ToneBar } from './tone-bar.tsx'
|
|
28
|
-
import { toneKey } from './tones.ts'
|
|
28
|
+
import { questionTones, toneKey } from './tones.ts'
|
|
29
29
|
import { renderMdInline } from '../md.ts'
|
|
30
30
|
import { LiveBody, LiveTile } from './live-view.tsx'
|
|
31
31
|
import { repoIdentity } from '../side-frame-view.tsx'
|
|
@@ -855,8 +855,10 @@ export function boxKey(rv: ReviewSt, thread: ThreadSt, view: BoxView, e: Pick<Ke
|
|
|
855
855
|
if (field && thread.note !== null) return false
|
|
856
856
|
const { at, ver, can, step, tile, opt } = x
|
|
857
857
|
const said = boxReaction(e.key)
|
|
858
|
-
// an option's picture:
|
|
859
|
-
|
|
858
|
+
// an option's picture: the keys of its side panel's answers (tones.ts questionTones) open that answer's box for the
|
|
859
|
+
// option shown, as the thread's keys do
|
|
860
|
+
const keyed = opt ? toneKey(e.key, /^Digit[1-6]$/.test(e.code ?? '') ? e.code!.slice(5) : undefined) : null
|
|
861
|
+
const toned = keyed !== null && questionTones('option', null).some((t) => t.status === keyed) ? keyed : null
|
|
860
862
|
if (e.key === 'Escape') thread.closeBox()
|
|
861
863
|
else if (opt && toned !== null) {
|
|
862
864
|
if (thread.can(toned === 'approved' || toned === 'approved-with-fix' ? 'pick' : 'answer')) thread.face(opt.c.id, toned, opt.i)
|
|
@@ -998,8 +1000,9 @@ export const BoxFrame = observer(({ rv, thread, stage, view }: { rv: ReviewSt; t
|
|
|
998
1000
|
|
|
999
1001
|
/** the side panel of the lightbox on an option's picture: every option of the question as a small picture (the one
|
|
1000
1002
|
* shown lit, his pick and the agent's marked, a click shows it), then the option shown, its number and label whole,
|
|
1001
|
-
* « my pick » on the agent's, his remark with it, the question's words,
|
|
1002
|
-
* he compares and answers without closing. ← → step the options,
|
|
1003
|
+
* « my pick » on the agent's, his remark with it, the question's words, then THAT option's pick and pick with a remark
|
|
1004
|
+
* over the question's row (tone-bar.tsx): he compares and answers without closing. ← → step the options, a digit opens
|
|
1005
|
+
* its answer, Escape closes */
|
|
1003
1006
|
const OptionSide = observer(({ rv, thread, cell, opt }: { rv: ReviewSt; thread: ThreadSt; cell: VersionCell; opt: { c: ReplyCell; i: number; order: number[] } }) => {
|
|
1004
1007
|
const { c, i, order } = opt
|
|
1005
1008
|
const ask = c.ask!
|
|
@@ -1032,8 +1035,8 @@ const OptionSide = observer(({ rv, thread, cell, opt }: { rv: ReviewSt; thread:
|
|
|
1032
1035
|
{ask.row ? <b className="rv-siderow">{ask.row.label}</b> : null}
|
|
1033
1036
|
<Words text={c.text} className="rv-sideqwords" />
|
|
1034
1037
|
</div>
|
|
1035
|
-
{answers ? <ToneBar thread={thread} on={c.id} question={c} pick={
|
|
1036
|
-
<div className="rv-sidekeys rv-dim"><Key k="←" /><Key k="→" /> the options · <Key k="1"
|
|
1038
|
+
{answers ? <ToneBar thread={thread} on={c.id} question={c} pick={ask.pick !== undefined ? (ask.options[ask.pick] ?? `option ${ask.pick + 1}`) : null} option={i} /> : null}
|
|
1039
|
+
<div className="rv-sidekeys rv-dim"><Key k="←" /><Key k="→" /> the options · <Key k="1" /> pick · <Key k="2" /> with a remark · <Key k="esc" /> closes</div>
|
|
1037
1040
|
</aside>
|
|
1038
1041
|
)
|
|
1039
1042
|
})
|
|
@@ -43,7 +43,7 @@ import { ADVISOR_WHO, type ReviewAct } from './review-host.ts'
|
|
|
43
43
|
import { TrailerSt } from './trailer-st.ts'
|
|
44
44
|
import { laneNotes, notesNow, sortedDraft, type LaneNote } from '../../../review/trailer-notes.ts'
|
|
45
45
|
import { ITEM_VERDICTS, type ItemVerdict } from '../../../review/verdict-items.ts'
|
|
46
|
-
import { toneOfStatus } from './tones.ts'
|
|
46
|
+
import { questionTones, toneOfStatus } from './tones.ts'
|
|
47
47
|
import { versionActs } from '../../../review/settle.ts'
|
|
48
48
|
import type { LaneMark } from '../../../review/trailer-model.ts'
|
|
49
49
|
import { KeptFolds } from '../kept-folds.ts'
|
|
@@ -173,6 +173,9 @@ export const requestState = (c: ReplyCell, waiting: boolean): 'superseded' | 'wa
|
|
|
173
173
|
|
|
174
174
|
/** the owner's answer on a choice's row: the option clicked, else the owner's words alone, one more option at the
|
|
175
175
|
* row's end; null while none */
|
|
176
|
+
/** the kinds of question that draw the question's row (none of these on a choice, your call, no answer) */
|
|
177
|
+
const BAR_KINDS: ReadonlySet<string> = new Set(['choice', 'confirm', 'text', 'url'])
|
|
178
|
+
|
|
176
179
|
export const ownerChoice = (a: NonNullable<ReplyCell['ask']>): { option: number } | { words: string } | null =>
|
|
177
180
|
a.answered ? { option: a.answered.option } : a.none !== undefined ? { words: a.none } : null
|
|
178
181
|
|
|
@@ -695,7 +698,12 @@ export class ThreadSt {
|
|
|
695
698
|
judgeKey(status: ItemVerdict): Promise<void> | void {
|
|
696
699
|
const c = [...this.openRequests].reverse().find((x) => x.judge?.open === true || this.questionCell(x.id) !== undefined)
|
|
697
700
|
const v = this.verdictAbove
|
|
698
|
-
if (c !== undefined && (v === null || c.at >= v.at))
|
|
701
|
+
if (c !== undefined && (v === null || c.at >= v.at)) {
|
|
702
|
+
// a question's keys are its row's alone: a pick is a click on its option
|
|
703
|
+
const q = this.questionCell(c.id)
|
|
704
|
+
if (q !== undefined && !questionTones('row', null, q.ask!.kind ?? 'choice').some((t) => t.status === status)) return
|
|
705
|
+
return this.face(c.id, status)
|
|
706
|
+
}
|
|
699
707
|
// a version answered by its kind's acts (a draft) takes no verdict, by key either
|
|
700
708
|
const h = this.head
|
|
701
709
|
if (h?.kind !== 'version' || versionActs(h.item) !== null || !this.takesVerdict) return
|
|
@@ -757,10 +765,11 @@ export class ThreadSt {
|
|
|
757
765
|
return null
|
|
758
766
|
}
|
|
759
767
|
|
|
760
|
-
/** the question `on` names when
|
|
768
|
+
/** the question `on` names when its bar answers it (tone-bar.tsx QuestionBar): a choice, a confirm, a text or a url,
|
|
769
|
+
* no step of an ask's instructions */
|
|
761
770
|
questionCell(on: string): ReplyCell | undefined {
|
|
762
771
|
const c = this.askingCell(on)
|
|
763
|
-
return c?.ask !== undefined && (c.ask.kind
|
|
772
|
+
return c?.ask !== undefined && BAR_KINDS.has(c.ask.kind ?? 'choice') && c.step === undefined && c.judge === undefined ? c : undefined
|
|
764
773
|
}
|
|
765
774
|
|
|
766
775
|
/** the tone the owner's answer to a question gives, the one on its way first: a pick ok, a pick with the owner's words a fix, words
|
|
@@ -774,13 +783,12 @@ export class ThreadSt {
|
|
|
774
783
|
return a.none !== undefined ? 'rework' : undefined
|
|
775
784
|
}
|
|
776
785
|
|
|
777
|
-
/** the owner's
|
|
778
|
-
*
|
|
786
|
+
/** the owner's answer from a question's bar (sendNote, tones.ts questionTones): a pick or a pick with a remark of the
|
|
787
|
+
* option `option`; none of these, your call or no answer goes as his answer in that tone (store.ts answerAsk `tone`) */
|
|
779
788
|
private answerTone(c: ReplyCell, status: ItemVerdict, text: string, option?: number): Promise<void> {
|
|
780
|
-
const pick = option ?? c.ask?.pick
|
|
781
|
-
if ((status === 'approved' || status === 'approved-with-fix') && pick !== undefined) return this.pickOption(c, pick, status === 'approved' ? '' : text)
|
|
782
789
|
if (status === 'approved' || status === 'approved-with-fix') {
|
|
783
|
-
|
|
790
|
+
if (option !== undefined) return this.pickOption(c, option, status === 'approved' ? '' : text)
|
|
791
|
+
this.failed = { on: c.id, why: 'click an option above to pick it' }
|
|
784
792
|
return Promise.resolve()
|
|
785
793
|
}
|
|
786
794
|
return this.save(c.id, status, () => postJson(this.rv.url(`/api/review/${c.on}/answer`), { re: c.id.slice(c.on.length + 1), tone: status, ...(text !== '' ? { text } : {}) }), false)
|
|
@@ -806,13 +814,19 @@ export class ThreadSt {
|
|
|
806
814
|
return this.takeBack()
|
|
807
815
|
}
|
|
808
816
|
|
|
809
|
-
/** the verdict given on `on` (a version's id or a message's cell id), the one on its way first
|
|
817
|
+
/** the verdict given on `on` (a version's id or a message's cell id), the one on its way first; on a person's own
|
|
818
|
+
* view, their newest ok or fix on that version that waits for the owner */
|
|
810
819
|
givenOn(on: string): ItemVerdict | undefined {
|
|
811
820
|
const q = this.questionCell(on)
|
|
812
|
-
const s = this.chosenOn(on) ?? (q !== undefined ? this.questionTone(q) : this.askingCell(on)?.judge?.verdict?.status)
|
|
821
|
+
const s = this.chosenOn(on) ?? (q !== undefined ? this.questionTone(q) : (this.askingCell(on)?.judge?.verdict?.status ?? this.adviceOn(on)))
|
|
813
822
|
return s !== undefined && (ITEM_VERDICTS as readonly string[]).includes(s) ? (s as ItemVerdict) : undefined
|
|
814
823
|
}
|
|
815
824
|
|
|
825
|
+
/** the tone of the reader's newest advice on version `on` that waits for the owner (advisors/sync.ts pendingCells) */
|
|
826
|
+
private adviceOn(on: string): ItemVerdict | undefined {
|
|
827
|
+
return findLast(this.cells, (c): c is ReplyCell => c.kind === 'reply' && c.advice?.on === on)?.advice?.status
|
|
828
|
+
}
|
|
829
|
+
|
|
816
830
|
/** the message `on` names when it is one that asks the owner's verdict; a version's id names none */
|
|
817
831
|
private askingCell(on: string): ReplyCell | undefined {
|
|
818
832
|
return this.cells.find((x): x is ReplyCell => x.kind === 'reply' && x.id === on)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// the owner's answer bar (wiki tools/shipkit/threads-page.md, His answer): the five tones, or no answer, in one labelled bar at the foot
|
|
2
|
-
// of the item that asks it, a version
|
|
3
|
-
//
|
|
4
|
-
//
|
|
2
|
+
// of the item that asks it, a version or a message that asks the owner's verdict; a question draws its own words in the
|
|
3
|
+
// same bar (tones.ts questionTones). A tone with no words acts in one click; one that takes words (a bubble corner marks
|
|
4
|
+
// it) opens a box over the tone, Enter sends its words with it, an empty box the bare tone, Escape closes. The send
|
|
5
5
|
// draws as given in that frame; only a refusal moves it back, the box open again with the words and why. While it waits
|
|
6
6
|
// it wears the orange frame (cta.tsx); given, the lit tone alone, the others on a hover. It sticks to the screen's foot
|
|
7
7
|
// while any part of its item shows, and never leaves its item (review.css .rv-tonebar)
|
|
@@ -15,7 +15,7 @@ import { tip } from '../tips.ts'
|
|
|
15
15
|
import { Cta } from './cta.tsx'
|
|
16
16
|
import { keepFocus, toneOf } from './kit.tsx'
|
|
17
17
|
import type { ThreadSt } from './thread-st.ts'
|
|
18
|
-
import { TONES, toneOfStatus, type Tone } from './tones.ts'
|
|
18
|
+
import { questionToneClass, questionTones, TONES, toneOfStatus, type Tone } from './tones.ts'
|
|
19
19
|
|
|
20
20
|
/** the act each tone is, for the page's role (review-host.ts): an advisor says ok or what they would fix, the rest is
|
|
21
21
|
* the owner's; on a question an advisor's ok and fix are picks */
|
|
@@ -37,47 +37,50 @@ export const ToneMark = ({ t }: { t: Tone }) => (
|
|
|
37
37
|
</span>
|
|
38
38
|
)
|
|
39
39
|
|
|
40
|
-
/** `on`: a version's id, or the cell id of a message that asks the owner's verdict or of a question.
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
40
|
+
/** `on`: a version's id, or the cell id of a message that asks the owner's verdict or of a question. A question answers in
|
|
41
|
+
* question words (tones.ts questionTones), never in a verdict's: under its options the question's row alone, none of
|
|
42
|
+
* these (a choice), your call (`pick`, the agent's pick by its label, null when it named none), no answer. `option`: the
|
|
43
|
+
* bar of that one option (the lightbox's side panel): its pick and its pick with a remark, then the row, its pick lit
|
|
44
|
+
* only on the option he picked. A question's cell wears the frame of what waits already: its bar draws none of its own */
|
|
44
45
|
export const ToneBar = observer(({ thread, on, question, pick, option }: { thread: ThreadSt; on: string; question?: ReplyCell; pick?: string | null; option?: number }) => {
|
|
45
46
|
const buttons = useRef(new Map<ItemVerdict, HTMLButtonElement>())
|
|
46
47
|
const sent = thread.givenOn(on)
|
|
47
48
|
const version = question === undefined && thread.versionOf(on)?.id === on
|
|
49
|
+
// a person's ok waits for the owner: they add a note to it, never take back what only he holds
|
|
50
|
+
const takesBack = version && thread.can('reopen')
|
|
48
51
|
const given = sent !== undefined && !(version && thread.marked)
|
|
49
52
|
const note = thread.note?.on === on && thread.note.option === option ? thread.note : null
|
|
50
53
|
const failed = thread.failed?.on === on && note === null ? thread.failed.why : null
|
|
51
54
|
const sending = thread.sending?.on === on
|
|
52
55
|
const q = question !== undefined
|
|
53
|
-
const
|
|
56
|
+
const row = q && option === undefined
|
|
57
|
+
const list = q ? questionTones(row ? 'row' : 'option', pick ?? null, question.ask?.kind ?? 'choice') : TONES
|
|
58
|
+
const tones = list.filter((t) => thread.can(actOf(t.status, q)))
|
|
54
59
|
if (tones.length === 0) return null
|
|
55
|
-
const
|
|
60
|
+
const cls = (s: ItemVerdict): string => (q ? questionToneClass(s) : toneOf(s))
|
|
61
|
+
const noteTone = note ? (list.find((t) => t.status === note.status) ?? toneOfStatus(note.status)!) : null
|
|
56
62
|
return (
|
|
57
63
|
<Cta on={question === undefined && (!given || note !== null)} className="rv-tonecta">
|
|
58
64
|
{/* a click here never folds or unfolds the cell it sits on */}
|
|
59
|
-
<div className={`rv-tonebar${given ? ' given' : ''}${note ? ' noting' : ''}`} role="group" aria-label={q ? 'your answer to this question' : 'your verdict on this item'} data-check="tonebar" onClick={(e) => e.stopPropagation()}>
|
|
65
|
+
<div className={`rv-tonebar${row ? ' question' : ''}${given ? ' given' : ''}${note ? ' noting' : ''}`} role="group" aria-label={q ? 'your answer to this question' : 'your verdict on this item'} data-check="tonebar" onClick={(e) => e.stopPropagation()}>
|
|
60
66
|
{tones.map((t) => {
|
|
61
67
|
const lit = option === undefined ? sent === t.status : thread.litOn(on, t.status, option)
|
|
62
68
|
const open = note?.status === t.status
|
|
63
|
-
const no = blocked(t)
|
|
64
|
-
const takes = q && pick && (t.status === 'approved' || t.status === 'approved-with-fix') ? ` ${pick}` : ''
|
|
65
69
|
return (
|
|
66
70
|
<button key={t.status} type="button" ref={(b) => void (b ? buttons.current.set(t.status, b) : buttons.current.delete(t.status))} data-check="tone" data-status={t.status}
|
|
67
|
-
className={`rv-tone ${
|
|
68
|
-
|
|
69
|
-
{...tip(`${t.word}${takes} (${t.key} or ${t.letter}): ${no ?? (lit ? 'your answer; a note on it' + (version ? ', or take it back' : '') : t.says)}${t.words && !lit ? '\nopens a box for your words, Enter sends' : ''}`)}
|
|
71
|
+
className={`rv-tone ${cls(t.status)}${lit ? ' chosen' : ''}${open ? ' open' : ''}${t.words ? ' words' : ''}`} aria-pressed={lit} aria-haspopup={t.words ? 'dialog' : undefined} aria-expanded={t.words ? open : undefined}
|
|
72
|
+
{...tip(`${t.word} (${t.key} or ${t.letter}): ${lit ? 'your answer; a note on it' + (takesBack ? ', or take it back' : '') : t.says}${t.words && !lit ? '\nopens a box for your words, Enter sends' : ''}`)}
|
|
70
73
|
onMouseDown={keepFocus} onClick={() => void thread.tone(on, t.status, option)}>
|
|
71
74
|
<ToneMark t={t} />
|
|
72
|
-
<span className="rv-toneword">{t.word}
|
|
75
|
+
<span className="rv-toneword">{t.word}</span>
|
|
73
76
|
</button>
|
|
74
77
|
)
|
|
75
78
|
})}
|
|
76
79
|
{sending ? <span className="rv-tonesending" role="status">sending…</span> : null}
|
|
77
|
-
{note ? (
|
|
78
|
-
<Popover open anchor={buttons.current.get(note.status) ?? null} onClose={() => thread.cancelNote()} outside={note.text.trim() === ''} className={`rv-vnote ${
|
|
79
|
-
label={`your ${
|
|
80
|
-
<NoteBox thread={thread} on={on}
|
|
80
|
+
{note && noteTone ? (
|
|
81
|
+
<Popover open anchor={buttons.current.get(note.status) ?? null} onClose={() => thread.cancelNote()} outside={note.text.trim() === ''} className={`rv-vnote ${cls(note.status)}${option !== undefined ? ' boxed' : ''}`}
|
|
82
|
+
label={`your ${noteTone.word}, with your words`} placement={option !== undefined ? 'bottom-start' : 'top-start'} fallbacks={option !== undefined ? ['top-start'] : ['bottom-start', 'top-end']}>
|
|
83
|
+
<NoteBox thread={thread} on={on} t={noteTone} question={q} text={note.text} why={note.why ?? null} takesBack={takesBack && sent === note.status} />
|
|
81
84
|
</Popover>
|
|
82
85
|
) : null}
|
|
83
86
|
{failed !== null ? <span className="rv-vfail" role="alert">✗ not saved: {failed}</span> : null}
|
|
@@ -88,13 +91,15 @@ export const ToneBar = observer(({ thread, on, question, pick, option }: { threa
|
|
|
88
91
|
|
|
89
92
|
/** the box of a tone: its mark and word, the box focused as it opens; Enter sends both (an empty box the bare tone),
|
|
90
93
|
* ⇧Enter a new line, Escape closes with nothing sent. On the lit tone of a version, « take it back » */
|
|
91
|
-
const NoteBox = observer(({ thread, on,
|
|
94
|
+
const NoteBox = observer(({ thread, on, t, question, text, why, takesBack }: { thread: ThreadSt; on: string; t: Tone; question: boolean; text: string; why: string | null; takesBack: boolean }) => {
|
|
92
95
|
const box = useRef<HTMLTextAreaElement | null>(null)
|
|
96
|
+
const status = t.status
|
|
93
97
|
useLayoutEffect(() => {
|
|
94
98
|
box.current?.focus()
|
|
95
99
|
}, [on, status])
|
|
96
|
-
const
|
|
97
|
-
|
|
100
|
+
const hint = question
|
|
101
|
+
? status === 'approved-with-fix' ? 'your remark: what to change, what to keep' : status === 'rework' ? 'what you want instead' : `a note with your ${t.word}, if you like`
|
|
102
|
+
: status === 'approved-with-fix' ? 'what to fix, the rest stays' : status === 'rework' ? 'what is wrong, what to keep' : status === 'wrong-direction' ? 'why the direction is wrong, what you want instead' : `a note with your ${t.word}, if you like`
|
|
98
103
|
return (
|
|
99
104
|
<>
|
|
100
105
|
<div className="rv-vnotehead">
|
|
@@ -27,6 +27,24 @@ export const TONES: readonly Tone[] = [
|
|
|
27
27
|
|
|
28
28
|
export const toneOfStatus = (s: string): Tone | undefined => TONES.find((t) => t.status === s)
|
|
29
29
|
|
|
30
|
+
/** a question answers in question words, a version in verdict words: one option's pick and pick with a remark, then the
|
|
31
|
+
* question's own row, none of these, your call, no answer. Each is stored as the tone it names (store.ts answerAsk);
|
|
32
|
+
* ok, rework and wrong direction draw on no question. `pick`: the agent's pick by its label, null when it named none.
|
|
33
|
+
* `kind`: none of these on a choice alone; a confirm is a step only the owner does, so no your call either */
|
|
34
|
+
export function questionTones(where: 'option' | 'row', pick: string | null, kind = 'choice'): Tone[] {
|
|
35
|
+
const t = (s: ItemVerdict): Tone => toneOfStatus(s)!
|
|
36
|
+
const row: Tone[] = [
|
|
37
|
+
...(kind === 'choice' ? [{ ...t('rework'), word: 'none of these', glyph: '✕', says: 'none of these options: say what you want instead' }] : []),
|
|
38
|
+
...(kind === 'confirm' ? [] : [{ ...t('your-call'), says: pick !== null ? `go with the agent's pick, ${pick}: nothing to type` : 'the agent decides and says what it chose: nothing to type' }]),
|
|
39
|
+
t('no-answer'),
|
|
40
|
+
]
|
|
41
|
+
if (where === 'row') return row
|
|
42
|
+
return [{ ...t('approved'), word: 'pick', says: 'pick this option' }, { ...t('approved-with-fix'), word: 'pick with a remark', says: 'pick this option with your words: the agent reads both' }, ...row]
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** the colour a question's answer draws in: « none of these » red, a pick with a remark orange, the rest their tone's */
|
|
46
|
+
export const questionToneClass = (s: ItemVerdict): string => (s === 'rework' || s === 'wrong-direction' ? 'st-none' : s === 'approved-with-fix' ? 'st-remark' : `st-${s}`)
|
|
47
|
+
|
|
30
48
|
/** a verdict's glyph as a disc draws it: a tone's, « not doing it » its own */
|
|
31
49
|
export const glyphOf = (s: string): string => toneOfStatus(s)?.glyph ?? (s === 'archived' ? '▤' : '•')
|
|
32
50
|
|
|
@@ -8,6 +8,10 @@
|
|
|
8
8
|
.st-approved-with-fix,.re-approved-with-fix{--tone:var(--yellow)}
|
|
9
9
|
.st-rework,.re-rework{--tone:var(--orange)}
|
|
10
10
|
.st-wrong-direction{--tone:var(--red)}
|
|
11
|
+
/* a question's « none of these » (tones.ts questionToneClass) */
|
|
12
|
+
.st-none{--tone:var(--red)}
|
|
13
|
+
/* a question's « pick with a remark » */
|
|
14
|
+
.st-remark{--tone:var(--orange)}
|
|
11
15
|
.st-your-call,.st-no-answer{--tone:var(--dim)}
|
|
12
16
|
.st-archived,.st-superseded,.st-withdrawn,.st-wontfix,.st-rated{--tone:var(--dim)}
|
|
13
17
|
.st-wip{--tone:var(--k2)}
|
|
@@ -442,7 +446,6 @@
|
|
|
442
446
|
.rv-siderow{color:var(--ink)}
|
|
443
447
|
.rv-boxside :is(.rv-tonecta,.rv-ctaoff.rv-tonecta){position:static;align-self:stretch;margin:0;padding:0}
|
|
444
448
|
.rv-boxside .rv-tonebar{flex-direction:column;align-items:stretch}
|
|
445
|
-
.rv-boxside .rv-tonetakes{display:none}
|
|
446
449
|
.rv-sidekeys{margin-top:auto;font-size:11.5px}
|
|
447
450
|
.rv-vnote.boxed{z-index:60}
|
|
448
451
|
@media (max-width:767px){.rv-boxbody{flex-direction:column}.rv-boxside{flex:0 0 auto;max-height:45%;border-left:0;border-top:1px solid var(--line)}.rv-sidekeys{display:none}}
|
|
@@ -1133,6 +1136,8 @@ button.tr-changed.on{background:var(--accent);color:var(--bg)}
|
|
|
1133
1136
|
.rv-askopt{display:inline-flex;align-items:center;gap:var(--s2);padding:var(--s1) var(--s3);border-radius:8px;border:1px solid var(--line);background:var(--bg);font-size:13px;cursor:pointer;text-align:left}
|
|
1134
1137
|
.rv-askoptlabel{flex:1 1 auto;min-width:min(7em,100%);overflow-wrap:break-word}
|
|
1135
1138
|
.rv-askopt:hover:not(:disabled){border-color:var(--accent)}
|
|
1139
|
+
/* an option of a question is its own pick: green under the pointer, as a pick draws once given */
|
|
1140
|
+
:is(.rv-askoption,.rv-askchoice) > .rv-askopt:hover:not(:disabled){border-color:var(--ok);background:color-mix(in srgb,var(--ok) 8%,var(--bg))}
|
|
1136
1141
|
.rv-askopt.pick{border-color:color-mix(in srgb,var(--accent) 60%,var(--line))}
|
|
1137
1142
|
/* his answer, green as what he settled; the agent's pick only a dashed suggestion beside it, never the same mark */
|
|
1138
1143
|
.rv-askopt.picked{background:color-mix(in srgb,var(--ok) 14%,var(--bg));border-color:var(--ok);outline:1px solid var(--ok);outline-offset:-2px;font-weight:600}
|
|
@@ -1366,7 +1371,11 @@ button.tr-changed.on{background:var(--accent);color:var(--bg)}
|
|
|
1366
1371
|
/* the speech bubble's corner: this tone opens a box for the owner's words */
|
|
1367
1372
|
.rv-tonebubble{position:absolute;right:-4px;top:-3px;width:9px;height:7px;border-radius:4px 4px 4px 0;background:var(--tone);box-shadow:0 0 0 1.5px var(--panel)}
|
|
1368
1373
|
.st-your-call .rv-tonemark{filter:grayscale(1)}
|
|
1369
|
-
.
|
|
1374
|
+
/* a question's own row under its options (tone-bar.tsx, tones.ts questionTones): quiet, the options are the answer */
|
|
1375
|
+
.rv-tonebar.question .rv-tone{min-height:26px;padding:2px var(--s2) 2px 2px;border-width:1px;font-size:12px;font-weight:500;background:none;box-shadow:none;color:var(--dim)}
|
|
1376
|
+
.rv-tonebar.question .rv-tone:hover:not(:disabled),.rv-tonebar.question .rv-tone:focus-visible{color:var(--ink);background:color-mix(in srgb,var(--tone) 16%,var(--panel))}
|
|
1377
|
+
.rv-tonebar.question .rv-tone.chosen,.rv-tonebar.question .rv-tone.open{color:var(--bg);background:var(--tone)}
|
|
1378
|
+
.rv-tonebar.question .rv-tonemark{width:18px;height:18px;font-size:11px}
|
|
1370
1379
|
.rv-tonesending{font-size:12px;color:var(--dim)}
|
|
1371
1380
|
.rv-phone .rv-tone,.rv-thread.slim .rv-tone{font-size:12px;padding-right:var(--s2)}
|
|
1372
1381
|
.rv-vdisc.st-your-call{filter:grayscale(1)}
|
package/src/setup-house.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { consumerOf } from './core/machine-link.ts'
|
|
|
15
15
|
import { runner, type Run } from './git-bootstrap.ts'
|
|
16
16
|
import { installedHouseRoot, plistPath } from './home/home-launchd.ts'
|
|
17
17
|
import { daemonUp, homeUp, pmUp } from './home/home-paths.ts'
|
|
18
|
+
import { houseLine } from './home/this-house.ts'
|
|
18
19
|
import { includeTargets } from './house/project-gutter.ts'
|
|
19
20
|
import { initRepo } from './init-repo.ts'
|
|
20
21
|
import { loadRepoConfig } from './repo-config.ts'
|
|
@@ -94,13 +95,6 @@ async function defaultPortsUp(): Promise<string[]> {
|
|
|
94
95
|
return [pm ? 'pm' : null, daemon ? 'daemon' : null, web ? 'web' : null].filter((x): x is string => x != null)
|
|
95
96
|
}
|
|
96
97
|
|
|
97
|
-
/** the line 1 a wired repo's CLAUDE.md carries: the house index, `~/` relative when it sits under the home */
|
|
98
|
-
export function houseLine(house: string, home: string): string {
|
|
99
|
-
const index = join(house, HOUSE_WIKI_INDEX)
|
|
100
|
-
// a home behind a symlink (/var → /private/var) would expand `~/` to another spelling of the path
|
|
101
|
-
return inside(index, home) && real(home) === home ? `@~/${relative(home, index)}` : `@${index}`
|
|
102
|
-
}
|
|
103
|
-
|
|
104
98
|
/** what is in the way, each a line with its fix; empty when setup may go on. Reads, never writes */
|
|
105
99
|
export async function refusals(o: { repo: string; house: string; home: string; scratch: boolean; realHome: string; platform: string; portsUp: () => Promise<string[]>; which: (b: string) => string | null; gitIdentity: () => Promise<{ name: string; email: string }> }): Promise<string[]> {
|
|
106
100
|
const out: string[] = []
|
package/src/shot/client.ts
CHANGED
|
@@ -16,7 +16,8 @@ export const SHOT_PROCESS = 'shot'
|
|
|
16
16
|
* (shot-theme.ts), and with none the browser's own */
|
|
17
17
|
export type ShotInput = { url: string; out: string; viewport?: Viewport; dpr?: number; reload?: boolean; waitMs?: number; step?: string; at?: number; full?: boolean; root?: string; theme?: Theme }
|
|
18
18
|
export type ClipInput = ShotInput & { seconds: number; fps?: number; dom?: boolean }
|
|
19
|
-
|
|
19
|
+
/** `on`: the place of the house it was shot on (on-place.ts), absent when here */
|
|
20
|
+
export type ShotResult = ShotDone & { via: 'warm' | 'started' | 'local' | 'box'; on?: string }
|
|
20
21
|
|
|
21
22
|
const shotAsk = async (i: ShotInput): Promise<ShotAsk> => {
|
|
22
23
|
const { houseShotLook } = await import('./shot-theme.ts')
|