From e976b5ec054b88aa2514435b86e4727b33a17dfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20Za=C5=A5ko?= Date: Sun, 15 Nov 2026 20:11:38 +0100 Subject: [PATCH] Improve match sign-ups and attendance history - Save eligible Discord sign-ups immediately with ranked preference editing - Add event-specific signup history and unified attendance responses --- content/operations/events.mdx | 31 +- content/operations/matches.mdx | 48 +- discord-bot/README.md | 11 + discord-bot/src/events/interactions.ts | 4 +- .../src/interactions/event-buttons.test.ts | 52 +- discord-bot/src/interactions/event-buttons.ts | 131 ++-- docs/integrations/website/v0.14/README.md | 15 +- .../[serverId]/signup-activity/page.tsx | 3 + .../[serverId]/trainings/[eventId]/page.tsx | 86 ++- src/components/app/event-signup-history.tsx | 43 ++ .../match-detail/match-attendance-panel.tsx | 648 ++++++++---------- .../app/match-detail/match-detail-header.tsx | 3 + .../app/match-detail/match-detail-page.tsx | 16 +- .../app/match-detail/match-detail-view.tsx | 4 + src/components/app/signup-activity-feed.tsx | 16 +- .../match-announcement-copy.ts | 1 + .../match-signup-replies.test.ts | 11 +- .../discord-messages/match-signup-replies.ts | 16 +- src/domain/rosters/match-attendance.test.ts | 54 ++ src/domain/rosters/match-attendance.ts | 50 +- src/i18n/messages/cs/match-detail.ts | 12 + src/i18n/messages/de/match-detail.ts | 12 + src/i18n/messages/en/match-detail.ts | 12 + src/i18n/messages/fr/match-detail.ts | 12 + src/i18n/messages/pl/match-detail.ts | 12 + src/lib/clan-language/announcements.ts | 62 +- src/lib/clan-language/ranked-signup.ts | 13 +- 27 files changed, 889 insertions(+), 489 deletions(-) create mode 100644 src/components/app/event-signup-history.tsx diff --git a/content/operations/events.mdx b/content/operations/events.mdx index 281ef734..3ea1eac4 100644 --- a/content/operations/events.mdx +++ b/content/operations/events.mdx @@ -327,18 +327,15 @@ their own time zone. name", with the meeting and the server (never its password), **Signed up 8** · Not coming 1, and no teams, map or forum. - **Sign-up replies** (visible only to the player who clicks; in a DM they - arrive as a normal message, in the clan's language too): **Sign up** opens "Where do you want to play?" - with each group, its count and, for a full group, "you'll go to the - reserves". Choosing a group saves the sign-up and the same card turns into - "Sign-up saved: Infantry" with **Change group** and **Can't make it**; **Edit - sign-up** returns that card. A full group keeps the sign-up as a reserve - without a group, a group that needs a Discord role names the group, the role - and where to ask for it, and closed sign-ups say when they closed. Every - refusal is a short reason and the next step. - A match with **Allow backup group choices** enabled instead opens an ordered - choice card. One group is enough; add alternatives if wanted, use **Change - order** for up/down/remove buttons, then **Save sign-up**. Full-group reserves - retain their preferences. See [match sign-ups](./matches#sign-ups). + arrive as a normal message, in the clan's language too): **Sign up** saves + your eligible primary group, falling back to the first eligible secondary group. + If none matches, **Not signed up - choose a group** requires a selection, which + saves immediately. The saved card says **No further action required** and offers + optional **Change group** and **Can't make it** actions. Full groups save as + reserves. With **Allow backup group choices**, Change group opens the optional + preference editor: add alternatives, use **Change order**, then **Save sign-up** + to apply edits. Abandoning or expiring the editor preserves the saved signup. + See [match sign-ups](./matches#sign-ups). During registration, you can select the same group again or return to a previously selected group, including on matches created before preferential sign-ups were introduced. Normal and preferential saves acknowledge the click @@ -555,3 +552,13 @@ delivery receipts still require that manual check. The match **Sign-ups and attendance** tab includes players who have signed up but are not yet placed on the roster. It groups players by their membership for the match's game. **No response** includes unpaused members, recruits, reserves and mercenaries whose membership status is allowed for the match; shared matches use the local player audience. Players who already responded or have a roster placement are excluded. Required Discord-role restrictions may further limit who can sign up. + + +## Event-specific sign-up history + +Match and training details include a **Sign-up history** tab. It stays inside +that event's detail and shows only activity recorded for that event. The tab has +a direct URL (`?tab=history`), and event names in the general sign-up activity feed +link to their corresponding event history. Switching back to **Overview** keeps +the same event and game context. History shows up to the latest 100 entries and +indicates when that limit is reached. diff --git a/content/operations/matches.mdx b/content/operations/matches.mdx index 0be63370..d92c9191 100644 --- a/content/operations/matches.mdx +++ b/content/operations/matches.mdx @@ -117,12 +117,19 @@ Switch on **Repeat every week** for a weekly series. ### Sign-ups +Clicking **Sign up** saves immediately using your offered, eligible primary group, +or the first eligible secondary group. If no assigned group matches, the bot says +**Not signed up - choose a group**. Choose one to save; no extra confirmation is +needed. A saved signup says **No further action required**. Clicking Sign up again +shows the saved signup without replacing your choices. + **Allow backup group choices** is off by default. Enable it to let players add -optional alternatives in preference order. In Discord, select a first group, -optionally **Add another group**, then **Save sign-up**. One group is enough. -**Change order** opens an editor with up/down and remove buttons; **Done** returns -to the choices before saving. Longer lists have pages. Edits are private and -expire after 15 minutes of inactivity; reopen the signup to start again. +optional alternatives in preference order. After signup, **Change group** opens +the optional preference editor. Use **Add another group** and **Change order** +for up/down/remove buttons; **Done** returns to the choices. Click **Save sign-up** +to apply edits. Longer lists have pages. Edits are private and expire after 15 +minutes of inactivity. Closing the editor, expiration, or a bot restart preserves +the saved signup; only unsaved edits are lost. Late signups still require a reason. A full first-choice group still starts the player in reserves, and their ordered choices are retained for roster planning. Backup choices do not automatically move players between groups when someone else signs up or withdraws. @@ -307,14 +314,29 @@ attendance**. ## Sign-ups and attendance (manager) -The **Sign-ups and attendance** tab counts roster players who attended, were -excused or did not attend, reserves who attended, people who declined and -members who never answered. The table lists the roster players in squad order, -then the reserves, with their place, what they said before the match, their -attendance and the points it gives under the workspace's -[membership score rules](/wiki/configuration/members). Filters switch to the -people who declined or did not answer; **Sign-up history** opens the event's -sign-up activity. +The **Sign-ups and attendance** tab shows one table for everyone: signed-up +players (including those awaiting placement), explicit declines, and eligible +members without a recorded response. The three summary counts stay visible; +click a count or a filter to narrow the table, or choose **All responses**. +Membership groups have prominent headings and can be collapsed independently. +Collapsing or filtering does not change the summary counts. + +The **Response** column is independent of roster placement and actual attendance. +Only a recorded **Not attending** response counts as a decline. The roster's +inferred not-attending bucket does not prove that a player declined. Someone +placed on a roster can still have no recorded sign-up response. An **Event reserve** +place is different from **Reserve member** membership. + +Points are shown per player using the current Membership rules and scoring +eligibility. Before closing, they are **Projected points**; after closing, they +are **Points under current rules**, not a historical ledger. Players outside the +scored membership set and events closed without points show **Not scored**. +Expand **Scoring rules** to see the configured values; hover a point value for its +category. This screen does not change the existing scoring policy. + +**Sign-up history** is a tab inside this match detail, with a direct link and +activity queried for this event only. The general sign-up activity feed also +links each event name to that event's history tab. - **Attended** records manager-confirmed attendance on the roster, the same status as **Confirmed** on the roster board. diff --git a/discord-bot/README.md b/discord-bot/README.md index fd636cd0..462e4cfc 100644 --- a/discord-bot/README.md +++ b/discord-bot/README.md @@ -393,3 +393,14 @@ The application/ticket effect journal is an internal Discord lifecycle. There is no new `/api/v1` write: an API key is not a substitute for the current Discord thread/category authority used by recruitment and ticket commands. Dashboard/v1 membership writes continue to use the existing shared assignment commands. + +## Immediate match signup + +Discord Sign up saves the first eligible offered assignment (primary, then +secondary order), or requires a group selection that saves immediately. +Saved replies distinguish completed signup from a required selection and a full +group reserve. Optional ranked preference edits require Save sign-up; abandoning +them preserves the existing signup. Late signups still require a reason. +This is a Discord interaction convenience over the existing shared signup command. +Dashboard and v1 writers retain their explicit group/preference inputs and existing +authorization, capacity and late-signup rules; no new API operation is needed. diff --git a/discord-bot/src/events/interactions.ts b/discord-bot/src/events/interactions.ts index 2f6ea301..709733ef 100644 --- a/discord-bot/src/events/interactions.ts +++ b/discord-bot/src/events/interactions.ts @@ -34,7 +34,9 @@ export const matchAnnouncementInteractions: InteractionFeature = { .stringSelect("ranked-signup:", (interaction) => handleRankedSignupInteraction(interaction, context) ) - .button("signup-picker:", handleEventSignupPickerInteraction) + .button("signup-picker:", (interaction) => + handleEventSignupPickerInteraction(interaction, context) + ) .button("check-signup:", handleCheckSignupInteraction) .button("signup:", (interaction) => handleEventButtonInteraction(interaction, context) diff --git a/discord-bot/src/interactions/event-buttons.test.ts b/discord-bot/src/interactions/event-buttons.test.ts index 60863c6b..1b04ad60 100644 --- a/discord-bot/src/interactions/event-buttons.test.ts +++ b/discord-bot/src/interactions/event-buttons.test.ts @@ -123,8 +123,57 @@ test("ranked Discord draft adds, reorders, removes and saves only on request", a return activeClick } const options = { enqueueEventSync: () => {}, triggerPollSoon: () => {} } + // First signup is durable immediately, including primary/secondary fallback. + context.assignments = [ + { userId, primaryGroupId: "inf", secondaryGroupIds: ["tank"] }, + ] await handleEventSignupPickerInteraction( - click(`signup-picker:event-1:${guildId}`) as ButtonInteraction + click(`signup-picker:event-1:${guildId}`) as ButtonInteraction, + options + ) + assert.equal(mutations.at(-1)?.group, boardGroups[0].name) + assert.deepEqual(mutations.at(-1)?.signupPreferences, [boardGroups[0].name]) + context.assignments[0].primaryGroupId = "unoffered" + await handleEventSignupPickerInteraction( + click(`signup-picker:event-1:${guildId}`) as ButtonInteraction, + options + ) + assert.equal(mutations.at(-1)?.group, boardGroups[1].name) + context.assignments = [] + const beforePicker = mutations.length + await handleEventSignupPickerInteraction( + click(`signup-picker:event-1:${guildId}`) as ButtonInteraction, + options + ) + assert.equal(mutations.length, beforePicker) + assert.match(payloadText(replies.at(-1)), /Not signed up/) + await handleEventButtonInteraction( + click(`signup:event-1:select:${guildId}`, "inf"), + options + ) + assert.equal(mutations.length, beforePicker + 1) + assert.match(payloadText(replies.at(-1)), /No further action required/) + context.event.participants = [ + { + userId, + status: "attending", + group: boardGroups[0].name, + updatedAt: "2030-01-01T00:00:00.000Z", + }, + ] + const beforeRepeat = mutations.length + await handleEventSignupPickerInteraction( + click(`signup-picker:event-1:${guildId}`) as ButtonInteraction, + options + ) + assert.equal( + mutations.length, + beforeRepeat, + "repeat signup preserves saved choices" + ) + mutations.length = 0 + await handleEventSignupPickerInteraction( + click(`signup-picker:event-1:${guildId}:edit`) as ButtonInteraction ) function actionId(action: string) { const match = payloadText(replies.at(-1)).match( @@ -151,6 +200,7 @@ test("ranked Discord draft adds, reorders, removes and saves only on request", a 1, "an expired or replayed editor never saves twice" ) + context.event.participants = [] // Legacy matches without the ranked setting may repeatedly choose any group. delete context.event.allowRankedSignup for (const groupId of ["tank", "tank", "inf", "inf", "tank"]) { diff --git a/discord-bot/src/interactions/event-buttons.ts b/discord-bot/src/interactions/event-buttons.ts index 23b47e0a..e40fa02c 100644 --- a/discord-bot/src/interactions/event-buttons.ts +++ b/discord-bot/src/interactions/event-buttons.ts @@ -283,12 +283,14 @@ function pickerOptions(context: EventInteractionContext): SignupPickerOption[] { * L1-88, L1-89). Who may not sign up at all reads why right away. */ export async function handleEventSignupPickerInteraction( - interaction: ButtonInteraction + interaction: ButtonInteraction, + handlers?: InteractionHandlerOptions ) { const [, eventId, thirdPart, fourthPart] = interaction.customId.split(":") // A legacy announcement's single signup button has an extra action // segment (`signup::PRIMARY_GROUP:`). - const customIdGuildId = fourthPart ?? thirdPart + const editing = thirdPart !== SIGNUP_PRIMARY_GROUP && fourthPart === "edit" + const customIdGuildId = editing ? thirdPart : (fourthPart ?? thirdPart) const context = await loadSignupContext( interaction, eventId ?? "", @@ -321,14 +323,76 @@ export async function handleEventSignupPickerInteraction( return } const choices = pickerOptions(context) - if (context.event.kind === "match" && context.event.allowRankedSignup) { + if (!editing && handlers) { + if ( + context.event.participants.some( + (person) => + person.userId === interaction.user.id && + person.status === "attending" + ) + ) { + await handleCheckSignupInteraction(interaction) + return + } + const preferred = [ + membership.assignment?.primaryGroupId, + ...(membership.assignment?.secondaryGroupIds ?? []), + ].find( + (id) => + id && + choices.some((choice) => choice.value === id) && + resolveEventSignupSelection({ + event: context.event, + groups: context.groups, + memberRoleIds: member + ? [...member.roles.cache.keys()] + : null, + assignedGroupIds: membership.assignedGroupIds, + membershipStatus: membership.membershipStatus, + actionId: id, + labels: selectionLabels(context), + }).ok + ) + if (preferred) { + const group = context.groups.find((item) => item.id === preferred) + if (group) { + await handleEventButtonInteraction(interaction, handlers, { + eventId: context.event.id, + guildId: context.event.guildId, + firstGroupId: preferred, + choices: context.event.allowRankedSignup + ? [group.name] + : [], + }) + return + } + } + } + if ( + editing && + context.event.participants.some( + (person) => + person.userId === interaction.user.id && + person.status === "attending" + ) && + context.event.kind === "match" && + context.event.allowRankedSignup + ) { await openRankedSignup(interaction, context) return } await replyToClicker( interaction, choices.length - ? signupPickerView({ ...replyContext(context), options: choices }) + ? signupPickerView({ + ...replyContext(context), + options: choices, + signedUp: context.event.participants.some( + (person) => + person.userId === interaction.user.id && + person.status === "attending" + ), + }) : signupNoGroupsView(replyContext(context).copy), { ...options, replaceCard: true } ) @@ -347,20 +411,6 @@ function groupNameOf( ) } -/** The first configured assignment that this match offers: primary, then secondary order. */ -function preferredSignupGroupId( - context: EventInteractionContext, - assignment: ReturnType["assignment"] -) { - if (!assignment) return undefined - const offered = new Set( - context.event.signupGroupIds ?? context.groups.map((group) => group.id) - ) - return [assignment.primaryGroupId, ...(assignment.secondaryGroupIds ?? [])] - .filter((groupId): groupId is string => Boolean(groupId)) - .find((groupId) => offered.has(groupId)) -} - /** * "Upravit přihlášku": the saved sign-up with "Změnit skupinu" and "Nepřijdu", * or, without one, "Přihlásit se" (L1-20, L1-92). @@ -496,7 +546,7 @@ export async function handleEventButtonInteraction( interaction.customId.split(":") const eventId = ranked?.eventId ?? parsedEventId const customIdGuildId = ranked?.guildId ?? parsedGuildId - let requestedGroupId = + const requestedGroupId = ranked?.firstGroupId ?? (interaction.isStringSelectMenu() ? (interaction.values[0] ?? "") @@ -533,6 +583,15 @@ export async function handleEventButtonInteraction( return } + if ( + !ranked && + interaction.isButton() && + requestedGroupId === SIGNUP_PRIMARY_GROUP + ) { + await handleEventSignupPickerInteraction(interaction, options) + return + } + const context = await loadSignupContext( interaction, eventId ?? "", @@ -569,20 +628,6 @@ export async function handleEventButtonInteraction( const member = await resolveInteractionMember(interaction, guild) const membership = membershipOf(context, interaction.user.id) const kit = { ...kitOptions(context), replaceCard: true } - if ( - interaction.isButton() && - requestedGroupId === SIGNUP_PRIMARY_GROUP - ) { - const preferredGroupId = preferredSignupGroupId( - context, - membership.assignment - ) - if (!preferredGroupId) { - await handleEventSignupPickerInteraction(interaction) - return - } - requestedGroupId = preferredGroupId - } const resolved = resolveEventSignupSelection({ event: context.event, groups: context.groups, @@ -602,18 +647,6 @@ export async function handleEventButtonInteraction( return } - if ( - !ranked && - context.event.kind === "match" && - context.event.allowRankedSignup && - resolved.group && - ![SIGNUP_NOT_ATTENDING, SIGNUP_GENERAL, TRAINING_ATTEND].includes( - resolved.group - ) - ) { - await openRankedSignup(interaction, context, [resolved.group]) - return - } if (ranked) { for (const name of ranked.choices) { const group = context.groups.find((item) => item.name === name) @@ -703,7 +736,13 @@ export async function handleEventButtonInteraction( group: resolved.group, signupPreferences: ranked?.choices.length ? ranked.choices - : undefined, + : context.event.allowRankedSignup && + resolved.group && + context.groups.some( + (group) => group.name === resolved.group + ) + ? [resolved.group] + : undefined, lateSignupReason, profile: { name: diff --git a/docs/integrations/website/v0.14/README.md b/docs/integrations/website/v0.14/README.md index 7d435af1..6cf31a69 100644 --- a/docs/integrations/website/v0.14/README.md +++ b/docs/integrations/website/v0.14/README.md @@ -92,11 +92,20 @@ semantics. A missing legacy `confirmed` value means unconfirmed. These states are not a proof that someone played, and absence of a slot is not a no-show. Training completion remains independently `passed`, `failed` or null. -The dashboard's sign-up and attendance view groups its existing event participants -and game memberships by status, including attendees awaiting roster placement. +The dashboard's sign-up and attendance view combines existing event participants +and eligible game memberships in one table, including attendees awaiting roster +placement. Its response counts distinguish explicit `not_attending` participation +from a missing response: the roster's not-attending bucket is also populated for +non-responders and must not be interpreted as proof of a decline. Roster placement, +confirmation and the event response remain separate facts. + This is a dashboard projection; the published roster summary continues to expose its existing participation and roster fields, without dashboard grouping or an -aggregate unanswered audience. +aggregate unanswered audience. The UI adds no persistence fields, scoring policy, +or API write operation, so the existing `/api/v1` contract and OpenAPI schema remain +unchanged. Event-specific sign-up activity tabs use the existing authenticated +dashboard reader; sign-up audit history is not added to the public integration +projection. ## Collected-session statistics, not career statistics diff --git a/src/app/[locale]/(dashboard)/dashboard/servers/[serverId]/signup-activity/page.tsx b/src/app/[locale]/(dashboard)/dashboard/servers/[serverId]/signup-activity/page.tsx index 21e980ca..ebe5c34e 100644 --- a/src/app/[locale]/(dashboard)/dashboard/servers/[serverId]/signup-activity/page.tsx +++ b/src/app/[locale]/(dashboard)/dashboard/servers/[serverId]/signup-activity/page.tsx @@ -77,6 +77,9 @@ export default async function SignupActivityPage({
+ `/${safeLocale}/dashboard/servers/${serverId}/${entry.eventKind === "training" ? "trainings" : "matches"}/${entry.eventId}?tab=history` + } userNameById={userNameById} dictionary={dictionary} timezone={context.discordConfig?.timezone} diff --git a/src/app/[locale]/(dashboard)/dashboard/servers/[serverId]/trainings/[eventId]/page.tsx b/src/app/[locale]/(dashboard)/dashboard/servers/[serverId]/trainings/[eventId]/page.tsx index f1fbe9fa..c73c55a6 100644 --- a/src/app/[locale]/(dashboard)/dashboard/servers/[serverId]/trainings/[eventId]/page.tsx +++ b/src/app/[locale]/(dashboard)/dashboard/servers/[serverId]/trainings/[eventId]/page.tsx @@ -1,4 +1,5 @@ import { EventDeliveryStatus } from "@/components/app/event-delivery-status" +import { EventSignupHistory } from "@/components/app/event-signup-history" import { notFound } from "next/navigation" import Link from "next/link" @@ -20,10 +21,11 @@ export default async function TrainingDetailPage({ searchParams, }: { params: Promise<{ locale: string; serverId: string; eventId: string }> - searchParams: Promise<{ game?: string }> + searchParams: Promise<{ game?: string; tab?: string }> }) { const { locale, serverId, eventId } = await params - const { game } = await searchParams + const { game, tab } = await searchParams + const activeTab = tab === "history" ? "history" : "overview" const safeLocale = isLocale(locale) ? locale : "en" const dictionary = getDictionary(safeLocale) const context = await getServerContext( @@ -85,17 +87,6 @@ export default async function TrainingDetailPage({ ) : null} - {canAdmin && event.status !== "concluded" ? ( } /> -
- {canAdmin && !event.isDraft ? : null} - +
+ + {activeTab === "history" ? ( + + ) : ( + <> + {canAdmin && !event.isDraft ? ( + + ) : null} + + + )}
) diff --git a/src/components/app/event-signup-history.tsx b/src/components/app/event-signup-history.tsx new file mode 100644 index 00000000..e8cc57b1 --- /dev/null +++ b/src/components/app/event-signup-history.tsx @@ -0,0 +1,43 @@ +import { getSignupActivity, SIGNUP_ACTIVITY_LIMIT } from "@/lib/signup-activity" +import { SignupActivityFeed } from "@/components/app/signup-activity-feed" +import { getUsersByIds } from "@/lib/server-user-management" +import type { Dictionary } from "@/i18n/dictionaries" + +/** Always query this event through the existing authenticated, clan-scoped reader. */ +export async function EventSignupHistory({ + serverId, + eventId, + guildDiscordId, + dictionary, + locale, + timezone, +}: { + serverId: string + eventId: string + guildDiscordId: string + dictionary: Dictionary + locale: string + timezone?: string +}) { + const activity = await getSignupActivity(serverId, eventId) + const users = await getUsersByIds( + [...new Set(activity.map((entry) => entry.userId))], + guildDiscordId + ) + return ( + [user.discordId, user.name])) + } + dictionary={dictionary} + intlLocale={locale} + timezone={timezone} + limited={ + activity.length >= SIGNUP_ACTIVITY_LIMIT + ? { count: SIGNUP_ACTIVITY_LIMIT } + : undefined + } + /> + ) +} diff --git a/src/components/app/match-detail/match-attendance-panel.tsx b/src/components/app/match-detail/match-attendance-panel.tsx index e43652bb..f5f7d029 100644 --- a/src/components/app/match-detail/match-attendance-panel.tsx +++ b/src/components/app/match-detail/match-attendance-panel.tsx @@ -1,7 +1,14 @@ "use client" +import { + ChevronDown, + ChevronRight, + ClipboardList, + Loader2, + Radio, + Save, +} from "lucide-react" import { signupListMembership } from "@/domain/events/signup-list" -import { ClipboardList, Loader2, Radio, Save } from "lucide-react" import { Fragment, useMemo, useState, useTransition } from "react" import { useRouter } from "next/navigation" import { toast } from "sonner" @@ -10,6 +17,8 @@ import Link from "next/link" import { applyAttendanceExcuses, buildMatchAttendance, + buildMatchResponseRows, + type MatchResponse, planAttendanceChanges, setRosterPresence, type AttendanceMark, @@ -39,7 +48,7 @@ import type { Dictionary } from "@/i18n/dictionaries" import { Button } from "@/components/ui/button" import { cn } from "@/lib/utils" -type Filter = "roster" | "declined" | "noResponse" +type Filter = "all" | MatchResponse const MARKS: AttendanceMark[] = ["present", "excused", "absent"] @@ -84,6 +93,7 @@ export function MatchAttendancePanel({ roster, users, memberIds, + scoredUserIds, assignments, scoreSettings, closeSummary, @@ -103,6 +113,7 @@ export function MatchAttendancePanel({ roster: Roster | null users: AppUser[] memberIds: string[] + scoredUserIds: string[] assignments: Array<{ userId: string type: "member" | "reserve_member" | "mercenary" @@ -129,7 +140,8 @@ export function MatchAttendancePanel({ const [overrides, setOverrides] = useState>( () => new Map() ) - const [filter, setFilter] = useState("roster") + const [filter, setFilter] = useState("all") + const [collapsed, setCollapsed] = useState>(() => new Set()) const [isSaving, startSaving] = useTransition() const [isLoadingVoice, setIsLoadingVoice] = useState(false) const concluded = event.status === "concluded" @@ -245,6 +257,11 @@ export function MatchAttendancePanel({ ) function pointsFor(userId: string) { + if ( + !scoredUserIds.includes(userId) || + event.scoreResolution === "skipped" + ) + return null return scoreSettings[ resolveRosterScoreCategory({ userId, @@ -260,7 +277,7 @@ export function MatchAttendancePanel({ ? [entry.placement.squadName, entry.placement.roleName] .filter(Boolean) .join(" · ") - : t.reserve + : t.eventReserve } function nameOf(userId: string) { @@ -360,7 +377,6 @@ export function MatchAttendancePanel({ } } - const counts = attendance.counts const foundInVoice = new Set(roster?.meetingAttendance?.foundUserIds ?? []) const lastLoaded = roster?.meetingAttendance ? t.lastLoaded @@ -379,79 +395,52 @@ export function MatchAttendancePanel({ dictionary.matchDetail.discord.meetingChannel ) : null - const summaryCards = [ - { - label: t.rosterSummary.replace( - "{count}", - String(counts.roster.total) - ), - value: t.rosterCounts - .replace("{present}", String(counts.roster.present)) - .replace("{excused}", String(counts.roster.excused)) - .replace("{absent}", String(counts.roster.absent)), - }, - { - label: t.reservesSummary.replace( - "{count}", - String(counts.reserves.total) - ), - value: t.reserveCounts - .replace("{present}", String(counts.reserves.present)) - .replace( - "{absent}", - String(counts.reserves.absent + counts.reserves.excused) - ), - }, - { - label: t.declinedSummary, - value: t.playerCount.replace("{count}", String(counts.declined)), - }, - { - label: t.noResponseSummary, - value: t.memberCount.replace("{count}", String(counts.noResponse)), - }, - ] + const responseRows = buildMatchResponseRows({ + attendance, + participants: event.participants, + memberIds, + }) + const responseLabels = { + attending: t.signedUp, + declined: t.before.declined, + noResponse: t.before.noResponse, + } + const responseCounts = { attending: 0, declined: 0, noResponse: 0 } + for (const row of responseRows) responseCounts[row.response] += 1 + const summaryCards = (["attending", "declined", "noResponse"] as const).map( + (id) => ({ + id, + label: responseLabels[id], + value: t.playerCount.replace("{count}", String(responseCounts[id])), + }) + ) const filters: Array<{ id: Filter; label: string }> = [ - { - id: "roster", - label: t.filters.roster.replace( - "{count}", - String( - attendance.entries.length + - attendance.unplacedUserIds.length - ) - ), - }, - { - id: "declined", - label: t.filters.declined.replace( - "{count}", - String(counts.declined) - ), - }, - { - id: "noResponse", - label: t.filters.noResponse.replace( - "{count}", - String(counts.noResponse) - ), - }, + { id: "all", label: `${t.allResponses} (${responseRows.length})` }, + ...summaryCards.map((card) => ({ + id: card.id, + label: `${card.label} (${responseCounts[card.id]})`, + })), ] + const visibleRows = responseRows.filter( + (row) => filter === "all" || row.response === filter + ) + const groups = groupPlayers(visibleRows, (row) => row.userId) return (
- {summaryCards.map((card, index) => ( -
( + ))}
@@ -575,97 +564,213 @@ export function MatchAttendancePanel({
- {filter === "roster" ? ( -
-
- - - - - {t.columns.player} - - - {t.columns.place} - - - {t.columns.before} - - - {t.columns.attendance} - - - {t.columns.points} - - - - - {attendance.entries.length === 0 ? ( - - {t.responseHelp}

+
+ + {t.scoringRules} + +

{t.pointsHelp}

+
    + {Object.entries(scoreSettings).map(([category, delta]) => ( +
  • + {dictionary.matchDetail.close.categories[ + category as keyof RosterScoreSettings + ].replace("{count}", "1")} + : {formatDelta(delta)} +
  • + ))} +
+
+ {(filter === "all" || filter === "noResponse") && + canAdmin && + !concluded ? ( +
+ + {t.noResponseHint.replace( + "{count}", + String(responseCounts.noResponse) + )} + + +
+ ) : null} + {event.requiredRoleIds?.length ? ( +

+ {t.roleEligibilityUnknown} +

+ ) : null} +
+
+ + + + {t.columns.player} + + + {t.responseColumn} + + {t.columns.place} + + {t.columns.before} + + + {t.columns.attendance} + + + {concluded + ? t.currentRulePoints + : t.previewPoints} + + + + + {groups.length === 0 ? ( + + + {t.empty} + + + ) : null} + {groups.map((group) => { + const closed = collapsed.has(group.category) + return ( + + + - {t.empty} - + + - ) : ( - groupPlayers( - attendance.entries, - (entry) => entry.userId - ).map((group) => ( - - + {group.items.map((row) => { + const entry = row.entry + const points = pointsFor(row.userId) + const category = + resolveRosterScoreCategory({ + userId: row.userId, + participants: + event.participants, + notices, + roster: board, + }) + return ( + - {group.items.map((entry) => ( - - - - {nameOf( - entry.userId - )} - - - {placeOf(entry)} + + {nameOf(row.userId)} + + {entry ? ( + + {entry.before + .kind === + "notice" + ? t.before.notice.replace( + "{reason}", + entry + .before + .reason + ) + : t.before[ + entry + .before + .kind + ]} - - - {placeOf(entry)} - - + + - {entry.before.kind === - "notice" + { + responseLabels[ + row.response + ] + } + + + + {entry + ? placeOf(entry) + : row.response === + "attending" + ? t.unplacedTitle + : "—"} + + + {entry + ? entry.before.kind === + "notice" ? t.before.notice.replace( "{reason}", entry.before @@ -674,16 +779,18 @@ export function MatchAttendancePanel({ : t.before[ entry.before .kind - ]} - - -
+ ] + : "—"} + + + {entry ? ( +
+ { t.fromVoice } ) : null}
-
- - {formatDelta( - pointsFor( - entry.userId - ) - )} - - - ))} - - )) - )} - -
-
- {attendance.unplacedUserIds.length ? ( - <> -

- {t.unplacedTitle} ?{" "} - {attendance.unplacedUserIds.length} -

- id - )} - /> - - ) : null} -
- ) : ( -
- {filter === "noResponse" && canAdmin && !concluded ? ( -
- - {t.noResponseHint.replace( - "{count}", - String(counts.noResponse) - )} - - -
- ) : null} - {filter === "noResponse" && - event.requiredRoleIds?.length ? ( -

- {t.roleEligibilityUnknown} -

- ) : null} - id - )} - before={ - filter === "declined" - ? t.before.declined - : t.before.noResponse - } - points={ - filter === "declined" - ? scoreSettings.declined - : scoreSettings.noCategory - } - usersById={usersById} - fallbackName={dictionary.common.unknown} - columns={t.columns} - empty={t.empty} - /> -
- )} + ) : ( + + — + + )} + + + {points === null + ? t.notScored + : formatDelta(points)} + + + ) + })} + + ) + })} + + +
{changeCount > 0 ? (
@@ -892,89 +934,3 @@ function MarkGroup({
) } - -function SimplePlayerList({ - userIds, - groups, - before, - points, - usersById, - fallbackName, - columns, - empty, -}: { - userIds: string[] - groups: Array<{ category: string; label: string; items: string[] }> - before: string - points: number | null - usersById: Map - fallbackName: string - columns: { player: string; before: string; points: string } - empty: string -}) { - return ( -
- - - - {columns.player} - {columns.before} - - {columns.points} - - - - - {userIds.length === 0 ? ( - - - {empty} - - - ) : ( - groups.map((group) => ( - - - - {group.label} ? {group.items.length} - - - {group.items.map((userId) => ( - - - - {usersById.get(userId)?.name ?? - fallbackName} - - - - {before} - - - {points === null - ? "?" - : formatDelta(points)} - - - ))} - - )) - )} - -
-
- ) -} diff --git a/src/components/app/match-detail/match-detail-header.tsx b/src/components/app/match-detail/match-detail-header.tsx index dfb33882..aac720be 100644 --- a/src/components/app/match-detail/match-detail-header.tsx +++ b/src/components/app/match-detail/match-detail-header.tsx @@ -16,6 +16,7 @@ import { cn } from "@/lib/utils" export const MATCH_DETAIL_TABS = [ "overview", "attendance", + "history", "roster", "discord", "result", @@ -181,6 +182,8 @@ export function MatchDetailHeader({ ) : ( t.tabSignups ) + ) : tab === "history" ? ( + t.actions.signupHistory ) : ( t.tabs[tab] ) diff --git a/src/components/app/match-detail/match-detail-page.tsx b/src/components/app/match-detail/match-detail-page.tsx index 9daaa8a1..fc642004 100644 --- a/src/components/app/match-detail/match-detail-page.tsx +++ b/src/components/app/match-detail/match-detail-page.tsx @@ -1,4 +1,5 @@ import { matchAttendanceMemberIds } from "@/domain/rosters/match-attendance" +import { EventSignupHistory } from "@/components/app/event-signup-history" import { matchesGameScope, resolveGameScope } from "@/domain/games/game" import { SharedMatchPanel } from "@/components/app/shared-match-panel" import { sharedInvitations } from "@/lib/gateways/shared-matches" @@ -287,7 +288,7 @@ export async function MatchDetailPage({ canAdmin && !event.hostEventId ? `/${locale}/dashboard/servers/${serverId}/rosters/create?game=${gameId}&eventId=${encodeURIComponent(event.id)}` : undefined - const signupHistoryHref = `/${locale}/dashboard/servers/${serverId}/signup-activity?eventId=${event.id}` + const signupHistoryHref = tabHref("history") const reviewerIds = activeTab === "result" && review ? [ @@ -392,6 +393,7 @@ export async function MatchDetailPage({ resolveGameScope(event.gameId) ) )} + scoredUserIds={memberIds} scoreSettings={scoreSettings} closeSummary={closeSummary} messages={messages} @@ -416,6 +418,18 @@ export async function MatchDetailPage({ : undefined } signupHistoryHref={signupHistoryHref} + signupHistory={ + activeTab === "history" ? ( + + ) : null + } editHref={editHref} overview={ activeTab === "overview" ? ( diff --git a/src/components/app/match-detail/match-detail-view.tsx b/src/components/app/match-detail/match-detail-view.tsx index 88702d68..eae8e8ec 100644 --- a/src/components/app/match-detail/match-detail-view.tsx +++ b/src/components/app/match-detail/match-detail-view.tsx @@ -57,6 +57,7 @@ export type MatchDetailViewModel = { roster: Roster | null users: AppUser[] memberIds: string[] + scoredUserIds: string[] attendanceAssignments: Array<{ userId: string type: "member" | "reserve_member" | "mercenary" @@ -86,6 +87,7 @@ export type MatchDetailViewModel = { /** The overview and the live roster board come from the page. */ overview: ReactNode rosterBoard: ReactNode + signupHistory: ReactNode } /** @@ -261,6 +263,7 @@ export function MatchDetailView(model: MatchDetailViewModel) { roster={roster} users={model.users} memberIds={model.memberIds} + scoredUserIds={model.scoredUserIds} assignments={model.attendanceAssignments} scoreSettings={model.scoreSettings} closeSummary={model.closeSummary} @@ -278,6 +281,7 @@ export function MatchDetailView(model: MatchDetailViewModel) { dictionary={dictionary} /> ) : null} + {activeTab === "history" ? model.signupHistory : null} {activeTab === "roster" ? ( roster && (canAdmin || event.hostEventId || roster.published) ? ( diff --git a/src/components/app/signup-activity-feed.tsx b/src/components/app/signup-activity-feed.tsx index 3111db28..7867b8f6 100644 --- a/src/components/app/signup-activity-feed.tsx +++ b/src/components/app/signup-activity-feed.tsx @@ -6,12 +6,15 @@ import { UserPlus, } from "lucide-react" +import Link from "next/link" + import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import type { SignupActivity } from "@/lib/signup-activity" import { EmptyState } from "@/components/app/empty-state" import type { Dictionary } from "@/i18n/dictionaries" type Props = { + eventHref?: (entry: SignupActivity) => string activity: SignupActivity[] userNameById: Map dictionary: Dictionary @@ -43,6 +46,7 @@ export function SignupActivityFeed({ timezone, intlLocale, limited, + eventHref, }: Props) { if (!activity.length) return ( @@ -107,7 +111,17 @@ export function SignupActivityFeed({

- {entry.eventName} ·{" "} + {eventHref ? ( + + {entry.eventName} + + ) : ( + entry.eventName + )}{" "} + ·{" "} {entry.eventKind === "match" ? dictionary.sidebar.matches : dictionary.sidebar.trainings} diff --git a/src/domain/discord-messages/match-announcement-copy.ts b/src/domain/discord-messages/match-announcement-copy.ts index 55dc10f7..cb8d1c67 100644 --- a/src/domain/discord-messages/match-announcement-copy.ts +++ b/src/domain/discord-messages/match-announcement-copy.ts @@ -178,6 +178,7 @@ export type MatchAnnouncementCopy = { /** "Přihláška · {event}" (laid out upper case). */ label: string pickerTitle: string + pickerBody: string /** "{start} · přihlášky do {deadline}". */ meta: string pickerPlaceholder: string diff --git a/src/domain/discord-messages/match-signup-replies.test.ts b/src/domain/discord-messages/match-signup-replies.test.ts index 89aaa840..2054acd2 100644 --- a/src/domain/discord-messages/match-signup-replies.test.ts +++ b/src/domain/discord-messages/match-signup-replies.test.ts @@ -80,7 +80,7 @@ test("Přihlásit se opens the group picker with counts and full groups (L1-88, const body = text(view) assert.match( body, - /^-# \*\*PŘIHLÁŠKA · VLK VS ROG\*\*\n### Kde chceš hrát\?/ + /^-# \*\*PŘIHLÁŠKA · VLK VS ROG\*\*\n### Nejsi přihlášený — vyber skupinu/ ) assert.match(body, / · přihlášky do /) const select = view.blocks.find((block) => block.kind === "select") @@ -111,7 +111,7 @@ test("a saved sign-up offers Změnit skupinu and Nepřijdu (L1-90, L1-91)", () = /Soupisku velení zveřejní před srazem\. Kde hraješ, uvidíš pod Zobrazit zařazení\./ ) assert.deepEqual(buttons(view), [ - "Změnit skupinu|secondary|signup-picker:event-1:111111111111111111", + "Změnit skupinu|secondary|signup-picker:event-1:111111111111111111:edit", "Nepřijdu|danger|signup:event-1:NOT_ATTENDING:111111111111111111", ]) assert.deepEqual( @@ -142,13 +142,16 @@ test("a full group keeps the sign-up as a reserve (L1-93, L1-B05)", () => { max: 6, }) valid(view) - assert.equal(view.header?.title, "Tanky jsou plné (6/6)") + assert.equal( + view.header?.title, + "Přihlášený v zálohách — Tanky jsou plné (6/6)" + ) assert.match( text(view), /Přihláška platí, ale v zálohách bez skupiny\. Když se místo uvolní, velení tě může přesunout\./ ) assert.deepEqual(buttons(view), [ - "Změnit skupinu|secondary|signup-picker:event-1:111111111111111111", + "Změnit skupinu|secondary|signup-picker:event-1:111111111111111111:edit", ]) }) diff --git a/src/domain/discord-messages/match-signup-replies.ts b/src/domain/discord-messages/match-signup-replies.ts index c2507d3d..598e3b44 100644 --- a/src/domain/discord-messages/match-signup-replies.ts +++ b/src/domain/discord-messages/match-signup-replies.ts @@ -48,7 +48,7 @@ function meta({ event, copy }: SignupReplyContext) { export function changeGroupButton(context: SignupReplyContext): MessageButton { return { kind: "action", - id: `signup-picker:${context.event.eventId}:${context.event.guildId}`, + id: `signup-picker:${context.event.eventId}:${context.event.guildId}:edit`, label: context.copy.buttons.changeGroup, style: "secondary", } @@ -95,15 +95,25 @@ export function signupSelectId( * capped group saying the sign-up goes to the reserves (L1-88, L1-89). */ export function signupPickerView( - context: SignupReplyContext & { options: readonly SignupPickerOption[] } + context: SignupReplyContext & { + options: readonly SignupPickerOption[] + signedUp?: boolean + } ): MessageView { const { copy, event } = context const text = copy.replies return { accent: "clan", ephemeral: true, - header: { label: label(context), title: text.pickerTitle }, + header: { + label: label(context), + title: context.signedUp ? text.savedTitleNoGroup : text.pickerTitle, + }, blocks: [ + { + kind: "text", + markdown: context.signedUp ? text.savedBody : text.pickerBody, + }, { kind: "meta", lines: [{ text: meta(context) }] }, { kind: "select", diff --git a/src/domain/rosters/match-attendance.test.ts b/src/domain/rosters/match-attendance.test.ts index 5dc666f0..7795449a 100644 --- a/src/domain/rosters/match-attendance.test.ts +++ b/src/domain/rosters/match-attendance.test.ts @@ -4,6 +4,7 @@ import test from "node:test" import { applyAttendanceExcuses, buildMatchAttendance, + buildMatchResponseRows, matchAttendanceMemberIds, planAttendanceChanges, setRosterPresence, @@ -269,3 +270,56 @@ test("attendance includes unplaced signups and excludes ineligible memberships", ["merc"] ) }) + +test("inferred not-attending buckets do not count as explicit declines", () => { + const attendance = buildMatchAttendance({ + roster: { ...roster, notAttendingPlayerIds: ["quiet", "no", "paused"] }, + participants: [{ userId: "no", status: "not_attending" }], + notices: [], + memberIds: ["quiet", "no"], + }) + assert.deepEqual(attendance.declinedUserIds, ["no"]) + assert.deepEqual(attendance.noResponseUserIds, ["quiet"]) + assert.equal(attendance.counts.declined, 1) +}) + +test("unified responses include unplaced signups and keep response separate from placement", () => { + const participants = [ + { userId: "unplaced", status: "attending" as const }, + { userId: "no", status: "not_attending" as const }, + { userId: "sl", status: "not_attending" as const }, + ] + const attendance = buildMatchAttendance({ + roster, + participants, + notices: [], + memberIds: ["quiet", "quiet", "no"], + }) + const rows = buildMatchResponseRows({ + attendance, + participants, + memberIds: ["quiet", "quiet", "no"], + }) + assert.equal(rows.length, 8) + assert.equal( + rows.find((row) => row.userId === "quiet")?.response, + "noResponse" + ) + assert.equal( + rows.find((row) => row.userId === "unplaced")?.response, + "attending" + ) + assert.equal( + rows.find((row) => row.userId === "unplaced")?.entry, + undefined + ) + assert.equal(rows.find((row) => row.userId === "sl")?.response, "declined") + assert.equal( + rows.find((row) => row.userId === "sl")?.entry?.mark, + "present" + ) + assert.equal( + rows.find((row) => row.userId === "cmd")?.response, + "noResponse" + ) +}) diff --git a/src/domain/rosters/match-attendance.ts b/src/domain/rosters/match-attendance.ts index 02781552..0cb4e566 100644 --- a/src/domain/rosters/match-attendance.ts +++ b/src/domain/rosters/match-attendance.ts @@ -202,12 +202,11 @@ export function buildMatchAttendance(input: { ), ] const declinedUserIds = [ - ...new Set([ - ...(input.roster?.notAttendingPlayerIds ?? []), - ...input.participants + ...new Set( + input.participants .filter((participant) => participant.status === "not_attending") - .map((participant) => participant.userId), - ]), + .map((participant) => participant.userId) + ), ].filter((userId) => !seen.has(userId) && !unplacedUserIds.includes(userId)) const answered = new Set([ ...seen, @@ -312,3 +311,44 @@ export function applyAttendanceExcuses(input: { } return notices } + +/** Response comes from the event, never from an inferred roster bucket. */ +export type MatchResponse = "attending" | "declined" | "noResponse" + +export function buildMatchResponseRows(input: { + attendance: MatchAttendance + participants: readonly { + userId: string + status: "attending" | "not_attending" + }[] + memberIds: readonly string[] +}): Array<{ + userId: string + response: MatchResponse + entry?: MatchAttendanceEntry +}> { + const participants = new Map( + input.participants.map((participant) => [ + participant.userId, + participant.status, + ]) + ) + const entries = new Map( + input.attendance.entries.map((entry) => [entry.userId, entry]) + ) + const userIds = new Set([ + ...input.memberIds, + ...participants.keys(), + ...entries.keys(), + ]) + return [...userIds].map((userId) => ({ + userId, + response: + participants.get(userId) === "attending" + ? "attending" + : participants.get(userId) === "not_attending" + ? "declined" + : "noResponse", + entry: entries.get(userId), + })) +} diff --git a/src/i18n/messages/cs/match-detail.ts b/src/i18n/messages/cs/match-detail.ts index 1a197c17..7a734290 100644 --- a/src/i18n/messages/cs/match-detail.ts +++ b/src/i18n/messages/cs/match-detail.ts @@ -109,6 +109,18 @@ export const matchDetailMessages = { meetingTime: "Čas srazu", }, attendance: { + allResponses: "Všechny odpovědi", + responseColumn: "Odpověď", + scoringRules: "Pravidla bodování", + notScored: "Neboduje se", + previewPoints: "Předběžné body", + currentRulePoints: "Body dle aktuálních pravidel", + responseHelp: + "Odpověď a zařazení do soupisky jsou oddělené. Bez odpovědi znamená, že nemáme zaznamenanou reakci; nejde o odmítnutí.", + pointsHelp: + "Body se počítají pro nepozastavená členství podle nastavení Členství. Typ členství a místo náhradníka na eventu jsou odlišné věci. Hodnoty odpovídají aktuálním pravidlům, nikoliv historickému výpisu bodů. U lidí mimo bodování a eventů uzavřených bez bodů se zobrazuje Neboduje se.", + eventReserve: "Náhradník na eventu", + summaryLabel: "Shrnutí docházky", rosterSummary: "Soupiska · {count}", reservesSummary: "Zálohy · {count}", diff --git a/src/i18n/messages/de/match-detail.ts b/src/i18n/messages/de/match-detail.ts index a907938e..528bc396 100644 --- a/src/i18n/messages/de/match-detail.ts +++ b/src/i18n/messages/de/match-detail.ts @@ -109,6 +109,18 @@ export const matchDetailMessages = { meetingTime: "Treffzeit", }, attendance: { + allResponses: "Alle Antworten", + responseColumn: "Antwort", + scoringRules: "Punkteregeln", + notScored: "Keine Wertung", + previewPoints: "Voraussichtliche Punkte", + currentRulePoints: "Punkte nach aktuellen Regeln", + responseHelp: + "Antwort und Aufstellung sind getrennt. Keine Antwort bedeutet keine erfasste Anmeldeantwort, keine Absage.", + pointsHelp: + "Punkte folgen den Mitgliedschaftseinstellungen für nicht pausierte Clan-Zuordnungen. Mitgliedschaftstyp und Event-Ersatzplatz sind verschieden. Werte folgen aktuellen Regeln, keinem historischen Punktekonto. Nicht gewertete Spieler und ohne Punkte abgeschlossene Events zeigen Keine Wertung.", + eventReserve: "Event-Ersatzspieler", + summaryLabel: "Anwesenheit im Überblick", rosterSummary: "Aufstellung · {count}", reservesSummary: "Reserve · {count}", diff --git a/src/i18n/messages/en/match-detail.ts b/src/i18n/messages/en/match-detail.ts index f29f8c13..408a7c2a 100644 --- a/src/i18n/messages/en/match-detail.ts +++ b/src/i18n/messages/en/match-detail.ts @@ -109,6 +109,18 @@ export const matchDetailMessages = { meetingTime: "Meeting time", }, attendance: { + allResponses: "All responses", + responseColumn: "Response", + scoringRules: "Scoring rules", + notScored: "Not scored", + previewPoints: "Projected points", + currentRulePoints: "Points under current rules", + responseHelp: + "Response and roster placement are separate. No response means no recorded sign-up response; it is not a decline.", + pointsHelp: + "Points follow Membership settings for non-paused clan assignments. Membership type and an event reserve place are different. Values use current rules, not a historical score ledger. Ineligible players and events closed without points show Not scored.", + eventReserve: "Event reserve", + summaryLabel: "Attendance summary", rosterSummary: "Roster · {count}", reservesSummary: "Reserves · {count}", diff --git a/src/i18n/messages/fr/match-detail.ts b/src/i18n/messages/fr/match-detail.ts index 913afff1..3efb3a4e 100644 --- a/src/i18n/messages/fr/match-detail.ts +++ b/src/i18n/messages/fr/match-detail.ts @@ -109,6 +109,18 @@ export const matchDetailMessages = { meetingTime: "Heure de rassemblement", }, attendance: { + allResponses: "Toutes les réponses", + responseColumn: "Réponse", + scoringRules: "Règles de points", + notScored: "Non comptabilisé", + previewPoints: "Points prévisionnels", + currentRulePoints: "Points selon les règles actuelles", + responseHelp: + "La réponse et le placement sont distincts. Sans réponse signifie aucune réponse enregistrée, pas un refus.", + pointsHelp: + "Les points suivent les paramètres des membres pour les affectations non suspendues. Le type d’adhésion et une place de remplaçant sont distincts. Les valeurs suivent les règles actuelles, pas un historique. Les joueurs non éligibles et les événements clôturés sans points affichent Non comptabilisé.", + eventReserve: "Remplaçant de l’événement", + summaryLabel: "Bilan des présences", rosterSummary: "Composition · {count}", reservesSummary: "Remplaçants · {count}", diff --git a/src/i18n/messages/pl/match-detail.ts b/src/i18n/messages/pl/match-detail.ts index 509cd301..35f39b0b 100644 --- a/src/i18n/messages/pl/match-detail.ts +++ b/src/i18n/messages/pl/match-detail.ts @@ -110,6 +110,18 @@ export const matchDetailMessages = { meetingTime: "Godzina zbiórki", }, attendance: { + allResponses: "Wszystkie odpowiedzi", + responseColumn: "Odpowiedź", + scoringRules: "Zasady punktacji", + notScored: "Bez punktacji", + previewPoints: "Przewidywane punkty", + currentRulePoints: "Punkty według obecnych zasad", + responseHelp: + "Odpowiedź i miejsce w składzie są oddzielne. Brak odpowiedzi oznacza brak zapisanej reakcji, a nie odmowę.", + pointsHelp: + "Punkty wynikają z ustawień członkostwa dla niezawieszonych przypisań do klanu. Typ członkostwa i miejsce rezerwowe w wydarzeniu to różne rzeczy. Wartości wynikają z obecnych zasad, a nie historii punktów. Osoby nieobjęte punktacją i wydarzenia zamknięte bez punktów pokazują Bez punktacji.", + eventReserve: "Rezerwowy wydarzenia", + summaryLabel: "Podsumowanie obecności", rosterSummary: "Skład · {count}", reservesSummary: "Rezerwy · {count}", diff --git a/src/lib/clan-language/announcements.ts b/src/lib/clan-language/announcements.ts index 5816884f..890462fd 100644 --- a/src/lib/clan-language/announcements.ts +++ b/src/lib/clan-language/announcements.ts @@ -167,7 +167,9 @@ const announcementMessages: Record = { }, replies: { label: "Přihláška · {event}", - pickerTitle: "Kde chceš hrát?", + pickerTitle: "Nejsi přihlášený — vyber skupinu", + pickerBody: + "Pro přihlášení musíš vybrat skupinu. Výběr se ihned uloží. U pozdní přihlášky ještě vyplň důvod.", meta: "{start} · přihlášky do {deadline}", pickerPlaceholder: "Vyber skupinu", optionCount: { @@ -183,10 +185,11 @@ const announcementMessages: Record = { savedTitle: "Přihláška uložena: {group}", savedTitleNoGroup: "Přihláška uložena", savedBody: - "Soupisku velení zveřejní před srazem. Kde hraješ, uvidíš pod Zobrazit zařazení.", + "Přihláška je uložená. Nemusíš už nic potvrzovat. Skupinu a preference můžeš volitelně změnit přes Změnit skupinu. Soupisku velení zveřejní před srazem. Kde hraješ, uvidíš pod Zobrazit zařazení.", savedBodyTraining: "Sraz je {time}. Když nakonec nemůžeš, klikni na Nepřijdu.", - fullTitle: "{group} jsou plné ({count}/{max})", + fullTitle: + "Přihlášený v zálohách — {group} jsou plné ({count}/{max})", fullBody: "Přihláška platí, ale v zálohách bez skupiny. Když se místo uvolní, velení tě může přesunout.", noRoleTitle: "Na {group} nemáš roli", @@ -404,7 +407,9 @@ const announcementMessages: Record = { }, replies: { label: "Rejestracja · {event}", - pickerTitle: "Gdzie chcesz grać?", + pickerTitle: "Nie jesteś zapisany — wybierz grupę", + pickerBody: + "Wybierz grupę, aby się zapisać. Wybór zapisuje się od razu. Spóźnione zgłoszenie wymaga jeszcze podania powodu.", meta: "{start} · rejestracje do {deadline}", pickerPlaceholder: "Wybierz grupę", optionCount: { @@ -418,10 +423,11 @@ const announcementMessages: Record = { savedTitle: "Rejestracja została zapisana: {group}", savedTitleNoGroup: "Rejestracja została zapisana", savedBody: - "Komenda publikuje skład przed spotkaniem. W obszarze Moje zadanie zobaczysz, gdzie grasz.", + "Zapisano. Nie musisz już nic potwierdzać. Grupę i preferencje możesz opcjonalnie zmienić przyciskiem Zmień grupę. Komenda publikuje skład przed spotkaniem. W obszarze Moje zadanie zobaczysz, gdzie grasz.", savedBodyTraining: "Spotkanie to {time}. Jeśli mimo wszystko nie dasz rady, kliknij Nie dam rady.", - fullTitle: "{group} jest pełny ({count}/{max})", + fullTitle: + "Zapisano do rezerwy — {group} jest pełny ({count}/{max})", fullBody: "Twoja rejestracja się liczy, ale jako rezerwa bez grupy. Jeśli zwolni się miejsce, dowództwo może cię przenieść.", noRoleTitle: "Nie masz roli dla {group}", @@ -533,8 +539,7 @@ const announcementMessages: Record = { trainingCancelledDetail: "l’entraînement est annulé", cancelledBody: "L’événement Discord est annulé. Si tu étais inscrit, tu n’as rien à faire.", - cancelledBodyNoEvent: - "Si tu étais inscrit, tu n’as rien à faire.", + cancelledBodyNoEvent: "Si tu étais inscrit, tu n’as rien à faire.", outcomes: { win: "Victoire", loss: "Défaite", draw: "Match nul" }, confirmedBy: "confirmé par {name}", forumFooter: "Forum du match : {channel}", @@ -594,14 +599,16 @@ const announcementMessages: Record = { full: "complet", attending: "Présents ({count})", reserves: "Remplaçants ({count})", - reservesNote: "le groupe était complet, le commandement peut les réaffecter", + reservesNote: + "le groupe était complet, le commandement peut les réaffecter", general: "Sans groupe ({count})", generalNote: "le commandement les répartira dans les groupes", declined: "Absents ({count})", declinedNote: "seul le commandement voit le motif", noReason: "sans motif", unanswered: "Sans réponse ({count})", - unansweredNote: "membres qui ne se sont ni inscrits ni déclarés absents", + unansweredNote: + "membres qui ne se sont ni inscrits ni déclarés absents", originally: "initialement {group}", late: "en retard", signedUpLate: "inscription tardive", @@ -621,20 +628,24 @@ const announcementMessages: Record = { "Les {members} membres sans réponse recevront un rappel d’inscription en message privé. Le prochain rappel pourra être envoyé dans une heure au plus tôt.", remindMembers: { one: "{count} membre", other: "{count} membres" }, remindNobodyTitle: "Personne à relancer", - remindNobodyBody: "Tous les membres autorisés à s’inscrire ont répondu.", + remindNobodyBody: + "Tous les membres autorisés à s’inscrire ont répondu.", remindLimitedTitle: "Un rappel a déjà été envoyé", remindLimitedBody: "Le commandement en a envoyé un il y a moins d’une heure. Le prochain pourra être envoyé {time}.", remindClosedTitle: "Les inscriptions sont closes", remindClosedBody: "Le rappel d’inscription ne peut être envoyé que tant que les inscriptions sont ouvertes.", - remindNotAllowedTitle: "Seul le commandement peut envoyer des rappels", + remindNotAllowedTitle: + "Seul le commandement peut envoyer des rappels", remindNotAllowedWho: "Ce bouton est réservé aux joueurs disposant du rôle d’administrateur Logi.", }, replies: { label: "Inscription · {event}", - pickerTitle: "Dans quel groupe veux-tu jouer ?", + pickerTitle: "Pas encore inscrit : choisis un groupe", + pickerBody: + "Choisis un groupe pour t’inscrire. Le choix est enregistré immédiatement. Une inscription tardive nécessite aussi un motif.", meta: "{start} · inscriptions jusqu’à {deadline}", pickerPlaceholder: "Choisis un groupe", optionCount: { @@ -648,10 +659,11 @@ const announcementMessages: Record = { savedTitle: "Inscription enregistrée : {group}", savedTitleNoGroup: "Inscription enregistrée", savedBody: - "Le commandement publiera la composition avant le rassemblement. Tu trouveras ton poste dans Mon affectation.", + "Inscription enregistrée. Aucune autre action requise. Le bouton Changer de groupe permet de modifier le groupe et les préférences si tu le souhaites. Le commandement publiera la composition avant le rassemblement. Tu trouveras ton poste dans Mon affectation.", savedBodyTraining: "Le rassemblement est prévu {time}. Si tu ne peux finalement pas venir, clique sur Je ne peux pas venir.", - fullTitle: "{group} est complet ({count}/{max})", + fullTitle: + "Inscrit en réserve — {group} est complet ({count}/{max})", fullBody: "Ton inscription est prise en compte, mais tu es remplaçant sans groupe. Si une place se libère, le commandement pourra t’affecter.", noRoleTitle: "Tu n’as pas le rôle requis pour {group}", @@ -682,7 +694,8 @@ const announcementMessages: Record = { declineSavedBody: "Le commandement est informé de ton absence. Si tu changes d’avis, réinscris-toi avant {time}.", groupGoneTitle: "Ce groupe n’est plus proposé", - groupGoneBody: "Le commandement a modifié les groupes entre-temps. Fais un nouveau choix.", + groupGoneBody: + "Le commandement a modifié les groupes entre-temps. Fais un nouveau choix.", noGroupsTitle: "Aucun groupe configuré pour le moment", noGroupsBody: "Le commandement n’a pas encore défini les groupes pour ce match. Réessaie plus tard ou contacte-le.", @@ -862,7 +875,9 @@ const announcementMessages: Record = { }, replies: { label: "Sign-up · {event}", - pickerTitle: "Where do you want to play?", + pickerTitle: "Not signed up - choose a group", + pickerBody: + "Choose a group to sign up. Your choice saves immediately. Late sign-ups also require a reason.", meta: "{start} · sign-ups until {deadline}", pickerPlaceholder: "Choose a group", optionCount: { @@ -876,10 +891,10 @@ const announcementMessages: Record = { savedTitle: "Sign-up saved: {group}", savedTitleNoGroup: "Sign-up saved", savedBody: - "Command publishes the roster before the meeting. You'll see where you play under My assignment.", + "You are signed up. No further action required. Changing your group or preferences is optional. Command publishes the roster before the meeting. You'll see where you play under My assignment.", savedBodyTraining: "The meeting is {time}. If you can't make it after all, click Can't make it.", - fullTitle: "{group} is full ({count}/{max})", + fullTitle: "Signed up as reserve — {group} is full ({count}/{max})", fullBody: "Your sign-up counts, but as a reserve without a group. If a place opens up, command can move you.", noRoleTitle: "You don't have the role for {group}", @@ -1105,7 +1120,9 @@ const announcementMessages: Record = { }, replies: { label: "Anmeldung · {event}", - pickerTitle: "Wo willst du spielen?", + pickerTitle: "Noch nicht angemeldet — Gruppe wählen", + pickerBody: + "Wähle eine Gruppe, um dich anzumelden. Die Auswahl wird sofort gespeichert. Für eine verspätete Anmeldung ist noch eine Begründung nötig.", meta: "{start} · Anmeldung bis {deadline}", pickerPlaceholder: "Gruppe wählen", optionCount: { @@ -1119,10 +1136,11 @@ const announcementMessages: Record = { savedTitle: "Anmeldung gespeichert: {group}", savedTitleNoGroup: "Anmeldung gespeichert", savedBody: - "Die Führung veröffentlicht das Roster vor dem Treffen. Wo du spielst, siehst du unter Meine Einteilung.", + "Du bist angemeldet. Keine weitere Aktion erforderlich. Über Gruppe ändern kannst du optional Gruppe und Präferenzen bearbeiten. Die Führung veröffentlicht das Roster vor dem Treffen. Wo du spielst, siehst du unter Meine Einteilung.", savedBodyTraining: "Das Treffen ist {time}. Wenn du doch nicht kannst, klick auf Ich komme nicht.", - fullTitle: "{group} ist voll ({count}/{max})", + fullTitle: + "Als Reserve angemeldet — {group} ist voll ({count}/{max})", fullBody: "Deine Anmeldung gilt, aber in der Reserve ohne Gruppe. Wenn ein Platz frei wird, kann dich die Führung verschieben.", noRoleTitle: "Dir fehlt die Rolle für {group}", diff --git a/src/lib/clan-language/ranked-signup.ts b/src/lib/clan-language/ranked-signup.ts index e970e930..89b9789c 100644 --- a/src/lib/clan-language/ranked-signup.ts +++ b/src/lib/clan-language/ranked-signup.ts @@ -5,7 +5,7 @@ export const getRankedSignupMessages = clanCopy({ title: "Tes préférences de groupe", edit: "Modifier l’ordre", add: "Ajouter un autre groupe", - hint: "Classe les groupes par ordre de préférence. Un seul choix suffit. Tu ne joueras que dans un groupe.", + hint: "Ton inscription reste enregistrée. Ces modifications sont facultatives. Clique sur Enregistrer l’inscription pour les appliquer. Classe les groupes par ordre de préférence. Un seul choix suffit. Tu ne joueras que dans un groupe.", remove: "Retirer", up: "Monter", down: "Descendre", @@ -13,7 +13,8 @@ export const getRankedSignupMessages = clanCopy({ save: "Enregistrer l’inscription", previous: "Précédent", next: "Suivant", - expired: "Cet éditeur a expiré. Ouvre à nouveau S’inscrire ou Modifier l’inscription.", + expired: + "Cet éditeur a expiré. Ouvre à nouveau S’inscrire ou Modifier l’inscription.", saved: "Préférences de groupe enregistrées", empty: "Choisis ton premier groupe", stale: "Les choix ont changé. Utilise la fiche la plus récente.", @@ -22,7 +23,7 @@ export const getRankedSignupMessages = clanCopy({ title: "Your group choices", edit: "Change order", add: "Add another group", - hint: "Choose groups in preference order. One choice is enough. You will only play in one group.", + hint: "You are already signed up. These changes are optional. Click Save sign-up to apply them; leaving keeps your saved sign-up. Choose groups in preference order. One choice is enough. You will only play in one group.", remove: "Remove", up: "Move up", down: "Move down", @@ -39,7 +40,7 @@ export const getRankedSignupMessages = clanCopy({ title: "Tvé volby skupin", edit: "Změnit pořadí", add: "Přidat další skupinu", - hint: "Vyber skupiny podle svých preferencí. Jedna volba stačí. Budeš hrát pouze v jedné skupině.", + hint: "Už jsi přihlášený. Změny jsou volitelné. Klikni na Uložit přihlášku pro jejich použití. Zavření zachová uloženou přihlášku. Vyber skupiny podle svých preferencí. Jedna volba stačí. Budeš hrát pouze v jedné skupině.", remove: "Odebrat", up: "Posunout nahoru", down: "Posunout dolů", @@ -57,7 +58,7 @@ export const getRankedSignupMessages = clanCopy({ title: "Deine Gruppenwünsche", edit: "Reihenfolge ändern", add: "Weitere Gruppe hinzufügen", - hint: "Wähle Gruppen nach Wunsch. Eine Auswahl reicht. Du spielst nur in einer Gruppe.", + hint: "Du bist bereits angemeldet. Änderungen sind optional und gelten erst nach dem Speichern. Wähle Gruppen nach Wunsch. Eine Auswahl reicht. Du spielst nur in einer Gruppe.", remove: "Entfernen", up: "Nach oben", down: "Nach unten", @@ -74,7 +75,7 @@ export const getRankedSignupMessages = clanCopy({ title: "Twoje preferencje grup", edit: "Zmień kolejność", add: "Dodaj kolejną grupę", - hint: "Wybierz grupy w kolejności preferencji. Jeden wybór wystarczy. Zagrasz tylko w jednej grupie.", + hint: "Jesteś już zapisany. Zmiany są opcjonalne i wymagają zapisania. Wybierz grupy w kolejności preferencji. Jeden wybór wystarczy. Zagrasz tylko w jednej grupie.", remove: "Usuń", up: "W górę", down: "W dół",