From 6c747beb61cd8a522fea246530d4e1be82d82da2 Mon Sep 17 00:00:00 2001 From: Kiril Videlov Date: Mon, 27 Feb 2023 22:32:39 +0100 Subject: [PATCH] unified timeline: abbreviated paths and more compact grid --- .../[projectId]/timeline/+page.svelte | 42 ++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) 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('/'); + };
@@ -343,12 +353,14 @@
-
+
-
+
{format(selection.start, 'hh:mm')}
-
+
{format( add(selection.start, { @@ -359,7 +371,7 @@ )}
-
+
{format( add(selection.start, { @@ -370,7 +382,7 @@ )}
-
+
{format( add(selection.start, { @@ -381,7 +393,7 @@ )}
-
+
{format(selection.end, 'hh:mm')}
@@ -412,7 +424,7 @@
@@ -423,7 +435,7 @@ : ''}" >
{/each} @@ -463,17 +475,19 @@
    {#each Object.entries(selection.deltas) as [filePath, fileDeltas], idx} {#each fileDeltas as delta}