Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: support configurable left and right message layout #3244

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

MrGaoGang
Copy link

@MrGaoGang MrGaoGang commented Feb 17, 2025

Pull Request Type

  • ✨ feat
  • πŸ› fix
  • ♻️ refactor
  • πŸ’„ style
  • πŸ”¨ chore
  • πŸ“ docs

resolves #3253

What is in this change?

  • In Appearance add [Message Direction] config!

The Message default direction is align left, follow the online! , we can change the different direction use the bottom bubble

image
  • In Message List:

    • default direction
    image
    • left to right direction
    image
  • Impact on code

    • Step1: Write direction config: frontend/src/pages/GeneralSettings/Appearance/MessageDirection/index.jsx
    • Step2: Register Direction Config: frontend/src/pages/GeneralSettings/Appearance/index.jsx
    • Step3: Change The Message Direction use Class name
      • frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/Actions/index.jsx
      • frontend/src/components/WorkspaceChat/ChatContainer/ChatHistory/HistoricalMessage/index.jsx

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

@timothycarambat
Copy link
Member

timothycarambat commented Feb 17, 2025

While I am not against this kind of style option - can I ask as to why? Is this a common style preference available in other tools that you personally like to us?

Usually, for things like the,is a better option is:

  • Create an issue to see if it gets πŸ‘ upvotes (shows user need)
  • Maintain this on an independent fork

This PR doesn't have an issue (and it should!) so its hard to gauge if adding this is worth it. Keep in mind after anyone makes a contribution we have to support it forever!

@MrGaoGang
Copy link
Author

MrGaoGang commented Feb 18, 2025

While I am not against this kind of style option - can I ask as to why? Is this a common style preference available in other tools that you personally like to us?

Usually, for things like the,is a better option is:

  • Create an issue to see if it gets πŸ‘ upvotes (shows user need)
  • Maintain this on an independent fork

This PR doesn't have an issue (and it should!) so its hard to gauge if adding this is worth it. Keep in mind after anyone makes a contribution we have to support it forever!

First of all, thank you @timothycarambat very much for your reply. I have added an issue to let everyone choose whether to use this feature.
The reason for adding this style configuration is that in China, the left-right layout of IM messaging software is more in line with everyone's usage habits; in this PR, the default layout method still maintains the online left layout, and the left-right layout becomes an option

@timothycarambat
Copy link
Member

Ah I see now, okay understood. Will review and see what we can do

@timothycarambat
Copy link
Member

@MrGaoGang - can you pull in my changes and re-confirm that functionality works as you intended? Did some UI refactors for dark and light mode + prevented rerenders of the hook on every chat message for performance reasons.

If all looks good, please reply so and ill merge. My end looks good to me.

fix: apply chat alignment to homepage chat
@MrGaoGang
Copy link
Author

MrGaoGang commented Feb 19, 2025

@MrGaoGang - can you pull in my changes and re-confirm that functionality works as you intended? Did some UI refactors for dark and light mode + prevented rerenders of the hook on every chat message for performance reasons.

If all looks good, please reply so and ill merge. My end looks good to me.

@timothycarambat Yes, thanks. I have just tested it and it works fine. Thank you very much for your commit, which makes the project run better.
image
image
image
image
image

Copy link
Collaborator

@shatfield4 shatfield4 left a comment

Choose a reason for hiding this comment

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

LGTM

Tested:

  • Desktop
  • Mobile
  • Light mode
  • Dark mode

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

Successfully merging this pull request may close these issues.

[FEAT]: support configurable left and right message layout
3 participants