Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: elk-zone/elk
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6185b1fa83f05da30bc362d61335522b05aad415
Choose a base ref
..
head repository: elk-zone/elk
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 9ec10f850475f027bfeb5f695d489f25a3edd6cd
Choose a head ref
Showing with 696 additions and 506 deletions.
  1. +4 −4 .github/workflows/docker.yml
  2. +3 −1 app.vue
  3. +2 −2 components/account/AccountFollowButton.vue
  4. +2 −2 components/account/AccountFollowRequestButton.vue
  5. +2 −2 components/account/AccountHeader.vue
  6. +3 −1 components/account/AccountLockIndicator.vue
  7. +4 −3 components/account/AccountMoreButton.vue
  8. +2 −2 components/account/AccountPaginator.vue
  9. +4 −6 components/common/CommonPaginator.vue
  10. +2 −2 components/conversation/ConversationPaginator.vue
  11. +2 −2 components/list/Account.vue
  12. +4 −3 components/list/ListEntry.vue
  13. +3 −3 components/list/Lists.vue
  14. +5 −1 components/main/MainContent.vue
  15. +1 −1 components/modal/ModalConfirm.vue
  16. +8 −1 components/modal/ModalDialog.vue
  17. +6 −2 components/nav/NavBottomMoreMenu.vue
  18. +0 −2 components/notification/NotificationCard.vue
  19. +3 −4 components/notification/NotificationPaginator.vue
  20. +3 −2 components/publish/PublishWidget.vue
  21. +3 −3 components/report/ReportModal.vue
  22. +1 −1 components/settings/SettingsProfileMetadata.vue
  23. +4 −2 components/status/StatusActionsMore.vue
  24. +1 −1 components/status/StatusFavouritedBoostedBy.vue
  25. +1 −1 components/status/StatusPoll.vue
  26. +1 −1 components/status/edit/StatusEditHistory.vue
  27. +2 −2 components/tag/TagActionButton.vue
  28. +2 −2 components/tag/TagCardPaginator.vue
  29. +1 −1 components/timeline/TimelineDomainBlocks.vue
  30. +2 −2 components/timeline/TimelineHome.vue
  31. +1 −1 components/timeline/TimelineNotifications.vue
  32. +3 −3 components/timeline/TimelinePaginator.vue
  33. +1 −1 components/timeline/TimelinePinned.vue
  34. +2 −2 components/timeline/TimelinePublic.vue
  35. +2 −2 components/timeline/TimelinePublicLocal.vue
  36. +3 −3 composables/cache.ts
  37. +2 −0 composables/masto/icons.ts
  38. +29 −40 composables/masto/masto.ts
  39. +19 −14 composables/masto/notification.ts
  40. +5 −6 composables/masto/publish.ts
  41. +13 −9 composables/masto/relationship.ts
  42. +4 −4 composables/masto/search.ts
  43. +5 −5 composables/masto/status.ts
  44. +1 −1 composables/masto/statusDrafts.ts
  45. +20 −16 composables/paginator.ts
  46. +4 −6 composables/push-notifications/createPushSubscription.ts
  47. +2 −2 composables/push-notifications/types.ts
  48. +4 −4 composables/push-notifications/usePushManager.ts
  49. +2 −0 composables/settings/definition.ts
  50. +4 −4 composables/tiptap/suggestion.ts
  51. +9 −3 composables/users.ts
  52. +3 −0 composables/vue.ts
  53. +8 −7 locales/ar.json
  54. +7 −7 locales/ca-valencia.json
  55. +8 −7 locales/ca.json
  56. +1 −0 locales/cs-CZ.json
  57. +8 −7 locales/de-DE.json
  58. +17 −8 locales/en.json
  59. +8 −7 locales/es-419.json
  60. +12 −10 locales/es.json
  61. +7 −7 locales/eu-ES.json
  62. +8 −7 locales/fi-FI.json
  63. +8 −7 locales/fr-FR.json
  64. +113 −14 locales/gl-ES.json
  65. +7 −7 locales/hu-HU.json
  66. +8 −7 locales/id-ID.json
  67. +17 −9 locales/it-IT.json
  68. +7 −7 locales/ja-JP.json
  69. +8 −7 locales/ko-KR.json
  70. +1 −0 locales/nl-NL.json
  71. +8 −7 locales/pl-PL.json
  72. +7 −7 locales/pt-BR.json
  73. +14 −7 locales/pt.json
  74. +8 −7 locales/ru-RU.json
  75. +8 −7 locales/th-TH.json
  76. +8 −7 locales/tl-PH.json
  77. +8 −7 locales/tr-TR.json
  78. +2 −1 locales/uk-UA.json
  79. +39 −27 locales/vi-VN.json
  80. +8 −7 locales/zh-CN.json
  81. +8 −7 locales/zh-TW.json
  82. +3 −1 middleware/1.permalink.global.ts
  83. +5 −3 package.json
  84. +1 −1 pages/[[server]]/@[account]/[status].vue
  85. +1 −1 pages/[[server]]/@[account]/index/followers.vue
  86. +1 −1 pages/[[server]]/@[account]/index/following.vue
  87. +1 −1 pages/[[server]]/@[account]/index/index.vue
  88. +1 −1 pages/[[server]]/@[account]/index/media.vue
  89. +1 −1 pages/[[server]]/@[account]/index/with_replies.vue
  90. +1 −1 pages/[[server]]/explore/index.vue
  91. +1 −1 pages/[[server]]/explore/links.vue
  92. +1 −1 pages/[[server]]/explore/tags.vue
  93. +1 −1 pages/[[server]]/list/[list]/index.vue
  94. +1 −1 pages/[[server]]/list/[list]/index/accounts.vue
  95. +2 −2 pages/[[server]]/list/[list]/index/index.vue
  96. +3 −3 pages/[[server]]/tags/[tag].vue
  97. +6 −0 pages/settings/preferences/index.vue
  98. +1 −1 pages/settings/profile/appearance.vue
  99. +59 −78 pnpm-lock.yaml
  100. +1 −1 scripts/generate-pwa-icons.ts
  101. +1 −1 service-worker/types.ts
  102. +8 −0 tests/setup.ts
  103. +1 −1 types/index.ts
  104. +5 −0 vitest.config.ts
