Skip to content

Commit

Permalink
Merge pull request #40 from docker/cm/0.1.2
Browse files Browse the repository at this point in the history
Bugfix pass 1
  • Loading branch information
ColinMcNeil authored Jan 30, 2025
2 parents ff35edb + a5155aa commit c3484bb
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 42 deletions.
4 changes: 2 additions & 2 deletions src/extension/ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function App() {
}]
})
await client.docker.cli.exec('run', ['--rm', '-v', 'docker-prompts:/docker-prompts', '--workdir', '/docker-prompts', 'vonwig/function_write_files:latest', `'${payload}'`])
client.desktopUI.toast.success('Prompt registered successfully');
client.desktopUI.toast.success('Prompt registered successfully. Restart Claude Desktop to apply.');
await loadRegistry();
}
catch (error) {
Expand All @@ -100,7 +100,7 @@ export function App() {
}]
})
await client.docker.cli.exec('run', ['--rm', '-v', 'docker-prompts:/docker-prompts', '--workdir', '/docker-prompts', 'vonwig/function_write_files:latest', `'${payload}'`])
client.desktopUI.toast.success('Prompt unregistered successfully');
client.desktopUI.toast.success('Prompt unregistered successfully. Restart Claude Desktop to apply.');
await loadRegistry();
}
catch (error) {
Expand Down
3 changes: 2 additions & 1 deletion src/extension/ui/src/components/ClaudeConfigSyncStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,8 @@ export const ClaudeConfigSyncStatus = ({ client, setHasConfig }: { client: v1.Do
</DialogContent>
</Dialog >

<Dialog open={showRestartModal} onClose={() => setShowRestartModal(false)} >
{/* Keep this closed for now. */}
<Dialog open={showRestartModal && false} onClose={() => setShowRestartModal(false)} >
<DialogTitle>Restart Claude Desktop</DialogTitle>
<DialogContent sx={{ padding: 5, mt: 2 }}>
<Stack direction="column" spacing={3}>
Expand Down
81 changes: 42 additions & 39 deletions src/extension/ui/src/components/PromptCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,45 +19,48 @@ export function CatalogItemCard({ openUrl, item, canRegister, registered, regist
const [isRegistering, setIsRegistering] = useState(false)
return (
<Card sx={{ height: '100%' }}>
<CardContent>
<a href="">
<Stack onClick={openUrl} direction="row" spacing={2} justifyContent="space-between" sx={{ cursor: 'pointer' }}>
<Typography gutterBottom variant="h5" component="div">
{item.name}
</Typography>
<CardMedia
component="img"
sx={{ maxWidth: 100, padding: 1, background: 'white', borderRadius: 1 }}
alt={`Icon for ${item.name}`}
image={item.icon}
/>
</Stack>
</a>
<Typography variant="body2" sx={{ color: 'text.secondary', mt: 2 }}>
{item.description}
</Typography>
</CardContent>
<CardActions>
<Button
size="small"
onClick={() => {
trackEvent('registry-changed', { name: item.name, ref: item.ref, action: registered ? 'remove' : 'add' });
setIsRegistering(true)
if (registered) {
unregister(item).then(() => {
setIsRegistering(false)
})
} else {
register(item).then(() => {
setIsRegistering(false)
})
}
}}
disabled={!canRegister || isRegistering}
>
{isRegistering ? <CircularProgress size={20} /> : registered ? 'Remove' : 'Add'}
</Button>
</CardActions>
<Stack direction="column" height="100%" sx={{ justifyContent: 'space-between' }}>
<CardContent>
<a href="">
<Stack onClick={openUrl} direction="row" spacing={2} justifyContent="space-between" sx={{ cursor: 'pointer' }}>

<Typography gutterBottom variant="h5" component="div">
{item.name}
</Typography>
<CardMedia
component="img"
sx={{ maxWidth: 100, padding: 1, background: 'white', borderRadius: 1 }}
alt={`Icon for ${item.name}`}
image={item.icon}
/>
</Stack>
</a>
<Typography variant="body2" sx={{ color: 'text.secondary', mt: 2 }}>
{item.description}
</Typography>
</CardContent>
<CardActions>
<Button
size="small"
onClick={() => {
trackEvent('registry-changed', { name: item.name, ref: item.ref, action: registered ? 'remove' : 'add' });
setIsRegistering(true)
if (registered) {
unregister(item).then(() => {
setIsRegistering(false)
})
} else {
register(item).then(() => {
setIsRegistering(false)
})
}
}}
disabled={!canRegister || isRegistering}
>
{isRegistering ? <CircularProgress size={20} /> : registered ? 'Remove' : 'Add'}
</Button>
</CardActions>
</Stack>
</Card >
)
}

0 comments on commit c3484bb

Please sign in to comment.