Skip to content

Commit

Permalink
Show recording title (metadata.title) if one has been set
Browse files Browse the repository at this point in the history
  • Loading branch information
bvaughn committed Jun 4, 2024
1 parent 01805c8 commit d5883a8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/new-dogs-nail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"replayio": minor
---

For recordings of e2e tests, the test name will be shown as the recording title
4 changes: 3 additions & 1 deletion packages/replayio/src/utils/recordings/formatRecording.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ export function formatRecording(recording: LocalRecording) {
break;
}
default: {
if (metadata.host) {
if (metadata.title) {
title = truncateRecordingTitle(metadata.title);
} else if (metadata.host) {
title = link(truncateRecordingTitle(metadata.host));
} else {
title = "(untitled)";
Expand Down
5 changes: 4 additions & 1 deletion packages/replayio/src/utils/recordings/getRecordings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ export function getRecordings(processGroupIdFilter?: string): LocalRecording[] {

Object.assign(recording.metadata, metadata);

const { argv, process, processGroupId, uri } = metadata;
const { argv, process, processGroupId, title, uri } = metadata;

recording.metadata.title = title;

if (uri) {
let host = uri;
Expand Down Expand Up @@ -87,6 +89,7 @@ export function getRecordings(processGroupIdFilter?: string): LocalRecording[] {
processGroupId: undefined,
processType: undefined,
sourceMaps: [],
title: undefined,
uri: undefined,
},
path: undefined,
Expand Down
2 changes: 2 additions & 0 deletions packages/replayio/src/utils/recordings/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export type LogEntry = {
argv?: string[];
process?: ProcessType;
processGroupId?: string;
title?: string;
uri?: string;
[key: string]: unknown;
};
Expand Down Expand Up @@ -76,6 +77,7 @@ export type LocalRecording = {
processGroupId: string | undefined;
processType: ProcessType | undefined;
sourceMaps: SourceMap[];
title: string | undefined;
uri: string | undefined;
[key: string]: unknown;
};
Expand Down

0 comments on commit d5883a8

Please sign in to comment.