Skip to content

MDeX-2.1.0

Choose a tag to compare

@fwzheng fwzheng released this 31 Jul 03:20

v2.1.0

AI 配置预设:支持保存多套命名的 API 配置(如 OpenAI / Anthropic / 本地 Ollama),并可在它们之间一键切换。
AI configuration profiles: save multiple named API configs and switch between them with one click (e.g. OpenAI / Anthropic / local Ollama).

新增 / Features

  • AI 配置预设管理:AI 设置弹窗现已升级为配置管理器风格,左侧为预设列表,右侧为详细表单。您现在可以创建命名配置(包含配置名、提供商、端点、模型、温度及 Key),支持保存及删除(含二次确认),并直接从列表切换当前使用的 API。老用户原有的单一配置将自动迁移为「默认」预设。Key 的存储方式保持不变,仅存于本机 localStorage,绝不会随会话备份外泄。
    AI configuration profiles: the AI settings dialog is now a two-pane profile manager (preset list on the left, form on the right). Create named profiles (name + provider/endpoint/model/temperature/key), save, delete (with confirm), and pick from the list to switch the active API; existing single-config users are auto-migrated to a "Default" profile. As before, keys live only in this machine's localStorage and are never included in session backups.
  • 编辑↔预览同步定位优化:大幅提升双向同步的精确度。点击编辑区定位预览时,采用 DOM 实测实现精确居中;滚动同步机制升级为“渲染时测量、滚动时读取缓存”模式:预览侧采用细粒度 Y 轴缓存,编辑侧新增 #editor-yprobe 镜像层,利用 Range 实测每行的真实 Y 值,从而使滚动精度接近点击级别。此外,修复了图片加载后导致的预览偏移(图片加载时主动重测缓存),以及镜像层字号未随缩放同步导致的发布版偏移问题。
    Edit↔Preview sync accuracy: editor→preview click now DOM-measures the exact target; scroll sync measures Y at render time and only reads cache while scrolling (fine-grained Y cache on the preview side; a new #editor-yprobe mirror layer range-measures each editor line's real Y), reaching near-click precision; also fixed preview drift after images load (via img-load re-measure) and a release-only drift caused by the mirror layer not syncing its font-size on zoom.
  • AI 浮层显示当前 API:浮层头部的 Chip 标签现在会显示当前激活的 API 预设名称,并在切换预设后实时更新。
    AI pane active-API chip: the pane header shows the active profile name and updates on switch.
  • 版本号升级至 2.1.0。Version bumped to 2.1.0.

修复 / Fixes

  • 修复长文档末尾 AI 选区阴影跳行问题:此前的版本中,#editor(textarea)在内容溢出时会出现原生垂直滚动条,而镜像层 #editor-hl 设置为 overflow:hidden(无滚动条)。这导致两层的可用文本宽度相差一个滚动条宽度,进而使得软换行的断行点不一致,造成行数与 scrollHeight 的差异。在长文档末尾,这种差异会累积,导致像素级同步(hl.scrollTop = editor.scrollTop)失效,蓝色选区阴影因此跳到下一行(文档开头因 scrollTop≈0 无累积,故显示正常)。本次更新将两处统一设置为 overflow-y: scroll,确保两层的可用文本宽度逐像素相等,彻底恢复对齐。此修复也同步解决了搜索高亮在长文档末尾可能出现的同类偏移隐患。
    AI selection shadow skipping a line at the end of long documents: the textarea's native scrollbar and the #editor-hl mirror's overflow:hidden left the two layers with different usable text widths, so soft-wrapped lines broke at different points and the pixel-level scrollTop sync drifted near the end of long docs. Unified both to overflow-y: scroll; also fixes the same latent drift in search highlighting.