feat(ui): add `hideFooter` setting to hide footer from UI (#6505)
This commit is contained in:
parent
b9cece767d
commit
fb5f2987f3
|
@ -86,6 +86,15 @@ export const SETTINGS_SCHEMA = {
|
||||||
description: 'Hide the application banner',
|
description: 'Hide the application banner',
|
||||||
showInDialog: true,
|
showInDialog: true,
|
||||||
},
|
},
|
||||||
|
hideFooter: {
|
||||||
|
type: 'boolean',
|
||||||
|
label: 'Hide Footer',
|
||||||
|
category: 'UI',
|
||||||
|
requiresRestart: false,
|
||||||
|
default: false,
|
||||||
|
description: 'Hide the footer from the UI',
|
||||||
|
showInDialog: true,
|
||||||
|
},
|
||||||
showMemoryUsage: {
|
showMemoryUsage: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
label: 'Show Memory Usage',
|
label: 'Show Memory Usage',
|
||||||
|
|
|
@ -864,6 +864,58 @@ describe('App UI', () => {
|
||||||
expect(vi.mocked(Header)).not.toHaveBeenCalled();
|
expect(vi.mocked(Header)).not.toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should display Footer component by default', async () => {
|
||||||
|
const { lastFrame, unmount } = renderWithProviders(
|
||||||
|
<App
|
||||||
|
config={mockConfig as unknown as ServerConfig}
|
||||||
|
settings={mockSettings}
|
||||||
|
version={mockVersion}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
currentUnmount = unmount;
|
||||||
|
await Promise.resolve();
|
||||||
|
// Footer should render - look for target directory which is always shown
|
||||||
|
expect(lastFrame()).toContain('/test/dir');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should not display Footer component when hideFooter is true', async () => {
|
||||||
|
mockSettings = createMockSettings({
|
||||||
|
user: { hideFooter: true },
|
||||||
|
});
|
||||||
|
|
||||||
|
const { lastFrame, unmount } = renderWithProviders(
|
||||||
|
<App
|
||||||
|
config={mockConfig as unknown as ServerConfig}
|
||||||
|
settings={mockSettings}
|
||||||
|
version={mockVersion}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
currentUnmount = unmount;
|
||||||
|
await Promise.resolve();
|
||||||
|
// Footer should not render - target directory should not appear
|
||||||
|
expect(lastFrame()).not.toContain('/test/dir');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should show footer if system says show, but workspace and user settings say hide', async () => {
|
||||||
|
mockSettings = createMockSettings({
|
||||||
|
system: { hideFooter: false },
|
||||||
|
user: { hideFooter: true },
|
||||||
|
workspace: { hideFooter: true },
|
||||||
|
});
|
||||||
|
|
||||||
|
const { lastFrame, unmount } = renderWithProviders(
|
||||||
|
<App
|
||||||
|
config={mockConfig as unknown as ServerConfig}
|
||||||
|
settings={mockSettings}
|
||||||
|
version={mockVersion}
|
||||||
|
/>,
|
||||||
|
);
|
||||||
|
currentUnmount = unmount;
|
||||||
|
await Promise.resolve();
|
||||||
|
// Footer should render because system overrides - look for target directory
|
||||||
|
expect(lastFrame()).toContain('/test/dir');
|
||||||
|
});
|
||||||
|
|
||||||
it('should show tips if system says show, but workspace and user settings say hide', async () => {
|
it('should show tips if system says show, but workspace and user settings say hide', async () => {
|
||||||
mockSettings = createMockSettings({
|
mockSettings = createMockSettings({
|
||||||
system: { hideTips: false },
|
system: { hideTips: false },
|
||||||
|
|
|
@ -1249,23 +1249,27 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
<Footer
|
{!settings.merged.hideFooter && (
|
||||||
model={currentModel}
|
<Footer
|
||||||
targetDir={config.getTargetDir()}
|
model={currentModel}
|
||||||
debugMode={config.getDebugMode()}
|
targetDir={config.getTargetDir()}
|
||||||
branchName={branchName}
|
debugMode={config.getDebugMode()}
|
||||||
debugMessage={debugMessage}
|
branchName={branchName}
|
||||||
corgiMode={corgiMode}
|
debugMessage={debugMessage}
|
||||||
errorCount={errorCount}
|
corgiMode={corgiMode}
|
||||||
showErrorDetails={showErrorDetails}
|
errorCount={errorCount}
|
||||||
showMemoryUsage={
|
showErrorDetails={showErrorDetails}
|
||||||
config.getDebugMode() || settings.merged.showMemoryUsage || false
|
showMemoryUsage={
|
||||||
}
|
config.getDebugMode() ||
|
||||||
promptTokenCount={sessionStats.lastPromptTokenCount}
|
settings.merged.showMemoryUsage ||
|
||||||
nightly={nightly}
|
false
|
||||||
vimMode={vimModeEnabled ? vimMode : undefined}
|
}
|
||||||
isTrustedFolder={isTrustedFolderState}
|
promptTokenCount={sessionStats.lastPromptTokenCount}
|
||||||
/>
|
nightly={nightly}
|
||||||
|
vimMode={vimModeEnabled ? vimMode : undefined}
|
||||||
|
isTrustedFolder={isTrustedFolderState}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
</StreamingContext.Provider>
|
</StreamingContext.Provider>
|
||||||
|
|
Loading…
Reference in New Issue