Repository navigation
🫸 fix: Right-Align User Message Images - #16404
Conversation
|
Review handoff for exact remote head |
|
Self-review handoff for exact PR head |
* 🫸 fix: Right-Align User Message Images * 🧪 test: Verify User Image Alignment in Browser --------- Co-authored-by: Lia <lia@librechat.ai>
Summary
When a user message has both an uploaded image and enough text to widen its bubble, the image sits on the left even though the user turn is right-aligned. The same mismatch affects image content parts and inline steering messages.
User-authored images now align with the right edge of their message bubble. Assistant images, non-image file chips, image preview interactions, and attachment order are unchanged.
How it works
The shared image preview accepts an opt-in right-alignment flag on its outer flex item. Uploaded files request it; content-part images request it only for user authors. Inline steering images stay in their original order inside a right-justified, wrapping group, while other file chips remain at the start.
Type of change
Testing
Tested environments/configuration: Local client Jest/jsdom, TypeScript, and Chromium with the mock-backed app and isolated ephemeral MongoDB.
Automated tests: Four focused Jest files, 50 tests passed. A Playwright test uploads a real PNG with a wider user message and checks the image's physical right inset in the browser; it fails on the base revision (−319 px) and passes on this PR.
cd client && npx tsc --noEmitpassed; direct ESLint and Prettier checks on the browser test passed;npm run static-checksand explicit-path import sorting passed on the changed client files. Local Lighthouse was not run; the PR has a Lighthouse CI job.Screenshots / recordings
A real-app before/after pair was captured using the same synthetic PNG and prompt in a 1280 × 900 Chromium viewport. Each cropped user-turn image is 896 × 538. The image was left-aligned on the base revision (left inset minus right inset: −319 px) and right-aligned on this PR (browser layout assertion passed).
The images cannot be attached to the PR from the Lia GitHub App: the attachment-capable GitHub CLI rejected the upload as
unsupported authentication type. No image URLs or mockups are included. Visual inspection by a maintainer is pending.Risk / compatibility
No API, storage, or configuration changes. Please visually check narrow screens, mixed file/image uploads, and right-to-left prompts before merging.
Checklist