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)
Thu, Nov 7, 10:51 AM
Unknown Object (File)
Tue, Nov 5, 4:27 AM
Unknown Object (File)
Tue, Nov 5, 4:27 AM
Unknown Object (File)
Mon, Oct 28, 12:45 PM
Unknown Object (File)
Mon, Oct 28, 12:45 PM
Unknown Object (File)
Mon, Oct 28, 12:45 PM
Unknown Object (File)
Mon, Oct 28, 12:45 PM
Unknown Object (File)
Mon, Oct 28, 12:36 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
Lint Not Applicable
Unit
Tests Not Applicable

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.