// DEPLOY_CONFIG: {"triggers": [{"name": "notify_on_call_when_bug_becomes_critical", "on": "collection.update", "collection": "bugs", "actions": [{"type": "email", "to": "{{bug.on_call_email}}", "subject": "Critical bug alert: {{bug.title}}", "body": "Bug \"{{bug.title}}\" has been updated to critical severity.\n\nBug ID: {{bug.id}}\nSeverity: {{bug.severity}}\nStatus: {{bug.status}}\nReporter: {{bug.reporter_email}}\n\nPlease review immediately."}]}, {"name": "notify_reporter_when_bug_fixed", "on": "collection.update", "collection": "bugs", "actions": [{"type": "email", "to": "{{bug.reporter_email}}", "subject": "Bug fixed: {{bug.title}}", "body": "Your reported bug \"{{bug.title}}\" has been marked as fixed.\n\nBug ID: {{bug.id}}\nSeverity: {{bug.severity}}\nStatus: {{bug.status}}\n\nThanks for reporting it."}]}]} import { useState } from 'react'; import { useAI, useAuth, useCollection, usePresence } from '@deplixo/sdk'; import { KanbanBoard } from './components/KanbanBoard.jsx'; import { BugForm } from './components/BugForm.jsx'; import { BugDetail } from './components/BugDetail.jsx'; import { FilterBar } from './components/FilterBar.jsx'; function App() { const { user, loading: authLoading, login, logout } = useAuth(); const [showForm, setShowForm] = useState(false); const [editBug, setEditBug] = useState(null); const [viewBug, setViewBug] = useState(null); const [severityFilter, setSeverityFilter] = useState('all'); const { items, loading, add, update, remove } = useCollection('bugs', { personal: true }); const { add: saveIdentity } = useCollection('auth-identities', { personal: true }); const { generate: generateAI } = useAI(); const { update: updatePresence } = usePresence( user ? { name: user.name, avatar: user.avatar, status: viewBug ? `Viewing bug ${viewBug.id}` : 'Online', } : {} ); const handleSignIn = async () => { await login('google'); }; const handleSaveIdentity = async () => { if (!user) return; const identity = { userId: user.id, name: user.name, email: user.email, avatar: user.avatar, provider: 'google', signedInAt: Date.now(), }; await saveIdentity(identity); }; const inferCategory = async (bugData) => { const title = bugData?.title || ''; const description = bugData?.description || ''; const existingCategory = bugData?.category || ''; if (!title && !description) { return existingCategory || 'General'; } try { const result = await generateAI({ system: 'You infer the best bug category from a title and description. Return only JSON with a single key category. Choose a short category name such as UI, Backend, Performance, Security, Data, Integration, Auth, Mobile, Accessibility, or General.', user: JSON.stringify({ title, description, existingCategory }), json: true, }); const rawCategory = result && typeof result === 'object' ? result.category : ''; const category = typeof rawCategory === 'string' ? rawCategory.trim() : ''; return category || existingCategory || 'General'; } catch (error) { return existingCategory || 'General'; } }; if (authLoading) return
Sign in with Google to create, review, and manage team bugs.