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: show README for prompts when available #313

Merged
merged 3 commits into from
Feb 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,9 @@ Then run:
```bash
npm run generate-icons
```

## Update built-in prompt presets:

```bash
npm run fetch-prompt-presets
```
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"build": "tsc -b && vite build",
"generate-client": "npm run fetch-openapi-schema && npm run openapi-ts",
"fetch-openapi-schema": "curl https://raw.githubusercontent.com/stacklok/codegate/refs/heads/main/api/openapi.json > src/api/openapi.json",
"fetch-prompt-presets": "curl https://raw.githubusercontent.com/stacklok/prompt-library/refs/heads/main/rules.json> ./src/features/workspace/constants/built-in-system-prompts.json",
"openapi-ts": "openapi-ts",
"knip": "knip",
"lint": "eslint .",
Expand Down
2 changes: 1 addition & 1 deletion src/features/header/components/header-status-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ function StatusPopover({
data: ReturnType<typeof useQueriesCodegateStatus>['data']
}) {
return (
<Popover className="px-3 py-2 min-w-64" placement="bottom end">
<Popover className="min-w-64 px-3 py-2" placement="bottom end">
<Dialog aria-label="CodeGate Status" style={{ outline: 0 }}>
<Row
title="CodeGate server"
Expand Down
32 changes: 19 additions & 13 deletions src/features/workspace/components/workspace-custom-instructions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,20 +215,26 @@ function PromptPresetPicker({ onActivate }: PromptPresetPickerProps) {
<div className="flex justify-between gap-4 p-2">
<div className="h-full items-center">
<div className="flex h-full max-w-52 items-center text-clip">
{item.contributors.map((contributor) => (
<Link
className="flex h-full items-center gap-1 rounded-md px-2 text-sm font-bold text-secondary
no-underline hover:bg-gray-200"
target="_blank"
href={`https://github.com/${contributor}/`}
>
<img
className="size-6 rounded-full"
src={`https://github.com/${contributor}.png?size=24`}
/>
<span className="truncate">{contributor}</span>
{item.readme ? (
<Link target="_blank" href={item.readme}>
README.md
</Link>
))}
) : (
item.commiters.map((contributor) => (
<Link
className="flex h-full items-center gap-1 rounded-md px-2 text-sm font-bold text-secondary
no-underline hover:bg-gray-200"
target="_blank"
href={`https://github.com/${contributor}/`}
>
<img
className="size-6 rounded-full"
src={`https://github.com/${contributor}.png?size=24`}
/>
<span className="truncate">{contributor}</span>
</Link>
))
)}
</div>
</div>
<Button
Expand Down
Loading
Loading