Skip to content

Comments

add promptFilePickers.fixture.ts#297005

Merged
aeschli merged 1 commit intomainfrom
aeschli/odd-bass-643
Feb 23, 2026
Merged

add promptFilePickers.fixture.ts#297005
aeschli merged 1 commit intomainfrom
aeschli/odd-bass-643

Conversation

@aeschli
Copy link
Contributor

@aeschli aeschli commented Feb 23, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 23, 2026 15:17
@aeschli aeschli enabled auto-merge (squash) February 23, 2026 15:17
@aeschli aeschli self-assigned this Feb 23, 2026
@vs-code-engineering vs-code-engineering bot added this to the February 2026 milestone Feb 23, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Component Explorer fixture to render and visually validate the Chat “Prompt File” / “Instruction File” picker UI in the workbench test fixtures.

Changes:

  • Introduces promptFilePickers.fixture.ts with two themed fixtures (prompt files + instruction files with agent instruction files).
  • Provides mocked IPromptsService data sources and minimal layout/context/quick-input services to host the Quick Pick UI.

Comment on lines +181 to +208
const instantiationService = createEditorServices(disposableStore, {
colorTheme: theme,
additionalServices: registration => {
registration.defineInstance(ILayoutService, layoutService);
registration.defineInstance(IContextMenuService, contextMenuService);
registration.defineInstance(IContextViewService, contextViewService);
registration.define(IListService, ListService);
registration.define(IQuickInputService, FixtureQuickInputService);
registration.defineInstance(IPromptsService, promptsService);
registration.defineInstance(IOpenerService, new class extends mock<IOpenerService>() { });
registration.defineInstance(IFileService, new class extends mock<IFileService>() { });
registration.defineInstance(IDialogService, new class extends mock<IDialogService>() { });
registration.defineInstance(ICommandService, new class extends mock<ICommandService>() { });
registration.defineInstance(ILabelService, new class extends mock<ILabelService>() {
override getUriLabel(uri: URI): string {
return uri.path;
}
});
registration.defineInstance(IProductService, new class extends mock<IProductService>() { });
}
});

const pickers = instantiationService.createInstance(PromptFilePickers);

void pickers.selectPromptFile({
placeholder,
type,
});
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixture creates a QuickInputService/QuickInputController (via PromptFilePickers) which registers global window listeners (key/mouse modifiers). createEditorServices uses TestInstantiationService without proper disposal of services created from SyncDescriptors, so those listeners can leak when the fixture is torn down / switched. Consider explicitly instantiating the IQuickInputService here and registering it with disposableStore for disposal (and optionally hiding any active quick input on dispose).

Copilot uses AI. Check for mistakes.
return promptsState.userPromptFiles.filter(file => file.type === type);
case PromptsStorage.extension:
return promptsState.extensionPromptFiles.filter(file => file.type === type);
}
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

listPromptFilesForStorage doesn't return a value for the (theoretically) fallthrough path of the switch (storage), which will cause a TS error (Function lacks ending return statement...). Add an explicit default/throw (e.g. return an empty array or throw/assertNever) after the switch so the function always returns IPromptPath[].

Suggested change
}
}
return [];

Copilot uses AI. Check for mistakes.
@aeschli aeschli merged commit 4273cad into main Feb 23, 2026
24 checks passed
@aeschli aeschli deleted the aeschli/odd-bass-643 branch February 23, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants