> ## Documentation Index
> Fetch the complete documentation index at: https://ophel.app/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 阅读历史、滚动锁定与位置恢复

> Ophel 自动记录并恢复每个对话的阅读进度，配合滚动锁定防止 AI 生成时打断阅读，以及一键锚点在长对话中来回跳转。

export const ShortcutLegend = ({lang = "en"}) => {
  const isZh = lang === "zh";
  return <div className="ophel-shortcut-legend" role="note">
      <div className="ophel-shortcut-legend-title">
        {isZh ? "跨平台按键说明" : "Cross-platform key mapping"}
      </div>
      <div className="ophel-shortcut-legend-body">
        {isZh ? <>
            文档中的快捷键会同时显示 Windows/Linux 与 Mac 写法：
            <code>Ctrl</code> 对应 <code>Command</code>，
            <code>Alt</code> 对应 <code>Option</code>。唯一例外是提示词发送，
            <code>Ctrl+Enter</code> 在 Mac 上也使用 <code>Ctrl+Enter</code>。
          </> : <>
            Shortcuts show both Windows/Linux and Mac keys: <code>Ctrl</code> maps
            to <code>Command</code>, and <code>Alt</code> maps to
            <code>Option</code>. Prompt submit is the only exception:
            <code>Ctrl+Enter</code> remains <code>Ctrl+Enter</code> on Mac.
          </>}
      </div>
    </div>;
};

export const Shortcut = ({combo, mac, sameOnMac = false}) => {
  const keyLabels = {
    arrowup: {
      win: "Up",
      mac: "↑"
    },
    arrowdown: {
      win: "Down",
      mac: "↓"
    },
    arrowleft: {
      win: "Left",
      mac: "←"
    },
    arrowright: {
      win: "Right",
      mac: "→"
    },
    up: {
      win: "Up",
      mac: "↑"
    },
    down: {
      win: "Down",
      mac: "↓"
    },
    left: {
      win: "Left",
      mac: "←"
    },
    right: {
      win: "Right",
      mac: "→"
    },
    esc: {
      win: "Esc",
      mac: "Esc"
    },
    escape: {
      win: "Esc",
      mac: "Esc"
    },
    enter: {
      win: "Enter",
      mac: "Enter"
    },
    shift: {
      win: "Shift",
      mac: "⇧"
    },
    backslash: {
      win: "\\",
      mac: "\\"
    }
  };
  const modifierLabels = {
    ctrl: {
      win: "Ctrl",
      mac: "⌘"
    },
    control: {
      win: "Ctrl",
      mac: "⌘"
    },
    cmd: {
      win: "Ctrl",
      mac: "⌘"
    },
    command: {
      win: "Ctrl",
      mac: "⌘"
    },
    alt: {
      win: "Alt",
      mac: "⌥"
    },
    option: {
      win: "Alt",
      mac: "⌥"
    },
    shift: {
      win: "Shift",
      mac: "⇧"
    }
  };
  const normalizeToken = token => String(token || "").trim();
  const formatKey = (token, platform) => {
    const normalized = normalizeToken(token);
    const key = normalized.toLowerCase();
    const mapped = keyLabels[key];
    if (mapped) return mapped[platform];
    if (normalized.length === 1) return normalized.toUpperCase();
    return normalized;
  };
  const formatCombo = (value, platform) => String(value || "").split("+").map(normalizeToken).filter(Boolean).map(token => {
    const mapped = modifierLabels[token.toLowerCase()];
    return mapped ? mapped[platform] : formatKey(token, platform);
  }).join(platform === "mac" ? "" : "+");
  const windowsLabel = formatCombo(combo, "win");
  const macLabel = sameOnMac ? windowsLabel : mac || formatCombo(combo, "mac");
  const title = windowsLabel === macLabel ? windowsLabel : `Windows/Linux: ${windowsLabel}; Mac: ${macLabel}`;
  return <span className="ophel-shortcut" title={title}>
      <code>{windowsLabel}</code>
      {windowsLabel !== macLabel && <>
          <span className="ophel-shortcut-separator"> / </span>
          <code>{macLabel}</code>
        </>}
    </span>;
};

