-
Notifications
You must be signed in to change notification settings - Fork 2.8k
adding new features & layouts #813
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
Open
TamHC
wants to merge
8
commits into
ItzCrazyKns:master
Choose a base branch
from
TamHC:dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
match the suggestions to user's language
### 1. __History Retention Configuration__ - __config.toml__: Added `[HISTORY]` section with `RETENTION_DAYS = 30` setting - __Backend Integration__: Updated configuration handling to support history retention - __API Endpoints__: Modified `/api/config` to read/write history retention settings ### 2. __User Interface__ - __Settings Page__: Added "History Settings" section with number input for retention days - __Real-time Updates__: Settings are saved to config.toml when changed - __Clear Documentation__: Explains that retention only applies when incognito mode is off ### 3. __Automatic History Cleanup__ - __Background Processing__: Cleanup runs automatically when new chats are created (non-incognito mode) - __Smart Logic__: Only deletes chats older than configured retention period - __Complete Cleanup__: Removes both chat records and associated messages - __Performance Optimized__: Non-blocking background execution ### 4. __Manual Cleanup API__ - __Endpoint__: `POST /api/cleanup-history` for manual cleanup triggers - __Utility Functions__: Reusable cleanup logic in dedicated utility file ### 5. __Docker Rebuild__ - __Container Rebuild__: Successfully rebuilt the Docker containers with new features - __Configuration Persistence__: config.toml changes are preserved in Docker volume - __Application Ready__: The application should now be accessible at [](http://localhost:3000)<http://localhost:3000> ## Key Features: 1. __Incognito Mode Integration__: History retention only applies when incognito mode is OFF 2. __Flexible Configuration__: 0 = keep forever, any positive number = days to retain 3. __Automatic Cleanup__: Runs in background when creating new chats 4. __Manual Control__: API endpoint for manual cleanup triggers 5. __Database Integrity__: Properly removes both chats and associated messages ## Testing the Feature: 1. __Access the Application__: Open [](http://localhost:3000)<http://localhost:3000> in your browser 2. __Configure Settings__: Go to Settings → History Settings → Set retention days 3. __Test Incognito Mode__: Toggle incognito mode on/off to see different behaviors 4. __Create Test Chats__: Create chats in both modes to verify functionality 5. __Manual Cleanup__: Use the `/api/cleanup-history` endpoint to test manual cleanup
### 1. Updated Theme Provider (`src/components/theme/Provider.tsx`)
- Enabled system theme support by setting `enableSystem={true}`
- Changed default theme from "dark" to "system" so the app follows the user's system preference by default
### 2. Updated Theme Switcher (`src/components/theme/Switcher.tsx`)
- Added "System" option to the theme dropdown menu alongside "Light" and "Dark"
- Removed the custom system theme detection logic that was interfering with next-themes' built-in system detection
- Simplified the component to rely on next-themes' native system theme handling
add setting of layout mode & history retention days
1. Update suggestionGeneratorAgent.ts - Match the suggestions to user's language 2. Add incognito mode - Allow user to switch on / off incognito mode by webpage toggle or url parameter - URL Parameter Control - Accessing `/?incognito=true` automatically enables incognito mode - Accessing `/?incognito=false` or without parameters will use normal mode 3. Add the history retention feature - Allow users to set history retention days through config.toml or API endpoints, as well as on the settings page. 4. Add layout mode: Default / Tabs - Allow users to change default layout mode through config.toml - Allow users to customize layout mode for each browser through setting page 5. Allow users to change webpage theme by system detection
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1. Update suggestionGeneratorAgent.ts
2. Add incognito mode
Allow user to switch on / off incognito mode by webpage toggle or url parameter
URL Parameter Control
Accessing
/?incognito=trueautomatically enables incognito modeAccessing
/?incognito=falseor without parameters will use normal mode3. Add the history retention feature
API Endpoints
GET /api/config
Returns current configuration including
historyRetentionDaysPOST /api/config
Updates configuration including
historyRetentionDaysPOST /api/cleanup-history
Manually triggers history cleanup and returns results:
{ "message": "Cleaned up X old chats and their messages", "deletedChats": X }4. Add layout mode: Default / Tabs
Allow users to change default layout mode through config.toml
Allow users to customize layout mode for each browser through setting page
5. Allow users to change webpage theme by system detection