Signal which session is current

- Add an indicator for the current session
- Change styling and title of the branch name link
- Add duration display in minutes

[src/lib/components/timeline/TimelineDaySession.svelte]
- Add an indicator for the current session
- Change the styling and title of the branch name link
- Add a duration display in minutes
- Fix a calculation bug in the duration display
This commit is contained in:
Kiril Videlov 2023-02-20 14:33:43 +01:00
parent e311f44886
commit 4a33245e60

View File

@ -49,9 +49,10 @@
</script>
<div class="flex flex-col space-y-2">
<span class="relative inline-flex">
<a
id="block"
class="truncate border px-4 py-2 text-slate-50 rounded-lg {colorFromBranchName(
class="inline-flex flex-grow items-center truncate transition ease-in-out duration-150 border px-4 py-2 text-slate-50 rounded-lg {colorFromBranchName(
session.meta.branch
)}"
title={session.meta.branch}
@ -59,6 +60,17 @@
>
{toHumanBranchName(session.meta.branch)}
</a>
{#if !session.hash}
<span class="flex absolute h-3 w-3 top-0 right-0 -mt-1 -mr-1" title="Current session">
<span
class="animate-ping absolute inline-flex h-full w-full rounded-full bg-orange-400 opacity-75"
/>
<span
class="relative inline-flex rounded-full h-3 w-3 bg-orange-600"
/>
</span>
{/if}
</span>
<div id="activities">
<div class="my-2 mx-1">
<TimelineDaySessionActivities
@ -72,7 +84,10 @@
{toHumanReadableDate(session.meta.startTimestampMs)},
{toHumanReadableTime(session.meta.startTimestampMs)}
<div class="text-xs text-zinc-600">
{Math.round((session.meta.lastTimestampMs - session.meta.startTimestampMs) / 60)} min
{Math.round(
(session.meta.lastTimestampMs - session.meta.startTimestampMs) /
60
)} min
</div>
</div>
<div id="files">