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

+7 -1
View File
@@ -36,6 +36,8 @@ import { ActivityLogosFixture } from "./activity-logos-fixture";
import { HistoryHydrationFixture } from "./history-hydration-fixture";
import { IdleCompactionFixture, installIdleCompactionApi } from "./idle-compaction-fixture";
import { FileEditPathFixture } from "./file-edit-path-fixture";
import { FileDiffFixture } from "./file-diff-fixture";
import { CodeHighlightingFixture } from "./code-highlighting-fixture";
import { QueuedGuidanceFixture } from "./queued-guidance-fixture";
import { WorkspaceAlignmentFixture } from "./workspace-alignment-fixture";
import { ComposerActionFixture } from "./composer-action-fixture";
@@ -148,7 +150,7 @@ function RailFixture() {
panes={[{ key: "rail", title: "Rail conversation" }]} activePaneKey="rail" layout="columns" showLayoutControl={false}
onActivatePane={() => {}} onAddPane={() => {}} onLayoutChange={() => {}} onPaneOrderChange={() => {}}
renderPane={(_pane, context) => <>
{viewport(true, context.navigationFrame)}
{viewport(context.composerPortalTarget !== undefined, context.navigationFrame)}
{context.composerPortalTarget && createPortal(composer, context.composerPortalTarget)}
</>}
/> : viewport(false)}
@@ -242,6 +244,10 @@ createRoot(document.getElementById("root")!).render(<TooltipProvider>
? <WorkspaceAlignmentFixture parameters={parameters} />
: parameters.get("case") === "queued-guidance"
? <QueuedGuidanceFixture />
: parameters.get("case") === "code-highlighting"
? <CodeHighlightingFixture />
: parameters.get("case") === "file-diff"
? <FileDiffFixture />
: parameters.get("case") === "file-edit-path"
? <FileEditPathFixture />
: parameters.get("case") === "answer-order"