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

@@ -205,6 +205,7 @@ export function PaneWorkbench({
}: PaneWorkbenchProps) {
const { t } = useTranslation();
const compact = useMediaQuery("(max-width: 767px)");
const sharedComposer = chrome && panes.length > 1;
const effectiveLayout = layout;
const [headerPortalTarget, setHeaderPortalTarget] = useState<HTMLElement | null>(null);
const [composerPortalTarget, setComposerPortalTarget] = useState<HTMLElement | null>(null);
@@ -728,7 +729,7 @@ export function PaneWorkbench({
active,
multiplePanes: displayedPanes.length > 1,
headerPortalTarget: chrome && displayedPanes.length > 1 ? headerPortalTarget : undefined,
composerPortalTarget: chrome ? composerPortalTarget : undefined,
composerPortalTarget: sharedComposer ? composerPortalTarget : undefined,
navigationFrame: displayedPanes.length === 1 ? navigationFrame : undefined,
headerActions,
})}
@@ -827,7 +828,7 @@ export function PaneWorkbench({
) : null}
</div>
{chrome ? (
{sharedComposer ? (
<footer className="workbench-composer-footer shrink-0 px-3 pb-[calc(0.5rem+env(safe-area-inset-bottom))] sm:px-4 sm:pb-[calc(0.75rem+env(safe-area-inset-bottom))]">
<div
ref={setComposerPortalTarget}