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: gate compact notification actions by pointer capability (#9899)

Adam Eivyfe4cfcc93057
diff --git a/client/src/components/NotificationDropdown.jsx b/client/src/components/NotificationDropdown.jsx
index 139efb2826..1ba90c5cd3 100644
--- a/client/src/components/NotificationDropdown.jsx
+++ b/client/src/components/NotificationDropdown.jsx
@@ -272,7 +272,7 @@ export default function NotificationDropdown({
<button
type="button"
onClick={() => onRemove(notification.id)}
- className="inline-flex shrink-0 items-center justify-center min-w-[44px] min-h-[44px] -my-2 rounded hover:bg-port-border transition-colors [@media(hover:hover)]:sm:min-w-0 [@media(hover:hover)]:sm:min-h-0 [@media(hover:hover)]:sm:my-0 [@media(hover:hover)]:sm:p-1 [@media(hover:hover)]:sm:opacity-0 [@media(hover:hover)]:sm:group-hover:opacity-100 group-focus-within:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-port-accent"
+ className="inline-flex shrink-0 items-center justify-center min-w-[44px] min-h-[44px] -my-2 rounded hover:bg-port-border transition-colors group-focus-within:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-port-accent notification-action"
aria-label={`Remove notification: ${notification.title}`}
>
<X className="w-4 h-4 text-gray-500 sm:w-3 sm:h-3" aria-hidden="true" />
@@ -281,7 +281,7 @@ export default function NotificationDropdown({
<button
type="button"
onClick={() => onMarkAsRead(notification.id)}
- className="min-h-[44px] text-[10px] text-port-accent hover:underline -my-2 [@media(hover:hover)]:sm:min-h-0 [@media(hover:hover)]:sm:my-0"
+ className="min-h-[44px] text-[10px] text-port-accent hover:underline -my-2 notification-mark-read"
aria-label={`Mark notification as read: ${notification.title}`}
>
Mark read
diff --git a/client/src/components/NotificationDropdown.test.jsx b/client/src/components/NotificationDropdown.test.jsx
index 368fccac89..cdb1fc5e65 100644
--- a/client/src/components/NotificationDropdown.test.jsx
+++ b/client/src/components/NotificationDropdown.test.jsx
@@ -1,4 +1,5 @@
import { useState } from 'react';
+import { readFileSync } from 'node:fs';
import { describe, it, expect, vi } from 'vitest';
import { render, screen, fireEvent } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
@@ -260,15 +261,19 @@ describe('NotificationDropdown', () => {
expect(remove.className).toContain('min-w-[44px]');
expect(remove.className).toContain('min-h-[44px]');
expect(remove.className).toContain('shrink-0');
- // Compact reveal is gated by actual hover capability, not viewport width.
- expect(remove.className).toContain('[@media(hover:hover)]:sm:opacity-0');
- expect(remove.className).toContain('[@media(hover:hover)]:sm:group-hover:opacity-100');
+ // Compact sizing and reveal require both hover and a fine primary pointer.
+ expect(remove.className).toContain('notification-action');
expect(remove.className).toContain('group-focus-within:opacity-100');
expect(remove.className).not.toMatch(/(^|\s)sm:opacity-/);
const markRead = screen.getByRole('button', { name: 'Mark notification as read: Notification 0' });
expect(markRead.className).toContain('min-h-[44px]');
- expect(markRead.className).toContain('[@media(hover:hover)]:sm:min-h-0');
+ expect(markRead.className).toContain('notification-mark-read');
+
+ const styles = readFileSync('src/index.css', 'utf8');
+ expect(styles).toMatch(/@media \(hover: hover\) and \(pointer: fine\) and \(min-width: 640px\)/);
+ expect(styles).toContain('.group:hover .notification-action');
+ expect(styles).toContain('.group:focus-within .notification-action');
});
it('gives the bell trigger a 44px touch target on mobile and compact size on desktop', () => {
diff --git a/client/src/index.css b/client/src/index.css
index fea88670f3..a6d7e0128b 100644
--- a/client/src/index.css
+++ b/client/src/index.css
@@ -1,5 +1,27 @@
@import "tailwindcss";
+/* Compact notification actions only when the primary input can both hover and
+ target precisely. Viewport width alone does not identify a mouse or trackpad. */
+@media (hover: hover) and (pointer: fine) and (min-width: 640px) {
+ .notification-action {
+ min-width: 0;
+ min-height: 0;
+ margin-block: 0;
+ padding: 0.25rem;
+ opacity: 0;
+ }
+
+ .group:hover .notification-action,
+ .group:focus-within .notification-action {
+ opacity: 1;
+ }
+
+ .notification-mark-read {
+ min-height: 0;
+ margin-block: 0;
+ }
+}
+
/* Viewport is both wide AND tall enough to host a canvas overlay (a legend/key)
without blanketing the graph under it. Width alone is the wrong signal: a
landscape phone is wider than `sm` but only ~390px tall, so a `sm:`-only rule