diff --git a/src/routes/projects/[projectId]/timeline/+page.svelte b/src/routes/projects/[projectId]/timeline/+page.svelte index 5222ff5be..d8ce33873 100644 --- a/src/routes/projects/[projectId]/timeline/+page.svelte +++ b/src/routes/projects/[projectId]/timeline/+page.svelte @@ -201,6 +201,16 @@ $: doc = selection?.files?.then((files) => deriveDoc(selection.deltas[selection.selectedFilePath], files[selection.selectedFilePath]) ); + + // Returns a shortened version of the file path where each directory is shortened to the first three characters, except for the last directory + const shortenFilePath = (filePath: string) => { + const split = filePath.split('/'); + const shortened = split.map((dir, i) => { + if (i === split.length - 1) return dir; + return dir.slice(0, 3); + }); + return shortened.join('/'); + };