Skip to content

Commit

Permalink
Merge pull request #468 from dcSpark/paulccari/minor-fixes-ui-3
Browse files Browse the repository at this point in the history
fix: more fixes + bump shinkai app
  • Loading branch information
nicarq authored Oct 1, 2024
2 parents 52782c1 + 16f26a1 commit d5033f9
Show file tree
Hide file tree
Showing 16 changed files with 269 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr-ci-healchecks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
- name: Download side binaries
env:
ARCH: x86_64-unknown-linux-gnu
SHINKAI_NODE_VERSION: v0.8.7
SHINKAI_NODE_VERSION: v0.8.8
OLLAMA_VERSION: v0.3.12
run: |
npx ts-node ./ci-scripts/download-side-binaries.ts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ jobs:
- name: Download side binaries
env:
ARCH: ${{ matrix.arch }}
SHINKAI_NODE_VERSION: v0.8.7
SHINKAI_NODE_VERSION: v0.8.8
OLLAMA_VERSION: v0.3.12
run: |
npx ts-node ./ci-scripts/download-side-binaries.ts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
- name: Download side binaries
env:
ARCH: ${{ matrix.arch }}
SHINKAI_NODE_VERSION: v0.8.7
SHINKAI_NODE_VERSION: v0.8.8
OLLAMA_VERSION: v0.3.12
run: |
npx ts-node ./ci-scripts/download-side-binaries.ts
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,22 +46,22 @@ $ git clone https://github.com/dcSpark/shinkai-apps
```
ARCH="aarch64-apple-darwin" \
OLLAMA_VERSION="v0.3.12" \
SHINKAI_NODE_VERSION="v0.8.7" \
SHINKAI_NODE_VERSION="v0.8.8" \
npx ts-node ./ci-scripts/download-side-binaries.ts
```

#### Linux
```
ARCH="x86_64-unknown-linux-gnu" \
OLLAMA_VERSION="v0.3.12"\
SHINKAI_NODE_VERSION="v0.8.7" \
SHINKAI_NODE_VERSION="v0.8.8" \
npx ts-node ./ci-scripts/download-side-binaries.ts
```

#### Windows
```
$ENV:OLLAMA_VERSION="v0.3.12"
$ENV:SHINKAI_NODE_VERSION="v0.8.7"
$ENV:SHINKAI_NODE_VERSION="v0.8.8"
$ENV:ARCH="x86_64-pc-windows-msvc"
npx ts-node ./ci-scripts/download-side-binaries.ts
```
Expand Down
107 changes: 97 additions & 10 deletions apps/shinkai-desktop/src/components/chat/conversation-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,88 @@ import { useAuth } from '../../store/auth';
import { useSettings } from '../../store/settings';
import { useSetJobScope } from './context/set-job-scope-context';

