Add privacy notice slash command (#2059)

This commit is contained in:
Tommaso Sciortino
2025-06-27 12:07:38 -07:00
committed by GitHub
parent 4fbffdf617
commit a2a46c7c67
13 changed files with 468 additions and 15 deletions

View File

@@ -71,6 +71,7 @@ import { checkForUpdates } from './utils/updateCheck.js';
import ansiEscapes from 'ansi-escapes';
import { OverflowProvider } from './contexts/OverflowContext.js';
import { ShowMoreLines } from './components/ShowMoreLines.js';
import { PrivacyNotice } from './privacy/PrivacyNotice.js';
const CTRL_EXIT_PROMPT_DURATION_MS = 1000;
@@ -130,6 +131,11 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
const [ctrlDPressedOnce, setCtrlDPressedOnce] = useState(false);
const ctrlDTimerRef = useRef<NodeJS.Timeout | null>(null);
const [constrainHeight, setConstrainHeight] = useState<boolean>(true);
const [showPrivacyNotice, setShowPrivacyNotice] = useState<boolean>(false);
const openPrivacyNotice = useCallback(() => {
setShowPrivacyNotice(true);
}, []);
const errorCount = useMemo(
() => consoleMessages.filter((msg) => msg.type === 'error').length,
@@ -277,6 +283,7 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
toggleCorgiMode,
showToolDescriptions,
setQuittingMessages,
openPrivacyNotice,
);
const pendingHistoryItems = [...pendingSlashCommandHistoryItems];
@@ -712,6 +719,11 @@ const App = ({ config, settings, startupWarnings = [] }: AppProps) => {
onExit={exitEditorDialog}
/>
</Box>
) : showPrivacyNotice ? (
<PrivacyNotice
onExit={() => setShowPrivacyNotice(false)}
config={config}
/>
) : (
<>
<LoadingIndicator