From b885d83011777a5e848e2ec94b1ea304d1fbc60f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Sun, 18 Dec 2022 23:13:01 +0000 Subject: [PATCH 001/329] chore: use `ofetch` (newer version of `ohymfetch`) --- server/shared.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/shared.ts b/server/shared.ts index 71c686c6..1efa87e1 100644 --- a/server/shared.ts +++ b/server/shared.ts @@ -4,7 +4,7 @@ import _fs from 'unstorage/drivers/fs' import _kv from 'unstorage/drivers/cloudflare-kv-http' import { parseURL } from 'ufo' -import { $fetch } from 'ohmyfetch' +import { $fetch } from 'ofetch' import type { Storage } from 'unstorage' import cached from './cache-driver' From b8ec15324495318d43b25f13e7df4987c3d6593c Mon Sep 17 00:00:00 2001 From: patak Date: Mon, 19 Dec 2022 09:36:58 +0100 Subject: [PATCH 002/329] chore: early alpha warning --- README.md | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index c2348740..b62198be 100644 --- a/README.md +++ b/README.md @@ -13,18 +13,15 @@


-Elk is in early alpha, but it is already quite usable. We would love your feedback and contributions. +# Elk is in early alpha ⚠️ -Check out the [Open Issues](https://github.com/elk-zone/elk/issues) and jump in the action. Join the [Elk discord server](https://chat.elk.zone) to learn more and get involved! +It is already quite usable, but it isn't ready for wide adoption yet. We recommend you to use if if you would like to help us building it. We appreciate your feedback and contributions. Check out the [Open Issues](https://github.com/elk-zone/elk/issues) and jump in the action. Join the [Elk discord server](https://chat.elk.zone) to chat with us and learn more about the project. -The client is deployed to [elk.zone](https://elk.zone), you can share screenshots on social media but avoid sharing this URL or the discord server until we open the repo. - -> **Note** -> If you would like to contribute, until the repo is open, please create branches in the main repository and send a PR from there. +The client is deployed to [elk.zone](https://elk.zone), you can share screenshots on social media but we prefer you avoid sharing this URL directly until the app is more polished. Feel free to share the URL with your friedns and invite others you think could be interested in helping to improve Elk. # Contributing -Hi! We're really excited that you're interested in contributing to Elk! Before submitting your contribution, please read through the following guide. +We're really excited that you're interested in contributing to Elk! Before submitting your contribution, please read through the following guide. ## Online From c7e6e10cb5aa4cfe917bb8ba6847128fc6dcb30c Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 19 Dec 2022 12:29:16 +0000 Subject: [PATCH 003/329] fix: handle missing user in github preview --- components/status/StatusPreviewGitHub.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/status/StatusPreviewGitHub.vue b/components/status/StatusPreviewGitHub.vue index b2b53214..c275d7a0 100644 --- a/components/status/StatusPreviewGitHub.vue +++ b/components/status/StatusPreviewGitHub.vue @@ -8,7 +8,7 @@ const props = defineProps<{ type UrlType = 'user' | 'repo' | 'issue' | 'pull' interface Meta { type: UrlType - user: string + user?: string titleUrl: string avatar: string details: string @@ -26,7 +26,7 @@ interface Meta { const meta = $computed(() => { const { url } = props.card const path = url.split('https://github.com/')[1] - const user = path.match(/([\w-]+)\//)![1] + const user = path.match(/([\w-]+)\//)?.[1] const repo = path.match(/[\w-]+\/([\w-]+)/)?.[1] const repoPath = `${user}/${repo}` const inRepoPath = path.split(`${repoPath}/`)?.[1] From 79fb8c5d92152f251143b9ccf9cb7e897125fe3e Mon Sep 17 00:00:00 2001 From: Guillaume Chau Date: Mon, 19 Dec 2022 14:48:25 +0100 Subject: [PATCH 004/329] feat: update vue-virtual-scroller (#461) --- package.json | 2 +- pnpm-lock.yaml | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 396b7643..1bdd32ab 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,7 @@ "vite-plugin-pwa": "^0.13.3", "vitest": "^0.25.3", "vue-tsc": "^1.0.11", - "vue-virtual-scroller": "2.0.0-beta.4", + "vue-virtual-scroller": "2.0.0-beta.7", "workbox-window": "^6.5.4" }, "simple-git-hooks": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 71dafc17..2fd38b06 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -65,7 +65,7 @@ specifiers: vite-plugin-pwa: ^0.13.3 vitest: ^0.25.3 vue-tsc: ^1.0.11 - vue-virtual-scroller: 2.0.0-beta.4 + vue-virtual-scroller: 2.0.0-beta.7 workbox-window: ^6.5.4 dependencies: @@ -132,10 +132,10 @@ devDependencies: ultrahtml: 1.0.4 unplugin-auto-import: 0.12.0 vite-plugin-inspect: 0.7.9 - vite-plugin-pwa: 0.13.3 + vite-plugin-pwa: 0.13.3_workbox-window@6.5.4 vitest: 0.25.3_jsdom@20.0.3 vue-tsc: 1.0.11_typescript@4.9.3 - vue-virtual-scroller: 2.0.0-beta.4 + vue-virtual-scroller: 2.0.0-beta.7 workbox-window: 6.5.4 packages: @@ -9721,10 +9721,11 @@ packages: - supports-color dev: true - /vite-plugin-pwa/0.13.3: + /vite-plugin-pwa/0.13.3_workbox-window@6.5.4: resolution: {integrity: sha512-cjWXpZ7slAY14OKz7M8XdgTIi9wjf6OD6NkhiMAc+ogxnbUrecUwLdRtfGPCPsN2ftut5gaN1jTghb11p6IQAA==} peerDependencies: vite: ^3.1.0 + workbox-window: ^6.5.4 dependencies: '@rollup/plugin-replace': 4.0.0_rollup@2.79.1 debug: 4.3.4 @@ -10020,8 +10021,8 @@ packages: typescript: 4.9.3 dev: true - /vue-virtual-scroller/2.0.0-beta.4: - resolution: {integrity: sha512-JfFRyMCUzjPg+lbDXP4SpWy1aE8lpCbe1AZgwXmQPHZr1eayX5n8GgEuntUi0ixFCzBQzdH7WQwPpchp8UgjtA==} + /vue-virtual-scroller/2.0.0-beta.7: + resolution: {integrity: sha512-OrouVj1i2939jaLjVfu8f5fsDlbzhAb4bOsYZYrAkpcVLylAmMoGtIL7eT3hJrdTiaKbwQpRdnv7DKf9Fn+tHg==} peerDependencies: vue: ^3.2.0 dependencies: From e72d45a2089b6f5bd78651c32c43b43ff4d8b366 Mon Sep 17 00:00:00 2001 From: patak Date: Mon, 19 Dec 2022 15:01:41 +0100 Subject: [PATCH 005/329] feat: blocking feedback on follow button --- components/account/AccountFollowButton.vue | 26 ++++++++++++++++++++-- locales/en-US.json | 2 ++ locales/es-ES.json | 2 ++ locales/fr-FR.json | 2 ++ locales/ja-JP.json | 2 ++ locales/zh-CN.json | 2 ++ 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/components/account/AccountFollowButton.vue b/components/account/AccountFollowButton.vue index 4e2458aa..8358b7a2 100644 --- a/components/account/AccountFollowButton.vue +++ b/components/account/AccountFollowButton.vue @@ -23,6 +23,18 @@ async function toggleFollow() { } } +async function unblock() { + relationship!.blocking = false + try { + const newRel = await useMasto().accounts.unblock(account.id) + Object.assign(relationship!, newRel) + } + catch { + // TODO error handling + relationship!.blocking = true + } +} + const { t } = useI18n() useCommand({ @@ -39,6 +51,9 @@ const buttonStyle = $computed(() => { if (!relationship) return 'text-inverted' + if (relationship.blocking) + return 'text-inverted bg-red border-red' + // If following, use a label style with a strong border for Mutuals if (relationship.following) return `text-base ${relationship.followedBy ? 'border-strong' : 'border-base'}` @@ -54,9 +69,16 @@ const buttonStyle = $computed(() => { gap-1 items-center group :disabled="relationship?.requested" border-1 - rounded-full flex="~ gap2 center" font-500 w-30 h-fit py1 :class="buttonStyle" :hover="relationship?.following ? 'border-red text-red' : 'bg-base border-primary text-primary'" @click="toggleFollow" + rounded-full flex="~ gap2 center" font-500 w-30 h-fit py1 + :class="buttonStyle" + :hover="!relationship?.blocking && relationship?.following ? 'border-red text-red' : 'bg-base border-primary text-primary'" + @click="relationship?.blocking ? unblock() : toggleFollow()" > - diff --git a/components/user/UserPicker.vue b/components/user/UserPicker.vue new file mode 100644 index 00000000..0d9c17f6 --- /dev/null +++ b/components/user/UserPicker.vue @@ -0,0 +1,30 @@ + + + diff --git a/composables/featureFlags.ts b/composables/featureFlags.ts index b4e7135d..d5903bfe 100644 --- a/composables/featureFlags.ts +++ b/composables/featureFlags.ts @@ -4,6 +4,7 @@ export interface FeatureFlags { experimentalVirtualScroll: boolean experimentalAvatarOnAvatar: boolean experimentalGitHubCards: boolean + experimentalUserSwitcherSidebar: boolean } export type FeatureFlagsMap = Record @@ -12,6 +13,7 @@ export function getDefaultFeatureFlags(): FeatureFlags { experimentalVirtualScroll: false, experimentalAvatarOnAvatar: true, experimentalGitHubCards: true, + experimentalUserSwitcherSidebar: true, } } @@ -31,3 +33,6 @@ export function toggleFeatureFlag(key: keyof FeatureFlags) { else featureFlags[key] = true } + +const userSwitcherSidebar = eagerComputed(() => useFeatureFlags().experimentalUserSwitcherSidebar) +export const showUserSwitcherSidebar = computed(() => useUsers().value.length > 1 && userSwitcherSidebar.value) diff --git a/layouts/default.vue b/layouts/default.vue index d08587e6..0b6f51bf 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -1,14 +1,38 @@