Skip to content

Batch rich HTML updates#16

Merged
koppor merged 2 commits into
mainfrom
agent/batch-rich-html-updates
Jul 19, 2026
Merged

Batch rich HTML updates#16
koppor merged 2 commits into
mainfrom
agent/batch-rich-html-updates

Conversation

@Siedlerchr

@Siedlerchr Siedlerchr commented Jul 19, 2026

Copy link
Copy Markdown
Member

What changed

Adds a RichHtmlView#setHtml(String, HtmlRenderOptions) overload that updates the source HTML and its render options as one batched operation.

Why

Preview consumers often change both the HTML and base URI together. Previously, each property listener rebuilt the RichText model independently, so the old content could be rendered once before the new content was rendered.

Impact

Consumers can update a rich HTML preview and its options with one model rebuild, reducing UI-thread work during preview changes. Existing single-property APIs retain their behavior.

Validation

  • ./gradlew guiTest --tests org.jabref.htmltonode.RichHtmlViewTest

AI assistance

OpenAI Codex (GPT-5) was used for implementation assistance; the change and validation were reviewed in this session.

@Siedlerchr
Siedlerchr marked this pull request as ready for review July 19, 2026 19:43
@Siedlerchr Siedlerchr added the java Pull requests that update java code label Jul 19, 2026
- Test the batching itself instead of only the new overload's signature:
  count model rebuilds for the batched call (1) against the two separate
  setters (2). Verified to fail when the batching guard is removed.
- Restore the single-argument setHtml call in viewRendersHtmlIntoRichTextArea,
  which had lost its coverage to the new overload.
- Re-render inside the finally block so a throwing property listener cannot
  leave the rendered content out of sync with the updated properties.
- Document the batching exception on the class javadoc, which still claimed an
  unconditional re-render on every property change.
- Add the new public API to the changelog.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SoJLfS17Nn4jCHYX1WxoTP
@koppor
koppor merged commit 92ded94 into main Jul 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

java Pull requests that update java code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants