|
1 | 1 | <script lang="ts" setup>
|
2 |
| -import { onMounted, ref } from 'vue' |
3 |
| -import ChangeLogEntry from '#root/components/ChangeLogEntry.vue' |
4 |
| -import CoreLink from '~/components/CoreLink.vue' |
| 2 | +import { ref } from 'vue' |
| 3 | +import KeyboardKey from './KeyboardKey.vue' |
| 4 | +import KeyboardKeyCombination from './KeyboardKeyCombination.vue' |
| 5 | +import ChangeLogEntry from './ChangeLogEntry.vue' |
| 6 | +import CoreLink from './CoreLink.vue' |
| 7 | +import Modal from './Modal.vue' |
| 8 | +import { track } from '/helpers/analytics' |
5 | 9 |
|
6 |
| -// import Code from '#root/components/Code.vue' |
7 |
| -import Modal from '#root/components/Modal.vue' |
8 |
| -import { track } from '#helpers/analytics' |
| 10 | +// When updating the changelog, generate a new timestamp |
| 11 | +// with `Date.now()`. |
| 12 | +const lastUpdated = ref(1726035870403) |
| 13 | +const lastSeen = useLocalStorage('changelog:v1', 0, { |
| 14 | + initOnMounted: true, |
| 15 | +}) |
9 | 16 |
|
| 17 | +const showChangeLog = ref(false) |
| 18 | +const { modKey } = useDevice() |
10 | 19 | const { public: { fathomEventCtaModalUpgrade, linkFeedback } } = useConfig()
|
11 | 20 | const { isSubscribed, user } = useSubscription()
|
12 | 21 |
|
13 |
| -const showChangeLog = ref(false) |
14 | 22 | const closeChangeLog = () => {
|
15 | 23 | showChangeLog.value = false
|
16 | 24 | }
|
| 25 | +
|
17 | 26 | const trackCta = () => {
|
18 | 27 | closeChangeLog()
|
19 | 28 | track(fathomEventCtaModalUpgrade)
|
20 | 29 | }
|
21 | 30 |
|
22 |
| -onMounted(async () => { |
23 |
| - try { |
24 |
| - // Make sure this timestamp is updated when new entries are added. |
25 |
| - // (new Date()).toISOString() |
26 |
| - const lastEntryTimestamp = '2023-10-07T18:41:43.227Z' |
27 |
| - const lastClientTimestamp = localStorage.getItem('changelog:v1') |
28 |
| -
|
29 |
| - if (!lastClientTimestamp || new Date(lastEntryTimestamp) > new Date(lastClientTimestamp)) { |
30 |
| - // showChangeLog.value = true |
| 31 | +watch(lastSeen, () => { |
| 32 | + if (typeof lastSeen.value === 'string') { |
| 33 | + lastSeen.value = Date.parse(lastSeen.value) |
| 34 | + } |
31 | 35 |
|
32 |
| - localStorage.setItem('changelog:v1', lastEntryTimestamp) |
| 36 | + if (lastSeen.value) { |
| 37 | + if (lastSeen.value < lastUpdated.value) { |
| 38 | + showChangeLog.value = true |
33 | 39 | }
|
34 |
| - } catch (error) { |
35 |
| - console.warn({ error }) |
36 | 40 | }
|
| 41 | +
|
| 42 | + lastSeen.value = lastUpdated.value |
37 | 43 | })
|
38 | 44 | </script>
|
39 | 45 |
|
40 | 46 | <template>
|
41 | 47 | <Modal v-if="showChangeLog" @close="closeChangeLog">
|
42 | 48 | <template #header>
|
43 |
| - What's new? |
| 49 | + <span class="inline-flex items-center gap-2"><Icon name="Announce" size="1em" /> Announcements</span> |
44 | 50 | </template>
|
45 |
| - <div class="flex flex-col gap-12"> |
46 |
| - <ChangeLogEntry header="Saturday, October 7th, 2023"> |
47 |
| - <p><strong>We would love your feedback!</strong></p> |
48 |
| - <template #items> |
| 51 | + <div class="flex flex-col gap-4"> |
| 52 | + <ChangeLogEntry> |
| 53 | + <template #header> |
| 54 | + A fresh new look |
| 55 | + </template> |
| 56 | + <template #timestamp> |
| 57 | + Tuesday, September 10th, 2024 |
| 58 | + </template> |
| 59 | + <p>The UI has been redesigned to better prepare for future improvements.</p> |
| 60 | + <ul class="flex flex-col gap-1 list-disc pl-6"> |
49 | 61 | <li>
|
50 |
| - We have created <CoreLink :to="linkFeedback" class="text-blue-500"> |
51 |
| - a feedback board |
52 |
| - </CoreLink> to make it easier for you to share your ideas or feature requests with us. |
| 62 | + <strong>Tabs</strong> are now in the sidebar! |
53 | 63 | </li>
|
54 | 64 | <li>
|
55 |
| - No time right now? No problem! You can find a new <strong>Feedback</strong> link in the menu when you want to share your ideas. |
| 65 | + A new feature called "<strong>Zen Mode</strong>" has been added to help you focus on your writing or note-taking. You can toggle it with the <KeyboardKeyCombination><KeyboardKey :text="modKey" /><KeyboardKey text="\" /></KeyboardKeyCombination> shortcut or by tapping the <Icon name="Logo" class="inline" /> logo in the top nav. |
56 | 66 | </li>
|
57 |
| - </template> |
| 67 | + <li> |
| 68 | + Additionally, this release contains multiple bug fixes, performance enhancements, and accessibility improvements. |
| 69 | + </li> |
| 70 | + </ul> |
| 71 | + <p>Have thoughts on what we should work on next? We would <strong>love</strong> your <CoreLink :to="linkFeedback" class="text-blue-500">feedback</CoreLink>!</p> |
58 | 72 | </ChangeLogEntry>
|
59 |
| - <!-- Todo: Create a history view for older announcements. --> |
60 |
| - <!-- <div v-if="false" class="flex flex-col gap-12"> |
61 |
| - <ChangeLogEntry header="Monday, November 14th, 2022"> |
62 |
| - <p>Introducing a new way to sign in.</p> |
63 |
| - <template #items> |
64 |
| - <li>Send yourself a <strong>magic link</strong> to sign in with your email address.</li> |
65 |
| - <li>If you already have an account with a social provider, your email address will be linked to that account.</li> |
66 |
| - </template> |
67 |
| - </ChangeLogEntry> |
68 |
| - <ChangeLogEntry header="Sunday, October 16th, 2022"> |
69 |
| - <p>Today's updates focus on <strong>portability</strong>.</p><p>Vendor lock-in has become commonplace, but you deserve the right to take your data with you <strong>anywhere</strong> you choose. Thanks to recent community contributions, transferring your data into or out of Octo has become much simpler.</p> |
70 |
| - <template #items> |
71 |
| - <li>Import plain-text Markdown files into your knowledge base, directly from App Settings.</li> |
72 |
| - <li>Export your entire knowledge base as a zipped folder of plain-text Markdown files, directly from App Settings.</li> |
73 |
| - </template> |
74 |
| - </ChangeLogEntry> |
75 |
| - <ChangeLogEntry header="Thursday, July 21st, 2022"> |
76 |
| - <template #items> |
77 |
| - <li>Tags are now properly highlighted and support a wide array of unicode letters and marks. Additionally, when typing a new tag, suggestions will appear based on your existing tags. Press enter to use the active tag suggestion.</li> |
78 |
| - <li>Direct doc references are finally here! Start typing the top-level title of another doc with the <CoreCode>[[my other doc]]</CoreCode> syntax for suggestions to appear.</li> |
79 |
| - </template> |
80 |
| - </ChangeLogEntry> |
81 |
| - <ChangeLogEntry header="Monday, May 23rd, 2022"> |
82 |
| - <template #items> |
83 |
| - <li>The Formatting Toolbar is here! You can toggle it per-device in App Settings.</li> |
84 |
| - <li>You can now improve the readability of active docs by customizing the max-width to better fit your needs (defaults to 100 characters).</li> |
85 |
| - <li>There is a new 'Auto' appearance option that will match your system theme. It is the default for new users, and you can update it for yourself in App Settings.</li> |
86 |
| - <li>Formatting tokens (<CoreCode>#</CoreCode>, <CoreCode>*</CoreCode>, etc) now have better contrast with the surrounding text.</li> |
87 |
| - <li>Additionally, this release includes dependency updates, performance improvements, and small bugfixes.</li> |
88 |
| - </template> |
89 |
| - </ChangeLogEntry> |
90 |
| - <ChangeLogEntry header="Wednesday, March 30th, 2022"> |
91 |
| - <template #items> |
92 |
| - <li>Drag-and-drop or paste files to upload and attach to the current doc (Octo Pro).</li> |
93 |
| - </template> |
94 |
| - </ChangeLogEntry> |
95 |
| - <ChangeLogEntry header="Saturday, March 26th, 2022"> |
96 |
| - <template #items> |
97 |
| - <li>Changelog notifications are displayed when Octo updates.</li> |
98 |
| - <li>Improvements have been made to IME language support.</li> |
99 |
| - <li>Regular expressions are automatically recognized by the <CoreCode>/.*/i</CoreCode> syntax in searches.</li> |
100 |
| - <li>The Active Context bar has been merged into the navigation menu.</li> |
101 |
| - <li>The legacy Markdown editor has been removed in favor of Ink.</li> |
102 |
| - <li>The Daily Notepad page now works offline.</li> |
103 |
| - <li>Vim Mode can be enabled on the Settings page.</li> |
104 |
| - </template> |
105 |
| - </ChangeLogEntry> |
106 |
| - </div> --> |
107 | 73 | </div>
|
108 | 74 | <template #footer>
|
109 |
| - <div class="flex items-center justify-end gap-2"> |
| 75 | + <div class="flex items-center justify-end gap-1"> |
110 | 76 | <CoreButton @click="closeChangeLog">
|
111 | 77 | Dismiss
|
112 | 78 | </CoreButton>
|
|
0 commit comments