Skip to content

feat: Add global chat for navigation #5820

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

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
e68961b
feat: ai flow chat
HugoCasa May 26, 2025
9661f13
Merge remote-tracking branch 'origin/main' into hc/ai-flow-chat
HugoCasa May 27, 2025
50b9dd0
youpi
HugoCasa May 29, 2025
700c484
feat: preprocessor and error handler support
HugoCasa May 30, 2025
13de5ec
Merge remote-tracking branch 'origin/main' into hc/ai-flow-chat
HugoCasa Jun 2, 2025
38aaa44
fix: reactivity
HugoCasa Jun 2, 2025
6240ab6
Add GlobalChat component with drawer functionality
claude[bot] May 27, 2025
c2f40cb
draft
centdix May 23, 2025
7cb8f0a
use triggerable by ai compoennt
centdix May 26, 2025
db99f55
make drawer triggerable
centdix May 27, 2025
4ac46ee
implement logic
centdix May 27, 2025
2496741
add inkeep tool
centdix May 27, 2025
4da5255
cleaner code
centdix May 27, 2025
f13b8f3
make more things available
centdix May 28, 2025
86e6023
more integrations + better system prompt
centdix May 28, 2025
d6340cc
fix docs fetching
centdix May 28, 2025
fb41953
small fix
centdix May 28, 2025
a2a1df1
cleaning
centdix May 28, 2025
ffc6cda
add ask in search bar + right top icon on homepage + suggestions
centdix May 29, 2025
624e379
fix button
centdix May 29, 2025
7a0b39f
disable chat if no ai providers
centdix May 29, 2025
9c31afe
add inkeep endpoint
centdix May 29, 2025
5d14c8a
draft working stuff
centdix May 29, 2025
0217a41
cleaner code
centdix May 29, 2025
1cb8e0d
better chat
centdix May 30, 2025
dd3ff96
fix
centdix May 30, 2025
b98b451
send license and uid
centdix May 30, 2025
2a41322
better anim
centdix May 30, 2025
31f1bed
move logic
centdix May 30, 2025
a6e9ef5
parse links in chat
centdix May 30, 2025
011f881
add missing integration
centdix May 30, 2025
3aaba09
add reset button
centdix May 30, 2025
2fc4d51
fix
centdix May 31, 2025
4238173
rm file
centdix Jun 2, 2025
6e4fdd6
integrate navigator mode
centdix Jun 2, 2025
af37a93
integrate all changes
centdix Jun 2, 2025
6f5806d
add hide button
centdix Jun 2, 2025
ff3b1d1
adjust drawer size
centdix Jun 2, 2025
e331c82
add script ai chat integration
centdix Jun 2, 2025
e7f7801
fix drawer
centdix Jun 2, 2025
89934ec
small fixes
centdix Jun 2, 2025
8185a08
small fixes
centdix Jun 2, 2025
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
Prev Previous commit
Next Next commit
disable chat if no ai providers
  • Loading branch information
centdix committed Jun 2, 2025
commit 7a0b39faf8a6b5d3f270db29897c161a49b609d1
4 changes: 1 addition & 3 deletions frontend/src/lib/components/TriggerableByAI.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,10 @@
<style>
.ai-triggerable-wrapper {
position: relative;
height: 100%;
}

.ai-triggerable-content {
/* This preserves original styling of children */
/* display: contents; */
display: contents;
height: 100%;
}

Expand Down
40 changes: 27 additions & 13 deletions frontend/src/lib/components/chat/GlobalChat.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,31 @@
import { Send, Loader2 } from 'lucide-svelte'
import { chatRequest, prepareSystemMessage } from './core'
import type { ChatCompletionMessageParam } from 'openai/resources/index.mjs'
import { globalChatInitialInput } from '$lib/stores'
import { globalChatInitialInput, userStore, copilotInfo } from '$lib/stores'

let chatHistory = [
{
role: 'assistant',
content: "Hello! I'm your global assistant. How can I help you today?"
}
] as ChatCompletionMessageParam[]
const isAdmin = $derived($userStore?.is_admin || $userStore?.is_super_admin)
const hasCopilot = $derived($copilotInfo.enabled)

const firstMessage = $derived(
hasCopilot
? 'Hello! I am your global assistant. How can I help you today?'
: isAdmin
? 'Enable Windmill AI in your workspace settings to use this chat'
: 'Ask an admin to enable Windmill AI in this workspace to use this chat'
)

let inputValue = $state('')
let isSubmitting = $state(false)
let currentReply = $state('')
let messages = $state(chatHistory)
let messages = $state<ChatCompletionMessageParam[]>([])

// Suggested questions for the user
const suggestions = $state([
const suggestions = [
'How do I create a new workflow?',
"What's the difference between scripts and flows?",
'How can I connect to a database?',
'How do I schedule a recurring job?'
])
]

// Check if there are any user messages
const hasUserMessages = $derived(messages.some((msg) => msg.role === 'user'))
Expand Down Expand Up @@ -64,12 +68,21 @@
}

$effect(() => {
if (globalChatInitialInput) {
if ($globalChatInitialInput.length > 0) {
inputValue = $globalChatInitialInput
globalChatInitialInput.set('')
handleSubmit()
}
})

$effect(() => {
messages = [
{
role: 'assistant',
content: firstMessage
}
]
})
</script>

<div class="flex flex-col h-full bg-surface z-10">
Expand Down Expand Up @@ -111,6 +124,7 @@
size="xs2"
color="gray"
buttonType="button"
disabled={!hasCopilot}
>
{suggestion}
</Button>
Expand All @@ -134,11 +148,11 @@
placeholder="Type your message..."
class="flex-1 resize-none border border-gray-300 dark:border-gray-600 rounded-lg p-3 text-sm bg-surface text-primary focus:outline-none focus:ring-2 focus:ring-blue-500 min-h-[44px] max-h-32 z-10"
rows="1"
disabled={isSubmitting}
disabled={!hasCopilot || isSubmitting}
></textarea>
<Button
size="md"
disabled={!inputValue.trim() || isSubmitting}
disabled={!hasCopilot || !inputValue.trim() || isSubmitting}
iconOnly
startIcon={{ icon: Send }}
on:click={handleSubmit}
Expand Down