From 47a76bbc4c25a317f0e8781d6748d1358a140920 Mon Sep 17 00:00:00 2001 From: Esurio/1673beta <60435625+1673beta@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:36:58 +0900 Subject: [PATCH 01/18] =?UTF-8?q?fix:=20swc=E3=81=AEjson-schema=E3=81=AEur?= =?UTF-8?q?l=E3=82=92=E5=A4=89=E6=9B=B4=20(#15409)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Esurio --- packages/backend/.swcrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/backend/.swcrc b/packages/backend/.swcrc index 845190b5f4..f4bf7a4d2a 100644 --- a/packages/backend/.swcrc +++ b/packages/backend/.swcrc @@ -1,5 +1,5 @@ { - "$schema": "https://json.schemastore.org/swcrc", + "$schema": "https://swc.rs/schema.json", "jsc": { "parser": { "syntax": "typescript", From d008394eb76b7b615258667dbba3d2e12acdf0f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?= <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Fri, 7 Feb 2025 15:54:52 +0900 Subject: [PATCH 02/18] =?UTF-8?q?enhance(frontend):=20PostForm=E3=81=AEann?= =?UTF-8?q?oying=E5=88=A4=E5=AE=9A=E3=81=A7CW=E3=82=92=E8=80=83=E6=85=AE?= =?UTF-8?q?=E3=81=99=E3=82=8B=E3=82=88=E3=81=86=E3=81=AB=20(#15405)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * enhance(frontend): PostFormのannoying判定でCWを考慮するように * Update Changelog * Update CHANGELOG.md --- CHANGELOG.md | 2 +- .../frontend/src/components/MkPostForm.vue | 20 +++++++++++-------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d17921700..6a4772362f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ - ### Client -- +- Enhance: 投稿フォームの「迷惑になる可能性があります」のダイアログを表示する条件においてCWを考慮するように ### Server - diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue index 4f2792ed40..49ed4197de 100644 --- a/packages/frontend/src/components/MkPostForm.vue +++ b/packages/frontend/src/components/MkPostForm.vue @@ -721,6 +721,14 @@ function deleteDraft() { miLocalStorage.setItem('drafts', JSON.stringify(draftData)); } +function isAnnoying(text: string): boolean { + return text.includes('$[x2') || + text.includes('$[x3') || + text.includes('$[x4') || + text.includes('$[scale') || + text.includes('$[position'); +} + async function post(ev?: MouseEvent) { if (useCw.value && (cw.value == null || cw.value.trim() === '')) { os.alert({ @@ -745,14 +753,10 @@ async function post(ev?: MouseEvent) { if (props.mock) return; - const annoying = - text.value.includes('$[x2') || - text.value.includes('$[x3') || - text.value.includes('$[x4') || - text.value.includes('$[scale') || - text.value.includes('$[position'); - - if (annoying && visibility.value === 'public') { + if (visibility.value === 'public' && ( + (useCw.value && cw.value != null && cw.value.trim() !== '' && isAnnoying(cw.value)) || // CWが迷惑になる場合 + ((!useCw.value || cw.value == null || cw.value.trim() === '') && text.value != null && text.value.trim() !== '' && isAnnoying(text.value)) // CWが無い かつ 本文が迷惑になる場合 + )) { const { canceled, result } = await os.actions({ type: 'warning', text: i18n.ts.thisPostMayBeAnnoying, From 607bf60007f36a22def49df533750d2bfc834362 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Fri, 7 Feb 2025 15:57:14 +0900 Subject: [PATCH 03/18] =?UTF-8?q?enhance(frontend):=20=E3=82=A2=E3=83=B3?= =?UTF-8?q?=E3=83=86=E3=83=8A=E3=80=81=E3=83=AA=E3=82=B9=E3=83=88=E7=AD=89?= =?UTF-8?q?=E3=81=AE=E5=90=8D=E5=89=8D=E3=82=92deck=E3=81=AE=E3=82=AB?= =?UTF-8?q?=E3=83=A9=E3=83=A0=E5=90=8D=E3=81=AE=E3=83=87=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=AB=E3=83=88=E5=80=A4=E3=81=AB=E3=81=99=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=20(#13992)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: remove type errors from deck.vue and deck-store.ts * feat: アンテナ、リスト等の名前をカラム名のデフォルト値にするように * docs: アンテナ、リスト等の名前をカラム名のデフォルト値にするように * lint: fix * chore: カラム名が指定されている場合にはチャンネル名を取得しないように * chore: チャンネルについては投稿でも使用されてる channel 変数を使用するように * docs: fix changelog --------- Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com> Co-authored-by: Sayamame-beans <61457993+Sayamame-beans@users.noreply.github.com> Co-authored-by: かっこかり <67428053+kakkokari-gtyih@users.noreply.github.com> --- CHANGELOG.md | 1 + packages/frontend/src/os.ts | 15 ++++++++++++++ packages/frontend/src/ui/deck.vue | 2 +- .../frontend/src/ui/deck/antenna-column.vue | 10 +++++++++- .../frontend/src/ui/deck/channel-column.vue | 19 +++++++++++++----- packages/frontend/src/ui/deck/column.vue | 5 +++-- packages/frontend/src/ui/deck/deck-store.ts | 14 +++++++++---- .../frontend/src/ui/deck/direct-column.vue | 3 ++- packages/frontend/src/ui/deck/list-column.vue | 20 ++++++++++++++----- .../frontend/src/ui/deck/mentions-column.vue | 3 ++- .../src/ui/deck/notifications-column.vue | 2 +- .../src/ui/deck/role-timeline-column.vue | 12 +++++++++-- packages/frontend/src/ui/deck/tl-column.vue | 2 +- .../frontend/src/ui/deck/widgets-column.vue | 2 +- 14 files changed, 85 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a4772362f..596bd62be9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### Client - Enhance: 投稿フォームの「迷惑になる可能性があります」のダイアログを表示する条件においてCWを考慮するように +- Enhance: アンテナ、リスト等の名前をカラム名のデフォルト値にするように `#13992` ### Server - diff --git a/packages/frontend/src/os.ts b/packages/frontend/src/os.ts index 69cc62ad6e..6e48366092 100644 --- a/packages/frontend/src/os.ts +++ b/packages/frontend/src/os.ts @@ -310,6 +310,21 @@ export function inputText(props: { } | { canceled: false; result: string; }>; +// min lengthが指定されてたら result は null になり得ないことを保証する overload function +export function inputText(props: { + type?: 'text' | 'email' | 'password' | 'url'; + title?: string; + text?: string; + placeholder?: string | null; + autocomplete?: string; + default?: string; + minLength: number; + maxLength?: number; +}): Promise<{ + canceled: true; result: undefined; +} | { + canceled: false; result: string; +}>; export function inputText(props: { type?: 'text' | 'email' | 'password' | 'url'; title?: string; diff --git a/packages/frontend/src/ui/deck.vue b/packages/frontend/src/ui/deck.vue index 71a18fbc66..8e99c457ad 100644 --- a/packages/frontend/src/ui/deck.vue +++ b/packages/frontend/src/ui/deck.vue @@ -188,7 +188,7 @@ const addColumn = async (ev) => { addColumnToStore({ type: column, id: uuid(), - name: i18n.ts._deck._columns[column], + name: null, width: 330, soundSetting: { type: null, volume: 1 }, }); diff --git a/packages/frontend/src/ui/deck/antenna-column.vue b/packages/frontend/src/ui/deck/antenna-column.vue index 07ae17b982..b79cd8408b 100644 --- a/packages/frontend/src/ui/deck/antenna-column.vue +++ b/packages/frontend/src/ui/deck/antenna-column.vue @@ -6,7 +6,7 @@ SPDX-License-Identifier: AGPL-3.0-only