feat(config): add enable-awesome experiment to show custom ASCII art

- Add ENABLE_AWESOME experiment flag (45758820).
- Update settings schema and regenerate JSON schema.
- Implement config.isAwesomeEnabled() wrapper.
- Add 'matt' ASCII art and update Header component to use it.
- Add unit tests for the new flag.
This commit is contained in:
mkorwel
2026-02-19 21:24:42 -06:00
committed by Matt Korwel
parent 24bbeb11c7
commit 14a7be90d4
8 changed files with 64 additions and 1 deletions
@@ -2217,6 +2217,15 @@ const SETTINGS_SCHEMA = {
'Enable the experimental Topic & Update communication model for reduced chattiness and structured progress reporting.',
showInDialog: true,
},
'enable-awesome': {
type: 'boolean',
label: 'Enable Awesome',
category: 'Experimental',
requiresRestart: false,
default: false,
description: "When enabled, the ASCII art says 'matt'.",
showInDialog: true,
},
},
},
extensions: {
@@ -121,6 +121,7 @@ export const createMockConfig = (overrides: Partial<Config> = {}): Config =>
getCompressionThreshold: vi.fn().mockResolvedValue(undefined),
getUserCaching: vi.fn().mockResolvedValue(false),
isNumericalRoutingEnabled: vi.fn().mockReturnValue(false),
isAwesomeEnabled: vi.fn().mockReturnValue(false),
getClassifierThreshold: vi.fn().mockResolvedValue(undefined),
getBannerTextNoCapacityIssues: vi.fn().mockResolvedValue(''),
getBannerTextCapacityIssues: vi.fn().mockResolvedValue(''),
@@ -57,3 +57,14 @@ export const tinyAsciiLogoCompactText = `
`;
export const mattAsciiLogo = `
`;
+10 -1
View File
@@ -7,10 +7,16 @@
import type React from 'react';
import { Box } from 'ink';
import { ThemedGradient } from './ThemedGradient.js';
import { shortAsciiLogo, longAsciiLogo, tinyAsciiLogo } from './AsciiArt.js';
import {
shortAsciiLogo,
longAsciiLogo,
tinyAsciiLogo,
mattAsciiLogo,
} from './AsciiArt.js';
import { getAsciiArtWidth } from '../utils/textUtils.js';
import { useTerminalSize } from '../hooks/useTerminalSize.js';
import { useSnowfall } from '../hooks/useSnowfall.js';
import { useConfig } from '../contexts/ConfigContext.js';
interface HeaderProps {
customAsciiArt?: string; // For user-defined ASCII art
@@ -23,6 +29,7 @@ export const Header: React.FC<HeaderProps> = ({
version,
nightly,
}) => {
const config = useConfig();
const { columns: terminalWidth } = useTerminalSize();
let displayTitle;
const widthOfLongLogo = getAsciiArtWidth(longAsciiLogo);
@@ -30,6 +37,8 @@ export const Header: React.FC<HeaderProps> = ({
if (customAsciiArt) {
displayTitle = customAsciiArt;
} else if (config.isAwesomeEnabled()) {
displayTitle = mattAsciiLogo;
} else if (terminalWidth >= widthOfLongLogo) {
displayTitle = longAsciiLogo;
} else if (terminalWidth >= widthOfShortLogo) {