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.
Files changed (32) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/package.json +1 -1
  3. package/src/checks/SK005-rvlib-versions.check.ts +17 -11
  4. package/src/cli/cmd_Fleet.ts +8 -5
  5. package/src/cli/cmd_Review.ts +2 -1
  6. package/src/core/update-policy.ts +6 -0
  7. package/src/fleet/commit-bump.ts +123 -0
  8. package/src/fleet/push-fleet.ts +9 -3
  9. package/src/fleet/update-fleet.ts +38 -9
  10. package/src/review/cells.ts +548 -0
  11. package/src/review/format.ts +1 -1
  12. package/src/review/model.ts +29 -4
  13. package/src/review/previews.ts +124 -0
  14. package/src/review/routes.ts +82 -45
  15. package/src/review/store.ts +6 -5
  16. package/src/serve/hub-app/auto-text.tsx +52 -0
  17. package/src/serve/hub-app/hub.css +2 -0
  18. package/src/serve/hub-app/media-view.tsx +3 -11
  19. package/src/serve/hub-app/review/kind-view.tsx +21 -22
  20. package/src/serve/hub-app/review/kit.tsx +11 -12
  21. package/src/serve/hub-app/review/review-board.tsx +15 -13
  22. package/src/serve/hub-app/review/review-cells.tsx +241 -0
  23. package/src/serve/hub-app/review/review-kit.ts +79 -0
  24. package/src/serve/hub-app/review/review-list.tsx +87 -122
  25. package/src/serve/hub-app/review/review-page.tsx +25 -66
  26. package/src/serve/hub-app/review/review-st.ts +269 -668
  27. package/src/serve/hub-app/review/review-thread.tsx +301 -0
  28. package/src/serve/hub-app/review/review-views.tsx +372 -234
  29. package/src/serve/hub-app/review/thread-st.ts +770 -0
  30. package/src/serve/hub-app/review/trailer-page.tsx +5 -4
  31. package/src/serve/hub-app/review.css +252 -90
  32. package/src/serve/hub-app/review/review-answer.tsx +0 -248
@@ -1,98 +1,57 @@
1
1
  // a repo's review page (`#page:review`, wiki build/shipkit/review.md, The review page): the cards on the left, the open
2
- // one in the middle with every view stacked, the answer on the right; `top` (or `auto` narrower than STACK_PX) reads in
3
- // one column from the top: the header and the verdicts, the views, the answer. On a phone one pane at a time, the verdicts in a bar under the thumb. The list is read while the page
4
- // shows
2
+ // one as a chat on the right (review-thread.tsx). On a phone one pane at a time: the cards, or the card with its answer
3
+ // box and the verdicts under the thumb. Everything is read while the page shows
5
4
  import { observer } from 'mobx-react-lite'
6
- import { useEffect, useRef } from 'react'
5
+ import { useEffect } from 'react'
7
6
  import { Group, Panel, Separator } from 'react-resizable-panels'
8
7
  import type { RepoSt } from '../repo-st.ts'
9
- import { ReviewForm, VerdictBar } from './review-answer.tsx'
10
8
  import { ReviewList } from './review-list.tsx'
11
- import type { PhonePane, ReviewSt } from './review-st.ts'
12
- import { ReviewImage } from './review-views.tsx'
13
-
14
- const PANE_LABEL: Record<PhonePane, string> = { list: 'cards', card: 'card', answer: 'answer' }
9
+ import type { ReviewSt } from './review-st.ts'
10
+ import { ThreadColumn } from './review-thread.tsx'
15
11
 
