max project limit set to below warning threshold

This commit is contained in:
DaKheera47 2026-01-21 12:36:11 +00:00
parent ae5aa53b99
commit 7cc5017e56
2 changed files with 4 additions and 3 deletions

View File

@ -66,7 +66,7 @@ describe('Resume Projects Logic', () => {
});
it('should ensure maxProjects is at least len(locked)', () => {
const input = {
const input = {
maxProjects: 1, // Too small
lockedProjectIds: ['a', 'b'],
aiSelectableProjectIds: []
@ -105,6 +105,7 @@ describe('Resume Projects Logic', () => {
// p1 is visible in base, so it should be locked by default
expect(result.resumeProjects.lockedProjectIds).toEqual(['p1']);
expect(result.resumeProjects.aiSelectableProjectIds).toEqual(['p2', 'p3']);
expect(result.resumeProjects.maxProjects).toBe(3);
});
it('should apply valid overrides', () => {
@ -126,7 +127,7 @@ describe('Resume Projects Logic', () => {
});
it('should handle invalid overrides by falling back to defaults', () => {
const result = rp.resolveResumeProjectsSettings({
const result = rp.resolveResumeProjectsSettings({
catalog: mockCatalog,
overrideRaw: '{"broken json'
});

View File

@ -58,7 +58,7 @@ export function buildDefaultResumeProjectsSettings(
.filter((id) => !lockedSet.has(id));
const total = catalog.length;
const preferredMax = Math.max(lockedProjectIds.length, 4);
const preferredMax = Math.max(lockedProjectIds.length, 3);
const maxProjects = total === 0 ? 0 : Math.min(total, preferredMax);
return normalizeResumeProjectsSettings(