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 message edited timestamp #275

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/v2/styles/Message/Message-layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,29 @@
.str-chat__message-metadata {
grid-area: metadata;
display: flex;
flex-wrap: wrap;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Adding wrap to the message metadata so that the "edited at ..." label can occupy the second line.

align-items: center;
column-gap: var(--str-chat__spacing-1);
margin-block-start: var(--str-chat__spacing-0_5);

.str-chat__message-simple-name {
@include utils.prevent-glitch-text-overflow;
}

.str-chat__message-simple-time + .str-chat__mesage-simple-edited::before {
content: '•';
margin-right: var(--str-chat__spacing-1);
}

.str-chat__message-edited-timestamp {
--str-chat__message-edited-timestamp-height: 1rem;
flex-basis: 100%;
}
}

&.str-chat__message--me .str-chat__message-metadata {
justify-content: flex-end;
text-align: right;
}

.str-chat__message-status {
Expand Down Expand Up @@ -473,3 +489,20 @@
transform: none;
}
}

.str-chat__message-edited-timestamp {
overflow: hidden;
transition: height 0.1s;

&--open {
height: var(--str-chat__message-edited-timestamp-height, 1rem);
}

&--collapsed {
height: 0;
}
}

.str-chat__message-text--pointer-cursor {
Copy link
Collaborator

Choose a reason for hiding this comment

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

@myandrienko I've added this here -> SDK's can apply this dynamically

Copy link
Collaborator

Choose a reason for hiding this comment

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

Angular logic for reference: https://github.com/GetStream/stream-chat-angular/pull/563/files#diff-1a38d0771c6ea73cc1bfd32b5699ffdc969cbcd65f0f99fef492517b2f201ed1R179-R183 - I know, I know that expression is a bit too complicated, but it handles the following cases:

  • unsent message
  • bounced message
  • edited message

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, this is useful!

cursor: pointer;
}