Add voice memos to live journal and event log.
Record short E2E-encrypted audio attachments from the live log, link them to events via __live:voice markers, and play them back in the stream and chronological event table. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,6 +7,8 @@ import {
|
||||
liveSogRemark,
|
||||
parseLiveCommentRemark,
|
||||
livePhotoRemark,
|
||||
liveVoiceRemark,
|
||||
parseLiveVoiceRemark,
|
||||
parseLiveSailsRemark
|
||||
} from './liveEventCodes.js'
|
||||
import { formatEventSummary } from './formatEventSummary.js'
|
||||
@@ -28,6 +30,7 @@ const t = (key: string, opts?: Record<string, unknown>) => {
|
||||
'logs.live_wind_entry': `Wind ${opts?.value}`,
|
||||
'logs.live_photo_entry': `Photo: ${opts?.caption}`,
|
||||
'logs.live_photo_entry_plain': 'Photo captured',
|
||||
'logs.live_voice_entry_plain': 'Voice memo',
|
||||
'logs.live_course_entry': `Course ${opts?.course}`,
|
||||
'logs.live_sog_entry': `SOG ${opts?.speed} kn`,
|
||||
'logs.live_stw_entry': `STW ${opts?.speed} kn`,
|
||||
@@ -59,6 +62,12 @@ describe('liveEventCodes', () => {
|
||||
expect(parseLiveSailsRemark(liveSailsRemark('Main + Genoa'))).toBe('Main + Genoa')
|
||||
expect(parseLiveCommentRemark(liveCommentRemark('Wind dreht'))).toBe('Wind dreht')
|
||||
})
|
||||
|
||||
it('parses voice remark with uuid', () => {
|
||||
const id = 'a1b2c3d4-e5f6-4789-a012-3456789abcde'
|
||||
expect(parseLiveVoiceRemark(liveVoiceRemark(id))).toBe(id)
|
||||
expect(parseLiveVoiceRemark('__live:voice:not-a-uuid')).toBeNull()
|
||||
})
|
||||
})
|
||||
|
||||
describe('formatEventSummary', () => {
|
||||
@@ -130,4 +139,10 @@ describe('formatEventSummary', () => {
|
||||
})
|
||||
expect(formatEventSummary(captioned, t)).toBe('Photo: Mastbruch')
|
||||
})
|
||||
|
||||
it('formats voice memo entry', () => {
|
||||
const id = 'a1b2c3d4-e5f6-4789-a012-3456789abcde'
|
||||
const event = normalizeLogEvent({ time: '12:00', remarks: liveVoiceRemark(id) })
|
||||
expect(formatEventSummary(event, t)).toBe('Voice memo')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user