@@ -9,6 +9,7 @@ import { TooltipV2 } from "@opencode-ai/ui/v2/tooltip-v2"
99import type { SessionReviewDiffStyle } from "../../components/session-review"
1010import { ResizeHandle } from "@opencode-ai/ui/resize-handle"
1111import { ScrollView } from "@opencode-ai/ui/scroll-view"
12+ import { useLocale } from "@kobalte/core/i18n"
1213import { makeEventListener } from "@solid-primitives/event-listener"
1314import { Show , createEffect , createMemo , createSignal , type JSX } from "solid-js"
1415import { getWorkerPool } from "../../pierre/worker"
@@ -149,6 +150,7 @@ export function SessionReviewV2Sidebar(props: SessionReviewV2SidebarProps) {
149150
150151export function SessionReviewV2 ( props : SessionReviewV2Props ) {
151152 const i18n = useI18n ( )
153+ const locale = useLocale ( )
152154
153155 createEffect ( ( ) => {
154156 getWorkerPool ( props . diffStyle )
@@ -175,6 +177,8 @@ export function SessionReviewV2(props: SessionReviewV2Props) {
175177 }
176178
177179 const canCycle = ( ) => props . files . length > 0
180+ const previousKey = ( ) => ( locale . direction ( ) === "rtl" ? "ArrowRight" : "ArrowLeft" )
181+ const nextKey = ( ) => ( locale . direction ( ) === "rtl" ? "ArrowLeft" : "ArrowRight" )
178182 const showCollapsedMeta = ( ) => props . sidebarOpen === false
179183 // Memoize slot getters so Show conditions do not instantiate throwaway elements.
180184 const title = createMemo ( ( ) => props . title )
@@ -189,11 +193,11 @@ export function SessionReviewV2(props: SessionReviewV2Props) {
189193 // pane is mounted, but never while typing in an input or comment editor.
190194 makeEventListener ( document , "keydown" , ( event ) => {
191195 if ( event . defaultPrevented || event . ctrlKey || event . metaKey || event . altKey ) return
192- if ( event . key !== "ArrowLeft" && event . key !== "ArrowRight" ) return
196+ if ( event . key !== previousKey ( ) && event . key !== nextKey ( ) ) return
193197 const target = event . target
194198 if ( target instanceof HTMLElement && ( target . isContentEditable || target . closest ( "input, textarea, select" ) ) ) return
195199 if ( ! props . hasDiffs || ! canCycle ( ) ) return
196- const file = event . key === "ArrowLeft" ? prev ( ) : next ( )
200+ const file = event . key === previousKey ( ) ? prev ( ) : next ( )
197201 if ( ! file ) return
198202 event . preventDefault ( )
199203 cycle ( file )
@@ -221,7 +225,7 @@ export function SessionReviewV2(props: SessionReviewV2Props) {
221225 value = {
222226 < >
223227 { i18n . t ( "ui.sessionReviewV2.previousFile" ) }
224- < KeybindV2 keys = { [ "←" ] } variant = "neutral" />
228+ < KeybindV2 keys = { [ locale . direction ( ) === "rtl" ? "→" : "←" ] } variant = "neutral" />
225229 </ >
226230 }
227231 >
@@ -241,7 +245,7 @@ export function SessionReviewV2(props: SessionReviewV2Props) {
241245 value = {
242246 < >
243247 { i18n . t ( "ui.sessionReviewV2.nextFile" ) }
244- < KeybindV2 keys = { [ "→" ] } variant = "neutral" />
248+ < KeybindV2 keys = { [ locale . direction ( ) === "rtl" ? "←" : "→" ] } variant = "neutral" />
245249 </ >
246250 }
247251 >
0 commit comments