/** * Fork selector (`o` in the sessions pane, what pi's `/fork` shows): the title * and footer hints for the centered menu of user messages to fork before. * * Like ./restore-dialog.ts, this is only the wording for a ./select-dialog.ts * preset — the panel builds the item list from the session's fork points, the * confirmation (./confirm-dialog.ts) then guards the actual fork. * * fork 选择器只是通用选择菜单(SelectDialog,带滚动窗口)的一个预设:标题 + 提示。 * 选项来自会话里的 user 消息(app 层从 data 拿),默认停在最后一条(pi 的默认)。 */ import { t } from "../../i18n/index.ts"; import type { KeyHint } from "../../types.ts"; /** Title on the top border of the fork selector. */ export function forkDialogTitle(): string { return t("dialog.forkTitle"); } /** Footer hints while the fork selector is open. */ export function forkDialogHints(): KeyHint[] { return [ ["j/k", t("hint.move")], ["Enter", t("hint.select")], ["Esc", t("hint.cancel")], ]; } /** * Title-bar subject of the confirmation: the picked message's position in the * list, not its text (the selector already showed it, and a 60-column box * would cut it to a meaningless "…"). Esc goes back to that same entry. */ export function forkDialogSubject(index: number, total: number): string { return `#${index + 1}/${total}`; }