[PR #2972] [CLOSED] [GUI] Add shared source-preserving chat math core #4372

Closed
opened 2026-11-07 15:35:14 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/2972
Author: @CC-David-CC
Created: 10/17/2026
Status: ❌ Closed

Base: main ← Head: feat/web-math-core-minimal


📝 Commits (1)

  • 0abb109 web: add shared source-preserving math core

📊 Changes

7 files changed (+183 additions, -4 deletions)

View changed files

➕ docs/WEB_MATH_INTERFACE.md (+16 -0)
📝 serve/server.py (+18 -0)
📝 serve/web/app.css (+8 -0)
📝 serve/web/app.js (+18 -4)
📝 serve/web/index.html (+4 -0)
➕ serve/web/math-adapter.js (+6 -0)
➕ serve/web/math.js (+113 -0)

📄 Description

Problem and result

Chat equations currently remain plain text. Add an opt-in shared parser and renderer interface while preserving original text through streaming, copy, export, history and API requests.

Related: #1829. Renderer follow-ups: #2974 (KaTeX) and #2975 (MathJax).

Approach

Keep rendering disabled by default. Recognize complete math outside code and Markdown links, bound rendering work, and fall back to source when rendering is unavailable. This core includes a placeholder adapter; renderer implementations remain separate.

Validation

Passed:

  • Rebased onto upstream main 90767252f; tested head 0abb10979. Range-diff confirms the original patches are unchanged; git diff --check upstream/main passed.
  • Windows, Python 3.13.15: the existing Playwright regression harness passed Chromium, Firefox and WebKit. Parser and streaming boundaries, code/currency handling, source preservation, settings persistence, disabled behavior, cache limits, deadlines and stale render completion.
  • Harness commands: python test_browser.py <checkout>. Renderer screenshots inspected where applicable.

Failed:

  • None observed in final validation.

Not run:

  • Real-model/GPU inference and the Tauri desktop app. This change targets the existing web chat and does not change engine code.

Limits

The placeholder adapter does not typeset equations. This targets the Python-served web chat; a renderer follow-up is needed for visual math.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/2972 **Author:** [@CC-David-CC](https://github.com/CC-David-CC) **Created:** 10/17/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `feat/web-math-core-minimal` --- ### 📝 Commits (1) - [`0abb109`](https://github.com/Niko1221/Strata/commit/0abb10979c800256f221496fb2b891e769cea47f) web: add shared source-preserving math core ### 📊 Changes **7 files changed** (+183 additions, -4 deletions) <details> <summary>View changed files</summary> ➕ `docs/WEB_MATH_INTERFACE.md` (+16 -0) 📝 `serve/server.py` (+18 -0) 📝 `serve/web/app.css` (+8 -0) 📝 `serve/web/app.js` (+18 -4) 📝 `serve/web/index.html` (+4 -0) ➕ `serve/web/math-adapter.js` (+6 -0) ➕ `serve/web/math.js` (+113 -0) </details> ### 📄 Description ## Problem and result Chat equations currently remain plain text. Add an opt-in shared parser and renderer interface while preserving original text through streaming, copy, export, history and API requests. ## Related discussion Related: #1829. Renderer follow-ups: #2974 (KaTeX) and #2975 (MathJax). ## Approach Keep rendering disabled by default. Recognize complete math outside code and Markdown links, bound rendering work, and fall back to source when rendering is unavailable. This core includes a placeholder adapter; renderer implementations remain separate. ## Validation **Passed:** - Rebased onto upstream main `90767252f`; tested head `0abb10979`. Range-diff confirms the original patches are unchanged; `git diff --check upstream/main` passed. - Windows, Python 3.13.15: the existing Playwright regression harness passed Chromium, Firefox and WebKit. Parser and streaming boundaries, code/currency handling, source preservation, settings persistence, disabled behavior, cache limits, deadlines and stale render completion. - Harness commands: `python test_browser.py <checkout>`. Renderer screenshots inspected where applicable. **Failed:** - None observed in final validation. **Not run:** - Real-model/GPU inference and the Tauri desktop app. This change targets the existing web chat and does not change engine code. ## Limits The placeholder adapter does not typeset equations. This targets the Python-served web chat; a renderer follow-up is needed for visual math. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-07 15:35:14 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#4372
No description provided.