peppa/apps/web/lib/shortcuts.ts
Асель 9052f3245f Merge main into task/pep-98: PEP-112…124 texts through the dictionary
Main's new wording (PEP-123 «Продакт» words) kept and wrapped in t()/m();
wording(mode, locale) gives English words for {task}/{runner} placeholders;
glossary check (pnpm lint) passes; English for all new keys (en/merge-*.ts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:04:39 +05:00

42 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Keyboard shortcuts (PEP-52): one list for the «?» dialog and /help/shortcuts.
// Texts are dictionary keys (m): translate where rendered with t(s.what) / t(PALETTE_KEYS).
import { m } from "@peppa/shared/i18n";
import type { Words } from "@peppa/shared/wording";
export interface Shortcut {
keys: string[];
what: string;
where?: string;
}
/** PEP-123: the list in the words of the user's view; «Продакт» has no terminals of agents. */
export function shortcutsFor(w: Words): Shortcut[] {
if (w.engineer) return SHORTCUTS;
return [
{ keys: ["⌘K", "Ctrl+K"], what: m("Поиск и переход к проекту, задаче или вопросу; «В работу», «Ответить»") },
{ keys: ["g", "h"], what: m("Главная") },
{ keys: ["g", "p"], what: m("Проекты") },
{ keys: ["g", "s"], what: m("Настройки") },
{ keys: ["a"], what: m("Перейти к полю ответа на первый открытый вопрос"), where: m("Главная, задача") },
{ keys: ["?"], what: m("Список сочетаний") },
{ keys: ["Esc"], what: m("Закрыть поиск или окно") },
];
}
export const SHORTCUTS: Shortcut[] = [
{ keys: ["⌘K", "Ctrl+K"], what: m("Командная палитра: поиск и переход к проекту, стори, раннеру, вопросу; «В работу», «Ответить»") },
{ keys: ["/"], what: m("Фокус в поиск на странице"), where: m("списки с полем поиска (Раннеры)") },
{ keys: ["g", "h"], what: m("Главная") },
{ keys: ["g", "p"], what: m("Проекты") },
{ keys: ["g", "r"], what: m("Раннеры") },
{ keys: ["g", "s"], what: m("Настройки") },
{ keys: ["j"], what: m("Следующий раннер"), where: m("Раннеры") },
{ keys: ["k"], what: m("Предыдущий раннер"), where: m("Раннеры") },
{ keys: ["a"], what: m("Фокус в поле ответа первого открытого вопроса"), where: m("Главная, стори, раннер") },
{ keys: ["?"], what: m("Список сочетаний") },
{ keys: ["Esc"], what: m("Закрыть палитру или окно") },
];
/** In the palette: ↑/↓ choose, Enter opens, ⌘Enter / Ctrl+Enter — «В работу» for a backlog story. */
export const PALETTE_KEYS = m("↑↓ — выбор · Enter — открыть · ⌘Enter — в работу · Esc — закрыть");