refactor(webui): unify code and diff highlighting (#6412)

* refactor(webui): unify code and diff highlighting

Replace Prism with shared Highlights tokens and Pierre read-only diffs, retaining rare grammars through lazy Shiki and preserving source, copy, preview and diff controls.

Restore single-session Composer ownership inside the conversation column while retaining the shared multi-pane footer. Keep the measured large-diff scroll regression explicit during review.

* fix(webui): contain highlighting errors and retain diff selections

Refs NAN-343

* test(webui): align pane fixtures after main rebase

* chore(webui): update highlighting dependencies

Keep grammar fallback coverage on a language that still requires Shiki, and align reading-size assertions with main.
This commit is contained in:
chengyongru authored and GitHub committed 2026-11-06 16:41:12 +08:00
1 parent f5c359476b
commit 3a37269f3f
44 files changed
+2261 -1072

No files matched your search

+2 -2
View File
@@ -106,14 +106,14 @@ test("reduced motion keeps the canvas fade but switches the icon directly", asyn
for (const width of [1440, 390]) {
for (const initial of ["light", "dark"] as const) {
test(`reduced motion fades existing chat surfaces together from ${initial} at ${width}px`, async ({ page }) => {
test(`reduced motion fades shared-composer chat surfaces together from ${initial} at ${width}px`, async ({ page }) => {
await page.emulateMedia({ reducedMotion: "reduce" });
await page.setViewportSize({ width, height: 844 });
await page.addInitScript((theme) => {
localStorage.setItem("nanobot.locale", "en");
localStorage.setItem("nanobot-webui.theme", theme);
}, initial);
await page.goto("/browser/fixture.html?case=theme-toggle&chat");
await page.goto("/browser/fixture.html?case=theme-toggle&chat&split");
const input = page.getByRole("textbox");
await input.fill("Keep this draft while changing theme");
const inputBox = await input.boundingBox();