feat(help): rewrite the help center for v5 with a Tours section, new pictures in every language, and fix the tour planner bugs it surfaced

Every help screen checked against the v5 redesign. Tours is documented for
the first time, as a screen of its own with twelve screens under it, and
notifications get help of their own. All pictures are taken again on a
realistic demo trip, with short loops where a still cannot show the motion.
The English is plain and every language is written naturally rather than
word for word.

The switcher shows two levels at most, a screen's overview lists its
sub-screens as cards above its guides, each wiki page is linked once, and
the help sidebar is wider.

Fixes found along the way: Save to Collection keeps a tour's route, a track
dropped on the places column opens the Tours import, tour Share on desktop,
the unsaved tour draft lives on the account, a route click no longer adds
an end point, Trip places leaves the trip's tours out, Escape closes a
stage's day menu, confirms before destructive deletes, DWD warnings sharing
one id kept apart, a booking's date moves with it, and smaller fixes across
notifications, bookings, the day plan, stays, Atlas, Collections, Vacay and
the admin screens.
This commit is contained in:
Maurice
2026-10-22 22:29:35 +02:00
parent 98f7549ac5
commit 31859651d7
2517 changed files with 160592 additions and 60094 deletions
@@ -72,6 +72,20 @@ describe('InAppNotificationItem', () => {
expect(screen.queryByTitle('Mark as read')).not.toBeInTheDocument();
});
it('FE-COMP-NOTIF-006b: a read notification offers Mark as unread and calls markUnread', async () => {
const user = userEvent.setup();
const markUnread = vi.fn().mockResolvedValue(undefined);
seedStore(useInAppNotificationStore, { markUnread });
render(<InAppNotificationItem notification={buildNotification({ id: 17, is_read: true })} />);
await user.click(screen.getByTitle('Mark as unread'));
expect(markUnread).toHaveBeenCalledWith(17);
});
it('FE-COMP-NOTIF-006c: an unread notification does not offer Mark as unread', () => {
render(<InAppNotificationItem notification={buildNotification({ is_read: false })} />);
expect(screen.queryByTitle('Mark as unread')).not.toBeInTheDocument();
});
it('FE-COMP-NOTIF-007: shows Delete button', () => {
render(<InAppNotificationItem notification={buildNotification()} />);
expect(screen.getByTitle('Delete')).toBeInTheDocument();
@@ -1,8 +1,7 @@
import React from 'react'
import { User, Check, X, ArrowRight, Trash2, CheckCheck } from 'lucide-react'
import { User, Check, X, ArrowRight, Trash2, CheckCheck, Mail } from 'lucide-react'
import { useTranslation } from '../../i18n'
import type { InAppNotification } from '../../store/inAppNotificationStore'
import { useSettingsStore } from '../../store/settingsStore'
import { compactTime, useNotificationItemActions } from './useNotificationItemActions'
function relativeTime(dateStr: string, locale: string): string {
@@ -16,10 +15,7 @@ interface NotificationItemProps {
export default function InAppNotificationItem({ notification, onClose }: NotificationItemProps): React.ReactElement {
const { t, locale } = useTranslation()
const { settings } = useSettingsStore()
const darkMode = settings.dark_mode
const dark = darkMode === true || darkMode === 'dark' || (darkMode === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches)
const { responding, handleRespond, handleNavigate, markRead, deleteNotification } =
const { responding, handleRespond, handleNavigate, markRead, markUnread, deleteNotification } =
useNotificationItemActions(notification, onClose)
const titleText = t(notification.title_key, notification.title_params)
@@ -29,10 +25,7 @@ export default function InAppNotificationItem({ notification, onClose }: Notific
return (
<div
className="relative px-4 py-3 transition-colors border-b border-edge-secondary"
style={{
background: notification.is_read ? 'transparent' : (dark ? 'rgba(99,102,241,0.07)' : 'rgba(99,102,241,0.05)'),
}}
className={`relative px-4 py-3 transition-colors border-b border-edge-secondary ${notification.is_read ? '' : 'bg-accent-subtle'}`}
>
<div className="flex gap-3 items-start">
@@ -46,8 +39,7 @@ export default function InAppNotificationItem({ notification, onClose }: Notific
/>
) : (
<div
className="w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold text-content-muted"
style={{ background: dark ? '#27272a' : '#f1f5f9' }}
className="w-8 h-8 rounded-full flex items-center justify-center text-xs font-bold text-content-muted bg-surface-tertiary"
>
{notification.sender_username
? notification.sender_username.charAt(0).toUpperCase()
@@ -67,14 +59,21 @@ export default function InAppNotificationItem({ notification, onClose }: Notific
<span className="text-xs me-1 text-content-faint">
{relativeTime(notification.created_at, locale)}
</span>
{!notification.is_read && (
{notification.is_read ? (
<button type="button"
onClick={() => markUnread(notification.id)}
title={t('notifications.markUnread')}
aria-label={t('notifications.markUnread')}
className="p-1 rounded transition-colors text-content-faint hover:bg-surface-hover hover:text-content focus-visible:bg-surface-hover focus-visible:text-content"
>
<Mail className="w-3.5 h-3.5" />
</button>
) : (
<button type="button"
onClick={() => markRead(notification.id)}
title={t('notifications.markRead')}
className="p-1 rounded transition-colors"
style={{ color: 'var(--text-faint)' }}
onMouseEnter={e => { e.currentTarget.style.background = 'var(--bg-hover)'; e.currentTarget.style.color = 'var(--text-primary)' }}
onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = 'var(--text-faint)' }}
aria-label={t('notifications.markRead')}
className="p-1 rounded transition-colors text-content-faint hover:bg-surface-hover hover:text-content focus-visible:bg-surface-hover focus-visible:text-content"
>
<CheckCheck className="w-3.5 h-3.5" />
</button>
@@ -82,10 +81,8 @@ export default function InAppNotificationItem({ notification, onClose }: Notific
<button type="button"
onClick={() => deleteNotification(notification.id)}
title={t('notifications.delete')}
className="p-1 rounded transition-colors"
style={{ color: 'var(--text-faint)' }}
onMouseEnter={e => { e.currentTarget.style.background = 'rgba(239,68,68,0.1)'; e.currentTarget.style.color = '#ef4444' }}
onMouseLeave={e => { e.currentTarget.style.background = 'transparent'; e.currentTarget.style.color = 'var(--text-faint)' }}
aria-label={t('notifications.delete')}
className="p-1 rounded transition-colors text-content-faint hover:bg-danger-soft hover:text-danger focus-visible:bg-danger-soft focus-visible:text-danger"
>
<Trash2 className="w-3.5 h-3.5" />
</button>
@@ -102,19 +99,11 @@ export default function InAppNotificationItem({ notification, onClose }: Notific
<button type="button"
onClick={() => handleRespond('positive')}
disabled={responding || notification.response !== null}
className="flex items-center gap-1 px-2.5 py-1 rounded-lg text-xs font-medium transition-colors"
style={{
background: notification.response === 'positive'
? 'var(--text-primary)'
: (dark ? '#27272a' : '#f1f5f9'),
color: notification.response === 'positive'
? '#fff'
: notification.response === 'negative'
? 'var(--text-faint)'
: 'var(--text-secondary)',
opacity: notification.response === 'negative' ? 0.5 : 1,
cursor: notification.response !== null || responding ? 'default' : 'pointer',
}}
className={`flex items-center gap-1 px-2.5 py-1 rounded-lg text-xs font-medium transition-colors ${
notification.response === 'positive'
? 'bg-content text-surface'
: `bg-surface-tertiary ${notification.response === 'negative' ? 'text-content-faint opacity-50' : 'text-content-secondary'}`
} ${notification.response !== null || responding ? 'cursor-default' : 'cursor-pointer'}`}
>
<Check className="w-3 h-3" />
{t(notification.positive_text_key)}
@@ -122,19 +111,11 @@ export default function InAppNotificationItem({ notification, onClose }: Notific
<button type="button"
onClick={() => handleRespond('negative')}
disabled={responding || notification.response !== null}
className="flex items-center gap-1 px-2.5 py-1 rounded-lg text-xs font-medium transition-colors"
style={{
background: notification.response === 'negative'
? '#ef4444'
: (dark ? '#27272a' : '#f1f5f9'),
color: notification.response === 'negative'
? '#fff'
: notification.response === 'positive'
? 'var(--text-faint)'
: 'var(--text-secondary)',
opacity: notification.response === 'positive' ? 0.5 : 1,
cursor: notification.response !== null || responding ? 'default' : 'pointer',
}}
className={`flex items-center gap-1 px-2.5 py-1 rounded-lg text-xs font-medium transition-colors ${
notification.response === 'negative'
? 'bg-danger text-white'
: `bg-surface-tertiary ${notification.response === 'positive' ? 'text-content-faint opacity-50' : 'text-content-secondary'}`
} ${notification.response !== null || responding ? 'cursor-default' : 'cursor-pointer'}`}
>
<X className="w-3 h-3" />
{t(notification.negative_text_key)}
@@ -146,10 +127,7 @@ export default function InAppNotificationItem({ notification, onClose }: Notific
{notification.type === 'navigate' && notification.navigate_text_key && notification.navigate_target && (
<button type="button"
onClick={handleNavigate}
className="flex items-center gap-1 mt-2 px-2.5 py-1 rounded-lg text-xs font-medium transition-colors"
style={{ background: dark ? '#27272a' : '#f1f5f9', color: 'var(--text-secondary)' }}
onMouseEnter={e => e.currentTarget.style.background = 'var(--bg-hover)'}
onMouseLeave={e => e.currentTarget.style.background = dark ? '#27272a' : '#f1f5f9'}
className="flex items-center gap-1 mt-2 px-2.5 py-1 rounded-lg text-xs font-medium transition-colors bg-surface-tertiary text-content-secondary hover:bg-surface-hover focus-visible:bg-surface-hover"
>
<ArrowRight className="w-3 h-3" />
{t(notification.navigate_text_key)}
@@ -16,12 +16,12 @@ export function compactTime(dateStr: string, justNow: string): string {
/**
* What one in-app notification can do, behind both lists (the desktop bell's item and
* the phone row render their own markup over this): answer a yes or no question once,
* follow its link (marking it read first), mark it read and delete it.
* follow its link (marking it read first), mark it read or unread and delete it.
*/
export function useNotificationItemActions(notification: InAppNotification, onClose?: () => void) {
const navigate = useNavigate();
const [responding, setResponding] = useState(false);
const { markRead, deleteNotification, respondToBoolean } = useInAppNotificationStore();
const { markRead, markUnread, deleteNotification, respondToBoolean } = useInAppNotificationStore();
const handleRespond = async (response: 'positive' | 'negative') => {
if (responding || notification.response !== null) return;
@@ -38,5 +38,5 @@ export function useNotificationItemActions(notification: InAppNotification, onCl
}
};
return { responding, handleRespond, handleNavigate, markRead, deleteNotification };
return { responding, handleRespond, handleNavigate, markRead, markUnread, deleteNotification };
}