Skip to content

Conversation

@trabalhefabricio
Copy link

No description provided.

Copilot AI and others added 28 commits December 25, 2025 14:33
- Detached threads now capture state by value instead of using 'this'
- Eliminates potential use-after-free if object is destroyed while thread runs
- Makes save operation fully independent from object lifetime
- Applied to both GeminiClient and LLMClient PersistentState classes

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Use atomic<bool> instead of bool for save_pending_ flag
- Use atomic exchange() to atomically check and set the flag
- Thread now resets flag after save completes, preventing concurrent saves
- Eliminates risk of file corruption from simultaneous writes
- Applied to both GeminiClient and LLMClient

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…tors

- Modified WhitelistEntry to include context field and advanced_subcategories flag
- Changed separator from comma to semicolon (with backward compatibility)
- Updated WhitelistStore to save/load context and advanced settings
- Enhanced WhitelistManagerDialog to support context input and advanced options
- Added user_context field to Settings class
- Integrated context into CategorizationService prompt building
- Added context_input UI field to MainApp
- Connected context input to settings and whitelist selection

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Added "Save Categories to Whitelist" button to CategorizationDialog
- Implemented callback mechanism for saving refined categories
- Extract unique categories and subcategories from review dialog
- Allow users to save refined categories with custom whitelist name
- Categories are now reviewable/modifiable before sorting
- Integrated context from categorization into saved whitelists

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Updated all LLM client prompts (Gemini, OpenAI, Local) to be more intelligent
- Added file extension analysis to categorization prompts
- Prompts now ask LLMs to consider what file types are used for
- Enhanced with semantic meaning and common purpose analysis
- Added file path context when available
- Improved prompt structure for better categorization accuracy
- LLMs now analyze files based on format purpose, not just filename

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Added user_context persistence to Settings load/save
- Added context_input restoration in restore_tree_settings
- Ensure user context is saved across app sessions
- Fix UI state synchronization on startup

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Added null pointer checks in on_save_categories_button_clicked
- Fixed context input to always update when switching whitelists (even if empty)
- Ensures proper UI state synchronization when context is cleared

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…t-feature-overhaul

Refactor whitelist system with context-aware categorization and intelligent file analysis
- Increased remote LLM timeout from 10s to 300s (5 min) to accommodate Gemini's adaptive timeout system (20-240s)
- Added user_provided column to database to track user-provided categorizations
- Created UserCategorizationDialog for manual categorization when AI fails
- Added "Clear Categorization Cache" menu item in Settings menu with options for current folder or all data
- Implemented DatabaseManager::close() and initialize() for cache clearing
- Updated UI translations for new cache management feature

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Simplified cache clearing logic with better error handling
- Added missing QString include to UserCategorizationDialog
- Ensured database reinitialize after deletion
- Verified default parameter for user_provided works with existing call sites

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Added validation feedback to UserCategorizationDialog when fields are empty
- Added comment about thread safety assumption in cache clearing
- Added QMessageBox include for validation dialog
- Acknowledged cached_results.clear() behavior is intentional given current data structure

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Modified prompts in GeminiClient and LLMClient to request confidence indication
- LLM now responds with "UNCERTAIN : filename" when confidence < 70%
- Added heuristic detection for generic categories (Uncategorized, Miscellaneous, Other, Unknown)
- Uncertain cases return empty result and log AI-UNCERTAIN message
- Both confidence-based (remote APIs) and heuristic (all models) approaches work together
- Lays foundation for future UserCategorizationDialog integration

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
- Changed GeminiClient to use placeholder "[filename]" instead of actual filename in prompt
- Ensures consistency between GeminiClient and LLMClient implementations
- Prevents potential prompt injection attacks from malicious filenames
- Detection logic works uniformly across all LLM providers

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…context handling

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…control

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…categorization

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…egory structures

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…te matching logic

Co-authored-by: trabalhefabricio <249921775+trabalhefabricio@users.noreply.github.com>
…ation-locally

Implement adaptive user profiling system with organizational template learning and per-folder control
…s-and-improvements

Fix Gemini timeout errors, add cache management, and implement uncertainty detection
…ormance-issues

Fix critical thread safety and resource management bugs
@trabalhefabricio trabalhefabricio marked this pull request as draft December 25, 2025 23:02
@hyperfield hyperfield marked this pull request as ready for review February 6, 2026 22:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants