Page MenuHomePhabricator

[lib] Introduce new ifJustViewer field in ThreadEntity for PRIVATE threads
ClosedPublic

Authored by ashoat on Apr 15 2023, 11:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 9, 10:34 PM
Unknown Object (File)
Mon, Dec 9, 10:34 PM
Unknown Object (File)
Sun, Dec 8, 6:36 PM
Unknown Object (File)
Thu, Dec 5, 2:28 AM
Unknown Object (File)
Thu, Dec 5, 2:28 AM
Unknown Object (File)
Nov 15 2024, 2:06 AM
Unknown Object (File)
Nov 14 2024, 11:02 PM
Unknown Object (File)
Nov 14 2024, 10:34 PM
Subscribers
None

Details

Summary

We currently name new ENS users' PRIVATE threads after their wallet address. In order to instead display their ENS name, we want to make the EntityText framework support some way to render an unnamed PRIVATE thread's name as just their username.

Currently we display such threads as "just you". In this diff, we introduce a new ifJustViewer field to make it possible to show "ashoat.eth" instead.

Test Plan

In combination with the following diff, I tested this by deleting and recreating my ashoat.eth account in my local web environment, and confirming that my new PRIVATE thread was displayed with the name "ashoat.eth"

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

tomek added inline comments.
lib/shared/thread-utils.js
873–876 ↗(On Diff #25188)

We can probably avoid this logic by implementing thread type specs - just like for message types. Then we would have a method that has one implementation for PRIVATE and one for other types. Obviously, this refactoring would be a lot more complicated than this, but we can consider it in the future.

lib/utils/entity-text.js
248–249 ↗(On Diff #25188)

It isn't intuitive to ignore viewer when viewer username mode is selected.

This revision is now accepted and ready to land.Apr 17 2023, 4:36 AM
lib/shared/thread-utils.js
873–876 ↗(On Diff #25188)

Agree that we should do this

lib/utils/entity-text.js
248–249 ↗(On Diff #25188)

I'll add a comment

This revision was landed with ongoing or failed builds.Apr 17 2023, 4:41 PM
This revision was automatically updated to reflect the committed changes.