From fd85fed204ade83d694570996f532cada8c99d5b Mon Sep 17 00:00:00 2001 From: Marco Beretta <81851188+berry-13@users.noreply.github.com> Date: Tue, 20 Oct 2026 16:19:14 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=AC=20fix:=20Mirror=20Chat=20Messages,?= =?UTF-8?q?=20Markdown=20and=20Code=20Blocks=20for=20RTL=20(#17267)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: Mirror Chat Surfaces For RTL Layouts * fix: Keep Short Subagent Ticker Lines at Their Reading Start Adds RTL chat scenarios covering code, markdown blocks, sibling arrows and virtualized lists. * fix: Resolve Quote and List Direction From Their Content dir=auto skips descendants that carry their own dir, so a quote or loose list holding dir=auto paragraphs always resolved left-to-right. Lists now take one direction so markers and indent stay on the same side. * fix: Keep Tables, Callouts and Trace Axes on One Direction Tables take one direction from their content so cell borders share a frame; strong-direction detection skips Arabic-Indic digits, separators and marks; handoff and answer callouts use a logical start border; trace tick and range labels stay on the LTR axis. * fix: Treat Every Script's Letters as Strong Direction Direction detection now keys on Unicode letters, so Devanagari, Thai and other LTR scripts resolve LTR. E2E specs that selected rows by pl-6 now select ps-6. * test: Cover the Shared Strong Direction Helper on Its Own * fix: Read Bidi Marks and Native Script Digits as Strong Direction * fix: Approximate Bidi Classes by Block So Symbols and Numerals Resolve * fix: Resolve Strong Direction From Unicode Bidi Class Tables * docs: Note How the Bidi Tables Are Generated and Where They Differ * fix: Generate the Bidi Tables From Unicode 17 Including L-Class Marks --- .../components/Artifacts/ArtifactVersion.tsx | 2 +- client/src/components/Artifacts/Artifacts.tsx | 6 +- .../components/Chat/BackgroundTasks/Card.tsx | 2 +- .../src/components/Chat/Input/AddedConvo.tsx | 2 +- .../Chat/Input/AskUserQuestionPopover.tsx | 4 +- .../Chat/Input/CodeApprovalMenu.tsx | 2 +- .../Chat/Input/CodeWorkspaceMenu.tsx | 10 +- .../components/Chat/Input/CollapseChat.tsx | 2 +- .../Chat/Input/Composer/Catalog.tsx | 2 +- .../components/Chat/Input/Composer/Files.tsx | 4 +- .../Chat/Input/Composer/Palette.tsx | 4 +- .../Chat/Input/Files/FileContainer.tsx | 4 +- .../Chat/Input/Files/FileUpload.tsx | 4 +- .../Chat/Input/Files/ImagePreview.tsx | 2 +- .../Chat/Input/Files/RemoveFile.tsx | 2 +- .../Chat/Input/Files/SourceIcon.tsx | 2 +- .../Chat/Input/Files/Table/Columns.tsx | 6 +- .../Chat/Input/Files/Table/DataTable.tsx | 4 +- .../Input/Files/Table/SortFilterHeader.tsx | 2 +- .../src/components/Chat/Input/MentionItem.tsx | 4 +- .../components/Chat/Input/PopoverButtons.tsx | 4 +- .../src/components/Chat/Input/Reasoning.tsx | 6 +- .../Chat/Input/TokenUsage/Breakdown.spec.tsx | 10 +- .../Chat/Input/TokenUsage/Breakdown.tsx | 14 +- .../Chat/Input/TokenUsage/Usage.tsx | 4 +- .../Messages/Content/ActivityPhaseGroup.tsx | 12 +- .../Chat/Messages/Content/AgentHandoff.tsx | 2 +- .../Chat/Messages/Content/AskUserQuestion.tsx | 4 +- .../Messages/Content/AskUserQuestionCall.tsx | 2 +- .../Messages/Content/AskUserQuestions.tsx | 2 +- .../Chat/Messages/Content/CodeAnalyze.tsx | 4 +- .../Chat/Messages/Content/DialogImage.tsx | 10 +- .../Messages/Content/FilePreviewDialog.tsx | 6 +- .../Chat/Messages/Content/Image.tsx | 2 +- .../Messages/Content/MarkdownComponents.tsx | 81 ++++- .../Content/MarkdownErrorBoundary.tsx | 27 +- .../Chat/Messages/Content/MarkdownLite.tsx | 27 +- .../components/Chat/Messages/Content/Part.tsx | 2 +- .../Messages/Content/Parts/Attachment.tsx | 6 +- .../Content/Parts/BackgroundTaskCall.tsx | 2 +- .../Chat/Messages/Content/Parts/BashCall.tsx | 10 +- .../Content/Parts/CodeWindowHeader.tsx | 2 +- .../Chat/Messages/Content/Parts/DiffView.tsx | 5 +- .../Messages/Content/Parts/ExecuteCode.tsx | 1 + .../Content/Parts/FileAuthoringCall.tsx | 2 + .../Messages/Content/Parts/LogContent.tsx | 5 +- .../Messages/Content/Parts/PtcToolTrace.tsx | 1 + .../Messages/Content/Parts/ReadFileCall.tsx | 5 +- .../Chat/Messages/Content/Parts/Stdout.tsx | 2 +- .../Chat/Messages/Content/Parts/SteerPart.tsx | 6 +- .../Messages/Content/Parts/SubagentCall.tsx | 49 ++- .../Chat/Messages/Content/Parts/Thinking.tsx | 14 +- .../Parts/__tests__/PendingSteers.test.tsx | 4 +- .../Parts/__tests__/SteerPart.test.tsx | 2 +- .../Chat/Messages/Content/RetrievalCall.tsx | 2 +- .../Chat/Messages/Content/ToolApproval.tsx | 4 +- .../Chat/Messages/Content/ToolCallInfo.tsx | 8 +- .../Messages/Content/ToolCallLimitNotice.tsx | 4 +- .../Content/ToolOutput/OutputRenderer.tsx | 10 +- .../Content/ToolOutput/StackedToolIcons.tsx | 4 +- .../__tests__/OutputRenderer.test.tsx | 4 +- .../Messages/Content/UIResourceCarousel.tsx | 11 +- .../Chat/Messages/Content/Wakeup.tsx | 6 +- .../Chat/Messages/Content/WebSearch.tsx | 6 +- .../__tests__/ActivityPhaseGroup.test.tsx | 6 +- .../Messages/Content/__tests__/Image.test.tsx | 4 +- .../Content/__tests__/ToolCallGroup.test.tsx | 2 +- .../__tests__/UIResourceCarousel.test.tsx | 22 ++ .../components/Chat/Messages/Content/auth.tsx | 4 +- .../Chat/Messages/Content/hydration.tsx | 4 +- .../Chat/Messages/Content/markdownConfig.ts | 26 +- .../components/Chat/Messages/Content/rail.tsx | 8 +- .../components/Chat/Messages/Content/rows.ts | 4 +- client/src/components/Chat/Messages/Fork.tsx | 6 +- .../components/Chat/Messages/HoverButtons.tsx | 2 +- .../components/Chat/Messages/MessageNav.tsx | 56 ++-- .../Chat/Messages/MinimalHoverButtons.tsx | 2 +- .../Chat/Messages/SiblingSwitch.tsx | 8 +- .../Chat/Messages/ui/MessageRow.tsx | 10 +- .../Chat/Messages/ui/MessageTimestamp.tsx | 4 +- .../Chat/Messages/ui/SystemEvent.tsx | 2 +- .../Messages/ui/__tests__/MessageRow.spec.tsx | 6 +- .../src/components/Chat/PullRequest/Card.tsx | 2 +- .../src/components/Chat/PullRequest/Panel.tsx | 4 +- .../components/Chat/PullRequest/RowMark.tsx | 4 +- .../PullRequest/__tests__/RowMark.test.tsx | 4 +- .../components/Chat/SubagentThreadLink.tsx | 2 +- .../Subagents/EventSubagentActivityGroup.tsx | 4 +- .../SharedSubagentActivityDialog.tsx | 4 +- .../Chat/Subagents/SubagentActivity.tsx | 4 +- .../src/components/Chat/Trace/Inspector.tsx | 8 +- client/src/components/Chat/Trace/Ledger.tsx | 41 +-- client/src/components/Chat/Trace/Timeline.tsx | 2 + client/src/components/Chat/Trace/Viewer.tsx | 4 +- .../Chat/Trace/__tests__/Viewer.test.tsx | 20 ++ .../src/components/Chat/approval/Review.tsx | 4 +- .../Messages/Content/ActionButton.tsx | 2 +- .../components/Messages/Content/CodeBar.tsx | 2 +- .../components/Messages/Content/CodeBlock.tsx | 4 +- .../Messages/Content/Error/parts.tsx | 2 +- .../Messages/Content/FloatingCodeBar.tsx | 4 +- .../Messages/Content/Mermaid/Export.tsx | 2 +- .../Messages/Content/Mermaid/Mermaid.tsx | 6 +- .../Content/Mermaid/MermaidDialog.tsx | 2 +- .../Messages/Content/ResultSwitcher.tsx | 8 +- .../components/Messages/Content/RunCode.tsx | 2 +- .../components/Messages/ScrollToBottom.tsx | 2 +- client/src/components/Web/Citation.tsx | 34 +-- client/src/components/Web/SourceHovercard.tsx | 12 +- client/src/components/Web/Sources.tsx | 22 +- client/src/mobile.css | 2 +- client/src/style.css | 156 +++++++--- client/src/utils/__tests__/direction.test.ts | 70 +++++ .../utils/__tests__/subagentContent.test.ts | 25 ++ client/src/utils/direction.ts | 39 +++ client/src/utils/mermaid.ts | 2 +- client/src/utils/subagentContent.ts | 22 +- client/tailwind.config.cjs | 8 +- e2e/specs/mock/activity-fold.spec.ts | 2 +- .../scenarios/persisted-context-usage.spec.ts | 2 +- e2e/specs/mock/scenarios/rtl-chat.spec.ts | 282 ++++++++++++++++++ .../mock/scenarios/tool-context-split.spec.ts | 6 +- eslint-suppressions.json | 4 +- 123 files changed, 1102 insertions(+), 369 deletions(-) create mode 100644 client/src/utils/__tests__/direction.test.ts create mode 100644 client/src/utils/direction.ts create mode 100644 e2e/specs/mock/scenarios/rtl-chat.spec.ts diff --git a/client/src/components/Artifacts/ArtifactVersion.tsx b/client/src/components/Artifacts/ArtifactVersion.tsx index a571fb406b..394d1b6fb3 100644 --- a/client/src/components/Artifacts/ArtifactVersion.tsx +++ b/client/src/components/Artifacts/ArtifactVersion.tsx @@ -82,7 +82,7 @@ export default function ArtifactVersion({ /> } items={dropdownItems} - className={isSmallScreen ? '' : 'absolute right-0 top-0 mt-2'} + className={isSmallScreen ? '' : 'absolute inset-e-0 top-0 mt-2'} /> ); } diff --git a/client/src/components/Artifacts/Artifacts.tsx b/client/src/components/Artifacts/Artifacts.tsx index 3906c890f4..43707ba9fe 100644 --- a/client/src/components/Artifacts/Artifacts.tsx +++ b/client/src/components/Artifacts/Artifacts.tsx @@ -495,7 +495,7 @@ export default function Artifacts() { 'h-full overflow-hidden shadow-2xl', isVisible && !isClosing ? 'translate-x-0 opacity-100 transition-all duration-350' - : 'translate-x-5 opacity-0 transition-all duration-300', + : 'translate-x-5 opacity-0 transition-all duration-300 rtl:-translate-x-5', ), )} style={isMobile ? { height: isFullscreen ? '100%' : `${height}vh` } : undefined} @@ -533,7 +533,7 @@ export default function Artifacts() { 'flex items-center transition-all duration-500 motion-reduce:transition-none', isVisible && !isClosing ? 'translate-x-0 opacity-100' - : '-translate-x-2 opacity-0', + : '-translate-x-2 opacity-0 rtl:translate-x-2', )} > {isUndocked ? ( -