From 25d7d6a3793b146b555405ccd42139d3c1aec10e Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Fri, 3 Jul 2026 18:13:23 +0200 Subject: [PATCH] ci(lighthouse): raise script-count budget to 220, align warn to 210 (#8740) * fix(work-context): use project icon for header title icon The header title icon read the active work context's icon, but selectActiveWorkContext forced icon: null for projects (a leftover from when projects had no icon field). Pass the project's own icon through so the header matches the side nav. * ci(lighthouse): raise script-count budget 200->220, align warn to 210 The Lighthouse `resource-summary.script.count` budget in budget.json was an exact hard cap of 200 that the app has crept up against as it grows (master passed at <=200; a recent build hit 201 and failed CI on an unrelated PR). Bump the hard budget to 220 to restore headroom. The parallel warn threshold in .lighthouserc.json was 170 - already exceeded by ~30, so it fired on every run as permanent, meaningless noise. Raise it to 210 so it sits just below the 220 hard cap and again functions as an early warning before the budget is breached. --- .../store/work-context.selectors.spec.ts | 43 +++++++++++++++++++ .../store/work-context.selectors.ts | 5 ++- tools/lighthouse/.lighthouserc.json | 2 +- tools/lighthouse/budget.json | 2 +- 4 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/app/features/work-context/store/work-context.selectors.spec.ts b/src/app/features/work-context/store/work-context.selectors.spec.ts index 89ca14669b..f729d431b9 100644 --- a/src/app/features/work-context/store/work-context.selectors.spec.ts +++ b/src/app/features/work-context/store/work-context.selectors.spec.ts @@ -219,6 +219,49 @@ describe('workContext selectors', () => { expect(result.taskIds).toEqual(['active']); }); + + it('should pass through the project icon (regression: header title icon)', () => { + const project = { + id: 'p1', + title: 'P1', + icon: 'rocket', + taskIds: [], + backlogTaskIds: [], + theme: { primary: '#fff' }, + } as any; + const result = selectActiveWorkContext.projector( + { activeId: 'p1', activeType: WorkContextType.PROJECT } as any, + fakeEntityStateFromArray([project]), + fakeEntityStateFromArray([TODAY_TAG]), + (fakeEntityStateFromArray([]) as any).entities, + [], + todayStr, + 0, + ); + + expect(result.icon).toBe('rocket'); + }); + + it('should default project icon to null when unset', () => { + const project = { + id: 'p1', + title: 'P1', + taskIds: [], + backlogTaskIds: [], + theme: { primary: '#fff' }, + } as any; + const result = selectActiveWorkContext.projector( + { activeId: 'p1', activeType: WorkContextType.PROJECT } as any, + fakeEntityStateFromArray([project]), + fakeEntityStateFromArray([TODAY_TAG]), + (fakeEntityStateFromArray([]) as any).entities, + [], + todayStr, + 0, + ); + + expect(result.icon).toBeNull(); + }); }); describe('selectTrackableTasksForActiveContext', () => { it('should select tasks for project', () => { diff --git a/src/app/features/work-context/store/work-context.selectors.ts b/src/app/features/work-context/store/work-context.selectors.ts index bc7fbd77dd..439b852a3f 100644 --- a/src/app/features/work-context/store/work-context.selectors.ts +++ b/src/app/features/work-context/store/work-context.selectors.ts @@ -208,7 +208,10 @@ export const selectActiveWorkContext = createSelector( } return { ...project, - icon: null, + // Keep the project's own icon so consumers (e.g. the header title icon) + // match the side nav; fall back to null when unset. `...project` already + // carries `icon`, but stay explicit since this used to force null. + icon: project.icon ?? null, taskIds: project.taskIds || [], isEnableBacklog: project.isEnableBacklog, backlogTaskIds: project.backlogTaskIds || [], diff --git a/tools/lighthouse/.lighthouserc.json b/tools/lighthouse/.lighthouserc.json index b2fe174082..2aa1857b99 100644 --- a/tools/lighthouse/.lighthouserc.json +++ b/tools/lighthouse/.lighthouserc.json @@ -21,7 +21,7 @@ "cumulative-layout-shift": ["warn", { "maxNumericValue": 0.1 }], "total-blocking-time": ["warn", { "maxNumericValue": 300 }], "interactive": ["warn", { "maxNumericValue": 5000 }], - "resource-summary.script.count": ["warn", { "maxNumericValue": 170 }], + "resource-summary.script.count": ["warn", { "maxNumericValue": 210 }], "resource-summary.total.count": ["warn", { "maxNumericValue": 300 }], "resource-summary.font.size": ["warn", { "maxNumericValue": 520000 }] } diff --git a/tools/lighthouse/budget.json b/tools/lighthouse/budget.json index 12e653bf11..119ec79c1b 100644 --- a/tools/lighthouse/budget.json +++ b/tools/lighthouse/budget.json @@ -26,7 +26,7 @@ "resourceCounts": [ { "resourceType": "script", - "budget": 200 + "budget": 220 }, { "resourceType": "stylesheet",