Skip to content

feat(comparison): summarize the changes between two versions - #9535

Draft
hweihwang wants to merge 1 commit into
feat/version-summaries-settingsfrom
feat/version-summaries
Draft

hweihwang wants to merge 1 commit into
feat/version-summaries-settingsfrom
feat/version-summaries

Conversation

@hweihwang

@hweihwang hweihwang commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

📝 Summary

The comparison can now summarize what changed between the two versions shown, in Files, and in Collectives once nextcloud/collectives#2878 is released. The list of changes already shows every edit; the summary says what the newer version means: the gist in a sentence or two, then the changes grouped by topic, with every changed number, date and name as old and new value.

  • Starting. "Summarize changes" sits on the row of Previous and Next. Its note says that both complete versions are sent to the instance's AI provider, and nothing starts without a click.
  • While it runs. Its place in the queue, then a card labelled "AI-generated, may omit or misstate changes", with both versions, their dates and authors, the summary, Copy and collapse. The card spans the full width, above both documents side by side and above the list of changes. A long summary scrolls inside the card, and its end fades while more text follows.
  • Stored summaries. Anyone who can open the file, with downloads allowed, sees a stored summary of the same two texts at once, also after closing and reopening while it is still being made.
  • When it cannot. Each case says why and what to do: identical versions, versions that differ only in Markdown source, too long, not UTF-8, no provider (checked again when the page is shown again), a limit (with the time it ends, by the server's clock), several starts in a short time (with the time to try again), the file changed (with "Reload comparison"), a version gone, access lost or summaries turned off while open, and no answer from the server (it keeps trying). Without access or with summaries off from the start, nothing shows, also when the first request got no answer.
  • Collectives after a restore. A pair whose older end is the current file offers no summary.
  • Files sidebar. "Summarize recent changes" opens the list of changes from the newest version at least an hour older than the latest change, or the oldest kept one, ready to summarize. After a restore, the latest change is the restore.
  • Keyboard and screen readers. The summary text can be focused and scrolled with the keyboard, with a visible focus ring also while it fades, the button's note is read with the button, the live region announces each state once, not every move in the queue, and "Try again" and "Reload comparison" give the keyboard back to the comparison once it has loaded again.

The comparison now loads both files as bytes, so the texts it fingerprints are exactly what the server reads; the fingerprints are computed only when a summary is asked for. The summary code is a separate chunk, loaded only where summaries are on, which pages learn from initial state without a request. What each state shows, says and when it asks again is one entry per state in states.ts.

🖼️ Screenshots

The whole flow in Files: compare, summarize, change the older version, summarize again, list of changes.

flow.mp4
Before summarizing Summary side by side
Before summarizing Summary side by side
Version picker Summary above the list of changes
Version picker Summary above the list of changes
Files sidebar: recent changes Two versions saved within one minute
Files sidebar: recent changes Two versions saved within one minute
On a phone On a phone, dark theme
On a phone On a phone, dark theme
In Collectives The admin setting (from #9534)
In Collectives The admin setting (from #9534)

When it cannot summarize:

Only the Markdown source differs Too long
Only the Markdown source differs Too long
The file changed meanwhile The hourly limit for each person
The file changed meanwhile The hourly limit for each person

The summaries above come from Claude Haiku through integration_openai's OpenAI-compatible endpoint.

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits
  • Tests (unit, integration and/or end-to-end) passing and the changes are covered with tests: Vitest for what each state shows and does, sharing one poller per pair, stale answers, fingerprints, waiting through a server that does not answer, limits by the server's clock, the provider check when the page is shown again, focus and the fade; Playwright version-summaries.spec.ts on core's testing chat provider, in Files and on a phone, and that only an administrator can change the setting
  • Documentation (README or documentation) has been updated or is not required

🤖 AI (if applicable)

  • The content of this PR was partly or fully generated using AI tools
  • The AI-generated content was reviewed, comprehended and tested by a human

@hweihwang
hweihwang added this pull request to stack #9536 November 4, 2026 09:06
The comparison in Files and Collectives can now summarize the changes
between the two versions shown, with the instance's AI provider.

"Summarize changes" sits in the comparison's header, on the row of
Previous and Next, and says that both complete versions are sent to the
AI provider; nothing starts without a click. The summary shows its place
in the queue, then a card labelled as AI-generated, with both versions,
the gist and the changes grouped by meaning, Copy and collapse. A stored
summary of the same two texts shows at once for anyone who opens them.
Side by side it spans both documents; in the list of changes it sits
above the list. Every state that stops a summary says why and what to
do, and a server that does not answer is asked again.

The comparison loads both files as bytes, so the texts it fingerprints
are the ones the server reads; it fingerprints them only for a summary.
The summary code is a separate chunk, loaded only where summaries are on,
which pages learn from initial state.

The Files sidebar gets "Summarize recent changes": it opens the list of
changes from the newest version at least an hour older than the latest
change, or the oldest kept one, ready to summarize.

Resolves #8904

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Hoang Pham <hoangmaths96@gmail.com>
@hweihwang
hweihwang force-pushed the feat/version-summaries branch from 23bb9c3 to 24eca60 Compare November 9, 2026 11:36
@nextcloud-command nextcloud-command added the AI assisted This PR contains AI-assisted commits label Nov 9, 2026
@blizzz blizzz added enhancement New feature or request 3. to review labels Nov 11, 2026

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

3. to review AI assisted This PR contains AI-assisted commits enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI assisted version summaries

3 participants