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 Brain bucket edit/delete taps to 44px so a mis-tap can't delete the bucket (#3525)

[._.]/ Adam Eivy8a907cacf749
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 4c4d110b1c..a58afeba6f 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -104,6 +104,7 @@
- **[issue-3524] Brain's RSS feeds were unreadable on a phone — the feed picker and the article list were jammed side by side in two narrow strips.** The Feeds tab lays its desktop sidebar and its item list out as a flex row, and the row direction was unconditional: below `md` the sidebar hides and a `<select>` feed picker takes its place, but that picker and the item list were still being laid out as columns next to each other, squeezing article titles into a sliver and pushing the page wider than the viewport. The container now stacks vertically by default and only becomes a row from `md` up, so the picker sits above a full-width list on a phone while desktop keeps the sidebar beside the list exactly as before. The picker also stops carrying its own bottom margin — that margin did nothing in a row and would have doubled up with the container's gap once stacked — and no longer shrinks when a long list of items competes for the same vertical space.
- **[issue-3517] A failed "Schedule Time Blocks" left the goal's scheduling buttons stuck on "Scheduling..." until you reloaded the page.** Scheduling, rescheduling, and removing a goal's time blocks each raised a shared busy flag before their request and lowered it afterwards, but nothing caught a rejection — so a server error or a dropped connection aborted the handler before the flag came back down, and all three buttons stayed disabled with no way to retry short of reloading. The three now share one runner that always clears the flag, and the panel refreshes afterwards whether or not the request succeeded, because a scheduling run can write some blocks before it fails and leaving that half-written state off screen is the more confusing outcome. The failure itself still surfaces exactly once, from the shared request helper, rather than picking up a second toast of its own.
+- **[issue-3525] Tapping "edit bucket" on a phone in Bookmarks often deleted the bucket instead.** The edit and delete icons in a bucket's header were 13px glyphs with 4px of padding — roughly 17px of tappable area each, sitting right next to each other — so on a narrow screen a thumb aimed at edit landed on delete and opened its confirmation instead. Both now use the standard 44px minimum tap target with the icon centered inside it, which is what the rest of PortOS uses for icon-only buttons, and the header's own vertical padding drops to compensate so the taller buttons don't inflate the card. The bucket's "add a URL" submit button had the same problem and gets the same treatment.
## Three.js Models
diff --git a/client/src/components/brain/links/BucketCard.jsx b/client/src/components/brain/links/BucketCard.jsx
index d9e8345e28..c20f6f611a 100644
--- a/client/src/components/brain/links/BucketCard.jsx
+++ b/client/src/components/brain/links/BucketCard.jsx
@@ -169,8 +169,10 @@ export default function BucketCard({
</div>
</div>
) : (
+ // py-1 rather than py-2: the 44px action buttons now set the row height,
+ // so the larger tap targets don't also inflate the header.
<div
- className={`flex items-center gap-2 px-3 py-2 border-b cursor-grab ${colors.header}`}
+ className={`flex items-center gap-2 px-3 py-1 border-b cursor-grab ${colors.header}`}
draggable
onDragStart={(e) => {
e.dataTransfer.setData(BUCKET_DND_TYPE, bucket.id);
@@ -183,17 +185,17 @@ export default function BucketCard({
<span className="text-xs text-gray-500">{links.length}</span>
<button
onClick={startEdit}
- className="p-1 text-gray-400 hover:text-white transition-colors"
+ className="shrink-0 flex items-center justify-center min-h-[44px] min-w-[44px] rounded text-gray-400 hover:text-white transition-colors"
title="Edit bucket" aria-label="Edit bucket"
>
- <Edit2 size={13} />
+ <Edit2 size={14} />
</button>
<button
onClick={() => setConfirmDelete(true)}
- className="p-1 text-gray-400 hover:text-port-error transition-colors"
+ className="shrink-0 flex items-center justify-center min-h-[44px] min-w-[44px] rounded text-gray-400 hover:text-port-error transition-colors"
title="Delete bucket" aria-label="Delete bucket"
>
- <Trash2 size={13} />
+ <Trash2 size={14} />
</button>
</div>
)}
@@ -246,7 +248,7 @@ export default function BucketCard({
<button
type="submit"
disabled={adding || !addUrl.trim()}
- className="shrink-0 px-2 py-1 bg-port-accent/80 hover:bg-port-accent text-white rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed"
+ className="shrink-0 flex items-center justify-center min-h-[44px] min-w-[44px] bg-port-accent/80 hover:bg-port-accent text-white rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed"
title="Add link to bucket" aria-label="Add link to bucket"
>
{adding ? <BrailleSpinner /> : <Plus size={14} />}
diff --git a/client/src/components/brain/links/BucketCard.test.jsx b/client/src/components/brain/links/BucketCard.test.jsx
new file mode 100644
index 0000000000..98ff671772
--- /dev/null
+++ b/client/src/components/brain/links/BucketCard.test.jsx
@@ -0,0 +1,55 @@
+import { describe, it, expect, vi } from 'vitest';
+import { render, screen, fireEvent } from '@testing-library/react';
+
+import BucketCard from './BucketCard';
+
+const bucket = { id: 'b1', name: 'Bookmarks', color: 'purple', icon: '', order: 0 };
+const links = [{ id: 'l1', url: 'https://example.com', title: 'Example', bucketId: 'b1', bucketOrder: 0 }];
+
+const renderCard = (props = {}) => render(
+ <BucketCard
+ bucket={bucket}
+ links={links}
+ onUpdate={vi.fn()}
+ onDelete={vi.fn()}
+ onAddLink={vi.fn()}
+ onRemoveLink={vi.fn()}
+ {...props}
+ />
+);
+
+// A tap target smaller than ~44px is unreliable on a phone, and here Edit sits
+// directly beside the destructive Delete — a mis-tap opens a delete confirm.
+const expectTouchTarget = (el) => {
+ expect(el.className).toContain('min-h-[44px]');
+ expect(el.className).toContain('min-w-[44px]');
+ expect(el.className).toContain('items-center');
+ expect(el.className).toContain('justify-center');
+};
+
+describe('BucketCard', () => {
+ it('gives the header edit and delete actions 44px touch targets', () => {
+ renderCard();
+ expectTouchTarget(screen.getByLabelText('Edit bucket'));
+ expectTouchTarget(screen.getByLabelText('Delete bucket'));
+ });
+
+ it('gives the add-link submit a 44px touch target', () => {
+ renderCard();
+ expectTouchTarget(screen.getByLabelText('Add link to bucket'));
+ });
+
+ it('opens the inline edit form from the edit action', () => {
+ renderCard();
+ fireEvent.click(screen.getByLabelText('Edit bucket'));
+ expect(screen.getByLabelText('Bucket name').value).toBe('Bookmarks');
+ });
+
+ it('asks for confirmation before deleting instead of deleting on the first tap', () => {
+ const onDelete = vi.fn();
+ renderCard({ onDelete });
+ fireEvent.click(screen.getByLabelText('Delete bucket'));
+ expect(onDelete).not.toHaveBeenCalled();
+ expect(screen.getByText(/Delete bucket\?/)).toBeTruthy();
+ });
+});