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
F3372172: D13855.id.diff
Tue, Nov 26, 5:52 AM
F3370770: D13855.id45573.diff
Tue, Nov 26, 3:56 AM
Unknown Object (File)
Mon, Nov 25, 8:31 AM
Unknown Object (File)
Sat, Nov 23, 4:17 PM
Unknown Object (File)
Sat, Nov 23, 3:52 AM
Unknown Object (File)
Fri, Nov 22, 3:11 PM
Unknown Object (File)
Thu, Nov 21, 7:40 AM
Unknown Object (File)
Thu, Nov 21, 1:03 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 ↗(On Diff #45575)

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 ↗(On Diff #45575)

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 ↗(On Diff #45575)

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