Skip to content

Commit 0967483

Browse files
fix(desktop): keep annotation comment direction independent of host page
The preview annotation overlay inherited its text direction from the inspected page's document, so RTL comments (Arabic, Hebrew, Persian) were misaligned on LTR pages, and forcing the host page to RTL mirrored the entire annotation toolbar instead of only the comment text. Pin the overlay host/root to dir="ltr" so the annotation chrome always has a stable layout, and set dir="auto" on the comment textarea so its direction is inferred from the typed content instead of inherited. Fixes #4644 Co-Authored-By: Claude Sonnet 5 <[email protected]>
1 parent e16b8b0 commit 0967483

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎apps/desktop/src/preview/PickPreload.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ function startAnnotation(): void {
436436
let finished = false;
437437
const host = document.createElement("div");
438438
host.setAttribute(OVERLAY_ATTRIBUTE, "");
439+
host.setAttribute("dir", "ltr");
439440
host.style.cssText = `position:fixed;inset:0;z-index:${Z_INDEX_OVERLAY};pointer-events:none`;
440441
applyAnnotationTheme(host, annotationTheme);
441442
const shadowRoot = host.attachShadow({ mode: "closed" });
@@ -445,6 +446,7 @@ function startAnnotation(): void {
445446

446447
const root = document.createElement("div");
447448
root.setAttribute(OVERLAY_ATTRIBUTE, "");
449+
root.setAttribute("dir", "ltr");
448450
root.className = "fixed inset-0 font-sans text-foreground";
449451
root.style.cssText = "pointer-events:none";
450452
const cursorStyle = document.createElement("style");
@@ -494,6 +496,7 @@ function startAnnotation(): void {
494496

495497
const comment = document.createElement("textarea");
496498
comment.placeholder = "Describe the change…";
499+
comment.setAttribute("dir", "auto");
497500
comment.rows = 1;
498501
comment.className =
499502
"min-h-8 max-h-24 min-w-0 flex-1 resize-none overflow-y-hidden border-0 border-b border-b-transparent bg-transparent px-0 py-1.5 font-sans text-sm leading-5 text-foreground outline-none ring-0 placeholder:text-muted-foreground focus:border-b-primary focus:outline-none focus:ring-0";

0 commit comments

Comments
 (0)