Skip to content

v0.2.23

Choose a tag to compare

@github-actions github-actions released this 05 Nov 07:23
· 32 commits to main since this release

OpenCompare v0.2.23 release notes

English | 简体中文

v0.2.23 converges the user-visible work already merged into main: files with an unknown extension now open by their content, the README screenshots cover both languages with the capture language pinned by settings, the code view highlights a fixed set of extensions in both panes, and oversized files fall back to plain text at a stated character boundary. Comparison semantics, IPC, export and snapshot formats are untouched.

What changed

Unknown extensions open by content

When the extension cannot be identified, the open path reads the raw bytes of each side once and decides between text and binary. Text opens in the code family with the same UTF-8 or GBK encoding and newline facts as any other text file; binary is rejected with a message that names the side and the file, and the message states that the extension is checked by content and binary files are not supported.

The same decision runs at every open entry: manual paths plus argv and opencompare:// links, drag and drop with the file picker and history reopen, directory tree double-click, and the three-way merge. Known extensions keep their previous behaviour and add no read at all; an unknown extension reads each side exactly once, and the text, encoding, newline and byte facts come from that single read.

Bilingual README screenshots

The README now carries four screenshots: the workbench and the file diff, each in English and Chinese. All four were captured from the real built application against real temporary trees, and the language is pinned by the persisted settings file rather than the host locale. The captured commit, byte sizes and sha256 provenance in docs/screenshots.md were repinned to that capture.

Syntax highlighting

Both diff panes now colour code through one entry, resolveSyntaxView, and fall back to plain text whenever it returns null. The V1 language map covers explicit extensions only: ts, tsx, js, jsx, mjs, cjs, py, json, jsonc, yml, yaml, md, css, html, htm, xml, sh and bash. Files outside that map keep the previous plain-text rendering, so nothing new is guessed from content.

Token colours and diff colours are layered by overlay, so syntax foreground and diff semantic backgrounds and underlines coexist in the same line. Additions, removals, modifications and conflicts keep their existing semantics; highlighting changes only how the code itself is coloured.

Large-file fallback

Highlighting stops at SYNTAX_MAX_HIGHLIGHT_CHARS = 262_144, counted after CRLF is folded to LF. A side whose folded length is at or below the threshold is highlighted, and a side one character past it falls back to plain text before it reaches the syntax cache or the tokenizer. The fallback is a stated behaviour boundary, not a degradation mode: the plain path keeps the same rows, counts, markers and diff semantics.

Windows installer and portable zip

Windows keeps the same packaging contract as the previous release; see the portable download note below.

Windows portable download

Windows ships both the NSIS installer and a portable .zip that runs right after extraction with no installation step. Auto-update keeps resolving to the NSIS installer, so the portable zip is a download only.

macOS signing and notarization

The macOS build keeps Developer ID signing and Apple notarization, and CI fails closed when the signing credentials are missing. This release does not change that posture.

Not in this release

  • The ignore whitespace switch is still off by default, and when it is on only spaces and tabs are swallowed, with highlights and the difference count reading one comparison result while the status bar shows raw values.
  • Reload still re-reads the current pair in the same session, so the scroll position and switches stay put, and an unreadable side keeps the previous result.
  • The swap action still exchanges content, the ruler and counts and the status bar values, and swapping again restores the original order.
  • Syntax highlighting adds no new comparison semantics: the extension map is explicit, unknown extensions stay plain text, and no language is inferred from content.
  • No changes to export or snapshot formats, directory scanning, the release channel or comparison semantics beyond the content fallback above.
  • CI, coverage, test, screenshot provenance and ratchet work in this range is validation plumbing, not a user feature.

Risk and verification scope

The new part of v0.2.23 relative to v0.2.21 is the content-based fallback decision at open, the screenshot assets, the V1 syntax overlay and the large-file fallback boundary. Comparison semantics, IPC, export and snapshot formats are untouched. Verification covers the content-family decision and its read budget, the four open entry points, the extension map and the token/diff overlay in both panes, the exact threshold boundary through the large-file gate, and the bilingual notes and screenshot provenance through the repository gates. This release states no performance or memory numbers.

Upgrade

Upgrade from v0.2.21. Replace the app with the v0.2.23 package for your platform (macOS .dmg / .zip, Windows installer, Linux .AppImage / .deb). On Windows you can either install with the NSIS .exe or download OpenCompare-0.2.23-win-x64.zip and run it right after extracting; auto-update still only uses the NSIS .exe. No data migration is needed; existing sessions and settings keep working.


简体中文

OpenCompare v0.2.23 发布说明