16
12
  export const ReviewPage = observer(({ app }: { app: RepoSt }) => {
17
13
  const rv = app.review
18
- const el = useRef<HTMLDivElement | null>(null)
19
14
  useEffect(() => {
20
15
  rv.start()
21
16
  return () => rv.stop()
22
17
  }, [rv])
23
- useEffect(() => {
24
- const node = el.current
25
- if (node == null || typeof ResizeObserver === 'undefined') return
26
- // the pick lands on the next frame: a relayout inside the callback is the observer's loop error
27
- let raf = 0
28
- const ro = new ResizeObserver(([e]) => {
29
- const w = e!.contentRect.width
30
- cancelAnimationFrame(raf)
31
- raf = requestAnimationFrame(() => rv.fit(w))
32
- })
33
- ro.observe(node)
34
- return () => {
35
- cancelAnimationFrame(raf)
36
- ro.disconnect()
37
- }
38
- }, [rv, rv.phone.on])
39
18
  if (rv.phone.on)
40
19
  return (
41
20
  <div className="rv-phone">
42
- <PhoneTop app={app} />
43
- <div className="rv-phonetabs seg">
44
- {(['list', 'card', 'answer'] as const).map((p) => (
45
- <button key={p} className={rv.phone.pane === p ? 'on' : ''} onClick={() => rv.phone.show(p)}>
46
- {PANE_LABEL[p]}{p === 'list' && rv.pendingCount > 0 ? ` · ${rv.pendingCount}` : ''}
47
- </button>
48
- ))}
49
- </div>
50
- <div className="rv-phonepane">
51
- {rv.phone.pane === 'list' ? <ReviewList rv={rv} /> : rv.phone.pane === 'card' ? <ReviewImage rv={rv} /> : <ReviewForm rv={rv} />}
52
- </div>
53
- {rv.phone.pane === 'list' ? null : <VerdictBar rv={rv} />}
21
+ {rv.phone.pane === 'list' ? (
22
+ <>
23
+ <PhoneTop app={app} />
24
+ <div className="rv-phonepane"><ReviewList rv={rv} /></div>
25
+ </>
26
+ ) : (
27
+ <ThreadColumn rv={rv} />
28
+ )}
54
29
  <Toast rv={rv} />
55
30
  </div>
56
31
  )
57
32
  return (
58
33
  <>
59
- <Toast rv={rv} />
60
- <Group className="rv-cols" orientation="horizontal" elementRef={el}>
61
- <Panel id="review-list" defaultSize={rv.stacked ? '32%' : '20%'} minSize={160} className="rv-pane" style={PANEL}>
62
- <ReviewList rv={rv} />
63
- </Panel>
64
- <Separator className="rsep" />
65
- {rv.stacked ? (
66
- // one column read from the top: the header and the verdicts, the views, then the answer
67
- <Panel id="review-stack" defaultSize="68%" minSize={300} className="rv-pane" style={PANEL}>
68
- <div className="rv-scroll">
69
- <ReviewImage rv={rv} />
70
- <ReviewForm rv={rv} />
71
- </div>
34
+ <Toast rv={rv} />
35
+ <Group className="rv-cols" orientation="horizontal">
36
+ <Panel id="review-list" defaultSize="24%" minSize={180} className="rv-pane" style={PANEL}>
37
+ <ReviewList rv={rv} />
38
+ </Panel>
39
+ <Separator className="rsep" />
40
+ <Panel id="review-thread" defaultSize="76%" minSize={360} className="rv-pane" style={PANEL}>
41
+ <ThreadColumn rv={rv} />
72
42
  </Panel>
73
- ) : (
74
- <>
75
- <Panel id="review-image" defaultSize="54%" minSize={300} className="rv-pane" style={PANEL}>
76
- <div className="rv-scroll"><ReviewImage rv={rv} /></div>
77
- </Panel>
78
- <Separator className="rsep" />
79
- <Panel id="review-form" defaultSize="26%" minSize={260} className="rv-pane" style={PANEL}>
80
- <div className="rv-scroll"><ReviewForm rv={rv} /></div>
81
- </Panel>
82
- </>
83
- )}
84
- </Group>
43
+ </Group>
85
44
  </>
86
45
  )
87
46
  })
88
47
 
89
- /** the phone's top line: the way back to the hub (none in another tool's frame), and the repo the page is of. On a phone the page covers the hub's
90
- * panes, which leave it no room */
48
+ /** the phone's top line over the cards: the way back to the hub (none in another tool's frame), the repo, the count
49
+ * that waits on him. On a phone the page covers the hub's panes, which leave it no room */
91
50
  export const PhoneTop = observer(({ app }: { app: RepoSt }) => (
92
51
  <div className="rv-phonetop">
93
52
  {app.home.embedded ? null : <button className="ghost" onClick={() => app.showReadme()}>◂ hub</button>}
94
53
  <b>{app.name}</b>
95
- <span className="rv-dim">{app.sel?.t === 'trailer' ? 'trailer' : 'review'}</span>
54
+ <span className="rv-dim">{app.sel?.t === 'trailer' ? 'trailer' : `review${app.review.pendingCount > 0 ? ` · ${app.review.pendingCount} waiting` : ''}`}</span>
96
55
  </div>
97
56
  ))
98
57