Skip to content

Render highlighted documents - #9045

Closed
hweihwang wants to merge 3 commits into
nextcloud:mainfrom
hweihwang:review/structured-markdown-comparison-documents
Closed

Render highlighted documents#9045
hweihwang wants to merge 3 commits into
nextcloud:mainfrom
hweihwang:review/structured-markdown-comparison-documents

Conversation

@hweihwang

@hweihwang hweihwang commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

In one sentence: the Full documents view — both originals read-only, highlighted, and navigable.

What and why

The Changes view says what changed — but it doesn't let you read the document, so you can't tell whether an edited sentence still fits its paragraph. This PR adds the view that shows you.

What's in this PR

  • Full documents: both originals, read-only, highlighted at the positions the model reported
  • Paired navigation, independent pane scrolling, and expandable gaps where nothing changed
  • Three width-selected modes: wide, paired, and explicit Before/After tabs on narrow screens

Full documents view: both panes with −/+ headers, line-through on removals, underline on additions, dotted borders on attribute changes, paired navigation (Change 1 of 25)
Wide mode. Non-colour cues throughout, so the highlights never carry the meaning alone.

Paired mode at 900 px: both panes, no wide change rail
Paired mode. Container width — not viewport width — selects the mode.

Single-pane mode at 390 px: Before/After tabs with the visible side labelled
Narrow mode. One document is never shown unlabelled as if it were a comparison.

Design notes

  • The originals are rendered, not reconstructions — footnotes, front matter and tables stay exactly where the user saved them.
  • scrollIntoView is not usable here: it walks every scrollable ancestor and would drag the dialog around. A pane-scoped helper preserves scroll position and reports failure instead of doing nothing.
  • An empty side gets a widget, and gap expansion is paired, so both panes always tell the same story.

Stack

Depends on: #9044. Followed by #9046. Opened stacked — the diff narrows as predecessors merge; I'll rebase before review.

Verification

ts:check and lint pass; complete suite 1,862/1,862. Empty-side and paired-gap regressions are pinned by tests; highlight positions are asserted against the originals in the live end-to-end suite.

AI assistance

Commits carry Assisted-by: Codex:gpt-5.6-sol; an independent review pass was run with Claude Opus 5. Description drafted with Hermes (deepseek-v4-pro) from my notes, then reviewed by me.

Related

Parse immutable documents, normalize their semantic structure, and emit bounded stable change descriptors. Support one shared schema for both parsed documents.

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
Expose the Text comparison factory and render grouped changes by document section. Preserve every changed-only preview in multi-edit blocks with semantic deletion and insertion markup.

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
Mount both immutable documents once, apply semantic decorations, support independent pane navigation, and provide an accessible single-pane layout for narrow containers.

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
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.

1 participant