-
Notifications
You must be signed in to change notification settings - Fork 86
Studio Code Assistant #2870
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
Studio Code Assistant #2870
Changes from all commits
96129ce
8ff912f
ab9f11e
f28f02d
a1c7cdb
fea21d8
ed3989e
2d979ea
580952f
ae30943
a7a34b8
e5d342e
a434428
cded980
a20a338
efb4f08
e666d7d
927181b
c3bf1c4
190b602
4cbbf44
bbf6a8b
bab6653
80bfb2c
cd87f0b
74f1cbe
a969711
a127b60
c1c14eb
1f0653a
0257618
b413467
6090ba9
c5fec7f
2843ca6
aeb6750
ca485bb
b3da4f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ interface AIInputProps { | |
| handleKeyDown: ( e: React.KeyboardEvent< HTMLTextAreaElement > ) => void; | ||
| clearConversation: () => void; | ||
| isAssistantThinking: boolean; | ||
| showTelexLink?: boolean; | ||
| } | ||
|
|
||
| const MAX_ROWS = 10; | ||
|
|
@@ -54,6 +55,7 @@ const UnforwardedAIInput = ( | |
| handleKeyDown, | ||
| clearConversation, | ||
| isAssistantThinking, | ||
| showTelexLink = true, | ||
| }: AIInputProps, | ||
| inputRef: React.RefObject< HTMLTextAreaElement > | React.RefCallback< HTMLTextAreaElement > | null | ||
| ) => { | ||
|
|
@@ -255,19 +257,24 @@ const UnforwardedAIInput = ( | |
| { ( { onClose }: { onClose: () => void } ) => ( | ||
| <> | ||
| <MenuGroup> | ||
| <MenuItem | ||
| data-testid="telex-link-button" | ||
| onClick={ () => { | ||
| const telexUrl = addUrlParams( `https://${ TELEX_HOSTNAME }/`, TELEX_UTM_PARAMS ); | ||
| getIpcApi().openURL( telexUrl ); | ||
| onClose(); | ||
| } } | ||
| className="flex flex-row" | ||
| > | ||
| <SparklesIcon /> | ||
| <span className="ltr:pl-2 rtl:pl-2">{ __( 'Build with Telex' ) }</span> | ||
| <ArrowIcon /> | ||
| </MenuItem> | ||
| { showTelexLink && ( | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. TBH, I don't think we should have this link to Telex.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. I'll create a follow-up issue to remove it and we can discuss it there. This PR just keeps intact the experience of Studio Assistant. |
||
| <MenuItem | ||
| data-testid="telex-link-button" | ||
| onClick={ () => { | ||
| const telexUrl = addUrlParams( | ||
| `https://${ TELEX_HOSTNAME }/`, | ||
| TELEX_UTM_PARAMS | ||
| ); | ||
| getIpcApi().openURL( telexUrl ); | ||
| onClose(); | ||
| } } | ||
| className="flex flex-row" | ||
| > | ||
| <SparklesIcon /> | ||
| <span className="ltr:pl-2 rtl:pl-2">{ __( 'Build with Telex' ) }</span> | ||
| <ArrowIcon /> | ||
| </MenuItem> | ||
| ) } | ||
| <MenuItem | ||
| isDestructive | ||
| data-testid="clear-conversation-button" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,9 +16,11 @@ import { ChatMessage, MarkDownWithCode } from 'src/components/chat-message'; | |
| import { ChatRating } from 'src/components/chat-rating'; | ||
| import { LearnMoreLink } from 'src/components/learn-more'; | ||
| import offlineIcon from 'src/components/offline-icon'; | ||
| import { StudioCodeChat } from 'src/components/studio-code-chat'; | ||
| import WelcomeComponent from 'src/components/welcome-message-prompt'; | ||
| import { LIMIT_OF_PROMPTS_PER_USER, TELEX_HOSTNAME, TELEX_UTM_PARAMS } from 'src/constants'; | ||
| import { useAuth } from 'src/hooks/use-auth'; | ||
| import { useFeatureFlags } from 'src/hooks/use-feature-flags'; | ||
| import { useOffline } from 'src/hooks/use-offline'; | ||
| import { useThemeDetails } from 'src/hooks/use-theme-details'; | ||
| import { cx } from 'src/lib/cx'; | ||
|
|
@@ -357,6 +359,16 @@ const UnauthenticatedView = ( { onAuthenticate }: { onAuthenticate: () => void } | |
| ); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| export function ContentTabAssistant( { selectedSite }: ContentTabAssistantProps ) { | ||
| const { enableStudioCodeUi } = useFeatureFlags(); | ||
|
|
||
| if ( enableStudioCodeUi ) { | ||
| return <StudioCodeChat selectedSite={ selectedSite } />; | ||
| } | ||
|
|
||
| return <WpcomAssistant selectedSite={ selectedSite } />; | ||
| } | ||
|
|
||
| function WpcomAssistant( { selectedSite }: ContentTabAssistantProps ) { | ||
| const inputRef = useRef< HTMLTextAreaElement >( null ); | ||
| const wrapperRef = useRef< HTMLDivElement >( null ); | ||
| const dispatch = useAppDispatch(); | ||
|
|
||

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.
I like the fact we can resume sessions now.