-
Notifications
You must be signed in to change notification settings - Fork 568
fix(chat): do not separate edited messages from the group #19006
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,7 +84,7 @@ | |
| <div | ||
| v-if="!isDeletedMessage" | ||
| class="message-main__info"> | ||
| <span v-if="isSplitViewEnabled && isOwnMessage && message.lastEditTimestamp" class="editor"> | ||
| <span v-if="message.lastEditTimestamp" class="editor"> | ||
| <IconPencilOutline :size="14" /> | ||
| <AvatarWrapper | ||
| v-if="isEditorDifferentThenAuthor" | ||
|
|
@@ -503,9 +503,9 @@ export default { | |
|
|
||
| isEditorDifferentThenAuthor() { | ||
| return this.message.lastEditActorId | ||
| && this.message.lastEditActorId !== this.message.actorId | ||
| && this.message.lastEditActorDisplayName !== this.message.actorDisplayName | ||
| && this.message.lastEditActorType !== this.message.actorType | ||
| && (this.message.lastEditActorId !== this.message.actorId | ||
| || this.message.lastEditActorType !== this.message.actorType) | ||
| }, | ||
|
|
||
| isMessagePinned() { | ||
|
|
@@ -617,7 +617,8 @@ export default { | |
| min-height: var(--clickable-area-small); | ||
| min-width: 100%; | ||
| // Layout 1 (standard view): text and info in two columns | ||
| grid-template-columns: minmax(0, $messages-text-max-width) $messages-info-width; | ||
| // Info column grows past its minimum to fit the edited-message icon, so it never overlaps the text column | ||
| grid-template-columns: minmax(0, $messages-text-max-width) minmax($messages-info-width, max-content); | ||
| row-gap: var(--default-grid-baseline); | ||
|
|
||
| & .message-main__thread-title, | ||
|
|
@@ -691,11 +692,7 @@ export default { | |
| width: auto; | ||
|
|
||
| .editor { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| margin-inline-end: var(--default-grid-baseline); | ||
| gap: calc(var(--default-grid-baseline) / 2); | ||
| height: 1lh; | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -805,13 +802,25 @@ export default { | |
| position: relative; | ||
| user-select: none; | ||
| display: flex; | ||
| align-items: center; | ||
| justify-content: flex-end; | ||
| color: var(--color-text-maxcontrast); | ||
| font-size: var(--default-font-size); | ||
| width: $messages-info-width; | ||
| min-width: $messages-info-width; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| gap: calc(var(--default-grid-baseline) / 2); | ||
| padding-inline: calc(2 * var(--default-grid-baseline)); | ||
|
|
||
| .editor { | ||
| display: inline-flex; | ||
| align-items: center; | ||
| gap: calc(var(--default-grid-baseline) / 2); | ||
| height: 1lh; | ||
|
|
||
| :deep(.avatar-wrapper) { | ||
| line-height: 0; | ||
| } | ||
| } | ||
|
|
||
| .date { | ||
| width: 8ch; | ||
| text-align: end; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,14 +101,13 @@ export default { | |
| const firstMessage = computed(() => messages.value[0]) | ||
| const { | ||
| remoteServer, | ||
| lastEditor, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it was the only consumer of this computed. Instead of removing it, maybe keep it and add in aria label of the pencil icon? |
||
| actorDisplayName, | ||
| actorDisplayNameWithFallback, | ||
| } = useMessageInfo(firstMessage) | ||
| const isSidebar = inject('chatView:isSidebar', false) | ||
|
|
||
| const actorInfo = computed(() => { | ||
| return [actorDisplayNameWithFallback.value, remoteServer.value, lastEditor.value] | ||
| return [actorDisplayNameWithFallback.value, remoteServer.value] | ||
| .filter((value) => value).join(' ') | ||
| }) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -592,10 +592,6 @@ export default { | |
| return false | ||
| } | ||
|
|
||
| if (!!message1.lastEditTimestamp || !!message2.lastEditTimestamp) { | ||
| return false // Edited messages are not grouped | ||
| } | ||
|
|
||
|
Comment on lines
-595
to
-598
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a test |
||
| if (message1.actorType === ATTENDEE.ACTOR_TYPE.BOTS // Don't group messages of bots | ||
| && message1.actorId !== ATTENDEE.CHANGELOG_BOT_ID // Apart from the changelog bot | ||
| && message1.actorId !== ATTENDEE.SAMPLE_BOT_ID) { // Apart from the sample message | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two different users with the same name will pass this and will be read as self-edited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So then we should fully remove displayName condition? actorId+actorType pair is unique enough