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

feat: add chat history time label #3024

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

Conversation

Patrickill
Copy link
Contributor

No description provided.

Copy link

sweep-ai bot commented Oct 30, 2024

Hey @Patrickill, here is an example of how you can ask me to improve this pull request:

@Sweep Add unit tests for the `formatTimeToChatTime` function in `packages/global/common/string/time.ts` to test:
- When time is less than 60 seconds ago (should return "just_now")
- When time is yesterday (should return "yesterday")
- When time is in current year (should return "MM-DD" format)
- When time is in previous years (should return "YYYY-M-D" format)

📖 For more information on how to use Sweep, please read our documentation.

Copy link

cla-assistant bot commented Oct 30, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Patrickill
❌ 勤劳上班的卑微小张


勤劳上班的卑微小张 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

1 similar comment
Copy link

cla-assistant bot commented Oct 30, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ Patrickill
❌ 勤劳上班的卑微小张


勤劳上班的卑微小张 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

if (now.isSame(target, 'day')) {
return target.format('HH : mm');
return 'common:' + target.format('HH#mm');
Copy link
Collaborator

Choose a reason for hiding this comment

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

去掉


// 如果时间是今天,展示几时:几分
if (now.isSame(target, 'day')) {
return 'common:' + detailTime;
Copy link
Collaborator

Choose a reason for hiding this comment

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

去掉

@@ -34,6 +34,7 @@ export type ChatProviderProps = OutLinkChatAuthProps & {

// not chat test params
chatId?: string;
isLog?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

改成 chatType 把,后面可能还会分其他的

{isChatting && type === ChatRoleEnum.AI && isLastChild ? null : (
<Box order={styleMap.order} ml={styleMap.ml}>
<Flex order={styleMap.order} ml={styleMap.ml} align={'center'} gap={'0.62rem'}>
{chat.time && type === ChatRoleEnum.Human && (isPc || isLog) && (
Copy link
Collaborator

Choose a reason for hiding this comment

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

讨论了下,这里不用 human,都可以展示

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

Successfully merging this pull request may close these issues.

2 participants