Skip to content

Conversation

@yash-agarwa-l
Copy link
Contributor

@yash-agarwa-l yash-agarwa-l commented Nov 18, 2025

Fixes #1245

This PR corrects the unread-marker alignment in RTL layouts.

Problem:
_UnreadMarker used LTR-specific properties (left: 0, Border(left: …)), causing the unread marker to always appear on the left, even for RTL languages like Arabic.

Fix
Therefore Replaced LTR-specific properties with directional equivalents:
PositionedDirectional(start: 0)
BorderDirectional(start: BorderSide(...))

This ensures the unread marker appears on the correct “start” side based on text direction.

Manually tested by setting:
locale: Locale('ar')

Verified correct behavior in both LTR and RTL layouts (screenshots included).

Before

LTR

LTR

RTL

RTL

After

LTR

LTR

RTL

RTL

Copy link
Collaborator

@chrisbobbe chrisbobbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Small comments below.

Also:

  • Please say Fixes #1245. in the commit message. For examples, use Greg's "secret" to using git log -p.
  • Please also post screenshots of what it looks like before this change, so we can see clearly the improvement being made. 🙂

}
}


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

Comment on lines 1659 to 1665
)),
),
),
),
),
],
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This code-style change is unrelated and unhelpful; please remove it.

@chrisbobbe chrisbobbe self-assigned this Nov 18, 2025
@chrisbobbe chrisbobbe added the maintainer review PR ready for review by Zulip maintainers label Nov 18, 2025
@yash-agarwa-l yash-agarwa-l changed the title msglist: Use directional positioning for unread marker in RTL. msglist: Use directional positioning for unread marker in RTL (Fixes #1245) Nov 18, 2025
@yash-agarwa-l
Copy link
Contributor Author

Thank you for the feedback.
I’ve cleaned up the commit and added the before screenshots as requested.
Please let me know if there’s anything else I should adjust.

@chrisbobbe
Copy link
Collaborator

Bump on this part:

@yash-agarwa-l
Copy link
Contributor Author

Thank You, I've updated the commit and pushed the revision.

@chrisbobbe
Copy link
Collaborator

Please write it according to the project style; the Fixes #1245. line belongs in the commit-message body, not in the summary line.

@yash-agarwa-l yash-agarwa-l changed the title msglist: Use directional positioning for unread marker in RTL (Fixes #1245) msglist: Use directional positioning for unread marker in RTL Nov 19, 2025
@yash-agarwa-l
Copy link
Contributor Author

Thanks for the clarification, updated.

@chrisbobbe chrisbobbe requested a review from gnprice November 19, 2025 04:18
@chrisbobbe chrisbobbe added integration review Added by maintainers when PR may be ready for integration and removed maintainer review PR ready for review by Zulip maintainers labels Nov 19, 2025
@chrisbobbe
Copy link
Collaborator

Thanks! Marked for Greg's review.

Copy link
Member

@gnprice gnprice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @yash-agarwa-l for taking care of this, and thanks @chrisbobbe for the previous reviews!

Those before/after screenshots in particular are very helpful, thanks. It's especially helpful that they're very clean — the before and after differ only in the one way that's relevant.

This looks good; merging. One commit-message nit which I'll fix up:

-    msglist: Use directional positioning for unread marker in RTL.
+    msglist: Use directional positioning for unread marker in RTL

In this repo we don't use a trailing period on the summary line of a commit message.

@gnprice gnprice force-pushed the fix-rtl-unread-marker branch from df5ae40 to 49d6226 Compare November 25, 2025 03:36
@gnprice gnprice merged commit 49d6226 into zulip:main Nov 25, 2025
@gnprice
Copy link
Member

gnprice commented Nov 25, 2025

I also just did a quick audit with git grep left: and git grep right: to look for other similar places to be fixed. (More precisely: git grep -iP 'left:|right:' lib/. Some matches for that query treat left and right symmetrically already, so those are fine.)

I found 4 of them:

  • The formatting on block quotations (the Quotation widget).

  • The display of images and video thumbnails in the message list. That's the MessageMediaContainer, here:

      child: UnconstrainedBox(
        alignment: Alignment.centerLeft,
        child: Padding(
          // TODO clean up this padding by imitating web less precisely;
          //   in particular, avoid adding loose whitespace at end of message.
          padding: const EdgeInsets.only(right: 5, bottom: 5),

@yash-agarwa-l if you're looking for more issues to work on for contributing to Zulip, I think those would be a good list to pick up while this area is fresh in your mind from doing this issue.

I'd suggest going in the order listed above — the quotes in particular I would guess look pretty wrong right now. And then a key element in a PR for any of these will be to post good before/after screenshots that clearly show the change, just like you did on this PR.

@yash-agarwa-l
Copy link
Contributor Author

Thanks so much for the review, the merge, and especially for auditing the code for these related RTL issues!

I'm really happy contributing to Zulip. I'll start working through that list, beginning with the block quotations (Quotation widget), and will keep all your feedback in mind for the new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration review Added by maintainers when PR may be ready for integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

msglist: Vertical message-unread marker should be "start"-positioned, not "left"

3 participants