Page MenuHomePhabricator

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

Authored by will on Nov 1 2024, 11:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Dec 3, 9:32 AM
Unknown Object (File)
Sat, Nov 30, 1:48 AM
Unknown Object (File)
Tue, Nov 26, 5:52 AM
Unknown Object (File)
Tue, Nov 26, 3:56 AM
Unknown Object (File)
Mon, Nov 25, 8:31 AM
Unknown Object (File)
Nov 23 2024, 4:17 PM
Unknown Object (File)
Nov 23 2024, 3:52 AM
Unknown Object (File)
Nov 22 2024, 3:11 PM
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.Nov 1 2024, 11:12 AM
will edited the test plan for this revision. (Show Details)
will requested review of this revision.Nov 1 2024, 11:29 AM
ashoat requested changes to this revision.Nov 1 2024, 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.Nov 1 2024, 11:31 AM
This revision is now accepted and ready to land.Nov 1 2024, 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