8 changes: 4 additions & 4 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -19,17 +19,17 @@ jobs:
uses: actions/checkout@v4
- name: Docker meta
id: metal
uses: docker/metadata-action@v4
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
4 changes: 3 additions & 1 deletion app.vue
Original file line number Diff line number Diff line change
@@ -5,9 +5,11 @@ provideGlobalCommands()
const route = useRoute()
if (process.server && !route.path.startsWith('/settings')) {
const url = useRequestURL()
useHead({
meta: [
{ property: 'og:url', content: `https://elk.zone${route.path}` },
{ property: 'og:url', content: `${url.origin}${route.path}` },
],
})
}
4 changes: 2 additions & 2 deletions components/account/AccountFollowButton.vue
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ const { client } = $(useMasto())
async function unblock() {
relationship!.blocking = false
try {
const newRel = await client.v1.accounts.unblock(account.id)
const newRel = await client.v1.accounts.$select(account.id).unblock()
Object.assign(relationship!, newRel)
}
catch (err) {
@@ -32,7 +32,7 @@ async function unblock() {
async function unmute() {
relationship!.muting = false
try {
const newRel = await client.v1.accounts.unmute(account.id)
const newRel = await client.v1.accounts.$select(account.id).unmute()
Object.assign(relationship!, newRel)
}
catch (err) {
4 changes: 2 additions & 2 deletions components/account/AccountFollowRequestButton.vue
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ async function authorizeFollowRequest() {
relationship!.requestedBy = false
relationship!.followedBy = true
try {
const newRel = await client.v1.followRequests.authorize(account.id)
const newRel = await client.v1.followRequests.$select(account.id).authorize()
Object.assign(relationship!, newRel)
}
catch (err) {
@@ -25,7 +25,7 @@ async function authorizeFollowRequest() {
async function rejectFollowRequest() {
relationship!.requestedBy = false
try {
const newRel = await client.v1.followRequests.reject(account.id)
const newRel = await client.v1.followRequests.$select(account.id).reject()
Object.assign(relationship!, newRel)
}
catch (err) {
4 changes: 2 additions & 2 deletions components/account/AccountHeader.vue
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ function previewAvatar() {
async function toggleNotifications() {
relationship!.notifying = !relationship?.notifying
try {
const newRel = await client.v1.accounts.follow(account.id, { notify: relationship?.notifying })
const newRel = await client.v1.accounts.$select(account.id).follow({ notify: relationship?.notifying })
Object.assign(relationship!, newRel)
}
catch {
@@ -97,7 +97,7 @@ async function editNote(event: Event) {
if (relationship.note?.trim() === newNote.trim())
return
const newNoteApiResult = await client.v1.accounts.createNote(account.id, { comment: newNote })
const newNoteApiResult = await client.v1.accounts.$select(account.id).note.create({ comment: newNote })
relationship.note = newNoteApiResult.note
personalNoteDraft.value = relationship.note ?? ''
}
4 changes: 3 additions & 1 deletion components/account/AccountLockIndicator.vue
Original file line number Diff line number Diff line change
@@ -2,6 +2,8 @@
defineProps<{
showLabel?: boolean
}>()
const { t } = useI18n()
</script>

<template>
@@ -15,7 +17,7 @@ defineProps<{
<div i-ri:lock-line />
</CommonTooltip>
<div v-if="showLabel">
Lock
{{ t('account.lock') }}
</div>
</div>
</template>
7 changes: 4 additions & 3 deletions components/account/AccountMoreButton.vue
Original file line number Diff line number Diff line change
@@ -26,14 +26,15 @@ function shareAccount() {
async function toggleReblogs() {
if (!relationship!.showingReblogs && await openConfirmDialog({
title: t('confirm.show_reblogs.title', [account.acct]),
title: t('confirm.show_reblogs.title'),
description: t('confirm.show_reblogs.description', [account.acct]),
confirm: t('confirm.show_reblogs.confirm'),
cancel: t('confirm.show_reblogs.cancel'),
}) !== 'confirm')
return
const showingReblogs = !relationship?.showingReblogs
relationship = await client.v1.accounts.follow(account.id, { reblogs: showingReblogs })
relationship = await client.v1.accounts.$select(account.id).follow({ reblogs: showingReblogs })
}
async function addUserNote() {
@@ -44,7 +45,7 @@ async function removeUserNote() {
if (!relationship!.note || relationship!.note.length === 0)
return
const newNote = await client.v1.accounts.createNote(account.id, { comment: '' })
const newNote = await client.v1.accounts.$select(account.id).note.create({ comment: '' })
relationship!.note = newNote.note
emit('removeNote')
}
4 changes: 2 additions & 2 deletions components/account/AccountPaginator.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import type { Paginator, mastodon } from 'masto'
import type { mastodon } from 'masto'
const { paginator, account, context } = defineProps<{
paginator: Paginator<mastodon.v1.Account[], mastodon.DefaultPaginationParams>
paginator: mastodon.Paginator<mastodon.v1.Account[], mastodon.DefaultPaginationParams | undefined>
context?: 'following' | 'followers'
account?: mastodon.v1.Account
relationshipContext?: 'followedBy' | 'following'
10 changes: 4 additions & 6 deletions components/common/CommonPaginator.vue
Original file line number Diff line number Diff line change
@@ -2,23 +2,21 @@
// @ts-expect-error missing types
import { DynamicScroller } from 'vue-virtual-scroller'
import 'vue-virtual-scroller/dist/vue-virtual-scroller.css'
import type { Paginator, WsEvents } from 'masto'
import type { mastodon } from 'masto'
import type { UnwrapRef } from 'vue'
const {
paginator,
stream,
keyProp = 'id',
virtualScroller = false,
eventType = 'update',
preprocess,
endMessage = true,
} = defineProps<{
paginator: Paginator<T[], O>
paginator: mastodon.Paginator<T[], O>
keyProp?: keyof T
virtualScroller?: boolean
stream?: Promise<WsEvents>
eventType?: 'notification' | 'update'
stream?: mastodon.streaming.Subscription
preprocess?: (items: (U | T)[]) => U[]
endMessage?: boolean | string
}>()
@@ -46,7 +44,7 @@ defineSlots<{
const { t } = useI18n()
const nuxtApp = useNuxtApp()
const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, $$(stream), eventType, preprocess)
const { items, prevItems, update, state, endAnchor, error } = usePaginator(paginator, $$(stream), preprocess)
nuxtApp.hook('elk-logo:click', () => {
update()
4 changes: 2 additions & 2 deletions components/conversation/ConversationPaginator.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<script setup lang="ts">
import type { Paginator, mastodon } from 'masto'
import type { mastodon } from 'masto'
const { paginator } = defineProps<{
paginator: Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
paginator: mastodon.Paginator<mastodon.v1.Conversation[], mastodon.DefaultPaginationParams>
}>()
function preprocess(items: mastodon.v1.Conversation[]): mastodon.v1.Conversation[] {
4 changes: 2 additions & 2 deletions components/list/Account.vue
Original file line number Diff line number Diff line change
@@ -16,8 +16,8 @@ const isRemoved = ref(false)
async function edit() {
try {
isRemoved.value
? await client.v1.lists.addAccount(list, { accountIds: [account.id] })
: await client.v1.lists.removeAccount(list, { accountIds: [account.id] })
? await client.v1.lists.$select(list).accounts.create({ accountIds: [account.id] })
: await client.v1.lists.$select(list).accounts.remove({ accountIds: [account.id] })
isRemoved.value = !isRemoved.value
}
catch (err) {
7 changes: 4 additions & 3 deletions components/list/ListEntry.vue
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ async function cancelEdit() {
const { submit, submitting } = submitter(async () => {
try {
list.value = await client.v1.lists.update(form.id, {
list.value = await client.v1.lists.$select(form.id).update({
title: form.title,
})
cancelEdit()
@@ -58,7 +58,8 @@ async function removeList() {
return
const confirmDelete = await openConfirmDialog({
title: t('confirm.delete_list.title', [list.value.title]),
title: t('confirm.delete_list.title'),
description: t('confirm.delete_list.description', [list.value.title]),
confirm: t('confirm.delete_list.confirm'),
cancel: t('confirm.delete_list.cancel'),
})
@@ -70,7 +71,7 @@ async function removeList() {
if (confirmDelete === 'confirm') {
await nextTick()
try {
await client.v1.lists.remove(list.value.id)
await client.v1.lists.$select(list.value.id).remove()
emit('listRemoved', list.value.id)
}
catch (err) {
6 changes: 3 additions & 3 deletions components/list/Lists.vue
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ const { userId } = defineProps<{
const { client } = $(useMasto())
const paginator = client.v1.lists.list()
const listsWithUser = ref((await client.v1.accounts.listLists(userId)).map(list => list.id))
const listsWithUser = ref((await client.v1.accounts.$select(userId).lists.list()).map(list => list.id))
function indexOfUserInList(listId: string) {
return listsWithUser.value.indexOf(listId)
@@ -15,11 +15,11 @@ async function edit(listId: string) {
try {
const index = indexOfUserInList(listId)
if (index === -1) {
await client.v1.lists.addAccount(listId, { accountIds: [userId] })
await client.v1.lists.$select(listId).accounts.create({ accountIds: [userId] })
listsWithUser.value.push(listId)
}
else {
await client.v1.lists.removeAccount(listId, { accountIds: [userId] })
await client.v1.lists.$select(listId).accounts.remove({ accountIds: [userId] })
listsWithUser.value = listsWithUser.value.filter(id => id !== listId)
}
}
6 changes: 5 additions & 1 deletion components/main/MainContent.vue
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@ defineProps<{
const container = ref()
const route = useRoute()
const userSettings = useUserSettings()
const { height: windowHeight } = useWindowSize()
const { height: containerHeight } = useElementBounding(container)
const wideLayout = computed(() => route.meta.wideLayout ?? false)
@@ -26,10 +27,13 @@ const containerClass = computed(() => {
<template>
<div ref="container" :class="containerClass">
<div
sticky top-0 z10 backdrop-blur
sticky top-0 z10
pt="[env(safe-area-inset-top,0)]"
bg="[rgba(var(--rgb-bg-base),0.7)]"
class="native:lg:w-[calc(100vw-5rem)] native:xl:w-[calc(135%+(100vw-1200px)/2)]"
:class="{
'backdrop-blur': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'),
}"
>
<div flex justify-between px5 py2 :class="{ 'xl:hidden': $route.name !== 'tag' }" class="native:xl:flex" border="b base">
<div flex gap-3 items-center :overflow-hidden="!noOverflowHidden ? '' : false" py2 w-full>
2 changes: 1 addition & 1 deletion components/modal/ModalConfirm.vue
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ const emit = defineEmits<{

<template>
<div flex="~ col" gap-6>
<div font-bold text-lg text-center>
<div font-bold text-lg>
{{ title }}
</div>
<div v-if="description">
9 changes: 8 additions & 1 deletion components/modal/ModalDialog.vue
Original file line number Diff line number Diff line change
@@ -56,6 +56,7 @@ const visible = defineModel<boolean>({ required: true })
const deactivated = useDeactivated()
const route = useRoute()
const userSettings = useUserSettings()
/** scrollable HTML element */
const elDialogMain = ref<HTMLDivElement>()
@@ -156,7 +157,13 @@ useEventListener('keydown', (e: KeyboardEvent) => {
<!-- corresponding to issue: #106, so please don't remove it. -->

<!-- Mask layer: blur -->
<div class="dialog-mask" absolute inset-0 z-0 bg-transparent opacity-100 backdrop-filter backdrop-blur-sm touch-none />
<div
class="dialog-mask"
:class="{
'backdrop-blur-sm': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'),
}"
absolute inset-0 z-0 bg-transparent opacity-100 backdrop-filter touch-none
/>
<!-- Mask layer: dimming -->
<div class="dialog-mask" absolute inset-0 z-0 bg-black opacity-48 touch-none h="[calc(100%+0.5px)]" @click="clickMask" />
<!-- Dialog container -->
8 changes: 6 additions & 2 deletions components/nav/NavBottomMoreMenu.vue
Original file line number Diff line number Diff line change
@@ -13,7 +13,10 @@ function toggleVisible() {
}
const buttonEl = ref<HTMLDivElement>()
/** Close the drop-down menu if the mouse click is not on the drop-down menu button when the drop-down menu is opened */
/**
* Close the drop-down menu if the mouse click is not on the drop-down menu button when the drop-down menu is opened
* @param mouse
*/
function clickEvent(mouse: MouseEvent) {
if (mouse.target && !buttonEl.value?.children[0].contains(mouse.target as any)) {
if (modelValue.value) {
@@ -141,11 +144,12 @@ const { dragging, dragDistance } = invoke(() => {
:class="{
'duration-0': dragging,
'duration-250': !dragging,
'backdrop-blur-md': !getPreferences(userSettings, 'optimizeForLowPerformanceDevice'),
}"
transition="transform ease-in"
flex-1 min-w-48 py-6 mb="-1px"
of-y-auto scrollbar-hide overscroll-none max-h="[calc(100vh-200px)]"
rounded-t-lg bg="white/85 dark:neutral-900/85" backdrop-filter backdrop-blur-md
rounded-t-lg bg="white/85 dark:neutral-900/85" backdrop-filter
border-t-1 border-base
>
<!-- Nav -->
2 changes: 0 additions & 2 deletions components/notification/NotificationCard.vue
Original file line number Diff line number Diff line change
@@ -15,7 +15,6 @@ const { notification } = defineProps<{
ps-3 pe-4 inset-is-0
rounded-ie-be-3
py-3 bg-base top-0
:lang="notification.status?.language ?? undefined"
>
<div i-ri-user-3-line text-xl me-3 color-blue />
<AccountDisplayName :account="notification.account" text-primary me-1 font-bold line-clamp-1 ws-pre-wrap break-all />
@@ -26,7 +25,6 @@ const { notification } = defineProps<{
<AccountBigCard
ms10
:account="notification.account"
:lang="notification.status?.language ?? undefined"
/>
</NuxtLink>
</template>
7 changes: 3 additions & 4 deletions components/notification/NotificationPaginator.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<script setup lang="ts">
// @ts-expect-error missing types
import { DynamicScrollerItem } from 'vue-virtual-scroller'
import type { Paginator, WsEvents, mastodon } from 'masto'
import type { mastodon } from 'masto'
import type { GroupedAccountLike, NotificationSlot } from '~/types'
const { paginator, stream } = defineProps<{
paginator: Paginator<mastodon.v1.Notification[], mastodon.v1.ListNotificationsParams>
stream?: Promise<WsEvents>
paginator: mastodon.Paginator<mastodon.v1.Notification[], mastodon.rest.v1.ListNotificationsParams>
stream?: mastodon.streaming.Subscription
}>()
const virtualScroller = false // TODO: fix flickering issue with virtual scroll
@@ -172,7 +172,6 @@ const { formatNumber } = useHumanReadableNumber()
:preprocess="preprocess"
:stream="stream"
:virtualScroller="virtualScroller"
eventType="notification"
>
<template #updater="{ number, update }">
<button py-4 border="b base" flex="~ col" p-3 w-full text-primary font-bold @click="() => { update(); clearNotifications() }">
5 changes: 3 additions & 2 deletions components/publish/PublishWidget.vue
Original file line number Diff line number Diff line change
@@ -75,12 +75,13 @@ function trimPollOptions() {
}
function editPollOptionDraft(event: Event, index: number) {
draft.params.poll!.options[index] = (event.target as HTMLInputElement).value
draft.params.poll!.options = Object.assign(draft.params.poll!.options.slice(), { [index]: (event.target as HTMLInputElement).value })
trimPollOptions()
}
function deletePollOption(index: number) {
draft.params.poll!.options.splice(index, 1)
draft.params.poll!.options = draft.params.poll!.options.slice().splice(index, 1)
trimPollOptions()
}
Loading