Skip to content

feat: add character-level diff mode - #4373

Open
ryanchou1994 wants to merge 2 commits into
dgtlmoon:masterfrom
ryanchou1994:fix/char-level-diff
Open

ryanchou1994 wants to merge 2 commits into
dgtlmoon:masterfrom
ryanchou1994:fix/char-level-diff

Conversation

@ryanchou1994

@ryanchou1994 ryanchou1994 commented Sep 4, 2026 •

Copy link
Copy Markdown

Summary

Resolves #4194.

Add a Characters diff option alongside Lines and Words in the web UI and history-diff API (type=diffChars). The HTML-aware tokenizer keeps tags, comments, declarations, and raw-text boundaries intact while isolating changed text characters. It treats Unicode code points as characters and preserves the input when reassembled, including quoted > attributes and literal or trailing < characters.

The API reference and translation catalogs include the new option. This update rebases the change onto 9c4c95dd while preserving the new diff header and filter controls.

Verification

Passed on macOS (Python 3.13) and Linux (Python 3.11):

  • Notification diff unit tests: 34 passed, plus 3 subtests.
  • Focused API/source tests and the complete diff-header test file: 12 passed. Fetches used a local Flask fixture.
  • Ruff checks: E9,F63,F7,F82,INT.
  • OpenAPI schema validation and exact equality between the generated reference's embedded specification and the YAML.

Also passed:

  • Babel 2.18 catalog extract/update/compile round trips on macOS and Linux with Python 3.13; all 17 language catalogs unchanged, apart from the ignored POT creation timestamp.
  • Dennis catalog checks on both platforms and msgfmt --check on macOS.
  • Source SHA256 verification before and after Linux validation, and git diff --check for the PR diff.

Linux test containers had external networking disabled. The full application suite and browser automation were not run.

Copilot AI lite review requested due to automatic review settings September 4, 2026 07:54

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ryanchou1994
ryanchou1994 force-pushed the fix/char-level-diff branch 3 times, most recently from 8271dbd to ca7f0e5 Compare September 9, 2026 15:36
Add a Characters option to the diff UI and history-diff API, using an
HTML-aware code-point tokenizer that preserves markup and raw-text
boundaries. Handle incomplete markup, including a trailing less-than sign.
Update the API reference and all language catalogs.

Verified on macOS and Linux: 34 notification-diff tests with 3 boundary
subtests, and 3 API/source tests including history deletion. Translation
catalogs, OpenAPI, generated docs, and hard lint checks also pass.

Resolves dgtlmoon#4194

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] char-level diff in addition to word/line-level diff

2 participants