const ConversationHeader = () => {
const ConversationHeaderEmpty = () => {
const { t } = useTranslation();
const isChatSidebarCollapsed = useSettings(
(state) => state.isChatSidebarCollapsed,
);
const setChatSidebarCollapsed = useSettings(
(state) => state.setChatSidebarCollapsed,
);
const setSetJobScopeOpen = useSetJobScope(
(state) => state.setSetJobScopeOpen,
);
const selectedKeys = useSetJobScope((state) => state.selectedKeys);

return (
<div className="flex h-[58px] items-center justify-between border-b border-gray-400 px-4 py-2">
<div className="inline-flex items-center gap-2">
<TooltipProvider delayDuration={0}>
<Tooltip>
<TooltipTrigger asChild>
<Button
className="text-gray-80 flex items-center gap-2"
onClick={() => setChatSidebarCollapsed(!isChatSidebarCollapsed)}
size="icon"
variant="tertiary"
>
{isChatSidebarCollapsed ? (
<PanelRightClose className="h-4 w-4" />
) : (
<PanelRightOpen className="h-4 w-4" />
)}
<span className="sr-only">
{isChatSidebarCollapsed ? 'Open' : 'Close'} Chat Sidebar
</span>
</Button>
</TooltipTrigger>
<TooltipPortal>
<TooltipContent className="flex flex-col items-center gap-1">
<p> Toggle Chat Sidebar</p>
<div className="text-gray-80 flex items-center justify-center gap-2 text-center">
<span>⌘</span>
<span>B</span>
</div>
</TooltipContent>
</TooltipPortal>
</Tooltip>
</TooltipProvider>

<span className="mr-2.5 line-clamp-1 inline text-sm font-medium capitalize text-white">
New Chat
</span>
</div>

<Button
className={cn(
'flex h-auto w-auto items-center gap-2 rounded-lg bg-gray-400 px-2.5 py-1.5',
)}
onClick={() => {
setSetJobScopeOpen(true);
}}
size="auto"
type="button"
variant="ghost"
>
<div className="flex items-center gap-2">
<FilesIcon className="h-4 w-4" />
<p className="text-xs text-white"> {t('vectorFs.localFiles')}</p>
</div>
{Object.keys(selectedKeys || {}).length > 0 ? (
<Badge className="bg-brand inline-flex h-5 w-5 items-center justify-center rounded-full border-gray-200 p-0 text-center text-gray-50">
{Object.keys(selectedKeys || {}).length}
</Badge>
) : (
<Badge className="inline-flex h-5 w-5 items-center justify-center rounded-full border-gray-200 bg-gray-200 p-0 text-center text-gray-50">
<PlusIcon className="h-3.5 w-3.5" />
</Badge>
)}
</Button>
</div>
);
};

const ConversationHeaderWithInboxId = () => {
const currentInbox = useGetCurrentInbox();
const { inboxId: encodedInboxId = '' } = useParams();
const inboxId = decodeURIComponent(encodedInboxId);
Expand Down Expand Up @@ -142,15 +223,9 @@ const ConversationHeader = () => {
</TooltipPortal>
</Tooltip>
</TooltipProvider>
{currentInbox ? (
<span className="mr-2.5 line-clamp-1 inline text-sm font-medium capitalize text-white">
{currentInbox?.custom_name || currentInbox?.inbox_id}
</span>
) : (
<span className="mr-2.5 line-clamp-1 inline text-sm font-medium capitalize text-white">
New Chat
</span>
)}
<span className="mr-2.5 line-clamp-1 inline text-sm font-medium capitalize text-white">
{currentInbox?.custom_name || currentInbox?.inbox_id}
</span>
</div>
{hasConversationContext ? (
<Button
Expand Down Expand Up @@ -204,4 +279,16 @@ const ConversationHeader = () => {
</div>
);
};

const ConversationHeader = () => {
const { inboxId: encodedInboxId = '' } = useParams();
const inboxId = decodeURIComponent(encodedInboxId);

if (inboxId) {
return <ConversationHeaderWithInboxId />;
}

return <ConversationHeaderEmpty />;
};

export default ConversationHeader;
10 changes: 5 additions & 5 deletions apps/shinkai-desktop/src/components/playground/baml-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,11 +193,11 @@ function BamlEditor() {
bamlForm.setValue('bamlInput', BAML_EXAMPLES[script].bamlInput);
};

const currentBamlScriptName = bamlForm.watch('bamlScriptName');
const currentBamlInput = bamlForm.watch('bamlInput');
const currentDslFile = bamlForm.watch('dslFile');
const currentFunctionName = bamlForm.watch('functionName');
const currentParamName = bamlForm.watch('paramName');
const currentBamlScriptName = bamlForm.watch('bamlScriptName') ?? '';
const currentBamlInput = bamlForm.watch('bamlInput') ?? '';
const currentDslFile = bamlForm.watch('dslFile') ?? '';
const currentFunctionName = bamlForm.watch('functionName') ?? '';
const currentParamName = bamlForm.watch('paramName') ?? '';

useEffect(() => {
const escapedBamlInput = escapeContent(currentBamlInput);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,10 @@ const QuickAskBody = ({ aiModel }: { aiModel: string }) => {
</span>

<h1 className="text-xl font-bold text-white">
{t('chat.emptyStateTitle')}
{t('quickAsk.emptyStateTitle')}
</h1>
<p className="text-gray-80 text-xs">
{t('chat.emptyStateDescription')}
{t('quickAsk.emptyStateDescription')}
</p>
</motion.div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion libs/shinkai-i18n/locales/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,14 @@
"messagePlaceholder": "Enter your message"
}
},
"quickAsk": {
"emptyStateTitle": "Ask Shinkai AI",
"emptyStateDescription": "Try “How to make a HTTP request in JavaScript” , “Give me the top 10 rock music in the 80s”, “Explain me how internet works”"
},
"chat": {
"chats": "Chats",
"emptyStateTitle": "Ask Shinkai AI",
"emptyStateDescription": "Try “How to make a HTTP request in JavaScript” , “Give me the top 10 rock music in the 80s”, “Explain me how internet works”",
"emptyStateDescription": "For quick questions, press ⌘ + Shift + J to use Shinkai Spotlight",
"create": "Create AI Chat",
"allMessagesLoaded": "All previous messages have been loaded ✅",
"limitReachedTitle": "Limit Reached",
Expand Down
10 changes: 8 additions & 2 deletions libs/shinkai-i18n/locales/es-ES.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"": {
},
"aiFilesSearch": {
"description": "Busca para encontrar contenido en todos los archivos de tus archivos AI fácilmente",
"filesSelected": "Seleccionados {{count}} archivos",
Expand Down Expand Up @@ -41,7 +43,7 @@
"editMessage": {
"warning": "Esto reiniciará tu conversación desde aquí."
},
"emptyStateDescription": "Prueba con “Cómo hacer una solicitud HTTP en JavaScript”, “Dame las 10 mejores canciones de rock de los 80”, “Explícame cómo funciona internet”",
"emptyStateDescription": "Para preguntas rápidas, presiona ⌘ + Shift + J para usar Shinkai Spotlight",
"emptyStateTitle": "Pregunta a Shinkai IA",
"enterMessage": "Introducir Mensaje",
"fileProcessing": {
Expand Down Expand Up @@ -289,6 +291,10 @@
"uploadAFile": "Subir un archivo",
"uploadAFileDescription": "Guarda tus notas, sitios web, documentos y otros de forma segura en un solo lugar."
},
"quickAsk": {
"emptyStateDescription": "Prueba con “¿Cómo hacer una solicitud HTTP en JavaScript?”, “Dame las 10 mejores canciones de rock de los 80”, “Explícame cómo funciona Internet”",
"emptyStateTitle": "Pregunta a Shinkai AI"
},
"quickConnection": {
"connectingToNode": "Conectando a tu Nodo Shinkai local",
"form": {
Expand Down Expand Up @@ -534,4 +540,4 @@
"workflowPlayground": {
"label": "Área de Juego de Flujo de Trabajo"
}
}
}
6 changes: 5 additions & 1 deletion libs/shinkai-i18n/locales/id-ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"editMessage": {
"warning": "Ini akan memulai ulang percakapan Anda dari sini."
},
"emptyStateDescription": "Coba “Bagaimana cara membuat permintaan HTTP dalam JavaScript”, “Beri saya 10 musik rock teratas di tahun 80an”, “Jelaskan bagaimana internet bekerja”",
"emptyStateDescription": "Untuk pertanyaan cepat, tekan ⌘ + Shift + J untuk menggunakan Shinkai Spotlight",
"emptyStateTitle": "Tanyakan kepada Shinkai AI",
"enterMessage": "Masukkan Pesan",
"fileProcessing": {
Expand Down Expand Up @@ -289,6 +289,10 @@
"uploadAFile": "Unggah File",
"uploadAFileDescription": "Simpan catatan, situs web, dokumen, dan lainnya dengan aman di satu tempat."
},
"quickAsk": {
"emptyStateDescription": "Coba tanyakan “Bagaimana cara membuat permintaan HTTP di JavaScript”, “Berikan saya 10 lagu rock terbaik di tahun 80-an”, “Jelaskan bagaimana internet bekerja”",
"emptyStateTitle": "Tanya Shinkai AI"
},
"quickConnection": {
"connectingToNode": "Menghubungkan ke Node Shinkai lokal Anda",
"form": {
Expand Down
6 changes: 5 additions & 1 deletion libs/shinkai-i18n/locales/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"editMessage": {
"warning": "ここから会話をやり直します。"
},
"emptyStateDescription": "「JavaScriptでHTTPリクエストを作成する方法」、「80年代のロック音楽のトップ10を教えて」、「インターネットの仕組みを説明して」などをお試しください",
"emptyStateDescription": "簡単な質問の場合は、⌘ + Shift + Jを押して新海スポットライトを使用してください",
"emptyStateTitle": "Shinkai AIに質問してみてください",
"enterMessage": "メッセージを入力",
"fileProcessing": {
Expand Down Expand Up @@ -289,6 +289,10 @@
"uploadAFile": "ファイルをアップロード",
"uploadAFileDescription": "ノート、ウェブサイト、ドキュメントなどを安全に保存"
},
"quickAsk": {
"emptyStateDescription": "「JavaScriptでHTTPリクエストを作成する方法は?」、「80年代のロック音楽トップ10は?」、「インターネットの仕組みを説明して」などを試してみてください。",
"emptyStateTitle": "新海AIに質問する"
},
"quickConnection": {
"connectingToNode": "ローカルShinkaiノードに接続中",
"form": {
Expand Down
6 changes: 5 additions & 1 deletion libs/shinkai-i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"editMessage": {
"warning": "这将重新开始您的对话。"
},
"emptyStateDescription": "尝试 “如何在 JavaScript 中进行 HTTP 请求”, “给我 80 年代十大摇滚音乐”, “解释互联网的工作原理”",
"emptyStateDescription": "对于快速问题,请按 ⌘ + Shift + J 使用 Shinkai Spotlight",
"emptyStateTitle": "询问 Shinkai AI",
"enterMessage": "输入消息",
"fileProcessing": {
Expand Down Expand Up @@ -289,6 +289,10 @@
"uploadAFile": "上传文件",
"uploadAFileDescription": "将您的笔记、网站、文档等安全存储在一个地方。"
},
"quickAsk": {
"emptyStateDescription": "试试“如何在 JavaScript 中发起 HTTP 请求”,“给我 80 年代的十大摇滚音乐”,“给我解释一下互联网是如何工作的”",
"emptyStateTitle": "询问 Shinkai AI"
},
"quickConnection": {
"connectingToNode": "连接到您的本地Shinkai节点",
"form": {
Expand Down
7 changes: 6 additions & 1 deletion libs/shinkai-i18n/src/lib/default/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,16 @@ export default {
messagePlaceholder: 'Enter your message',
},
},
quickAsk: {
emptyStateTitle: 'Ask Shinkai AI',
emptyStateDescription:
'Try “How to make a HTTP request in JavaScript” , “Give me the top 10 rock music in the 80s”, “Explain me how internet works”',
},
chat: {
chats: 'Chats',
emptyStateTitle: 'Ask Shinkai AI',
emptyStateDescription:
'Try “How to make a HTTP request in JavaScript” , “Give me the top 10 rock music in the 80s”, “Explain me how internet works”',
'For quick questions, press ⌘ + Shift + J to use Shinkai Spotlight',
create: 'Create AI Chat',
allMessagesLoaded: 'All previous messages have been loaded ✅',
limitReachedTitle: 'Limit Reached',
Expand Down
2 changes: 1 addition & 1 deletion libs/shinkai-ui/src/components/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ const DropdownMenuRadioItem = React.forwardRef<
>(({ className, children, ...props }, ref) => (
<DropdownMenuPrimitive.RadioItem
className={cn(
'focus:bg-accent relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-gray-400 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
className,
)}
ref={ref}
Expand Down
Loading

0 comments on commit d5033f9

Please sign in to comment.