Page MenuHomePhabricator

[keyserver] add link back to original warpcast cast in farcaster bot sidebar source message
ClosedPublic

Authored by will on Fri, Nov 1, 11:11 AM.
Tags
None
Referenced Files
F3169290: D13855.diff
Thu, Nov 7, 10:38 AM
F3164138: D13855.diff
Wed, Nov 6, 6:24 PM
Unknown Object (File)
Sat, Nov 2, 3:43 PM
Unknown Object (File)
Sat, Nov 2, 3:43 PM
Unknown Object (File)
Sat, Nov 2, 3:43 PM
Unknown Object (File)
Sat, Nov 2, 3:43 PM
Unknown Object (File)
Sat, Nov 2, 3:32 PM
F3122808: Screenshot 2024-11-01 at 2.05.55 PM.png
Fri, Nov 1, 11:13 AM
Subscribers

Details

Summary

Following discussion in https://linear.app/comm/issue/ENG-9838/add-a-link-back-to-warpcast-in-sidebar-source-message#comment-54f1ff96, we decided to give Comm users context to Comm taggings on Farcaster with a link back to the original cast.

This diff adds a link to "said" in the sidebar source message.

When one copies the cast hash directly on warpcast through the "Copy cast hash" option in a cast's upper right menu, it results in a link like so: https://warpcast.com/ashoat.eth/0xccbf1cc1, but it looks like using the full cast's hash in the link works just the same.

Depends on D13856

Test Plan

Tested by running on my local keyserver and triggering a sidebar creation with a manual webhook event. Included a full cast hash and confirmed the resulting message viewed from my iOS simulator comm app had a linkified "said" word that when clicked, opened the cast on warpcast.

Screenshot 2024-11-01 at 2.05.55 PM.png (788×750 px, 195 KB)

Diff Detail

Repository
rCOMM Comm
Branch
add_warpcast_linkback
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

will retitled this revision from [keyserver] add link back to original warpcast cast on farcaster bot sidebar source message to [keyserver] add link back to original warpcast cast in farcaster bot sidebar source message.Fri, Nov 1, 11:12 AM
will edited the test plan for this revision. (Show Details)
will requested review of this revision.Fri, Nov 1, 11:29 AM
ashoat requested changes to this revision.Fri, Nov 1, 11:31 AM

Line length. Please check this yourself going forward – I don't want to keep having to mention it

This revision now requires changes to proceed.Fri, Nov 1, 11:31 AM
This revision is now accepted and ready to land.Fri, Nov 1, 12:55 PM
keyserver/src/responders/farcaster-webhook-responders.js
71

Did a few things to reduce character count:

  1. renamed linkifiedSaidText to saidText
  2. Introduced https://phab.comm.dev/D13856 which removed the need to access castText with sidebarCast.castText.
  3. Split off warpcast link from linkifiedSaidText into own variable

Wasn't able to find a solution with multi-lining template literals. Using \ with template literals unfortunately includes unwanted whitespace preceding the next line

keyserver/src/responders/farcaster-webhook-responders.js
71

This works, but just to be clear because you seem to be struggling here... there are a ton of solutions here that don't require using template literals. You can just concatenate strings...

keyserver/src/responders/farcaster-webhook-responders.js
71

Got it. I'll opt to concatenate strings next time