@vibefield/rosetta-room 0.1.5 → 0.1.7
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/LICENSE +21 -0
- package/README.md +53 -2
- package/dist/HistoryRoom.js +21 -5
- package/dist/components/ColdStart.d.ts +15 -0
- package/dist/components/ColdStart.js +27 -0
- package/dist/components/IngestStatus.js +43 -6
- package/dist/components/Transcript.js +8 -2
- package/dist/components/transcript/Attachments.d.ts +2 -0
- package/dist/components/transcript/Attachments.js +35 -10
- package/dist/components/transcript/AuthoredMessage.js +2 -1
- package/dist/components/transcript/DayPill.d.ts +8 -4
- package/dist/components/transcript/DayPill.js +13 -12
- package/dist/components/transcript/Document.js +8 -2
- package/dist/components/transcript/PromptJump.d.ts +14 -0
- package/dist/components/transcript/PromptJump.js +116 -0
- package/dist/components/transcript/TranscriptLoading.js +9 -0
- package/dist/components/transcript/VideoTile.d.ts +28 -0
- package/dist/components/transcript/VideoTile.js +99 -0
- package/dist/components/transcript/attachment-file-source.d.ts +9 -1
- package/dist/components/transcript/attachment-file-source.js +9 -1
- package/dist/components/transcript/document-model.js +6 -4
- package/dist/components/transcript/video-source.d.ts +39 -0
- package/dist/components/transcript/video-source.js +110 -0
- package/dist/components/transcript/viewer-day.d.ts +7 -0
- package/dist/components/transcript/viewer-day.js +44 -0
- package/dist/components/ui/Hold.d.ts +25 -0
- package/dist/components/ui/Hold.js +44 -0
- package/dist/components/ui/Meter.d.ts +1 -1
- package/dist/components/ui/Meter.js +10 -0
- package/dist/components/ui/index.d.ts +2 -0
- package/dist/components/ui/index.js +1 -0
- package/dist/fixtures/index.d.ts +2 -1
- package/dist/fixtures/index.js +53 -4
- package/dist/host-inputs.d.ts +25 -0
- package/dist/host-inputs.js +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/lib/image-media.d.ts +5 -0
- package/dist/lib/image-media.js +17 -0
- package/dist/lib/ingest-activity.d.ts +6 -0
- package/dist/lib/ingest-activity.js +6 -0
- package/dist/lib/transcript/images.d.ts +6 -2
- package/dist/lib/transcript/images.js +10 -4
- package/dist/lib/transcript/index.d.ts +3 -1
- package/dist/lib/transcript/index.js +2 -1
- package/dist/lib/transcript/prompt-jump.d.ts +30 -0
- package/dist/lib/transcript/prompt-jump.js +65 -0
- package/dist/lib/transcript/sittings.d.ts +26 -0
- package/dist/lib/transcript/sittings.js +46 -1
- package/dist/lib/use-standing-hold.d.ts +17 -0
- package/dist/lib/use-standing-hold.js +70 -0
- package/dist/ports.d.ts +15 -1
- package/dist/styles/attachments.css +13 -0
- package/dist/styles/hold.css +47 -0
- package/dist/styles/ingest.css +14 -0
- package/dist/styles/room.css +18 -0
- package/package.json +3 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 James Yong
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -20,7 +20,10 @@ import "@vibefield/rosetta-room/styles/room.css"; // after the host's --vf-* tok
|
|
|
20
20
|
|
|
21
21
|
`@vibefield/rosetta-room/fixtures` renders the room with no daemon at all:
|
|
22
22
|
`<HistoryRoom {...createDemoPorts()} />` (six projects, eleven sessions, a year
|
|
23
|
-
of figures, two transcripts with images
|
|
23
|
+
of figures, two transcripts with images, web lines and two sent videos (one
|
|
24
|
+
captured, one not), all relative to now). The demo commits no encoded video: a
|
|
25
|
+
video member reads as a header-only MP4, so pressing play ends at "Could not
|
|
26
|
+
play video".
|
|
24
27
|
`createColdImport({ now })` returns `{ ports, consent, daemon, controller }`
|
|
25
28
|
for a first import instead, over a seeded synthetic archive (by default the
|
|
26
29
|
MacBook trace's shape: 8,612 sessions in 1,139 trees over 119 projects;
|
|
@@ -48,7 +51,7 @@ sockets stay the simulator's.
|
|
|
48
51
|
|---|---|---|
|
|
49
52
|
| `CatalogPort` | `subscribeMeta` (runtimes, projects, every session row, live: one snapshot then mutations) · `status` → `CatalogStatus` · `projectStats(projectId, window)` → `ProjectStats` (per-day heat and per-session facts) · `usage` · `dayUsage` · `search(CatalogSearch)` · optional `onConnectionChange`, `unavailable` (the host's own words for why the index cannot answer), `boost` and `projectStatsBatch` (every listed project's figures in one ask; present, the room asks it once per refresh instead of `projectStats` per project) | its client's REST and `/ws/meta` (`catalogOver`) |
|
|
50
53
|
| `SessionPort` | `open(sessionId)` → a `SessionClient` bound to that session (its live subscription, child threads and team members each open their own; entries, report work, commands, plans, file targets, stored members), or a promise of one; `close(sessionId)` | the one client for every session; close is nothing |
|
|
51
|
-
| `AssetSource` | `imageAssetUrl(asset, variant)` → a URL, null, or a promise of either · `attachmentAssetUrl(asset)` → the attachment's address, for identity and can-open only | the daemon's own URLs |
|
|
54
|
+
| `AssetSource` | `imageAssetUrl(asset, variant)` → a URL, null, or a promise of either · `attachmentAssetUrl(asset)` → the attachment's address, for identity and can-open only · optional `mediaAssetUrl(asset)` → an address a `<video src>` can load, null, or a promise of either | the daemon's own URLs |
|
|
52
55
|
| `HostPort` (optional) | `homeDir` · `platform` · `openInBrowser(name, bytes, browserId?)` · optional `browsers()` · `favicon(site)` · optional `worktree: { open, gitFacts, fileAction, ports }` | the Electron bridge (`hostPortOver`) |
|
|
53
56
|
|
|
54
57
|
- **The room opens a session at most once at a time and follows every `open`
|
|
@@ -78,6 +81,30 @@ sockets stay the simulator's.
|
|
|
78
81
|
originals as placeholders. The SDK published as 0.1.2 answers an
|
|
79
82
|
original's `full` with its plain URL, so a host pairs this room with the
|
|
80
83
|
SDK released beside it.
|
|
84
|
+
- **A sent video plays in place, and only when asked.** A tool row's
|
|
85
|
+
attachment of kind `video` is a recorded member (`/api/assets/<digest>.mp4`
|
|
86
|
+
or `.mov`, `video/mp4` or `video/quicktime`, no `image_variants`) or a
|
|
87
|
+
reference to a file that was sent but not captured. The rail draws a
|
|
88
|
+
captured one as a tile with a play glyph, the file's name and its size, at
|
|
89
|
+
the rail's height and the video's own shape (16:9 when its dimensions are
|
|
90
|
+
unknown, never narrower than a square nor wider than 21:9). There is no
|
|
91
|
+
poster and no thumbnail: the room asks nothing for a video until the reader
|
|
92
|
+
presses play. Then it asks the optional **`mediaAssetUrl(asset)`** for an
|
|
93
|
+
address a `<video src>` can load. A host answers one only for an address
|
|
94
|
+
that honours byte ranges: served whole, without ranges, a video plays but
|
|
95
|
+
cannot seek, and no error tells the room to fall back. The daemon serves a
|
|
96
|
+
member whole, so rosetta's app leaves `mediaAssetUrl` out. A host without
|
|
97
|
+
it, one that answers null, or one whose address the element cannot load
|
|
98
|
+
needs nothing more: the room reads the member's bytes through the reading
|
|
99
|
+
session's `readAsset` and plays an object URL it makes and revokes itself,
|
|
100
|
+
which seeks. If the bytes cannot be read or played either,
|
|
101
|
+
the tile says "Could not play video" and offers Retry, which asks the host
|
|
102
|
+
again. A video that was not captured keeps the tile's shape, says "Video not
|
|
103
|
+
captured" with its name and size, and is not a button; an image sent the
|
|
104
|
+
same way says "Image not captured". A video is never passed to
|
|
105
|
+
`imageAssetUrl`, never opens the image viewer and is not in its gallery.
|
|
106
|
+
While a video has focus the rail's arrow, Home and End keys are the
|
|
107
|
+
video's. `attachmentAssetUrl` is still asked for a video, as its identity.
|
|
81
108
|
- **`boost` is optional** because a grant never opens a write: only a host
|
|
82
109
|
holding the daemon's bearer offers it. Without it the index keeps its order.
|
|
83
110
|
- **`browsers()`** returns installed browser ids, names and icon URLs. HTML
|
|
@@ -248,6 +275,30 @@ The callbacks are called while the room renders, so a host keeps them cheap.
|
|
|
248
275
|
a checked row. The room's own search sheet keeps its native selects.
|
|
249
276
|
- **`repositoryUrl(projectId)`** — the address ②'s repository act opens.
|
|
250
277
|
Undefined: the room's own reading of `git_repo`; null: no act.
|
|
278
|
+
- **`waitMark`** → `RoomWaitMark` — the host's mark for the room's
|
|
279
|
+
waits: `mark(place, { resting })` draws it for a place (`"view"`,
|
|
280
|
+
`"column"`, `"card"`), at rest while the work it stands for is paused, and
|
|
281
|
+
`carried` says the host's own hold already stands where the room's first
|
|
282
|
+
one comes. With it:
|
|
283
|
+
- **the view's waits are one hold** — reaching the index, then the cold
|
|
284
|
+
start before its first project: the mark at the centre of the room's box,
|
|
285
|
+
one line 26 under it (`connectingTitle`, or the step's own title with the
|
|
286
|
+
ellipsis of work under way) and its count 4 under that ("1,333 files
|
|
287
|
+
checked"). It is late (nothing for 120ms), stands 800ms once it has shown,
|
|
288
|
+
fades over 280ms (120ms under reduced motion), and what comes next waits
|
|
289
|
+
for it; a new line crossfades in place. An index that has stopped
|
|
290
|
+
answering keeps the room's face: a failure is no wait.
|
|
291
|
+
- **the import card wears the mark** where IMPORTING HISTORY stood, the step
|
|
292
|
+
beside it; its words keep to the step's title and its count, a fraction
|
|
293
|
+
the step knows is a colourless 2px hairline (none for one it does not),
|
|
294
|
+
and the detail, the amount, the connection and the timer fold under Agent
|
|
295
|
+
details. Paused updates stand the mark at rest.
|
|
296
|
+
- **a conversation's wait is a hold in its column**, its sketch and sweep
|
|
297
|
+
gone; a load that failed keeps its own face and Try again.
|
|
298
|
+
- **nothing sweeps beside the mark**: a meter that knows no amount draws
|
|
299
|
+
nothing (a veil keeps its words), and one that knows still fills.
|
|
300
|
+
|
|
301
|
+
Absent: every wait is the room's own, as rosetta's app shows it.
|
|
251
302
|
|
|
252
303
|
## The reader (`TranscriptReader`)
|
|
253
304
|
|
package/dist/HistoryRoom.js
CHANGED
|
@@ -13,17 +13,18 @@ import { HostInputsProvider, hostInputsOf, useHostInputs } from "./host-inputs.j
|
|
|
13
13
|
import { tildePath } from "./lib/format.js";
|
|
14
14
|
import { MenuLayerProvider } from "./components/HostMenu.js";
|
|
15
15
|
import { RoomProvider, useRoom, useRoomOverlayOpen } from "./room-context.js";
|
|
16
|
-
import { ColdStartPanel } from "./components/ColdStart.js";
|
|
16
|
+
import { ColdStartPanel, coldStartHold } from "./components/ColdStart.js";
|
|
17
17
|
import { ProjectsColumn } from "./components/projects/index.js";
|
|
18
18
|
import { SearchLauncher, SearchSheet, emptyTranscriptPrompt, searchKeyLegend } from "./components/search/index.js";
|
|
19
19
|
import { ArtifactGlyph, ArtifactLibrary } from "./components/artifacts/ArtifactLibrary.js";
|
|
20
20
|
import { SessionsColumn } from "./components/sessions/index.js";
|
|
21
21
|
import { TranscriptColumn } from "./components/Transcript.js";
|
|
22
|
-
import { EmptyState, Meter } from "./components/ui/index.js";
|
|
22
|
+
import { EmptyState, Hold, Meter } from "./components/ui/index.js";
|
|
23
23
|
import { sessionFilePaths } from "./components/git/index.js";
|
|
24
24
|
import { useWorktreeGuest, WorktreeColumn } from "./components/worktree/index.js";
|
|
25
25
|
import { useDaemonStatus, useMeta, useProjectStats, useProjectUsage, useSearch, useTimeline, } from "./lib/hooks.js";
|
|
26
26
|
import { useIngestActivity } from "./lib/use-ingest-activity.js";
|
|
27
|
+
import { useStandingHold } from "./lib/use-standing-hold.js";
|
|
27
28
|
import { ConversationFold } from "./lib/conversation-readiness.js";
|
|
28
29
|
import { isAwaitingConsent, isIngestActive } from "./lib/ingest.js";
|
|
29
30
|
import { UNASSIGNED_PROJECT_ID, buildProjectViewModelFromSessions, getActivityGridStartTimestamp, indexSessionsByProject, projectKey, rootSessionsOfProject, sessionsOfProject, unassignedProject, } from "./lib/model.js";
|
|
@@ -102,7 +103,7 @@ export const HistoryRoom = forwardRef(function HistoryRoom(props, ref) {
|
|
|
102
103
|
});
|
|
103
104
|
function RoomBody({ handle, surface, search: searchOption, unavailable, unavailableTitle, connectingTitle, consent, emptyPrompt, onSelect, frameStyle, }) {
|
|
104
105
|
const { catalog, sessions, host, storage, tints } = useRoom();
|
|
105
|
-
const { projectTint: hostTint, sessionRow: hostSessionRow, projectActs: hostProjectActs, projectCard: hostProjectCard, sessionActs: hostSessionActs, folders: hostFoldersOf, } = useHostInputs();
|
|
106
|
+
const { projectTint: hostTint, sessionRow: hostSessionRow, projectActs: hostProjectActs, projectCard: hostProjectCard, sessionActs: hostSessionActs, folders: hostFoldersOf, waitMark, } = useHostInputs();
|
|
106
107
|
const overlayOpen = useRoomOverlayOpen();
|
|
107
108
|
// The room's root, where a host's menus are drawn over every column.
|
|
108
109
|
const [frameElement, setFrameElement] = useState(null);
|
|
@@ -487,11 +488,26 @@ function RoomBody({ handle, surface, search: searchOption, unavailable, unavaila
|
|
|
487
488
|
// meters move, but there is not yet a canonical project to render. Once
|
|
488
489
|
// RAM metadata arrives the ordinary room takes over progressively.
|
|
489
490
|
const coldStarting = projectRows.length === 0 && ingestActive && ingest !== null && !awaitingConsent;
|
|
490
|
-
|
|
491
|
+
// R10 — with the host's mark, the view's waits are ONE hold: reaching the
|
|
492
|
+
// index, then the cold start before its first project, in the room's own
|
|
493
|
+
// words. A failure is no wait (a closed feed works on nothing), so it keeps
|
|
494
|
+
// the room's face. The hold keeps its floor and its leave, and what comes
|
|
495
|
+
// next waits for it (`useStandingHold`).
|
|
496
|
+
const viewHold = waitMark === undefined ? null
|
|
497
|
+
: disconnected && !coldStarting
|
|
498
|
+
? metaStatus === "closed" ? null : {
|
|
499
|
+
face: "connecting",
|
|
500
|
+
words: { key: "connecting", line: connectingTitle, sub: connectionError ?? unavailable },
|
|
501
|
+
resting: false,
|
|
502
|
+
}
|
|
503
|
+
: coldStarting ? { face: "cold-start", ...coldStartHold(activity) }
|
|
504
|
+
: null;
|
|
505
|
+
const standingHold = useStandingHold(viewHold, waitMark?.carried === true);
|
|
506
|
+
return (_jsx("div", { className: "ah-frame is-tall", "data-ah-surface": surface, "data-ah-overlay": overlayOpen ? "" : undefined, style: frameStyle, ref: setFrameElement, children: _jsxs(MenuLayerProvider, { value: frameElement, children: [_jsxs("div", { className: "ah-room", ref: roomRef, children: [searchOption !== null && (_jsxs("div", { className: "ah-searchbar", children: [_jsx(SearchLauncher, { query: search.query, placeholder: launcherPlaceholder, shortcut: searchKey, onOpen: () => setSheetOpen(true), onClear: clearSearch }), catalog.artifacts && _jsxs("button", { ref: artifactLauncherRef, type: "button", className: "ah-artifacts-launcher", onClick: () => setArtifactsOpen(true), "aria-label": "Open artifacts", "aria-haspopup": "dialog", "aria-expanded": artifactsOpen, children: [_jsx(ArtifactGlyph, {}), "Artifacts"] }), searchOption.accessory] })), standingHold !== null ? null : disconnected && !coldStarting ? (_jsx(EmptyState, { style: { flex: 1 }, title: metaStatus === "closed" ? unavailableTitle : connectingTitle, description: connectionError ?? unavailable, "data-face": metaStatus === "closed" ? "not-answering" : "connecting", children: metaStatus !== "closed" && _jsx(Meter, { fraction: null }) })) : awaitingConsent ? (consent ?? (_jsx(EmptyState, { style: { flex: 1 }, title: "Waiting for consent", description: "The index has found agents on this machine and reads nothing until it is told which ones to read.", "data-face": "consent" }))) : coldStarting ? (_jsx(ColdStartPanel, { activity: activity })) : (_jsxs("div", { className: "ah-cols", "data-rail": worktree.visible ? "on" : "off", children: [_jsx(ProjectsColumn, { projects: projectViewModels, activityOrder: activityOrder, selectedProjectId: projectId, sort: sort, onSortChange: setSort, homeDirectory: home, currentTimestamp: nowMs, ingest: ingest, activity: activity, conversations: conversations, onProjectSelect: (id) => {
|
|
491
507
|
setProjectId(id);
|
|
492
508
|
setSessionId(null);
|
|
493
509
|
setInspectedThread(null);
|
|
494
|
-
} }), _jsx(SessionsColumn, { project: projectId ? (projectById.get(projectId) ?? null) : null, sessions: projectSessions, factsBySessionId: facts, getRuntimeKind: kindOf, selectedSessionId: sessionId, usage: usage, activityGridStartTimestamp: getActivityGridStartTimestamp(nowMs), currentTimestamp: nowMs, ingest: ingest, isWorktreeVisible: worktree.available && projectRoot !== null ? worktree.visible : null, onToggleWorktree: worktree.toggle, onSessionSelect: (selectedSession) => { setSessionId(selectedSession.id); setInspectedThread(null); }, parentIds: sessionParents, hostActs: projectId === null ? null : (hostProjectActs?.(projectId, { folder: shownFolderKey }) ?? null), hostCard: projectId === null || hostProjectCard === undefined ? null : hostProjectCard(projectId) }), _jsx(WorktreeColumn, { projectRoot: worktreeRoot, folders: folderMenu === null ? null : { menu: folderMenu, shown: shownFolder }, tint: projectId ? (projectById.get(projectId)?.tint ?? null) : null, homeDirectory: home, sessionPaths: sessionPaths, currentTimestamp: nowMs, onReceipt: showReceipt, requestError: worktree.error, onRetry: worktree.retry }), _jsx(TranscriptColumn, { session: session, duringBackfill: ingestActive, importCourse: importCourse(ingest, session?.runtime_id ?? null, activity?.feed.resumed === true), importAgent: session === null ? undefined : agentLabel(kindOf(session.runtime_id)), sessions: meta?.sessions ?? [], project: session ? (projectById.get(projectKey(session)) ?? null) : null, feed: feed, focus: focus, onFocusConsumed: () => setFocus(null), onReceipt: showReceipt, emptyPrompt: emptyPrompt === undefined ? emptyTranscriptPrompt(searchKey) : emptyPrompt, stepper: stepperState, onStepMatch: stepMatch, onDismissStepper: () => setStepper(null), getRuntimeKind: kindOf, homeDirectory: home, onOpenThread: openThread, onBackToParent: session?.parent_session_id == null ? null : () => openThread(session.parent_session_id), headActs: session === null ? null : (hostSessionActs?.(session) ?? null) })] }))] }), searchOption !== null && _jsx(SearchSheet, { open: sheetOpen, onClose: () => setSheetOpen(false), query: query, onQuery: setQuery, filters: filters, onFilters: setFilters, feed: search, results: searchResults, readiness: readiness, progress: searchProgress, canonicalReady: canonicalReady, ingestPaused: ingest?.phase === "metadata_ready" || ingest?.run?.state === "paused" || ingest?.run?.state === "failed", duringBackfill: ingestActive, agentKinds: kinds, currentProject: projectId !== null && projectId !== UNASSIGNED_PROJECT_ID
|
|
510
|
+
} }), _jsx(SessionsColumn, { project: projectId ? (projectById.get(projectId) ?? null) : null, sessions: projectSessions, factsBySessionId: facts, getRuntimeKind: kindOf, selectedSessionId: sessionId, usage: usage, activityGridStartTimestamp: getActivityGridStartTimestamp(nowMs), currentTimestamp: nowMs, ingest: ingest, isWorktreeVisible: worktree.available && projectRoot !== null ? worktree.visible : null, onToggleWorktree: worktree.toggle, onSessionSelect: (selectedSession) => { setSessionId(selectedSession.id); setInspectedThread(null); }, parentIds: sessionParents, hostActs: projectId === null ? null : (hostProjectActs?.(projectId, { folder: shownFolderKey }) ?? null), hostCard: projectId === null || hostProjectCard === undefined ? null : hostProjectCard(projectId) }), _jsx(WorktreeColumn, { projectRoot: worktreeRoot, folders: folderMenu === null ? null : { menu: folderMenu, shown: shownFolder }, tint: projectId ? (projectById.get(projectId)?.tint ?? null) : null, homeDirectory: home, sessionPaths: sessionPaths, currentTimestamp: nowMs, onReceipt: showReceipt, requestError: worktree.error, onRetry: worktree.retry }), _jsx(TranscriptColumn, { session: session, duringBackfill: ingestActive, importCourse: importCourse(ingest, session?.runtime_id ?? null, activity?.feed.resumed === true), importAgent: session === null ? undefined : agentLabel(kindOf(session.runtime_id)), sessions: meta?.sessions ?? [], project: session ? (projectById.get(projectKey(session)) ?? null) : null, feed: feed, focus: focus, onFocusConsumed: () => setFocus(null), onReceipt: showReceipt, emptyPrompt: emptyPrompt === undefined ? emptyTranscriptPrompt(searchKey) : emptyPrompt, stepper: stepperState, onStepMatch: stepMatch, onDismissStepper: () => setStepper(null), getRuntimeKind: kindOf, homeDirectory: home, onOpenThread: openThread, onBackToParent: session?.parent_session_id == null ? null : () => openThread(session.parent_session_id), headActs: session === null ? null : (hostSessionActs?.(session) ?? null) })] })), standingHold !== null && (_jsx(Hold, { place: "view", face: standingHold.hold.face, words: standingHold.hold.words, resting: standingHold.hold.resting, carried: standingHold.carried, leaving: standingHold.leaving }))] }), searchOption !== null && _jsx(SearchSheet, { open: sheetOpen, onClose: () => setSheetOpen(false), query: query, onQuery: setQuery, filters: filters, onFilters: setFilters, feed: search, results: searchResults, readiness: readiness, progress: searchProgress, canonicalReady: canonicalReady, ingestPaused: ingest?.phase === "metadata_ready" || ingest?.run?.state === "paused" || ingest?.run?.state === "failed", duringBackfill: ingestActive, agentKinds: kinds, currentProject: projectId !== null && projectId !== UNASSIGNED_PROJECT_ID
|
|
495
511
|
? (projectById.get(projectId) ?? null)
|
|
496
512
|
: null, homeDirectory: home, nowMs: nowMs, getRuntimeKind: kindOf, onOpenHit: openHit, titles: titleMatches, onOpenSession: openSession }), receipt !== null && _jsx("div", { className: "ah-receipt", children: receipt }), catalog.artifacts && _jsx(ArtifactLibrary, { open: artifactsOpen, onClose: () => setArtifactsOpen(false), returnFocus: () => artifactLauncherRef.current?.focus(), agents: kinds, projects: meta?.projects ?? [], canonicalReady: canonicalReady === true, onOpenSession: (sessionId, timelineId) => setPendingOpen({ sessionId, timelineId }) })] }) }));
|
|
497
513
|
}
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import type { IngestActivity } from "../lib/ingest-activity.js";
|
|
2
|
+
import type { HoldWords } from "./ui/Hold.js";
|
|
2
3
|
export declare function ColdStartPanel({ activity }: {
|
|
3
4
|
readonly activity: IngestActivity | null;
|
|
4
5
|
}): import("react").JSX.Element;
|
|
6
|
+
/**
|
|
7
|
+
* The cold start as a hold (R10): before the first project the room's own
|
|
8
|
+
* words for the step stand under the host's mark — the step's title, with the
|
|
9
|
+
* ellipsis of work under way, over its amount ("Discovering conversations…"
|
|
10
|
+
* over "1,333 files checked"; "History import paused" over "80 sessions
|
|
11
|
+
* found"). The first step's title stands alone: its amount ("Looking for
|
|
12
|
+
* conversations…") counts nothing and says the same wait again. Paused updates
|
|
13
|
+
* say the card's words, the mark at rest; a paused import its own title, at
|
|
14
|
+
* rest too.
|
|
15
|
+
*/
|
|
16
|
+
export declare function coldStartHold(activity: IngestActivity | null): {
|
|
17
|
+
readonly words: HoldWords;
|
|
18
|
+
readonly resting: boolean;
|
|
19
|
+
};
|
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { PAUSED_UPDATES } from "../lib/ingest-activity.js";
|
|
2
3
|
import { IngestStatus } from "./IngestStatus.js";
|
|
3
4
|
export function ColdStartPanel({ activity }) {
|
|
4
5
|
return (_jsxs("div", { className: "ah-empty ah-cold-start", "data-face": "cold-start", children: [_jsx("strong", { children: "Bringing your history together" }), _jsx("p", { children: "Your projects will appear here as we discover your conversations." }), _jsx(IngestStatus, { activity: activity })] }));
|
|
5
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* The cold start as a hold (R10): before the first project the room's own
|
|
9
|
+
* words for the step stand under the host's mark — the step's title, with the
|
|
10
|
+
* ellipsis of work under way, over its amount ("Discovering conversations…"
|
|
11
|
+
* over "1,333 files checked"; "History import paused" over "80 sessions
|
|
12
|
+
* found"). The first step's title stands alone: its amount ("Looking for
|
|
13
|
+
* conversations…") counts nothing and says the same wait again. Paused updates
|
|
14
|
+
* say the card's words, the mark at rest; a paused import its own title, at
|
|
15
|
+
* rest too.
|
|
16
|
+
*/
|
|
17
|
+
export function coldStartHold(activity) {
|
|
18
|
+
if (activity === null)
|
|
19
|
+
return { words: { key: "discovering", line: "Finding your history…" }, resting: false };
|
|
20
|
+
const { phase, feed } = activity;
|
|
21
|
+
if (feed.connectionError !== null) {
|
|
22
|
+
return { words: { key: "paused-updates", line: PAUSED_UPDATES.title, sub: PAUSED_UPDATES.detail }, resting: true };
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
words: {
|
|
26
|
+
key: phase.key,
|
|
27
|
+
line: phase.active ? `${phase.title}…` : phase.title,
|
|
28
|
+
sub: phase.key === "discovering" ? null : phase.amount,
|
|
29
|
+
},
|
|
30
|
+
resting: !phase.active,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useId, useLayoutEffect, useRef } from "react";
|
|
3
|
+
import { useHostInputs } from "../host-inputs.js";
|
|
3
4
|
import { AgentMark, agentLabel } from "../lib/agents.js";
|
|
4
|
-
import { phaseHeading, readyConversations, runtimeActivity } from "../lib/ingest-activity.js";
|
|
5
|
+
import { PAUSED_UPDATES, phaseHeading, readableText, readyConversations, runtimeActivity, } from "../lib/ingest-activity.js";
|
|
5
6
|
import { IngestionControls } from "./IngestionControls.js";
|
|
6
7
|
function ProgressMeter({ value, label, paused = false }) {
|
|
7
8
|
return _jsx("div", { className: "ah-ingest-meter", role: "progressbar", "aria-label": label, "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": value === null ? undefined : Math.floor(value * 100), "data-indeterminate": value === null ? "" : undefined, "data-paused": paused ? "" : undefined, children: _jsx("i", { style: value === null ? undefined : { width: `${value * 100}%` } }) });
|
|
8
9
|
}
|
|
9
10
|
export function IngestStatus({ activity }) {
|
|
10
11
|
const titleId = useId();
|
|
12
|
+
const { waitMark } = useHostInputs();
|
|
11
13
|
if (!activity)
|
|
12
14
|
return null;
|
|
13
15
|
const { phase, feed, footer, elapsed } = activity;
|
|
@@ -19,13 +21,48 @@ export function IngestStatus({ activity }) {
|
|
|
19
21
|
// The end collapses in place to one line, which the column then folds away.
|
|
20
22
|
if (ready && !interrupted)
|
|
21
23
|
return (_jsxs("section", { className: "ah-ingest-status", "aria-labelledby": titleId, "data-state": "complete", "data-compact": "", "data-ready-count": count.readable, "data-ready-total": count.total, children: [_jsx("span", { className: "ah-visually-hidden", "aria-live": "polite", "aria-atomic": "true", children: phase.title }), _jsxs("h3", { id: titleId, children: [phase.title, " ", _jsx("span", { "aria-hidden": "true", children: "\u2713" })] })] }));
|
|
24
|
+
if (waitMark !== undefined)
|
|
25
|
+
return _jsx(MarkedIngestStatus, { activity: activity, waitMark: waitMark, titleId: titleId });
|
|
22
26
|
return (
|
|
23
27
|
// `data-ready-count` / `data-ready-total` are the readable conversations
|
|
24
28
|
// and their total, carried (inert) even where the copy leaves them out.
|
|
25
|
-
_jsxs("section", { className: "ah-ingest-status", "aria-labelledby": titleId, "data-state": interrupted ? "disconnected" : ready ? "complete" : phase.key, "data-ready-count": count.readable, "data-ready-total": count.total, children: [_jsxs("div", { className: "ah-ingest-status__eyebrow", children: [_jsx("span", { children: ready ? "ALL SET" : "IMPORTING HISTORY" }), _jsx("span", { children: ready ? "✓" : `Step ${phase.step} of 4` })] }), _jsx(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
_jsxs("section", { className: "ah-ingest-status", "aria-labelledby": titleId, "data-state": interrupted ? "disconnected" : ready ? "complete" : phase.key, "data-ready-count": count.readable, "data-ready-total": count.total, children: [_jsxs("div", { className: "ah-ingest-status__eyebrow", children: [_jsx("span", { children: ready ? "ALL SET" : "IMPORTING HISTORY" }), _jsx("span", { children: ready ? "✓" : `Step ${phase.step} of 4` })] }), _jsx(StatusLive, { phase: phase, interrupted: interrupted }), _jsxs("h3", { id: titleId, children: [interrupted ? PAUSED_UPDATES.title : phase.title, !interrupted && phase.count ? _jsx("span", { className: "ah-ingest-status__count", children: phase.count }) : null] }), _jsx("p", { className: "ah-ingest-status__detail", children: interrupted ? PAUSED_UPDATES.detail : phase.detail }), _jsxs("div", { className: "ah-ingest-status__amount", children: [_jsx("span", { children: phase.amount }), phase.fraction !== null && !ready && _jsxs("b", { children: [Math.floor(phase.fraction * 100), "%"] })] }), _jsx(ProgressMeter, { value: phase.fraction, label: phaseHeading(phase), paused: paused }, phase.key), horizon && _jsx("p", { className: "ah-ingest-status__horizon", "aria-hidden": "true", children: horizon.line }), _jsx(StatusFooter, { feed: feed, footer: footer, elapsed: elapsed }), _jsx(IngestionControls, { run: feed.ingest?.run }), phase.step < 4 && (feed.ingest?.runtimes.length ?? 0) > 0 && _jsxs("details", { className: "ah-ingest-status__agents", children: [_jsxs("summary", { children: ["Agent details ", _jsx("span", { "aria-hidden": "true", children: "\u2304" })] }), _jsx(AgentList, { feed: feed, paused: paused })] })] }));
|
|
30
|
+
}
|
|
31
|
+
/** The counts move with every tree the import opens: drawn, never announced.
|
|
32
|
+
* The live regions say the step and each recency span reached, nothing else. */
|
|
33
|
+
function StatusLive({ phase, interrupted }) {
|
|
34
|
+
return _jsxs(_Fragment, { children: [_jsx("span", { className: "ah-visually-hidden", "aria-live": "polite", "aria-atomic": "true", children: interrupted ? PAUSED_UPDATES.title : phase.spoken ?? phase.title }), _jsx("span", { className: "ah-visually-hidden", "aria-live": "polite", "aria-atomic": "true", children: phase.horizon?.reached ?? "" })] });
|
|
35
|
+
}
|
|
36
|
+
/** The connection and the timer. */
|
|
37
|
+
function StatusFooter({ feed, footer, elapsed }) {
|
|
38
|
+
return _jsxs("div", { className: "ah-ingest-status__footer", children: [_jsx("span", { title: feed.connectionError ?? (footer.includes("No new") ? "The service is connected; its work counters have not changed." : undefined), children: footer }), _jsx("span", { children: elapsed })] });
|
|
39
|
+
}
|
|
40
|
+
/** Each agent's own step, under Agent details. */
|
|
41
|
+
function AgentList({ feed, paused }) {
|
|
42
|
+
return _jsx("ul", { children: feed.ingest?.runtimes.map((runtime) => {
|
|
43
|
+
const status = runtimeActivity(runtime, feed.ingest?.phase === "restoring");
|
|
44
|
+
return _jsxs("li", { children: [_jsx(AgentMark, { kind: runtime.kind }), _jsxs("div", { children: [_jsxs("div", { className: "ah-ingest-status__agent-name", children: [_jsx("strong", { children: agentLabel(runtime.kind) }), runtime.state === "done" && _jsx("span", { "aria-label": "Ready to browse", children: "\u2713" })] }), _jsx("span", { className: "ah-ingest-status__agent-caption", children: status.label }), runtime.state !== "done" && _jsx(ProgressMeter, { value: status.fraction, label: `${agentLabel(runtime.kind)}: ${status.label}`, paused: paused || runtime.state === "queued" })] })] }, runtime.kind);
|
|
45
|
+
}) });
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The card in the host's mark (R10): it keeps its place at the head of the
|
|
49
|
+
* first column and wears the mark where IMPORTING HISTORY stood, the step
|
|
50
|
+
* beside it. Its words keep to the step's title and its count; a fraction the
|
|
51
|
+
* step knows is a colourless hairline, and a step that knows none draws no
|
|
52
|
+
* bar, the mark being the sign of working. The detail, the amount, the
|
|
53
|
+
* recency line, the connection and the timer fold under Agent details, which
|
|
54
|
+
* stand through search as well. Paused updates stand the mark at rest.
|
|
55
|
+
*/
|
|
56
|
+
function MarkedIngestStatus({ activity, waitMark, titleId }) {
|
|
57
|
+
const { phase, feed, footer, elapsed } = activity;
|
|
58
|
+
const interrupted = feed.connectionError !== null;
|
|
59
|
+
const paused = interrupted || !phase.active;
|
|
60
|
+
const count = readyConversations(feed);
|
|
61
|
+
const horizon = interrupted ? null : phase.horizon ?? null;
|
|
62
|
+
const runtimes = phase.step < 4 ? (feed.ingest?.runtimes.length ?? 0) : 0;
|
|
63
|
+
const sub = interrupted ? PAUSED_UPDATES.detail
|
|
64
|
+
: phase.count ? readableText(count) : phase.amount;
|
|
65
|
+
return (_jsxs("section", { className: "ah-ingest-status", "aria-labelledby": titleId, "data-marked": "", "data-state": interrupted ? "disconnected" : phase.key, "data-ready-count": count.readable, "data-ready-total": count.total, children: [_jsxs("div", { className: "ah-ingest-status__eyebrow", children: [_jsx("span", { className: "ah-ingest-status__mark", children: waitMark.mark("card", { resting: paused }) }), _jsx("span", { children: `Step ${phase.step} of 4` })] }), _jsx(StatusLive, { phase: phase, interrupted: interrupted }), _jsx("h3", { id: titleId, children: interrupted ? PAUSED_UPDATES.title : phase.title }), _jsx("p", { className: "ah-ingest-status__sub", children: sub }), phase.fraction !== null && (_jsx(ProgressMeter, { value: phase.fraction, label: phaseHeading(phase), paused: paused }, phase.key)), _jsxs("details", { className: "ah-ingest-status__agents", children: [_jsxs("summary", { children: ["Agent details ", _jsx("span", { "aria-hidden": "true", children: "\u2304" })] }), !interrupted && _jsx("p", { className: "ah-ingest-status__detail", children: phase.detail }), _jsxs("div", { className: "ah-ingest-status__amount", children: [_jsx("span", { children: phase.amount }), phase.fraction !== null && _jsxs("b", { children: [Math.floor(phase.fraction * 100), "%"] })] }), horizon && _jsx("p", { className: "ah-ingest-status__horizon", "aria-hidden": "true", children: horizon.line }), _jsx(StatusFooter, { feed: feed, footer: footer, elapsed: elapsed }), _jsx(IngestionControls, { run: feed.ingest?.run }), runtimes > 0 && _jsx(AgentList, { feed: feed, paused: paused })] })] }));
|
|
29
66
|
}
|
|
30
67
|
/**
|
|
31
68
|
* The card's place in the projects column, whose height follows the card's
|
|
@@ -26,8 +26,10 @@ import { DayMenu, markStuckPills } from "./transcript/DayPill.js";
|
|
|
26
26
|
import { TranscriptDocument } from "./transcript/Document.js";
|
|
27
27
|
import { TranscriptLoading } from "./transcript/TranscriptLoading.js";
|
|
28
28
|
import { useTranscriptModel } from "./transcript/document-model.js";
|
|
29
|
+
import { useViewerDay } from "./transcript/viewer-day.js";
|
|
29
30
|
import { useFoldPreference } from "./transcript/fold-preference.js";
|
|
30
31
|
import { MessageViewerContext } from "./transcript/MessagePreview.js";
|
|
32
|
+
import { PromptJump } from "./transcript/PromptJump.js";
|
|
31
33
|
import { ThreadNavigationContext } from "./transcript/thread-navigation.js";
|
|
32
34
|
import { handleForMessage, messageFileSource } from "./transcript/message-file-source.js";
|
|
33
35
|
import { attachmentStatus } from "./transcript/Attachments.js";
|
|
@@ -84,7 +86,9 @@ function SessionTranscript({ session, duringBackfill, importCourse, importAgent,
|
|
|
84
86
|
const targetTimelineId = requestedTimelineId ?? metaFocus?.timelineId ?? null;
|
|
85
87
|
const targetIsMeta = requestedTimelineId === null && metaFocus !== null;
|
|
86
88
|
const cuts = useMemo(() => activityCuts(feed.rows, feed.watermark), [feed.rows, feed.watermark]);
|
|
87
|
-
|
|
89
|
+
// The viewer's day, re-read at midnight and on focus: a pill's words are the drawing's.
|
|
90
|
+
const viewerDay = useViewerDay();
|
|
91
|
+
const model = useTranscriptModel(feed.rows, session, homeDirectory, viewerDay.now, { cutBefore: cuts.cutBefore });
|
|
88
92
|
const opening = useTranscriptOpening(feed.snapshotReady, focus !== null || metaFocus !== null);
|
|
89
93
|
const loading = session !== null && opening.visible;
|
|
90
94
|
useEffect(() => {
|
|
@@ -363,7 +367,9 @@ function SessionTranscript({ session, duringBackfill, importCourse, importAgent,
|
|
|
363
367
|
// button fades, instead of leaving focus on an inert control.
|
|
364
368
|
scrollRef.current?.focus({ preventScroll: true });
|
|
365
369
|
tail.latest();
|
|
366
|
-
}, children: [_jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M8 3v10m-4-4 4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("span", { children: tail.unseen > 0 ? `${tail.unseen} new ${tail.unseen === 1 ? "message" : "messages"}` : "Latest" }), tail.unseen > 0 && _jsx("i", { "aria-hidden": "true" })] })),
|
|
370
|
+
}, children: [_jsx("svg", { width: "14", height: "14", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M8 3v10m-4-4 4 4 4-4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) }), _jsx("span", { children: tail.unseen > 0 ? `${tail.unseen} new ${tail.unseen === 1 ? "message" : "messages"}` : "Latest" }), tail.unseen > 0 && _jsx("i", { "aria-hidden": "true" })] })), session !== null && (
|
|
371
|
+
// A button at the side goes to the message before.
|
|
372
|
+
_jsx(PromptJump, { scrollRef: scrollRef, earlier: feed.earlier.kind, layoutKey: model.plan, onLeaveTail: tail.pause, hidden: loading })), !reader && _jsx("span", { className: "ah-tail-announcement", role: "status", "aria-live": "polite", "aria-atomic": "true", children: tail.away && tail.unseen > 0
|
|
367
373
|
? `${tail.unseen} new ${tail.unseen === 1 ? "message" : "messages"}. Scroll to latest to read.`
|
|
368
374
|
: "" }), !reader && _jsx(FileViewerDialog, { renderMarkdown: viewerTarget?.message === undefined ? undefined : (text) => _jsx(AuthoredMessage, { text: text, messageKey: viewerTarget.message.key, role: viewerTarget.message.role, preview: false, attachments: viewerTarget.message.attachments ?? [], onOpenAttachment: openAttachment, onReceipt: onReceipt }), handle: viewerTarget?.handle ?? null, source: viewerTarget?.source ?? attachments.fileSource, tint: project?.tint ?? null, homeDirectory: homeDirectory, onClose: () => {
|
|
369
375
|
viewerRequest.current += 1;
|
|
@@ -10,6 +10,8 @@ export declare function useAttachmentActions(onOpenAttachment: AttachmentOpener,
|
|
|
10
10
|
request: number;
|
|
11
11
|
} | null;
|
|
12
12
|
};
|
|
13
|
+
/** Why an attachment has no picture here, in the words of its kind. Every
|
|
14
|
+
* kind answers something: a kind this rail does not draw is never blank. */
|
|
13
15
|
export declare function attachmentStatus(fact: AttachmentFact): string;
|
|
14
16
|
export declare function Attachments({ facts, onOpenAttachment, reveal }: {
|
|
15
17
|
readonly facts: readonly AttachmentFact[];
|
|
@@ -3,6 +3,7 @@ import { createContext, useId, useLayoutEffect, useRef, useState } from "react";
|
|
|
3
3
|
import { fmtBytes } from "../../lib/format.js";
|
|
4
4
|
import { useAttachmentReader } from "./attachment-file-source.js";
|
|
5
5
|
import { useImageUrl, useImageVisibility } from "../file-viewer/image-resource.js";
|
|
6
|
+
import { VideoTile, videoStatus } from "./VideoTile.js";
|
|
6
7
|
import "../../styles/attachments.css";
|
|
7
8
|
/** Explicitly shared only by messages whose images are gathered in this run. */
|
|
8
9
|
export const ActivityImagesContext = createContext(null);
|
|
@@ -19,17 +20,29 @@ export function useAttachmentActions(onOpenAttachment, onReceipt, facts) {
|
|
|
19
20
|
};
|
|
20
21
|
return { open, reveal };
|
|
21
22
|
}
|
|
23
|
+
/** Why an attachment has no picture here, in the words of its kind. Every
|
|
24
|
+
* kind answers something: a kind this rail does not draw is never blank. */
|
|
22
25
|
export function attachmentStatus(fact) {
|
|
23
26
|
const source = fact.ref?.source;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
switch (fact.kind) {
|
|
28
|
+
case "image":
|
|
29
|
+
// Sent by path and not captured: the record names a file, not bytes.
|
|
30
|
+
if (source?.type === "reference")
|
|
31
|
+
return "Image not captured";
|
|
32
|
+
if (source?.type === "unavailable") {
|
|
33
|
+
switch (source.reason) {
|
|
34
|
+
case "omitted": return "Image omitted from the recording";
|
|
35
|
+
case "invalid_data": return "Recorded image data is invalid";
|
|
36
|
+
case "unsupported_media": return "Image format is not supported";
|
|
37
|
+
case "not_recorded": return "Image data was not recorded";
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return "Image data was not recorded";
|
|
41
|
+
case "video":
|
|
42
|
+
return videoStatus(fact);
|
|
43
|
+
default:
|
|
44
|
+
return "Attachment preview unavailable";
|
|
31
45
|
}
|
|
32
|
-
return "Image data was not recorded";
|
|
33
46
|
}
|
|
34
47
|
function Tile({ fact, index, onOpen }) {
|
|
35
48
|
const [failedUrl, setFailedUrl] = useState(null);
|
|
@@ -59,7 +72,7 @@ function Tile({ fact, index, onOpen }) {
|
|
|
59
72
|
}, [attempt, failed]);
|
|
60
73
|
const label = fact.ref?.label ?? `${fact.kind === "image" ? "Image" : "Attachment"} ${index + 1}`;
|
|
61
74
|
const details = [label, fact.name, fact.caption, fact.byteLen === null ? null : fmtBytes(fact.byteLen)].filter(Boolean).join(" · ");
|
|
62
|
-
return _jsx("figure", { ref: figureRef, "data-attachment-id": fact.key, title: details, children: resource === null || failed ? (_jsxs("div", { className: "tr-att__tile tr-att__tile--missing", tabIndex: -1, "aria-label": details, children: [_jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.3", "aria-hidden": "true", children: [_jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "4" }), _jsx("circle", { cx: "8", cy: "8", r: "1.5" }), _jsx("path", { d: "m3 17 5-5 4 4 3-3 6 6" })] }), _jsx("span", { children: failed ? "Could not load image" :
|
|
75
|
+
return _jsx("figure", { ref: figureRef, "data-attachment-id": fact.key, title: details, children: resource === null || failed ? (_jsxs("div", { className: "tr-att__tile tr-att__tile--missing", tabIndex: -1, "aria-label": details, children: [_jsxs("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.3", "aria-hidden": "true", children: [_jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "4" }), _jsx("circle", { cx: "8", cy: "8", r: "1.5" }), _jsx("path", { d: "m3 17 5-5 4 4 3-3 6 6" })] }), _jsx("span", { children: failed ? "Could not load image" : attachmentStatus(fact) }), failed && _jsx("button", { type: "button", ref: retryRef, className: "tr-att__retry", onClick: () => {
|
|
63
76
|
restoreFocus.current = true;
|
|
64
77
|
setAttempt(value => value + 1);
|
|
65
78
|
setFailedUrl(null);
|
|
@@ -125,11 +138,15 @@ export function Attachments({ facts, onOpenAttachment, reveal }) {
|
|
|
125
138
|
return null;
|
|
126
139
|
const page = (direction) => gallery.current?.scrollBy({ left: direction * gallery.current.clientWidth * 0.8,
|
|
127
140
|
behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches ? "instant" : "smooth" });
|
|
141
|
+
const seen = { image: 0, video: 0 };
|
|
128
142
|
return _jsxs("div", { className: "tr-attachments", role: "group", "aria-label": `${facts.length} ${facts.length === 1 ? "attachment" : "attachments"}`, children: [_jsx("div", { className: "tr-att", id: id, ref: gallery, onFocusCapture: event => {
|
|
129
143
|
const tile = event.target.closest(".tr-att__tile");
|
|
130
144
|
if (tile && gallery.current)
|
|
131
145
|
revealTile(gallery.current, tile);
|
|
132
146
|
}, onKeyDown: event => {
|
|
147
|
+
// A playing video keeps its own keys: arrows seek, Home and End jump.
|
|
148
|
+
if (event.target instanceof Element && event.target.closest("video") !== null)
|
|
149
|
+
return;
|
|
133
150
|
if (!["ArrowLeft", "ArrowRight", "Home", "End"].includes(event.key) || !gallery.current)
|
|
134
151
|
return;
|
|
135
152
|
const tiles = [...gallery.current.querySelectorAll(".tr-att__tile")];
|
|
@@ -139,5 +156,13 @@ export function Attachments({ facts, onOpenAttachment, reveal }) {
|
|
|
139
156
|
event.preventDefault();
|
|
140
157
|
const next = event.key === "Home" ? 0 : event.key === "End" ? tiles.length - 1 : Math.max(0, Math.min(tiles.length - 1, index + (event.key === "ArrowRight" ? 1 : -1)));
|
|
141
158
|
tiles[next]?.focus({ preventScroll: true });
|
|
142
|
-
}, children: facts.map((fact, index) =>
|
|
159
|
+
}, children: facts.map((fact, index) => {
|
|
160
|
+
const key = `${fact.key}:${attachments.assetUrl(fact) ?? "reference"}`;
|
|
161
|
+
// An unlabelled tile is numbered among its own kind, as the gallery
|
|
162
|
+
// numbers the row's images: "Image 1" names one picture in both.
|
|
163
|
+
const ordinal = fact.kind === "image" ? seen.image++ : fact.kind === "video" ? seen.video++ : index;
|
|
164
|
+
// A video plays in place: it has no open action and no image path.
|
|
165
|
+
return fact.kind === "video" ? _jsx(VideoTile, { fact: fact, index: ordinal }, key)
|
|
166
|
+
: _jsx(Tile, { fact: fact, index: ordinal, onOpen: selected => onOpenAttachment(selected, facts) }, key);
|
|
167
|
+
}) }), (edges.before || edges.after) && _jsx("button", { className: "tr-att__nav tr-att__nav--previous", type: "button", "aria-label": "Previous images", "aria-disabled": !edges.before, "data-edge": !edges.before || undefined, "aria-controls": id, onClick: () => page(-1), children: "\u2039" }), (edges.before || edges.after) && _jsx("button", { className: "tr-att__nav tr-att__nav--next", type: "button", "aria-label": "Next images", "aria-disabled": !edges.after, "data-edge": !edges.after || undefined, "aria-controls": id, onClick: () => page(1), children: "\u203A" })] });
|
|
143
168
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useContext } from "react";
|
|
3
|
+
import { isRailMedia } from "../../lib/transcript/images.js";
|
|
3
4
|
import { ActivityImagesContext, Attachments, useAttachmentActions } from "./Attachments.js";
|
|
4
5
|
import { MessagePreview } from "./MessagePreview.js";
|
|
5
6
|
import { Prose } from "./Prose.js";
|
|
@@ -13,5 +14,5 @@ export function AuthoredMessage({ text, recordedText, attachments, messageKey, r
|
|
|
13
14
|
const content = (text !== null || recordedText?.type === "member") ? (preview
|
|
14
15
|
? _jsx(MessagePreview, { ...prose, messageKey: messageKey, role: role, recordedText: recordedText, title: title, matched: matched })
|
|
15
16
|
: _jsx(Prose, { ...prose })) : null;
|
|
16
|
-
return _jsxs(_Fragment, { children: [renderText ? renderText(content) : content, _jsx(Attachments, { facts: shared ? attachments.filter(fact => fact
|
|
17
|
+
return _jsxs(_Fragment, { children: [renderText ? renderText(content) : content, _jsx(Attachments, { facts: shared ? attachments.filter(fact => !isRailMedia(fact)) : attachments, onOpenAttachment: open, reveal: actions.reveal })] });
|
|
17
18
|
}
|
|
@@ -5,10 +5,14 @@ export interface PillText {
|
|
|
5
5
|
readonly after: string | null;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* A pill with a clock — the reader came back after a pause — leads with that
|
|
9
|
+
* clock by how far back its day is (`20:21` today,
|
|
10
|
+
* `Fri · 20:21` on one of the six days before, `Fri 6 Nov · 20:21` earlier),
|
|
11
|
+
* then `after 3h 37m`; where the day turned and inside a day alike. A pill
|
|
12
|
+
* with no clock — the day turned with no pause — keeps its day alone: `Today`,
|
|
13
|
+
* `Yesterday`, `Mon 31 Aug`. Null when the sitting is neither — a session that
|
|
14
|
+
* lives on one day with no pause draws no pill at all, because the column
|
|
15
|
+
* head's range already says when it was.
|
|
12
16
|
*/
|
|
13
17
|
export declare function pillText(sitting: SittingModel): PillText | null;
|
|
14
18
|
export interface DayPillProps {
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { duration } from "../../lib/format.js";
|
|
4
4
|
import { useReaderMode } from "./reader-context.js";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* A pill with a clock — the reader came back after a pause — leads with that
|
|
7
|
+
* clock by how far back its day is (`20:21` today,
|
|
8
|
+
* `Fri · 20:21` on one of the six days before, `Fri 6 Nov · 20:21` earlier),
|
|
9
|
+
* then `after 3h 37m`; where the day turned and inside a day alike. A pill
|
|
10
|
+
* with no clock — the day turned with no pause — keeps its day alone: `Today`,
|
|
11
|
+
* `Yesterday`, `Mon 31 Aug`. Null when the sitting is neither — a session that
|
|
12
|
+
* lives on one day with no pause draws no pill at all, because the column
|
|
13
|
+
* head's range already says when it was.
|
|
10
14
|
*/
|
|
11
15
|
export function pillText(sitting) {
|
|
12
16
|
const after = sitting.pauseMs === null ? null : `after ${duration(0, sitting.pauseMs)}`;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (sitting.dayChanged &&
|
|
16
|
-
return { lead:
|
|
17
|
-
}
|
|
18
|
-
if (resumed !== null)
|
|
19
|
-
return { lead: resumed, after };
|
|
17
|
+
if (sitting.clockLabel !== null)
|
|
18
|
+
return { lead: sitting.clockLabel, after };
|
|
19
|
+
if (sitting.dayChanged && sitting.dayLabel !== null)
|
|
20
|
+
return { lead: sitting.dayLabel, after };
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
22
23
|
export function DayPill({ sitting, onPress }) {
|
|
@@ -18,6 +18,7 @@ import { useRoom } from "../../room-context.js";
|
|
|
18
18
|
import { lastActive } from "../../lib/format.js";
|
|
19
19
|
import { sessionLastActive } from "../../lib/session-activity.js";
|
|
20
20
|
import { withinHistoryWindow } from "../../lib/transcript/history-window.js";
|
|
21
|
+
import { useViewerDay } from "./viewer-day.js";
|
|
21
22
|
import { EmptyState, Meter } from "../ui/index.js";
|
|
22
23
|
import { Anchor } from "./Anchor.js";
|
|
23
24
|
import { DayPill, Sitting } from "./DayPill.js";
|
|
@@ -90,7 +91,9 @@ function staticTimelineFeed(rows) {
|
|
|
90
91
|
function ReportWorkDocument({ session, rows, name, color, runtime, startedAt, endedAt, index, onReceipt, onOpenAttachment, onOpenPath, getRuntimeKind, homeDirectory, }) {
|
|
91
92
|
const boundedSession = useMemo(() => ({ ...session, stream_state: "indexed" }), [session]);
|
|
92
93
|
const feed = useMemo(() => staticTimelineFeed(rows), [rows]);
|
|
93
|
-
|
|
94
|
+
// A pill's words are the drawing's: the model is re-derived when the viewer's day turns.
|
|
95
|
+
const viewerDay = useViewerDay();
|
|
96
|
+
const model = useMemo(() => transcriptModel(rows, boundedSession, homeDirectory, viewerDay.now), [rows, boundedSession, homeDirectory, viewerDay.now]);
|
|
94
97
|
const scopedIndex = useMemo(() => {
|
|
95
98
|
const linked = new Set(rows.flatMap((row) => linkedChildSessionIds(row)));
|
|
96
99
|
const childrenByParent = new Map(index.childrenByParent);
|
|
@@ -119,10 +122,12 @@ export function TranscriptDocument({ session, model: baseModel, feed, duringBack
|
|
|
119
122
|
const chronology = useMemo(() => teamChronology(feed.rows, teamFeed.rowsBySession, { hasEarlier, ready: feed.snapshotReady }), [feed.rows, teamFeed.rowsBySession, hasEarlier, feed.snapshotReady]);
|
|
120
123
|
const displayedRows = chronology.rows;
|
|
121
124
|
const cuts = useMemo(() => activityCuts(feed.rows, feed.watermark, displayedRows), [feed.rows, feed.watermark, displayedRows]);
|
|
125
|
+
// A pill's words are the drawing's: the derived model is re-derived when the viewer's day turns.
|
|
126
|
+
const viewerDay = useViewerDay();
|
|
122
127
|
const model = useMemo(() => {
|
|
123
128
|
const derived = displayedRows === feed.rows
|
|
124
129
|
? baseModel
|
|
125
|
-
: transcriptModel(displayedRows, session, homeDirectory,
|
|
130
|
+
: transcriptModel(displayedRows, session, homeDirectory, viewerDay.now, {
|
|
126
131
|
sharedCollaborationSessionIds: teamIdSet,
|
|
127
132
|
cutBefore: cuts.cutBefore,
|
|
128
133
|
});
|
|
@@ -145,6 +150,7 @@ export function TranscriptDocument({ session, model: baseModel, feed, duringBack
|
|
|
145
150
|
teamIdSet,
|
|
146
151
|
chronology.duplicateRepresentatives,
|
|
147
152
|
cuts,
|
|
153
|
+
viewerDay.now,
|
|
148
154
|
]);
|
|
149
155
|
const previousReading = useRef(null);
|
|
150
156
|
const reading = useMemo(() => retainReadingIdentity(previousReading.current?.sessionId === session.id ? previousReading.current.reading : [], activityPlan(model.plan, {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { EarlierState } from "../../lib/transcript/head-state.js";
|
|
2
|
+
export interface PromptJumpProps {
|
|
3
|
+
readonly scrollRef: {
|
|
4
|
+
readonly current: HTMLElement | null;
|
|
5
|
+
};
|
|
6
|
+
readonly earlier: EarlierState["kind"];
|
|
7
|
+
/** Changes whenever the document's rows may have moved: what is above is read again. */
|
|
8
|
+
readonly layoutKey: unknown;
|
|
9
|
+
/** The document stops following, as it does for any move up the page. */
|
|
10
|
+
readonly onLeaveTail: () => void;
|
|
11
|
+
/** While the transcript is still opening, the button is not there. */
|
|
12
|
+
readonly hidden: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function PromptJump({ scrollRef, earlier, layoutKey, onLeaveTail, hidden }: PromptJumpProps): import("react").JSX.Element;
|