From 1696e31797a193918aa0fe05ec3108c2d5d7b311 Mon Sep 17 00:00:00 2001 From: piuvas Date: Tue, 15 Jul 2025 18:37:29 -0300 Subject: [PATCH 1/2] initial split descriptions impl. --- locales/index.d.ts | 8 ++++++++ .../migration/1752607599852-split-descriptions.js | 12 ++++++++++++ .../backend/src/core/entities/MetaEntityService.ts | 1 + packages/backend/src/models/Meta.ts | 5 +++++ packages/backend/src/models/json-schema/meta.ts | 4 ++++ .../backend/src/server/api/endpoints/admin/meta.ts | 1 + .../src/server/api/endpoints/admin/update-meta.ts | 5 +++++ .../src/server/api/mastodon/endpoints/instance.ts | 3 ++- .../frontend/src/components/MkVisitorDashboard.vue | 8 ++++++++ packages/frontend/src/pages/about.overview.vue | 4 ++-- packages/frontend/src/pages/admin/settings.vue | 8 ++++++++ sharkey-locales/en-US.yml | 2 ++ sharkey-locales/pt-PT.yml | 3 +++ 13 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 packages/backend/migration/1752607599852-split-descriptions.js diff --git a/locales/index.d.ts b/locales/index.d.ts index f1626a3212..1fd3e739e7 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -6413,6 +6413,14 @@ export interface Locale extends ILocale { * E.g. In the sidebar, to visitors and in the "About" page. */ "sidebarLogoUsageExample": string; + /** + * About instance + */ + "aboutInstance": string; + /** + * A longer description that will be displayed in the 'Instance Information' page. Supports HTML. + */ + "aboutInstanceDescription": string; }; "_accountMigration": { /** diff --git a/packages/backend/migration/1752607599852-split-descriptions.js b/packages/backend/migration/1752607599852-split-descriptions.js new file mode 100644 index 0000000000..b280432574 --- /dev/null +++ b/packages/backend/migration/1752607599852-split-descriptions.js @@ -0,0 +1,12 @@ +export class SplitDescriptions1752607599852 { + name = 'SplitDescriptions1752607599852' + + async up(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" ADD COLUMN "about" TEXT`); + await queryRunner.query(`UPDATE "meta" SET "about" = "description"`); + } + + async down(queryRunner) { + await queryRunner.query(`ALTER TABLE "meta" DROP COLUMN "about"`); + } +} diff --git a/packages/backend/src/core/entities/MetaEntityService.ts b/packages/backend/src/core/entities/MetaEntityService.ts index 3e16266d7d..d7ab20db2c 100644 --- a/packages/backend/src/core/entities/MetaEntityService.ts +++ b/packages/backend/src/core/entities/MetaEntityService.ts @@ -75,6 +75,7 @@ export class MetaEntityService { shortName: instance.shortName, uri: this.config.url, description: instance.description, + about: instance.about, langs: instance.langs, tosUrl: instance.termsOfServiceUrl, repositoryUrl: instance.repositoryUrl, diff --git a/packages/backend/src/models/Meta.ts b/packages/backend/src/models/Meta.ts index 182495e95f..653b6d05aa 100644 --- a/packages/backend/src/models/Meta.ts +++ b/packages/backend/src/models/Meta.ts @@ -43,6 +43,11 @@ export class MiMeta { }) public description: string | null; + @Column('text', { + nullable: true, + }) + public about: string | null; + /** * メンテナの名前 */ diff --git a/packages/backend/src/models/json-schema/meta.ts b/packages/backend/src/models/json-schema/meta.ts index 35e470c459..9a81cdea3d 100644 --- a/packages/backend/src/models/json-schema/meta.ts +++ b/packages/backend/src/models/json-schema/meta.ts @@ -43,6 +43,10 @@ export const packedMetaLiteSchema = { type: 'string', optional: false, nullable: true, }, + about: { + type: 'string', + optional: false, nullable: true, + }, langs: { type: 'array', optional: false, nullable: false, diff --git a/packages/backend/src/server/api/endpoints/admin/meta.ts b/packages/backend/src/server/api/endpoints/admin/meta.ts index 4bcdc06aa3..22eab974a8 100644 --- a/packages/backend/src/server/api/endpoints/admin/meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/meta.ts @@ -664,6 +664,7 @@ export default class extends Endpoint { // eslint- shortName: instance.shortName, uri: this.config.url, description: instance.description, + about: instance.about, langs: instance.langs, tosUrl: instance.termsOfServiceUrl, repositoryUrl: instance.repositoryUrl, diff --git a/packages/backend/src/server/api/endpoints/admin/update-meta.ts b/packages/backend/src/server/api/endpoints/admin/update-meta.ts index 39ce8fde15..338ce8cac1 100644 --- a/packages/backend/src/server/api/endpoints/admin/update-meta.ts +++ b/packages/backend/src/server/api/endpoints/admin/update-meta.ts @@ -67,6 +67,7 @@ export const paramDef = { name: { type: 'string', nullable: true }, shortName: { type: 'string', nullable: true }, description: { type: 'string', nullable: true }, + about: { type: 'string', nullable: true }, defaultLightTheme: { type: 'string', nullable: true }, defaultDarkTheme: { type: 'string', nullable: true }, defaultLike: { type: 'string' }, @@ -340,6 +341,10 @@ export default class extends Endpoint { // eslint- set.description = ps.description; } + if (ps.about !== undefined) { + set.about = ps.about; + } + if (ps.defaultLightTheme !== undefined) { set.defaultLightTheme = ps.defaultLightTheme; } diff --git a/packages/backend/src/server/api/mastodon/endpoints/instance.ts b/packages/backend/src/server/api/mastodon/endpoints/instance.ts index cfca5b1350..f502b5e191 100644 --- a/packages/backend/src/server/api/mastodon/endpoints/instance.ts +++ b/packages/backend/src/server/api/mastodon/endpoints/instance.ts @@ -41,7 +41,8 @@ export class ApiInstanceMastodon { const response: MastodonEntity.Instance = { uri: this.config.host, title: this.meta.name || 'Sharkey', - description: this.meta.description || 'This is a vanilla Sharkey Instance. It doesn\'t seem to have a description.', + shortDescription: this.meta.description || 'This is a vanilla Sharkey Instance. It doesn\'t seem to have a description.', + description: this.meta.about || 'This is a vanilla Sharkey Instance.', email: instance.email || '', version: `3.0.0 (compatible; Sharkey ${this.config.version}; like Akkoma)`, urls: instance.urls, diff --git a/packages/frontend/src/components/MkVisitorDashboard.vue b/packages/frontend/src/components/MkVisitorDashboard.vue index 942085f7bb..d0c9435ebd 100644 --- a/packages/frontend/src/components/MkVisitorDashboard.vue +++ b/packages/frontend/src/components/MkVisitorDashboard.vue @@ -18,6 +18,9 @@ SPDX-License-Identifier: AGPL-3.0-only
+
+

{{ i18n.ts.showMore }}

+
{{ i18n.ts.invitationRequiredToRegister }} {{ i18n.ts.federationSpecified }} @@ -216,4 +219,9 @@ function showMenu(ev: MouseEvent) { height: 350px; overflow: auto; } + +.showMore { + font-size: 0.8m; + color: var(--MI_THEME-accent); +} diff --git a/packages/frontend/src/pages/about.overview.vue b/packages/frontend/src/pages/about.overview.vue index 241ee3c388..03c47ba01f 100644 --- a/packages/frontend/src/pages/about.overview.vue +++ b/packages/frontend/src/pages/about.overview.vue @@ -15,8 +15,8 @@ SPDX-License-Identifier: AGPL-3.0-only
- - + + diff --git a/packages/frontend/src/pages/admin/settings.vue b/packages/frontend/src/pages/admin/settings.vue index 50f62512f5..fd51269181 100644 --- a/packages/frontend/src/pages/admin/settings.vue +++ b/packages/frontend/src/pages/admin/settings.vue @@ -28,6 +28,12 @@ SPDX-License-Identifier: AGPL-3.0-only + + + + + + @@ -343,6 +349,7 @@ const infoForm = useForm({ name: meta.name ?? '', shortName: meta.shortName ?? '', description: meta.description ?? '', + about: meta.about ?? '', maintainerName: meta.maintainerName ?? '', maintainerEmail: meta.maintainerEmail ?? '', tosUrl: meta.tosUrl ?? '', @@ -356,6 +363,7 @@ const infoForm = useForm({ name: state.name, shortName: state.shortName === '' ? null : state.shortName, description: state.description, + about: state.about, maintainerName: state.maintainerName, maintainerEmail: state.maintainerEmail, tosUrl: state.tosUrl, diff --git a/sharkey-locales/en-US.yml b/sharkey-locales/en-US.yml index 23a3afce82..b81d4f91c8 100644 --- a/sharkey-locales/en-US.yml +++ b/sharkey-locales/en-US.yml @@ -216,6 +216,8 @@ _serverSettings: sidebarLogoUsageExample: "E.g. In the sidebar, to visitors and in the \"About\" page." inquiryUrl: "Contact URL" inquiryUrlDescription: "Specify the URL of a web page that contains a contact form or the instance operators' contact information." + aboutInstance: "About instance" + aboutInstanceDescription: "A longer description that will be displayed in the 'Instance Information' page. Supports HTML." _accountMigration: moveAccountDescription: "This will migrate your account to a different one.\n ・Followers from this account will automatically be migrated to the new account\n ・This account will unfollow all users it is currently following\n ・You will be unable to create new notes etc. on this account\n\nWhile migration of followers is automatic, you must manually prepare some steps to migrate the list of users you are following. To do so, carry out a follows export that you will later import on the new account in the settings menu. The same procedure applies to your lists as well as your muted and blocked users.\n\n(This explanation applies to Sharkey v13.12.0 and later. Other ActivityPub software, such as Mastodon, might function differently.)" _achievements: diff --git a/sharkey-locales/pt-PT.yml b/sharkey-locales/pt-PT.yml index 7220cd2b59..da8a89c58c 100644 --- a/sharkey-locales/pt-PT.yml +++ b/sharkey-locales/pt-PT.yml @@ -10,3 +10,6 @@ blockingYou: "Bloqueando você" attributionDomains: "Domínios de Atribuição" attributionDomainsDescription: "Uma lista de domínios cujo conteúdo pode ser atribuído a você em prévias de link, separadas por linha. Qualquer subdomínio também será válido. O código seguinte precisa estar presente na página:" writtenBy: "Escrito por {user}" +_serverSettings: + aboutInstance: "Sobre a instância" + aboutInstanceDescription: "Uma descrição maior que irá aparecer na página 'Informações da Instância'. Aceita HTML." From c97fafa07173565d38bccfa58d96c5dde4f017ff Mon Sep 17 00:00:00 2001 From: piuvas Date: Wed, 16 Jul 2025 12:43:35 -0300 Subject: [PATCH 2/2] requested changes. --- locales/index.d.ts | 2 +- packages/backend/migration/1752607599852-split-descriptions.js | 1 - packages/frontend/src/components/MkVisitorDashboard.vue | 2 +- packages/frontend/src/pages/about.overview.vue | 2 +- sharkey-locales/en-US.yml | 2 +- sharkey-locales/pt-PT.yml | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 1fd3e739e7..3ed47f414f 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -6418,7 +6418,7 @@ export interface Locale extends ILocale { */ "aboutInstance": string; /** - * A longer description that will be displayed in the 'Instance Information' page. Supports HTML. + * A longer description that will be displayed in the 'Instance Information' page, going in place of the regular instance description. Supports HTML. */ "aboutInstanceDescription": string; }; diff --git a/packages/backend/migration/1752607599852-split-descriptions.js b/packages/backend/migration/1752607599852-split-descriptions.js index b280432574..7c00db68a4 100644 --- a/packages/backend/migration/1752607599852-split-descriptions.js +++ b/packages/backend/migration/1752607599852-split-descriptions.js @@ -3,7 +3,6 @@ export class SplitDescriptions1752607599852 { async up(queryRunner) { await queryRunner.query(`ALTER TABLE "meta" ADD COLUMN "about" TEXT`); - await queryRunner.query(`UPDATE "meta" SET "about" = "description"`); } async down(queryRunner) { diff --git a/packages/frontend/src/components/MkVisitorDashboard.vue b/packages/frontend/src/components/MkVisitorDashboard.vue index d0c9435ebd..ed63f43574 100644 --- a/packages/frontend/src/components/MkVisitorDashboard.vue +++ b/packages/frontend/src/components/MkVisitorDashboard.vue @@ -18,7 +18,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
diff --git a/packages/frontend/src/pages/about.overview.vue b/packages/frontend/src/pages/about.overview.vue index 03c47ba01f..b1677d160c 100644 --- a/packages/frontend/src/pages/about.overview.vue +++ b/packages/frontend/src/pages/about.overview.vue @@ -16,7 +16,7 @@ SPDX-License-Identifier: AGPL-3.0-only - + diff --git a/sharkey-locales/en-US.yml b/sharkey-locales/en-US.yml index b81d4f91c8..2e562326c3 100644 --- a/sharkey-locales/en-US.yml +++ b/sharkey-locales/en-US.yml @@ -217,7 +217,7 @@ _serverSettings: inquiryUrl: "Contact URL" inquiryUrlDescription: "Specify the URL of a web page that contains a contact form or the instance operators' contact information." aboutInstance: "About instance" - aboutInstanceDescription: "A longer description that will be displayed in the 'Instance Information' page. Supports HTML." + aboutInstanceDescription: "A longer description that will be displayed in the 'Instance Information' page, going in place of the regular instance description. Supports HTML." _accountMigration: moveAccountDescription: "This will migrate your account to a different one.\n ・Followers from this account will automatically be migrated to the new account\n ・This account will unfollow all users it is currently following\n ・You will be unable to create new notes etc. on this account\n\nWhile migration of followers is automatic, you must manually prepare some steps to migrate the list of users you are following. To do so, carry out a follows export that you will later import on the new account in the settings menu. The same procedure applies to your lists as well as your muted and blocked users.\n\n(This explanation applies to Sharkey v13.12.0 and later. Other ActivityPub software, such as Mastodon, might function differently.)" _achievements: diff --git a/sharkey-locales/pt-PT.yml b/sharkey-locales/pt-PT.yml index da8a89c58c..02d2caf6a4 100644 --- a/sharkey-locales/pt-PT.yml +++ b/sharkey-locales/pt-PT.yml @@ -12,4 +12,4 @@ attributionDomainsDescription: "Uma lista de domínios cujo conteúdo pode ser a writtenBy: "Escrito por {user}" _serverSettings: aboutInstance: "Sobre a instância" - aboutInstanceDescription: "Uma descrição maior que irá aparecer na página 'Informações da Instância'. Aceita HTML." + aboutInstanceDescription: "Uma descrição maior que irá aparecer na página 'Informações da Instância', substituindo a descrição da instância. Aceita HTML."