Skip to content

Commit 7a36d21

Browse files
authored
fix(chat-deploy): fixed hanging deployment state, fixed x tools, fixed credentials styling (#303)
* fix(ui): standardize flex for credentials component * fixed hanging deploy request for chat deploy, configured & tested DNS subdomain deployment * fixed x endpoints
1 parent 4e14914 commit 7a36d21

6 files changed

Lines changed: 42 additions & 25 deletions

File tree

sim/app/w/[id]/components/control-bar/components/deploy-modal/components/chat-deploy/chat-deploy.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ interface ChatDeployProps {
4848
onChatExistsChange?: (exists: boolean) => void
4949
showDeleteConfirmation?: boolean
5050
setShowDeleteConfirmation?: (show: boolean) => void
51+
onDeploymentComplete?: () => void
5152
}
5253

5354
type AuthType = 'public' | 'password' | 'email'
@@ -81,6 +82,7 @@ export function ChatDeploy({
8182
onChatExistsChange,
8283
showDeleteConfirmation: externalShowDeleteConfirmation,
8384
setShowDeleteConfirmation: externalSetShowDeleteConfirmation,
85+
onDeploymentComplete,
8486
}: ChatDeployProps) {
8587
// Store hooks
8688
const { addNotification } = useNotificationStore()
@@ -703,6 +705,14 @@ export function ChatDeploy({
703705
if (chatUrl) {
704706
logger.info(`Chat ${existingChat ? 'updated' : 'deployed'} successfully:`, chatUrl)
705707
setDeployedChatUrl(chatUrl)
708+
709+
if (onDeploymentComplete) {
710+
onDeploymentComplete()
711+
}
712+
713+
if (onChatExistsChange) {
714+
onChatExistsChange(true)
715+
}
706716
} else {
707717
throw new Error('Response missing chatUrl')
708718
}
@@ -810,7 +820,7 @@ export function ChatDeploy({
810820
{domainSuffix}
811821
</div>
812822
</div>
813-
<p className="text-xs text-muted-foreground">Your chat is now live at this URL</p>
823+
<p className="text-xs text-muted-foreground">Your chat is now live at <a href={deployedChatUrl} target="_blank" rel="noopener noreferrer" className="text-primary hover:underline">this URL</a></p>
814824
</div>
815825
</div>
816826
)

sim/app/w/[id]/components/control-bar/components/deploy-modal/deploy-modal.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,10 @@ export function DeployModal({
495495
}
496496
}
497497

498+
const handleChatDeploymentComplete = () => {
499+
setChatSubmitting(false);
500+
};
501+
498502
// Render deployed chat view
499503
const renderDeployedChatView = () => {
500504
if (!deployedChatUrl) {
@@ -618,6 +622,7 @@ export function DeployModal({
618622
onChatExistsChange={setChatExists}
619623
showDeleteConfirmation={showDeleteConfirmation}
620624
setShowDeleteConfirmation={setShowDeleteConfirmation}
625+
onDeploymentComplete={handleChatDeploymentComplete}
621626
/>
622627
)}
623628
</div>

sim/app/w/components/sidebar/components/settings-modal/components/credentials/credentials.tsx

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -374,26 +374,26 @@ export function Credentials({ onOpenChange }: CredentialsProps) {
374374
)}
375375
ref={pendingService === service.id ? pendingServiceRef : undefined}
376376
>
377-
<div className="flex items-start justify-between gap-4">
378-
<div className="flex items-start gap-4">
377+
<div className="flex items-start w-full gap-4">
378+
<div className="flex items-start gap-4 w-full">
379379
<div className="flex h-12 w-12 items-center justify-center rounded-lg bg-muted shrink-0">
380380
{typeof service.icon === 'function'
381381
? service.icon({ className: 'h-5 w-5' })
382382
: service.icon}
383383
</div>
384-
<div className="space-y-1">
384+
<div className="space-y-1 w-full">
385385
<div>
386386
<h4 className="font-medium leading-none">{service.name}</h4>
387387
<p className="text-sm text-muted-foreground mt-1">
388388
{service.description}
389389
</p>
390390
</div>
391391
{service.accounts && service.accounts.length > 0 && (
392-
<div className="pt-3 space-y-2">
392+
<div className="pt-3 space-y-2 w-full">
393393
{service.accounts.map((account) => (
394394
<div
395395
key={account.id}
396-
className="flex items-center justify-between gap-2 rounded-md border bg-card/50 p-2"
396+
className="flex items-center justify-between gap-2 rounded-md border bg-card/50 p-2 w-full"
397397
>
398398
<div className="flex items-center gap-2">
399399
<div className="h-6 w-6 rounded-full bg-green-500/10 flex items-center justify-center">
@@ -441,22 +441,24 @@ export function Credentials({ onOpenChange }: CredentialsProps) {
441441
</div>
442442

443443
{!service.accounts?.length && (
444-
<Button
445-
variant="default"
446-
size="sm"
447-
onClick={() => handleConnect(service)}
448-
disabled={isConnecting === service.id}
449-
className="shrink-0"
450-
>
451-
{isConnecting === service.id ? (
452-
<>
453-
<RefreshCw className="h-4 w-4 animate-spin mr-2" />
454-
Connecting...
455-
</>
456-
) : (
457-
'Connect'
458-
)}
459-
</Button>
444+
<div className="flex justify-end ml-auto">
445+
<Button
446+
variant="default"
447+
size="sm"
448+
onClick={() => handleConnect(service)}
449+
disabled={isConnecting === service.id}
450+
className="shrink-0"
451+
>
452+
{isConnecting === service.id ? (
453+
<>
454+
<RefreshCw className="h-4 w-4 animate-spin mr-2" />
455+
Connecting...
456+
</>
457+
) : (
458+
'Connect'
459+
)}
460+
</Button>
461+
</div>
460462
)}
461463
</div>
462464
</Card>

sim/tools/x/read.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const xReadTool: ToolConfig<XReadParams, XReadResponse> = {
4242
'attachments.poll_ids',
4343
].join(',')
4444

45-
return `https://api.x.com/2/tweets/${params.tweetId}?expansions=${expansions}`
45+
return `https://api.twitter.com/2/tweets/${params.tweetId}?expansions=${expansions}`
4646
},
4747
method: 'GET',
4848
headers: (params) => ({

sim/tools/x/search.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ export const xSearchTool: ToolConfig<XSearchParams, XSearchResponse> = {
7272
if (params.endTime) queryParams.append('end_time', params.endTime)
7373
if (params.sortOrder) queryParams.append('sort_order', params.sortOrder)
7474

75-
return `https://api.x.com/2/tweets/search/recent?${queryParams.toString()}`
75+
return `https://api.twitter.com/2/tweets/search/recent?${queryParams.toString()}`
7676
},
7777
method: 'GET',
7878
headers: (params) => ({

sim/tools/x/write.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export const xWriteTool: ToolConfig<XWriteParams, XWriteResponse> = {
4242
},
4343

4444
request: {
45-
url: 'https://api.x.com/2/tweets',
45+
url: 'https://api.twitter.com/2/tweets',
4646
method: 'POST',
4747
headers: (params) => ({
4848
Authorization: `Bearer ${params.accessToken}`,

0 commit comments

Comments
 (0)