feat: enhance theme customization and UI components

- Implemented a new color generation module to create CSS variables based on a single hue value, supporting both light and dark modes.
- Added unit tests for the color generation logic to ensure accuracy and robustness.
- Replaced dropdown location filter with tab navigation in RulesManagerPage and SkillsManagerPage for improved UX.
- Updated app store to manage custom theme hues and states, allowing for dynamic theme adjustments.
- Sanitized notification content before persisting to localStorage to prevent sensitive data exposure.
- Refactored memory retrieval logic to handle archived status more flexibly.
- Improved Tailwind CSS configuration with new gradient utilities and animations.
- Minor adjustments to SettingsPage layout for better visual consistency.
This commit is contained in:
catlog22
2026-02-04 17:20:40 +08:00
parent 88616224e0
commit e260a3f77b
30 changed files with 1377 additions and 388 deletions

View File

@@ -381,16 +381,29 @@ export class CoreMemoryStore {
* Get all memories
*/
getMemories(options: { archived?: boolean; limit?: number; offset?: number } = {}): CoreMemory[] {
const { archived = false, limit = 50, offset = 0 } = options;
const { archived, limit = 50, offset = 0 } = options;
const stmt = this.db.prepare(`
SELECT * FROM memories
WHERE archived = ?
ORDER BY updated_at DESC
LIMIT ? OFFSET ?
`);
let stmt;
let rows;
const rows = stmt.all(archived ? 1 : 0, limit, offset) as any[];
if (archived === undefined) {
// Fetch all memories regardless of archived status
stmt = this.db.prepare(`
SELECT * FROM memories
ORDER BY updated_at DESC
LIMIT ? OFFSET ?
`);
rows = stmt.all(limit, offset) as any[];
} else {
// Fetch memories filtered by archived status
stmt = this.db.prepare(`
SELECT * FROM memories
WHERE archived = ?
ORDER BY updated_at DESC
LIMIT ? OFFSET ?
`);
rows = stmt.all(archived ? 1 : 0, limit, offset) as any[];
}
return rows.map(row => ({
id: row.id,
content: row.content,

View File

@@ -31,8 +31,10 @@ export async function handleCoreMemoryRoutes(ctx: RouteContext): Promise<boolean
// API: Core Memory - Get all memories
if (pathname === '/api/core-memory/memories' && req.method === 'GET') {
const projectPath = url.searchParams.get('path') || initialPath;
const archived = url.searchParams.get('archived') === 'true';
const limit = parseInt(url.searchParams.get('limit') || '50', 10);
const archivedParam = url.searchParams.get('archived');
// undefined means fetch all, 'true' means only archived, 'false' means only non-archived
const archived = archivedParam === null ? undefined : archivedParam === 'true';
const limit = parseInt(url.searchParams.get('limit') || '100', 10);
const offset = parseInt(url.searchParams.get('offset') || '0', 10);
try {