English | 简体中文

v0.2.23 收敛已合入主干、用户可见的改动:扩展名无法识别的文件改按内容判定打开,README 截图补齐中英两套,代码视图对固定扩展名着色,超大文件在明确的字符边界回落纯文本。除这些改动外,比较语义、IPC、导出与快照格式都没有改动。

本次变化

未知扩展名按内容判定

扩展名无法识别时,打开链路对每一侧只读取一次原始字节,据此判定文本或二进制。文本按代码家族打开,UTF-8 / GBK 编码与换行事实与其他文本文件一致;二进制在打开链路被拒绝,提示写明是哪一侧的哪个文件,并说明「扩展名无法识别时按内容判断,二进制文件不支持」。

同一判定在四个打开入口保持一致:手动路径与 argv / opencompare://、拖放 / 选择器 / 历史重开、目录树双击,以及三向合并。已知扩展名的行为与读取次数不变,不新增探测;未知扩展名每侧恰好读取一次,正文、编码、换行与字节事实都来自这一次读取。

双语 README 截图

README 现有四张截图:工作台与文件对比各一张,中英各一套。四张图都取自真实构建的应用与真实临时目录,语言由持久化设置文件钉住,而不是宿主 locale。docs/screenshots.md 的 captured commit、字节数与 sha256 provenance 已按该次取证重钉。

语法高亮

两个差异面板现在都通过唯一入口 resolveSyntaxView 着色,返回 null 时按纯文本渲染。V1 扩语言映射只认显式扩展名:ts、tsx、js、jsx、mjs、cjs、py、json、jsonc、yml、yaml、md、css、html、htm、xml、sh、bash。映射之外的扩展名保持原有纯文本渲染,不从内容猜测语言。

token 颜色与差异颜色由 overlay 叠合,语法前景色与差异语义背景、下划线在同一行共存。新增、删除、修改、冲突四态语义不变,着色只改变代码本身的颜色。

大文件回落

着色上限为 SYNTAX_MAX_HIGHLIGHT_CHARS = 262_144,按 CRLF 折叠成 LF 后的字符数计算。折叠后长度小于等于阈值的文件着色;多一个字符即回落纯文本,并且在进入语法缓存与分词之前完成回落。回落是一条明确的行为边界而非降级模式:纯文本路径保持相同的行、计数、指示条与差异语义。

Windows 安装包与免安装 zip

Windows 的打包口径与上一版一致;免安装下载说明见下节。

Windows 免安装包

Windows 同时提供 NSIS 安装包与免安装 .zip,解压即用、无安装步骤。自动更新仍指向 NSIS 安装包,免安装 zip 只作为下载。

macOS 签名与公证

macOS 包保持 Developer ID 签名与 Apple 公证,签名凭据缺失时 CI fail-closed。本版不改这一口径。

不做的事

  • 「忽略空白差异」开关仍默认关闭;开启时只吞空格与制表符,行级高亮、行内高亮与差异计数仍读取同一份比较结果,状态栏仍显示原始值。
  • 重载仍在原会话读取当前文件对,不新建会话,滚动位置与开关状态保持不变;某一侧读取失败时保留上一次结果。
  • 交换仍只对调内容、状态栏原始值、指示条与计数,再次交换即可复原。
  • 语法高亮不新增比较语义:扩展名映射是显式的,映射之外仍是纯文本,不从内容推断语言。
  • 不改导出与快照格式、目录扫描口径与发布通道;除上述内容兜底外,比较语义保持原状。
  • 本范围内的 CI、覆盖率、测试、截图取证与 ratchet 调整属于验证面,不写成用户功能。

风险与验证规模

v0.2.23 相对 v0.2.21 的新增部分是内容兜底判定、截图资产、V1 语法叠合与大文件回落边界。比较语义、IPC、导出与快照格式均未改动。验证覆盖内容家族判定与读取预算、四个打开入口、两侧的扩展名映射与 token×diff 叠合、大文件门禁对阈值边界的精确断言,以及双语说明与截图 provenance,均通过仓库门禁。本文件不写任何性能或内存数字。

升级方式

建议从 v0.2.21 升级:下载 v0.2.23 对应平台的新安装包覆盖安装(macOS .dmg / .zip,Windows 安装包,Linux .AppImage / .deb)。Windows 可选 NSIS 安装包,或下载 OpenCompare-0.2.23-win-x64.zip 解压即用;自动更新仍只走 NSIS exe。本次不需要迁移数据,已有的会话与设置照常可用。

Full Changelog: v0.2.21...v0.2.23