feat: close #2187 improve chat actions ux

This commit is contained in:
Yidadaa 2023-06-29 23:51:11 +08:00
parent 463251dcc1
commit 3937dad6a6
2 changed files with 37 additions and 27 deletions

View File

@ -239,6 +239,19 @@
&:last-child { &:last-child {
animation: slide-in ease 0.3s; animation: slide-in ease 0.3s;
} }
&:hover {
.chat-message-actions {
opacity: 1;
transform: translateY(0px);
max-width: 100%;
height: 40px;
}
.chat-message-action-date {
opacity: 0.2;
}
}
} }
.chat-message-user { .chat-message-user {
@ -305,45 +318,40 @@
position: relative; position: relative;
transition: all ease 0.3s; transition: all ease 0.3s;
&:hover {
.chat-message-actions {
opacity: 1;
transform: translateY(0px);
max-width: 100%;
height: 40px;
.chat-message-action-date {
opacity: 0.3;
}
}
}
.chat-message-actions { .chat-message-actions {
display: flex; display: flex;
box-sizing: border-box; box-sizing: border-box;
font-size: 12px; font-size: 12px;
align-items: flex-end; align-items: flex-end;
justify-content: space-between; justify-content: space-between;
transition: all ease 0.1s; transition: all ease 0.3s 0.15s;
transform: translateY(10px); transform: translateX(-5px) scale(0.9) translateY(30px);
opacity: 0; opacity: 0;
height: 0; height: 0;
max-width: 0; max-width: 0;
position: absolute;
left: 0;
z-index: 2;
.chat-input-actions { .chat-input-actions {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
} }
} }
}
.chat-message-action-date { .chat-message-action-date {
white-space: nowrap; font-size: 12px;
transition: all ease 0.6s; opacity: 0.2;
color: var(--black); white-space: nowrap;
opacity: 0; transition: all ease 0.6s;
text-align: right; color: var(--black);
margin-left: 20px; text-align: right;
} width: 100%;
box-sizing: border-box;
padding-right: 10px;
pointer-events: none;
z-index: 1;
} }
.chat-message-user > .chat-message-container > .chat-message-item { .chat-message-user > .chat-message-container > .chat-message-item {

View File

@ -992,13 +992,15 @@ export function Chat() {
</> </>
)} )}
</div> </div>
<div className={styles["chat-message-action-date"]}>
{message.date.toLocaleString()}
</div>
</div> </div>
)} )}
</div> </div>
{showActions && (
<div className={styles["chat-message-action-date"]}>
{message.date.toLocaleString()}
</div>
)}
</div> </div>
</div> </div>
{shouldShowClearContextDivider && <ClearContextDivider />} {shouldShowClearContextDivider && <ClearContextDivider />}