rvlib-shipkit 2.23.0 → 2.24.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 +25 -0
- package/package.json +1 -1
- package/src/agent-time/render.ts +28 -14
- package/src/agent-time/report.ts +46 -25
- package/src/agent-time/store.ts +30 -10
- package/src/agent-time/timeline.ts +43 -15
- package/src/asks/asks-queue.ts +32 -11
- package/src/checks/SK044-behind-upstream.check.ts +38 -0
- package/src/cli/cmd_Asks.ts +2 -0
- package/src/cli/cmd_Backup.ts +7 -5
- package/src/cli/cmd_Bump.ts +1 -0
- package/src/cli/cmd_Capacity.ts +26 -0
- package/src/cli/cmd_Check.ts +1 -0
- package/src/cli/cmd_Checks.ts +1 -0
- package/src/cli/cmd_Ci.ts +1 -0
- package/src/cli/cmd_Commands.ts +50 -14
- package/src/cli/cmd_Home.ts +0 -29
- package/src/cli/cmd_Hooks.ts +1 -0
- package/src/cli/cmd_Mv.ts +1 -0
- package/src/cli/cmd_Reflect.ts +1 -0
- package/src/cli/cmd_Releases.ts +1 -0
- package/src/cli/cmd_Review.ts +97 -14
- package/src/cli/cmd_Secret.ts +41 -2
- package/src/cli/cmd_Shot.ts +1 -0
- package/src/cli/cmd_Status.ts +1 -0
- package/src/cli/cmd_Time.ts +3 -1
- package/src/cli/cmd_Tmp.ts +82 -0
- package/src/cli/cmd_Wiki.ts +1 -0
- package/src/cli/registry.ts +13 -1
- package/src/collections/pings.ts +1 -1
- package/src/core/capacity.ts +71 -0
- package/src/core/check-runner.ts +86 -15
- package/src/core/motherhome.ts +67 -9
- package/src/core/slots.ts +49 -12
- package/src/core/trace-audit.ts +4 -1
- package/src/drill/run.ts +5 -2
- package/src/home/gui-app/ShipkitGui.swift +1 -0
- package/src/home/home-launchd.ts +11 -3
- package/src/home/home-routes.ts +11 -4
- package/src/home/machine-host.ts +65 -0
- package/src/home/machine-stores.ts +19 -17
- package/src/home/machine-temp.ts +493 -0
- package/src/home/other-macs.ts +74 -0
- package/src/home/run-daemon.ts +10 -2
- package/src/home/serve-web.ts +2 -2
- package/src/home/via-hub.ts +6 -1
- package/src/init-repo.ts +7 -3
- package/src/ledger/ledger.ts +6 -0
- package/src/ledger/store.ts +6 -0
- package/src/media-store/backup/keys.ts +21 -6
- package/src/media-store/backup/manifest.ts +52 -11
- package/src/media-store/backup/restore.ts +17 -10
- package/src/media-store/backup/run.ts +5 -2
- package/src/media-store/backup/sources.ts +2 -1
- package/src/mv/mv-md.ts +121 -42
- package/src/reflect/transcript.ts +56 -11
- package/src/releases/from-card.ts +45 -3
- package/src/releases/model.ts +6 -0
- package/src/releases/store.ts +8 -1
- package/src/repo-config.ts +5 -3
- package/src/review/cells.ts +24 -3
- package/src/review/format.ts +33 -9
- package/src/review/media-kind.ts +14 -11
- package/src/review/media-read.ts +6 -5
- package/src/review/model.ts +71 -3
- package/src/review/paste.ts +2 -1
- package/src/review/previews.ts +123 -36
- package/src/review/routes.ts +29 -18
- package/src/review/store.ts +74 -12
- package/src/review/threads.ts +7 -5
- package/src/secrets/copy.ts +110 -0
- package/src/secrets/list.ts +17 -7
- package/src/serve/hub-app/home-strip.css +5 -0
- package/src/serve/hub-app/home-strip.tsx +18 -0
- package/src/serve/hub-app/hub-app.tsx +2 -1
- package/src/serve/hub-app/hub.css +14 -0
- package/src/serve/hub-app/inbox.css +1 -0
- package/src/serve/hub-app/pull-refresh.tsx +88 -0
- package/src/serve/hub-app/review/review-cells.tsx +52 -13
- package/src/serve/hub-app/review/review-list.tsx +6 -1
- package/src/serve/hub-app/review/review-st.ts +6 -5
- package/src/serve/hub-app/review/review-thread.tsx +3 -1
- package/src/serve/hub-app/review/review-views.tsx +18 -11
- package/src/serve/hub-app/review/thread-st.ts +82 -14
- package/src/serve/hub-app/review.css +15 -2
- package/src/serve/hub-runtime.ts +2 -1
- package/src/serve/run-serve.ts +4 -2
- package/src/serve/serve-hub.ts +9 -2
- package/src/suite/child-tools.ts +45 -0
- package/src/suite/judge-suites.ts +10 -22
- package/src/suite/select.ts +83 -8
- package/src/suite/suite-cli.ts +38 -14
- package/src/suite/suite-cores.ts +68 -0
- package/src/suite/suite-reads-preload.ts +8 -6
- package/src/ts/config.ts +44 -0
- package/src/ts/rename.ts +11 -1
- package/src/home/claude-temp.ts +0 -139
package/src/secrets/list.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
// the secrets one repo is for: the house's registry rows in its scope, plus the
|
|
2
2
|
// repo's own `creds`. Presence reads each value through `credsReadCommand` and
|
|
3
|
-
// keeps only whether it answered
|
|
3
|
+
// keeps only whether it answered, or that the keychain was locked to this session:
|
|
4
|
+
// a value is never printed, logged or returned.
|
|
4
5
|
import { inScope, scopesAll, scopeText, type Asker } from '../core/scope.ts'
|
|
5
6
|
import type { RepoConfig } from '../repo-config.ts'
|
|
6
7
|
import { secretArgv } from '../smoke/run-smoke.ts'
|
|
8
|
+
import { LOCKED } from './copy.ts'
|
|
7
9
|
|
|
8
10
|
export type Cred = NonNullable<RepoConfig['creds']>[number]
|
|
9
11
|
|
|
@@ -28,13 +30,21 @@ export function secretsFor(o: { asker: Asker; own: Cred[]; house: Cred[]; all?:
|
|
|
28
30
|
.sort((a, b) => Number(b.mine) - Number(a.mine) || Number(b.inScope) - Number(a.inScope) || a.name.localeCompare(b.name))
|
|
29
31
|
}
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
export type Presence = 'ok' | 'missing' | 'locked'
|
|
34
|
+
|
|
35
|
+
/** the exit of macOS's `security` for an item it found in a keychain locked to this session (an ssh one), with no
|
|
36
|
+
* message; an item it did not find exits 44, locked or not */
|
|
37
|
+
export const LOCKED_EXIT = 36
|
|
38
|
+
|
|
39
|
+
/** whether each secret answers through the read command, all at once. A secret in a keychain locked to this session
|
|
40
|
+
* is there but unread: locked, never missing */
|
|
41
|
+
export async function presence(reader: string, names: string[]): Promise<Map<string, Presence>> {
|
|
42
|
+
const out = new Map<string, Presence>()
|
|
34
43
|
await Promise.all(names.map(async (name) => {
|
|
35
|
-
const p = Bun.spawn(secretArgv(reader, name, 'get'), { stdout: 'pipe', stderr: '
|
|
36
|
-
const
|
|
37
|
-
|
|
44
|
+
const p = Bun.spawn(secretArgv(reader, name, 'get'), { stdout: 'pipe', stderr: 'pipe' })
|
|
45
|
+
const [value, err] = await Promise.all([new Response(p.stdout).text(), new Response(p.stderr).text()])
|
|
46
|
+
const code = await p.exited
|
|
47
|
+
out.set(name, code === 0 && value.trim() !== '' ? 'ok' : code === LOCKED_EXIT || LOCKED.test(err) ? 'locked' : 'missing')
|
|
38
48
|
}))
|
|
39
49
|
return out
|
|
40
50
|
}
|
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
.hstrip{display:flex;align-items:center;flex-wrap:nowrap;gap:var(--s2);height:40px;flex:none;padding:0 var(--s3);border-bottom:1px solid var(--line);background:var(--bg-top);overflow:hidden;white-space:nowrap}
|
|
4
4
|
.hstrip .sp{flex:1}
|
|
5
5
|
.hplace{font-size:12px;font-weight:650;letter-spacing:.08em;text-transform:uppercase;color:var(--dim)}
|
|
6
|
+
/* the Mac this home runs on, and a link to each other Mac's home */
|
|
7
|
+
.hmacs{display:inline-flex;align-items:center;gap:var(--s1);flex:none}
|
|
8
|
+
.hmac{font-size:12px;font-weight:600;line-height:20px;padding:0 var(--s2);border:1px solid var(--line);border-radius:10px;color:var(--ink);text-decoration:none;white-space:nowrap}
|
|
9
|
+
.hmac.cur{color:var(--dim);border-color:transparent}
|
|
10
|
+
a.hmac:hover{border-color:var(--accent);color:var(--accent)}
|
|
6
11
|
.hrepo{display:inline-flex;align-items:center;gap:var(--s2);min-width:0;flex:0 1 auto}
|
|
7
12
|
.hrepo img,.hrico{flex:none;width:18px;height:18px;border-radius:4px;object-fit:contain}
|
|
8
13
|
.hrname{font-size:13px;font-weight:650;letter-spacing:.04em;min-width:0;overflow:hidden;text-overflow:ellipsis}
|
|
@@ -344,6 +344,7 @@ export const HomeStrip = observer(({ app }: { app: HomeSt }) => {
|
|
|
344
344
|
<div className="hstrip">
|
|
345
345
|
<Places s={app.projects} />
|
|
346
346
|
<Identities s={app.projects} />
|
|
347
|
+
<MacLinks m={m} />
|
|
347
348
|
{name == null ? <span className="hplace">{app.page === 'overview' ? 'overview' : app.page}</span> : <ShownRepo app={app} name={name} />}
|
|
348
349
|
{name == null ? null : <RepoProcesses m={m} name={name} />}
|
|
349
350
|
<span className="sp" />
|
|
@@ -356,6 +357,23 @@ export const HomeStrip = observer(({ app }: { app: HomeSt }) => {
|
|
|
356
357
|
)
|
|
357
358
|
})
|
|
358
359
|
|
|
360
|
+
/** this Mac's name and a link to each other Mac's home: shown only while another Mac's home answers */
|
|
361
|
+
const MacLinks = observer(({ m }: { m: MachineSt }) => {
|
|
362
|
+
const macs = m.data?.otherMacs ?? []
|
|
363
|
+
if (macs.length === 0) return null
|
|
364
|
+
const here = m.data?.here
|
|
365
|
+
return (
|
|
366
|
+
<span className="hmacs" aria-label="the homes of this Mac and the others">
|
|
367
|
+
{here == null ? null : <span className="hmac cur" title="the Mac this home runs on">{here}</span>}
|
|
368
|
+
{macs.map((x) => (
|
|
369
|
+
<a key={x.url} className="hmac" href={x.url} target="_blank" rel="noopener" title={`the home on ${x.name}: ${x.url}`}>
|
|
370
|
+
{x.name} ↗
|
|
371
|
+
</a>
|
|
372
|
+
))}
|
|
373
|
+
</span>
|
|
374
|
+
)
|
|
375
|
+
})
|
|
376
|
+
|
|
359
377
|
/** archive the repo or bring it back: `archived` in its repo.config.ts, and
|
|
360
378
|
* only that key. Archived, it stays listed and nothing runs there */
|
|
361
379
|
export const ArchiveButton = observer(({ app, name }: { app: HomeSt; name: string }) => {
|
|
@@ -56,6 +56,7 @@ import { PageFrames } from './pages-frames.tsx'
|
|
|
56
56
|
import { repoSections } from './repo-sections.ts'
|
|
57
57
|
import { Dock } from './dock-view.tsx'
|
|
58
58
|
import { DOCK } from './dock-st.ts'
|
|
59
|
+
import { PullRefresh } from './pull-refresh.tsx'
|
|
59
60
|
import { animateDock } from './dock-anim.ts'
|
|
60
61
|
|
|
61
62
|
// home.html marks the home's page; index.html is a hub serving on its own; `<base>/embed/?page=review` is one repo's
|
|
@@ -481,4 +482,4 @@ await Promise.race([home.shown?.cols.restore(), new Promise((ok) => setTimeout(o
|
|
|
481
482
|
const solo = location.pathname.startsWith('/recordings') && new URLSearchParams(location.search).has('solo')
|
|
482
483
|
|
|
483
484
|
quietBenignErrors(window)
|
|
484
|
-
createRoot(document.getElementById('root')!).render(<StrictMode
|
|
485
|
+
createRoot(document.getElementById('root')!).render(<StrictMode><PullRefresh />{solo ? <main className="rcsolo"><RecordingsView app={home} solo /></main> : embed == null ? <App /> : <EmbedApp page={embed} />}</StrictMode>)
|
|
@@ -57,6 +57,20 @@
|
|
|
57
57
|
.idb{background:var(--idd)}
|
|
58
58
|
:root[data-theme=light] .idb{background:var(--idl)}
|
|
59
59
|
*{box-sizing:border-box}html,body,#root{height:100%}
|
|
60
|
+
/* react-resizable-panels writes touch-action pan-x or pan-y inline on every group and on the div inside every panel,
|
|
61
|
+
and they wrap the whole page: a phone could not pinch anywhere. Its separators keep their own none, so a drag still
|
|
62
|
+
resizes */
|
|
63
|
+
[data-group],[data-panel]>div{touch-action:manipulation!important}
|
|
64
|
+
/* the pull to refresh arrow (pull-refresh.tsx), over every sheet of the phone */
|
|
65
|
+
.ptr{position:fixed;top:env(safe-area-inset-top);left:50%;z-index:200;width:36px;height:36px;display:flex;align-items:center;
|
|
66
|
+
justify-content:center;border-radius:50%;background:var(--panel);border:1px solid var(--line);box-shadow:0 2px 10px var(--shadow);
|
|
67
|
+
color:var(--dim);font-size:20px;line-height:1;transform:translate(-50%,-48px);opacity:0;pointer-events:none;
|
|
68
|
+
transition:transform .2s,opacity .2s}
|
|
69
|
+
.ptr.drag{transition:none}
|
|
70
|
+
.ptr.armed{color:var(--accent);border-color:var(--accent)}
|
|
71
|
+
.ptr.go{animation:ptrspin .7s linear infinite}
|
|
72
|
+
@keyframes ptrspin{to{rotate:360deg}}
|
|
73
|
+
@media (prefers-reduced-motion:reduce){.ptr{transition:none}.ptr.go{animation:none}}
|
|
60
74
|
body{margin:0;background:var(--bg);color:var(--ink);font:14px/1.5 system-ui,sans-serif;overflow:hidden}
|
|
61
75
|
/* a link with no class of its own: the browser default is dark blue on this dark page */
|
|
62
76
|
a,a:visited{color:var(--accent)}
|
|
@@ -80,5 +80,6 @@ a.ib-hub svg{width:14px;height:14px}
|
|
|
80
80
|
.ib-phone .rv-back{min-width:44px;min-height:44px}
|
|
81
81
|
.ib-phone input,.ib-phone textarea,.ib-phone select{font-size:16px}
|
|
82
82
|
.ib-phone .ib-pane button,.ib-sheet button{min-height:44px}
|
|
83
|
+
.ib-phone .ib-pane .seg,.ib-sheet .seg{height:auto}
|
|
83
84
|
.ib-phone .stagewrap{padding:var(--s3)}
|
|
84
85
|
.ib-phone .colcard input{min-width:0}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// pull to refresh on a touch screen. The page is an app shell (body overflow hidden, the panes scroll inside, hub.css),
|
|
2
|
+
// so the browser's own pull never starts, and the home installed on a phone (standalone) has none at all. One finger
|
|
3
|
+
// that pulls down where nothing under it is scrolled draws the arrow; let go past the mark and the page reloads.
|
|
4
|
+
// Mounted once for every page (hub-app.tsx); a mouse first screen renders nothing
|
|
5
|
+
import { useEffect, useRef } from 'react'
|
|
6
|
+
|
|
7
|
+
/** finger travel before a drag counts as a pull, so a tap or a sideways swipe never shows the arrow */
|
|
8
|
+
const DEAD_PX = 12
|
|
9
|
+
/** the arrow's travel, half the finger's, that reloads on release */
|
|
10
|
+
const ARM_PX = 72
|
|
11
|
+
const MAX_PX = 110
|
|
12
|
+
|
|
13
|
+
const TOUCH = typeof window !== 'undefined' && window.parent === window && typeof window.matchMedia === 'function' && window.matchMedia('(pointer: coarse)').matches
|
|
14
|
+
|
|
15
|
+
/** a touch that starts here pulls the page: nothing under it scrolled down, nothing under it that keeps the touch for
|
|
16
|
+
* itself (touch-action none: a separator, a surface a drag draws on), and the page not pinch zoomed in */
|
|
17
|
+
function pullsFrom(target: EventTarget | null): boolean {
|
|
18
|
+
if ((window.visualViewport?.scale ?? 1) > 1.01) return false
|
|
19
|
+
for (let el = target instanceof Element ? target : null; el != null; el = el.parentElement) {
|
|
20
|
+
if (el.scrollTop > 0) return false
|
|
21
|
+
if (getComputedStyle(el).touchAction === 'none') return false
|
|
22
|
+
}
|
|
23
|
+
return true
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function PullRefresh() {
|
|
27
|
+
const ref = useRef<HTMLDivElement | null>(null)
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
const el = ref.current
|
|
30
|
+
if (el == null) return
|
|
31
|
+
let from: { x: number; y: number } | null = null
|
|
32
|
+
let pull = -1
|
|
33
|
+
const draw = (px: number) => {
|
|
34
|
+
el.style.transform = `translate(-50%, ${px - 48}px) rotate(${px * 3}deg)`
|
|
35
|
+
el.style.opacity = String(Math.min(1, px / ARM_PX))
|
|
36
|
+
el.classList.toggle('armed', px >= ARM_PX)
|
|
37
|
+
}
|
|
38
|
+
const reset = () => {
|
|
39
|
+
from = null
|
|
40
|
+
pull = -1
|
|
41
|
+
el.classList.remove('drag', 'armed')
|
|
42
|
+
el.style.transform = ''
|
|
43
|
+
el.style.opacity = ''
|
|
44
|
+
}
|
|
45
|
+
const onStart = (e: TouchEvent) => {
|
|
46
|
+
if (e.touches.length !== 1 || !pullsFrom(e.target)) return reset()
|
|
47
|
+
const t = e.touches[0]!
|
|
48
|
+
from = { x: t.clientX, y: t.clientY }
|
|
49
|
+
}
|
|
50
|
+
const onMove = (e: TouchEvent) => {
|
|
51
|
+
if (from == null) return
|
|
52
|
+
// a second finger is a pinch: the pull lets go of it
|
|
53
|
+
if (e.touches.length !== 1) return reset()
|
|
54
|
+
const t = e.touches[0]!
|
|
55
|
+
const dx = t.clientX - from.x
|
|
56
|
+
const dy = t.clientY - from.y
|
|
57
|
+
if (pull < 0) {
|
|
58
|
+
if (Math.abs(dx) < DEAD_PX && Math.abs(dy) < DEAD_PX) return
|
|
59
|
+
if (dy <= Math.abs(dx)) return reset()
|
|
60
|
+
el.classList.add('drag')
|
|
61
|
+
}
|
|
62
|
+
pull = Math.min(MAX_PX, Math.max(0, (dy - DEAD_PX) / 2))
|
|
63
|
+
draw(pull)
|
|
64
|
+
}
|
|
65
|
+
const onEnd = (e: TouchEvent) => {
|
|
66
|
+
if (pull >= ARM_PX && e.type === 'touchend') {
|
|
67
|
+
el.classList.remove('drag')
|
|
68
|
+
el.classList.add('go')
|
|
69
|
+
location.reload()
|
|
70
|
+
return
|
|
71
|
+
}
|
|
72
|
+
reset()
|
|
73
|
+
}
|
|
74
|
+
const opts = { capture: true, passive: true }
|
|
75
|
+
window.addEventListener('touchstart', onStart, opts)
|
|
76
|
+
window.addEventListener('touchmove', onMove, opts)
|
|
77
|
+
window.addEventListener('touchend', onEnd, opts)
|
|
78
|
+
window.addEventListener('touchcancel', onEnd, opts)
|
|
79
|
+
return () => {
|
|
80
|
+
window.removeEventListener('touchstart', onStart, opts)
|
|
81
|
+
window.removeEventListener('touchmove', onMove, opts)
|
|
82
|
+
window.removeEventListener('touchend', onEnd, opts)
|
|
83
|
+
window.removeEventListener('touchcancel', onEnd, opts)
|
|
84
|
+
}
|
|
85
|
+
}, [])
|
|
86
|
+
if (!TOUCH) return null
|
|
87
|
+
return <div ref={ref} className="ptr" aria-hidden="true">↻</div>
|
|
88
|
+
}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
// click shows the view they sit on), a reply and a note are words; a run of state changes is one thin line
|
|
5
5
|
import { observer } from 'mobx-react-lite'
|
|
6
6
|
import type { EventCell, NoteCell, ReplyCell, VerdictCell, VersionCell } from '../../../review/cells.ts'
|
|
7
|
-
import { isGallery, isTrailerCard, STATUS_LABEL, viewName, viewTag, type Item, type Rect, type TrailerCard } from '../../../review/model.ts'
|
|
7
|
+
import { isGallery, isTrailerCard, STATUS_LABEL, UPDATE_WORDS, viewName, viewTag, type Item, type Rect, type TrailerCard } from '../../../review/model.ts'
|
|
8
8
|
import { Caret, Icon, ICON } from '../icons.tsx'
|
|
9
9
|
import { renderMd } from '../md.ts'
|
|
10
10
|
import { ageWords, stampWords } from '../time-ago.tsx'
|
|
11
11
|
import { KindView, AnimPanel } from './kind-view.tsx'
|
|
12
12
|
import { keepFocus, laneColor, REACTIONS, secs, SIDE_LABEL, toneOf } from './kit.tsx'
|
|
13
13
|
import type { ReviewSt } from './review-st.ts'
|
|
14
|
-
import { VersionViews } from './review-views.tsx'
|
|
14
|
+
import { VersionViews, ViewCell } from './review-views.tsx'
|
|
15
15
|
import { cellDom, type Framed, type ThreadSt } from './thread-st.ts'
|
|
16
16
|
import { NoteMeta, NoteStill, TrailerCardBody } from './trailer-card.tsx'
|
|
17
17
|
|
|
@@ -57,8 +57,9 @@ export const CellFrame = observer(({ rv, card, c }: { rv: ReviewSt; card: Thread
|
|
|
57
57
|
<button className="rv-foldbtn" aria-label={open ? 'fold' : 'unfold'} aria-expanded={open} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.toggleCell(c) }}><Caret open={open} /></button>
|
|
58
58
|
<Avatar who={c.who} />
|
|
59
59
|
{avatarText(c.who) === whoWords(c.who) ? null : <b className="rv-cwho">{whoWords(c.who)}</b>}
|
|
60
|
-
<span className="rv-ckind">{c.kind === 'version' ? `v${c.n}` : c.kind === 'reply' && c.op ? (c.op === 'ask' ? 'question' : 'answer') : KIND_LABEL[c.kind]}</span>
|
|
60
|
+
<span className="rv-ckind">{c.kind === 'version' ? `v${c.n}` : c.kind === 'reply' && c.op ? (c.op === 'ask' ? 'question' : 'answer') : c.kind === 'reply' && c.update ? `update ${c.update.k}` : c.kind === 'reply' && c.re ? `hint on update ${c.re.k}` : KIND_LABEL[c.kind]}</span>
|
|
61
61
|
{c.kind === 'version' ? <span className="rv-badge">{STATUS_LABEL[c.status]}</span> : null}
|
|
62
|
+
{c.kind === 'reply' && c.update ? <span className={`rv-badge rv-up up-${c.update.state}`}>{UPDATE_WORDS[c.update.state]}</span> : null}
|
|
62
63
|
{c.kind === 'verdict' ? <span className="rv-badge">{STATUS_LABEL[c.verdict]}</span> : null}
|
|
63
64
|
{c.kind === 'verdict' ? (
|
|
64
65
|
<button className="rv-on ghost" title={c.n > 0 ? `the version this answers: v${c.n}` : 'the note this answers'} onMouseDown={keepFocus} onClick={(e) => { e.stopPropagation(); card.reveal(c.on) }}>↑ on {c.n > 0 ? `v${c.n}` : 'the note'}</button>
|
|
@@ -75,7 +76,7 @@ export const CellFrame = observer(({ rv, card, c }: { rv: ReviewSt; card: Thread
|
|
|
75
76
|
</header>
|
|
76
77
|
{open ? (
|
|
77
78
|
<div className="rv-cbody">
|
|
78
|
-
{c.kind === 'version' ? <VersionBody rv={rv} card={card} c={c} /> : c.kind === 'verdict' ? <VerdictBody card={card} c={c} /> : c.kind === 'reply' ? <ReplyBody rv={rv} c={c} /> : <NoteBody rv={rv} c={c} />}
|
|
79
|
+
{c.kind === 'version' ? <VersionBody rv={rv} card={card} c={c} /> : c.kind === 'verdict' ? <VerdictBody card={card} c={c} /> : c.kind === 'reply' ? <ReplyBody rv={rv} card={card} c={c} /> : <NoteBody rv={rv} c={c} />}
|
|
79
80
|
</div>
|
|
80
81
|
) : (
|
|
81
82
|
<div className="rv-csum" onClick={() => card.toggleCell(c)}>{c.summary || '·'}</div>
|
|
@@ -204,15 +205,53 @@ const TrailerVerdictRows = observer(({ card, c, item }: { card: ThreadSt; c: Ver
|
|
|
204
205
|
</div>
|
|
205
206
|
))
|
|
206
207
|
|
|
207
|
-
/** words of either party, and an image he pasted */
|
|
208
|
-
const ReplyBody = ({ rv, c }: { rv: ReviewSt; c: ReplyCell }) =>
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
)
|
|
208
|
+
/** words of either party, and an image he pasted; an agent's update draws its view here, at its time, and takes his hint */
|
|
209
|
+
const ReplyBody = observer(({ rv, card, c }: { rv: ReviewSt; card: ThreadSt; c: ReplyCell }) => {
|
|
210
|
+
const version = c.update?.view !== undefined ? card.versionOf(c.on) : null
|
|
211
|
+
const view = c.update?.view !== undefined ? version?.item.views[c.update.view] : undefined
|
|
212
|
+
return (
|
|
213
|
+
<>
|
|
214
|
+
{c.re ? (
|
|
215
|
+
<button className="rv-on ghost" onMouseDown={keepFocus} onClick={() => card.reveal(c.re!.id)}>↑ on update {c.re.k} · {UPDATE_WORDS[c.re.state]}</button>
|
|
216
|
+
) : null}
|
|
217
|
+
<div className="rv-pre rv-words">{c.text}</div>
|
|
218
|
+
{c.image ? (
|
|
219
|
+
<a href={rv.threadImageUrl(c.on, c.image)} target="_blank" rel="noreferrer"><img className="rv-msgimg" src={rv.threadImageUrl(c.on, c.image)} alt="" loading="lazy" /></a>
|
|
220
|
+
) : null}
|
|
221
|
+
{version && view && c.update?.view !== undefined ? (
|
|
222
|
+
<ViewCell
|
|
223
|
+
ver={{ rv, card, cell: version, live: version.id === card.head?.id && card.takesVerdict, claim: version.id === card.newest?.id && card.claims }}
|
|
224
|
+
v={view}
|
|
225
|
+
i={c.update.view}
|
|
226
|
+
noted={false}
|
|
227
|
+
/>
|
|
228
|
+
) : null}
|
|
229
|
+
{c.update && c.party === 'agent' ? <HintBox card={card} c={c} /> : null}
|
|
230
|
+
</>
|
|
231
|
+
)
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
/** his few words on one update: a hint the agent reads, the card left as it is */
|
|
235
|
+
const HintBox = observer(({ card, c }: { card: ThreadSt; c: ReplyCell }) => {
|
|
236
|
+
const text = card.hints[c.id] ?? ''
|
|
237
|
+
return (
|
|
238
|
+
<div className="rv-hint">
|
|
239
|
+
<input
|
|
240
|
+
type="text"
|
|
241
|
+
placeholder="a hint on this update (Enter sends it, the card stays as it is)"
|
|
242
|
+
value={text}
|
|
243
|
+
onChange={(e) => card.setHint(c.id, e.target.value)}
|
|
244
|
+
onKeyDown={(e) => {
|
|
245
|
+
if (e.key === 'Enter') {
|
|
246
|
+
e.preventDefault()
|
|
247
|
+
void card.sendHint(c)
|
|
248
|
+
}
|
|
249
|
+
}}
|
|
250
|
+
/>
|
|
251
|
+
<button disabled={!text.trim() || card.busy} onMouseDown={keepFocus} onClick={() => void card.sendHint(c)}>hint</button>
|
|
252
|
+
</div>
|
|
253
|
+
)
|
|
254
|
+
})
|
|
216
255
|
|
|
217
256
|
/** what he or a player raised, or his mark: the words, the still with his rectangles on it */
|
|
218
257
|
const NoteBody = ({ rv, c }: { rv: ReviewSt; c: NoteCell }) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { observer } from 'mobx-react-lite'
|
|
4
4
|
import { useEffect, useRef } from 'react'
|
|
5
5
|
import type { ThreadRow } from '../../../review/cells.ts'
|
|
6
|
-
import { MOVE_LABEL, STATUS_LABEL, subjectLabel, type Move, type ShownStatus } from '../../../review/model.ts'
|
|
6
|
+
import { MOVE_LABEL, STATUS_LABEL, subjectLabel, UPDATE_WORDS, type Move, type ShownStatus } from '../../../review/model.ts'
|
|
7
7
|
import { AutoTag, LaneTag, laneColor, Listeners, Rework, ThumbOf, toneOf } from './kit.tsx'
|
|
8
8
|
import { ReviewBoard } from './review-board.tsx'
|
|
9
9
|
import type { ReviewSt } from './review-st.ts'
|
|
@@ -114,6 +114,11 @@ const Row = observer(({ rv, r, on }: { rv: ReviewSt; r: ThreadRow; on: boolean }
|
|
|
114
114
|
{r.rule ? <AutoTag rule={r.rule} /> : null}
|
|
115
115
|
<span className="rv-about">{ABOUT(r, rv)}</span>
|
|
116
116
|
</div>
|
|
117
|
+
{r.update ? (
|
|
118
|
+
<div className={`rv-rowupdate up-${r.update.state}`} title={r.update.text}>
|
|
119
|
+
<b>{UPDATE_WORDS[r.update.state]}</b> {r.update.text}
|
|
120
|
+
</div>
|
|
121
|
+
) : null}
|
|
117
122
|
<Rework r={r.rework} />
|
|
118
123
|
</div>
|
|
119
124
|
</div>
|
|
@@ -338,10 +338,10 @@ export class ReviewSt {
|
|
|
338
338
|
return `${f ? `${f}&` : ''}limit=${this.shown}`
|
|
339
339
|
}
|
|
340
340
|
|
|
341
|
-
/** the verdict he just gave, by thread head: its row shows it at once, while the store takes it */
|
|
342
|
-
answering: Record<string, ReviewStatus> = {}
|
|
341
|
+
/** the verdict he just gave or took back (`pending`), by thread head: its row shows it at once, while the store takes it */
|
|
342
|
+
answering: Record<string, ReviewStatus | 'pending'> = {}
|
|
343
343
|
|
|
344
|
-
setAnswering(head: string, status: ReviewStatus | null): void {
|
|
344
|
+
setAnswering(head: string, status: ReviewStatus | 'pending' | null): void {
|
|
345
345
|
if (status === null) delete this.answering[head]
|
|
346
346
|
else this.answering[head] = status
|
|
347
347
|
}
|
|
@@ -599,9 +599,10 @@ export class ReviewSt {
|
|
|
599
599
|
return `${this.st.url(`/api/review/${id}/${name}`)}${wip ? `?f=${wip.frame}` : ''}`
|
|
600
600
|
}
|
|
601
601
|
|
|
602
|
-
/** an image at the size the card column draws it (1600 px webp)
|
|
602
|
+
/** an image at the size the card column draws it (1600 px webp), a clip as it plays (its play copy when it is over
|
|
603
|
+
* the line); any other file is the file itself */
|
|
603
604
|
fitUrl(id: string, name: string, wip?: { frame: number }): string {
|
|
604
|
-
return /\.(png|jpe?g|webp)$/i.test(name) ? `${this.st.url(`/api/review/${id}/preview/fit/${name}`)}${wip ? `?f=${wip.frame}` : ''}` : this.fileUrl(id, name, wip)
|
|
605
|
+
return /\.(png|jpe?g|webp|mp4|webm|mov|m4v)$/i.test(name) ? `${this.st.url(`/api/review/${id}/preview/fit/${name}`)}${wip ? `?f=${wip.frame}` : ''}` : this.fileUrl(id, name, wip)
|
|
605
606
|
}
|
|
606
607
|
|
|
607
608
|
/** an image at the list's size (480 px webp) */
|
|
@@ -317,8 +317,10 @@ const Composer = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
|
|
|
317
317
|
<div className="rv-acts">
|
|
318
318
|
{verdicts
|
|
319
319
|
? VERDICTS.map((x) => (
|
|
320
|
-
<button key={x.status} className={`rv-verdict ${toneOf(x.status)}${sent === x.status ? ' chosen' : ''}`} disabled={card.busy} onClick={() => void card.submit(x.status)}
|
|
320
|
+
<button key={x.status} className={`rv-verdict ${toneOf(x.status)}${sent === x.status ? ' chosen' : ''}`} disabled={card.busy} onClick={() => void card.submit(x.status)}
|
|
321
|
+
title={sent === x.status ? `${x.label}: your answer now. Click again (${x.key}) to take it back, the card waits for you again` : `${x.label} (${x.key})`}>
|
|
321
322
|
{rv.phone.on ? x.short : <><span className="rv-vglyph">{x.glyph}</span> {x.short} ({x.key})</>}
|
|
323
|
+
{sent === x.status ? <span className="rv-undo" aria-label="click again to take it back"> ↺</span> : null}
|
|
322
324
|
</button>
|
|
323
325
|
))
|
|
324
326
|
: null}
|
|
@@ -48,6 +48,8 @@ export const VersionViews = observer(({ ver }: { ver: Ver }) => {
|
|
|
48
48
|
const drawable = takes(ver) && views.some((v) => isGallery(v) || (!v.clip && !v.audio))
|
|
49
49
|
// a draft card's history is no view of its own: its frames cycle in place over the live one
|
|
50
50
|
const history = item.wip ? views.find(isGallery) : undefined
|
|
51
|
+
// a view an agent's update holds draws in that update's cell, at its time in the thread
|
|
52
|
+
const owned = new Set(card.updateViewsOf(item.id))
|
|
51
53
|
const options = rows || (card.full[item.id] === true)
|
|
52
54
|
return (
|
|
53
55
|
<div className="rv-views">
|
|
@@ -73,16 +75,16 @@ export const VersionViews = observer(({ ver }: { ver: Ver }) => {
|
|
|
73
75
|
) : null}
|
|
74
76
|
</div>
|
|
75
77
|
{rows ? (
|
|
76
|
-
<div className="rv-opts">{views.map((v, i) => <OptionRow key={i} ver={ver} v={v} i={i} />)}</div>
|
|
78
|
+
<div className="rv-opts">{views.map((v, i) => (owned.has(i) ? null : <OptionRow key={i} ver={ver} v={v} i={i} />))}</div>
|
|
77
79
|
) : (
|
|
78
|
-
views.map((v, i) => (v === history ? null : <ViewCell key={i} ver={ver} v={v} i={i} {...(i === 0 && history && isGallery(history) ? { frames: history } : {})} />))
|
|
80
|
+
views.map((v, i) => (v === history || owned.has(i) ? null : <ViewCell key={i} ver={ver} v={v} i={i} {...(i === 0 && history && isGallery(history) ? { frames: history } : {})} />))
|
|
79
81
|
)}
|
|
80
82
|
</div>
|
|
81
83
|
)
|
|
82
84
|
})
|
|
83
85
|
|
|
84
86
|
/** one view as a sub cell: its number and title, its kind, the owner's reaction, its tools, what was said on it and his word, then the view */
|
|
85
|
-
const ViewCell = observer(({ ver, v: live, i, frames }: { ver: Ver; v: ReviewView; i: number; frames?: GalleryView }) => {
|
|
87
|
+
export const ViewCell = observer(({ ver, v: live, i, frames, noted = true }: { ver: Ver; v: ReviewView; i: number; frames?: GalleryView; noted?: boolean }) => {
|
|
86
88
|
const { rv, card, cell } = ver
|
|
87
89
|
const past = frames && card.frame !== null ? frames.gallery[card.frame] : undefined
|
|
88
90
|
const v: ReviewView = past && !isGallery(live) ? { ...live, files: { image: past.file }, size: past.size } : live
|
|
@@ -110,7 +112,7 @@ const ViewCell = observer(({ ver, v: live, i, frames }: { ver: Ver; v: ReviewVie
|
|
|
110
112
|
<div className="rv-viewbody">
|
|
111
113
|
{frames ? <FrameSlider card={card} frames={frames} /> : null}
|
|
112
114
|
{gone.length > 0 ? <Gone files={gone} /> : isGallery(v) ? <Gallery ver={ver} v={v} view={i} /> : <MediaBody ver={ver} v={v} i={i} zoom={zoom} />}
|
|
113
|
-
{media?.note ? <div className="rv-viewnote">{media.note}</div> : null}
|
|
115
|
+
{noted && media?.note ? <div className="rv-viewnote">{media.note}</div> : null}
|
|
114
116
|
</div>
|
|
115
117
|
) : null}
|
|
116
118
|
</section>
|
|
@@ -216,6 +218,7 @@ const OptionRow = observer(({ ver, v, i }: { ver: Ver; v: ReviewView; i: number
|
|
|
216
218
|
const reaction = card.reactionShown(cell, i)
|
|
217
219
|
const choice = isChoice(item)
|
|
218
220
|
const picked = card.pickShown(cell) === i
|
|
221
|
+
const held = takes(ver) && card.holdsPick(id, i)
|
|
219
222
|
const unfolded = card.rowOpen(item, i)
|
|
220
223
|
const file = playable ? ('video' in playable.files ? playable.files.video : 'audio' in playable.files ? playable.files.audio : '') : ''
|
|
221
224
|
const duration = playable?.clip?.duration ?? playable?.audio?.duration ?? 0
|
|
@@ -237,7 +240,7 @@ const OptionRow = observer(({ ver, v, i }: { ver: Ver; v: ReviewView; i: number
|
|
|
237
240
|
{choice && item.agentPick === i ? <span className="rv-mypick" title="the option the agent suggests; your pick is your own">my pick</span> : null}
|
|
238
241
|
{c && playable?.clip && !unfolded ? (
|
|
239
242
|
<span className="rv-optthumb" style={{ aspectRatio: `${playable.size.w} / ${playable.size.h}` }} onClick={() => card.toggleRow(item, i)} title="the full view">
|
|
240
|
-
<ClipVideo clip={c} src={rv.
|
|
243
|
+
<ClipVideo clip={c} src={rv.fitUrl(id, file, item.wip)} poster={rv.thumbUrl(id, playable.clip.poster)} loop={false} />
|
|
241
244
|
</span>
|
|
242
245
|
) : null}
|
|
243
246
|
{c && playable && clock2 ? (
|
|
@@ -254,8 +257,9 @@ const OptionRow = observer(({ ver, v, i }: { ver: Ver; v: ReviewView; i: number
|
|
|
254
257
|
) : null}
|
|
255
258
|
{playable?.audio ? <a className="rv-dl" href={rv.fileUrl(id, file)} download={`${id}-${file}`} title="download the sound">⤓</a> : null}
|
|
256
259
|
{choice && takes(ver) ? (
|
|
257
|
-
<button className={`rv-pick${picked ? ' on' : ''}`} title=
|
|
260
|
+
<button className={`rv-pick${picked ? ' on' : ''}`} title={held ? 'your pick: click again to take it back, the card waits for you again' : 'pick this one: it is your answer (P)'} disabled={card.busy} onClick={() => mark(ver, () => void card.choose(i))}>
|
|
258
261
|
{picked ? '✓ picked' : 'pick'}
|
|
262
|
+
{held ? <span className="rv-undo" aria-label="click again to take it back"> ↺</span> : null}
|
|
259
263
|
</button>
|
|
260
264
|
) : choice && picked ? <span className="rv-pick on">✓ picked</span> : null}
|
|
261
265
|
</span>
|
|
@@ -561,7 +565,8 @@ const MediaBody = observer(({ ver, v, i, zoom }: { ver: Ver; v: MediaView; i: nu
|
|
|
561
565
|
const aspect = `${v.size.w} / ${v.size.h}`
|
|
562
566
|
const scale = zoom === 'fit' ? null : Number(zoom)
|
|
563
567
|
const room = FIT_ROOM + (v.clip ? 40 : 0)
|
|
564
|
-
|
|
568
|
+
// a clip always plays its fit url (its play copy keeps its size and frames), an image is the full file past « fit »
|
|
569
|
+
const src = (name: string): string => (scale && !v.clip ? rv.fileUrl(id, name, item.wip) : rv.fitUrl(id, name, item.wip))
|
|
565
570
|
const bar = v.clip ? <ClipBar clip={card.clipOf(id, i)} info={v.clip} use={() => ver.live && card.setView(i)} /> : null
|
|
566
571
|
const scroll = scale ? { overflow: 'auto', maxHeight: `calc(100vh - ${room}px)` } : undefined
|
|
567
572
|
if (!isPair(f)) {
|
|
@@ -835,7 +840,7 @@ const Frame = ({ aspect, caption, modCap, swipe, onPeek, over, children }: { asp
|
|
|
835
840
|
const frame = useRef<HTMLDivElement>(null)
|
|
836
841
|
const down = (e: React.PointerEvent): void => {
|
|
837
842
|
const el = frame.current
|
|
838
|
-
if (!swipe || !el) return
|
|
843
|
+
if (!swipe || !el || !e.isPrimary) return
|
|
839
844
|
e.preventDefault()
|
|
840
845
|
const at = (x: number): void => {
|
|
841
846
|
const r = el.getBoundingClientRect()
|
|
@@ -882,11 +887,13 @@ export function dragBox(e: { clientX: number; clientY: number }, el: Element, sh
|
|
|
882
887
|
cur = { ...cur, x1: b.x, y1: b.y }
|
|
883
888
|
show(cur)
|
|
884
889
|
}
|
|
885
|
-
const up = (): void => {
|
|
890
|
+
const up = (ev: PointerEvent): void => {
|
|
886
891
|
window.removeEventListener('pointermove', move)
|
|
887
892
|
window.removeEventListener('pointerup', up)
|
|
888
893
|
window.removeEventListener('pointercancel', up)
|
|
889
894
|
show(null)
|
|
895
|
+
// a second finger hands the gesture to the browser's pinch, which cancels this one: no rectangle, no tap
|
|
896
|
+
if (ev.type === 'pointercancel') return
|
|
890
897
|
const r = box(cur)
|
|
891
898
|
end(r.w > MIN_DRAG && r.h > MIN_DRAG ? r : null)
|
|
892
899
|
}
|
|
@@ -930,7 +937,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
|
|
|
930
937
|
const drawing = takes(ver) && (phone.on ? phone.draw && (free || phone.pair !== 'swipe' || rv.compare.mode !== 'swipe') : free || rv.compare.mode !== 'swipe')
|
|
931
938
|
const c = clock?.c ?? null
|
|
932
939
|
const down = (e: React.PointerEvent): void => {
|
|
933
|
-
if (e.button !== 0) return
|
|
940
|
+
if (e.button !== 0 || !e.isPrimary) return
|
|
934
941
|
if (clock && ver.live && !active) {
|
|
935
942
|
e.preventDefault()
|
|
936
943
|
card.setView(view)
|
|
@@ -955,7 +962,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
|
|
|
955
962
|
const rings = rv.marksOn ? (shown?.marks ?? []).filter((m) => m.side === side) : []
|
|
956
963
|
const live = drawing || (clock !== null && ver.live && !active)
|
|
957
964
|
return (
|
|
958
|
-
<div ref={el} className={`rv-marks${clock && ver.live && !active ? ' pick' : drawing ? ' draw' : ''}`} onPointerDown={down} style={{ pointerEvents: live ? 'auto' : 'none', touchAction: drawing ? '
|
|
965
|
+
<div ref={el} className={`rv-marks${clock && ver.live && !active ? ' pick' : drawing ? ' draw' : ''}`} onPointerDown={down} style={{ pointerEvents: live ? 'auto' : 'none', touchAction: drawing ? 'pinch-zoom' : undefined }}>
|
|
959
966
|
{face ?? (c ? <ClipVideo key={src} clip={c} src={src} poster={shown?.clip ? rv.fitUrl(cell.id, shown.clip.poster) : undefined} preload={ver.live ? 'auto' : 'none'} /> : <img src={src} alt="" draggable={false} className="rv-markimg" loading="lazy" decoding="async" />)}
|
|
960
967
|
{shown && rings.length > 0 ? <Rings marks={rings} w={shown.size.w} h={shown.size.h} /> : null}
|
|
961
968
|
{notes
|