Skip to content

Commit fd90b30

Browse files
atepemclaude
andcommitted
feat(connect-ui): [VLOP-114] remove Restricted/Unrestricted mode from agent UI
- Delete the TransactionMode section (radio cards + "Unrestricted mode is on" banner) and PasswordModal, whose only consumer it was - Whitelisted addresses section now always renders (restricted is the server-side default; the UI no longer offers a way to change it) - Drop mode-only styling tokens from theme.ts - Keep protected/mode in types.ts and the password-gated path in useUpdateSettings: the API mirror is unchanged, no component sends a mode patch anymore Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent 63e89a2 commit fd90b30

6 files changed

Lines changed: 6 additions & 520 deletions

File tree

apps/connect-ui/__tests__/App.spec.tsx

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,14 @@ import { render, screen, waitFor } from '@testing-library/react';
44
import App from '../src/App';
55
import { ConnectSettings } from '../src/types';
66

7-
const restrictedSettings: ConnectSettings = {
7+
const settings: ConnectSettings = {
88
protected: {
99
mode: 'restricted',
1010
whitelist: { gnosis: ['0x735faab1c4ec41128c367afb5c3bac73509f70bb'] },
1111
},
1212
harness: 'claude_code_desktop',
1313
};
1414

15-
const unrestrictedSettings: ConnectSettings = {
16-
...restrictedSettings,
17-
protected: { ...restrictedSettings.protected, mode: 'unrestricted' },
18-
};
19-
2015
const renderApp = () => {
2116
const queryClient = new QueryClient({
2217
defaultOptions: { queries: { retry: false }, mutations: { retry: false } },
@@ -46,32 +41,20 @@ describe('App', () => {
4641
expect(container.querySelector('.ant-spin')).toBeInTheDocument();
4742
});
4843

49-
it('renders all sections including the whitelist in restricted mode', async () => {
44+
it('renders all sections once settings load', async () => {
5045
(global.fetch as jest.Mock).mockResolvedValue({
5146
ok: true,
52-
json: () => Promise.resolve(restrictedSettings),
47+
json: () => Promise.resolve(settings),
5348
});
5449

5550
renderApp();
5651

5752
await waitFor(() => expect(screen.getByText('Get started with Connect')).toBeInTheDocument());
5853
expect(screen.getByText('Coding tool')).toBeInTheDocument();
59-
expect(screen.getByText('Transaction mode')).toBeInTheDocument();
6054
expect(screen.getByText('Whitelisted addresses')).toBeInTheDocument();
6155
// Whitelist entries are deliberately not listed.
6256
expect(screen.queryByText('0x735f...70bb')).not.toBeInTheDocument();
63-
expect(screen.queryByText('Unrestricted mode is on')).not.toBeInTheDocument();
64-
});
65-
66-
it('hides the whitelist and shows the banner in unrestricted mode', async () => {
67-
(global.fetch as jest.Mock).mockResolvedValue({
68-
ok: true,
69-
json: () => Promise.resolve(unrestrictedSettings),
70-
});
71-
72-
renderApp();
73-
74-
await waitFor(() => expect(screen.getByText('Unrestricted mode is on')).toBeInTheDocument());
75-
expect(screen.queryByText('Whitelisted addresses')).not.toBeInTheDocument();
57+
// The Restricted/Unrestricted mode section was removed from the agent UI.
58+
expect(screen.queryByText('Transaction mode')).not.toBeInTheDocument();
7659
});
7760
});

apps/connect-ui/__tests__/components/TransactionMode.spec.tsx

Lines changed: 0 additions & 142 deletions
This file was deleted.

apps/connect-ui/src/App.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import styled from 'styled-components';
55

66
import { CodingTool } from './components/CodingTool/CodingTool';
77
import { GetStarted } from './components/GetStarted/GetStarted';
8-
import { TransactionMode } from './components/TransactionMode/TransactionMode';
98
import { WhitelistedAddresses } from './components/WhitelistedAddresses/WhitelistedAddresses';
109
import { COLOR } from './constants/theme';
1110
import { useSettings } from './hooks/useSettings';
@@ -35,13 +34,7 @@ const Profile = () => {
3534
<Divider style={{ margin: 0 }} />
3635
<CodingTool settings={data} />
3736
<Divider style={{ margin: 0 }} />
38-
<TransactionMode settings={data} />
39-
{data.protected.mode === 'restricted' && (
40-
<>
41-
<Divider style={{ margin: 0 }} />
42-
<WhitelistedAddresses />
43-
</>
44-
)}
37+
<WhitelistedAddresses />
4538
</>
4639
);
4740
};

apps/connect-ui/src/components/PasswordModal/PasswordModal.tsx

Lines changed: 0 additions & 167 deletions
This file was deleted.

0 commit comments

Comments
 (0)