Skip to content

Commit

Permalink
AI Assistant: Enable Breve for 10% of production sites (#38465)
Browse files Browse the repository at this point in the history
* enable breve to 10% of production sites

* changelog

* fix highlights check
  • Loading branch information
dhasilva authored Jul 23, 2024
1 parent 4c6c1d6 commit be1b5a7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: enhancement

AI Assistant: Enable Breve for 10% of production sites
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { getFeatureAvailability } from '../../../../blocks/ai-assistant/lib/util
import JetpackPluginSidebar from '../../../../shared/jetpack-plugin-sidebar';
import { FeaturedImage } from '../ai-image';
import { Breve, registerBreveHighlights, Highlight } from '../breve';
import isBreveAvailable from '../breve/utils/get-availability';
import Feedback from '../feedback';
import TitleOptimization from '../title-optimization';
import UsagePanel from '../usage-panel';
Expand Down Expand Up @@ -65,7 +66,6 @@ const JetpackAndSettingsContent = ( {
requireUpgrade,
upgradeType,
}: JetpackSettingsContentProps ) => {
const isBreveAvailable = getFeatureAvailability( 'ai-proofread-breve' );
const isLogoGeneratorAvailable = getFeatureAvailability( 'ai-assistant-site-logo-support' );
const { checkoutUrl } = useAICheckout();
const [ showLogoGeneratorModal, setShowLogoGeneratorModal ] = useState( false );
Expand Down Expand Up @@ -139,8 +139,6 @@ const JetpackAndSettingsContent = ( {
export default function AiAssistantPluginSidebar() {
const { requireUpgrade, upgradeType, currentTier } = useAiFeature();
const { checkoutUrl } = useAICheckout();
const isBreveAvailable = getFeatureAvailability( 'ai-proofread-breve' );

const { tracks } = useAnalytics();

const isViewable = useSelect( select => {
Expand Down Expand Up @@ -230,4 +228,4 @@ export default function AiAssistantPluginSidebar() {
}

// Register the highlight format type from the Breve component
getFeatureAvailability( 'ai-proofread-breve' ) && registerBreveHighlights();
isBreveAvailable && registerBreveHighlights();
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { getFeatureAvailability } from '../../../../../blocks/ai-assistant/lib/utils/get-feature-availability';

const blogId = parseInt( window?.Jetpack_Editor_Initial_State?.wpcomBlogId );

// Enable backend prompts for beta sites + 10% of production sites.
const isBreveAvailable = getFeatureAvailability( 'ai-proofread-breve' ) || blogId % 10 === 0;

export default isBreveAvailable;
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import React from 'react';
/**
* Internal dependencies
*/
import './style.scss';
import usePostContent from '../../hooks/use-post-content';
import AiAssistantModal from '../modal';
import './style.scss';
/**
* Types
*/
Expand Down

0 comments on commit be1b5a7

Please sign in to comment.