better privacy

This commit is contained in:
Thomas G. Lopes 2025-06-19 12:50:56 +01:00
parent 4e1eb76368
commit 8887ed349d
4 changed files with 31 additions and 20 deletions

View file

@ -81,3 +81,11 @@ Clone of [T3 Chat](https://t3.chat/)
- ~[ ] Test link with free credits~
- [x] Cursor-like Rules (@ieedan's idea!)
- [x] Full-text search
### Final push
- [ ] Private mode for greeting
- [ ] Free mode
- [ ] make things prettier
- [ ] mobile adjustments
- [ ] cloud per chat persistance

View file

@ -1,25 +1,24 @@
<script lang="ts">
import { goto } from '$app/navigation';
import { page } from '$app/state';
import { api } from '$lib/backend/convex/_generated/api';
import type { Doc, Id } from '$lib/backend/convex/_generated/dataModel';
import { useCachedQuery } from '$lib/cache/cached-query.svelte';
import * as Sidebar from '$lib/components/ui/sidebar';
import { useSidebarControls } from '$lib/components/ui/sidebar';
import { cmdOrCtrl } from '$lib/hooks/is-mac.svelte';
import Tooltip from '$lib/components/ui/tooltip.svelte';
import { cmdOrCtrl } from '$lib/hooks/is-mac.svelte';
import { session } from '$lib/state/session.svelte';
import { cn } from '$lib/utils/utils.js';
import { useConvexClient } from 'convex-svelte';
import { Avatar } from 'melt/components';
import LoaderCircleIcon from '~icons/lucide/loader-circle';
import PinOffIcon from '~icons/lucide/pin-off';
import { useConvexClient } from 'convex-svelte';
import { session } from '$lib/state/session.svelte';
import { api } from '$lib/backend/convex/_generated/api';
import { callModal } from './ui/modal/global-modal.svelte';
import { goto } from '$app/navigation';
import { useCachedQuery } from '$lib/cache/cached-query.svelte';
import type { Doc, Id } from '$lib/backend/convex/_generated/dataModel';
import PinIcon from '~icons/lucide/pin';
import XIcon from '~icons/lucide/x';
import { page } from '$app/state';
import { Button } from './ui/button';
import SearchIcon from '~icons/lucide/search';
import PanelLeftIcon from '~icons/lucide/panel-left';
import PinIcon from '~icons/lucide/pin';
import PinOffIcon from '~icons/lucide/pin-off';
import XIcon from '~icons/lucide/x';
import { Button } from './ui/button';
import { callModal } from './ui/modal/global-modal.svelte';
let { searchModalOpen = $bindable(false) }: { searchModalOpen: boolean } = $props();
@ -120,10 +119,6 @@
{ key: 'lastMonth', label: 'Last 30 days', conversations: groupedConversations.lastMonth },
{ key: 'older', label: 'Older', conversations: groupedConversations.older },
]);
function openSearchModal() {
searchModalOpen = true;
}
</script>
<Sidebar.Sidebar class="flex flex-col overflow-clip p-2">

View file

@ -18,6 +18,10 @@
'When are you going to take my job?',
];
const settings = useCachedQuery(api.user_settings.get, {
session_token: session.current?.session.token ?? '',
});
const suggestionCategories: Record<string, { icon: typeof IconAi; suggestions: string[] }> = {
Create: {
icon: IconAi,
@ -71,7 +75,9 @@
{#if prompt.current.length === 0 && openRouterKeyQuery.data}
<div class="w-full p-2" in:scale={{ duration: 500, start: 0.9 }}>
<h2 class="text-left font-serif text-3xl font-semibold">
Hey there{session.current?.user.name ? ` ${session.current?.user.name}` : ''}!
Hey there <span class={{ 'blur-sm': settings.data?.privacy_mode }}
>{session.current?.user.name ? ` ${session.current?.user.name}` : ''}</span
>!
</h2>
<div class="mt-4 flex flex-wrap items-center gap-1">
{#each Object.entries(suggestionCategories) as [category, opts] (category)}
@ -124,7 +130,9 @@
{:else if !openRouterKeyQuery.data}
<div class="w-full p-2" in:scale={{ duration: 500, start: 0.9 }}>
<h2 class="text-left font-serif text-3xl font-semibold">
Hey there, {session.current?.user.name}!
Hey there, <span class={{ 'blur-sm': settings.data?.privacy_mode }}
>{session.current?.user.name}</span
>!
</h2>
<p class="mt-2 text-left text-lg">
You need to provide a key to start sending messages.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 256 KiB

After

Width:  |  Height:  |  Size: 254 KiB