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

💄 style: improve images display in chat messages #3475

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

vual
Copy link
Contributor

@vual vual commented Aug 15, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 👷 build
  • ⚡️ perf
  • 📝 docs
  • 🔨 chore

🔀 变更说明 | Description of Change

修改聊天界面多图展示效果。
1.一行最多3个图片。
2.列的个数以第一行的个数为准。
3.多图时,最大宽度比率计算公式为:scale = firstRow.length * (firstRow.length / items.length),避免多图时占用窗口太大。

修改前:
8da85bbaa18e0bfadb8a3624100f2bc
d838e1b21697efcb7c9b02a97862b80

修改后:
8a80dfa4b353dfe66a02b01713ccfc0
256d995a2ec8b83e768f6d31e9575da

📝 补充信息 | Additional Information

1.一行最多3个图片。
2.列的个数以第一行的个数为准。
3.多图时,最大宽度比率计算公式为:scale = firstRow.length * (firstRow.length / items.length),避免多图时占用窗口太大。
Copy link

vercel bot commented Aug 15, 2024

@vual is attempting to deploy a commit to the LobeHub Pro Team on Vercel.

A member of the Team first needs to authorize it.

@lobehubbot
Copy link
Member

👍 @vual

Thank you for raising your pull request and contributing to our Community
Please make sure you have followed our contributing guidelines. We will review it as soon as possible.
If you encounter any problems, please feel free to connect with us.
非常感谢您提出拉取请求并为我们的社区做出贡献,请确保您已经遵循了我们的贡献指南,我们会尽快审查它。
如果您遇到任何问题,请随时与我们联系。

Copy link

codecov bot commented Aug 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.18%. Comparing base (5ccc41d) to head (b3cc911).

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3475    +/-   ##
========================================
  Coverage   92.18%   92.18%            
========================================
  Files         464      464            
  Lines       31862    31862            
  Branches     3022     2165   -857     
========================================
  Hits        29371    29371            
  Misses       2491     2491            
Flag Coverage Δ
app 92.18% <ø> (ø)
server 97.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@arvinxx
Copy link
Contributor

arvinxx commented Aug 16, 2024

这个方案感觉不太好,如果是 4 个话应该不会变成4宫格吧?

之前做图片展示逻辑是参考的 discord ,感觉目前的方案是一个比较优的展示方案了。比如5个的场景我觉得还是现在的方案能撑满 体验好。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


This plan doesn't feel very good. If there are 4, it shouldn't become a 4-square grid, right?

The previous picture display logic was based on discord. I feel that the current solution is a better display solution. For example, for 5 scenes, I think the current solution can fully support it and provide a good experience.

@vual
Copy link
Contributor Author

vual commented Aug 16, 2024

这个方案感觉不太好,如果是 4 个话应该不会变成4宫格吧?

之前做图片展示逻辑是参考的 discord ,感觉目前的方案是一个比较优的展示方案了。比如5个的场景我觉得还是现在的方案能撑满 体验好。

3个以内是一排,4个就你原来的逻辑,4宫格
image

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


This plan doesn’t feel very good. If it is 4, it shouldn’t become a 4-square grid, right?

The previous picture display logic was based on discord. I feel that the current solution is a better display solution. For example, for 5 scenes, I think the current solution can fully support it and provide a good experience.

3 or less is a row, 4 is your original logic, 4 squares
image

@vual
Copy link
Contributor Author

vual commented Aug 16, 2024

如果按照原来的逻辑,个数是3的倍数的时候,比如6个或9个时,图片就会变成600宽,并且是2行或3行,那图片铺满屏幕了。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


If according to the original logic, when the number is a multiple of 3, such as 6 or 9, the picture will become 600 wide and 2 or 3 lines long, then the picture will fill the screen.

@arvinxx
Copy link
Contributor

arvinxx commented Aug 16, 2024

@vual 能不能看下 8、9 、10 个的时候样子?

根据你现在的截图,我感觉 5 个的时候并没有比原来好,但 7 个的时候可能是你现在的会好一点。

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@vual Can you see what it looks like at 8, 9, and 10?

Based on your current screenshots, I feel that the 5-bit version is no better than the original one, but the 7-bit version may be a little better than what you have now.

@arvinxx arvinxx changed the title 修改聊天界面多图展示效果。 1.一行最多3个图片。 2.列的个数以第一行的个数为准。 3.多图时,最大宽度比率计算公式为:scale = firstRow.length * (firstRow.length / items.length),避免多图时占用窗口太大。imize 💄 style: improve images display in chat messages Aug 16, 2024
@vual
Copy link
Contributor Author

vual commented Aug 16, 2024

@vual 能不能看下 8、9 、10 个的时候样子?

根据你现在的截图,我感觉 5 个的时候并没有比原来好,但 7 个的时候可能是你现在的会好一点。

大于3个时,就按一行3个显示。
image
image
image

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


@vual Can you see what it looks like at 8, 9 and 10?

Based on your current screenshots, I feel that the 5-bit version is no better than the original one, but the 7-bit version may be a little better than what you have now.

When there are more than 3, they will be displayed as 3 in a row.
image
image
image

Copy link

vercel bot commented Sep 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-preview 🛑 Canceled (Inspect) Sep 18, 2024 4:55pm

@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Sep 18, 2024
Copy link
Contributor

@arvinxx arvinxx left a comment

Choose a reason for hiding this comment

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

LGTM

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm This PR has been approved by a maintainer size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants