rvlib-shipkit 2.17.0 → 2.18.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 +22 -0
- package/package.json +1 -1
- package/src/checks/SK039-vscode-watch-generated.check.ts +119 -0
- package/src/cli/cmd_Review.ts +4 -0
- package/src/core/discover-checks.ts +18 -5
- package/src/home/beat.ts +30 -0
- package/src/home/home-paths.ts +1 -0
- package/src/home/pm.ts +3 -1
- package/src/home/run-daemon.ts +5 -2
- package/src/home/run-web.ts +4 -2
- package/src/home/supervise.ts +18 -1
- package/src/review/model.ts +11 -0
- package/src/scaffold/files/vscode-settings.json +9 -1
- package/src/serve/hub-app/auto-text.tsx +6 -1
- package/src/serve/hub-app/hub-app.tsx +28 -2
- package/src/serve/hub-app/icons.tsx +1 -0
- package/src/serve/hub-app/identities-view.tsx +1 -1
- package/src/serve/hub-app/kept-cols.tsx +47 -8
- package/src/serve/hub-app/layout-st.ts +37 -3
- package/src/serve/hub-app/review/review-kit.ts +8 -0
- package/src/serve/hub-app/review/review-page.tsx +1 -1
- package/src/serve/hub-app/review/review-st.ts +38 -6
- package/src/serve/hub-app/review/review-thread.tsx +2 -1
- package/src/serve/hub-app/review/review-views.tsx +91 -20
- package/src/serve/hub-app/review/thread-st.ts +23 -1
- package/src/serve/hub-app/review/trailer-page.tsx +1 -1
- package/src/serve/hub-app/review.css +24 -0
- package/src/serve/hub-app/social/comms-page.tsx +1 -1
- package/src/serve/hub-app/social/kit.tsx +3 -3
- package/src/serve/hub-app/social/post-card.tsx +2 -1
- package/src/serve/hub-app/social/social-page.tsx +1 -1
- package/src/serve/hub-app/social.css +1 -1
- package/src/serve/hub-app/stores/stores-page.tsx +5 -4
- package/src/serve/hub-app/veille/veille-page.tsx +3 -2
- package/src/serve/serve-hub.ts +4 -4
- package/src/serve/warm-cell.ts +63 -1
- package/src/shot/box.ts +32 -9
- package/src/shot/browser-slot.ts +8 -1
- package/src/shot/client.ts +9 -4
- package/src/shot/clip-encoder.ts +5 -2
- package/src/shot/job-store.ts +167 -0
- package/src/shot/shooter.ts +31 -4
- package/src/social/load.ts +3 -1
- package/src/suite/select.ts +32 -6
- package/src/trailer/grammar.ts +2 -0
- package/src/trailer/graph.ts +9 -3
- package/src/trailer/sound/presets.ts +3 -3
- package/src/trailer/sound/run.ts +22 -14
- package/src/trailer/titles.ts +1 -1
- package/src/wiki/lint-md.ts +4 -2
- package/src/wiki/run-wiki.ts +11 -5
- package/src/wiki/scan-md.ts +3 -1
|
@@ -23,6 +23,21 @@ const RAIL_PAD = 6
|
|
|
23
23
|
/** the project list folded: its icons only, a row's name in its hover card */
|
|
24
24
|
export const railPx = (size: RailIcon): number => RAIL_ICONS[size] + 2 * RAIL_PAD
|
|
25
25
|
const RAIL_KEY = 'hub:list-rail'
|
|
26
|
+
/** what each page with columns has folded, by page: W the left (the repo's sidebar and the page's list), T the right
|
|
27
|
+
* panel (kept-cols.tsx) */
|
|
28
|
+
const FOLDS_KEY = 'hub:folds'
|
|
29
|
+
export type FoldSide = 'left' | 'right'
|
|
30
|
+
/** the repo pages whose columns fold (their `sel.t`): W there folds the repo's sidebar too */
|
|
31
|
+
export const FOLD_PAGES: ReadonlySet<string> = new Set(['review', 'trailer', 'stores', 'veille', 'comms', 'social'])
|
|
32
|
+
type Folds = Record<string, Partial<Record<FoldSide, true>>>
|
|
33
|
+
function loadFolds(): Folds {
|
|
34
|
+
try {
|
|
35
|
+
const v = JSON.parse(globalThis.localStorage?.getItem(FOLDS_KEY) ?? '{}') as unknown
|
|
36
|
+
return v != null && typeof v === 'object' && !Array.isArray(v) ? (v as Folds) : {}
|
|
37
|
+
} catch {
|
|
38
|
+
return {}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
26
41
|
const RAIL_ICON_KEY = 'hub:rail-icon'
|
|
27
42
|
|
|
28
43
|
function loadRailIcon(): RailIcon {
|
|
@@ -54,9 +69,9 @@ function saveWidth(b: Bounds, px: number): void {
|
|
|
54
69
|
} catch { /* private window or blocked site data: the width lasts the tab */ }
|
|
55
70
|
}
|
|
56
71
|
|
|
57
|
-
function
|
|
72
|
+
function loadFlag(key: string): boolean {
|
|
58
73
|
try {
|
|
59
|
-
return globalThis.localStorage?.getItem(
|
|
74
|
+
return globalThis.localStorage?.getItem(key) === '1'
|
|
60
75
|
} catch {
|
|
61
76
|
return false
|
|
62
77
|
}
|
|
@@ -68,12 +83,14 @@ export const NARROW_PX = 768
|
|
|
68
83
|
export class LayoutSt {
|
|
69
84
|
listWidth = loadWidth(LIST)
|
|
70
85
|
/** the owner's pick: the list shows its icons only */
|
|
71
|
-
listRail =
|
|
86
|
+
listRail = loadFlag(RAIL_KEY)
|
|
72
87
|
/** the page is narrower than NARROW_PX, read live */
|
|
73
88
|
narrow = false
|
|
74
89
|
/** the rail's icon size */
|
|
75
90
|
railIcon: RailIcon = loadRailIcon()
|
|
76
91
|
sidebarWidth = loadWidth(SIDEBAR)
|
|
92
|
+
/** each page's folded sides, kept per browser */
|
|
93
|
+
folds: Folds = loadFolds()
|
|
77
94
|
|
|
78
95
|
constructor() {
|
|
79
96
|
makeAutoObservable(this)
|
|
@@ -123,6 +140,23 @@ export class LayoutSt {
|
|
|
123
140
|
this.setRail(!this.listRail)
|
|
124
141
|
}
|
|
125
142
|
|
|
143
|
+
/** whether a page has folded that side */
|
|
144
|
+
foldedOn(page: string | undefined, side: FoldSide): boolean {
|
|
145
|
+
// a narrow page draws its own one pane layout: a fold there would hide a side with no bar to bring it back
|
|
146
|
+
return page != null && !this.narrow && this.folds[page]?.[side] === true
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** W (the left) or T (the right) on a page with columns, and the bar that stands where a folded side was */
|
|
150
|
+
toggleFold(page: string, side: FoldSide): void {
|
|
151
|
+
const cur = { ...this.folds[page] }
|
|
152
|
+
if (cur[side]) delete cur[side]
|
|
153
|
+
else cur[side] = true
|
|
154
|
+
this.folds = { ...this.folds, [page]: cur }
|
|
155
|
+
try {
|
|
156
|
+
globalThis.localStorage?.setItem(FOLDS_KEY, JSON.stringify(this.folds))
|
|
157
|
+
} catch { /* private window or blocked site data: the folds last the tab */ }
|
|
158
|
+
}
|
|
159
|
+
|
|
126
160
|
/** a drag of the sidebar's separator ended at this width */
|
|
127
161
|
setSidebarWidth(px: number): void {
|
|
128
162
|
this.sidebarWidth = clampWidth(Math.round(px), SIDEBAR)
|
|
@@ -6,6 +6,14 @@ import { reach } from '../reach.ts'
|
|
|
6
6
|
export const ZOOMS = ['fit', '1', '1.5', '2'] as const
|
|
7
7
|
export type Zoom = (typeof ZOOMS)[number]
|
|
8
8
|
|
|
9
|
+
/** how a gallery draws: a side list of its images with the picked one large, one image a row at full width, or the
|
|
10
|
+
* wrapping grid of tiles at the slider's height */
|
|
11
|
+
export const GALLERY_MODES = ['tabs', 'list', 'grid'] as const
|
|
12
|
+
export type GalleryMode = (typeof GALLERY_MODES)[number]
|
|
13
|
+
/** a large gallery image fills the column's width (it scrolls), or fits the screen whole */
|
|
14
|
+
export const GALLERY_FITS = ['width', 'screen'] as const
|
|
15
|
+
export type GalleryFit = (typeof GALLERY_FITS)[number]
|
|
16
|
+
|
|
9
17
|
/** a gallery tile's image height in px: his slider's range and its start; past THUMB a tile reads the fit preview, the
|
|
10
18
|
* list thumb is too small for it */
|
|
11
19
|
export const TILE_H = { min: 80, max: 480, start: 170, thumb: 220 } as const
|
|
@@ -33,7 +33,7 @@ export const ReviewPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
33
33
|
return (
|
|
34
34
|
<>
|
|
35
35
|
<Toast rv={rv} />
|
|
36
|
-
<KeptCols id="review">
|
|
36
|
+
<KeptCols id="review" folds={{ left: 'review-list' }} layout={app.home.layout}>
|
|
37
37
|
<Panel id="review-list" defaultSize="24%" minSize={180} className="rv-pane" style={PANEL}>
|
|
38
38
|
<ReviewList rv={rv} />
|
|
39
39
|
</Panel>
|
|
@@ -4,11 +4,11 @@
|
|
|
4
4
|
// 304 when the store did not move. His drafts are kept in the browser until they are sent
|
|
5
5
|
import { makeAutoObservable, observableRef, reaction, runInAction } from 'mobx'
|
|
6
6
|
import { PAGE, type BoardRow, type ThreadPage, type ThreadRow } from '../../../review/cells.ts'
|
|
7
|
-
import { MOVE_LABEL, pasteBlock, STATUS_LABEL, type Move, type ShownStatus, type Spec } from '../../../review/model.ts'
|
|
7
|
+
import { MOVE_LABEL, pasteBlock, STATUS_LABEL, type Move, type ReviewStatus, type ShownStatus, type Spec } from '../../../review/model.ts'
|
|
8
8
|
import type { PasteHosts } from '../../../review/paste.ts'
|
|
9
9
|
import type { Role } from '../../../review/role.ts'
|
|
10
10
|
import type { RepoSt } from '../repo-st.ts'
|
|
11
|
-
import { copyText, etagLoader, kept, postJson, TILE_H, ZOOMS, type EtagLoader, type Zoom } from './review-kit.ts'
|
|
11
|
+
import { copyText, etagLoader, GALLERY_FITS, GALLERY_MODES, kept, postJson, TILE_H, ZOOMS, type EtagLoader, type GalleryFit, type GalleryMode, type Zoom } from './review-kit.ts'
|
|
12
12
|
import { ThreadSt, type Draft } from './thread-st.ts'
|
|
13
13
|
|
|
14
14
|
/** a live `sk review watch`: its process, the session or lane it keeps, when it started */
|
|
@@ -141,6 +141,9 @@ export class ReviewSt {
|
|
|
141
141
|
tileH: number = TILE_H.start
|
|
142
142
|
/** each gallery tile also drawn at 16, 32 and 64 px, the sizes an icon lives at */
|
|
143
143
|
tileSmall = false
|
|
144
|
+
/** how a gallery draws (tabs, list, grid), and how its large image fits */
|
|
145
|
+
galleryMode: GalleryMode = 'tabs'
|
|
146
|
+
galleryFit: GalleryFit = 'width'
|
|
144
147
|
/** the contents strip beside the cells, when the column is wide enough; folded by hand */
|
|
145
148
|
railOn = true
|
|
146
149
|
/** the contents as a sheet over the cells: a narrow column or the phone */
|
|
@@ -174,7 +177,7 @@ export class ReviewSt {
|
|
|
174
177
|
this.loadBoard = etagLoader(() => st.url('/api/review/board'))
|
|
175
178
|
this.compare = new CompareSt(`${this.prefix}compare`)
|
|
176
179
|
try {
|
|
177
|
-
const p = JSON.parse(kept.get(`${this.prefix}prefs`) ?? '{}') as { hideHandled?: boolean; byLane?: boolean; zoom?: string; marks?: boolean; rail?: boolean; tileH?: number; tileSmall?: boolean }
|
|
180
|
+
const p = JSON.parse(kept.get(`${this.prefix}prefs`) ?? '{}') as { hideHandled?: boolean; byLane?: boolean; zoom?: string; marks?: boolean; rail?: boolean; tileH?: number; tileSmall?: boolean; galleryMode?: string; galleryFit?: string }
|
|
178
181
|
if (p.hideHandled === false) this.hideHandled = false
|
|
179
182
|
if (p.byLane === true) this.byLane = true
|
|
180
183
|
if (p.marks === false) this.marksOn = false
|
|
@@ -182,6 +185,8 @@ export class ReviewSt {
|
|
|
182
185
|
if ((ZOOMS as readonly string[]).includes(p.zoom ?? '')) this.zoom = p.zoom as Zoom
|
|
183
186
|
if (typeof p.tileH === 'number') this.setTileH(p.tileH)
|
|
184
187
|
if (p.tileSmall === true) this.tileSmall = true
|
|
188
|
+
if ((GALLERY_MODES as readonly string[]).includes(p.galleryMode ?? '')) this.galleryMode = p.galleryMode as GalleryMode
|
|
189
|
+
if ((GALLERY_FITS as readonly string[]).includes(p.galleryFit ?? '')) this.galleryFit = p.galleryFit as GalleryFit
|
|
185
190
|
} catch {
|
|
186
191
|
// a broken pref is the default
|
|
187
192
|
}
|
|
@@ -205,7 +210,7 @@ export class ReviewSt {
|
|
|
205
210
|
boardRows: observableRef,
|
|
206
211
|
})
|
|
207
212
|
reaction(
|
|
208
|
-
() => JSON.stringify({ hideHandled: this.hideHandled, byLane: this.byLane, zoom: this.zoom, marks: this.marksOn, rail: this.railOn, tileH: this.tileH, tileSmall: this.tileSmall }),
|
|
213
|
+
() => JSON.stringify({ hideHandled: this.hideHandled, byLane: this.byLane, zoom: this.zoom, marks: this.marksOn, rail: this.railOn, tileH: this.tileH, tileSmall: this.tileSmall, galleryMode: this.galleryMode, galleryFit: this.galleryFit }),
|
|
209
214
|
(s) => kept.put(`${this.prefix}prefs`, s),
|
|
210
215
|
)
|
|
211
216
|
// the card the address names, else the list's first: a new one is a new thread state, the old one disposed
|
|
@@ -314,8 +319,18 @@ export class ReviewSt {
|
|
|
314
319
|
return `${f ? `${f}&` : ''}limit=${this.shown}`
|
|
315
320
|
}
|
|
316
321
|
|
|
322
|
+
/** the verdict he just gave, by thread head: its row shows it at once, while the store takes it */
|
|
323
|
+
answering: Record<string, ReviewStatus> = {}
|
|
324
|
+
|
|
325
|
+
setAnswering(head: string, status: ReviewStatus | null): void {
|
|
326
|
+
if (status === null) delete this.answering[head]
|
|
327
|
+
else this.answering[head] = status
|
|
328
|
+
}
|
|
329
|
+
|
|
317
330
|
get rows(): ThreadRow[] {
|
|
318
|
-
|
|
331
|
+
const rows = this.page?.rows ?? []
|
|
332
|
+
const a = this.answering
|
|
333
|
+
return Object.keys(a).length === 0 ? rows : rows.map((r) => (a[r.head] ? { ...r, status: a[r.head]! } : r))
|
|
319
334
|
}
|
|
320
335
|
|
|
321
336
|
/** more rows sit on the server past the ones shown */
|
|
@@ -471,6 +486,15 @@ export class ReviewSt {
|
|
|
471
486
|
return this.railOn && !this.phone.on && this.width >= RAIL_PX
|
|
472
487
|
}
|
|
473
488
|
|
|
489
|
+
/** the card drawn alone, the sidebar and the cards folded away; a phone shows one pane anyway */
|
|
490
|
+
get wide(): boolean {
|
|
491
|
+
return this.st.home.layout.foldedOn('review', 'left') && !this.phone.on
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
toggleWide(): void {
|
|
495
|
+
this.st.home.layout.toggleFold('review', 'left')
|
|
496
|
+
}
|
|
497
|
+
|
|
474
498
|
toggleRail(): void {
|
|
475
499
|
if (this.phone.on || this.width < RAIL_PX) this.sheet = !this.sheet
|
|
476
500
|
else this.railOn = !this.railOn
|
|
@@ -484,6 +508,14 @@ export class ReviewSt {
|
|
|
484
508
|
this.zoom = z
|
|
485
509
|
}
|
|
486
510
|
|
|
511
|
+
setGalleryMode(m: GalleryMode): void {
|
|
512
|
+
this.galleryMode = m
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
setGalleryFit(f: GalleryFit): void {
|
|
516
|
+
this.galleryFit = f
|
|
517
|
+
}
|
|
518
|
+
|
|
487
519
|
toggleTileSmall(): void {
|
|
488
520
|
this.tileSmall = !this.tileSmall
|
|
489
521
|
}
|
|
@@ -598,7 +630,7 @@ export class ReviewSt {
|
|
|
598
630
|
|
|
599
631
|
/** the page's keys, as the atelier takes its own: true when it used the key. V approves, F ok with a fix, R rejects,
|
|
600
632
|
* A archives, N the next waiting card, C copies the card for an agent, M the rings, T the contents, D the next
|
|
601
|
-
* compare mode of every pair (⇧D the one before), ↑ ↓ the list; the card takes
|
|
633
|
+
* compare mode of every pair (⇧D the one before), ↑ ↓ the list (W the card wide is the hub's, kept-cols.tsx); the card takes
|
|
602
634
|
* the rest (ThreadSt.key). A digit is read from its physical key (`code`), so ⇧ and an AZERTY keyboard read the same */
|
|
603
635
|
key(e: Pick<KeyboardEvent, 'key' | 'shiftKey'> & { code?: string }): boolean {
|
|
604
636
|
const card = this.card
|
|
@@ -126,6 +126,7 @@ const TopBar = observer(({ rv, card, back }: { rv: ReviewSt; card: ThreadSt; bac
|
|
|
126
126
|
<Rework r={v.rework} />
|
|
127
127
|
<span className="sp" />
|
|
128
128
|
<PostAsk rv={rv} card={card} />
|
|
129
|
+
<button className={`rv-iconbtn${rv.wide ? ' on' : ''}`} aria-pressed={rv.wide} title={rv.wide ? 'back to the sidebar and the cards (W)' : 'wide: fold the sidebar and the cards, the card takes the page (W)'} aria-label="wide" onMouseDown={keepFocus} onClick={() => rv.toggleWide()}><Icon d={ICON.wide} /></button>
|
|
129
130
|
<span className="seg">
|
|
130
131
|
<button className="rv-iconbtn" title="fold every cell" aria-label="fold every cell" onMouseDown={keepFocus} onClick={() => card.foldAll(false)}><Icon d={ICON.foldAll} /></button>
|
|
131
132
|
<button className="rv-iconbtn" title="unfold every cell (it loads every image)" aria-label="unfold every cell" onMouseDown={keepFocus} onClick={() => card.foldAll(true)}><Icon d={ICON.unfoldAll} /></button>
|
|
@@ -299,7 +300,7 @@ const Composer = observer(({ rv, card }: { rv: ReviewSt; card: ThreadSt }) => {
|
|
|
299
300
|
const views = card.headItem?.views ?? []
|
|
300
301
|
const reactions = card.outgoingReactions
|
|
301
302
|
const verdicts = card.takesVerdict
|
|
302
|
-
const sent = h?.kind === 'version' ? card.
|
|
303
|
+
const sent = h?.kind === 'version' ? card.chosenOn(h.id) : undefined
|
|
303
304
|
const newest = card.newest
|
|
304
305
|
const parked = card.parked === null ? null : card.versionOf(card.parked)
|
|
305
306
|
return (
|
|
@@ -11,7 +11,7 @@ import { isChoice, isGallery, isPair, onFrame, STARS, STATUS_LABEL, thumbFileOf,
|
|
|
11
11
|
import { AutoText } from '../auto-text.tsx'
|
|
12
12
|
import type { ClipSt } from './clip-st.ts'
|
|
13
13
|
import { blurOnEscape, FIT_ROOM, keepFocus, PAIR_NAMES, REACTIONS, secs, SIDE_LABEL } from './kit.tsx'
|
|
14
|
-
import { TILE_H, ZOOMS, type Zoom } from './review-kit.ts'
|
|
14
|
+
import { GALLERY_FITS, GALLERY_MODES, TILE_H, ZOOMS, type GalleryFit, type GalleryMode, type Zoom } from './review-kit.ts'
|
|
15
15
|
import { COMPARE_MODES, drawnSide, type CompareMode, type CompareSt, type PairSide, type ReviewSt } from './review-st.ts'
|
|
16
16
|
import { TILE_FILTERS, viewDom, viewKind, viewKey, type ThreadSt, type TileFilter } from './thread-st.ts'
|
|
17
17
|
import { Caret } from '../icons.tsx'
|
|
@@ -358,17 +358,35 @@ const ReactionToggles = observer(({ ver, view, tile, small }: { ver: Ver; view:
|
|
|
358
358
|
)
|
|
359
359
|
})
|
|
360
360
|
|
|
361
|
-
/** a gallery view
|
|
362
|
-
*
|
|
361
|
+
/** a gallery view, drawn the way he picks (kept per repo): tabs, a side list of its images with the picked one large;
|
|
362
|
+
* list, one image a row at full width; grid, its tiles at the slider's height, one row per asset when its tiles are
|
|
363
|
+
* variants (a group each). A head picks the mode and the fit, filters the tiles, flips every tile to its before, adds
|
|
364
|
+
* the small sizes. A phone has no room for a side list, so its tabs read as the list */
|
|
363
365
|
const Gallery = observer(({ ver, v, view }: { ver: Ver; v: GalleryView; view: number }) => {
|
|
364
366
|
const { rv, card } = ver
|
|
365
367
|
const befores = v.gallery.some((t) => t.before)
|
|
366
368
|
const tiles = v.gallery.map((t, k) => ({ t, k }))
|
|
367
|
-
const
|
|
368
|
-
const
|
|
369
|
+
const sections = v.gallery.some((t) => t.group) ? [...new Set(v.gallery.map((t) => t.group ?? ''))].map((g) => ({ g, tiles: tiles.filter((x) => (x.t.group ?? '') === g) })) : null
|
|
370
|
+
const mode: GalleryMode = rv.galleryMode === 'tabs' && rv.phone.on ? 'list' : rv.galleryMode
|
|
371
|
+
const draw = (xs: typeof tiles): ReactNode =>
|
|
372
|
+
mode === 'list'
|
|
373
|
+
? <div className="rv-gallerylist">{xs.map(({ t, k }) => <Tile key={k} ver={ver} v={v} view={view} t={t} k={k} fill />)}</div>
|
|
374
|
+
: <div className="rv-gallery">{xs.map(({ t, k }) => <Tile key={k} ver={ver} v={v} view={view} t={t} k={k} />)}</div>
|
|
369
375
|
return (
|
|
370
376
|
<div className="rv-gallerywrap">
|
|
371
377
|
<div className="rv-galleryhead rv-small">
|
|
378
|
+
<span className="seg" role="group" aria-label="how the images show">
|
|
379
|
+
{GALLERY_MODES.map((m) => (
|
|
380
|
+
<button key={m} data-mode={m} className={rv.galleryMode === m ? 'on' : ''} title={GALLERY_MODE_TITLE[m]} onMouseDown={keepFocus} onClick={() => rv.setGalleryMode(m)}>{m}</button>
|
|
381
|
+
))}
|
|
382
|
+
</span>
|
|
383
|
+
{mode !== 'grid' ? (
|
|
384
|
+
<span className="seg" role="group" aria-label="how a large image fits">
|
|
385
|
+
{GALLERY_FITS.map((f) => (
|
|
386
|
+
<button key={f} data-fit={f} className={rv.galleryFit === f ? 'on' : ''} title={GALLERY_FIT_TITLE[f]} onMouseDown={keepFocus} onClick={() => rv.setGalleryFit(f)}>{`fit ${f}`}</button>
|
|
387
|
+
))}
|
|
388
|
+
</span>
|
|
389
|
+
) : null}
|
|
372
390
|
<span className="seg" role="group" aria-label="which tiles show">
|
|
373
391
|
{TILE_FILTERS.map((f) => (
|
|
374
392
|
<button key={f} className={card.tileFilter === f ? 'on' : ''} onMouseDown={keepFocus} onClick={() => card.setTileFilter(f)}>{TILE_FILTER_LABEL[f]}</button>
|
|
@@ -377,14 +395,63 @@ const Gallery = observer(({ ver, v, view }: { ver: Ver; v: GalleryView; view: nu
|
|
|
377
395
|
{befores ? <button className={`rv-chip${card.beforeAll ? ' on' : ''}`} title="every tile shows its before" onMouseDown={keepFocus} onClick={() => card.toggleBeforeAll()}>before</button> : null}
|
|
378
396
|
<button className={`rv-chip${rv.tileSmall ? ' on' : ''}`} title="each tile also at 16, 32 and 64 px" onMouseDown={keepFocus} onClick={() => rv.toggleTileSmall()}>real size</button>
|
|
379
397
|
</div>
|
|
380
|
-
{
|
|
381
|
-
?
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
398
|
+
{mode === 'tabs'
|
|
399
|
+
? <GalleryTabs ver={ver} v={v} view={view} />
|
|
400
|
+
: sections
|
|
401
|
+
? sections.map(({ g, tiles: xs }) => (
|
|
402
|
+
<div key={g} className="rv-galleryrow">
|
|
403
|
+
<div className="rv-rowlabel">{g || 'others'}</div>
|
|
404
|
+
{draw(xs)}
|
|
405
|
+
</div>
|
|
406
|
+
))
|
|
407
|
+
: draw(tiles)}
|
|
408
|
+
</div>
|
|
409
|
+
)
|
|
410
|
+
})
|
|
411
|
+
|
|
412
|
+
const GALLERY_MODE_TITLE: Record<GalleryMode, string> = {
|
|
413
|
+
tabs: 'a list of the images on the left, the picked one large (↑ ↓ in the list walk it)',
|
|
414
|
+
list: 'every image one under the other, at full width',
|
|
415
|
+
grid: 'the images side by side, at the tiles slider\'s height',
|
|
416
|
+
}
|
|
417
|
+
const GALLERY_FIT_TITLE: Record<GalleryFit, string> = { width: 'a large image takes the whole width, and scrolls', screen: 'a large image fits the screen whole' }
|
|
418
|
+
|
|
419
|
+
/** the tabs of a gallery: one row a shown tile (its thumbnail, its name, its stars, its mark's colour), a row per
|
|
420
|
+
* asset name over its variants, and the picked tile drawn large beside them. ↑ ↓ walk the list while it has the
|
|
421
|
+
* focus, and never reach the page, where they walk the cards */
|
|
422
|
+
const GalleryTabs = observer(({ ver, v, view }: { ver: Ver; v: GalleryView; view: number }) => {
|
|
423
|
+
const { rv, card, cell } = ver
|
|
424
|
+
const id = itemOf(ver).id
|
|
425
|
+
const shown = v.gallery.map((t, k) => ({ t, k, r: card.reactionShown(cell, view, k) })).filter((x) => card.tileShown(x.r))
|
|
426
|
+
const at = shown.find((x) => x.k === card.galleryTab[view]) ?? shown[0]
|
|
427
|
+
if (at === undefined) return <div className="rv-dim rv-small">no image passes this filter</div>
|
|
428
|
+
const step = (by: number): void => {
|
|
429
|
+
const i = shown.indexOf(at)
|
|
430
|
+
card.setGalleryTab(view, shown[(i + by + shown.length) % shown.length]!.k)
|
|
431
|
+
}
|
|
432
|
+
const walk = (e: React.KeyboardEvent): void => {
|
|
433
|
+
if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp') return
|
|
434
|
+
e.preventDefault()
|
|
435
|
+
e.stopPropagation()
|
|
436
|
+
step(e.key === 'ArrowDown' ? 1 : -1)
|
|
437
|
+
}
|
|
438
|
+
return (
|
|
439
|
+
<div className="rv-gtabs">
|
|
440
|
+
<nav className="rv-gtablist" aria-label="the images" onKeyDown={walk}>
|
|
441
|
+
{shown.map(({ t, k, r }, i) => (
|
|
442
|
+
<div key={k} className="rv-gtabslot">
|
|
443
|
+
{t.group && t.group !== shown[i - 1]?.t.group ? <div className="rv-gtabgroup">{t.group}</div> : null}
|
|
444
|
+
<button className={`rv-gtab${k === at.k ? ' on' : ''}${toneClass(r?.status)}`} aria-current={k === at.k} title={t.label} onClick={() => card.setGalleryTab(view, k)}>
|
|
445
|
+
<img src={rv.thumbUrl(id, t.file)} alt="" loading="lazy" draggable={false} />
|
|
446
|
+
<span className="rv-gtablabel">{t.label}</span>
|
|
447
|
+
<span className="rv-gtabmark">{r?.stars ? '★'.repeat(r.stars) : ''}{r?.picked ? ' ✓ kept' : ''}</span>
|
|
448
|
+
</button>
|
|
449
|
+
</div>
|
|
450
|
+
))}
|
|
451
|
+
</nav>
|
|
452
|
+
<div className="rv-gtabbody">
|
|
453
|
+
<Tile key={at.k} ver={ver} v={v} view={view} t={at.t} k={at.k} fill />
|
|
454
|
+
</div>
|
|
388
455
|
</div>
|
|
389
456
|
)
|
|
390
457
|
})
|
|
@@ -401,8 +468,9 @@ const TILE_WIDE = 1.6
|
|
|
401
468
|
const SMALL_SIZES = [16, 32, 64] as const
|
|
402
469
|
|
|
403
470
|
/** one gallery tile: its image (its before while flipped or peeked), the small sizes, its label, stars, the variant
|
|
404
|
-
* pick on a row, OK fix or no and a word; a click shows it large at the column's size
|
|
405
|
-
|
|
471
|
+
* pick on a row, OK fix or no and a word; a click shows it large at the column's size. `fill`: drawn large in the
|
|
472
|
+
* tabs or the list, at the fit he picks (the column's width, or the screen), with no click to shrink it */
|
|
473
|
+
const Tile = observer(({ ver, v, view, t, k, fill = false }: { ver: Ver; v: GalleryView; view: number; t: GalleryTile; k: number; fill?: boolean }) => {
|
|
406
474
|
const { rv, card, cell } = ver
|
|
407
475
|
const id = itemOf(ver).id
|
|
408
476
|
const big = card.bigTile === `${viewKey(id, view)}/${k}`
|
|
@@ -416,13 +484,16 @@ const Tile = observer(({ ver, v, view, t, k }: { ver: Ver; v: GalleryView; view:
|
|
|
416
484
|
const ih = Math.round(iw / ratio)
|
|
417
485
|
const file = t.before && card.showsBefore(view, k) ? t.before : t.file
|
|
418
486
|
const thumb = rv.thumbUrl(id, file)
|
|
419
|
-
const src = big || h > TILE_H.thumb ? rv.fitUrl(id, file) : thumb
|
|
420
|
-
const toggle = (): void => card.toggleTile(id, view, k)
|
|
487
|
+
const src = big || fill || h > TILE_H.thumb ? rv.fitUrl(id, file) : thumb
|
|
488
|
+
const toggle = (): void => { if (!fill) card.toggleTile(id, view, k) }
|
|
489
|
+
const aspect = `${t.size.w} / ${t.size.h}`
|
|
490
|
+
const screen = { width: `min(100%, calc((100vh - ${FIT_ROOM}px) * ${ratio}))`, aspectRatio: aspect }
|
|
491
|
+
const imgStyle = fill ? (rv.galleryFit === 'width' ? { width: '100%', aspectRatio: aspect } : screen) : big ? screen : { width: iw, height: ih }
|
|
492
|
+
const title = live ? (fill ? 'drag to circle a spot' : 'drag to circle a spot, click to enlarge') : fill ? undefined : big ? 'click to shrink' : 'click to enlarge'
|
|
421
493
|
return (
|
|
422
|
-
<div className={`rv-tile${big ? ' big' : ''}${r?.picked ? ' picked' : ''}${toneClass(r?.status)}`} style={big ? undefined : { width: Math.max(iw, TILE_MIN_W) + TILE_CHROME }}
|
|
494
|
+
<div className={`rv-tile${big ? ' big' : ''}${fill ? ' fill' : ''}${r?.picked ? ' picked' : ''}${toneClass(r?.status)}`} style={big || fill ? undefined : { width: Math.max(iw, TILE_MIN_W) + TILE_CHROME }}
|
|
423
495
|
onMouseEnter={live ? () => card.setHoverTile({ view, tile: k }) : undefined} onMouseLeave={live ? () => card.setHoverTile(null) : undefined}>
|
|
424
|
-
<div className="rv-tileimg" onClick={live ? undefined : toggle} title={
|
|
425
|
-
style={big ? { width: `min(100%, calc((100vh - ${FIT_ROOM}px) * ${ratio}))`, aspectRatio: `${t.size.w} / ${t.size.h}` } : { width: iw, height: ih }}>
|
|
496
|
+
<div className="rv-tileimg" onClick={live ? undefined : toggle} title={title} style={imgStyle}>
|
|
426
497
|
<Marks ver={ver} src={src} side={undefined} view={view} tile={k} onTap={toggle} />
|
|
427
498
|
{ver.live ? <div className="rv-over"><RectNote ver={ver} view={view} sides={[undefined]} tile={k} /></div> : null}
|
|
428
499
|
{t.before ? (
|
|
@@ -120,6 +120,8 @@ export class ThreadSt {
|
|
|
120
120
|
noteFocus: number | null = null
|
|
121
121
|
/** the gallery tile shown large, `<item>#<view>/<tile>` */
|
|
122
122
|
bigTile: string | null = null
|
|
123
|
+
/** the tile each gallery view opens in tabs mode, by view; absent = its first shown tile */
|
|
124
|
+
galleryTab: Record<number, number> = {}
|
|
123
125
|
/** the gallery tile under the pointer of the newest version: 1 to 5 score it */
|
|
124
126
|
hoverTile: { view: number; tile: number } | null = null
|
|
125
127
|
/** which gallery tiles show: all, the ones he has not scored nor marked, under 3 stars, the ones marked fix or no */
|
|
@@ -135,6 +137,8 @@ export class ThreadSt {
|
|
|
135
137
|
/** an option row folded or unfolded by hand, by `<item>#<view>` */
|
|
136
138
|
openRows: Record<string, boolean> = {}
|
|
137
139
|
busy = false
|
|
140
|
+
/** the verdict he just gave: shown as chosen the moment he clicks, while the store takes it */
|
|
141
|
+
sending: { on: string; status: ReviewStatus } | null = null
|
|
138
142
|
/** « 📣 post »'s box: his word while it is open, null when shut */
|
|
139
143
|
postBox: string | null = null
|
|
140
144
|
private readonly clips = new Map<string, ClipSt>()
|
|
@@ -429,6 +433,12 @@ export class ThreadSt {
|
|
|
429
433
|
// ── what was said on each view ──
|
|
430
434
|
|
|
431
435
|
/** the verdicts on one version, oldest first */
|
|
436
|
+
/** the verdict a version shows as chosen: the one being sent, else its current one */
|
|
437
|
+
chosenOn(id: string): ReviewStatus | undefined {
|
|
438
|
+
if (this.sending?.on === id) return this.sending.status
|
|
439
|
+
return this.verdictsOn(id).findLast((x) => x.current)?.verdict
|
|
440
|
+
}
|
|
441
|
+
|
|
432
442
|
verdictsOn(id: string): VerdictCell[] {
|
|
433
443
|
return this.cells.filter((c): c is VerdictCell => c.kind === 'verdict' && c.on === id)
|
|
434
444
|
}
|
|
@@ -664,6 +674,10 @@ export class ThreadSt {
|
|
|
664
674
|
}
|
|
665
675
|
}
|
|
666
676
|
|
|
677
|
+
setGalleryTab(view: number, tile: number): void {
|
|
678
|
+
this.galleryTab = { ...this.galleryTab, [view]: tile }
|
|
679
|
+
}
|
|
680
|
+
|
|
667
681
|
toggleTile(id: string, view: number, tile: number): void {
|
|
668
682
|
const k = `${viewKey(id, view)}/${tile}`
|
|
669
683
|
this.bigTile = this.bigTile === k ? null : k
|
|
@@ -751,8 +765,11 @@ export class ThreadSt {
|
|
|
751
765
|
return
|
|
752
766
|
}
|
|
753
767
|
const d = this.draft
|
|
768
|
+
const head = this.data?.head ?? h.id
|
|
754
769
|
this.busy = true
|
|
755
770
|
this.error = null
|
|
771
|
+
this.sending = { on: h.id, status }
|
|
772
|
+
this.rv.setAnswering(head, status)
|
|
756
773
|
try {
|
|
757
774
|
const pick = isChoice(h.item) && isApproved(status) && d.pick !== undefined ? { pick: d.pick } : {}
|
|
758
775
|
await postJson(this.rv.url(`/api/review/${h.id}/feedback`), { status, comment: d.comment, rects: d.rects, reactions: d.reactions ?? [], ...pick })
|
|
@@ -761,7 +778,12 @@ export class ThreadSt {
|
|
|
761
778
|
} catch (e) {
|
|
762
779
|
runInAction(() => (this.error = (e as Error).message))
|
|
763
780
|
} finally {
|
|
764
|
-
|
|
781
|
+
// the store's answer is in by now, or the send failed: either way what shows is the truth again
|
|
782
|
+
runInAction(() => {
|
|
783
|
+
this.busy = false
|
|
784
|
+
this.sending = null
|
|
785
|
+
this.rv.setAnswering(head, null)
|
|
786
|
+
})
|
|
765
787
|
}
|
|
766
788
|
}
|
|
767
789
|
|
|
@@ -33,7 +33,7 @@ export const TrailerPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
33
33
|
</div>
|
|
34
34
|
)
|
|
35
35
|
return (
|
|
36
|
-
<KeptCols id="trailer">
|
|
36
|
+
<KeptCols id="trailer" folds={{ left: 'trailer-cuts', right: 'trailer-notes' }} layout={app.home.layout}>
|
|
37
37
|
<Panel id="trailer-cuts" defaultSize="15%" minSize={190} className="rv-pane" style={PANEL}>
|
|
38
38
|
<div className="rv-scroll"><CutList tr={tr} /></div>
|
|
39
39
|
</Panel>
|
|
@@ -17,6 +17,17 @@
|
|
|
17
17
|
/* ── the columns ── */
|
|
18
18
|
.rv-cols{flex:1;min-height:0}
|
|
19
19
|
.rv-pane{height:100%;min-width:0;display:flex;flex-direction:column}
|
|
20
|
+
.rv-widebody{display:flex}
|
|
21
|
+
.rv-widebody > .pmain{flex:1;min-width:0}
|
|
22
|
+
.rv-foldrow{flex:1;min-height:0;min-width:0;display:flex}
|
|
23
|
+
.rv-foldrow > .rv-cols{flex:1;min-width:0}
|
|
24
|
+
.rv-widebar.right{border-right:0;border-left:1px solid var(--line)}
|
|
25
|
+
.rv-widebar{flex:none;width:16px;height:100%;padding:0;border:0;border-right:1px solid var(--line);border-radius:0;background:var(--panel);cursor:pointer;display:flex;align-items:center;justify-content:center}
|
|
26
|
+
.rv-widebar:hover{background:color-mix(in srgb,var(--accent) 12%,var(--panel))}
|
|
27
|
+
.rv-wideknob{display:flex;align-items:center;justify-content:center;width:12px;height:56px;border-radius:6px;background:color-mix(in srgb,var(--accent) 35%,var(--line));color:var(--fg);font-size:13px;font-weight:700;line-height:1}
|
|
28
|
+
.rv-widebar:hover .rv-wideknob{background:var(--accent);color:var(--bg)}
|
|
29
|
+
.rv-iconbtn.on{background:color-mix(in srgb,var(--accent) 18%,transparent);border-color:var(--accent)}
|
|
30
|
+
.rv-iconbtn.on .hico{color:var(--accent)}
|
|
20
31
|
.rv-scroll{flex:1;min-height:0;overflow-y:auto}
|
|
21
32
|
.rv-dim,.tr-dim{color:var(--dim)}
|
|
22
33
|
.rv-small,.tr-small{font-size:11px}
|
|
@@ -300,6 +311,19 @@ span.rv-react{display:inline-block;border:1px solid;border-radius:4px}
|
|
|
300
311
|
.rv-tile{display:flex;flex-direction:column;gap:var(--s1);padding:var(--s1);border-radius:6px;border:2px solid var(--line)}
|
|
301
312
|
.rv-tile[class*=' re-']{border-color:var(--tone);background:color-mix(in srgb,var(--tone) 8%,transparent)}
|
|
302
313
|
.rv-tile.big{width:100%}
|
|
314
|
+
.rv-tile.fill{width:100%}
|
|
315
|
+
.rv-tile.fill .rv-tileimg{cursor:default}
|
|
316
|
+
.rv-gallerylist{display:flex;flex-direction:column;gap:var(--s2)}
|
|
317
|
+
.rv-gtabs{display:grid;grid-template-columns:minmax(150px,220px) minmax(0,1fr);gap:var(--s2);align-items:start}
|
|
318
|
+
.rv-gtablist{position:sticky;top:0;display:flex;flex-direction:column;gap:2px;max-height:calc(100vh - 160px);overflow:auto;padding-right:2px}
|
|
319
|
+
.rv-gtab{display:grid;grid-template-columns:48px minmax(0,1fr);grid-template-rows:auto auto;column-gap:var(--s1);align-items:center;width:100%;text-align:left;padding:var(--s1);border:1px solid transparent;border-left:3px solid var(--line);border-radius:4px;background:none;cursor:pointer}
|
|
320
|
+
.rv-gtab:hover{background:color-mix(in srgb,var(--fg) 5%,transparent)}
|
|
321
|
+
.rv-gtab.on{background:color-mix(in srgb,var(--accent) 14%,transparent);border-color:var(--accent)}
|
|
322
|
+
.rv-gtab[class*=' re-']{border-left-color:var(--tone)}
|
|
323
|
+
.rv-gtab img{grid-row:span 2;width:48px;height:36px;object-fit:cover;object-position:top;border-radius:2px;background:repeating-conic-gradient(var(--chk1) 0 25%,var(--chk2) 0 50%) 0 0/8px 8px}
|
|
324
|
+
.rv-gtablabel{font-size:12px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
325
|
+
.rv-gtabmark{font-size:10px;color:var(--warn);min-height:12px}
|
|
326
|
+
.rv-gtabgroup{font-weight:600;font-size:11px;margin:var(--s1) 0 2px}
|
|
303
327
|
.rv-tileimg{border-radius:4px;cursor:zoom-in;width:100%;background:repeating-conic-gradient(var(--chk1) 0 25%,var(--chk2) 0 50%) 0 0/12px 12px}
|
|
304
328
|
.rv-tile.big .rv-tileimg{cursor:zoom-out}
|
|
305
329
|
.rv-tileimg img{display:block;width:100%;height:100%;object-fit:contain}
|
|
@@ -49,7 +49,7 @@ export const CommsPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
49
49
|
return (
|
|
50
50
|
<div className="so-page">
|
|
51
51
|
<SocialCalendar so={so} />
|
|
52
|
-
<KeptCols id="comms">
|
|
52
|
+
<KeptCols id="comms" folds={{ left: 'comms-list', right: 'comms-side' }} layout={app.home.layout}>
|
|
53
53
|
<Panel id="comms-list" defaultSize="22%" minSize={240} className="rv-pane" style={PANEL}>
|
|
54
54
|
<DraftsList so={so} />
|
|
55
55
|
</Panel>
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
import { useState, type CSSProperties, type ReactNode } from 'react'
|
|
6
6
|
import { BRANDS, brandHex } from '../../../social/brands.ts'
|
|
7
|
+
import { AutoText } from '../auto-text.tsx'
|
|
7
8
|
import { renderMd, renderMdInline } from '../md.ts'
|
|
8
9
|
import { plain } from './social-model.ts'
|
|
9
10
|
import type { DraftNote, SocialSt } from './social-st.ts'
|
|
@@ -145,11 +146,10 @@ export const NotesBox = observer((p: { so: SocialSt; notes: readonly DraftNote[]
|
|
|
145
146
|
return (
|
|
146
147
|
<div className="so-notes">
|
|
147
148
|
<div className="so-noteline">
|
|
148
|
-
<
|
|
149
|
-
rows={1}
|
|
149
|
+
<AutoText
|
|
150
150
|
placeholder={p.placeholder}
|
|
151
151
|
value={text}
|
|
152
|
-
|
|
152
|
+
onText={setText}
|
|
153
153
|
onKeyDown={(e) => {
|
|
154
154
|
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) void send()
|
|
155
155
|
}}
|
|
@@ -8,6 +8,7 @@ import { CopyFrame, Count, ExpandButton, Field, Fold, FoldCard, Logo, Md, popup
|
|
|
8
8
|
import { angleCards, isClip, isVertical, logoStacks, sharing, STATUS, TEXT_FIELD, TITLE_MAX, type DeskAccount, type Media, type Place, type SocialPost } from './social-model.ts'
|
|
9
9
|
import type { SocialSt } from './social-st.ts'
|
|
10
10
|
import { Caret } from '../icons.tsx'
|
|
11
|
+
import { AutoText } from '../auto-text.tsx'
|
|
11
12
|
|
|
12
13
|
/** the platforms of some messages, each lit once posted there; a group's accounts one stack of overlapping logos */
|
|
13
14
|
export const Logos = observer((p: { so: SocialSt; posts: readonly SocialPost[]; size: number }) => {
|
|
@@ -406,7 +407,7 @@ const EditBox = observer((p: { so: SocialSt; post: SocialPost; label: string })
|
|
|
406
407
|
</Field>
|
|
407
408
|
) : null}
|
|
408
409
|
<Field label={p.label}>
|
|
409
|
-
<
|
|
410
|
+
<AutoText className="so-editor" autoFocus rows={3} value={e.text} onText={(text) => so.typeEdit(p.post, { text })} onKeyDown={keys} />
|
|
410
411
|
</Field>
|
|
411
412
|
<Field label="Tags">
|
|
412
413
|
<input className="so-input" placeholder="#gamedev #indiedev" value={e.tags} onChange={(ev) => so.typeEdit(p.post, { tags: ev.currentTarget.value })} onKeyDown={keys} />
|
|
@@ -48,7 +48,7 @@ export const SocialPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
48
48
|
)
|
|
49
49
|
return (
|
|
50
50
|
<div className="so-page">
|
|
51
|
-
<KeptCols id="social">
|
|
51
|
+
<KeptCols id="social" folds={{ left: 'social-list', right: 'social-right' }} layout={app.home.layout}>
|
|
52
52
|
<Panel id="social-list" defaultSize="22%" minSize={240} className="rv-pane" style={PANEL}>
|
|
53
53
|
<IdentityList so={so} />
|
|
54
54
|
</Panel>
|
|
@@ -107,7 +107,7 @@ a.so-icon:visited{color:var(--dim)}
|
|
|
107
107
|
.so-partchip{font-size:13px;font-weight:700;padding:0 var(--s2);line-height:24px;border-radius:4px;background:var(--sel);color:var(--accent)}
|
|
108
108
|
.so-notes{display:flex;flex-direction:column;gap:var(--s1);padding:var(--s2);border-radius:6px;border:1px solid color-mix(in srgb,var(--warn) 45%,var(--line));background:color-mix(in srgb,var(--warn) 7%,var(--panel))}
|
|
109
109
|
.so-noteline{display:flex;gap:var(--s2);align-items:flex-end}
|
|
110
|
-
.so-noteline textarea{flex:1;min-
|
|
110
|
+
.so-noteline textarea{flex:1;min-width:0;font:12.5px/1.45 system-ui,sans-serif;padding:var(--s1) var(--s2)}
|
|
111
111
|
.so-said{text-align:left;font-size:12px;padding:var(--s1) var(--s2);border:0;border-left:3px solid var(--tone);background:none;white-space:pre-wrap;cursor:pointer}
|
|
112
112
|
.so-saidstate{font-size:10px;font-weight:700;text-transform:uppercase;color:var(--tone)}
|
|
113
113
|
.so-text{font-size:13px}
|
|
@@ -11,6 +11,7 @@ import { renderMd } from '../md.ts'
|
|
|
11
11
|
import type { RepoSt } from '../repo-st.ts'
|
|
12
12
|
import { PANEL, PhoneTop } from '../review/review-page.tsx'
|
|
13
13
|
import type { FieldView, Picture, StoresSt, StoreView } from './stores-st.ts'
|
|
14
|
+
import { AutoText } from '../auto-text.tsx'
|
|
14
15
|
|
|
15
16
|
export const StoresPage = observer(({ app }: { app: RepoSt }) => {
|
|
16
17
|
const so = app.stores
|
|
@@ -32,7 +33,7 @@ export const StoresPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
32
33
|
return (
|
|
33
34
|
<>
|
|
34
35
|
<Toast so={so} />
|
|
35
|
-
<KeptCols id="stores">
|
|
36
|
+
<KeptCols id="stores" folds={{ left: 'stores-list', right: 'stores-pictures' }} layout={app.home.layout}>
|
|
36
37
|
<Panel id="stores-list" defaultSize="20%" minSize={220} className="rv-pane" style={PANEL}>
|
|
37
38
|
<div className="rv-scroll"><StoreList so={so} /></div>
|
|
38
39
|
</Panel>
|
|
@@ -158,7 +159,7 @@ const FieldCard = observer(({ so, f }: { so: StoresSt; f: FieldView }) => {
|
|
|
158
159
|
</div>
|
|
159
160
|
{editing ? (
|
|
160
161
|
<>
|
|
161
|
-
<
|
|
162
|
+
<AutoText className="sto-edit" autoFocus rows={4} value={so.editing?.text ?? ''} onText={(t) => so.type(t)} onKeyDown={keys} />
|
|
162
163
|
<div className="sto-acts">
|
|
163
164
|
<button disabled={so.busy || (so.editing?.text.trim() ?? '') === ''} onClick={() => void so.saveEdit(f)}>Save</button>
|
|
164
165
|
<button className="ghost" onClick={() => so.cancelEdit()}>Cancel</button>
|
|
@@ -198,12 +199,12 @@ const NoteBox = observer(({ so, asset, said }: { so: StoresSt; asset: string; sa
|
|
|
198
199
|
{n.answer ? <div className="rv-dim">↳ {n.answer}</div> : null}
|
|
199
200
|
</button>
|
|
200
201
|
))}
|
|
201
|
-
<
|
|
202
|
+
<AutoText
|
|
202
203
|
autoFocus
|
|
203
204
|
rows={2}
|
|
204
205
|
placeholder="a note on this: it goes to the review page, an agent takes it"
|
|
205
206
|
value={text}
|
|
206
|
-
|
|
207
|
+
onText={(t) => so.typeNote(asset, t)}
|
|
207
208
|
onKeyDown={(e) => {
|
|
208
209
|
if (e.key === 'Enter' && (e.metaKey || e.ctrlKey)) void so.sendNote(asset)
|
|
209
210
|
}}
|