Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Svelte: add Cody upsell banner#63167

Merged
camdencheek merged 7 commits intomainfrom
cc/cody-upsell-banner
Jun 12, 2024
Merged

Svelte: add Cody upsell banner#63167
camdencheek merged 7 commits intomainfrom
cc/cody-upsell-banner

Conversation

@camdencheek
Copy link
Member

@camdencheek camdencheek commented Jun 7, 2024

Fixes SRCH-492

test

screenshot-2024-06-07_13-53-54@2x
screenshot-2024-06-07_13-53-47@2x

Test plan

Manual testing. Compared against the banner visible on dotcom. Tested resize behavior (grid correctly reflows)

@cla-bot cla-bot bot added the cla-signed label Jun 7, 2024
@camdencheek camdencheek requested a review from a team June 7, 2024 19:55
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes Cody.svelte to default to normal colors, but allow its fill to be overridden by --icon-fill-color.

More generally: it would be nice if we have a consistent API for all our icons. I briefly attempted to make this conform the unplugin icons. e.g. I don't know whether our icons respect --icon-color, color:, --icon-fill-color, nothing, etc.

@camdencheek camdencheek force-pushed the cc/cody-upsell-banner branch from b47bd05 to 972ba99 Compare June 7, 2024 20:05
@camdencheek camdencheek marked this pull request as ready for review June 7, 2024 20:16
<SearchInput {queryState} autoFocus onSubmit={handleSubmit} />
<SearchHomeNotifications />
</div>
<CodyUpsellBanner />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only want to show this on dotcom, right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh actually it seems we show it on S2 as well 🤔

Copy link
Contributor

@taiyab taiyab Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea, we did put this deliberately on S2, but I'm starting to question that and think we probably shouldn't surface any Cody related things for people who have Code Search only (the Cody pages lead to landing pages, etc. if you don't have it).

Some customers who have Code Search only and use a different AI tool are getting frustrated and confused being shown Cody stuff.

cc @BolajiOlajide

Copy link
Contributor

@taiyab taiyab Jun 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Infact, I think we should pretty urgently include an option for admins to remove this from their instances in React @camdencheek

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@taiyab could you follow up with an issue describing what needs to be shown when? This is getting into the realm of rolling back product decisions, and I'm not comfortable bundling that in with this PR, which I think can be merged separately from changing that behavior.

Cody autocompletes single lines, or entire code blocks, in any programming language, keeping all of your
company’s codebase in mind.
</p>
<a href="/cody">Explore Cody</a>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In react we seem to distinguish between dotcom and enterprise here but it seems the final path should be the same, so I guess this is fine.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. Actually, I wonder if it was because /cody is not part of the SPA on dotcom and gets redirected to our marketing page by Cloudflare. I should probably do the same.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I see.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just pushed a fix 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's unfortunate it's not really testable

@camdencheek camdencheek enabled auto-merge (squash) June 12, 2024 13:46
<SearchInput {queryState} autoFocus onSubmit={handleSubmit} />
<SearchHomeNotifications />
</div>
<CodyUpsellBanner codyHref={window.context.sourcegraphDotComMode ? 'https://sourcegraph.com/cody' : '/cody'} />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we want to abstract this away and do this in the data loader? Maybe we just return codyURL from the page data loader?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hahah, my first attempt did that. I ended up reverting it and going with this because it felt weird to do multiple layers of prop drilling just for a URL. But yes, we maybe should.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(also, I want to chat about window.context in general at pairing time this morning)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Went ahead and passed it in from the data loader

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up reverting it and going with this because it felt weird to do multiple layers of prop drilling just for a URL.

Yeah, I can see that. Not sure what the best course of action is here.

@camdencheek camdencheek merged commit e0e234c into main Jun 12, 2024
@camdencheek camdencheek deleted the cc/cody-upsell-banner branch June 12, 2024 14:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants