feat(app): open local file references at the referenced line
Mark absolute Markdown links and inline-code relative paths as file references, resolve them against the originating message cwd, and open them in the configured editor. Local links no longer navigate the SPA away from the running renderer. The canonical transcript assembly projected messages down to seven fields, so cwd and session_id never reached the renderer. Both are added to SessionDetailMessage: cwd because the working directory can change mid-session, session_id because it scopes which roots a reference may resolve inside. The main process derives those roots from the database rather than trusting anything the renderer sends. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
87ad2892b6
commit
c3751f0f6b
@@ -19,6 +19,8 @@ export interface SessionDetailMessage {
|
||||
text: string | null;
|
||||
content_type: string | null;
|
||||
is_meta: 0 | 1;
|
||||
session_id: string | null;
|
||||
cwd: string | null;
|
||||
turn_duration_ms: number | null;
|
||||
}
|
||||
|
||||
@@ -365,6 +367,10 @@ function assembleTranscriptRecords(records: Iterable<TranscriptRecord>): Session
|
||||
text: record.text,
|
||||
content_type: record.content_type,
|
||||
is_meta: record.is_meta,
|
||||
// Both kept per message, not per session: the working directory can change
|
||||
// mid-session, and the session id scopes which roots a file reference may resolve in.
|
||||
session_id: typeof record.session_id === 'string' ? record.session_id : null,
|
||||
cwd: typeof record.cwd === 'string' ? record.cwd : null,
|
||||
turn_duration_ms: typeof (record as MessageRecord & { turn_duration_ms?: unknown }).turn_duration_ms === 'number'
|
||||
? (record as MessageRecord & { turn_duration_ms: number }).turn_duration_ms
|
||||
: null,
|
||||
|
||||
Reference in New Issue
Block a user