Standardize title-style menu announcements

This commit is contained in:
Jage9
2026-02-28 20:44:24 -05:00
parent 313ff581c0
commit ca300a084e
2 changed files with 7 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
// Maintainer-controlled web client version. // Maintainer-controlled web client version.
// Format: YYYY.MM.DD Rn (example: 2026.02.20 R2) // Format: YYYY.MM.DD Rn (example: 2026.02.20 R2)
window.CHGRID_WEB_VERSION = "2026.03.01 R325"; window.CHGRID_WEB_VERSION = "2026.03.01 R326";
// Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid. // Optional display timezone for timestamps. Falls back to America/Detroit if unset/invalid.
window.CHGRID_TIME_ZONE = "America/Detroit"; window.CHGRID_TIME_ZONE = "America/Detroit";

View File

@@ -249,7 +249,9 @@ function buildHelpLines(help: HelpData): string[] {
function announceMenuEntry(title: string, firstOption: string): void { function announceMenuEntry(title: string, firstOption: string): void {
const trimmedTitle = title.trim(); const trimmedTitle = title.trim();
const trimmedOption = firstOption.trim(); const trimmedOption = firstOption.trim();
updateStatus(`${trimmedTitle}. ${trimmedOption}.`); const titleSuffix = /[.!?]$/.test(trimmedTitle) ? '' : '.';
const optionSuffix = /[.!?]$/.test(trimmedOption) ? '' : '.';
updateStatus(`${trimmedTitle}${titleSuffix} ${trimmedOption}${optionSuffix}`);
audio.sfxUiBlip(); audio.sfxUiBlip();
} }
@@ -1105,8 +1107,7 @@ function openItemManagementConfirm(context: ItemManagementConfirmContext): void
itemManagementConfirmContext = context; itemManagementConfirmContext = context;
itemManagementConfirmIndex = 0; itemManagementConfirmIndex = 0;
state.mode = 'confirmYesNo'; state.mode = 'confirmYesNo';
updateStatus(`${context.prompt} ${YES_NO_OPTIONS[itemManagementConfirmIndex].label}.`); announceMenuEntry(context.prompt, YES_NO_OPTIONS[itemManagementConfirmIndex].label);
audio.sfxUiBlip();
} }
/** Clears temporary item-management menu state. */ /** Clears temporary item-management menu state. */
@@ -2316,8 +2317,7 @@ function handleNormalModeInput(code: string, shiftKey: boolean): void {
} }
state.addItemTypeIndex = Math.max(0, Math.min(state.addItemTypeIndex, itemTypeSequence.length - 1)); state.addItemTypeIndex = Math.max(0, Math.min(state.addItemTypeIndex, itemTypeSequence.length - 1));
state.mode = 'addItem'; state.mode = 'addItem';
updateStatus(`Add item: ${itemTypeLabel(itemTypeSequence[state.addItemTypeIndex])}.`); announceMenuEntry('Add item', itemTypeLabel(itemTypeSequence[state.addItemTypeIndex]));
audio.sfxUiBlip();
return; return;
} }
case 'locateOrListItems': case 'locateOrListItems':
@@ -3262,8 +3262,7 @@ function handleAdminUserListModeInput(code: string, key: string): void {
if (adminPendingUserAction === 'delete_account') { if (adminPendingUserAction === 'delete_account') {
adminDeleteConfirmIndex = 0; adminDeleteConfirmIndex = 0;
state.mode = 'adminUserDeleteConfirm'; state.mode = 'adminUserDeleteConfirm';
updateStatus(`Delete account ${selected.username}? ${YES_NO_OPTIONS[adminDeleteConfirmIndex].label}.`); announceMenuEntry(`Delete account ${selected.username}?`, YES_NO_OPTIONS[adminDeleteConfirmIndex].label);
audio.sfxUiBlip();
return; return;
} }
return; return;