Skip to content
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(webviews): add Sourcegraph Workspaces CTA #6604

Merged
merged 9 commits into from
Jan 15, 2025
Merged

Conversation

abeatrix
Copy link
Contributor

@abeatrix abeatrix commented Jan 11, 2025

CLOSE https://linear.app/sourcegraph/issue/CODY-4661/editor-side-panel-cta

  1. The WelcomeNotice component is added to the WelcomeMessage component, positioned at the bottom of the message. This provides additional information or notices to the user in the chat welcome message.
  2. The isTeamsUpgradeCtaEnabled (feature flag) prop is added to the WelcomeMessage component, allowing the display of the WelcomeNotice component to be conditionally rendered based on the value of this prop. This provides flexibility in controlling the visibility of the WelcomeNotice component within the chat welcome message.

Changes

  • Added the WelcomeNotice component to the WelcomeMessage component
  • Positioned the WelcomeNotice at the bottom of the WelcomeMessage, centered horizontally
  • Added the isTeamsUpgradeCtaEnabled prop to the WelcomeMessage component
  • Conditionally rendered the WelcomeNotice component based on the value of isTeamsUpgradeCtaEnabled

Test plan

Log into an account that has the teams upgrade cta enabled feature flag and confirm you are seeing the CTA in welcome screen:

image

Missing new logo svg

The WelcomeNotice component is added to the WelcomeMessage component, positioned at the bottom of the message. This provides additional information or notices to the user in the chat welcome message.

## Changes
- Added the WelcomeNotice component to the WelcomeMessage component
- Positioned the WelcomeNotice at the bottom of the WelcomeMessage, centered horizontally
The isTeamsUpgradeCtaEnabled prop is added to the WelcomeMessage component, allowing the display of the WelcomeNotice component to be conditionally rendered based on the value of this prop. This provides flexibility in controlling the visibility of the WelcomeNotice component within the chat welcome message.

## Changes
- Added the isTeamsUpgradeCtaEnabled prop to the WelcomeMessage component
- Conditionally rendered the WelcomeNotice component based on the value of isTeamsUpgradeCtaEnabled
return (
<div className="tw-w-full tw-relative tw-shadow-xl tw-bg-muted tw-border tw-border-input-border tw-p-8 tw-h-full tw-overflow-hidden tw-rounded-2xl tw-flex tw-flex-col tw-justify-end tw-items-start tw-gap-4">
<div className="tw-flex tw-mb-2">
<SourcegraphLogo width={22} height={22} />
Copy link
Contributor Author

Choose a reason for hiding this comment

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

TODO: replace with new logo once available

@mmanela mmanela requested a review from eseliger January 11, 2025 14:07
@danielmarquespt
Copy link
Contributor

@abeatrix the heading seems too big from the screenshot. Can you ensure it is 14px and the body text 12px like the design?

@danielmarquespt
Copy link
Contributor

@abeatrix can you also ensure that the callout (red) actually overlays the hints (green) until the user dismissed the callout?

Otherwise it gets too busy
Screenshot 2025-01-13 at 10 13 59

@eseliger
Copy link
Member

@danielmarquespt in your screenshot I find the contrast of the SVG to the background very low - can we do something about that?

@danielmarquespt
Copy link
Contributor

@danielmarquespt in your screenshot I find the contrast of the SVG to the background very low - can we do something about that?

It will always depend on the current theme of the user, so we are limited in that say :/

@abeatrix
Copy link
Contributor Author

@danielmarquespt updated text size to 14px for title and 12px for the text, and the position of the notice as advised:

image

@danielmarquespt
Copy link
Contributor

danielmarquespt commented Jan 14, 2025

@abeatrix a few more UI tweaks

red annotations represent what it should be, not what it is

Screenshot 2025-01-14 at 11 53 12

@abeatrix
Copy link
Contributor Author

@danielmarquespt thanks for the screenshot, that's really helpful! I've made the changes as suggested:
image

Comment on lines 12 to 13
// TODO: Update to live link https://linear.app/sourcegraph/issue/CORE-535/
const DOCS_URL = 'https://docs.sourcegraph.com'
Copy link
Member

Choose a reason for hiding this comment

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

I think we should link to marketing content here, not a docs page - can you check with marketing if they have a link for a landing page yet?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated the placeholder. we can replace the URL in a follow up once the landing page is ready 😄

@abeatrix abeatrix force-pushed the bee/workspace-welcome branch from bad8794 to 3b3c3f3 Compare January 15, 2025 15:59
CLOSE
https://linear.app/sourcegraph/issue/CODY-4657/profile-menu-add-upgrade-to-pro-and-explore-enterprise-plans-cta-if

- Adds an "Upgrade to Pro" CTA in the user menu for non-Pro users
- Adds an "Upgrade to Enterprise" CTA in the user menu for Pro users
when Teams upgrade CTA is enabled
- Adds telemetry recording for the upgrade CTAs

<img width="522" alt="image"
src="https://github.com/user-attachments/assets/fbe7460f-d3c4-45d2-9148-be2a1f0a7b7e"
/>

<img width="378" alt="image"
src="https://github.com/user-attachments/assets/6f59de62-fd2b-4b0b-9416-d5e299a25533"
/>

## Test plan

<!-- Required. See
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles.
-->

Require the workspace team feature flag.
Check if the logo shows up for PLG users.
Enterprise users shouldn't see it.
@abeatrix abeatrix changed the base branch from main to bee/workspace-user-menu-cta January 15, 2025 16:48
@abeatrix abeatrix changed the base branch from bee/workspace-user-menu-cta to main January 15, 2025 17:05
abeatrix and others added 2 commits January 15, 2025 09:06
CLOSE
https://linear.app/sourcegraph/issue/CODY-4658/switch-account-add-create-workspace-cta-if-they-are-on-plg


![image](https://github.com/user-attachments/assets/a5f1ea71-831a-4a2e-a1b0-39fa0435f520)


- Adds a Sourcegraph Teams upgrade CTA to the user menu and tabs bar
- The CTA is conditionally rendered based on the
`isTeamsUpgradeCtaEnabled` prop
- The CTA provides a link to create a Sourcegraph workspace

## Test plan

<!-- Required. See
https://docs-legacy.sourcegraph.com/dev/background-information/testing_principles.
-->

1. Verify the CTA is displayed when `isTeamsUpgradeCtaEnabled` is true
2. Verify the CTA is not displayed when `isTeamsUpgradeCtaEnabled` is
false
3. Verify clicking the "Create a workspace" button navigates to the
correct URL
@abeatrix abeatrix changed the title feat(chat): add WelcomeNotice component to WelcomeMessage feat(webviews): add Sourcegraph Workspaces CTA Jan 15, 2025
@abeatrix abeatrix enabled auto-merge (squash) January 15, 2025 17:30
@abeatrix abeatrix merged commit 8a34b3b into main Jan 15, 2025
22 of 23 checks passed
@abeatrix abeatrix deleted the bee/workspace-welcome branch January 15, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants