refactor(ui): give every message one friendly, ungendered voice

Members read all replies as one voice, so the wording now lives in one place:
the shared titles, the list marker and the "what to do next" hint come from
src/ui/embeds.js, and every module follows them.

An error explains the cause, recalls the rule and offers the way out instead of
blaming; a success says what happens next. Nothing agrees on the gender of a
person ("utilisateur", "cher/chère", "ravie"), which also keeps the sentences
shorter. Two tests lock the shared titles and reject gendered descriptions.
This commit is contained in:
BlackAngelTV committed 2026-09-15 16:12:19 +02:00
1 parent 76e2269555
commit ef8f09da10
31 files changed
+469 -201

No files matched your search

+12 -11
View File
@@ -2,7 +2,7 @@ import { SlashCommandBuilder } from 'discord.js';
import { ACCESS_LEVELS, COLORS } from '../../config/constants.js';
import { asList, gitea, repositoryUrl } from '../../services/gitea/gitea-client.js';
import { replyGiteaFailure, assertGiteaConfigured } from '../../services/gitea/gitea-modals.js';
import { baseEmbed, successEmbed } from '../../ui/embeds.js';
import { baseEmbed, bullets, successEmbed } from '../../ui/embeds.js';
export const access = ACCESS_LEVELS.USER;
@@ -13,13 +13,14 @@ export const data = new SlashCommandBuilder()
.addSubcommand((sub) => sub.setName('release').setDescription('Releases disponibles'));
const commitLines = (commits) =>
asList(commits)
.slice(0, 5)
.map((commit) => {
const message = commit.commit?.message?.split('\n')[0] ?? '(sans message)';
return `\`${commit.sha?.slice(0, 7)}\` ${message} — *${commit.commit?.author?.name ?? 'inconnu'}*`;
})
.join('\n');
bullets(
asList(commits)
.slice(0, 5)
.map((commit) => {
const message = commit.commit?.message?.split('\n')[0] ?? '(sans message)';
return `\`${commit.sha?.slice(0, 7)}\` ${message} — *${commit.commit?.author?.name ?? 'un compte inconnu'}*`;
}),
);
/** Read-only summaries of the repository (M5-T06 / M5-T07). */
export async function execute(interaction) {
@@ -35,7 +36,7 @@ export async function execute(interaction) {
}
const embed = baseEmbed(COLORS.gitea)
.setTitle('Releases FWS Arch')
.setTitle('📦 Releases FWS Arch')
.setURL(repositoryUrl())
.setDescription(
releases
@@ -59,9 +60,9 @@ export async function execute(interaction) {
]);
const embed = baseEmbed(COLORS.gitea)
.setTitle('Activité récente')
.setTitle('📈 Activité récente')
.setURL(repositoryUrl())
.setDescription(commitLines(commits) || 'Aucun commit récent.')
.setDescription(commitLines(commits) || 'Aucun commit récent pour le moment.')
.addFields(
{ name: 'Issues ouvertes', value: String(asList(issues).length), inline: true },
{ name: 'PR ouvertes', value: String(asList(pulls).length), inline: true },