export const Icon = ({src, alt}) => <img src={typeof window !== "undefined" && typeof src === "string" && src.startsWith("/images/icons/") && (window.location.pathname === "/docs" || window.location.pathname.startsWith("/docs/")) ? `/docs${src}` : src} alt={alt} width="18" height="18" style={{
  display: "inline-block",
  verticalAlign: "-0.2em",
  margin: "0 0.15em"
}} />;

Ophel 记录你在每个对话中的阅读位置，让你不再需要重新滚动寻找上次读到的地方。配合滚动锁定，在 AI 生成时固定你的阅读位置；再加上一组快速导航锚点，在长对话的不同位置之间瞬间跳转。

## 阅读历史

对话太长，中途离开后再回来，很难记起上次读到哪里——阅读历史功能解决这个问题。

Ophel 会在你离开时悄悄记录每个对话的滚动位置。下次重新打开时，自动滚动到上次离开的地方，无需手动拖动滚动条。

**设置 → 功能 → 阅读历史**：

| 设置项    | 说明                 | 默认   |
| ------ | ------------------ | ---- |
| 记录阅读位置 | 是否开启阅读位置记录         | 开启   |
| 自动恢复   | 重新打开对话时是否自动滚动到上次位置 | 开启   |
| 保留天数   | 历史记录的有效期，过期自动清理    | 30 天 |

可选保留时长：1 天 / 3 天 / 7 天 / 30 天 / 90 天 / 永久。

<Tip>
  如果某次你不想自动跳转（例如想从头读一遍），可在 URL 末尾加上
  `?ophel_skip_restore=1` 打开对话，Ophel 会跳过这次的自动恢复，不影响之后的正常行为。
</Tip>

## 滚动锁定

AI 每生成一段内容，页面就会自动滚动到最新处——这在你正在阅读上方某段内容时会打断视线。

**滚动锁定**开启后，AI 生成期间页面不再自动滚动，你的阅读位置被固定住。AI 生成完毕后，一切恢复正常。

**开启方式（任一）：**

<Tabs>
  <Tab title="键盘快捷键">
    按 <Shortcut combo="alt+s" /> 切换开启/关闭。
  </Tab>

  <Tab title="工具箱菜单">
    点击浮动按钮组中的 <Icon src="/docs/images/icons/tools.svg" alt="工具箱图标" /> 工具箱图标，选择 <Icon src="/docs/images/icons/scroll-lock.svg" alt="滚动锁定图标" /> **滚动锁定**。
  </Tab>
</Tabs>

<Note>
  滚动锁定是临时的会话状态，页面刷新后不保留。如需在某个站点每次都开启，可在每次加载后手动切换。
</Note>

## 导航锚点

浮动按钮组提供三个滚动快捷键，同时构成一套导航系统：

| 按钮                                                               | 键盘快捷键                      | 功能           |
| ---------------------------------------------------------------- | -------------------------- | ------------ |
| <Icon src="/docs/images/icons/scroll-top.svg" alt="滚到顶部图标" /> 滚到顶部    | <Shortcut combo="alt+t" /> | 加载完整历史并跳转到顶部 |
| <Icon src="/docs/images/icons/scroll-bottom.svg" alt="滚到底部图标" /> 滚到底部 | <Shortcut combo="alt+b" /> | 跳转到最新消息      |
| <Icon src="/docs/images/icons/anchor.svg" alt="返回锚点图标" /> 返回锚点        | <Shortcut combo="alt+z" /> | 跳回上次保存的位置    |

每次使用**滚到顶部**或**滚到底部**，Ophel 都会先把当前位置保存为锚点。点击**返回锚点**即可跳回。再次点击可在锚点位置和当前位置之间来回切换——非常适合在长对话中交叉对比两处内容。

<Tip>
  如果想直接保存当前位置为锚点而不触发滚动，可在 **设置 → 通用 → 快捷按钮** 中启用
  <Icon src="/docs/images/icons/manual-anchor.svg" alt="手动锚点图标" /> **手动锚点**按钮（默认隐藏）。
</Tip>

## 书签

Ophel 支持为对话中的特定消息添加书签，方便之后快速跳转。书签项会显示在大纲面板中，你可以直接从侧边栏点击跳转。

如需删除指向已不存在内容的失效书签，打开 <Icon src="/docs/images/icons/tools.svg" alt="工具箱图标" /> **工具箱**，选择 <Icon src="/docs/images/icons/cleanup.svg" alt="清除无效收藏图标" /> **清除无效收藏**。
