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: raise NotesTab header controls to the 44px touch-target minimum (#3528)

[._.]/ Adam Eivyfd5854da5dbb
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 421d9bdd2e..149a215454 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -142,3 +142,5 @@
- **[issue-3530] Deleting a Digital Twin document no longer leaves it to be resurrected by your other machines.** Peer sync merged the identity documents add-only: whichever machine still had the file put its metadata entry back into `meta.json` and re-wrote the `.md` on disk, so a document you deleted came back on the next sync cycle, every cycle, forever. A delete now records a tombstone on the document's filename, and those tombstones union in both directions — so the machine that still holds the document drops its entry and removes the file, instead of the deleting machine merely defending itself while the peer keeps re-sending. Filename is the key rather than the document id because ids are minted per install and the same document can carry a different one on each machine. Deleting is not permanent in the way a naive tombstone would make it: a document created — or edited — after the delete records a stamp that supersedes the tombstone, which is then dropped, so re-creating a document you removed (by hand, or by an enrichment session regenerating its target) works and survives a peer that has not seen the re-create yet, and an edit you made on one machine is not silently destroyed by a delete another machine performed before that edit. Those two stamps are the one part of a document's entry that is not add-only — each machine takes the newer of its own and its peer's — so a machine holding a stale copy cannot keep a third machine's older delete alive against a document that has since come back. A peer running an older build simply ignores the new field and keeps offering its copy; the upgraded machine still refuses it, so nothing is corrupted while the two versions differ.
- **[issue-3527] The Brain Trust Panel no longer scrolls sideways on a phone.** Its header put the title block and the five audit counters — Total, Filed, Review, Corrected, Errors — on one row that was not allowed to wrap, so on a 375px screen the counters ran off the right edge and dragged the whole page's horizontal scrollbar with them. The title and the counters now stack under `sm` and re-join from `sm` up, the counters wrap among themselves, and the status-filter row wraps too so its Refresh button cannot spill off screen either. Every counter stays visible without scrolling; the desktop layout is unchanged.
+
+- **[issue-3528] The Notes header controls in Brain are now big enough to hit on a phone.** The "Manage vaults" and "New note" buttons wrapped 14px icons in nothing but `p-1.5`, giving them roughly 26x26px of tappable area right next to the vault dropdown — close enough that a thumb aiming for "New note" would land on the dropdown instead. Those two buttons, plus the vault selector, the search box, and the create-note row beside them, now all clear the 44px touch-target floor the rest of the app uses. The search box also gained enough right padding to clear its own clear-search button, which was already 44px wide and had been sitting on top of whatever you typed.
diff --git a/client/src/components/brain/tabs/NotesTab.jsx b/client/src/components/brain/tabs/NotesTab.jsx
index 8dd9fcc31a..3b0c5286ea 100644
--- a/client/src/components/brain/tabs/NotesTab.jsx
+++ b/client/src/components/brain/tabs/NotesTab.jsx
@@ -266,7 +266,7 @@ export default function NotesTab() {
setSearchResults(null);
setFolderFilter('');
}}
- className="flex-1 bg-port-bg border border-port-border rounded px-2 py-1.5 text-sm text-white"
+ className="flex-1 min-w-0 min-h-[44px] bg-port-bg border border-port-border rounded px-2 py-1.5 text-sm text-white"
>
{vaults.map(v => (
<option key={v.id} value={v.id}>{v.name}</option>
@@ -274,14 +274,14 @@ export default function NotesTab() {
</select>
<button
onClick={() => setShowVaultSetup(true)}
- className="p-1.5 rounded hover:bg-port-card text-gray-400 hover:text-white"
+ className="p-1.5 rounded hover:bg-port-card text-gray-400 hover:text-white min-h-[44px] min-w-[44px] flex items-center justify-center shrink-0"
title="Manage vaults" aria-label="Manage vaults"
>
<Settings size={14} />
</button>
<button
onClick={() => { setShowCreateForm(true); setNewNotePath(''); }}
- className="p-1.5 rounded hover:bg-port-card text-gray-400 hover:text-port-accent"
+ className="p-1.5 rounded hover:bg-port-card text-gray-400 hover:text-port-accent min-h-[44px] min-w-[44px] flex items-center justify-center shrink-0"
title="New note" aria-label="New note"
>
<Plus size={14} />
@@ -297,7 +297,7 @@ export default function NotesTab() {
onChange={e => setSearchQuery(e.target.value)}
onKeyDown={e => e.key === 'Enter' && handleSearch()}
placeholder="Search notes..."
- className="w-full bg-port-bg border border-port-border rounded pl-7 pr-7 py-1.5 text-sm text-white placeholder-gray-500"
+ className="w-full min-h-[44px] bg-port-bg border border-port-border rounded pl-7 pr-14 py-1.5 text-sm text-white placeholder-gray-500"
/>
{searchQuery && (
<button
@@ -318,20 +318,20 @@ export default function NotesTab() {
onChange={e => setNewNotePath(e.target.value)}
onKeyDown={e => e.key === 'Enter' && handleCreateNote()}
placeholder="folder/note-name"
- className="flex-1 bg-port-bg border border-port-border rounded px-2 py-1 text-sm text-white placeholder-gray-500"
+ className="flex-1 min-w-0 min-h-[44px] bg-port-bg border border-port-border rounded px-2 py-1 text-sm text-white placeholder-gray-500"
autoFocus
/>
<button
onClick={handleCreateNote}
disabled={creating || !newNotePath.trim()}
- className="px-2 py-1 rounded bg-port-accent text-white text-xs disabled:opacity-50"
+ className="px-3 min-h-[44px] shrink-0 rounded bg-port-accent text-white text-xs disabled:opacity-50"
>
{creating ? '...' : 'Create'}
</button>
<button
onClick={() => setShowCreateForm(false)}
aria-label="Close"
- className="p-1 rounded hover:bg-port-card text-gray-400 min-h-[44px] min-w-[44px] flex items-center justify-center"
+ className="p-1 rounded hover:bg-port-card text-gray-400 min-h-[44px] min-w-[44px] shrink-0 flex items-center justify-center"
>
<X size={14} />
</button>
diff --git a/client/src/components/brain/tabs/NotesTab.test.jsx b/client/src/components/brain/tabs/NotesTab.test.jsx
new file mode 100644
index 0000000000..490db4af63
--- /dev/null
+++ b/client/src/components/brain/tabs/NotesTab.test.jsx
@@ -0,0 +1,110 @@
+import { describe, it, expect, vi, beforeEach } from 'vitest';
+import { render, screen, fireEvent, act } from '@testing-library/react';
+
+// ── Mock toast ────────────────────────────────────────────────────────────────
+const mockToast = vi.hoisted(() => Object.assign(vi.fn(), { success: vi.fn(), error: vi.fn() }));
+vi.mock('../../ui/Toast', () => ({ default: mockToast }));
+
+// ── Mock API ──────────────────────────────────────────────────────────────────
+const api = vi.hoisted(() => ({
+ getNotesVaults: vi.fn(),
+ detectNotesVaults: vi.fn(),
+ scanNotesVault: vi.fn(),
+ getNotesVaultFolders: vi.fn(),
+ getNotesVaultTags: vi.fn(),
+ addNotesVault: vi.fn(),
+ getNote: vi.fn(),
+ updateNote: vi.fn(),
+ createNote: vi.fn(),
+ deleteNote: vi.fn(),
+ searchNotes: vi.fn(),
+}));
+vi.mock('../../../services/api', () => api);
+
+const NotesTab = (await import('./NotesTab')).default;
+
+// Tailwind `min-h-`/`min-w-`/`h-`/`w-` token → px, for both the arbitrary value
+// (`min-h-[44px]`) and the spacing scale (`h-11` = 11 * 4px = 44px). Mirrors
+// `tokenPx` in src/a11yConventions.test.js.
+const tokenPx = token => {
+ const arb = token.match(/^(?:min-)?[hw]-\[(\d+(?:\.\d+)?)px\]$/);
+ if (arb) return parseFloat(arb[1]);
+ const scale = token.match(/^(?:min-)?[hw]-(\d+(?:\.5)?)$/);
+ if (scale) return parseFloat(scale[1]) * 4;
+ return null;
+};
+
+const axisPx = (className, axis) => {
+ let px = 0;
+ for (const token of String(className).split(/\s+/)) {
+ if (!new RegExp(`^(?:min-)?${axis}-`).test(token)) continue;
+ const value = tokenPx(token);
+ if (value !== null && value > px) px = value;
+ }
+ return px;
+};
+
+const expectTouchTarget = (el, { width = true } = {}) => {
+ expect(axisPx(el.className, 'h'), `height floor on: ${el.className}`).toBeGreaterThanOrEqual(44);
+ if (width) {
+ expect(axisPx(el.className, 'w'), `width floor on: ${el.className}`).toBeGreaterThanOrEqual(44);
+ }
+};
+
+const renderTab = async () => {
+ await act(async () => { render(<NotesTab />); });
+};
+
+describe('NotesTab header touch targets', () => {
+ beforeEach(() => {
+ vi.clearAllMocks();
+ api.getNotesVaults.mockResolvedValue([{ id: 'vault-1', name: 'Example Vault', path: '/example/vault' }]);
+ api.detectNotesVaults.mockResolvedValue([]);
+ api.scanNotesVault.mockResolvedValue({ notes: [], total: 0 });
+ api.getNotesVaultFolders.mockResolvedValue({ folders: [] });
+ api.getNotesVaultTags.mockResolvedValue({ tags: [] });
+ });
+
+ it('sizes the "Manage vaults" and "New note" buttons to the 44px minimum', async () => {
+ await renderTab();
+
+ // Icon-only header actions: both axes must clear the floor, since a bare
+ // `p-1.5` wrapper around a 14px icon is only ~26x26.
+ expectTouchTarget(screen.getByRole('button', { name: 'Manage vaults' }));
+ expectTouchTarget(screen.getByRole('button', { name: 'New note' }));
+ });
+
+ it('sizes the vault select and search input to the 44px minimum', async () => {
+ await renderTab();
+
+ // Full-width/flex-1 controls only need the height floor — their width is
+ // driven by the row, not a min-w token.
+ expectTouchTarget(screen.getByRole('combobox'), { width: false });
+ expectTouchTarget(screen.getByPlaceholderText('Search notes...'), { width: false });
+ });
+
+ it('sizes the create-note form controls to the 44px minimum', async () => {
+ await renderTab();
+
+ fireEvent.click(screen.getByRole('button', { name: 'New note' }));
+
+ expectTouchTarget(screen.getByPlaceholderText('folder/note-name'), { width: false });
+ expectTouchTarget(screen.getByRole('button', { name: 'Create' }), { width: false });
+ expectTouchTarget(screen.getByRole('button', { name: 'Close' }));
+ });
+
+ it('pads the search input past the clear button so the query is not obscured', async () => {
+ await renderTab();
+
+ const input = screen.getByPlaceholderText('Search notes...');
+ fireEvent.change(input, { target: { value: 'meeting' } });
+
+ const clear = screen.getByRole('button', { name: 'Close' });
+ // The clear button is absolutely positioned at `right-2` (8px) and is 44px
+ // wide, so the input needs >= 52px of right padding or the typed text runs
+ // underneath it.
+ const rightOffset = (clear.className.match(/(?:^|\s)right-(\d+)(?:\s|$)/) || [, '0'])[1] * 4;
+ const padRight = (input.className.match(/(?:^|\s)pr-(\d+)(?:\s|$)/) || [, '0'])[1] * 4;
+ expect(padRight).toBeGreaterThanOrEqual(rightOffset + axisPx(clear.className, 'w'));
+ });
+});