Standardize title-style menu announcements
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// Maintainer-controlled web client version.
|
||||
// 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.
|
||||
window.CHGRID_TIME_ZONE = "America/Detroit";
|
||||
|
||||
@@ -249,7 +249,9 @@ function buildHelpLines(help: HelpData): string[] {
|
||||
function announceMenuEntry(title: string, firstOption: string): void {
|
||||
const trimmedTitle = title.trim();
|
||||
const trimmedOption = firstOption.trim();
|
||||
updateStatus(`${trimmedTitle}. ${trimmedOption}.`);
|
||||
const titleSuffix = /[.!?]$/.test(trimmedTitle) ? '' : '.';
|
||||
const optionSuffix = /[.!?]$/.test(trimmedOption) ? '' : '.';
|
||||
updateStatus(`${trimmedTitle}${titleSuffix} ${trimmedOption}${optionSuffix}`);
|
||||
audio.sfxUiBlip();
|
||||
}
|
||||
|
||||
@@ -1105,8 +1107,7 @@ function openItemManagementConfirm(context: ItemManagementConfirmContext): void
|
||||
itemManagementConfirmContext = context;
|
||||
itemManagementConfirmIndex = 0;
|
||||
state.mode = 'confirmYesNo';
|
||||
updateStatus(`${context.prompt} ${YES_NO_OPTIONS[itemManagementConfirmIndex].label}.`);
|
||||
audio.sfxUiBlip();
|
||||
announceMenuEntry(context.prompt, YES_NO_OPTIONS[itemManagementConfirmIndex].label);
|
||||
}
|
||||
|
||||
/** 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.mode = 'addItem';
|
||||
updateStatus(`Add item: ${itemTypeLabel(itemTypeSequence[state.addItemTypeIndex])}.`);
|
||||
audio.sfxUiBlip();
|
||||
announceMenuEntry('Add item', itemTypeLabel(itemTypeSequence[state.addItemTypeIndex]));
|
||||
return;
|
||||
}
|
||||
case 'locateOrListItems':
|
||||
@@ -3262,8 +3262,7 @@ function handleAdminUserListModeInput(code: string, key: string): void {
|
||||
if (adminPendingUserAction === 'delete_account') {
|
||||
adminDeleteConfirmIndex = 0;
|
||||
state.mode = 'adminUserDeleteConfirm';
|
||||
updateStatus(`Delete account ${selected.username}? ${YES_NO_OPTIONS[adminDeleteConfirmIndex].label}.`);
|
||||
audio.sfxUiBlip();
|
||||
announceMenuEntry(`Delete account ${selected.username}?`, YES_NO_OPTIONS[adminDeleteConfirmIndex].label);
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user