mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-28 23:48:39 +02:00
feat: add session library backend APIs
Add persisted session and pattern metadata for pinning, archiving, manual titles, and favorite patterns. Expose backend query and mutation APIs for session library features, and cover the shared helpers with tests. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -4,6 +4,7 @@ import type { PatternDefinition } from '@shared/domain/pattern';
|
||||
import {
|
||||
applyScratchpadSessionConfig,
|
||||
createScratchpadSessionConfig,
|
||||
resolveSessionTitle,
|
||||
resolveScratchpadSessionConfig,
|
||||
type SessionRecord,
|
||||
} from '@shared/domain/session';
|
||||
@@ -95,3 +96,25 @@ describe('scratchpad session config helpers', () => {
|
||||
expect(updated.agents[1]).toEqual(pattern.agents[1]);
|
||||
});
|
||||
});
|
||||
|
||||
describe('session title helpers', () => {
|
||||
test('keeps a manual title instead of recomputing it from the first user message', () => {
|
||||
const pattern = createPattern();
|
||||
const session = createSession({
|
||||
title: 'Release readiness review',
|
||||
titleSource: 'manual',
|
||||
});
|
||||
|
||||
expect(
|
||||
resolveSessionTitle(session, pattern, [
|
||||
{
|
||||
id: 'msg-1',
|
||||
role: 'user',
|
||||
authorName: 'You',
|
||||
content: 'Investigate why the version badge keeps saying unknown after refresh.',
|
||||
createdAt: '2026-03-23T00:00:00.000Z',
|
||||
},
|
||||
]),
|
||||
).toBe('Release readiness review');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user