-
-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: implemented StarSearch share prompt #3324
Conversation
✅ Deploy Preview for oss-insights ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for design-insights ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Thought this was the issue 😓 , but sharing my context. |
I've pushed changes to use the share dropdown @bdougie, but I think we could still run the risk of the prompt URL being too many characters for Twitter, but this should be an easy fix by either hashing it or using dub.co URLs. |
743c707
to
d4f5006
Compare
This is ready for initial review @nickytonline @isabensusan Screen.Recording.2024-05-30.at.10.49.31.AM.movNotes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the placement of the share icon and the logic to only take the first item in the chat session. Screen.Recording.2024-05-31.at.2.41.49.PM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great @brandonroberts! One thing I wonder is for Twitter/X, we should truncate the prompt if it doesn't fit in a standard Tweet message length.
Also, a shorter URL would be great to increase the text count in a Tweet, but I imagine that unfurling potentially prevents an OG image from appearing?
Yea, we could truncate the prompt, or not include it as it will be in the OG image. The short URL shouldn't prevent the OG image from appearing |
Good point that it's in the OG image so no need for it in the Tweet. Sounds good with that tweak and the short URL. |
@nickytonline The prompt text has been removed from the social media text in favor of the OG image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brandonroberts, it works great on Desktop, but on iPhone at least, the menu share menu opens, but clicking any of the menu items, like share to X do nothing. It looks like Safari/iOS (and any other browsers on iPhone) block window.open in an async call.
There's some solutions in https://stackoverflow.com/questions/20696041/window-openurl-blank-not-working-on-imac-safari that should work.
I tried this logged out and it fills the prompt input, but I'm not prompted to log in and can still run the prompt. CleanShot.2024-06-03.at.11.59.13.mp4 |
That's intended behavior for a shared prompt, otherwise we have to connect and redirect them back just to see the results that someone else already shared. Not sure if we should gate it if its shared |
For that particular prompt I guess not, but what if they do another prompt? |
Not sure, but I'd lean towards letting them enter more prompts to start. |
@nickytonline will you try it again with iOS Safari and see if the window opens now? |
Argh. Still no dice. If you have an Android phone, I can dig into this if you want. |
5fe7a42
to
6fefa5c
Compare
@nickytonline it won't even let me type a prompt rn. I can use one of the suggested prompts though. Screen.Recording.2024-06-06.at.8.56.16.AM.mov |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are some things I'm not clear on, and I've left a couple of comments. Noteably, it's not allowing me to use it when logged in and the LI share isn't working.
I'm in the process of fixing the logged in experience. The check wasn't right. That fix will be up shortly. I'll look at the LinkedIn (LI) share issue. For the LI share issue, does it not open LinkedIn for you? This was working previously. |
That isn't loading the correct OG image. It should be the shared prompt one. 🤔 The copy looks fine though. Open to suggestions for better copy. I'll look into the OG image issue as that wasn't an issue before. |
If it's loading the correct OG image with the prompt, the copy is totally fine. |
The logged in experience and logged out experience should be fine now. I fixed the one time only prompt for a guest @BekahHW. |
For the OG image, I think it's Twitter caching it from the deployment preview before we had the shared prompt OG image. This is what I get when I share it on Twitter from the deploy preview. Same result as you. But if I go to share it on Slack OR Discord, it's all good. I think once this in beta it'll work properly, but Twitter caches aggressively so not sure how long it will take to start appearing correctly on Twitter. |
I'm still investigating why the URL isn't shortened via https://github.com/open-sauced/app/pull/3324/files#diff-4e4544e2a158050d1656e7d4abaa1d7652c416028e87eb88f570db12ac922b21R241 . Is it because it's a deployment preview @brandonroberts? useEffect(() => {
if (!promptMessage) {
return;
}
const promptUrl = getSharedPromptUrl(promptMessage);
let twitterUrl = "https://twitter.com/intent/tweet";
let linkedinUrl = "https://www.linkedin.com/sharing/share-offsite/";
const twitterParams = new URLSearchParams();
const linkedinParams = new URLSearchParams();
setTimeout(async () => {
const shortUrl = await shortenUrl(`${promptUrl}`);
twitterParams.set("text", `Here's my StarSearch prompt!\n\nTry it out for yourself. #StarSearch`);
twitterParams.set("url", shortUrl);
twitterUrl += `?${twitterParams.toString()}`;
setTwitterShareUrl(twitterUrl);
linkedinParams.set("url", shortUrl);
linkedinUrl += `?${linkedinParams.toString()}`;
setLinkedInShareUrl(linkedinUrl);
}, 0);
}, [promptMessage]); |
@nickytonline I don't think so. It could that our Dub dev account is at its limit on the free tier. Let me delete some of those links and let's try it again |
@nickytonline I cleared out all the non-essential links so it shouldn't return an error at least from the API side. |
Looks like that fixed it. Thanks! Looks like the URL shortener fixes OG images as well @BekahHW! |
## [2.34.0-beta.1](v2.33.1-beta.1...v2.34.0-beta.1) (2024-06-06) ### 🍕 Features * implemented StarSearch share prompt ([#3324](#3324)) ([c7ce190](c7ce190))
## [2.34.0](v2.33.0...v2.34.0) (2024-06-06) ### 🐛 Bug Fixes * now long words break so they fit in the StarSearch Share Prompt OG image ([#3532](#3532)) ([d752399](d752399)) * set `/star-search` user avatar after logging in ([#3531](#3531)) ([71b54b7](71b54b7)) * update user redirects to exclude notifications, settings, and card paths ([#3525](#3525)) ([efc893e](efc893e)) ### 🍕 Features * enforce upgrades on workspaces that exceed usage ([#3511](#3511)) ([d98d4b1](d98d4b1)) * implemented StarSearch share prompt ([#3324](#3324)) ([c7ce190](c7ce190))
Description
Now you can share StarSearch prompts. Note that some accessibility issues were also fixed while writing end to end tests for this feature.
Related Tickets & Documents
Closes #3325
Fixes #3478
Mobile & Desktop Screenshots/Recordings
StarSearch.Share.Prompt.mp4
Steps to QA
Share a Prompt
Try the shared prompt
Logged In User
Logged Out User
Tier (staff will fill in)
[optional] What gif best describes this PR or how it makes you feel?