From 5c680d65c78ba15c214bb3aae772b80d353b80a7 Mon Sep 17 00:00:00 2001 From: dakkar Date: Fri, 30 May 2025 17:44:35 +0100 Subject: [PATCH] replace more icons in a few places icon classes are constructed from string constants, and those not always include the `ti` prefix also updated the `grep` in `CONTRIBUTING.md` to catch those kind of constants. --- CONTRIBUTING.md | 2 +- packages/frontend/vite.replaceIcons.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c8a58fadab..ef08d5275f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -690,7 +690,7 @@ seems to do a decent job) * re-generate locales (`pnpm run build-assets`) and commit * build the frontend: `rm -rf built/; NODE_ENV=development pnpm --filter=frontend --filter=frontend-embed --filter=frontend-shared build` (the `development` tells it to keep some of the original filenames in the built files) * make sure there aren't any new `ti-*` classes (Tabler Icons), and replace them with appropriate `ph-*` ones (Phosphor Icons) in [`vite.replaceicons.ts`](packages/frontend/vite.replaceIcons.ts). - * This command should show you want to change: `grep -ohrP '(?<=["'\'']ti )(ti-(?!fw)[\w\-]+)' --exclude \*.map -- built/ | sort -u`. + * This command should show you want to change: `grep -ohrP '(?<=["'\''](ti )?)(ti-(?!fw)[\w\-]+)' --exclude \*.map -- built/ | sort -u`. * NOTE: `ti-fw` is a special class that's defined by Misskey, leave it alone. * After every change, re-build the frontend and check again, until there are no more `ti-*` classes in the built files. * Commit! diff --git a/packages/frontend/vite.replaceIcons.ts b/packages/frontend/vite.replaceIcons.ts index ce05fc7e7b..36e6666925 100644 --- a/packages/frontend/vite.replaceIcons.ts +++ b/packages/frontend/vite.replaceIcons.ts @@ -224,6 +224,7 @@ export function pluginReplaceIcons() { 'ti ti-dice-5': 'ph ph-dice-five ph-bold ph-lg', 'ti ti-dots': 'ph-dots-three ph-bold ph-lg', 'ti ti-download': 'ph-download ph-bold ph-lg', + 'ti-download': 'ph-download ph-bold ph-lg', // in custom-emoji-manager.remote.list 'ti ti-edit': 'ph-pencil-simple-line ph-bold ph-lg', 'ti ti-equal-double': 'ph-equals ph-bold ph-lg', 'ti ti-equal-not': 'ph-prohibit ph-bold ph-lg', @@ -258,6 +259,7 @@ export function pluginReplaceIcons() { 'ti ti-home': 'ph-house ph-bold ph-lg', 'ti ti-hourglass-empty': 'ph-hourglass ph-bold ph-lg', 'ti ti-icons': 'ph-squares-four ph-bold ph-lg', + 'ti-icons': 'ph-squares-four ph-bold ph-lg', // in custom-emoji-manager.local.list 'ti ti-id': 'ph-identification-card ph-bold ph-lg', 'ti ti-info-circle': 'ph-info ph-bold ph-lg', 'ti ti-json': 'ph-brackets-curly ph-bold ph-lg', @@ -275,6 +277,7 @@ export function pluginReplaceIcons() { 'ti ti-lock-star': 'ph-shield-star ph-bold ph-lg', 'ti ti-login-2': 'ph-sign-in ph-bold ph-lg', 'ti ti-mail': 'ph-envelope ph-bold ph-lg', + 'ti-mail': 'ph-envelope ph-bold ph-lg', // in notification-recipient.item.vue 'ti ti-map-pin': 'ph-map-pin ph-bold ph-lg', 'ti ti-maximize': 'ph-frame-corners ph-bold ph-lg', 'ti ti-medal': 'ph-trophy ph-bold ph-lg', @@ -359,6 +362,7 @@ export function pluginReplaceIcons() { 'ti ti-text-caption': 'ph-text-indent ph-bold ph-lg', 'ti ti-tool': 'ph-wrench ph-bold ph-lg', 'ti ti-trash': 'ph-trash ph-bold ph-lg', + 'ti-trash': 'ph-trash ph-bold ph-lg', // in custom-emoji-manager.local.list 'ti ti-trophy': 'ph-trophy ph-bold ph-lg', 'ti ti-universe': 'ph-rocket-launch ph-bold ph-lg', 'ti ti-upload': 'ph-upload ph-bold ph-lg', @@ -379,6 +383,7 @@ export function pluginReplaceIcons() { 'ti ti-volume': 'ph-speaker-high ph-bold ph-lg', 'ti ti-volume-3': 'ph-speaker-x ph-bold ph-lg', 'ti ti-webhook': 'ph-webhooks-logo ph-bold ph-lg', + 'ti-webhook': 'ph-webhooks-logo ph-bold ph-lg', // in notification-recipient.item.vue 'ti ti-whirl': 'ph-globe-hemisphere-west ph-bold ph-lg', 'ti ti-window-maximize': 'ph-frame-corners ph-bold ph-lg', 'ti ti-world': 'ph-globe-hemisphere-west ph-bold ph-lg', @@ -389,6 +394,7 @@ export function pluginReplaceIcons() { 'ti ti-world-x': 'ph-planet ph-bold ph-lg', 'ti ti-x': 'ph-x ph-bold ph-lg', 'ti ti-help': 'ph-question ph-bold ph-lg', + 'ti-help': 'ph-question ph-bold ph-lg', // in notification-recipient.item.vue 'ti ti ti-caret-down': 'ph-caret-down ph-bold ph-lg', 'ti ti-chevron-down': 'ph-caret-down ph-bold ph-lg', 'ti ti-accessible': 'ph-person-simple-circle ph-bold ph-lg',