From 1278200ae71c4db1377c093f13a6d064d04e413a Mon Sep 17 00:00:00 2001 From: cutestnekoaqua Date: Sat, 25 Mar 2023 12:35:30 +0100 Subject: [PATCH 1/2] [PATCH] set workers to reduce their processing priority Authored-by: Kaitlyn Allan --- packages/backend/src/boot/index.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/packages/backend/src/boot/index.ts b/packages/backend/src/boot/index.ts index 4e1d947656..e4f2ed7b1b 100644 --- a/packages/backend/src/boot/index.ts +++ b/packages/backend/src/boot/index.ts @@ -9,6 +9,7 @@ import { envOption } from "../env.js"; import "reflect-metadata"; import { masterMain } from "./master.js"; import { workerMain } from "./worker.js"; +import os from "node:os"; const logger = new Logger("core", "cyan"); const clusterLogger = logger.createSubLogger("cluster", "orange", false); @@ -31,6 +32,16 @@ export default async function () { await workerMain(); } + if (cluster.isPrimary) { + // Leave the master process with a marginally lower priority but not too low. + os.setPriority(2); + } + if (cluster.isWorker) { + // Set workers to a much lower priority so that the master process will be + // able to respond to api calls even if the workers gank everything. + os.setPriority(10); + } + // For when Calckey is started in a child process during unit testing. // Otherwise, process.send cannot be used, so start it. if (process.send) { From 83c7dd177ba38105bf5920e272c9f542c37ba0bf Mon Sep 17 00:00:00 2001 From: Free Date: Sun, 26 Mar 2023 03:33:44 +0000 Subject: [PATCH 2/2] note-improvements (#9768) Fixes #9745, quote icon, note spacing adjustments, border radius's in noGap Co-authored-by: Freeplay Reviewed-on: https://codeberg.org/calckey/calckey/pulls/9768 Co-authored-by: Free Co-committed-by: Free --- .../src/components/MkDateSeparatedList.vue | 7 +++++++ packages/client/src/components/MkMention.vue | 1 - packages/client/src/components/MkNote.vue | 16 +++++----------- packages/client/src/components/MkNoteHeader.vue | 4 ++-- packages/client/src/components/MkNoteSub.vue | 4 ++-- packages/client/src/components/MkNotes.vue | 1 + .../client/src/components/MkNotifications.vue | 1 + .../client/src/components/MkSubNoteContent.vue | 2 +- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/packages/client/src/components/MkDateSeparatedList.vue b/packages/client/src/components/MkDateSeparatedList.vue index e8896a2a28..41e7ac376d 100644 --- a/packages/client/src/components/MkDateSeparatedList.vue +++ b/packages/client/src/components/MkDateSeparatedList.vue @@ -178,6 +178,13 @@ export default defineComponent({ border-radius: 0; box-shadow: none; + &:first-child { + border-radius: var(--radius) var(--radius) 0 0; + } + &:last-child { + border-radius: 0 0 var(--radius) var(--radius); + } + &:not(:last-child) { border-bottom: solid 0.5px var(--divider); } diff --git a/packages/client/src/components/MkMention.vue b/packages/client/src/components/MkMention.vue index 4b2e0d5189..2a73404214 100644 --- a/packages/client/src/components/MkMention.vue +++ b/packages/client/src/components/MkMention.vue @@ -47,7 +47,6 @@ const bgCss = bg.toRgbString(); border-radius: 999px; max-width: 100%; white-space: nowrap; - overflow: clip; text-overflow: ellipsis; color: var(--mention); diff --git a/packages/client/src/components/MkNote.vue b/packages/client/src/components/MkNote.vue index 852eb48b50..c02e79d005 100644 --- a/packages/client/src/components/MkNote.vue +++ b/packages/client/src/components/MkNote.vue @@ -382,7 +382,6 @@ function readPromo() { width: 0; flex-grow: 1; position: relative; - margin-bottom: -10px; line-height: 28px; } > .line { @@ -452,17 +451,13 @@ function readPromo() { } } } - - & + .article { - padding-top: 10px !important; - } - } > .article { - padding: 28px 32px 16px; + padding: 4px 32px 10px; cursor: pointer; + @media (pointer: coarse) { cursor: default; } @@ -662,17 +657,16 @@ function readPromo() { padding-top: 6px; > .note-context { padding-inline: 16px; - margin-top: 0; + margin-top: 8px; > :not(.line) { - margin-top: 5px; + margin-top: 0px; } > .line { margin-right: 10px; } } > .article { - padding: 16px 16px 9px; - + padding: 4px 16px 8px; > .main > .header-container > .avatar { margin-right: 10px; // top: calc(14px + var(--stickyTop, 0px)); diff --git a/packages/client/src/components/MkNoteHeader.vue b/packages/client/src/components/MkNoteHeader.vue index 0d0b2183d4..6d55bcff52 100644 --- a/packages/client/src/components/MkNoteHeader.vue +++ b/packages/client/src/components/MkNoteHeader.vue @@ -56,7 +56,6 @@ const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultS border-radius: 100px; font-size: .8em; text-shadow: 0 2px 2px var(--shadow); - > .avatar { width: 3.7em; height: 3.7em; @@ -74,10 +73,11 @@ const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultS width: 0; overflow: hidden; text-overflow: ellipsis; + gap: .1em 0; } &:last-child { max-width: 50%; - gap: .2em .5em; + gap: .3em .5em; } .article > .main & { display: flex; diff --git a/packages/client/src/components/MkNoteSub.vue b/packages/client/src/components/MkNoteSub.vue index 5b9d4b33ae..401d33ca85 100644 --- a/packages/client/src/components/MkNoteSub.vue +++ b/packages/client/src/components/MkNoteSub.vue @@ -17,7 +17,7 @@ - + @@ -373,7 +373,7 @@ function noteClick(e) { &.reply-to, &.reply-to-more { padding-bottom: 0; &:first-child { - padding-top: 30px; + padding-top: 24px; } .line::before { margin-bottom: -16px; diff --git a/packages/client/src/components/MkNotes.vue b/packages/client/src/components/MkNotes.vue index a67b59d73d..f1c8aab46e 100644 --- a/packages/client/src/components/MkNotes.vue +++ b/packages/client/src/components/MkNotes.vue @@ -42,6 +42,7 @@ defineExpose({ &.noGap { > .notes { background: var(--panel); + border-radius: var(--radius); } } &:not(.noGap) { diff --git a/packages/client/src/components/MkNotifications.vue b/packages/client/src/components/MkNotifications.vue index 1aa33e74d2..a38c0e0b2d 100644 --- a/packages/client/src/components/MkNotifications.vue +++ b/packages/client/src/components/MkNotifications.vue @@ -100,5 +100,6 @@ onUnmounted(() => { diff --git a/packages/client/src/components/MkSubNoteContent.vue b/packages/client/src/components/MkSubNoteContent.vue index abb0def32d..f58e9b763d 100644 --- a/packages/client/src/components/MkSubNoteContent.vue +++ b/packages/client/src/components/MkSubNoteContent.vue @@ -6,7 +6,7 @@ - +