fix(chat): add PATCH to CORS and use Gemini for title generation

- Add PATCH method to CORS allowed methods
- Change title generation to use Gemini 2.5 Flash instead of GPT-5

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Till-JS 2025-11-29 15:20:24 +01:00
parent 24eafc5430
commit 90c696caf3
5 changed files with 21 additions and 4 deletions

View file

@ -16,7 +16,7 @@ async function bootstrap() {
'exp://localhost:8081',
'http://localhost:3001', // Mana Core Auth
],
methods: ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS'],
methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
credentials: true,
});

View file

@ -164,7 +164,7 @@ export const conversationService = {
const response = await chatApi.createCompletion({
messages: [{ role: 'user', content: titlePrompt }],
modelId: '550e8400-e29b-41d4-a716-446655440004', // GPT-4o-Mini
modelId: '550e8400-e29b-41d4-a716-446655440101', // Gemini 2.5 Flash (default)
temperature: 0.3,
maxTokens: 50,
});

View file

@ -80,6 +80,8 @@
'M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z',
logout:
'M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1',
// App icons
grid: 'M4 5a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1V5zM14 5a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1V5zM4 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1H5a1 1 0 01-1-1v-4zM14 15a1 1 0 011-1h4a1 1 0 011 1v4a1 1 0 01-1 1h-4a1 1 0 01-1-1v-4z',
};
function getIcon(iconName: string) {
@ -139,7 +141,9 @@
class:active-pill={item.active}
style="animation-delay: {(header ? i + 1 : i) * 15}ms"
>
{#if item.icon}
{#if item.imageUrl}
<img src={item.imageUrl} alt="" class="pill-image-icon" />
{:else if item.icon}
<svg class="pill-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path
stroke-linecap="round"
@ -296,6 +300,14 @@
flex-shrink: 0;
}
.pill-image-icon {
width: 1.25rem;
height: 1.25rem;
flex-shrink: 0;
border-radius: 0.25rem;
object-fit: cover;
}
.check-icon {
width: 0.875rem;
height: 0.875rem;

View file

@ -9,6 +9,9 @@
return apps.map((app) => ({
id: app.id,
label: app.name,
// Use image icon if available, otherwise use grid as fallback
imageUrl: app.icon,
icon: app.icon ? undefined : 'grid',
onClick: () => {
if (app.isCurrent) {
// Navigate to home route for current app

View file

@ -27,8 +27,10 @@ export interface PillDropdownItem {
id: string;
/** Display label */
label: string;
/** Icon name */
/** Icon name (SVG path) */
icon?: string;
/** Image URL for icon (data URL or regular URL) */
imageUrl?: string;
/** Click handler */
onClick: () => void;
/** Whether item is disabled */