Enable PgUp/PgDn jumps in item property list cycling

This commit is contained in:
Jage9
2026-02-28 02:46:50 -05:00
parent d9b134b3db
commit b0b6744a52
3 changed files with 14 additions and 4 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.02.28 R305"; window.CHGRID_WEB_VERSION = "2026.02.28 R306";
// 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

@@ -91,7 +91,7 @@ export function createItemPropertyEditor(deps: EditorDeps): {
deps.sfxUiBlip(); deps.sfxUiBlip();
return; return;
} }
if (code === 'ArrowLeft' || code === 'ArrowRight') { if (code === 'ArrowLeft' || code === 'ArrowRight' || code === 'PageUp' || code === 'PageDown') {
const selectedKey = deps.state.itemPropertyKeys[deps.state.itemPropertyIndex]; const selectedKey = deps.state.itemPropertyKeys[deps.state.itemPropertyIndex];
if (!deps.isItemPropertyEditable(item, selectedKey)) { if (!deps.isItemPropertyEditable(item, selectedKey)) {
deps.updateStatus(`${deps.itemPropertyLabel(selectedKey)} is not editable.`); deps.updateStatus(`${deps.itemPropertyLabel(selectedKey)} is not editable.`);
@@ -105,7 +105,15 @@ export function createItemPropertyEditor(deps: EditorDeps): {
0, 0,
options.findIndex((option) => option.toLowerCase() === currentRaw), options.findIndex((option) => option.toLowerCase() === currentRaw),
); );
const delta = code === 'ArrowRight' ? 1 : -1; const pageJump = Math.min(10, Math.max(1, options.length - 1));
const delta =
code === 'ArrowRight'
? 1
: code === 'ArrowLeft'
? -1
: code === 'PageDown'
? pageJump
: -pageJump;
const nextIndex = (currentIndex + delta + options.length) % options.length; const nextIndex = (currentIndex + delta + options.length) % options.length;
const nextValue = options[nextIndex]; const nextValue = options[nextIndex];
deps.suppressItemPropertyEchoMs(600); deps.suppressItemPropertyEchoMs(600);
@@ -137,7 +145,8 @@ export function createItemPropertyEditor(deps: EditorDeps): {
: Number.isFinite(min) : Number.isFinite(min)
? min ? min
: 0; : 0;
const delta = code === 'ArrowRight' ? step : -step; const multiplier = code === 'PageUp' || code === 'PageDown' ? 10 : 1;
const delta = (code === 'ArrowRight' || code === 'PageUp' ? step : -step) * multiplier;
const anchor = Number.isFinite(min) ? min : 0; const anchor = Number.isFinite(min) ? min : 0;
const attempted = snapNumberToStep(currentValue + delta, step, anchor); const attempted = snapNumberToStep(currentValue + delta, step, anchor);
let nextValue = attempted; let nextValue = attempted;

View File

@@ -74,6 +74,7 @@ This document is the authoritative keymap for the client.
Applies to effect select, user/item list modes, item selection, item property list, and property option select. Applies to effect select, user/item list modes, item selection, item property list, and property option select.
- `ArrowUp` / `ArrowDown`: Move selection - `ArrowUp` / `ArrowDown`: Move selection
- `PageUp` / `PageDown` in item property list: Jump 10 values for left/right-editable option fields
- `PageUp` / `PageDown` in item property option select: Jump 10 options backward/forward - `PageUp` / `PageDown` in item property option select: Jump 10 options backward/forward
- `ArrowLeft` / `ArrowRight` in user list: Lower/raise selected user listen volume (`0.5..4.0`) - `ArrowLeft` / `ArrowRight` in user list: Lower/raise selected user listen volume (`0.5..4.0`)
- `Enter`: Confirm selection - `Enter`: Confirm selection