From afd7eb0dcf704815452ef62a6fcf85d0600415e5 Mon Sep 17 00:00:00 2001 From: imccyu <276526105+imccyu@users.noreply.github.com> Date: Thu, 23 Jul 2026 19:45:02 +0800 Subject: [PATCH] fix(gui): drop the impossible slots-undefined guard in the ui-question plugin ClientContext types ctx.slots as always present (inject-declared service); the unnecessary-condition lint rule rejects the dead guard and its fail-loud test premise. Load-order failure still surfaces loud through the undeclared-slot registration path, covered by the remaining case. --- packages/client/ui-question/src/client/index.ts | 1 - packages/client/ui-question/tests/browser-plugin.spec.ts | 4 ---- 2 files changed, 5 deletions(-) diff --git a/packages/client/ui-question/src/client/index.ts b/packages/client/ui-question/src/client/index.ts index ef0a253b61..de8f481aad 100644 --- a/packages/client/ui-question/src/client/index.ts +++ b/packages/client/ui-question/src/client/index.ts @@ -29,7 +29,6 @@ function selectQuestion({ interactions }: ComposerChainProps): QuestionWait | nu */ export function apply(ctx: ClientContext): void { const slots = ctx.slots - if (slots === undefined) throw new Error('ui-question: slots service unavailable') ctx.effect( () => slots.register({ name: 'conversation.composer', select: selectQuestion }, QuestionComposer), 'ui-question: composer chain registration', diff --git a/packages/client/ui-question/tests/browser-plugin.spec.ts b/packages/client/ui-question/tests/browser-plugin.spec.ts index 6fb90c3e47..1c4801b96a 100644 --- a/packages/client/ui-question/tests/browser-plugin.spec.ts +++ b/packages/client/ui-question/tests/browser-plugin.spec.ts @@ -31,10 +31,6 @@ describe('apply', () => { expect(inject).toEqual(['slots']) }) - it('fails loud when the slots service is missing', () => { - expect(() => { apply(new Context()) }).toThrow(/slots service unavailable/) - }) - it('fails loud when no live entry has declared the composer slot', async () => { const ctx = new Context() await ctx.plugin(SlotsService).await()