From 3ecc69185c9f01334d8c0047f37eed78d7f740eb Mon Sep 17 00:00:00 2001 From: Cleo Date: Thu, 9 Feb 2023 22:59:05 +0000 Subject: [PATCH 1/6] Beta Docker build (#9589) Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9589 --- .woodpecker/dockerHubRelease.yml | 2 +- .woodpecker/dockerHubReleaseCandidate.yml | 15 +++++++++++++++ .woodpecker/testDocker.yml | 2 +- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .woodpecker/dockerHubReleaseCandidate.yml diff --git a/.woodpecker/dockerHubRelease.yml b/.woodpecker/dockerHubRelease.yml index e995b3fd01..bcb6df4904 100644 --- a/.woodpecker/dockerHubRelease.yml +++ b/.woodpecker/dockerHubRelease.yml @@ -12,4 +12,4 @@ pipeline: # Secret 'docker_password' needs to be set in the CI settings from_secret: docker_password -branch: main +branches: main diff --git a/.woodpecker/dockerHubReleaseCandidate.yml b/.woodpecker/dockerHubReleaseCandidate.yml new file mode 100644 index 0000000000..9b1a84316d --- /dev/null +++ b/.woodpecker/dockerHubReleaseCandidate.yml @@ -0,0 +1,15 @@ +pipeline: + publish-docker-latest: + image: plugins/kaniko + settings: + repo: thatonecalculator/calckey + tags: rc + dockerfile: Dockerfile + username: + # Secret 'docker_username' needs to be set in the CI settings + from_secret: docker_username + password: + # Secret 'docker_password' needs to be set in the CI settings + from_secret: docker_password + +branches: beta diff --git a/.woodpecker/testDocker.yml b/.woodpecker/testDocker.yml index aef58c9ad4..e3fdf0eb93 100644 --- a/.woodpecker/testDocker.yml +++ b/.woodpecker/testDocker.yml @@ -8,4 +8,4 @@ pipeline: no_push: true branches: - include: [ main, develop ] + include: [ main, develop, beta ] From 69089016d551c5a39a89a1ddc7c6a057bff1daab Mon Sep 17 00:00:00 2001 From: Cleo Date: Fri, 10 Feb 2023 07:00:47 +0000 Subject: [PATCH 2/6] Meow --- .woodpecker/dockerHubReleaseCandidate.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.woodpecker/dockerHubReleaseCandidate.yml b/.woodpecker/dockerHubReleaseCandidate.yml index 9b1a84316d..48bd39525f 100644 --- a/.woodpecker/dockerHubReleaseCandidate.yml +++ b/.woodpecker/dockerHubReleaseCandidate.yml @@ -11,5 +11,4 @@ pipeline: password: # Secret 'docker_password' needs to be set in the CI settings from_secret: docker_password - branches: beta From c48c42850c6b08eb4345815e43087f2261ddeeec Mon Sep 17 00:00:00 2001 From: Freeplay Date: Thu, 23 Feb 2023 20:50:58 -0500 Subject: [PATCH 3/6] fix not being able to click around there are new posts button --- packages/client/src/pages/timeline.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/client/src/pages/timeline.vue b/packages/client/src/pages/timeline.vue index 3646e8d86d..9357050c7e 100644 --- a/packages/client/src/pages/timeline.vue +++ b/packages/client/src/pages/timeline.vue @@ -315,12 +315,14 @@ onMounted(() => { top: calc(var(--stickyTop, 0px) + 16px); z-index: 1000; width: 100%; + pointer-events: none; > button { display: block; margin: var(--margin) auto 0 auto; padding: 8px 16px; border-radius: 32px; + pointer-events: all; } } From 2f419ad7278fd23d9afe0261e569c9f251af4e00 Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Fri, 17 Feb 2023 00:01:22 -0800 Subject: [PATCH 4/6] perf: :zap: emoji lib performance fix --- packages/backend/src/misc/reaction-lib.ts | 87 +++++++++++------------ 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/packages/backend/src/misc/reaction-lib.ts b/packages/backend/src/misc/reaction-lib.ts index a61c0a1198..7d78904bba 100644 --- a/packages/backend/src/misc/reaction-lib.ts +++ b/packages/backend/src/misc/reaction-lib.ts @@ -4,73 +4,68 @@ import { Emojis } from "@/models/index.js"; import { toPunyNullable } from "./convert-host.js"; import { IsNull } from "typeorm"; -const legacies: Record = { - like: "👍", - love: "❀", // ă“ă“ă«èš˜èż°ă™ă‚‹ć ŽćˆăŻç•°äœ“ć­—ă‚»ăƒŹă‚Żă‚żă‚’ć…„ă‚ŒăȘい <- not that good because modern browsers just display it as the red heart so just convert it to it to not end up with two seperate reactions of "the same emoji" for the user - laugh: "😆", - hmm: "đŸ€”", - surprise: "😼", - congrats: "🎉", - angry: "💱", - confused: "đŸ˜„", - rip: "😇", - pudding: "🍼", - star: "⭐", -}; +const legacies = new Map([ + ['like', '👍'], + ['love', '❀'], + ['laugh', '😆'], + ['hmm', 'đŸ€”'], + ['surprise', '😼'], + ['congrats', '🎉'], + ['angry', '💱'], + ['confused', 'đŸ˜„'], + ['rip', '😇'], + ['pudding', '🍼'], + ['star', '⭐'], +]); -export async function getFallbackReaction(): Promise { +export async function getFallbackReaction() { const meta = await fetchMeta(); return meta.defaultReaction; } export function convertLegacyReactions(reactions: Record) { - const _reactions = {} as Record; + const _reactions = new Map(); + const decodedReactions = new Map(); - for (const reaction of Object.keys(reactions)) { + for (const reaction in reactions) { if (reactions[reaction] <= 0) continue; - if (Object.keys(legacies).includes(reaction)) { - if (_reactions[legacies[reaction]]) { - _reactions[legacies[reaction]] += reactions[reaction]; - } else { - _reactions[legacies[reaction]] = reactions[reaction]; - } - } else if (reaction === "♄") { - if (_reactions["❀"]) { - _reactions["❀"] += reactions[reaction]; - } else { - _reactions["❀"] = reactions[reaction]; - } + let decodedReaction; + if (decodedReactions.has(reaction)) { + decodedReaction = decodedReactions.get(reaction); } else { - if (_reactions[reaction]) { - _reactions[reaction] += reactions[reaction]; - } else { - _reactions[reaction] = reactions[reaction]; - } + decodedReaction = decodeReaction(reaction); + decodedReactions.set(reaction, decodedReaction); + } + + let emoji = legacies.get(decodedReaction.reaction); + if (emoji) { + _reactions.set(emoji, (_reactions.get(emoji) || 0) + reactions[reaction]); + } else { + _reactions.set(reaction, (_reactions.get(reaction) || 0) + reactions[reaction]); } } - const _reactions2 = {} as Record; - - for (const reaction of Object.keys(_reactions)) { - _reactions2[decodeReaction(reaction).reaction] = _reactions[reaction]; + const _reactions2 = new Map(); + for (const [reaction, count] of _reactions) { + const decodedReaction = decodedReactions.get(reaction); + _reactions2.set(decodedReaction.reaction, count); } - return _reactions2; + return Object.fromEntries(_reactions2); } export async function toDbReaction( reaction?: string | null, reacterHost?: string | null, ): Promise { - if (reaction == null) return await getFallbackReaction(); + if (!reaction) return await getFallbackReaction(); reacterHost = toPunyNullable(reacterHost); // Convert string-type reactions to unicode - if (Object.keys(legacies).includes(reaction)) return legacies[reaction]; - // Convert old heart to new - if (reaction === "♄") return "❀"; + const emoji = legacies.get(reaction) || (reaction === "♄" ? "❀" : null); + if (emoji) return emoji; // Allow unicode reactions const match = emojiRegex.exec(reaction); @@ -83,7 +78,7 @@ export async function toDbReaction( if (custom) { const name = custom[1]; const emoji = await Emojis.findOneBy({ - host: reacterHost ?? IsNull(), + host: reacterHost || IsNull(), name, }); @@ -132,7 +127,7 @@ export function decodeReaction(str: string): DecodedReaction { } export function convertLegacyReaction(reaction: string): string { - reaction = decodeReaction(reaction).reaction; - if (Object.keys(legacies).includes(reaction)) return legacies[reaction]; - return reaction; + const decoded = decodeReaction(reaction).reaction; + if (legacies.has(decoded)) return legacies.get(decoded)!; + return decoded; } From 456eb4b62746c62cdf505872cd1b7a501dc0a9c9 Mon Sep 17 00:00:00 2001 From: Free Date: Mon, 13 Feb 2023 21:14:06 +0000 Subject: [PATCH 5/6] New MkPageHeader --- .../src/components/global/MkPageHeader.vue | 85 +++++++++++-------- 1 file changed, 50 insertions(+), 35 deletions(-) diff --git a/packages/client/src/components/global/MkPageHeader.vue b/packages/client/src/components/global/MkPageHeader.vue index 464a965b33..5eaa5e4fee 100644 --- a/packages/client/src/components/global/MkPageHeader.vue +++ b/packages/client/src/components/global/MkPageHeader.vue @@ -1,35 +1,35 @@