Files
karakeep-mirror/apps/web/lib/clientConfig.tsx
Mohamed Bassem 0bdba54ba2 feat: Add user settings to disable auto tagging/summarization (#2275)
* feat: Add per-user settings to disable auto-tagging and auto-summarization

This commit adds user-level controls for AI features when they are enabled
on the server. Users can now toggle auto-tagging and auto-summarization
on/off from the AI Settings page.

Changes:
- Added autoTaggingEnabled and autoSummarizationEnabled fields to user table
- Updated user settings schemas and API endpoints to handle new fields
- Modified inference workers to check user preferences before processing
- Added toggle switches to AI Settings page (only visible when server has features enabled)
- Generated database migration for new fields
- Exposed enableAutoTagging and enableAutoSummarization in client config

The settings default to null (use server default). When explicitly set to false,
the user's bookmarks will skip the respective AI processing.

* revert migration

* i18n

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-22 14:59:04 +00:00

27 lines
612 B
TypeScript

import { createContext, useContext } from "react";
import type { ClientConfig } from "@karakeep/shared/config";
export const ClientConfigCtx = createContext<ClientConfig>({
publicUrl: "",
publicApiUrl: "",
demoMode: undefined,
auth: {
disableSignups: false,
disablePasswordAuth: false,
},
turnstile: null,
inference: {
isConfigured: false,
inferredTagLang: "english",
enableAutoTagging: false,
enableAutoSummarization: false,
},
serverVersion: undefined,
disableNewReleaseCheck: true,
});
export function useClientConfig() {
return useContext(ClientConfigCtx);
}