Page MenuHomePhabricator

[lib] Add 'hasBeenEdited' status to messages
ClosedPublic

Authored by kuba on Mar 7 2023, 1:48 AM.
Tags
None
Referenced Files
F3520623: D6966.id24405.diff
Mon, Dec 23, 12:54 AM
Unknown Object (File)
Fri, Dec 20, 12:40 AM
Unknown Object (File)
Fri, Dec 20, 12:40 AM
Unknown Object (File)
Fri, Nov 29, 11:51 PM
Unknown Object (File)
Tue, Nov 26, 7:14 PM
Unknown Object (File)
Tue, Nov 26, 5:32 PM
Unknown Object (File)
Tue, Nov 26, 1:54 PM
Unknown Object (File)
Nov 23 2024, 12:36 AM
Subscribers

Details

Summary

Added 'hasBeenEdited' variable to track if the message was edited. Will be used to displaying 'edited' label.

Test Plan

Checked if the app compiles and works. Then tested if the status is set properly by changing labels of tooltip buttons to the edited status (instead of 'Reply' i displayed edited status).

Diff Detail

Repository
rCOMM Comm
Branch
kuba/messageediting
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

lib/selectors/chat-selectors.js
332 ↗(On Diff #23479)
403–404 ↗(On Diff #23479)

To work with a read-only type, you can do this

lib/types/messages/text.js
32 ↗(On Diff #23479)
  1. Please never add a new property that isn't read-only unless you have a good reason for it
  2. When touching a type, it's worth seeing if you can easily convert the whole thing to be read-only
kuba marked 3 inline comments as done.

Responded to comments, made hasBeenEdited property read-only

ashoat requested changes to this revision.Mar 8 2023, 7:14 AM

Can we avoid putting this in TextMessageInfo? I don't think it belongs there... and you're doing something pretty inconsistent with how we approached reactions.

Why didn't you put this in ChatMessageInfoItem? (In the future, when you are doing something different like this, please expect that your reviewers will call you out on it, and explain it ahead of time.)

This revision now requires changes to proceed.Mar 8 2023, 7:14 AM

Moved 'hasBeenEdited' property to 'ChatMessageInfoItem' type

Can we avoid putting this in TextMessageInfo? I don't think it belongs there... and you're doing something pretty inconsistent with how we approached reactions.

Why didn't you put this in ChatMessageInfoItem? (In the future, when you are doing something different like this, please expect that your reviewers will call you out on it, and explain it ahead of time.)

You are right. It should be in ChatMessageInfoItem. Going to update the diff.

I wasn't sure if we want to add it to RobotextChatMessageInfoItem, but reactions are there as well, so I also added it to it.

ashoat requested changes to this revision.Mar 8 2023, 10:16 AM

Can RobotextChatMessageInfoItem be edited?

This revision now requires changes to proceed.Mar 8 2023, 10:16 AM

Add 'hasBeenEdited' to code for native to be able to access the variable

Removed 'hasBeenEdited' variable from 'RobotextChatMessageInfoItem'

This revision is now accepted and ready to land.Mar 9 2023, 9:52 AM