This commit is contained in:
Fahleen Arif 2026-04-04 23:37:11 +00:00 committed by GitHub
commit bec2280de3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 68 additions and 7 deletions

View file

@ -143,13 +143,15 @@ export default function useSideNavLinks({
});
}
links.push({
title: 'com_sidepanel_attach_files',
label: '',
icon: AttachmentIcon,
id: 'files',
Component: FilesPanel,
});
if (interfaceConfig.attachFiles !== false) {
links.push({
title: 'com_sidepanel_attach_files',
label: '',
icon: AttachmentIcon,
id: 'files',
Component: FilesPanel,
});
}
if (hasAccessToBookmarks) {
links.push({
@ -195,6 +197,7 @@ export default function useSideNavLinks({
hasAccessToMemories,
hasAccessToReadMemories,
interfaceConfig.parameters,
interfaceConfig.attachFiles,
endpointType,
hasAccessToBookmarks,
availableMCPServers,

View file

@ -83,6 +83,10 @@ interface:
modelSelect: true
parameters: true
presets: true
# Enable/disable the Attach Files sidebar panel (default: true)
# When set to false, hides the sidebar's file management panel
# but users can still upload files directly in chats
attachFiles: true
prompts:
use: true
create: true

View file

@ -154,4 +154,55 @@ describe('AppService interface configuration', () => {
// Verify that peoplePicker is undefined when not provided
expect(result.interfaceConfig?.peoplePicker).toBeUndefined();
});
it('should set attachFiles to true when config specifies attachFiles as true', async () => {
const config = {
interface: {
attachFiles: true,
},
};
const result = await AppService({ config });
expect(result).toEqual(
expect.objectContaining({
interfaceConfig: expect.objectContaining({
attachFiles: true,
}),
}),
);
});
it('should set attachFiles to false when config specifies attachFiles as false', async () => {
const config = {
interface: {
attachFiles: false,
},
};
const result = await AppService({ config });
expect(result).toEqual(
expect.objectContaining({
interfaceConfig: expect.objectContaining({
attachFiles: false,
}),
}),
);
});
it('should not set attachFiles when not provided in config', async () => {
const config = {};
const result = await AppService({ config });
expect(result).toEqual(
expect.objectContaining({
interfaceConfig: expect.anything(),
}),
);
// Verify that attachFiles is undefined when not provided
expect(result.interfaceConfig?.attachFiles).toBeUndefined();
});
});

View file

@ -696,6 +696,7 @@ export const interfaceSchema = z
bookmarks: z.boolean().optional(),
memories: z.boolean().optional(),
presets: z.boolean().optional(),
attachFiles: z.boolean().optional(),
prompts: z
.union([
z.boolean(),
@ -752,6 +753,7 @@ export const interfaceSchema = z
multiConvo: true,
bookmarks: true,
memories: true,
attachFiles: true,
prompts: {
use: true,
create: true,

View file

@ -40,6 +40,7 @@ export async function loadDefaultInterface({
customWelcome: interfaceConfig?.customWelcome ?? defaults.customWelcome,
// Permissions - only include if explicitly configured
attachFiles: interfaceConfig?.attachFiles,
bookmarks: interfaceConfig?.bookmarks,
memories: shouldDisableMemories ? false : interfaceConfig?.memories,
prompts: interfaceConfig?.prompts,