Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix(privacy): remove duplicate manage buttons and tighten overview intro (#11898)

pasitnussoffbb6df4641e
diff --git a/client/src/components/privacy/PrivacyOverviewTab.jsx b/client/src/components/privacy/PrivacyOverviewTab.jsx
index dbbf4dce7b..2b4d286bff 100644
--- a/client/src/components/privacy/PrivacyOverviewTab.jsx
+++ b/client/src/components/privacy/PrivacyOverviewTab.jsx
@@ -54,8 +54,7 @@ export default function PrivacyOverviewTab({ subjectId }) {
return (
<div className="space-y-6">
<p className="text-sm text-gray-500 max-w-2xl">
- The Privacy Center is your system of record for personal identity facts and who holds them.
- Vault values are encrypted at rest and never shown until you explicitly reveal them.
+ Vault values stay hidden until you reveal them.
</p>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
@@ -147,15 +146,6 @@ export default function PrivacyOverviewTab({ subjectId }) {
)}
</div>
</button>
-
- <div className="flex flex-wrap gap-2">
- <button onClick={() => goTo('vault')} className="px-3 py-2 text-sm rounded bg-port-accent text-white hover:bg-port-accent/80">
- Manage vault
- </button>
- <button onClick={() => goTo('organizations')} className="px-3 py-2 text-sm rounded border border-port-border text-gray-300 hover:text-white hover:bg-port-card">
- Manage organizations
- </button>
- </div>
</div>
);
}
diff --git a/client/src/components/privacy/PrivacyOverviewTab.test.jsx b/client/src/components/privacy/PrivacyOverviewTab.test.jsx
new file mode 100644
index 0000000000..cbfa51aa13
--- /dev/null
+++ b/client/src/components/privacy/PrivacyOverviewTab.test.jsx
@@ -0,0 +1,90 @@
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+import { render, screen, fireEvent, waitFor } from '@testing-library/react';
+
+const navigateMock = vi.hoisted(() => vi.fn());
+vi.mock('react-router', async (importOriginal) => {
+ const actual = await importOriginal();
+ return { ...actual, useNavigate: () => navigateMock };
+});
+
+const api = vi.hoisted(() => ({
+ getPrivacyStatus: vi.fn(),
+ getPrivacyOrgs: vi.fn(),
+ getPrivacyScanStatus: vi.fn(),
+}));
+vi.mock('../../services/api', () => api);
+
+import PrivacyOverviewTab from './PrivacyOverviewTab';
+
+describe('PrivacyOverviewTab', () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ api.getPrivacyStatus.mockResolvedValue({
+ keyConfigured: true,
+ recordCounts: { email: 2, address: 1 },
+ });
+ api.getPrivacyOrgs.mockResolvedValue([
+ { id: 'org-1', name: 'Acme Bank', trust: 'trusted' },
+ ]);
+ api.getPrivacyScanStatus.mockResolvedValue({
+ enabledBrokers: 3,
+ caseCounts: { found: 1, confirmed_removed: 1 },
+ });
+ });
+
+ it('renders a single-sentence intro paragraph', async () => {
+ render(<PrivacyOverviewTab />);
+ await waitFor(() => expect(screen.getByText('Vault values stay hidden until you reveal them.')).toBeInTheDocument());
+
+ const intro = screen.getByText('Vault values stay hidden until you reveal them.');
+ expect(screen.queryByText(/system of record/i)).toBeNull();
+ const sentences = intro.textContent.trim().split(/(?<=[.?!])\s+/);
+ expect(sentences.length).toBeLessThanOrEqual(1);
+ });
+
+ it('does not render "Manage vault" or "Manage organizations" buttons', async () => {
+ render(<PrivacyOverviewTab />);
+ await waitFor(() => expect(screen.getByText('Vault records')).toBeInTheDocument());
+
+ expect(screen.queryByRole('button', { name: /manage vault/i })).toBeNull();
+ expect(screen.queryByRole('button', { name: /manage organizations/i })).toBeNull();
+ });
+
+ it('navigates to the vault tab when clicking the Vault records card', async () => {
+ render(<PrivacyOverviewTab />);
+ await waitFor(() => expect(screen.getByText('Vault records')).toBeInTheDocument());
+
+ fireEvent.click(screen.getByRole('button', { name: /Vault records/i }));
+ expect(navigateMock).toHaveBeenCalledWith('/privacy/vault');
+ });
+
+ it('navigates to the organizations tab when clicking the Organizations card', async () => {
+ render(<PrivacyOverviewTab />);
+ await waitFor(() => expect(screen.getByText('Organizations')).toBeInTheDocument());
+
+ fireEvent.click(screen.getByRole('button', { name: /Organizations/i }));
+ expect(navigateMock).toHaveBeenCalledWith('/privacy/organizations');
+ });
+
+ it('navigates to the data brokers tab when clicking the Data brokers card', async () => {
+ render(<PrivacyOverviewTab />);
+ await waitFor(() => expect(screen.getByText('Data brokers')).toBeInTheDocument());
+
+ fireEvent.click(screen.getByRole('button', { name: /Data brokers/i }));
+ expect(navigateMock).toHaveBeenCalledWith('/privacy/brokers');
+ });
+
+ it('preserves subjectId in navigation query param when scoped to household member', async () => {
+ render(<PrivacyOverviewTab subjectId="sub-42" />);
+ await waitFor(() => expect(screen.getByText('Vault records')).toBeInTheDocument());
+
+ fireEvent.click(screen.getByRole('button', { name: /Vault records/i }));
+ expect(navigateMock).toHaveBeenCalledWith('/privacy/vault?subject=sub-42');
+
+ fireEvent.click(screen.getByRole('button', { name: /Organizations/i }));
+ expect(navigateMock).toHaveBeenCalledWith('/privacy/organizations?subject=sub-42');
+
+ fireEvent.click(screen.getByRole('button', { name: /Data brokers/i }));
+ expect(navigateMock).toHaveBeenCalledWith('/privacy/brokers?subject=sub-42');
+ });
+});
diff --git a/client/src/pages/Privacy.test.jsx b/client/src/pages/Privacy.test.jsx
index e2ad80af16..d0214a868e 100644
--- a/client/src/pages/Privacy.test.jsx
+++ b/client/src/pages/Privacy.test.jsx
@@ -159,7 +159,7 @@ describe('Privacy Center', () => {
it('stale :tab param falls back to Overview', async () => {
renderAt('/privacy/bogus');
- await waitFor(() => expect(screen.getByText(/system of record/i)).toBeInTheDocument());
+ await waitFor(() => expect(screen.getByText(/Vault values stay hidden/i)).toBeInTheDocument());
});
// ── Household subjects (#3658) ────────────────────────────────────────────