diff --git a/src/lib/components/History/History.svelte b/src/lib/components/History/History.svelte index e091e7b1..444cb294 100644 --- a/src/lib/components/History/History.svelte +++ b/src/lib/components/History/History.svelte @@ -2,6 +2,7 @@ import Card from '$lib/components/Card/Card.svelte'; import type { HistoryEntry, HistoryType, State, Tab } from '$lib/types'; import { notify, prompt } from '$lib/util/notify'; + import { serializeState } from '$lib/util/serde'; import { inputStateStore } from '$lib/util/state'; import { logEvent } from '$lib/util/stats'; import dayjs from 'dayjs'; @@ -14,6 +15,7 @@ import UploadIcon from '~icons/material-symbols/upload-rounded'; import HistoryIcon from '~icons/mdi/clock-outline'; import GitAltIcon from '~icons/mdi/git'; + import OpenInNewIcon from '~icons/material-symbols/open-in-new-rounded'; import { Button } from '../ui/button'; import { Separator } from '../ui/separator'; import { @@ -99,6 +101,10 @@ const restoreHistoryItem = (state: State): void => { inputStateStore.set({ ...state, updateDiagram: true }); }; + + // Absolute editor URL for an entry, so the link can be opened in a new tab or copied. + const entryUrl = (state: State): string => + `${window.location.origin}${window.location.pathname}#${serializeState(state)}`; @@ -160,6 +166,15 @@ {dayjs(time).fromNow()} +