@vibefield/rosetta-room 0.1.6 → 0.1.8
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/README.md +29 -2
- 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/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/fixtures/index.d.ts +2 -1
- package/dist/fixtures/index.js +53 -4
- package/dist/lib/image-media.d.ts +5 -0
- package/dist/lib/image-media.js +17 -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/ports.d.ts +15 -1
- package/dist/styles/attachments.css +13 -0
- package/dist/styles/room.css +18 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { dayLabel } from "../format.js";
|
|
1
|
+
import { clockShort, dayLabel } from "../format.js";
|
|
2
2
|
/** A silence this long or longer means the reader left and came back. */
|
|
3
3
|
export const SITTING_PAUSE_MS = 15 * 60_000;
|
|
4
4
|
/** Adjacent successful setting commands inside this window may share one
|
|
@@ -44,6 +44,50 @@ export function sittingDayLabel(timestamp, now) {
|
|
|
44
44
|
}
|
|
45
45
|
return dayLabel(timestamp, now);
|
|
46
46
|
}
|
|
47
|
+
const DAY_MS = 86_400_000;
|
|
48
|
+
/** A viewer-local day key as the UTC midnight of that date: two of them differ by whole days, never by an hour. */
|
|
49
|
+
function dayOrdinal(timestamp) {
|
|
50
|
+
const [year, month, day] = calendarDayKey(timestamp).split("-").map(Number);
|
|
51
|
+
return Date.UTC(year, month - 1, day);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* How many of the viewer's calendar days `timestamp` lies before `now`'s: 0 for today, 1 for the day before. Counted
|
|
55
|
+
* between the two days' keys, so a 23- or 25-hour day never moves it. Negative for a stamp ahead of `now` (a clock
|
|
56
|
+
* skew between devices).
|
|
57
|
+
*/
|
|
58
|
+
export function viewerDaysBack(timestamp, now) {
|
|
59
|
+
return Math.round((dayOrdinal(now) - dayOrdinal(timestamp)) / DAY_MS);
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* §07 — a pill that carries a clock says how far back it is. By the viewer's own calendar days, counted from
|
|
63
|
+
* today:
|
|
64
|
+
* - today: the clock alone, `20:21`;
|
|
65
|
+
* - one of the six days before today: the weekday and the clock, `Fri · 20:21`;
|
|
66
|
+
* - earlier: the day and the clock, `Fri 6 Nov · 20:21`, and with its year when it is not this one,
|
|
67
|
+
* `6 Nov 2025 · 20:21`.
|
|
68
|
+
* This holds for every pill with a clock, where the day turned and inside a day alike. A stamp ahead of `now`
|
|
69
|
+
* (a clock skew between devices) takes today's form, never a negative distance's. Six days, not seven: a weekday
|
|
70
|
+
* then never names today's own.
|
|
71
|
+
*/
|
|
72
|
+
export function clockPillLead(at, now) {
|
|
73
|
+
const clock = clockShort(at);
|
|
74
|
+
const back = viewerDaysBack(at, now);
|
|
75
|
+
if (back <= 0)
|
|
76
|
+
return clock;
|
|
77
|
+
const then = new Date(at);
|
|
78
|
+
if (back <= 6)
|
|
79
|
+
return `${then.toLocaleDateString("en-GB", { weekday: "short" })} · ${clock}`;
|
|
80
|
+
return `${sittingDayLabel(at, now)} · ${clock}`;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* How long until the viewer's next calendar day begins, by the wall clock: the room re-reads its clock then, so a
|
|
84
|
+
* pill's words are tomorrow's tomorrow. 23 or 25 hours across a daylight-saving change, as the wall clock has them.
|
|
85
|
+
*/
|
|
86
|
+
export function msToNextViewerDay(now) {
|
|
87
|
+
const next = new Date(now);
|
|
88
|
+
next.setHours(24, 0, 0, 0);
|
|
89
|
+
return next.getTime() - now;
|
|
90
|
+
}
|
|
47
91
|
/**
|
|
48
92
|
* Fold ordered entries into sittings: open a new one before any entry whose
|
|
49
93
|
* calendar day differs from the previous stamped entry's, or whose gap from it
|
|
@@ -99,6 +143,7 @@ export function sittings(rows, now = Date.now()) {
|
|
|
99
143
|
dayKey: startedAt === null ? null : calendarDayKey(startedAt),
|
|
100
144
|
dayLabel: startedAt === null ? null : sittingDayLabel(startedAt, now),
|
|
101
145
|
resumedAt: sitting.resumedAt,
|
|
146
|
+
clockLabel: sitting.resumedAt === null ? null : clockPillLead(sitting.resumedAt, now),
|
|
102
147
|
pauseMs: sitting.pauseMs,
|
|
103
148
|
dayChanged: sitting.dayChanged,
|
|
104
149
|
isFirst: index === 0,
|
package/dist/ports.d.ts
CHANGED
|
@@ -202,7 +202,7 @@ export interface HostPort {
|
|
|
202
202
|
/** Absent: the worktree guest stays closed and says why. */
|
|
203
203
|
readonly worktree?: WorktreeHostPort | undefined;
|
|
204
204
|
}
|
|
205
|
-
/** An address an `<img>` can load: now, later, or not at all. */
|
|
205
|
+
/** An address an `<img>` or a `<video>` can load: now, later, or not at all. */
|
|
206
206
|
export type AssetUrl = string | null | PromiseLike<string | null>;
|
|
207
207
|
/** Where every stored image and attachment is addressed. */
|
|
208
208
|
export interface AssetSource {
|
|
@@ -224,6 +224,20 @@ export interface AssetSource {
|
|
|
224
224
|
* room should not offer it. The room uses it as the attachment's identity
|
|
225
225
|
* and to decide it can be opened; it never loads it. */
|
|
226
226
|
attachmentAssetUrl(asset: AssetRef): string | null;
|
|
227
|
+
/**
|
|
228
|
+
* An address a `<video src>` can load for one recorded video member (MP4
|
|
229
|
+
* or QuickTime), or null. Optional. The room asks only after the reader
|
|
230
|
+
* presses play, never for a poster or a thumbnail. Answer one only for an
|
|
231
|
+
* address that honours byte ranges: an address served whole, without
|
|
232
|
+
* ranges, plays but cannot seek, and raises no error for the room to fall
|
|
233
|
+
* back on. The daemon serves a member whole, so rosetta's app leaves this
|
|
234
|
+
* door out. A host without this door, one that answers null, or one whose
|
|
235
|
+
* address the element then fails to load is not an error: the room reads
|
|
236
|
+
* the member's bytes through the reading session's client (`readAsset`)
|
|
237
|
+
* and plays an object URL it makes and revokes itself, which seeks.
|
|
238
|
+
* `attachmentAssetUrl` stays the member's identity and is never loaded.
|
|
239
|
+
*/
|
|
240
|
+
mediaAssetUrl?(asset: AssetRef): AssetUrl;
|
|
227
241
|
}
|
|
228
242
|
/** Everything a host hands the room. */
|
|
229
243
|
export interface IngestionPort {
|
|
@@ -27,3 +27,16 @@ button.tr-att__tile { padding: 0; border: 0; color: inherit; cursor: pointer; ap
|
|
|
27
27
|
@container (max-width: 300px) { .tr-att__tile--missing svg, .tr-att__tile--loading svg { display: none; } .tr-att__tile--missing, .tr-att__tile--loading { padding: 10px; } .tr-att figure { flex-basis: 96px; width: 96px; } .tr-att__tile { border-radius: 13px; } }
|
|
28
28
|
.tr-ledger > .tr-attachments { margin-top: 8px; margin-bottom: 12px; }
|
|
29
29
|
.tr-prompt-message + .tr-prompt-message:has(.tr-attachments), .tr-prompt-message:has(.tr-attachments) + .tr-prompt-message { margin-top: 8px; }
|
|
30
|
+
/* §06A · sent videos, 2026-11-12: the rail's height and the video's own shape (16:9 when unmeasured); name and size stand in for a poster. */
|
|
31
|
+
.tr-att { --tr-att-size: 144px; }
|
|
32
|
+
.tr-att figure.tr-att__video { flex: 0 0 auto; width: calc(var(--tr-att-size) * var(--tr-video-aspect, 1.7778)); }
|
|
33
|
+
.tr-att__video .tr-att__tile { aspect-ratio: auto; height: var(--tr-att-size); align-content: center; gap: 4px; padding: 12px; color: var(--vf-text-secondary); font-size: 11px; line-height: 1.4; text-align: center; }
|
|
34
|
+
.tr-att__video .tr-att__tile--missing, .tr-att__video .tr-att__tile--loading { color: var(--vf-text-tertiary); }
|
|
35
|
+
.tr-att__name, .tr-att__facts { min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
36
|
+
.tr-att__name { color: var(--vf-text-primary); font-weight: 500; }
|
|
37
|
+
.tr-att__facts { color: var(--vf-text-tertiary); font-variant-numeric: tabular-nums; }
|
|
38
|
+
.tr-att__video .tr-att__tile--playing { padding: 0; background: #000; }
|
|
39
|
+
.tr-att__tile video { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
|
|
40
|
+
.tr-att__tile video:focus-visible { outline: 2px solid var(--vf-select); outline-offset: -2px; }
|
|
41
|
+
@container (max-width: 440px) { .tr-att { --tr-att-size: 112px; } }
|
|
42
|
+
@container (max-width: 300px) { .tr-att { --tr-att-size: 96px; } .tr-att__video .tr-att__tile { padding: 8px; gap: 2px; } }
|
package/dist/styles/room.css
CHANGED
|
@@ -492,6 +492,24 @@
|
|
|
492
492
|
.ah-newpill svg { flex: none; }
|
|
493
493
|
.ah-newpill span { overflow: hidden; text-overflow: ellipsis; }
|
|
494
494
|
.ah-newpill i { flex: none; width: 6px; height: 6px; border-radius: 999px; background: var(--vf-green); }
|
|
495
|
+
|
|
496
|
+
/* A button at the side goes to the message before:
|
|
497
|
+
round glass on the island shadow and hairline, 16px in from the transcript
|
|
498
|
+
column's edge, its centre on the Latest pill's (that pill is 36px high, this
|
|
499
|
+
32). It fades over 200ms; hidden, it takes no press. */
|
|
500
|
+
.tr-prompt-jump {
|
|
501
|
+
position: absolute; right: 16px; bottom: calc(var(--composer-h) + 28px); z-index: 6;
|
|
502
|
+
display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
|
|
503
|
+
border: 1px solid var(--vf-hairline-strong); border-radius: 999px;
|
|
504
|
+
background: var(--vf-chrome-surface); backdrop-filter: blur(24px) saturate(1.25);
|
|
505
|
+
box-shadow: var(--vf-shadow-island);
|
|
506
|
+
color: var(--vf-text-primary);
|
|
507
|
+
opacity: 0; visibility: hidden; pointer-events: none;
|
|
508
|
+
transition: opacity 200ms ease, background-color 160ms ease, visibility 0s linear 200ms;
|
|
509
|
+
}
|
|
510
|
+
.tr-prompt-jump[data-visible] { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
|
|
511
|
+
.tr-prompt-jump:hover { background: var(--vf-chrome-solid); }
|
|
512
|
+
.tr-prompt-jump svg { flex: none; }
|
|
495
513
|
.ah-tail-announcement {
|
|
496
514
|
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
|
|
497
515
|
overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibefield/rosetta-room",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "rosetta's History room as a package: the projects, sessions and worktree columns, the panels and charts, and the transcript, behind injected ports. It dials nothing.",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@radix-ui/react-context-menu": "^2.3.7",
|
|
36
36
|
"@radix-ui/react-dialog": "^1.1.23",
|
|
37
37
|
"@radix-ui/react-tooltip": "^1.2.16",
|
|
38
|
-
"@vibefield/rosetta-protocol": "^0.1.
|
|
38
|
+
"@vibefield/rosetta-protocol": "^0.1.8",
|
|
39
39
|
"@tanstack/react-virtual": "^3.14.10",
|
|
40
40
|
"@vibecook/mille": "^0.3.4",
|
|
41
41
|
"@vibecook/mille-ui": "^0.3.4"
|