The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.
TypeScript budget-trackercollaborativedockeritinerarymcp-serveroffline-firstopen-sourceopenstreetmappacking-listpwareal-timeself-hostedselfhostedtraveltravel-apptravel-journaltravel-plannertripitwanderlog
feat(packing): a calmer packing list, with every item's choices in one window
Maurice5536d29cbf02
diff --git a/client/scripts/feature-pairs.json b/client/scripts/feature-pairs.jsonindex e3440ef9a..2e21e202a 100644--- a/client/scripts/feature-pairs.json+++ b/client/scripts/feature-pairs.json@@ -647,6 +647,12 @@"desktop": ["src/components/Packing/usePackingListPanel.ts"],"mobile": ["src/mobile/screens/trip/tabs/MPackingListTab.tsx"]},+ {+ "feature": "Packing list: who brings and who sees an item",+ "hooks": ["src/components/Packing/packingItemAccess.ts"],+ "desktop": ["src/components/Packing/PackingItemDetail.tsx"],+ "mobile": ["src/mobile/screens/trip/tabs/MPackItemSheet.tsx"]+ },{"feature": "Packing list: sharing of a whole list","hooks": ["src/components/Packing/usePackingCategorySharing.ts"],diff --git a/client/scripts/format-baseline.json b/client/scripts/format-baseline.jsonindex ec7044735..833fd052d 100644--- a/client/scripts/format-baseline.json+++ b/client/scripts/format-baseline.json@@ -577,16 +577,12 @@"src/components/Packing/PackingListPanelItemRow.test.tsx","src/components/Packing/PackingListPanelItemRow.tsx","src/components/Packing/PackingListPanelList.tsx",- "src/components/Packing/PackingListPanelQuantityInput.test.tsx",- "src/components/Packing/PackingListPanelQuantityInput.tsx","src/components/Packing/PackingListPanelViewTabs.tsx","src/components/Packing/PackingPackedCounter.test.tsx","src/components/Packing/PackingPackedCounter.tsx","src/components/Packing/PackingPopover.test.tsx","src/components/Packing/PackingPopover.tsx","src/components/Packing/PackingPrintPreview.tsx",- "src/components/Packing/PackingShareControl.test.tsx",- "src/components/Packing/PackingShareControl.tsx","src/components/Packing/PackingWeightSummary.tsx","src/components/Packing/packingExport.test.ts","src/components/Packing/packingExport.ts",diff --git a/client/scripts/rtl-baseline.json b/client/scripts/rtl-baseline.jsonindex 4af5b800d..62ecdaf5e 100644--- a/client/scripts/rtl-baseline.json+++ b/client/scripts/rtl-baseline.json@@ -40,7 +40,6 @@"components/Packing/PackingListPanelBagCard.tsx": 1,"components/Packing/PackingListPanelCategoryGroup.tsx": 3,"components/Packing/PackingListPanelItemRow.tsx": 2,- "components/Packing/PackingShareControl.tsx": 3,"components/Planner/DayDetailPanel.tsx": 1,"components/Planner/PlaceInspector.tsx": 1,"components/Planner/TransitSearchPanel.tsx": 3,diff --git a/client/scripts/rtl-disable-baseline.json b/client/scripts/rtl-disable-baseline.jsonindex 09f626534..e8f5d8afe 100644--- a/client/scripts/rtl-disable-baseline.json+++ b/client/scripts/rtl-disable-baseline.json@@ -1,10 +1,12 @@{"components/Collections/CollectionMap.tsx": 1,+ "components/Packing/PackingItemDetail.tsx": 1,"components/Studio/LineHandles.tsx": 1,"components/Studio/StudioSelectionChrome.tsx": 2,"components/Studio/inspector/FocalPad.tsx": 1,"mobile/components/trek3d/MascotClip.tsx": 1,"mobile/screens/trip/MTripShell.tsx": 1,"mobile/screens/vacay/MVacay.tsx": 1,+ "pages/CollectionsPage.tsx": 1,"pages/tripPlanner/PlanMapStage.tsx": 4}diff --git a/client/scripts/theme-baseline.json b/client/scripts/theme-baseline.jsonindex 5d2a44be9..23a345d8a 100644--- a/client/scripts/theme-baseline.json+++ b/client/scripts/theme-baseline.json@@ -77,7 +77,6 @@"components/Packing/PackingListPanelCategoryGroup.tsx": 5,"components/Packing/PackingListPanelHeader.tsx": 5,"components/Packing/PackingListPanelItemRow.tsx": 2,- "components/Packing/PackingShareControl.tsx": 3,"components/Packing/packingPrintDocument.ts": 24,"components/Planner/AirTrailImportModal.tsx": 4,"components/Planner/BookingCostsSection.tsx": 1,diff --git a/client/src/components/Packing/ApplyTemplateButton.test.tsx b/client/src/components/Packing/ApplyTemplateButton.test.tsxindex b9d19a316..843111141 100644--- a/client/src/components/Packing/ApplyTemplateButton.test.tsx+++ b/client/src/components/Packing/ApplyTemplateButton.test.tsx@@ -1,4 +1,4 @@-// FE-W4ATB-001 to FE-W4ATB-010+// FE-W4ATB-001 to FE-W4ATB-012import { describe, it, expect, vi, beforeEach } from 'vitest'import { render, screen, fireEvent, waitFor } from '../../../tests/helpers/render'import { useTripStore } from '../../store/tripStore'@@ -138,4 +138,16 @@ describe('ApplyTemplateButton', () => {expect(await screen.findByRole('button')).toHaveClass('btn-ghost')})++ it('FE-W4ATB-012: as a menu line it opens the templates under it and closes the menu once applied', async () => {+ const onApplied = vi.fn()+ render(<ApplyTemplateButton tripId={4} visibility="personal" variant="menu" onApplied={onApplied} />)++ fireEvent.click(await screen.findByRole('button', { name: /Apply template/ }))+ fireEvent.click(screen.getByText('City break'))++ await waitFor(() => expect(applyTemplate).toHaveBeenCalledWith(4, 2, 'personal'))+ await waitFor(() => expect(onApplied).toHaveBeenCalledTimes(1))+ expect(screen.queryByText('Beach trip')).toBeNull()+ })})diff --git a/client/src/components/Packing/ApplyTemplateButton.tsx b/client/src/components/Packing/ApplyTemplateButton.tsxindex 6b2cdc17e..a059f25f1 100644--- a/client/src/components/Packing/ApplyTemplateButton.tsx+++ b/client/src/components/Packing/ApplyTemplateButton.tsx@@ -1,10 +1,11 @@import React, { useEffect, useRef, useState } from 'react'-import { Package } from 'lucide-react'+import { ChevronDown, ChevronRight, Package } from 'lucide-react'import { packingApi } from '../../api/client'import { useTripStore } from '../../store/tripStore'import { useToast } from '../shared/Toast'import { useTranslation } from '../../i18n'import { PackingTemplateOption } from './PackingTemplateOption'+import { PopoverItem } from './PackingPopover'import { offlineOr } from '../../utils/needsConnection'interface Template {@@ -16,13 +17,16 @@ interface Template {interface ApplyTemplateButtonProps {tripId: numbervisibility: 'common' | 'personal'- style: React.CSSProperties+ style?: React.CSSPropertiesclassName?: string+ /** 'menu' draws a line of the Lists menu that opens the templates under it; onApplied closes that menu. */+ variant?: 'button' | 'menu'+ onApplied?: () => void}// Dropdown-Button um ein Packing-Template auf den aktuellen Trip anzuwenden.// Rendert nichts wenn keine Templates existieren.-export default function ApplyTemplateButton({ tripId, visibility, style, className }: ApplyTemplateButtonProps): React.ReactElement | null {+export default function ApplyTemplateButton({ tripId, visibility, style, className, variant = 'button', onApplied }: ApplyTemplateButtonProps): React.ReactElement | null {const [templates, setTemplates] = useState<Template[]>([])const [open, setOpen] = useState(false)const [applying, setApplying] = useState(false)@@ -50,6 +54,7 @@ export default function ApplyTemplateButton({ tripId, visibility, style, classNauseTripStore.setState(s => ({ packingItems: [...s.packingItems, ...(data.items || [])] }))toast.success(t('packing.templateApplied', { count: data.count }))setOpen(false)+ onApplied?.()} catch {toast.error(offlineOr(t, t('packing.templateError')))} finally {@@ -59,6 +64,20 @@ export default function ApplyTemplateButton({ tripId, visibility, style, classNaif (templates.length === 0) return null+ if (variant === 'menu') return (+ <>+ <PopoverItem icon={<Package size={13} />} label={t('packing.applyTemplate')} onClick={() => setOpen(v => !v)}+ trailing={open ? <ChevronDown size={13} className="shrink-0 text-content-faint" /> : <ChevronRight size={13} className="shrink-0 text-content-faint" />} />+ {open && (+ <div className="mb-1 ms-[18px] border-s border-edge-faint ps-1.5">+ {templates.map(tmpl => (+ <PackingTemplateOption key={tmpl.id} name={tmpl.name} itemCount={tmpl.item_count} onClick={() => { if (!applying) void handleApply(tmpl.id) }} t={t} />+ ))}+ </div>+ )}+ </>+ )+return (<div ref={dropRef} style={{ position: 'relative' }}><button type="button"diff --git a/client/src/components/Packing/PackingExportMenu.test.tsx b/client/src/components/Packing/PackingExportMenu.test.tsxindex f288ae188..6204fab13 100644--- a/client/src/components/Packing/PackingExportMenu.test.tsx+++ b/client/src/components/Packing/PackingExportMenu.test.tsx@@ -1,4 +1,4 @@-// FE-PACKEXPORTMENU-001 to FE-PACKEXPORTMENU-006+// FE-PACKEXPORTMENU-001 to FE-PACKEXPORTMENU-007import { beforeEach, describe, expect, it, vi } from 'vitest'import userEvent from '@testing-library/user-event'import { fireEvent, render, screen } from '../../../tests/helpers/render'@@ -99,4 +99,18 @@ describe('PackingPrintPreview', () => {await user.click(closeButtons[closeButtons.length - 1])expect(onClose).toHaveBeenCalledTimes(1)})++ it('FE-PACKEXPORTMENU-007: as menu lines it offers the three ways out and reports the choice', async () => {+ const user = userEvent.setup()+ const onChosen = vi.fn()+ render(<PackingExportMenu tripId={7} view="personal" variant="menu" onChosen={onChosen} />)+ expect(screen.queryByRole('button', { name: 'Export' })).toBeNull()+ await user.click(screen.getByRole('button', { name: 'CSV for import (.csv)' }))+ expect(packingExport.exportCsv).toHaveBeenCalledTimes(1)+ expect(onChosen).toHaveBeenCalledTimes(1)+ await user.click(screen.getByRole('button', { name: 'Print or save as PDF' }))+ expect(packingExport.openPrint).toHaveBeenCalledTimes(1)+ await user.click(screen.getByRole('button', { name: 'Markdown checklist (.md)' }))+ expect(packingExport.exportMarkdown).toHaveBeenCalledTimes(1)+ })})diff --git a/client/src/components/Packing/PackingExportMenu.tsx b/client/src/components/Packing/PackingExportMenu.tsxindex 00f33c902..8b8522d38 100644--- a/client/src/components/Packing/PackingExportMenu.tsx+++ b/client/src/components/Packing/PackingExportMenu.tsx@@ -3,13 +3,17 @@ import type { LucideIcon } from 'lucide-react'import { FileSpreadsheet, FileText, Printer, Upload } from 'lucide-react'import { useTranslation } from '../../i18n'import PackingPrintPreview from './PackingPrintPreview'+import { PopoverItem } from './PackingPopover'import { usePackingExport, type PackingView } from './usePackingExport'interface PackingExportMenuProps {tripId: numberview: PackingView- style: React.CSSProperties+ style?: React.CSSPropertiesclassName?: string+ /** 'menu' draws the three ways out as lines of the Lists menu; onChosen closes that menu. */+ variant?: 'button' | 'menu'+ onChosen?: () => void}function MenuItem({ icon: Icon, label, onClick }: { icon: LucideIcon; label: string; onClick: () => void }) {@@ -31,7 +35,7 @@ function MenuItem({ icon: Icon, label, onClick }: { icon: LucideIcon; label: str* as PDF, a Markdown checklist, or CSV in the import's own format. Covers the view on* screen and renders nothing while that view is empty.*/-export default function PackingExportMenu({ tripId, view, style, className }: PackingExportMenuProps): React.ReactElement | null {+export default function PackingExportMenu({ tripId, view, style, className, variant = 'button', onChosen }: PackingExportMenuProps): React.ReactElement | null {const { t } = useTranslation()const packingExport = usePackingExport(tripId, view)const [open, setOpen] = useState(false)@@ -55,9 +59,19 @@ export default function PackingExportMenu({ tripId, view, style, className }: Paconst choose = (action: () => void | Promise<void>) => () => {setOpen(false)+ onChosen?.()void action()}+ if (variant === 'menu') return (+ <>+ <PopoverItem icon={<Printer size={13} />} label={t('packing.exportPrint')} onClick={choose(packingExport.openPrint)} />+ <PopoverItem icon={<FileText size={13} />} label={t('packing.exportMarkdown')} onClick={choose(packingExport.exportMarkdown)} />+ <PopoverItem icon={<FileSpreadsheet size={13} />} label={t('packing.exportCsv')} onClick={choose(packingExport.exportCsv)} />+ <PackingPrintPreview html={packingExport.printHtml} title={packingExport.printTitle} onClose={packingExport.closePrint} />+ </>+ )+return (// A flex box, so the button stretches to the row height like its neighbours in the header.<div ref={menuRef} className="relative flex">diff --git a/client/src/components/Packing/PackingItemDetail.test.tsx b/client/src/components/Packing/PackingItemDetail.test.tsxnew file mode 100644index 000000000..952ed6474--- /dev/null+++ b/client/src/components/Packing/PackingItemDetail.test.tsx@@ -0,0 +1,373 @@+// FE-PACKDETAIL-001 to FE-PACKDETAIL-024+import { http, HttpResponse } from 'msw';+import type { ComponentProps } from 'react';+import { createRef } from 'react';+import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';+import { buildPackingItem, buildTrip, buildUser } from '../../../tests/helpers/factories';+import { server } from '../../../tests/helpers/msw/server';+import { fireEvent, render, screen, waitFor, within } from '../../../tests/helpers/render';+import { resetAllStores, seedStore } from '../../../tests/helpers/store';+import { useAuthStore } from '../../store/authStore';+import { useTripStore } from '../../store/tripStore';+import type { PackingBag, PackingItem } from '../../types';+import { PackingItemDetail } from './PackingItemDetail';+import type { TripMember } from './usePackingListPanel';++type Props = ComponentProps<typeof PackingItemDetail>;++const toastSpy = vi.fn((_message: string, _type?: string, _duration?: number) => 0);+const MEMBERS = [+ { id: 1, username: 'owner' },+ { id: 2, username: 'alice' },+ { id: 3, username: 'bob', avatar_url: '/uploads/avatars/bob.png' },+] as unknown as TripMember[];+const BAGS = [+ { id: 7, name: 'Carry-on', color: '#10b981' },+ { id: 8, name: 'Trolley', color: '#ec4899' },+] as unknown as PackingBag[];++function setup(overrides: Partial<Props> = {}) {+ const anchor = document.createElement('div');+ document.body.appendChild(anchor);+ const anchorRef = createRef<HTMLElement>() as { current: HTMLElement | null };+ anchorRef.current = anchor;+ const props: Props = {+ item: buildPackingItem({+ id: 1,+ name: 'Tent',+ category: 'Gear',+ quantity: 1,+ is_private: 0,+ owner_id: 1,+ owner_username: 'owner',+ } as Partial<PackingItem>),+ tripId: 1,+ anchorRef,+ onClose: vi.fn(),+ categories: ['Gear', 'Docs'],+ canEdit: true,+ bags: BAGS,+ onCreateBag: vi.fn(async () => undefined),+ tripMembers: MEMBERS,+ currentUserId: 1,+ onSetSharing: vi.fn(),+ onClone: vi.fn(),+ onJoin: vi.fn(),+ onLeave: vi.fn(),+ onDelete: vi.fn(),+ ...overrides,+ };+ const utils = render(<PackingItemDetail {...props} />);+ return { ...utils, props, dialog: within(screen.getByRole('dialog')) };+}++/** Captures the body of the next PUT to item 1. */+function capturePut() {+ const box: { body: Record<string, unknown> | null } = { body: null };+ server.use(+ http.put('/api/trips/1/packing/1', async ({ request }) => {+ box.body = (await request.json()) as Record<string, unknown>;+ return HttpResponse.json({ item: buildPackingItem({ id: 1 }) });+ })+ );+ return box;+}++beforeEach(() => {+ resetAllStores();+ toastSpy.mockClear();+ window.__addToast = toastSpy;+ seedStore(useAuthStore, { user: buildUser({ id: 1 }), isAuthenticated: true });+ seedStore(useTripStore, { trip: buildTrip({ id: 1 }), packingItems: [buildPackingItem({ id: 1, name: 'Tent' })] });+});++afterEach(() => {+ delete window.__addToast;+ vi.restoreAllMocks();+});++describe('PackingItemDetail — name and list', () => {+ it('FE-PACKDETAIL-001: renaming saves when the field lets go, Enter included', async () => {+ const put = capturePut();+ const { dialog } = setup();+ const input = dialog.getByRole('textbox', { name: 'Rename' });+ input.focus();+ fireEvent.change(input, { target: { value: 'Tarp' } });+ fireEvent.keyDown(input, { key: 'Enter' });+ await waitFor(() => expect(put.body).toMatchObject({ name: 'Tarp' }));+ });++ it('FE-PACKDETAIL-002: a blank or unchanged name saves nothing', async () => {+ const put = capturePut();+ const { dialog } = setup();+ const input = dialog.getByRole('textbox', { name: 'Rename' });+ fireEvent.change(input, { target: { value: ' ' } });+ fireEvent.blur(input);+ expect(input).toHaveValue('Tent');+ fireEvent.blur(input);+ await new Promise((r) => setTimeout(r, 20));+ expect(put.body).toBeNull();+ });++ it('FE-PACKDETAIL-003: a failing save surfaces a save error', async () => {+ server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })));+ const { dialog } = setup();+ const input = dialog.getByRole('textbox', { name: 'Rename' });+ fireEvent.change(input, { target: { value: 'Tarp' } });+ fireEvent.blur(input);+ await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined));+ });++ it('FE-PACKDETAIL-004: the List choice moves the item and leaves the current list alone', async () => {+ const put = capturePut();+ const { dialog } = setup();+ const choice = dialog.getByRole('button', { name: /Gear/ });+ expect(choice).toHaveAttribute('aria-expanded', 'false');+ fireEvent.click(choice);+ expect(choice).toHaveAttribute('aria-expanded', 'true');+ fireEvent.click(dialog.getAllByRole('button', { name: /Gear/ })[1]);+ expect(put.body).toBeNull();+ fireEvent.click(dialog.getByRole('button', { name: /Gear/ }));+ fireEvent.click(dialog.getByRole('button', { name: /Docs/ }));+ await waitFor(() => expect(put.body).toMatchObject({ category: 'Docs' }));+ });++ it('FE-PACKDETAIL-005: an item without a list sits in the default one', () => {+ const { dialog } = setup({ item: buildPackingItem({ id: 1, name: 'Tent', category: null }) });+ expect(dialog.getByRole('button', { name: /Other/ })).toBeInTheDocument();+ });+});++describe('PackingItemDetail — amounts', () => {+ it('FE-PACKDETAIL-006: the amount steps up and down and is typed into', async () => {+ const put = capturePut();+ const { dialog } = setup({ item: buildPackingItem({ id: 1, name: 'Socks', quantity: 3 }) });+ const group = within(dialog.getByRole('group', { name: 'Qty' }));+ fireEvent.click(group.getByRole('button', { name: 'One more' }));+ await waitFor(() => expect(put.body).toMatchObject({ quantity: 4 }));+ fireEvent.click(group.getByRole('button', { name: 'One less' }));+ await waitFor(() => expect(put.body).toMatchObject({ quantity: 2 }));+ const field = group.getByDisplayValue('3');+ fireEvent.focus(field);+ fireEvent.change(field, { target: { value: '12' } });+ fireEvent.keyDown(field, { key: 'Enter' });+ fireEvent.blur(field);+ await waitFor(() => expect(put.body).toMatchObject({ quantity: 12 }));+ });++ it('FE-PACKDETAIL-007: one piece cannot go lower, and a cleared field falls back to one', async () => {+ const put = capturePut();+ const { dialog } = setup();+ const group = within(dialog.getByRole('group', { name: 'Qty' }));+ expect(group.getByRole('button', { name: 'One less' })).toBeDisabled();+ const field = group.getByDisplayValue('1');+ fireEvent.focus(field);+ fireEvent.change(field, { target: { value: '' } });+ fireEvent.blur(field);+ await new Promise((r) => setTimeout(r, 20));+ expect(put.body).toBeNull();+ expect(field).toHaveValue('1');+ });++ it('FE-PACKDETAIL-008: several pieces add the packed counter', () => {+ const { dialog } = setup({+ item: buildPackingItem({ id: 1, name: 'Socks', quantity: 5, packed_quantity: 2 } as Partial<PackingItem>),+ });+ expect(dialog.getByText('2/5')).toBeInTheDocument();+ });++ it('FE-PACKDETAIL-009: a single piece and a read-only window show no steppers', () => {+ const first = setup();+ expect(first.dialog.queryByText(/\/1$/)).toBeNull();+ first.unmount();+ const ro = setup({ canEdit: false });+ expect(ro.dialog.queryByRole('group', { name: 'Qty' })).toBeNull();+ expect(ro.dialog.getByRole('button', { name: /Gear/ })).toBeDisabled();+ });++ it('FE-PACKDETAIL-010: with bag tracking the weight is typed in grams', async () => {+ const put = capturePut();+ const { dialog } = setup({ bagTrackingEnabled: true });+ const weight = dialog.getByPlaceholderText('—');+ fireEvent.focus(weight);+ fireEvent.change(weight, { target: { value: '450' } });+ fireEvent.blur(weight);+ await waitFor(() => expect(put.body).toMatchObject({ weight_grams: 450 }));+ });+});++describe('PackingItemDetail — bag', () => {+ it('FE-PACKDETAIL-011: no bag tracking, no bag or weight lines', () => {+ const { dialog } = setup();+ expect(dialog.queryByPlaceholderText('—')).toBeNull();+ expect(dialog.queryByRole('button', { name: /Unassigned/ })).toBeNull();+ });++ it('FE-PACKDETAIL-012: picking a bag assigns it, picking the same one does nothing', async () => {+ const put = capturePut();+ const { dialog } = setup({ bagTrackingEnabled: true });+ fireEvent.click(dialog.getByRole('button', { name: /Unassigned/ }));+ fireEvent.click(dialog.getAllByRole('button', { name: /Unassigned/ })[1]);+ expect(put.body).toBeNull();+ fireEvent.click(dialog.getByRole('button', { name: /Unassigned/ }));+ fireEvent.click(dialog.getByRole('button', { name: /Trolley/ }));+ await waitFor(() => expect(put.body).toMatchObject({ bag_id: 8 }));+ });++ it('FE-PACKDETAIL-013: an assigned item can be taken out of its bag', async () => {+ const put = capturePut();+ const { dialog } = setup({+ bagTrackingEnabled: true,+ item: buildPackingItem({ id: 1, name: 'Tent', bag_id: 7 } as Partial<PackingItem>),+ });+ fireEvent.click(dialog.getByRole('button', { name: /Carry-on/ }));+ fireEvent.click(dialog.getByRole('button', { name: /Unassigned/ }));+ await waitFor(() => expect(put.body).toMatchObject({ bag_id: null }));+ });++ it('FE-PACKDETAIL-014: a new bag is created and assigned, a blank name creates nothing', async () => {+ const put = capturePut();+ const onCreateBag = vi.fn(async () => ({ id: 20, name: 'Daypack', color: '#6366f1' }) as unknown as PackingBag);+ const { dialog } = setup({ bagTrackingEnabled: true, onCreateBag });+ fireEvent.click(dialog.getByRole('button', { name: /Unassigned/ }));+ const field = dialog.getByRole('textbox', { name: 'Bag name...' });+ expect(dialog.getByRole('button', { name: 'Add bag' })).toBeDisabled();+ fireEvent.keyDown(field, { key: 'Enter' });+ expect(onCreateBag).not.toHaveBeenCalled();+ fireEvent.change(field, { target: { value: 'Daypack' } });+ fireEvent.click(dialog.getByRole('button', { name: 'Add bag' }));+ await waitFor(() => expect(put.body).toMatchObject({ bag_id: 20 }));+ expect(onCreateBag).toHaveBeenCalledWith('Daypack');+ });++ it('FE-PACKDETAIL-015: a bag that could not be created assigns nothing', async () => {+ const put = capturePut();+ const { dialog } = setup({ bagTrackingEnabled: true });+ fireEvent.click(dialog.getByRole('button', { name: /Unassigned/ }));+ const field = dialog.getByRole('textbox', { name: 'Bag name...' });+ fireEvent.change(field, { target: { value: 'Daypack' } });+ fireEvent.keyDown(field, { key: 'Enter' });+ await waitFor(() => expect(dialog.queryByRole('textbox', { name: 'Bag name...' })).toBeNull());+ expect(put.body).toBeNull();+ });+});++describe('PackingItemDetail — who brings it and who sees it', () => {+ it('FE-PACKDETAIL-016: the bringer pill opens every traveller, ticked on or off (#3098)', () => {+ const { dialog, props } = setup({+ item: buildPackingItem({+ id: 1,+ name: 'Tent',+ is_private: 0,+ owner_id: 1,+ owner_username: 'owner',+ contributors: [{ user_id: 3, username: 'bob' }],+ } as unknown as Partial<PackingItem>),+ });+ fireEvent.click(dialog.getByRole('button', { name: /owner, bob/ }));+ fireEvent.click(dialog.getByRole('button', { name: 'alice' }));+ expect(props.onJoin).toHaveBeenCalledWith(1, 2);+ fireEvent.click(dialog.getByRole('button', { name: 'bob' }));+ expect(props.onLeave).toHaveBeenCalledWith(1, 3);+ fireEvent.click(dialog.getByRole('button', { name: 'owner' }));+ expect(props.onLeave).toHaveBeenCalledWith(1, 1);+ });++ it('FE-PACKDETAIL-017: nobody bringing it yet reads as such', () => {+ const { dialog } = setup({+ item: buildPackingItem({+ id: 1,+ name: 'Tent',+ is_private: 0,+ owner_id: null,+ owner_username: null,+ } as Partial<PackingItem>),+ });+ expect(dialog.getByRole('button', { name: /Nobody yet/ })).toBeInTheDocument();+ });++ it('FE-PACKDETAIL-018: the owner sets who sees the item', () => {+ const { dialog, props } = setup();+ const group = within(dialog.getByRole('radiogroup', { name: 'Visible to' }));+ expect(group.getByRole('radio', { name: 'All' })).toHaveAttribute('aria-checked', 'true');+ fireEvent.click(group.getByRole('radio', { name: 'Only me' }));+ expect(props.onSetSharing).toHaveBeenCalledWith(1, 'personal', []);+ fireEvent.click(group.getByRole('radio', { name: 'Selected' }));+ expect(group.getByRole('radio', { name: 'Selected' })).toHaveAttribute('aria-checked', 'true');+ fireEvent.click(dialog.getByRole('button', { name: 'alice' }));+ expect(props.onSetSharing).toHaveBeenCalledWith(1, 'shared', [2]);+ fireEvent.click(group.getByRole('radio', { name: 'All' }));+ expect(props.onSetSharing).toHaveBeenLastCalledWith(1, 'common', []);+ });++ it('FE-PACKDETAIL-019: taking the last person off a shared item makes it personal', () => {+ const { dialog, props } = setup({+ item: buildPackingItem({+ id: 1,+ name: 'Diary',+ is_private: 1,+ owner_id: 1,+ recipients: [{ user_id: 2, username: 'alice' }],+ } as unknown as Partial<PackingItem>),+ });+ expect(dialog.getByRole('radio', { name: 'Selected' })).toHaveAttribute('aria-checked', 'true');+ // A private item has no bringer pill.+ expect(dialog.queryByRole('button', { name: /owner/ })).toBeNull();+ fireEvent.click(dialog.getByRole('button', { name: 'alice' }));+ expect(props.onSetSharing).toHaveBeenCalledWith(1, 'personal', []);+ });++ it('FE-PACKDETAIL-020: alone on the trip there is nobody to pick', () => {+ const { dialog } = setup({ tripMembers: [MEMBERS[0]] });+ fireEvent.click(dialog.getByRole('radio', { name: 'Selected' }));+ expect(dialog.getByText('No one else on this trip yet')).toBeInTheDocument();+ });++ it('FE-PACKDETAIL-021: an item someone else shared with me says whose it is and offers no sharing', () => {+ const { dialog } = setup({+ item: buildPackingItem({+ id: 1,+ name: 'Stove',+ is_private: 1,+ owner_id: 2,+ owner_username: 'alice',+ } as Partial<PackingItem>),+ });+ expect(dialog.getByText('by alice')).toBeInTheDocument();+ expect(dialog.queryByRole('radiogroup')).toBeNull();+ expect(dialog.queryByRole('button', { name: 'Copy to my list' })).toBeNull();+ });++ it('FE-PACKDETAIL-022: a common item of someone else can be copied to my list', () => {+ const { dialog, props } = setup({+ item: buildPackingItem({+ id: 1,+ name: 'Stove',+ is_private: 0,+ owner_id: 2,+ owner_username: 'alice',+ } as Partial<PackingItem>),+ });+ expect(dialog.queryByRole('radiogroup')).toBeNull();+ fireEvent.click(dialog.getByRole('button', { name: 'Copy to my list' }));+ expect(props.onClone).toHaveBeenCalledWith(1);+ expect(props.onClose).toHaveBeenCalled();+ });+});++describe('PackingItemDetail — closing and deleting', () => {+ it('FE-PACKDETAIL-023: Delete closes the window and hands over', () => {+ const { dialog, props } = setup();+ fireEvent.click(dialog.getByRole('button', { name: 'Delete' }));+ expect(props.onClose).toHaveBeenCalled();+ expect(props.onDelete).toHaveBeenCalled();+ });++ it('FE-PACKDETAIL-024: Escape, the close button and a click beside the window close it', () => {+ const { dialog, props } = setup();+ fireEvent.keyDown(dialog.getByRole('textbox', { name: 'Rename' }), { key: 'Escape' });+ fireEvent.click(dialog.getByRole('button', { name: 'Close' }));+ fireEvent.click(document.querySelector('[role="presentation"]')!);+ expect(props.onClose).toHaveBeenCalledTimes(3);+ });+});diff --git a/client/src/components/Packing/PackingItemDetail.tsx b/client/src/components/Packing/PackingItemDetail.tsxnew file mode 100644index 000000000..6894e525b--- /dev/null+++ b/client/src/components/Packing/PackingItemDetail.tsx@@ -0,0 +1,602 @@+import { ChevronDown, Copy, Minus, Plus, Trash2, X } from 'lucide-react';+import { useState, type CSSProperties, type ReactNode, type RefObject } from 'react';+import { createPortal } from 'react-dom';+import { useAnchoredPosition } from '../../hooks/useAnchoredPosition';+import { useTranslation } from '../../i18n';+import { useTripStore } from '../../store/tripStore';+import type { PackingBag, PackingItem } from '../../types';+import { NumericInput } from '../shared/NumericInput';+import { useToast } from '../shared/Toast';+import { bringersOf, packingBringerNames } from './packingBringers';+import { BringerAvatar, MoreBringers } from './PackingBringersCard';+import { bringsItem, packingItemAccess, toggledRecipients, type PackingVisibility } from './packingItemAccess';+import { katColor, packedOf } from './packingListPanel.helpers';+import { WeightInput } from './PackingListPanelWeightInput';+import { PackedCounter } from './PackingPackedCounter';+import { PopoverItem } from './PackingPopover';+import { POPOVER, POPOVER_DIVIDER } from './packingPopoverStyles';+import type { TripMember } from './usePackingListPanel';++type ItemPatch = Partial<Pick<PackingItem, 'name' | 'category' | 'quantity' | 'weight_grams' | 'bag_id'>>;+type Save = (data: ItemPatch) => Promise<void>;++export interface PackingItemDetailProps {+ item: PackingItem;+ tripId: number;+ /** The row the window hangs from. */+ anchorRef: RefObject<HTMLElement | null>;+ onClose: () => void;+ categories: string[];+ canEdit: boolean;+ bagTrackingEnabled?: boolean;+ bags: PackingBag[];+ onCreateBag: (name: string) => Promise<PackingBag | undefined>;+ tripMembers: TripMember[];+ currentUserId?: number;+ onSetSharing?: (id: number, visibility: PackingVisibility, recipientIds: number[]) => void;+ onClone?: (id: number) => void;+ onJoin?: (id: number, userId?: number) => void;+ onLeave?: (id: number, userId: number) => void;+ onDelete: () => void;+}++const WIDTH = 320;+/** Every value of the window sits in the same soft pill: steppers, fields and the choices that open a list. */+const PILL =+ 'inline-flex h-7 min-w-0 max-w-full items-center gap-1.5 rounded-full bg-surface-tertiary text-caption font-semibold text-content';+const STEP =+ 'grid size-6 cursor-pointer place-items-center rounded-full border-0 bg-transparent p-0 text-content-muted hover:text-content disabled:cursor-default disabled:opacity-35';++const dotStyle = (color: string | undefined): CSSProperties => ({+ width: 8,+ height: 8,+ borderRadius: '50%',+ background: color,+ display: 'inline-block',+ flexShrink: 0,+});+const avatarOf = (m: TripMember) => ({ name: m.username, avatar: m.avatar_url ?? m.avatar ?? null });++/** One line of the window: what it is on the left, its value on the right. */+function Field({ name, children }: Readonly<{ name: string; children: ReactNode }>) {+ return (+ <div className="flex min-h-[38px] items-center gap-2.5 px-2.5 py-[3px]">+ <span className="w-[92px] shrink-0 text-caption font-medium text-content-muted">{name}</span>+ <div className="flex min-w-0 flex-1 items-center justify-end">{children}</div>+ </div>+ );+}++/** A pill that opens a short list right under its line, like a select would. */+function Choice({+ open,+ onToggle,+ lead,+ text,+ disabled,+}: Readonly<{ open: boolean; onToggle: () => void; lead?: ReactNode; text: string; disabled: boolean }>) {+ return (+ <button+ type="button"+ onClick={onToggle}+ disabled={disabled}+ aria-expanded={open}+ className={`${PILL} border-0 py-0 pe-2 ps-3 font-[inherit] ${disabled ? 'cursor-default pe-3' : 'cursor-pointer'}`}+ >+ {lead}+ <span className="truncate">{text}</span>+ {!disabled && (+ <ChevronDown+ size={13}+ className={`shrink-0 text-content-faint transition-transform ${open ? 'rotate-180' : ''}`}+ />+ )}+ </button>+ );+}++/** The short list a Choice opens, set in under its line. */+function ChoiceList({ children }: Readonly<{ children: ReactNode }>) {+ return (+ <div className="mx-1.5 mb-1 max-h-56 overflow-y-auto rounded-[10px] bg-surface-secondary p-[3px]">{children}</div>+ );+}++/** How many of the item: minus, the number to type into, plus. */+function QuantityStepper({ value, onSave }: Readonly<{ value: number; onSave: (qty: number) => void }>) {+ const { t } = useTranslation();+ // What is being typed while the field has focus; null shows the stored amount.+ const [draft, setDraft] = useState<string | null>(null);+ const commit = (next: number) => {+ const qty = Math.max(1, Math.min(999, next || 1));+ setDraft(null);+ if (qty !== value) onSave(qty);+ };+ return (+ <div className={`${PILL} px-0.5`} role="group" aria-label={t('packing.quantity')}>+ <button+ type="button"+ className={STEP}+ aria-label={t('packing.quantityLess')}+ disabled={value <= 1}+ onClick={() => commit(value - 1)}+ >+ <Minus size={12} strokeWidth={2.5} />+ </button>+ <NumericInput+ value={draft ?? String(value)}+ onValueChange={setDraft}+ onFocus={() => setDraft(String(value))}+ onBlur={() => commit(Number(draft ?? value))}+ onKeyDown={(e) => {+ if (e.key === 'Enter') e.currentTarget.blur();+ }}+ className="w-8 border-0 bg-transparent p-0 text-center font-[inherit] text-caption font-semibold text-content outline-none"+ />+ <button+ type="button"+ className={STEP}+ aria-label={t('packing.quantityMore')}+ disabled={value >= 999}+ onClick={() => commit(value + 1)}+ >+ <Plus size={12} strokeWidth={2.5} />+ </button>+ </div>+ );+}++function BagChoice({+ item,+ bags,+ canEdit,+ onCreateBag,+ save,+}: Readonly<{+ item: PackingItem;+ bags: PackingBag[];+ canEdit: boolean;+ onCreateBag: (name: string) => Promise<PackingBag | undefined>;+ save: Save;+}>) {+ const { t } = useTranslation();+ const [open, setOpen] = useState(false);+ const [newBag, setNewBag] = useState('');+ const selected = bags.find((b) => b.id === item.bag_id);+ const pick = (bagId: number | null) => {+ setOpen(false);+ if ((item.bag_id ?? null) !== bagId) void save({ bag_id: bagId });+ };+ const create = async () => {+ const name = newBag.trim();+ if (!name) return;+ const bag = await onCreateBag(name);+ if (bag) await save({ bag_id: bag.id });+ setNewBag('');+ setOpen(false);+ };+ return (+ <>+ <Field name={t('packing.detail.bag')}>+ <Choice+ open={open}+ disabled={!canEdit}+ text={selected?.name || t('packing.noBag')}+ onToggle={() => setOpen((o) => !o)}+ lead={selected ? <span aria-hidden style={dotStyle(selected.color)} /> : undefined}+ />+ </Field>+ {open && (+ <ChoiceList>+ <PopoverItem+ label={t('packing.noBag')}+ active={!item.bag_id}+ onClick={() => pick(null)}+ icon={+ <span className="inline-block size-2 rounded-full border-[1.5px] border-dashed border-content-faint" />+ }+ />+ {bags.map((b) => (+ <PopoverItem+ key={b.id}+ label={b.name}+ active={item.bag_id === b.id}+ onClick={() => pick(b.id)}+ icon={<span style={dotStyle(b.color)} />}+ />+ ))}+ {/* A new bag is typed in as one more line of the list: no frame, the+ add as a small round button that darkens once there is a name. */}+ <div className="flex items-center gap-[9px] rounded-[9px] py-1 pe-1.5 ps-2.5">+ <span aria-hidden className="inline-flex w-4 shrink-0 justify-center text-content-faint">+ <Plus size={13} />+ </span>+ <input+ value={newBag}+ onChange={(e) => setNewBag(e.target.value)}+ placeholder={t('packing.addBag')}+ aria-label={t('packing.bagName')}+ onKeyDown={(e) => {+ if (e.key === 'Enter') void create();+ }}+ className="min-w-0 flex-1 border-0 bg-transparent p-0 font-[inherit] text-caption text-content outline-none placeholder:text-content-faint"+ />+ <button+ type="button"+ aria-label={t('packing.addBag')}+ onClick={() => void create()}+ disabled={!newBag.trim()}+ className={`grid size-6 shrink-0 place-items-center rounded-full border-0 transition-colors ${newBag.trim() ? 'cursor-pointer bg-accent text-accent-text' : 'cursor-default bg-transparent text-content-faint'}`}+ >+ <Plus size={13} strokeWidth={2.5} />+ </button>+ </div>+ </ChoiceList>+ )}+ </>+ );+}++/** Who brings a common item: a pill with their faces that opens the trip's people to tick on or off (#3098). */+function Bringers({+ item,+ members,+ onJoin,+ onLeave,+}: Readonly<{+ item: PackingItem;+ members: TripMember[];+ onJoin: (id: number, userId?: number) => void;+ onLeave: (id: number, userId: number) => void;+}>) {+ const { t } = useTranslation();+ const [open, setOpen] = useState(false);+ const faces = bringersOf(item, members);+ const lead =+ faces.length > 0 ? (+ <span className="-ms-2 inline-flex shrink-0">+ <BringerAvatar bringer={faces[0]} />+ {faces.length > 1 && <MoreBringers count={faces.length - 1} />}+ </span>+ ) : undefined;+ return (+ <>+ <Field name={t('packing.bringersTitle')}>+ <Choice+ open={open}+ disabled={false}+ lead={lead}+ text={faces.length > 0 ? packingBringerNames(item) : t('packing.bringersNobody')}+ onToggle={() => setOpen((o) => !o)}+ />+ </Field>+ {open && (+ <ChoiceList>+ {members.map((m) => {+ const on = bringsItem(item, m.id);+ return (+ <PopoverItem+ key={m.id}+ label={m.username}+ active={on}+ icon={<BringerAvatar bringer={avatarOf(m)} />}+ onClick={() => (on ? onLeave(item.id, m.id) : onJoin(item.id, m.id))}+ />+ );+ })}+ </ChoiceList>+ )}+ </>+ );+}++/** Who sees the item: the whole trip, only its owner, or people the owner picks (#858). */+function Visibility({+ item,+ members,+ currentUserId,+ onSetSharing,+}: Readonly<{+ item: PackingItem;+ members: TripMember[];+ currentUserId?: number;+ onSetSharing: (id: number, visibility: PackingVisibility, recipientIds: number[]) => void;+}>) {+ const { t } = useTranslation();+ const { recipientIds, visibility: current } = packingItemAccess(item, currentUserId);+ const [picking, setPicking] = useState(false);+ const shown: PackingVisibility = picking ? 'shared' : current;+ const others = members.filter((m) => m.id !== item.owner_id && m.id !== currentUserId);+ const choose = (next: PackingVisibility) => {+ setPicking(next === 'shared');+ if (next !== 'shared') onSetSharing(item.id, next, []);+ };+ const toggle = (uid: number) => {+ const next = toggledRecipients(recipientIds, uid);+ onSetSharing(item.id, next.visibility, next.recipientIds);+ };+ const options: { id: PackingVisibility; label: string }[] = [+ { id: 'common', label: t('packing.filterAll') },+ { id: 'personal', label: t('packing.visibility.me') },+ { id: 'shared', label: t('packing.visibility.some') },+ ];+ return (+ <>+ <Field name={t('packing.detail.visibility')}>+ <div role="radiogroup" aria-label={t('packing.detail.visibility')} className={`${PILL} gap-0 p-0.5`}>+ {options.map((o) => (+ <button+ type="button"+ role="radio"+ key={o.id}+ aria-checked={shown === o.id}+ onClick={() => choose(o.id)}+ className={`h-6 cursor-pointer whitespace-nowrap rounded-full border-0 px-2.5 font-[inherit] text-caption font-semibold ${shown === o.id ? 'bg-content text-surface' : 'bg-transparent text-content-muted'}`}+ >+ {o.label}+ </button>+ ))}+ </div>+ </Field>+ {shown === 'shared' && (+ <ChoiceList>+ {others.length === 0 ? (+ <div className="px-2 py-1.5 text-caption text-content-faint">{t('packing.noOneToShare')}</div>+ ) : (+ others.map((m) => (+ <PopoverItem+ key={m.id}+ label={m.username}+ active={recipientIds.includes(m.id)}+ onClick={() => toggle(m.id)}+ icon={<BringerAvatar bringer={avatarOf(m)} />}+ />+ ))+ )}+ </ChoiceList>+ )}+ </>+ );+}++function DetailHead({+ item,+ canEdit,+ save,+ onClose,+}: Readonly<{ item: PackingItem; canEdit: boolean; save: Save; onClose: () => void }>) {+ const { t } = useTranslation();+ const [name, setName] = useState(item.name);+ const commit = () => {+ const next = name.trim();+ if (!next) {+ setName(item.name);+ return;+ }+ if (next !== item.name) void save({ name: next });+ };+ return (+ <div className="flex items-center gap-2 py-1.5 pe-1.5 ps-2.5">+ {canEdit ? (+ <input+ value={name}+ onChange={(e) => setName(e.target.value)}+ onBlur={commit}+ aria-label={t('common.rename')}+ onKeyDown={(e) => {+ if (e.key === 'Enter') e.currentTarget.blur();+ }}+ className="min-w-0 flex-1 border-0 bg-transparent py-0.5 font-[inherit] text-body font-bold text-content outline-none"+ />+ ) : (+ <span className="min-w-0 flex-1 truncate text-body font-bold">{item.name}</span>+ )}+ <button+ type="button"+ onClick={onClose}+ aria-label={t('common.close')}+ className="flex cursor-pointer rounded-md border-0 bg-transparent p-1 text-content-faint hover:text-content"+ >+ <X size={15} />+ </button>+ </div>+ );+}++function ListChoice({+ item,+ categories,+ canEdit,+ save,+}: Readonly<{ item: PackingItem; categories: string[]; canEdit: boolean; save: Save }>) {+ const { t } = useTranslation();+ const [open, setOpen] = useState(false);+ const category = item.category || t('packing.defaultCategory');+ return (+ <>+ <Field name={t('packing.detail.list')}>+ <Choice+ open={open}+ disabled={!canEdit}+ text={category}+ onToggle={() => setOpen((o) => !o)}+ lead={<span aria-hidden style={dotStyle(katColor(category, categories))} />}+ />+ </Field>+ {open && (+ <ChoiceList>+ {categories.map((cat) => (+ <PopoverItem+ key={cat}+ label={cat}+ active={cat === category}+ icon={<span style={dotStyle(katColor(cat, categories))} />}+ onClick={() => {+ setOpen(false);+ if (cat !== category) void save({ category: cat });+ }}+ />+ ))}+ </ChoiceList>+ )}+ </>+ );+}++/** Amount, pieces packed and weight: the three numbers of an item. */+function Amounts({+ item,+ tripId,+ canEdit,+ bagTrackingEnabled,+ save,+}: Readonly<{ item: PackingItem; tripId: number; canEdit: boolean; bagTrackingEnabled?: boolean; save: Save }>) {+ const { t } = useTranslation();+ const setPackedCount = useTripStore((s) => s.setPackedCount);+ const quantity = item.quantity || 1;+ return (+ <>+ {canEdit && (+ <Field name={t('packing.quantity')}>+ <QuantityStepper value={quantity} onSave={(qty) => void save({ quantity: qty })} />+ </Field>+ )}+ {canEdit && quantity > 1 && (+ <Field name={t('packing.printPacked')}>+ <PackedCounter+ packed={packedOf(item)}+ quantity={quantity}+ onChange={(count) => setPackedCount(tripId, item.id, count)}+ style={{ height: 28, padding: '0 2px' }}+ />+ </Field>+ )}+ {bagTrackingEnabled && (+ <Field name={t('packing.totalWeight')}>+ <div className={`${PILL} px-3`}>+ <WeightInput+ value={item.weight_grams}+ readOnly={!canEdit}+ width={52}+ onSave={(grams) => save({ weight_grams: grams })}+ />+ <span className="text-content-faint">g</span>+ </div>+ </Field>+ )}+ </>+ );+}++/**+ * Everything about one packing item in one small window at its row: which list,+ * how many and how many are packed, weight and bag, who brings it and who sees+ * it, and the copy and delete actions. The row only shows what is set, so this+ * is where every choice lives, each one a pill that opens at most one short list.+ */+export function PackingItemDetail(props: Readonly<PackingItemDetailProps>) {+ const {+ item,+ tripId,+ anchorRef,+ onClose,+ categories,+ canEdit,+ bagTrackingEnabled,+ bags,+ onCreateBag,+ tripMembers,+ currentUserId,+ onSetSharing,+ onClone,+ onJoin,+ onLeave,+ onDelete,+ } = props;+ const { t } = useTranslation();+ const toast = useToast();+ const updatePackingItem = useTripStore((s) => s.updatePackingItem);+ const box = useAnchoredPosition(anchorRef, true, { estimatedHeight: 460, offset: 6 });+ if (!box) return null;++ const save: Save = async (data) => {+ try {+ await updatePackingItem(tripId, item.id, data);+ } catch {+ toast.error(t('packing.toast.saveError'));+ }+ };+ const { isCommon, isOwner, sharedToMe, canClone } = packingItemAccess(item, currentUserId);+ const bringers = canEdit && isCommon && onJoin && onLeave && tripMembers.length > 0 ? { onJoin, onLeave } : null;+ const sharing = canEdit && isOwner && onSetSharing ? onSetSharing : null;+ const clone = canEdit && canClone && onClone ? onClone : null;++ return createPortal(+ <>+ <div role="presentation" className="fixed inset-0 z-[1098]" onClick={onClose} />+ <div+ role="dialog"+ aria-label={item.name}+ className="trek-menu-enter fixed z-[1099] overflow-y-auto"+ onKeyDown={(e) => {+ if (e.key === 'Escape') {+ e.stopPropagation();+ onClose();+ }+ }}+ style={{+ ...POPOVER,+ width: `min(${WIDTH}px, calc(100vw - 16px))`,+ top: box.top,+ bottom: box.bottom,+ maxHeight: box.maxHeight,+ left: Math.max(8, Math.min(box.left + box.width - WIDTH, window.innerWidth - WIDTH - 8)), // rtl-lint-disable: measured position+ }}+ >+ <DetailHead key={item.name} item={item} canEdit={canEdit} save={save} onClose={onClose} />+ <ListChoice item={item} categories={categories} canEdit={canEdit} save={save} />+ <Amounts item={item} tripId={tripId} canEdit={canEdit} bagTrackingEnabled={bagTrackingEnabled} save={save} />+ {bagTrackingEnabled && (+ <BagChoice item={item} bags={bags} canEdit={canEdit} onCreateBag={onCreateBag} save={save} />+ )}++ {(bringers || sharing || sharedToMe) && <div style={POPOVER_DIVIDER} />}+ {bringers && <Bringers item={item} members={tripMembers} onJoin={bringers.onJoin} onLeave={bringers.onLeave} />}+ {sharing && (+ <Visibility item={item} members={tripMembers} currentUserId={currentUserId} onSetSharing={sharing} />+ )}+ {sharedToMe && (+ <div className="px-2.5 py-1.5 text-caption text-content-muted">+ {t('packing.takenCareOf', { name: item.owner_username || '' })}+ </div>+ )}++ {canEdit && (+ <>+ <div style={POPOVER_DIVIDER} />+ {clone && (+ <PopoverItem+ icon={<Copy size={13} />}+ label={t('packing.cloneToMine')}+ onClick={() => {+ clone(item.id);+ onClose();+ }}+ />+ )}+ <PopoverItem+ icon={<Trash2 size={13} />}+ label={t('common.delete')}+ danger+ onClick={() => {+ onClose();+ onDelete();+ }}+ />+ </>+ )}+ </div>+ </>,+ document.body+ );+}diff --git a/client/src/components/Packing/PackingListPanel.test.tsx b/client/src/components/Packing/PackingListPanel.test.tsxindex ae15c9371..bbf1f8d23 100644--- a/client/src/components/Packing/PackingListPanel.test.tsx+++ b/client/src/components/Packing/PackingListPanel.test.tsx@@ -6,10 +6,17 @@ import { http, HttpResponse } from 'msw';import { server } from '../../../tests/helpers/msw/server';import { useAuthStore } from '../../store/authStore';import { useTripStore } from '../../store/tripStore';+import { useAddonStore } from '../../store/addonStore';import { resetAllStores, seedStore } from '../../../tests/helpers/store';import { buildUser, buildAdmin, buildTrip, buildPackingItem } from '../../../tests/helpers/factories';import PackingListPanel, { itemWeight } from './PackingListPanel';+/** Opens an item's window from its name and scopes the queries to it. */+function openItem(name: string) {+ fireEvent.click(screen.getByText(name));+ return within(screen.getByRole('dialog'));+}+describe('itemWeight (bag total weight calc)', () => {it('FE-COMP-PACKING-030: multiplies unit weight by quantity', () => {expect(itemWeight({ weight_grams: 120, quantity: 3 })).toBe(360);@@ -185,8 +192,7 @@ describe('PackingListPanel', () => {expect(await screen.findByPlaceholderText('List name (e.g. Clothing)')).toBeInTheDocument();});- it('FE-COMP-PACKING-016: delete item button exists and triggers API call', async () => {- const user = userEvent.setup();+ it('FE-COMP-PACKING-016: an item is deleted from its window', async () => {// Uncategorized item: deleting it is a plain DELETE (a custom category's last// item is instead converted to a placeholder — see FE-COMP-PACKING-070).const item = buildPackingItem({ id: 99, name: 'To Remove', category: null });@@ -198,90 +204,69 @@ describe('PackingListPanel', () => {}));render(<PackingListPanel tripId={1} items={[item]} />);- expect(screen.getByText('To Remove')).toBeInTheDocument();- // Delete button is in the DOM (opacity 0 on desktop but exists)- const deleteBtn = screen.getByTitle('Delete');- await user.click(deleteBtn);+ // The row holds no delete button of its own any more.+ expect(screen.queryByTitle('Delete')).toBeNull();+ fireEvent.click(openItem('To Remove').getByRole('button', { name: 'Delete' }));await waitFor(() => expect(deleteCalled).toBe(true));});- it('FE-COMP-PACKING-017: shows filter buttons (All, Open, Done) when items exist', () => {+ it('FE-COMP-PACKING-017: the row above the lists carries no filter or sort pills', () => {const items = [buildPackingItem({ name: 'Shirt', category: 'Clothing' })];render(<PackingListPanel tripId={1} items={items} />);- expect(screen.getByText('All')).toBeInTheDocument();- expect(screen.getByText('Open')).toBeInTheDocument();- expect(screen.getByText('Done')).toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Open' })).toBeNull();+ expect(screen.queryByRole('button', { name: 'Done' })).toBeNull();+ expect(screen.queryByRole('button', { name: 'A to Z' })).toBeNull();});- it('FE-COMP-PACKING-018: filtering to Done hides unchecked items', async () => {- const user = userEvent.setup();+ it('FE-COMP-PACKING-018: hiding packed items leaves the open ones', () => {const items = [buildPackingItem({ name: 'Done Item', checked: 1, category: 'Test' }),buildPackingItem({ name: 'Open Item', checked: 0, category: 'Test' }),];- render(<PackingListPanel tripId={1} items={items} />);- await user.click(screen.getByText('Done'));- expect(screen.getByText('Done Item')).toBeInTheDocument();- expect(screen.queryByText('Open Item')).not.toBeInTheDocument();+ render(<PackingListPanel tripId={1} items={items} hideDone />);+ expect(screen.queryByText('Done Item')).not.toBeInTheDocument();+ expect(screen.getByText('Open Item')).toBeInTheDocument();});- it('FE-COMP-PACKING-019: filtering to Open hides checked items', async () => {- const user = userEvent.setup();+ it('FE-COMP-PACKING-019: without hiding, packed and open items both show', () => {const items = [buildPackingItem({ name: 'Done Item', checked: 1, category: 'Test' }),buildPackingItem({ name: 'Open Item', checked: 0, category: 'Test' }),];- render(<PackingListPanel tripId={1} items={items} />);- await user.click(screen.getByText('Open'));- expect(screen.queryByText('Done Item')).not.toBeInTheDocument();+ render(<PackingListPanel tripId={1} items={items} hideDone={false} />);+ expect(screen.getByText('Done Item')).toBeInTheDocument();expect(screen.getByText('Open Item')).toBeInTheDocument();});- it('FE-COMP-PACKING-020: renders empty filter message when filter yields nothing', async () => {- const user = userEvent.setup();- const items = [- buildPackingItem({ name: 'Open Item', checked: 0, category: 'Test' }),- ];- render(<PackingListPanel tripId={1} items={items} />);- await user.click(screen.getByText('Done'));+ it('FE-COMP-PACKING-020: renders the empty filter message when everything is packed and hidden', () => {+ const items = [buildPackingItem({ name: 'Done Item', checked: 1, category: 'Test' })];+ render(<PackingListPanel tripId={1} items={items} hideDone />);expect(screen.getByText('No items match this filter')).toBeInTheDocument();});- it('FE-COMP-PACKING-093: the A to Z switch sorts each list by name and a second click restores the manual order', async () => {- const user = userEvent.setup();+ it('FE-COMP-PACKING-093: sorted by name each list reads A to Z, and the manual order comes back', () => {const items = [buildPackingItem({ id: 1, name: 'Toothbrush', category: 'Bag' }),buildPackingItem({ id: 2, name: 'adapter', category: 'Bag' }),buildPackingItem({ id: 3, name: 'Shirt', category: 'Bag' }),];- render(<PackingListPanel tripId={1} items={items} />);+ const { rerender } = render(<PackingListPanel tripId={1} items={items} sort="name" />);const order = () => ['Toothbrush', 'adapter', 'Shirt'].map(n => [n, screen.getByText(n)] as const).sort(([, a], [, b]) => (a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1)).map(([n]) => n);- const toggle = screen.getByRole('button', { name: 'A to Z' });-- expect(order()).toEqual(['Toothbrush', 'adapter', 'Shirt']);- expect(toggle).toHaveAttribute('aria-pressed', 'false');- await user.click(toggle);expect(order()).toEqual(['adapter', 'Shirt', 'Toothbrush']);- expect(toggle).toHaveAttribute('aria-pressed', 'true');- expect(localStorage.getItem('trek:packing-sort')).toBe('name');-- await user.click(toggle);+ rerender(<PackingListPanel tripId={1} items={items} sort="manual" />);expect(order()).toEqual(['Toothbrush', 'adapter', 'Shirt']);- expect(localStorage.getItem('trek:packing-sort')).toBe('manual');});- it('FE-COMP-PACKING-094: sorted A to Z the rows cannot be dragged, and the choice is remembered', () => {- localStorage.setItem('trek:packing-sort', 'name');+ it('FE-COMP-PACKING-094: sorted A to Z the rows cannot be dragged', () => {const items = [buildPackingItem({ id: 1, name: 'Toothbrush', category: 'Bag' }),buildPackingItem({ id: 2, name: 'adapter', category: 'Bag' }),];- const { container } = render(<PackingListPanel tripId={1} items={items} />);- expect(screen.getByRole('button', { name: 'A to Z' })).toHaveAttribute('aria-pressed', 'true');+ const { container } = render(<PackingListPanel tripId={1} items={items} sort="name" />);// Only the category grip stays: the order of the categories is not the A to Z of their items.const draggable = [...container.querySelectorAll('[draggable="true"]')];expect(draggable.map((el) => el.getAttribute('aria-label'))).toEqual(['Drag to reorder the category']);@@ -373,8 +358,8 @@ describe('PackingListPanel', () => {);render(<PackingListPanel tripId={1} items={[item]} />);- // Find the quantity input showing '2'- const qtyInput = screen.getByDisplayValue('2');+ // The amount is typed in the item's window+ const qtyInput = openItem('T-Shirts').getByDisplayValue('2');await user.clear(qtyInput);await user.type(qtyInput, '5');await user.tab(); // blur triggers commit@@ -721,7 +706,7 @@ describe('PackingListPanel', () => {expect(screen.getByText(/Import 1/)).toBeInTheDocument();});- it('FE-COMP-PACKING-044: bag item row shows weight input and bag button when bag tracking enabled', async () => {+ it('FE-COMP-PACKING-044: with bag tracking the weight is set in the item window, not the row', async () => {server.use(http.get('/api/addons', () =>HttpResponse.json({ bagTracking: true, addons: [] })@@ -733,13 +718,12 @@ describe('PackingListPanel', () => {const items = [buildPackingItem({ name: 'Laptop', category: 'Tech' })];const { container } = render(<PackingListPanel tripId={1} items={items} />);- // Wait for bag tracking to enable (weight input 'g' label appears)- await waitFor(() => {- expect(container.querySelector('input[placeholder="—"]')).toBeTruthy();- });-- // The 'g' gram label appears next to the weight input- expect(container.querySelector('span[style*="g"]')).toBeTruthy();+ // The row stays quiet; the weight field is in the item's window+ await waitFor(() => expect(useAddonStore.getState().bagTracking).toBe(true));+ expect(container.querySelector('input[placeholder="—"]')).toBeNull();+ const dialog = openItem('Laptop');+ expect(dialog.getByPlaceholderText('—')).toBeInTheDocument();+ expect(dialog.getByText('g')).toBeInTheDocument();});it('FE-COMP-PACKING-045: "Remove checked" button appears when checked items exist', async () => {@@ -799,7 +783,7 @@ describe('PackingListPanel', () => {await waitFor(() => expect(savedTemplateName).toBe('My Template'));});- it('FE-COMP-PACKING-047: bag picker in item row opens when clicked with bag tracking enabled', async () => {+ it('FE-COMP-PACKING-047: the bag choice in the item window lists the trip bags', async () => {const user = userEvent.setup();server.use(http.get('/api/addons', () =>@@ -812,20 +796,12 @@ describe('PackingListPanel', () => {const items = [buildPackingItem({ name: 'Laptop', category: 'Tech' })];const { container } = render(<PackingListPanel tripId={1} items={items} />);- // Wait for bag tracking to enable (Package icon button in item row)- await waitFor(() => {- expect(container.querySelector('svg.lucide-package')).toBeTruthy();- });-- // Click the bag button (Package icon) to open bag picker- const packageBtn = container.querySelector('svg.lucide-package')?.closest('button');- expect(packageBtn).toBeTruthy();- await user.click(packageBtn!);-- // Bag picker dropdown shows the bag name (may also appear in sidebar)- await waitFor(() => {- expect(screen.getAllByText('Carry-on').length).toBeGreaterThan(0);- });+ await waitFor(() => expect(useAddonStore.getState().bagTracking).toBe(true));+ expect(container).toBeTruthy();+ await user.click(screen.getByText('Laptop'));+ const dialog = within(await screen.findByRole('dialog'));+ await user.click(dialog.getByRole('button', { name: /Unassigned/ }));+ expect(await dialog.findByRole('button', { name: /Carry-on/ })).toBeInTheDocument();});it('FE-COMP-PACKING-048: add bag in bag modal opens form when "Add bag" clicked', async () => {@@ -885,13 +861,9 @@ describe('PackingListPanel', () => {const items = [buildPackingItem({ id: itemId, name: 'Camera', category: 'Electronics' })];const { container } = render(<PackingListPanel tripId={1} items={items} />);- // Wait for weight input to appear (bag tracking enabled)- await waitFor(() => {- expect(container.querySelector('input[placeholder="—"]')).toBeTruthy();- });-- // Change the weight input value- const weightInput = container.querySelector('input[placeholder="—"]') as HTMLInputElement;+ await waitFor(() => expect(useAddonStore.getState().bagTracking).toBe(true));+ expect(container).toBeTruthy();+ const weightInput = openItem('Camera').getByPlaceholderText('—');await user.clear(weightInput);await user.type(weightInput, '500');await user.tab(); // blur to trigger change@@ -901,25 +873,18 @@ describe('PackingListPanel', () => {});});- it('FE-COMP-PACKING-050: ArtikelZeile category change picker opens on dot button click', async () => {+ it('FE-COMP-PACKING-050: the List choice in the item window offers the other lists', async () => {const user = userEvent.setup();const item = buildPackingItem({ name: 'Camera', category: 'Electronics' });const item2 = buildPackingItem({ name: 'Passport', category: 'Documents' });const { container } = render(<PackingListPanel tripId={1} items={[item, item2]} />);- // The category change picker is triggered by a small dot button (no title)- // It's rendered inside the action buttons group (sm:opacity-0 sm:group-hover:opacity-100)- // In jsdom, CSS classes don't apply so the buttons are accessible- // The dot button has a circle span inside with category color- // Find all buttons with the 'Move to List' title- // Moving an item goes through its menu: the three dots, then Move to List.- await user.click(container.querySelector<HTMLButtonElement>('.packing-row-overflow button')!);- await user.click(screen.getByText('Move to List'));-- // Category picker shows both category names- await waitFor(() => {- expect(screen.getAllByText('Electronics').length).toBeGreaterThan(0);- });+ expect(container).toBeTruthy();+ // Moving an item goes through the List choice of its window.+ await user.click(screen.getByText('Camera'));+ const dialog = within(await screen.findByRole('dialog'));+ await user.click(dialog.getByRole('button', { name: /Electronics/ }));+ expect(await dialog.findByRole('button', { name: /Documents/ })).toBeInTheDocument();});it('FE-COMP-PACKING-051: bag assignment from picker calls PUT with bag_id', async () => {@@ -941,25 +906,12 @@ describe('PackingListPanel', () => {const items = [buildPackingItem({ id: itemId, name: 'Shoes', category: 'Clothing' })];const { container } = render(<PackingListPanel tripId={1} items={items} />);- // Wait for bag tracking to enable (Package icon appears)- await waitFor(() => {- expect(container.querySelector('svg.lucide-package')).toBeTruthy();- });-- // Use fireEvent (no pointer events) to open the picker without triggering mouseLeave- const packageBtn = container.querySelector('svg.lucide-package')?.closest('button');- fireEvent.click(packageBtn!);-- // Picker is open - find "Trolley" button inside the dropdown. The bag- // sidebar carries the same name on its own button, so scope the query to- // the picker, which opens in a portal on the body.- const picker = await waitFor(() => {- const el = document.body.querySelector<HTMLElement>(':scope > .trek-menu-enter');- if (!el) throw new Error('bag picker not open yet');- return el;- });- const trolleyBtn = await within(picker).findByRole('button', { name: /Trolley/ });- fireEvent.click(trolleyBtn);+ await waitFor(() => expect(useAddonStore.getState().bagTracking).toBe(true));+ expect(container).toBeTruthy();+ // The bag sidebar carries the same name, so the query stays inside the window.+ const dialog = openItem('Shoes');+ fireEvent.click(dialog.getByRole('button', { name: /Unassigned/ }));+ fireEvent.click(await dialog.findByRole('button', { name: /Trolley/ }));await waitFor(() => expect(putBody).toMatchObject({ bag_id: 7 }));});@@ -1081,7 +1033,7 @@ describe('PackingListPanel', () => {);render(<PackingListPanel tripId={1} items={[item]} />);- const qtyInput = screen.getByDisplayValue('3');+ const qtyInput = openItem('Socks').getByDisplayValue('3');await user.clear(qtyInput);await user.type(qtyInput, '7');await user.keyboard('{Enter}');@@ -1089,7 +1041,7 @@ describe('PackingListPanel', () => {await waitFor(() => expect(putBody).toMatchObject({ quantity: 7 }));});- it('FE-COMP-PACKING-057: clicking unchecked item name enters inline edit mode', async () => {+ it('FE-COMP-PACKING-057: clicking an item name opens its window with the name ready to edit', async () => {const user = userEvent.setup();const item = buildPackingItem({ id: 73, name: 'Jacket', checked: 0, category: 'Clothing' });render(<PackingListPanel tripId={1} items={[item]} />);@@ -1115,15 +1067,12 @@ describe('PackingListPanel', () => {return HttpResponse.json({ item: buildPackingItem({ id: 74, category: 'Documents' }) });}));- const { container } = render(<PackingListPanel tripId={1} items={[itemA, itemB]} />);+ render(<PackingListPanel tripId={1} items={[itemA, itemB]} />);- // Open the first item's menu and its Move to List entry- fireEvent.click(container.querySelector<HTMLButtonElement>('.packing-row-overflow button')!);- fireEvent.click(screen.getByText('Move to List'));-- // Picker shows available categories — find and click the 'Documents' button (role=button, text=Documents)- const docBtn = await screen.findByRole('button', { name: 'Documents' });- fireEvent.click(docBtn);+ // The List choice of the item's window opens the lists to move it to+ const dialog = openItem('Camera');+ fireEvent.click(dialog.getByRole('button', { name: /Electronics/ }));+ fireEvent.click(await dialog.findByRole('button', { name: /Documents/ }));await waitFor(() => expect(putBody).toMatchObject({ category: 'Documents' }));});@@ -1518,7 +1467,7 @@ describe('PackingListPanel', () => {await waitFor(() => expect(membersBody).toMatchObject({ user_ids: [3] }));});- it('FE-COMP-PACKING-068: inline bag create in item row picker creates bag and assigns it', async () => {+ it('FE-COMP-PACKING-068: a bag created from the item window is assigned right away', async () => {let createBody: Record<string, unknown> | null = null;server.use(http.get('/api/addons', () => HttpResponse.json({ bagTracking: true, addons: [] })),@@ -1532,21 +1481,12 @@ describe('PackingListPanel', () => {));const items = [buildPackingItem({ id: 150, name: 'Sunglasses', category: 'Accessories' })];- const { container } = render(<PackingListPanel tripId={1} items={items} />);-- // Wait for Package icon (bag button in item row)- await waitFor(() => expect(container.querySelector('svg.lucide-package')).toBeTruthy());-- // Use fireEvent to open picker (avoids mouseLeave pointer events)- const packageBtn = container.querySelector('svg.lucide-package')?.closest('button');- fireEvent.click(packageBtn!);-- // Click "Add bag" inside picker to show inline create- const addBagInPickerBtns = await screen.findAllByText('Add bag');- fireEvent.click(addBagInPickerBtns[addBagInPickerBtns.length - 1]);+ render(<PackingListPanel tripId={1} items={items} />);- // Inline input appears in picker- const inlineInput = await screen.findByPlaceholderText('Bag name...');+ await waitFor(() => expect(useAddonStore.getState().bagTracking).toBe(true));+ const dialog = openItem('Sunglasses');+ fireEvent.click(dialog.getByRole('button', { name: /Unassigned/ }));+ const inlineInput = dialog.getByRole('textbox', { name: 'Bag name...' });fireEvent.change(inlineInput, { target: { value: 'New Bag' } });fireEvent.keyDown(inlineInput, { key: 'Enter' });@@ -1607,36 +1547,23 @@ describe('PackingListPanel', () => {);render(<PackingListPanel tripId={1} items={[item]} />);- await user.click(screen.getByTitle('Delete'));+ await user.click(screen.getByText('Tent'));+ await user.click(within(await screen.findByRole('dialog')).getByRole('button', { name: 'Delete' }));// The row is updated in place (same id) rather than deleted, so colour/position hold.await waitFor(() => expect(putBody).toMatchObject({ name: '...' }));expect(deleted).toBe(false);});- it('FE-COMP-PACKING-071: deleting the placeholder row deletes it, dismissing the empty category (#1289)', async () => {- const user = userEvent.setup();+ it('FE-COMP-PACKING-071: the placeholder row of an empty list is typed into, not opened (#1289)', () => {const placeholder = buildPackingItem({ id: 5, name: '...', category: 'Camping Gear' });seedStore(useTripStore, { packingItems: [placeholder] });- let deleted = false;- let converted = false;- server.use(- http.delete('/api/trips/1/packing/5', () => {- deleted = true;- return HttpResponse.json({ success: true });- }),- http.put('/api/trips/1/packing/5', () => {- converted = true;- return HttpResponse.json({ item: placeholder });- })- );render(<PackingListPanel tripId={1} items={[placeholder]} />);- await user.click(screen.getByTitle('Delete'));-- await waitFor(() => expect(deleted).toBe(true));- // It is the placeholder itself — it must be removed, not re-converted.- expect(converted).toBe(false);+ // The empty list goes with its own menu; the placeholder has no window or delete of its own.+ expect(screen.getByPlaceholderText('...')).toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Delete' })).toBeNull();+ expect(screen.queryByRole('dialog')).toBeNull();});it('FE-COMP-PACKING-072: adding an item to an empty category reuses the placeholder row instead of appending (#1289)', async () => {@@ -1706,16 +1633,48 @@ describe('PackingListPanel — under the Lists bar', () => {seedStore(useTripStore, { trip: buildTrip({ id: 1 }) });});- it('FE-COMP-PACKING-090: the clean-up sits in the progress card and clears what is ticked', async () => {+ it('FE-COMP-PACKING-090: the progress sits in the view row and the clean-up comes from the Lists menu', async () => {vi.spyOn(window, 'confirm').mockReturnValue(true);let deleted = false;server.use(http.delete('/api/trips/1/packing/91', () => { deleted = true; return HttpResponse.json({ success: true }); }));- render(<PackingListPanel tripId={1} inlineHeader={false} items={[buildPackingItem({ id: 91, name: 'Towel', checked: 1 }), buildPackingItem({ id: 92, name: 'Soap' })]} />);+ const items = [buildPackingItem({ id: 91, name: 'Towel', checked: 1 }), buildPackingItem({ id: 92, name: 'Soap' })];+ const { rerender } = render(<PackingListPanel tripId={1} inlineHeader={false} items={items} clearCheckedSignal={0} />);- fireEvent.click(screen.getByRole('button', { name: 'Remove 1 checked' }));- await waitFor(() => expect(deleted).toBe(true));+ expect(screen.getByText('1 of 2 packed')).toBeInTheDocument();+ expect(screen.queryByRole('button', { name: 'Remove 1 checked' })).toBeNull();// No dashed Add list under the bar: the Lists bar carries it.expect(screen.queryByRole('button', { name: 'Add list' })).toBeNull();++ rerender(<PackingListPanel tripId={1} inlineHeader={false} items={items} clearCheckedSignal={1} />);+ await waitFor(() => expect(deleted).toBe(true));+ });++ it('FE-COMP-PACKING-090b: a declined clean-up from the menu deletes nothing', async () => {+ vi.spyOn(window, 'confirm').mockReturnValue(false);+ let deleted = false;+ server.use(http.delete('/api/trips/1/packing/91', () => { deleted = true; return HttpResponse.json({ success: true }); }));+ const items = [buildPackingItem({ id: 91, name: 'Towel', checked: 1 })];+ const { rerender } = render(<PackingListPanel tripId={1} inlineHeader={false} items={items} clearCheckedSignal={0} />);+ rerender(<PackingListPanel tripId={1} inlineHeader={false} items={items} clearCheckedSignal={1} />);+ expect(window.confirm).toHaveBeenCalled();+ expect(deleted).toBe(false);+ // Everything packed reads as done.+ expect(screen.getByText('All packed!')).toBeInTheDocument();+ });++ it('FE-COMP-PACKING-090c: the menu opens the bag overview on a narrow screen', async () => {+ server.use(+ http.get('/api/addons', () => HttpResponse.json({ bagTracking: true, addons: [] })),+ http.get('/api/trips/:id/packing/bags', () =>+ HttpResponse.json({ bags: [{ id: 1, name: 'Main Bag', color: '#6366f1', weight_limit_grams: null, members: [] }] })+ ),+ );+ const items = [buildPackingItem({ id: 92, name: 'Soap' })];+ const { rerender } = render(<PackingListPanel tripId={1} inlineHeader={false} items={items} openBagsSignal={0} />);+ await waitFor(() => expect(useAddonStore.getState().bagTracking).toBe(true));+ const before = (await screen.findAllByText('Main Bag')).length;+ rerender(<PackingListPanel tripId={1} inlineHeader={false} items={items} openBagsSignal={1} />);+ await waitFor(() => expect(screen.getAllByText('Main Bag').length).toBeGreaterThan(before));});it('FE-COMP-PACKING-091: a raised add-list signal opens the name dialog, which creates the list', async () => {diff --git a/client/src/components/Packing/PackingListPanelCategoryGroup.test.tsx b/client/src/components/Packing/PackingListPanelCategoryGroup.test.tsxindex 8aa0c8680..f7aa08631 100644--- a/client/src/components/Packing/PackingListPanelCategoryGroup.test.tsx+++ b/client/src/components/Packing/PackingListPanelCategoryGroup.test.tsx@@ -489,7 +489,7 @@ describe('KategorieGruppe — inline add item', () => {server.use(http.put('/api/trips/1/packing/1', () => HttpResponse.json({ item: buildPackingItem({ id: 1, name: 'Tent', category: 'Gear' }) })))setup({ items: [buildPackingItem({ id: 1, name: '...', category: 'Gear' })] })- fireEvent.click(screen.getByText('...'))+ // The placeholder row is a field from the start.fireEvent.change(screen.getByPlaceholderText('...'), { target: { value: 'Tent' } })fireEvent.keyDown(screen.getByPlaceholderText('...'), { key: 'Enter' })@@ -519,13 +519,17 @@ describe('KategorieGruppe — inline add item', () => {expect(screen.queryByPlaceholderText('Item name...')).toBeNull()})- it('FE-W5CAT-030: the X button closes the inline form', () => {+ it('FE-W5CAT-030: an empty field closes when it loses focus, a typed one stays', () => {const { container } = setup()fireEvent.click(screen.getByText('Add item'))- fireEvent.change(screen.getByPlaceholderText('Item name...'), { target: { value: 'Rope' } })+ expect(container.querySelector('svg.lucide-x')).toBeNull()- fireEvent.click(container.querySelector('svg.lucide-x')!.closest('button')!)+ fireEvent.change(screen.getByPlaceholderText('Item name...'), { target: { value: 'Rope' } })+ fireEvent.blur(screen.getByPlaceholderText('Item name...'))+ expect(screen.getByPlaceholderText('Item name...')).toBeInTheDocument()+ fireEvent.change(screen.getByPlaceholderText('Item name...'), { target: { value: ' ' } })+ fireEvent.blur(screen.getByPlaceholderText('Item name...'))expect(screen.queryByPlaceholderText('Item name...')).toBeNull()})diff --git a/client/src/components/Packing/PackingListPanelCategoryGroup.tsx b/client/src/components/Packing/PackingListPanelCategoryGroup.tsxindex d8f87996a..aa6ecd70e 100644--- a/client/src/components/Packing/PackingListPanelCategoryGroup.tsx+++ b/client/src/components/Packing/PackingListPanelCategoryGroup.tsx@@ -4,14 +4,14 @@ import { useToast } from '../shared/Toast'import { useTranslation } from '../../i18n'import {Trash2, Plus, ChevronDown, ChevronRight,- X, Pencil, Check, MoreHorizontal, CheckCheck, RotateCcw, UserPlus, GripVertical, Share2,+ Pencil, Check, MoreHorizontal, CheckCheck, RotateCcw, UserPlus, GripVertical, Share2,} from 'lucide-react'import type { PackingItem, PackingBag } from '../../types'import { katColor } from './packingListPanel.helpers'import type { TripMember, CategoryAssignee } from './usePackingListPanel'import { ArtikelZeile } from './PackingListPanelItemRow'import { PopoverItem } from './PackingPopover'-import { COMPOSER, POPOVER, POPOVER_DIVIDER, composerConfirm } from './packingPopoverStyles'+import { POPOVER, POPOVER_DIVIDER } from './packingPopoverStyles'import { usePluginViewContributions, PluginCardFooter } from '../Plugins/PluginContributions'import GuestBadge from '../shared/GuestBadge'@@ -312,10 +312,11 @@ export function KategorieGruppe({ kategorie, items, tripId, allCategories, onRen})}{/* Inline add item */}{canEdit && (showAddItem ? (- // The new item already looks like a row: an empty box in the checkbox- // column, the name typed where names sit, and the add as the accent.- <div style={{ ...COMPOSER, gap: 9, margin: '6px 4px 0', paddingBlock: 4, paddingInlineEnd: 4, paddingInlineStart: 27 }}>- <span aria-hidden style={{ width: 20, height: 20, borderRadius: 6, border: '1.5px solid var(--text-faint)', opacity: 0.6, flexShrink: 0 }} />+ // The add row turns into the field in place: same tint, same size, no+ // frame, an empty box where the new item's box will be, and the add as+ // the accent at the end.+ <div style={{ display: 'flex', alignItems: 'center', gap: 9, margin: '6px 4px 0', minHeight: 36, paddingBlock: 4, paddingInlineEnd: 8, paddingInlineStart: 28, borderRadius: 10, background: 'var(--bg-secondary)' }}>+ <span aria-hidden style={{ width: 20, height: 20, borderRadius: 6, border: '1.5px solid var(--text-faint)', flexShrink: 0 }} /><inputref={addItemRef}autoFocus@@ -329,18 +330,16 @@ export function KategorieGruppe({ kategorie, items, tripId, allCategories, onRen}if (e.key === 'Escape') { setShowAddItem(false); setNewItemName('') }}}+ onBlur={() => { if (!newItemName.trim()) { setShowAddItem(false); setNewItemName('') } }}placeholder={t('packing.addItemPlaceholder')}- style={{ flex: 1, minWidth: 0, padding: '5px 0', border: 'none', fontSize: 'calc(13.5px * var(--fs-scale-body, 1))', fontWeight: 500, fontFamily: 'inherit', outline: 'none', color: 'var(--text-primary)', background: 'transparent' }}+ style={{ flex: 1, minWidth: 0, padding: 0, border: 'none', boxShadow: 'none', fontSize: 'calc(13.5px * var(--fs-scale-body, 1))', fontWeight: 500, fontFamily: 'inherit', outline: 'none', color: 'var(--text-primary)', background: 'transparent' }}/>- {/* disabled while the field is empty, so no extra guard here */}+ {/* A small round add, dark once there is something to add; an empty+ field simply closes when the pointer goes elsewhere. */}<button type="button" onClick={() => { void onAddItem(kategorie, newItemName.trim()); setNewItemName(''); setTimeout(() => addItemRef.current?.focus(), 30) }}disabled={!newItemName.trim()} aria-label={t('common.add')}- style={composerConfirm(!!newItemName.trim())}>- <Plus size={15} strokeWidth={2.5} />- </button>- <button type="button" onClick={() => { setShowAddItem(false); setNewItemName('') }} aria-label={t('common.cancel')}- style={{ width: 28, height: 28, borderRadius: 8, border: 'none', background: 'none', cursor: 'pointer', display: 'grid', placeItems: 'center', flexShrink: 0, color: 'var(--text-faint)' }}>- <X size={14} />+ className={`grid size-6 shrink-0 place-items-center rounded-full border-0 transition-colors ${newItemName.trim() ? 'cursor-pointer bg-accent text-accent-text' : 'cursor-default bg-transparent text-content-faint'}`}>+ <Plus size={13} strokeWidth={2.5} /></button></div>) : (diff --git a/client/src/components/Packing/PackingListPanelHeader.tsx b/client/src/components/Packing/PackingListPanelHeader.tsxindex c95f7dfde..e6f9b008a 100644--- a/client/src/components/Packing/PackingListPanelHeader.tsx+++ b/client/src/components/Packing/PackingListPanelHeader.tsx@@ -1,5 +1,5 @@import {- CheckCheck, Luggage, Package, FolderPlus, Download, Trash2, ListPlus, BookmarkPlus,+ CheckCheck, Luggage, Package, FolderPlus, Download, ListPlus, BookmarkPlus,} from 'lucide-react'import type { PackingState } from './usePackingListPanel'import NameDialog from '../shared/NameDialog'@@ -15,7 +15,7 @@ export function PackingHeader(S: PackingState) {addingCategory, newCatName, setNewCatName, handleAddNewCategory, setAddingCategory,} = Sreturn (- <div style={{ padding: inlineHeader ? '20px 24px 16px' : '0 0 16px', flexShrink: 0, borderBottom: inlineHeader ? '1px solid rgba(0,0,0,0.06)' : undefined }}>+ <div style={{ padding: inlineHeader ? '20px 24px 16px' : 0, flexShrink: 0, borderBottom: inlineHeader ? '1px solid rgba(0,0,0,0.06)' : undefined }}><div style={{ display: 'flex', alignItems: inlineHeader ? 'flex-start' : 'center', justifyContent: 'space-between', gap: 14 }}>{inlineHeader ? (<div>@@ -86,7 +86,7 @@ export function PackingHeader(S: PackingState) {<FolderPlus size={12} /> <span className="hidden sm:inline">{t('packing.saveAsTemplate')}</span></button>)}- {bagTrackingEnabled && (+ {inlineHeader && bagTrackingEnabled && (<button type="button" onClick={() => setShowBagModal(true)} className="xl:!hidden"style={{display: 'flex', alignItems: 'center', gap: 5, padding: '5px 11px', borderRadius: 99,@@ -101,8 +101,9 @@ export function PackingHeader(S: PackingState) {</div></div>- {items.length > 0 && (+ {inlineHeader && items.length > 0 && (// The phone's progress card: count and share on the left, the bar filling the rest.+ // Under the Lists bar the progress sits in the view row and the clean-up in the Lists menu.<div className="hidden sm:block" style={{ marginTop: 14, marginBottom: 2, padding: '14px 18px', borderRadius: 16, background: 'var(--bg-card)', border: '1px solid var(--border-secondary)' }}><div className="flex items-center" style={{ gap: 16 }}>{fortschritt === 100 ? (@@ -166,17 +167,6 @@ export function PackingHeader(S: PackingState) {</div></div>- {/* Under the Lists bar the clean-up sits with the count it clears. */}- {!inlineHeader && canEdit && abgehakt > 0 && (- <button type="button" onClick={handleClearChecked} style={{- display: 'inline-flex', alignItems: 'center', gap: 5, flexShrink: 0, padding: '5px 11px', borderRadius: 99,- border: 'none', background: 'rgba(239,68,68,0.1)', color: '#ef4444', cursor: 'pointer', fontFamily: 'inherit',- fontSize: 'calc(12px * var(--fs-scale-body, 1))', fontWeight: 600,- }}>- <Trash2 size={13} strokeWidth={2.2} />- {t('packing.clearChecked', { count: abgehakt })}- </button>- )}</div></div>)}diff --git a/client/src/components/Packing/PackingListPanelItemRow.test.tsx b/client/src/components/Packing/PackingListPanelItemRow.test.tsxindex fb9730ba1..eb9c06f89 100644--- a/client/src/components/Packing/PackingListPanelItemRow.test.tsx+++ b/client/src/components/Packing/PackingListPanelItemRow.test.tsx@@ -1,4 +1,4 @@-// FE-W5ROW-001 to FE-W5ROW-059+// FE-W5ROW-001 to FE-W5ROW-030import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest'import type { ComponentProps } from 'react'import { http, HttpResponse } from 'msw'@@ -9,18 +9,13 @@ import { buildUser, buildTrip, buildPackingItem } from '../../../tests/helpers/fimport { useAuthStore } from '../../store/authStore'import { useTripStore } from '../../store/tripStore'import { ArtikelZeile } from './PackingListPanelItemRow'-import type { PackingBag, PackingItem } from '../../types'+import type { PackingItem } from '../../types'import type { TripMember } from './usePackingListPanel'type Props = ComponentProps<typeof ArtikelZeile>const toastSpy = vi.fn((_message: string, _type?: string, _duration?: number) => 0)-const BAGS = [- { id: 7, name: 'Carry-on', color: '#10b981' },- { id: 8, name: 'Trolley', color: '#ec4899' },-] as unknown as PackingBag[]-const MEMBERS = [{ id: 1, username: 'owner' },{ id: 2, username: 'alice' },@@ -41,36 +36,10 @@ function setup(overrides: Partial<Props> = {}) {return { ...utils, props }}-/** The row's own overflow menu trigger (rendered but display:none on desktop). */-function overflowTrigger(container: HTMLElement) {- return container.querySelector<HTMLButtonElement>('.packing-row-overflow button')!-}--/**- * The overflow menu lives inside a display:none wrapper (it only shows on narrow- * viewports), so every query against it has to opt into hidden elements.- */-function menu(container: HTMLElement) {- return within(container.querySelector<HTMLElement>('.trek-menu-enter')!)-}--function menuButton(container: HTMLElement, name: string) {- return menu(container).getByRole('button', { name, hidden: true })-}--function fieldOf(container: HTMLElement, label: string) {- return within(menu(container).getByText(label).parentElement!).getByRole('textbox', { hidden: true })-}--/** Opens the item menu and its Move to List entry. */-function openMoveToList(container: HTMLElement) {- fireEvent.click(overflowTrigger(container))- fireEvent.click(menuButton(container, 'Move to List'))-}--function bagButton(container: HTMLElement) {- // The bag picker trigger is the round button right after the weight field.- return container.querySelectorAll<HTMLButtonElement>('button[style*="border-radius: 50%"]')[0]+const row = (container: HTMLElement) => container.querySelector<HTMLElement>('.packing-item-row')!+const openWindow = (name = 'Tent') => {+ fireEvent.click(screen.getByText(name))+ return within(screen.getByRole('dialog'))}beforeEach(() => {@@ -86,7 +55,7 @@ afterEach(() => {vi.restoreAllMocks()})-describe('ArtikelZeile — basics', () => {+describe('ArtikelZeile — at rest', () => {it('FE-W5ROW-001: renders the name and checks the item off', async () => {let body: Record<string, unknown> | null = nullserver.use(@@ -105,302 +74,69 @@ describe('ArtikelZeile — basics', () => {await waitFor(() => expect(body).toMatchObject({ checked: true }))})- it('FE-W5ROW-002: a checked item is struck through and still renames on a click', () => {+ it('FE-W5ROW-002: a checked item is struck through', () => {setup({ item: buildPackingItem({ id: 1, name: 'Tent', checked: 1 }) })- const label = screen.getByText('Tent')-- expect(label).toHaveStyle({ textDecoration: 'line-through' })- fireEvent.click(label)-- expect(screen.getByDisplayValue('Tent')).toBeInTheDocument()- })-- it('FE-W5ROW-003: the placeholder row edits from an empty field', () => {- setup({ item: buildPackingItem({ id: 1, name: '...', category: 'Gear' }) })-- fireEvent.click(screen.getByText('...'))-- const input = screen.getByPlaceholderText('...')- expect(input).toHaveValue('')+ expect(screen.getByText('Tent')).toHaveStyle({ textDecoration: 'line-through' })})- it('FE-W5ROW-004: a read-only row hides the quantity field and the action buttons', () => {- const { container } = setup({ canEdit: false })-- expect(screen.queryByTitle('Rename')).toBeNull()- expect(screen.queryByTitle('Delete')).toBeNull()- expect(container.querySelector('.packing-row-overflow')).toBeNull()- fireEvent.click(screen.getByText('Tent'))- expect(screen.queryByDisplayValue('Tent')).toBeNull()- })-- it('FE-W5ROW-005: hovering the row lifts its background and brings its controls up', () => {+ it('FE-W5ROW-003: the row holds no inline controls, only what is set', () => {const { container } = setup()- const row = container.querySelector<HTMLElement>('.packing-item-row')!- const actions = container.querySelector<HTMLElement>('.packing-row-overflow')!- expect(actions.style.opacity).toBe('0.4')-- fireEvent.mouseEnter(row)- expect(row.style.background).toBe('var(--bg-secondary)')- expect(actions.style.opacity).toBe('1')-- fireEvent.mouseLeave(row)- expect(row.style.background).toBe('transparent')- expect(actions.style.opacity).toBe('0.4')- })-- it('FE-W5ROW-005b: keyboard focus inside the row counts as hovering it', () => {- const { container } = setup()- const actions = container.querySelector<HTMLElement>('.packing-row-overflow')!-- fireEvent.focus(overflowTrigger(container))- expect(actions.style.opacity).toBe('1')-- fireEvent.blur(overflowTrigger(container), { relatedTarget: document.body })- expect(actions.style.opacity).toBe('0.4')- })-- it('FE-W5ROW-005c: the bag picker stays open when the pointer leaves and closes on a click beside it', () => {- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS })- const row = container.querySelector<HTMLElement>('.packing-item-row')!- fireEvent.click(bagButton(container))- expect(screen.getByRole('button', { name: 'Trolley' })).toBeInTheDocument()-- fireEvent.mouseLeave(row)- expect(screen.getByRole('button', { name: 'Trolley' })).toBeInTheDocument()-- // The picker and its click catcher open in a portal on the body.- fireEvent.click(Array.from(document.body.children).find(el => el.getAttribute('role') === 'presentation')!)- expect(screen.queryByRole('button', { name: 'Trolley' })).toBeNull()- })-})--describe('ArtikelZeile — quantity', () => {- it('FE-W5ROW-005a: committing the inline quantity saves it', async () => {- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1, quantity: 3 }) })- }),- )- const { container } = setup({ item: buildPackingItem({ id: 1, name: 'Tent', quantity: null } as Partial<PackingItem>) })-- const qty = container.querySelector<HTMLInputElement>('.packing-row-inline-actions input')!- expect(qty).toHaveValue('1')- fireEvent.change(qty, { target: { value: '3' } })- fireEvent.blur(qty)-- await waitFor(() => expect(body).toMatchObject({ quantity: 3 }))- })-})--describe('ArtikelZeile — renaming', () => {- it('FE-W5ROW-006: Enter commits the new name', async () => {- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1, name: 'Tarp' }) })- }),- )- setup()- fireEvent.click(screen.getByText('Tent'))-- const input = screen.getByDisplayValue('Tent')- fireEvent.change(input, { target: { value: ' Tarp ' } })- fireEvent.keyDown(input, { key: 'Enter' })-- await waitFor(() => expect(body).toMatchObject({ name: 'Tarp' }))- })-- it('FE-W5ROW-007: blurring an emptied field restores the old name', async () => {- let called = false- server.use(http.put('/api/trips/1/packing/1', () => { called = true; return HttpResponse.json({ item: buildPackingItem() }) }))- setup()- fireEvent.click(screen.getByText('Tent'))-- const input = screen.getByDisplayValue('Tent')- fireEvent.change(input, { target: { value: ' ' } })- fireEvent.blur(input)-- await waitFor(() => expect(screen.queryByDisplayValue('Tent')).toBeNull())- expect(screen.getByText('Tent')).toBeInTheDocument()- expect(called).toBe(false)- })-- it('FE-W5ROW-008: Escape discards the edit', () => {- setup()- fireEvent.click(screen.getByText('Tent'))-- const input = screen.getByDisplayValue('Tent')- fireEvent.change(input, { target: { value: 'Tarp' } })- fireEvent.keyDown(input, { key: 'Escape' })-- expect(screen.queryByDisplayValue('Tarp')).toBeNull()- expect(screen.getByText('Tent')).toBeInTheDocument()- })-- it('FE-W5ROW-008a: a blanked placeholder row falls back to an empty field', async () => {- setup({ item: buildPackingItem({ id: 1, name: '...', category: 'Gear' }) })- fireEvent.click(screen.getByText('...'))-- const input = screen.getByPlaceholderText('...')- fireEvent.change(input, { target: { value: 'Tent' } })- fireEvent.keyDown(input, { key: 'Escape' })- fireEvent.click(screen.getByText('...'))- expect(screen.getByPlaceholderText('...')).toHaveValue('')-- fireEvent.change(screen.getByPlaceholderText('...'), { target: { value: ' ' } })- fireEvent.blur(screen.getByPlaceholderText('...'))-- await waitFor(() => expect(screen.getByText('...')).toBeInTheDocument())- })-- it('FE-W5ROW-008b: Enter on a filled placeholder row hands the typing on, a blur does not (#2825)', async () => {- server.use(http.put('/api/trips/1/packing/1', () => HttpResponse.json({ item: buildPackingItem({ id: 1, name: 'Tent' }) })))- const onPlaceholderFilled = vi.fn()- setup({ item: buildPackingItem({ id: 1, name: '...', category: 'Gear' }), onPlaceholderFilled })-- fireEvent.click(screen.getByText('...'))- fireEvent.change(screen.getByPlaceholderText('...'), { target: { value: 'Tent' } })- fireEvent.blur(screen.getByPlaceholderText('...'))- await waitFor(() => expect(screen.queryByPlaceholderText('...')).toBeNull())- expect(onPlaceholderFilled).not.toHaveBeenCalled()-- fireEvent.click(screen.getByText('...'))- fireEvent.change(screen.getByPlaceholderText('...'), { target: { value: 'Tent' } })- fireEvent.keyDown(screen.getByPlaceholderText('...'), { key: 'Enter' })- await waitFor(() => expect(onPlaceholderFilled).toHaveBeenCalledTimes(1))- })-- it('FE-W5ROW-009: a failing rename surfaces a save error', async () => {- server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))- setup()- fireEvent.click(screen.getByText('Tent'))-- fireEvent.change(screen.getByDisplayValue('Tent'), { target: { value: 'Tarp' } })- fireEvent.keyDown(screen.getByDisplayValue('Tarp'), { key: 'Enter' })-- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))- })-})--describe('ArtikelZeile — deleting', () => {- it('FE-W5ROW-010: the panel handler takes over when provided', async () => {- const onDelete = vi.fn(async () => {})- const { props } = setup({ onDelete })-- fireEvent.click(screen.getByTitle('Delete'))-- await waitFor(() => expect(onDelete).toHaveBeenCalledWith(props.item))- })-- it('FE-W5ROW-011: a standalone row deletes through the store', async () => {- let deleted = false- server.use(http.delete('/api/trips/1/packing/1', () => { deleted = true; return HttpResponse.json({ success: true }) }))- setup()-- fireEvent.click(screen.getByTitle('Delete'))-- await waitFor(() => expect(deleted).toBe(true))- })-- it('FE-W5ROW-012: a failing standalone delete surfaces a delete error', async () => {- server.use(http.delete('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))- setup()-- fireEvent.click(screen.getByTitle('Delete'))-- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to delete', 'error', undefined))- })-- it('FE-W5ROW-013: the delete button turns red on hover', () => {- setup()- const remove = screen.getByTitle('Delete')-- fireEvent.mouseEnter(remove)- expect(remove.style.color).toBe('rgb(239, 68, 68)')- fireEvent.mouseLeave(remove)- expect(remove.style.color).toBe('var(--text-faint)')+ expect(container.querySelectorAll('input')).toHaveLength(0)+ expect(screen.queryByTitle('Delete')).toBeNull()+ expect(screen.queryByText('×1')).toBeNull()})-})--describe('ArtikelZeile — category picker', () => {- it('FE-W5ROW-014: picking another list moves the item', async () => {- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1, category: 'Docs' }) })- }),- )- const { container } = setup()- openMoveToList(container)-- fireEvent.click(screen.getByRole('button', { name: 'Docs' }))- await waitFor(() => expect(body).toMatchObject({ category: 'Docs' }))- expect(screen.queryByRole('button', { name: 'Docs' })).toBeNull()+ it('FE-W5ROW-004: an amount from two up reads as ×n', () => {+ setup({ item: buildPackingItem({ id: 1, name: 'Socks', quantity: 5 }) })+ expect(screen.getByText('×5')).toBeInTheDocument()})- it('FE-W5ROW-015: picking the current list closes the picker without a request', async () => {- let called = false- server.use(http.put('/api/trips/1/packing/1', () => { called = true; return HttpResponse.json({ item: buildPackingItem() }) }))- const { container } = setup()- openMoveToList(container)-- fireEvent.click(screen.getByRole('button', { name: 'Gear' }))-- await waitFor(() => expect(screen.queryByRole('button', { name: 'Docs' })).toBeNull())- expect(called).toBe(false)+ it('FE-W5ROW-005: a partly packed item shows the pieces packed instead of the amount', () => {+ const { container } = setup({ item: buildPackingItem({ id: 1, name: 'Socks', quantity: 5, packed_quantity: 2 } as Partial<PackingItem>) })+ expect(screen.getByText('2/5')).toBeInTheDocument()+ expect(screen.queryByText('×5')).toBeNull()+ expect(container.querySelector<HTMLElement>('.packing-check')!.style.borderColor).toBe('var(--accent)')})- it('FE-W5ROW-016: a failing move surfaces a generic error', async () => {- server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))+ it('FE-W5ROW-006: hovering brings up the chevron, leaving puts it away', () => {const { container } = setup()- openMoveToList(container)-- fireEvent.click(screen.getByRole('button', { name: 'Docs' }))-- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Error', 'error', undefined))+ const chevron = container.querySelector<SVGElement>('svg.lucide-chevron-right')!+ expect(chevron.style.opacity).toBe('0')+ fireEvent.mouseEnter(row(container))+ expect(chevron.style.opacity).toBe('1')+ expect(row(container).style.background).toBe('var(--bg-secondary)')+ fireEvent.mouseLeave(row(container))+ expect(chevron.style.opacity).toBe('0')})- it('FE-W5ROW-017: an uncategorized item marks the default list as current', () => {- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Soap', category: null }),- categories: ['Other', 'Gear'],- })- openMoveToList(container)-- expect(screen.getByRole('button', { name: 'Other' })).toHaveStyle({ background: 'var(--bg-tertiary)' })- expect(screen.getByRole('button', { name: 'Gear' })).not.toHaveStyle({ background: 'var(--bg-tertiary)' })+ it('FE-W5ROW-007: the hairline shows only on rows after the first and hides under the pointer', () => {+ const { container } = setup({ divider: true })+ expect(container.querySelector('.bg-edge-faint')).not.toBeNull()+ fireEvent.mouseEnter(row(container))+ expect(container.querySelector('.bg-edge-faint')).toBeNull()})})-describe('ArtikelZeile — sharing badges', () => {- it('FE-W5ROW-018: an item somebody else brings shows their name in the TREK tooltip', async () => {+describe('ArtikelZeile — badges', () => {+ it('FE-W5ROW-008: an item somebody else takes care of shows their name in the tooltip', async () => {setup({item: buildPackingItem({ id: 1, name: 'Stove', is_private: 1, owner_id: 2, owner_username: 'Bob' } as Partial<PackingItem>),currentUserId: 1,})-const badge = screen.getByLabelText('by Bob')- expect(badge).not.toHaveAttribute('title')fireEvent.mouseEnter(badge)expect(await screen.findByRole('tooltip')).toHaveTextContent('by Bob')})- it('FE-W5ROW-019: a nameless bringer degrades to an empty name', () => {+ it('FE-W5ROW-009: a nameless owner degrades to an empty name', () => {setup({item: buildPackingItem({ id: 1, name: 'Stove', is_private: 1, owner_id: 2, owner_username: null } as Partial<PackingItem>),currentUserId: 1,})-expect(screen.getByLabelText('by')).toBeInTheDocument()})- it('FE-W5ROW-020: an item shared by me counts its recipients', async () => {+ it('FE-W5ROW-010: an item shared by me counts its recipients', async () => {setup({item: buildPackingItem({id: 1, name: 'Stove', is_private: 1, owner_id: 1,@@ -408,13 +144,12 @@ describe('ArtikelZeile — sharing badges', () => {} as unknown as Partial<PackingItem>),currentUserId: 1,})-expect(screen.getByLabelText('shared with 2')).toHaveTextContent('2')fireEvent.mouseEnter(screen.getByLabelText('shared with 2'))expect(await screen.findByRole('tooltip')).toHaveTextContent('shared with 2: alice, bob')})- it('FE-W5ROW-021: a common item names its bringer and counts co-bringers', async () => {+ it('FE-W5ROW-011: a common item shows its bringer and counts the others', async () => {setup({item: buildPackingItem({id: 1, name: 'Stove', is_private: 0, owner_username: 'Bob',@@ -422,58 +157,137 @@ describe('ArtikelZeile — sharing badges', () => {} as unknown as Partial<PackingItem>),currentUserId: 1,})-- // The bringer's initial on an avatar, the co-bringers as a "+N" circle; the tooltip- // names everyone, each on a line of their own (#2782).const badge = screen.getByLabelText('brought by Bob, cleo')expect(badge).toHaveTextContent('B+1')fireEvent.mouseEnter(badge)const rows = within(await screen.findByRole('tooltip')).getAllByRole('listitem')- expect(rows).toHaveLength(2)- expect(rows[0]).toHaveTextContent('Bob')- expect(rows[1]).toHaveTextContent('cleo')+ expect(rows.map(r => r.textContent)).toEqual(['Bob', 'cleo'])})- it('FE-W5ROW-022: a bringer without co-bringers shows no counter', () => {+ it('FE-W5ROW-012: co-bringers alone still show, without an owner', () => {setup({- item: buildPackingItem({ id: 1, name: 'Stove', is_private: 0, owner_username: 'Bob' } as Partial<PackingItem>),- currentUserId: 1,+ item: buildPackingItem({ id: 1, name: 'Stove', is_private: 0, owner_id: null, owner_username: null, contributors: [{ user_id: 2, username: 'alice' }] } as unknown as Partial<PackingItem>),+ tripMembers: MEMBERS,})+ expect(screen.getByLabelText('brought by alice')).toHaveTextContent(/^A$/)+ })- expect(screen.getByLabelText('brought by Bob')).toHaveTextContent(/^B$/)+ it('FE-W5ROW-013: a private item shows no bringer faces', () => {+ setup({ item: buildPackingItem({ id: 1, name: 'Diary', is_private: 1, owner_id: 1, owner_username: 'owner' } as Partial<PackingItem>), currentUserId: 1 })+ expect(screen.queryByLabelText(/brought by/)).toBeNull()})+})- it('FE-W5ROW-023: the placeholder row carries no badges and no share control', () => {- setup({- item: buildPackingItem({ id: 1, name: '...', is_private: 0, owner_username: 'Bob' } as Partial<PackingItem>),- currentUserId: 1,- onSetSharing: () => {},- onClone: () => {},- onJoin: () => {},- onLeave: () => {},- })+describe('ArtikelZeile — the placeholder of a new list', () => {+ it('FE-W5ROW-014: the placeholder row is typed into right away', () => {+ setup({ item: buildPackingItem({ id: 1, name: '...', category: 'Gear' }) })+ expect(screen.getByPlaceholderText('...')).toHaveValue('')+ expect(screen.queryByRole('button', { name: '...' })).toBeNull()+ })++ it('FE-W5ROW-015: Escape and a blank blur leave the placeholder as it was', async () => {+ let saved = false+ server.use(http.put('/api/trips/1/packing/1', () => { saved = true; return HttpResponse.json({ item: buildPackingItem({ id: 1 }) }) }))+ setup({ item: buildPackingItem({ id: 1, name: '...', category: 'Gear' }) })+ const input = screen.getByPlaceholderText('...')++ fireEvent.change(input, { target: { value: 'Tent' } })+ fireEvent.keyDown(input, { key: 'Escape' })+ expect(input).toHaveValue('')+ fireEvent.change(input, { target: { value: ' ' } })+ fireEvent.blur(input)- expect(screen.queryByTitle('brought by Bob')).toBeNull()- expect(screen.queryByTitle('Sharing')).toBeNull()+ await waitFor(() => expect(input).toHaveValue(''))+ expect(saved).toBe(false)})- it('FE-W5ROW-024: the share control is wired up for an editable item', () => {- const onSetSharing = vi.fn()- const { container } = setup({- currentUserId: 1,- tripMembers: MEMBERS,- onSetSharing,- onClone: () => {},- onJoin: () => {},- onLeave: () => {},- })+ it('FE-W5ROW-016: Enter on a filled placeholder hands the typing on, a blur does not (#2825)', async () => {+ server.use(http.put('/api/trips/1/packing/1', () => HttpResponse.json({ item: buildPackingItem({ id: 1, name: 'Tent' }) })))+ const onPlaceholderFilled = vi.fn()+ setup({ item: buildPackingItem({ id: 1, name: '...', category: 'Gear' }), onPlaceholderFilled })+ const input = screen.getByPlaceholderText('...')- // Sharing lives in the item menu, as a whole line to click.- fireEvent.click(overflowTrigger(container))- fireEvent.click(menu(container).getByText('Sharing').closest('button')!)- fireEvent.click(screen.getByText(/^Personal$/))+ fireEvent.change(input, { target: { value: 'Tent' } })+ fireEvent.blur(input)+ await waitFor(() => expect(toastSpy).not.toHaveBeenCalled())+ expect(onPlaceholderFilled).not.toHaveBeenCalled()- expect(onSetSharing).toHaveBeenCalledWith(1, 'personal', [])+ fireEvent.change(input, { target: { value: 'Tarp' } })+ fireEvent.keyDown(input, { key: 'Enter' })+ await waitFor(() => expect(onPlaceholderFilled).toHaveBeenCalledTimes(1))+ })++ it('FE-W5ROW-017: a failing placeholder save surfaces a save error', async () => {+ server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))+ setup({ item: buildPackingItem({ id: 1, name: '...', category: 'Gear' }) })+ const input = screen.getByPlaceholderText('...')+ fireEvent.change(input, { target: { value: 'Tent' } })+ fireEvent.keyDown(input, { key: 'Enter' })+ await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))+ })++ it('FE-W5ROW-018: a read-only placeholder just shows its dots', () => {+ setup({ item: buildPackingItem({ id: 1, name: '...', category: 'Gear' }), canEdit: false })+ expect(screen.queryByPlaceholderText('...')).toBeNull()+ expect(screen.getByText('...')).toBeInTheDocument()+ })+})++describe('ArtikelZeile — the item window', () => {+ it('FE-W5ROW-019: a click on the name opens the window and the row marks itself', () => {+ const { container } = setup()+ const trigger = screen.getByRole('button', { name: /Tent/ })+ expect(trigger).toHaveAttribute('aria-expanded', 'false')++ const dialog = openWindow()+ expect(dialog.getByDisplayValue('Tent')).toBeInTheDocument()+ expect(trigger).toHaveAttribute('aria-expanded', 'true')+ expect(row(container).style.boxShadow).toBe('inset 0 0 0 1px var(--border-primary)')+ })++ it('FE-W5ROW-020: the close button, the backdrop and Escape all close it', () => {+ setup()+ fireEvent.click(openWindow().getByRole('button', { name: 'Close' }))+ expect(screen.queryByRole('dialog')).toBeNull()++ openWindow()+ fireEvent.click(document.querySelector('[role="presentation"]')!)+ expect(screen.queryByRole('dialog')).toBeNull()++ fireEvent.keyDown(openWindow().getByDisplayValue('Tent'), { key: 'Escape' })+ expect(screen.queryByRole('dialog')).toBeNull()+ })++ it('FE-W5ROW-021: Delete in the window goes to the panel handler when there is one', async () => {+ const onDelete = vi.fn(async () => {})+ const { props } = setup({ onDelete })+ fireEvent.click(openWindow().getByRole('button', { name: 'Delete' }))+ await waitFor(() => expect(onDelete).toHaveBeenCalledWith(props.item))+ expect(screen.queryByRole('dialog')).toBeNull()+ })++ it('FE-W5ROW-022: a standalone row deletes through the store', async () => {+ let deleted = false+ server.use(http.delete('/api/trips/1/packing/1', () => { deleted = true; return HttpResponse.json({ success: true }) }))+ seedStore(useTripStore, { trip: buildTrip({ id: 1 }), packingItems: [buildPackingItem({ id: 1, name: 'Tent' })] })+ setup()+ fireEvent.click(openWindow().getByRole('button', { name: 'Delete' }))+ await waitFor(() => expect(deleted).toBe(true))+ })++ it('FE-W5ROW-023: a failing standalone delete surfaces a delete error', async () => {+ server.use(http.delete('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))+ seedStore(useTripStore, { trip: buildTrip({ id: 1 }), packingItems: [buildPackingItem({ id: 1, name: 'Tent' })] })+ setup()+ fireEvent.click(openWindow().getByRole('button', { name: 'Delete' }))+ await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to delete', 'error', undefined))+ })++ it('FE-W5ROW-024: a read-only window shows the name as text and offers no delete', () => {+ setup({ canEdit: false })+ const dialog = openWindow()+ expect(dialog.queryByRole('textbox')).toBeNull()+ expect(dialog.queryByRole('button', { name: 'Delete' })).toBeNull()})})@@ -494,644 +308,52 @@ describe('ArtikelZeile — drag handle', () => {fireEvent.dragStart(handle, { dataTransfer: dt() })expect(d.onStart).toHaveBeenCalledWith(1)-fireEvent.dragEnd(handle)expect(d.onEnd).toHaveBeenCalled()})- it('FE-W5ROW-026: dragging over the row marks it as the drop target', () => {+ it('FE-W5ROW-026: dragging over the row marks it, dropping reports the target', () => {const d = drag()const { container } = setup({ drag: d })- const row = container.querySelector<HTMLElement>('.packing-item-row')!-- fireEvent.dragOver(row, { dataTransfer: dt() })+ fireEvent.dragOver(row(container), { dataTransfer: dt() })expect(d.onOver).toHaveBeenCalledWith(1)+ fireEvent.drop(row(container), { dataTransfer: dt() })+ expect(d.onDrop).toHaveBeenCalledWith(1)})it('FE-W5ROW-027: leaving the row clears the drop target, but moving inside it does not', () => {const d = drag()const { container } = setup({ drag: d })- const row = container.querySelector<HTMLElement>('.packing-item-row')!- const leave = (relatedTarget: Node) =>- fireEvent(row, new MouseEvent('dragleave', { bubbles: true, relatedTarget }))+ const leave = (relatedTarget: Node) => fireEvent(row(container), new MouseEvent('dragleave', { bubbles: true, relatedTarget }))leave(document.body)expect(d.onOver).toHaveBeenCalledWith(-1)-d.onOver.mockClear()leave(screen.getByText('Tent'))expect(d.onOver).not.toHaveBeenCalled()})- it('FE-W5ROW-028: dropping on the row reports the target id', () => {- const d = drag()- const { container } = setup({ drag: d })-- fireEvent.drop(container.querySelector<HTMLElement>('.packing-item-row')!, { dataTransfer: dt() })-- expect(d.onDrop).toHaveBeenCalledWith(1)- })-- it('FE-W5ROW-029: the dragged row fades and the hovered row shows an edge', () => {+ it('FE-W5ROW-028: the dragged row fades and the hovered row shows an edge', () => {const { container } = setup({ drag: { ...drag(), isDragging: true, isOver: true } })- const row = container.querySelector<HTMLElement>('.packing-item-row')!-- expect(row.style.opacity).toBe('0.4')- expect(row.style.boxShadow).toBe('inset 3px 0 0 0 var(--accent)')+ expect(row(container).style.opacity).toBe('0.4')+ expect(row(container).style.boxShadow).toBe('inset 3px 0 0 0 var(--accent)')})- it('FE-W5ROW-030: hovering the row brings the grip to full opacity', () => {+ it('FE-W5ROW-029: the grip only shows under the pointer', () => {const { container } = setup({ drag: drag() })- const row = container.querySelector<HTMLElement>('.packing-item-row')!const handle = container.querySelector<HTMLElement>('div[draggable="true"]')!-- expect(handle.style.opacity).toBe('0.35')- fireEvent.mouseEnter(row)+ expect(handle.style.opacity).toBe('0')+ fireEvent.mouseEnter(row(container))expect(handle.style.opacity).toBe('1')})- it('FE-W5ROW-031: a placeholder row is not draggable', () => {- const { container } = setup({ item: buildPackingItem({ id: 1, name: '...' }), drag: drag() })-+ it('FE-W5ROW-030: a placeholder or read-only row is not draggable, a sorted row keeps the grip column', () => {+ const { container, unmount } = setup({ item: buildPackingItem({ id: 1, name: '...' }), drag: drag() })expect(container.querySelector('div[draggable="true"]')).toBeNull()- })-})--describe('ArtikelZeile — weight and bag', () => {- it('FE-W5ROW-032: entering a weight saves it in grams', async () => {- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1 }) })- }),- )- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS })-- const weightField = container.querySelector('input[placeholder="—"]')!- fireEvent.change(weightField, { target: { value: '450' } })- fireEvent.blur(weightField)-- await waitFor(() => expect(body).toMatchObject({ weight_grams: 450 }))- })-- it('FE-W5ROW-033: clearing the weight stores null', async () => {- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1 }) })- }),- )- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Tent', weight_grams: 300 } as Partial<PackingItem>),- bagTrackingEnabled: true,- })-- const weightField = container.querySelector('input[placeholder="—"]')!- fireEvent.change(weightField, { target: { value: '' } })- fireEvent.blur(weightField)-- await waitFor(() => expect(body).toMatchObject({ weight_grams: null }))- })-- it('FE-W5ROW-034: a failing weight save surfaces a save error', async () => {- server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))- const { container } = setup({ bagTrackingEnabled: true })-- const weightField = container.querySelector('input[placeholder="—"]')!- fireEvent.change(weightField, { target: { value: '450' } })- fireEvent.blur(weightField)-- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))- })-- it('FE-W5ROW-035: a read-only row ignores weight edits and never opens the bag picker', async () => {- let called = false- server.use(http.put('/api/trips/1/packing/1', () => { called = true; return HttpResponse.json({ item: buildPackingItem() }) }))- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS, canEdit: false })-- const weight = container.querySelector<HTMLInputElement>('input[placeholder="—"]')!- expect(weight.readOnly).toBe(true)- fireEvent.change(weight, { target: { value: '450' } })- fireEvent.blur(weight)- fireEvent.click(bagButton(container))-- await waitFor(() => expect(screen.queryByRole('button', { name: /Carry-on/ })).toBeNull())- expect(called).toBe(false)- })-- it('FE-W5ROW-036: picking a bag assigns it', async () => {- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1 }) })- }),- )- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS })- fireEvent.click(bagButton(container))-- fireEvent.click(screen.getByRole('button', { name: 'Trolley' }))-- await waitFor(() => expect(body).toMatchObject({ bag_id: 8 }))- })-- it('FE-W5ROW-037: a failing bag assign surfaces a save error', async () => {- server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS })- fireEvent.click(bagButton(container))-- fireEvent.click(screen.getByRole('button', { name: 'Trolley' }))-- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))- })-- it('FE-W5ROW-038: only an assigned item offers the Unassigned entry, which clears the bag', async () => {- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1 }) })- }),- )- const unassigned = setup({ bagTrackingEnabled: true, bags: BAGS })- fireEvent.click(bagButton(unassigned.container))- expect(screen.queryByRole('button', { name: 'Unassigned' })).toBeNull()- unassigned.unmount()-- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Tent', bag_id: 7 } as Partial<PackingItem>),- bagTrackingEnabled: true,- bags: BAGS,- })- fireEvent.click(bagButton(container))- fireEvent.click(screen.getByRole('button', { name: 'Unassigned' }))-- await waitFor(() => expect(body).toMatchObject({ bag_id: null }))- })-- it('FE-W5ROW-039: a failing clear surfaces a save error', async () => {- server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Tent', bag_id: 7 } as Partial<PackingItem>),- bagTrackingEnabled: true,- bags: BAGS,- })- fireEvent.click(bagButton(container))-- fireEvent.click(screen.getByRole('button', { name: 'Unassigned' }))-- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))- })-- it('FE-W5ROW-040: only the unselected bag entries react to hover', () => {- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Tent', bag_id: 7 } as Partial<PackingItem>),- bagTrackingEnabled: true,- bags: BAGS,- })- fireEvent.click(bagButton(container))- const selected = screen.getByRole('button', { name: 'Carry-on' })- const other = screen.getByRole('button', { name: 'Trolley' })-- fireEvent.mouseEnter(other)- expect(other.style.background).toBe('var(--bg-tertiary)')- fireEvent.mouseLeave(other)- expect(other.style.background).toBe('none')-- fireEvent.mouseEnter(selected)- fireEvent.mouseLeave(selected)- expect(selected.style.background).toBe('var(--bg-tertiary)')- })-- it('FE-W5ROW-040a: hovering the selected bag entry leaves it untouched', () => {- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Tent', bag_id: 7 } as Partial<PackingItem>),- bagTrackingEnabled: true,- bags: BAGS,- })- fireEvent.click(bagButton(container))- const selected = screen.getByRole('button', { name: 'Carry-on' })-- fireEvent.mouseEnter(selected)- expect(selected.style.background).toBe('var(--bg-tertiary)')- fireEvent.mouseLeave(selected)- expect(selected.style.background).toBe('var(--bg-tertiary)')- })-- it('FE-W5ROW-040b: a bag id the trip no longer knows falls back to the neutral border', () => {- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Tent', bag_id: 99 } as Partial<PackingItem>),- bagTrackingEnabled: true,- bags: BAGS,- })-- const trigger = bagButton(container)- expect(trigger.style.border).toBe('2.5px solid var(--border-primary)')- expect(trigger.style.background).toBe('var(--border-primary)30')- })-- it('FE-W5ROW-041: creating a bag inline assigns it right away', async () => {- const created = { id: 12, name: 'Duffel', color: '#f97316' } as unknown as PackingBag- const onCreateBag = vi.fn(async () => created)- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1 }) })- }),- )- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS, onCreateBag })- fireEvent.click(bagButton(container))- fireEvent.click(screen.getByText('Add bag'))-- const input = screen.getByPlaceholderText('Bag name...')- fireEvent.change(input, { target: { value: ' Duffel ' } })- fireEvent.keyDown(input, { key: 'Enter' })-- await waitFor(() => expect(onCreateBag).toHaveBeenCalledWith('Duffel'))- await waitFor(() => expect(body).toMatchObject({ bag_id: 12 }))- })-- it('FE-W5ROW-042: Enter on a blank inline name creates nothing', () => {- const onCreateBag = vi.fn(async () => undefined)- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS, onCreateBag })- fireEvent.click(bagButton(container))- fireEvent.click(screen.getByText('Add bag'))-- fireEvent.keyDown(screen.getByPlaceholderText('Bag name...'), { key: 'Enter' })-- expect(onCreateBag).not.toHaveBeenCalled()- })-- it('FE-W5ROW-043: Escape cancels the inline bag form', () => {- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS })- fireEvent.click(bagButton(container))- fireEvent.click(screen.getByText('Add bag'))-- fireEvent.keyDown(screen.getByPlaceholderText('Bag name...'), { key: 'Escape' })-- expect(screen.queryByPlaceholderText('Bag name...')).toBeNull()- expect(screen.getByText('Add bag')).toBeInTheDocument()- })-- it('FE-W5ROW-044: the inline confirm button creates the bag, and is inert while blank', async () => {- const created = { id: 13, name: 'Crate', color: '#f97316' } as unknown as PackingBag- const onCreateBag = vi.fn(async () => created)- server.use(http.put('/api/trips/1/packing/1', () => HttpResponse.json({ item: buildPackingItem({ id: 1 }) })))- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS, onCreateBag })- fireEvent.click(bagButton(container))- fireEvent.click(screen.getByText('Add bag'))- const confirm = screen.getByPlaceholderText('Bag name...').nextElementSibling as HTMLButtonElement-- fireEvent.click(confirm)- expect(onCreateBag).not.toHaveBeenCalled()-- fireEvent.change(screen.getByPlaceholderText('Bag name...'), { target: { value: 'Crate' } })- fireEvent.click(confirm)-- await waitFor(() => expect(onCreateBag).toHaveBeenCalledWith('Crate'))- })-- it('FE-W5ROW-045: a rejected bag creation leaves the item unassigned', async () => {- const onCreateBag = vi.fn(async () => undefined)- let called = false- server.use(http.put('/api/trips/1/packing/1', () => { called = true; return HttpResponse.json({ item: buildPackingItem() }) }))- const { container } = setup({ bagTrackingEnabled: true, bags: [], onCreateBag })- fireEvent.click(bagButton(container))- fireEvent.click(screen.getByText('Add bag'))-- const input = screen.getByPlaceholderText('Bag name...')- fireEvent.change(input, { target: { value: 'Duffel' } })- fireEvent.keyDown(input, { key: 'Enter' })-- await waitFor(() => expect(onCreateBag).toHaveBeenCalled())- await waitFor(() => expect(screen.queryByPlaceholderText('Bag name...')).toBeNull())- expect(called).toBe(false)- })-- it('FE-W5ROW-045a: a failing assign after an inline create surfaces a save error', async () => {- const created = { id: 14, name: 'Duffel', color: '#f97316' } as unknown as PackingBag- const onCreateBag = vi.fn(async () => created)- server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS, onCreateBag })- fireEvent.click(bagButton(container))- fireEvent.click(screen.getByText('Add bag'))-- const input = screen.getByPlaceholderText('Bag name...')- fireEvent.change(input, { target: { value: 'Duffel' } })- fireEvent.keyDown(input, { key: 'Enter' })-- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))- })-- it('FE-W5ROW-045b: the confirm button also reports a failing assign', async () => {- const created = { id: 15, name: 'Crate', color: '#f97316' } as unknown as PackingBag- const onCreateBag = vi.fn(async () => created)- server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS, onCreateBag })- fireEvent.click(bagButton(container))- fireEvent.click(screen.getByText('Add bag'))- const confirm = screen.getByPlaceholderText('Bag name...').nextElementSibling as HTMLButtonElement-- fireEvent.change(screen.getByPlaceholderText('Bag name...'), { target: { value: 'Crate' } })- fireEvent.click(confirm)-- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))- })-- it('FE-W5ROW-045c: the confirm button closes the form when creation is refused', async () => {- const onCreateBag = vi.fn(async () => undefined)- let called = false- server.use(http.put('/api/trips/1/packing/1', () => { called = true; return HttpResponse.json({ item: buildPackingItem() }) }))- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS, onCreateBag })- fireEvent.click(bagButton(container))- fireEvent.click(screen.getByText('Add bag'))- const confirm = screen.getByPlaceholderText('Bag name...').nextElementSibling as HTMLButtonElement-- fireEvent.change(screen.getByPlaceholderText('Bag name...'), { target: { value: 'Crate' } })- fireEvent.click(confirm)-- await waitFor(() => expect(screen.queryByPlaceholderText('Bag name...')).toBeNull())- expect(called).toBe(false)- })-- it('FE-W5ROW-046: the Add bag entry highlights on hover', () => {- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS })- fireEvent.click(bagButton(container))- const add = screen.getByText('Add bag').closest('button')!-- fireEvent.mouseEnter(add)- expect(add.style.background).toBe('var(--bg-tertiary)')- fireEvent.mouseLeave(add)- expect(add.style.background).toBe('none')- })-})--describe('ArtikelZeile — overflow menu', () => {- it('FE-W5ROW-047: the menu renames and closes', () => {- const { container } = setup()- fireEvent.click(overflowTrigger(container))-- fireEvent.click(screen.getByText('Rename'))-- expect(screen.getByDisplayValue('Tent')).toBeInTheDocument()- expect(screen.queryByText('Delete')).toBeNull()- })-- it('FE-W5ROW-048: the menu deletes through the panel handler', async () => {- const onDelete = vi.fn(async () => {})- const { container, props } = setup({ onDelete })- fireEvent.click(overflowTrigger(container))-- fireEvent.click(screen.getByText('Delete'))-- await waitFor(() => expect(onDelete).toHaveBeenCalledWith(props.item))- })-- it('FE-W5ROW-049: the scrim closes the menu', () => {- const { container, baseElement } = setup()- fireEvent.click(overflowTrigger(container))- expect(screen.getByText('Qty')).toBeInTheDocument()-- fireEvent.click(baseElement.querySelector('div[style*="z-index: 1098"]')!)-- expect(screen.queryByText('Qty')).toBeNull()- })-- it('FE-W5ROW-050: the menu commits a new quantity', async () => {- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1, quantity: 4 }) })- }),- )- const { container } = setup({ item: buildPackingItem({ id: 1, name: 'Tent', quantity: null } as Partial<PackingItem>) })- fireEvent.click(overflowTrigger(container))-- const qty = fieldOf(container, 'Qty')- fireEvent.change(qty, { target: { value: '4' } })- fireEvent.blur(qty)-- await waitFor(() => expect(body).toMatchObject({ quantity: 4 }))- })-- it('FE-W5ROW-051: the menu saves a weight and reassigns the bag', async () => {- const bodies: Record<string, unknown>[] = []- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- bodies.push((await request.json()) as Record<string, unknown>)- return HttpResponse.json({ item: buildPackingItem({ id: 1 }) })- }),- )- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Tent', bag_id: 7 } as Partial<PackingItem>),- bagTrackingEnabled: true,- bags: BAGS,- })- fireEvent.click(overflowTrigger(container))-- const weight = fieldOf(container, 'Total weight')- fireEvent.change(weight, { target: { value: '900' } })- fireEvent.blur(weight)- await waitFor(() => expect(bodies[0]).toMatchObject({ weight_grams: 900 }))-- // The first entry mirrors the current bag and clears it when tapped.- fireEvent.click(menu(container).getAllByRole('button', { name: 'Carry-on', hidden: true })[0])- await waitFor(() => expect(bodies[1]).toMatchObject({ bag_id: null }))-- fireEvent.click(menuButton(container, 'Trolley'))- await waitFor(() => expect(bodies[2]).toMatchObject({ bag_id: 8 }))- })-- it('FE-W5ROW-052: a failing menu weight or bag change surfaces a save error', async () => {- server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS })- fireEvent.click(overflowTrigger(container))-- fireEvent.change(fieldOf(container, 'Total weight'), { target: { value: '900' } })- fireEvent.blur(fieldOf(container, 'Total weight'))-- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))-- toastSpy.mockClear()- fireEvent.click(menuButton(container, 'Trolley'))- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))- })-- it('FE-W5ROW-053: an unassigned item shows the Unassigned row without firing a request', async () => {- let called = false- server.use(http.put('/api/trips/1/packing/1', () => { called = true; return HttpResponse.json({ item: buildPackingItem() }) }))- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS })- fireEvent.click(overflowTrigger(container))-- fireEvent.click(menuButton(container, 'Unassigned'))-- await waitFor(() => expect(menu(container).getByText('Total weight')).toBeInTheDocument())- expect(called).toBe(false)- })-- it('FE-W5ROW-053a: a failing clear from the menu surfaces a save error', async () => {- server.use(http.put('/api/trips/1/packing/1', () => new HttpResponse(null, { status: 500 })))- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Tent', bag_id: 7 } as Partial<PackingItem>),- bagTrackingEnabled: true,- bags: BAGS,- })- fireEvent.click(overflowTrigger(container))-- fireEvent.click(menu(container).getAllByRole('button', { name: 'Carry-on', hidden: true })[0])-- await waitFor(() => expect(toastSpy).toHaveBeenCalledWith('Failed to save', 'error', undefined))- })-- it('FE-W5ROW-053b: clearing the menu weight stores null', async () => {- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1 }) })- }),- )- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Tent', weight_grams: 400 } as Partial<PackingItem>),- bagTrackingEnabled: true,- bags: BAGS,- })- fireEvent.click(overflowTrigger(container))-- fireEvent.change(fieldOf(container, 'Total weight'), { target: { value: '' } })- fireEvent.blur(fieldOf(container, 'Total weight'))-- await waitFor(() => expect(body).toMatchObject({ weight_grams: null }))- })-- it('FE-W5ROW-054: the menu list submenu moves the item and can be collapsed again', async () => {- let body: Record<string, unknown> | null = null- server.use(- http.put('/api/trips/1/packing/1', async ({ request }) => {- body = (await request.json()) as Record<string, unknown>- return HttpResponse.json({ item: buildPackingItem({ id: 1, category: 'Docs' }) })- }),- )- const { container } = setup()- fireEvent.click(overflowTrigger(container))-- fireEvent.click(menuButton(container, 'Move to List'))- expect(menuButton(container, 'Docs')).toBeInTheDocument()-- fireEvent.click(menuButton(container, 'Move to List'))- expect(menu(container).queryByRole('button', { name: 'Docs', hidden: true })).toBeNull()-- fireEvent.click(menuButton(container, 'Move to List'))- fireEvent.click(menuButton(container, 'Docs'))-- await waitFor(() => expect(body).toMatchObject({ category: 'Docs' }))- })-- it('FE-W5ROW-054a: an uncategorized item marks the default list in the submenu', () => {- const { container } = setup({- item: buildPackingItem({ id: 1, name: 'Soap', category: null }),- categories: ['Other', 'Gear'],- })- fireEvent.click(overflowTrigger(container))- fireEvent.click(menuButton(container, 'Move to List'))-- expect(menuButton(container, 'Other')).toHaveStyle({ background: 'var(--bg-tertiary)' })- expect(menuButton(container, 'Gear')).not.toHaveStyle({ background: 'var(--bg-tertiary)' })- })-- it('FE-W5ROW-055: the menu carries its own share control', () => {- const onSetSharing = vi.fn()- const { container } = setup({- currentUserId: 1,- tripMembers: MEMBERS,- onSetSharing,- onClone: () => {},- onJoin: () => {},- onLeave: () => {},- })- fireEvent.click(overflowTrigger(container))-- fireEvent.click(menu(container).getByText('Sharing').closest('button')!)- fireEvent.click(screen.getByText(/^Personal$/))-- expect(onSetSharing).toHaveBeenCalledWith(1, 'personal', [])- })-- it('FE-W5ROW-056: menu entries highlight on hover, the active one stays put', () => {- const { container } = setup({ bagTrackingEnabled: true, bags: BAGS })- fireEvent.click(overflowTrigger(container))- fireEvent.click(menuButton(container, 'Move to List'))- // "Gear" is the item's current list, so its submenu entry renders as active.- const active = menuButton(container, 'Gear')- const plain = menuButton(container, 'Carry-on')- const danger = menu(container).getByText('Delete').closest('button')!-- fireEvent.mouseEnter(plain)- expect(plain.style.background).toBe('var(--bg-tertiary)')- fireEvent.mouseLeave(plain)- expect(plain.style.background).toBe('none')-- fireEvent.mouseEnter(active)- fireEvent.mouseLeave(active)- expect(active.style.background).toBe('var(--bg-tertiary)')-- fireEvent.mouseEnter(danger)- expect(danger.style.background).toBe('rgba(239, 68, 68, 0.1)')- })-})--describe('ArtikelZeile — who brings a common item (#3098)', () => {- const handlers = () => ({ onSetSharing: vi.fn(), onClone: vi.fn(), onJoin: vi.fn(), onLeave: vi.fn() })-- it('FE-W5ROW-057: the item menu lists every member and ticks one on as a bringer', () => {- const h = handlers()- const { container } = setup({ currentUserId: 1, tripMembers: MEMBERS, ...h })-- fireEvent.click(overflowTrigger(container))- fireEvent.click(menuButton(container, 'Brought by'))- fireEvent.click(menuButton(container, 'alice'))-- expect(h.onJoin).toHaveBeenCalledWith(1, 2)- expect(h.onLeave).not.toHaveBeenCalled()- })-- it('FE-W5ROW-058: a ticked bringer, the owner included, comes off again', () => {- const h = handlers()- const { container } = setup({- item: buildPackingItem({- id: 1, name: 'Stove', is_private: 0, owner_id: 1, owner_username: 'owner',- contributors: [{ user_id: 2, username: 'alice' }],- } as unknown as Partial<PackingItem>),- currentUserId: 1, tripMembers: MEMBERS, ...h,- })-- fireEvent.click(overflowTrigger(container))- fireEvent.click(menuButton(container, 'Brought by'))- fireEvent.click(menuButton(container, 'owner'))- fireEvent.click(menuButton(container, 'alice'))-- expect(h.onLeave).toHaveBeenNthCalledWith(1, 1, 1)- expect(h.onLeave).toHaveBeenNthCalledWith(2, 1, 2)- expect(h.onJoin).not.toHaveBeenCalled()- })-- it('FE-W5ROW-059: a click on the faces opens the menu at the bringers, also when only co-bringers are left', () => {- const { container } = setup({- item: buildPackingItem({- id: 1, name: 'Stove', is_private: 0, owner_id: null, owner_username: null,- contributors: [{ user_id: 2, username: 'alice' }],- } as unknown as Partial<PackingItem>),- currentUserId: 1, tripMembers: MEMBERS, ...handlers(),- })-- fireEvent.click(screen.getByRole('button', { name: 'brought by alice' }))-- expect(menuButton(container, 'alice')).toBeInTheDocument()- expect(menuButton(container, 'owner')).toBeInTheDocument()+ unmount()+ const sorted = setup()+ expect(sorted.container.querySelector('div[draggable="true"]')).toBeNull()+ expect(sorted.container.querySelector('span[aria-hidden][style*="width: 13px"]')).not.toBeNull()})})diff --git a/client/src/components/Packing/PackingListPanelItemRow.tsx b/client/src/components/Packing/PackingListPanelItemRow.tsxindex 06ac9cc09..9a7bbafda 100644--- a/client/src/components/Packing/PackingListPanelItemRow.tsx+++ b/client/src/components/Packing/PackingListPanelItemRow.tsx@@ -1,26 +1,16 @@import { useRef, useState, type CSSProperties } from 'react'-import { createPortal } from 'react-dom'-import { useAnchoredPosition } from '../../hooks/useAnchoredPosition'import { useTripStore } from '../../store/tripStore'import { useToast } from '../shared/Toast'import { useTranslation } from '../../i18n'-import {- Check, Trash2, Plus, Pencil, Package, GripVertical, UserRound, HandHelping,- MoreHorizontal, ChevronDown, ChevronRight,-} from 'lucide-react'+import { Check, GripVertical, UserRound, HandHelping, ChevronRight } from 'lucide-react'import type { PackingItem, PackingBag } from '../../types'-import { katColor, packedOf } from './packingListPanel.helpers'+import { packedOf } from './packingListPanel.helpers'import { PACKING_PLACEHOLDER_NAME } from './packingListPanel.constants'-import { QuantityInput } from './PackingListPanelQuantityInput'-import { PackedCounter } from './PackingPackedCounter'-import PackingShareControl from './PackingShareControl'-import { PopoverItem } from './PackingPopover'-import { POPOVER, POPOVER_CAPTION, POPOVER_DIVIDER } from './packingPopoverStyles'import type { TripMember } from './usePackingListPanel'-import { WeightInput } from './PackingListPanelWeightInput'import { bringersOf, packingBringerNames } from './packingBringers'import { Tooltip } from '../shared/Tooltip'import { BringerAvatar, BringersCard, MoreBringers } from './PackingBringersCard'+import { PackingItemDetail } from './PackingItemDetail'interface ArtikelZeileProps {item: PackingItem@@ -34,7 +24,7 @@ interface ArtikelZeileProps {bags?: PackingBag[]onCreateBag: (name: string) => Promise<PackingBag | undefined>canEdit?: boolean- // Three-tier sharing (#858): members + handlers for the per-item share control.+ // Three-tier sharing (#858): members + handlers for the item's detail window.tripMembers?: TripMember[]currentUserId?: numberonSetSharing?: (id: number, visibility: 'common' | 'personal' | 'shared', recipientIds: number[]) => void@@ -54,50 +44,93 @@ interface ArtikelZeileProps {}}-export function ArtikelZeile({ item, tripId, categories, onCategoryChange: _onCategoryChange, onDelete, onPlaceholderFilled, bagTrackingEnabled, bags = [], onCreateBag, canEdit = true, tripMembers = [], currentUserId, onSetSharing, onClone, onJoin, onLeave, divider = false, drag }: ArtikelZeileProps) {- const isPlaceholder = item.name === PACKING_PLACEHOLDER_NAME- const [editing, setEditing] = useState(false)- const [editName, setEditName] = useState(isPlaceholder ? '' : item.name)- const [hovered, setHovered] = useState(false)- // Keyboard focus anywhere in the row counts as hovering it, so every control- // that only shows on hover is also there for someone tabbing through.- const [focused, setFocused] = useState(false)- const [showBagPicker, setShowBagPicker] = useState(false)- // The picker opens in a portal: inside the category card it was cut off by the card's edge.- const bagBtnRef = useRef<HTMLButtonElement>(null)- const bagBox = useAnchoredPosition(bagBtnRef, showBagPicker, { estimatedHeight: 260, offset: 6 })- const [showItemMenu, setShowItemMenu] = useState(false)- const [showMenuCategories, setShowMenuCategories] = useState(false)- const [showMenuBringers, setShowMenuBringers] = useState(false)- const [bagInlineCreate, setBagInlineCreate] = useState(false)- const [bagInlineName, setBagInlineName] = useState('')- const itemMenuBtnRef = useRef<HTMLButtonElement>(null)- const { togglePackingItem, updatePackingItem, deletePackingItem, setPackedCount } = useTripStore()+const nameStyle = (checked: boolean, placeholder: boolean): CSSProperties => ({+ flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap',+ fontSize: 'calc(13.5px * var(--fs-scale-body, 1))', fontWeight: 500, textAlign: 'start',+ color: checked || placeholder ? 'var(--text-faint)' : 'var(--text-primary)',+ textDecoration: checked ? 'line-through' : 'none',+ transition: 'color 200ms cubic-bezier(0.23,1,0.32,1)',+})++/** The '...' row a new list starts with: typed into right here, so the next item follows (#2825). */+function PlaceholderField({ item, tripId, onFilled }: Readonly<{ item: PackingItem; tripId: number; onFilled?: () => void }>) {+ const [name, setName] = useState('')+ const updatePackingItem = useTripStore(s => s.updatePackingItem)const toast = useToast()const { t } = useTranslation()+ const save = async (viaEnter: boolean) => {+ if (!name.trim()) { setName(''); return }+ try {+ await updatePackingItem(tripId, item.id, { name: name.trim() })+ if (viaEnter) onFilled?.()+ } catch { toast.error(t('packing.toast.saveError')) }+ }+ return (+ <input type="text" value={name} placeholder="..." onChange={e => setName(e.target.value)}+ onBlur={() => void save(false)}+ onKeyDown={e => { if (e.key === 'Enter') void save(true); if (e.key === 'Escape') setName('') }}+ className="min-w-0 flex-1 rounded-md border border-edge bg-transparent px-2 py-0.5 font-[inherit] text-content outline-none"+ style={{ fontSize: 'calc(13.5px * var(--fs-scale-body, 1))' }} />+ )+}- // Three-tier sharing display (#858).- const sharedToMe = !!item.is_private && item.owner_id != null && item.owner_id !== currentUserId+/** What the row says about the item at rest: only what is set, never an empty field. */+function RowFacts({ item, tripMembers, currentUserId }: Readonly<{ item: PackingItem; tripMembers: TripMember[]; currentUserId?: number }>) {+ const { t } = useTranslation()+ const quantity = item.quantity || 1+ const packed = packedOf(item)+ const partly = !item.checked && packed > 0const recipients = item.recipients || []+ const sharedToMe = !!item.is_private && item.owner_id != null && item.owner_id !== currentUserIdconst sharedByMe = !!item.is_private && item.owner_id === currentUserId && recipients.length > 0- const canShare = canEdit && !isPlaceholder && !!onSetSharing- // Who brings a Common item is anyone's call on the trip, not just a pledge for- // yourself: the menu lists every member to tick on or off (#3098).- const canPickBringers = canEdit && !isPlaceholder && !item.is_private && tripMembers.length > 0 && !!onJoin && !!onLeave- const isBringer = (userId: number) => item.owner_id === userId || (item.contributors || []).some(c => c.user_id === userId)- const toggleBringer = (userId: number) => (isBringer(userId) ? onLeave!(item.id, userId) : onJoin!(item.id, userId))- const closeItemMenu = () => { setShowItemMenu(false); setShowMenuCategories(false); setShowMenuBringers(false) }-- const handleToggle = () => togglePackingItem(tripId, item.id, !item.checked)+ const bringers = item.is_private ? [] : bringersOf(item, tripMembers)+ return (+ <>+ {partly && <span className="shrink-0 text-caption font-semibold tabular-nums text-content-muted">{packed}/{quantity}</span>}+ {!partly && quantity > 1 && <span className="shrink-0 text-caption font-medium tabular-nums text-content-faint">×{quantity}</span>}+ {sharedToMe && (+ <Tooltip label={t('packing.takenCareOf', { name: item.owner_username || '' })}>+ <span className="packing-row-badge inline-flex size-[22px] shrink-0 items-center justify-center rounded-full text-accent"+ aria-label={t('packing.takenCareOf', { name: item.owner_username || '' })}+ style={{ background: 'color-mix(in srgb, var(--accent) 12%, transparent)' }}>+ <HandHelping size={12} />+ </span>+ </Tooltip>+ )}+ {sharedByMe && (+ <Tooltip label={`${t('packing.sharedWithCount', { count: recipients.length })}: ${recipients.map(r => r.username).join(', ')}`}>+ <span className="packing-row-badge inline-flex h-[22px] shrink-0 items-center gap-[3px] rounded-full bg-surface-tertiary px-[7px] text-caption font-bold text-content-muted"+ aria-label={t('packing.sharedWithCount', { count: recipients.length })}>+ <UserRound size={11} /> {recipients.length}+ </span>+ </Tooltip>+ )}+ {bringers.length > 0 && (+ <Tooltip label={t('packing.broughtBy', { name: packingBringerNames(item) })} content={<BringersCard bringers={bringers} />}>+ <span className="packing-row-badge inline-flex shrink-0 items-center" aria-label={t('packing.broughtBy', { name: packingBringerNames(item) })}>+ <BringerAvatar bringer={bringers[0]} />+ {bringers.length > 1 && <MoreBringers count={bringers.length - 1} />}+ </span>+ </Tooltip>+ )}+ </>+ )+}- const handleSaveName = async (viaEnter = false) => {- if (!editName.trim()) { setEditing(false); setEditName(isPlaceholder ? '' : item.name); return }- try {- await updatePackingItem(tripId, item.id, { name: editName.trim() }); setEditing(false)- if (viaEnter && isPlaceholder) onPlaceholderFilled?.()- }- catch { toast.error(t('packing.toast.saveError')) }- }+/**+ * One packing item. At rest it shows its box, its name and only what is set+ * (the amount from two up, the pieces packed, who brings it); a click anywhere+ * past the box opens the item's window with every choice in it.+ */+export function ArtikelZeile({ item, tripId, categories, onDelete, onPlaceholderFilled, bagTrackingEnabled, bags = [], onCreateBag, canEdit = true, tripMembers = [], currentUserId, onSetSharing, onClone, onJoin, onLeave, divider = false, drag }: ArtikelZeileProps) {+ const isPlaceholder = item.name === PACKING_PLACEHOLDER_NAME+ const [hovered, setHovered] = useState(false)+ const [open, setOpen] = useState(false)+ const rowRef = useRef<HTMLDivElement>(null)+ const togglePackingItem = useTripStore(s => s.togglePackingItem)+ const deletePackingItem = useTripStore(s => s.deletePackingItem)+ const toast = useToast()+ const { t } = useTranslation()const handleDelete = async () => {// The panel routes deletion through onDelete so an emptied custom category@@ -107,84 +140,44 @@ export function ArtikelZeile({ item, tripId, categories, onCategoryChange: _onCacatch { toast.error(t('packing.toast.deleteError')) }}- const handleCatChange = async (cat: string) => {- setShowMenuCategories(false)- setShowItemMenu(false)- if (cat === item.category) return- try { await updatePackingItem(tripId, item.id, { category: cat }) }- catch { toast.error(t('common.error')) }- }-- const saveWeight = async (grams: number | null) => {- try { await updatePackingItem(tripId, item.id, { weight_grams: grams }) } catch { toast.error(t('packing.toast.saveError')) }- }-- const canDrag = canEdit && !isPlaceholder && !!drag- const selectedBag = bags.find(b => b.id === item.bag_id)- const quantity = item.quantity || 1- // A multi-piece item counts its pieces into the bag (#2296).- const packed = packedOf(item)- const partlyPacked = !item.checked && packed > 0- const bringers = bringersOf(item, tripMembers)-- // At rest a row reads as what it holds (owner, a quantity above one, a- // weight, the bag) and everything else stays in place but dimmed: nothing- // leaves a hole and nothing jumps. Pointer or focus brings it all up.- const active = hovered || focused || showItemMenu || showBagPicker- const reveal = (visible: boolean): CSSProperties => ({ opacity: visible ? 1 : 0.4, transition: 'opacity 120ms ease' })- // Quantity and weight read as quiet pills; under the pointer an outline- // shows they can be typed into.- const badge = (visible: boolean): CSSProperties => ({- ...reveal(visible), background: 'var(--bg-tertiary)', borderRadius: 99, padding: '2px 8px',- borderColor: active ? 'var(--border-primary)' : 'transparent',- })-- // Shared by both shells of the name: a renameable name is a real button so- // the rename can be reached with the keyboard, everything else is plain text.- const nameStyle: CSSProperties = {- flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap',- fontSize: 'calc(13.5px * var(--fs-scale-body, 1))', fontWeight: 500,- cursor: canEdit ? 'text' : 'default',- color: isPlaceholder ? 'var(--text-faint)' : (item.checked ? 'var(--text-faint)' : 'var(--text-primary)'),- transition: 'color 200ms cubic-bezier(0.23,1,0.32,1)',- textDecoration: item.checked ? 'line-through' : 'none',- }+ // The drag handlers only when this row can be dragged at all.+ const dnd = canEdit && !isPlaceholder ? drag : undefined+ const partlyPacked = !item.checked && packedOf(item) > 0+ const active = hovered || openreturn (<div+ ref={rowRef}className="group packing-item-row"onMouseEnter={() => setHovered(true)}onMouseLeave={() => setHovered(false)}- onFocus={() => setFocused(true)}- onBlur={e => { if (!e.currentTarget.contains(e.relatedTarget as Node)) setFocused(false) }}- onDragOver={canDrag ? (e => { e.preventDefault(); e.dataTransfer.dropEffect = 'move'; drag!.onOver(item.id) }) : undefined}- onDragLeave={canDrag ? (e => { if (!e.currentTarget.contains(e.relatedTarget as Node)) drag!.onOver(-1) }) : undefined}- onDrop={canDrag ? (e => { e.preventDefault(); e.stopPropagation(); drag!.onDrop(item.id) }) : undefined}+ onDragOver={dnd ? (e => { e.preventDefault(); e.dataTransfer.dropEffect = 'move'; dnd.onOver(item.id) }) : undefined}+ onDragLeave={dnd ? (e => { if (!e.currentTarget.contains(e.relatedTarget as Node)) dnd.onOver(-1) }) : undefined}+ onDrop={dnd ? (e => { e.preventDefault(); e.stopPropagation(); dnd.onDrop(item.id) }) : undefined}style={{display: 'flex', alignItems: 'center', gap: 9,- padding: '8px 10px', borderRadius: 10, position: 'relative',- background: hovered ? 'var(--bg-secondary)' : 'transparent',+ padding: '8px 10px', borderRadius: 10, position: 'relative', minHeight: 40,+ background: active ? 'var(--bg-secondary)' : 'transparent',+ boxShadow: drag?.isOver ? 'inset 3px 0 0 0 var(--accent)' : (open ? 'inset 0 0 0 1px var(--border-primary)' : 'none'),opacity: drag?.isDragging ? 0.4 : 1,- boxShadow: drag?.isOver ? 'inset 3px 0 0 0 var(--accent)' : 'none',transition: 'background 0.1s, opacity 0.15s',}}>- {divider && !hovered && <span aria-hidden className="pointer-events-none absolute inset-x-2.5 top-0 h-px bg-edge-faint" />}- {canDrag && (+ {divider && !active && <span aria-hidden className="pointer-events-none absolute inset-x-2.5 top-0 h-px bg-edge-faint" />}+ {dnd && (<divdraggable- onDragStart={e => { e.stopPropagation(); e.dataTransfer.effectAllowed = 'move'; drag!.onStart(item.id) }}- onDragEnd={() => drag!.onEnd()}- title=""- style={{ cursor: 'grab', display: 'flex', alignItems: 'center', color: 'var(--text-faint)', flexShrink: 0, opacity: hovered ? 1 : 0.35, transition: 'opacity 0.15s' }}+ onDragStart={e => { e.stopPropagation(); e.dataTransfer.effectAllowed = 'move'; dnd.onStart(item.id) }}+ onDragEnd={() => dnd.onEnd()}+ className="flex shrink-0 cursor-grab items-center text-content-faint transition-opacity"+ style={{ opacity: hovered ? 1 : 0 }}><GripVertical size={13} /></div>)}{/* Sorted A-Z there is nothing to drag, but the box keeps its column. */}- {!canDrag && canEdit && !isPlaceholder && <span aria-hidden style={{ width: 13, flexShrink: 0 }} />}- {/* The phone's box: filled with the accent once packed, an outline until then. */}- <button type="button" onClick={handleToggle} className="packing-check" aria-pressed={!!item.checked} style={{+ {!dnd && canEdit && !isPlaceholder && <span aria-hidden style={{ width: 13, flexShrink: 0 }} />}+ <button type="button" onClick={() => void togglePackingItem(tripId, item.id, !item.checked)} className="packing-check" aria-pressed={!!item.checked} style={{flexShrink: 0, cursor: 'pointer', padding: 0, width: 20, height: 20, borderRadius: 6,display: 'grid', placeItems: 'center',border: `1.5px solid ${item.checked || partlyPacked ? 'var(--accent)' : 'var(--text-faint)'}`,@@ -199,266 +192,25 @@ export function ArtikelZeile({ item, tripId, categories, onCategoryChange: _onCa}} /></button>- {editing && canEdit ? (- <input- type="text" value={editName} autoFocus- placeholder={isPlaceholder ? '...' : undefined}- onChange={e => setEditName(e.target.value)}- onBlur={() => void handleSaveName()}- onKeyDown={e => { if (e.key === 'Enter') void handleSaveName(true); if (e.key === 'Escape') { setEditing(false); setEditName(isPlaceholder ? '' : item.name) } }}- style={{ flex: 1, minWidth: 0, fontSize: 'calc(13.5px * var(--fs-scale-body, 1))', padding: '2px 8px', borderRadius: 6, border: '1px solid var(--border-primary)', outline: 'none', fontFamily: 'inherit' }}- />- ) : canEdit ? (- <button- type="button"- onClick={() => setEditing(true)}- style={{ ...nameStyle, border: 'none', background: 'none', padding: 0, textAlign: 'start', fontFamily: 'inherit' }}- >- {item.name}- </button>+ {isPlaceholder && canEdit ? (+ <PlaceholderField item={item} tripId={tripId} onFilled={onPlaceholderFilled} />) : (- <span style={nameStyle}>- {item.name}- </span>- )}-- {/* Sharing badges (#858 three-tier), as compact chips like the phone's- (#1525): the full sentence is the tooltip and the accessible name. */}- {!isPlaceholder && sharedToMe && (- <Tooltip label={t('packing.takenCareOf', { name: item.owner_username || '' })}>- <span className="packing-row-badge" aria-label={t('packing.takenCareOf', { name: item.owner_username || '' })}- style={{ display: 'inline-flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0, width: 22, height: 22, borderRadius: 99, color: 'var(--accent)', background: 'color-mix(in srgb, var(--accent) 12%, transparent)' }}>- <HandHelping size={12} />- </span>- </Tooltip>- )}- {!isPlaceholder && sharedByMe && (- <Tooltip label={`${t('packing.sharedWithCount', { count: recipients.length })}: ${recipients.map(r => r.username).join(', ')}`}>- <span className="packing-row-badge" aria-label={t('packing.sharedWithCount', { count: recipients.length })}- style={{ display: 'inline-flex', alignItems: 'center', gap: 3, flexShrink: 0, height: 22, padding: '0 7px', borderRadius: 99, fontSize: 'calc(10px * var(--fs-scale-caption, 1))', fontWeight: 700, color: 'var(--text-muted)', background: 'var(--bg-tertiary)' }}>- <UserRound size={11} /> {recipients.length}- </span>- </Tooltip>- )}- {!isPlaceholder && !item.is_private && bringers.length > 0 && (- <Tooltip label={t('packing.broughtBy', { name: packingBringerNames(item) })} content={<BringersCard bringers={bringers} />}>- {/* A click on the faces opens the menu right at the bringers (#3098). */}- {canPickBringers ? (- <button type="button" className="packing-row-badge" aria-label={t('packing.broughtBy', { name: packingBringerNames(item) })}- onClick={() => { setShowItemMenu(true); setShowMenuBringers(true) }}- style={{ display: 'inline-flex', alignItems: 'center', flexShrink: 0, border: 'none', background: 'none', padding: 0, cursor: 'pointer' }}>- <BringerAvatar bringer={bringers[0]} />- {bringers.length > 1 && <MoreBringers count={bringers.length - 1} />}- </button>- ) : (- <span className="packing-row-badge" aria-label={t('packing.broughtBy', { name: packingBringerNames(item) })}- style={{ display: 'inline-flex', alignItems: 'center', flexShrink: 0 }}>- <BringerAvatar bringer={bringers[0]} />- {bringers.length > 1 && <MoreBringers count={bringers.length - 1} />}- </span>- )}- </Tooltip>- )}-- <div className="packing-row-inline-actions" style={{ display: 'flex', alignItems: 'center', gap: 6, flexShrink: 0 }}>- {canEdit && !isPlaceholder && quantity > 1 && (- <PackedCounter packed={packed} quantity={quantity} onChange={count => setPackedCount(tripId, item.id, count)} style={reveal(active || partlyPacked)} />- )}- {/* Quantity */}- {canEdit && <QuantityInput value={quantity} onSave={qty => updatePackingItem(tripId, item.id, { quantity: qty })} style={badge(active || quantity > 1)} />}-- {/* Weight + Bag (when enabled) */}- {bagTrackingEnabled && (- <>- <div style={{ display: 'flex', alignItems: 'center', gap: 2, border: '1px solid var(--border-primary)', borderRadius: 8, padding: '3px 6px', background: 'transparent', ...badge(active || item.weight_grams != null) }}>- <WeightInput value={item.weight_grams} readOnly={!canEdit} width={36} onSave={saveWeight} />- <span style={{ fontSize: 'calc(10px * var(--fs-scale-caption, 1))', color: 'var(--text-faint)', userSelect: 'none' }}>g</span>- </div>- <div style={{ position: 'relative' }}>- <button type="button"- ref={bagBtnRef}- onClick={() => canEdit && setShowBagPicker(p => !p)}- style={{- width: 22, height: 22, borderRadius: '50%', cursor: canEdit ? 'pointer' : 'default', padding: 0, display: 'flex', alignItems: 'center', justifyContent: 'center',- border: item.bag_id ? `2.5px solid ${selectedBag?.color || 'var(--border-primary)'}` : '2px dashed var(--border-primary)',- background: item.bag_id ? `${selectedBag?.color || 'var(--border-primary)'}30` : 'transparent',- opacity: item.bag_id || active ? 1 : 0.45, transition: 'opacity 120ms ease',- }}- >- {!item.bag_id && <Package size={9} className="text-content-faint" />}- </button>- {showBagPicker && bagBox && createPortal(- <>- <div role="presentation" style={{ position: 'fixed', inset: 0, zIndex: 'var(--z-toast)' }} onClick={() => { setShowBagPicker(false); setBagInlineCreate(false); setBagInlineName('') }} />- <div className="trek-menu-enter" style={{- ...POPOVER, position: 'fixed', zIndex: 'var(--z-toast)', width: 210, overflowY: 'auto',- top: bagBox.top, bottom: bagBox.bottom, maxHeight: bagBox.maxHeight,- left: Math.max(8, bagBox.left + bagBox.width - 210),- }}>- <div style={POPOVER_CAPTION}>{t('packing.bags')}</div>- {item.bag_id && (- <PopoverItem icon={<span style={{ width: 10, height: 10, borderRadius: '50%', border: '1.5px dashed var(--text-faint)', display: 'inline-block' }} />} label={t('packing.noBag')}- onClick={async () => { setShowBagPicker(false); try { await updatePackingItem(tripId, item.id, { bag_id: null }) } catch { toast.error(t('packing.toast.saveError')) } }} />- )}- {bags.map(b => (- <PopoverItem key={b.id} icon={<span style={{ width: 10, height: 10, borderRadius: '50%', background: b.color, display: 'inline-block' }} />} label={b.name} active={item.bag_id === b.id}- onClick={async () => { setShowBagPicker(false); try { await updatePackingItem(tripId, item.id, { bag_id: b.id }) } catch { toast.error(t('packing.toast.saveError')) } }} />- ))}- {bags.length > 0 && <div style={POPOVER_DIVIDER} />}- {bagInlineCreate ? (- <div style={{ display: 'flex', gap: 6, padding: 4 }}>- <input autoFocus value={bagInlineName} onChange={e => setBagInlineName(e.target.value)}- onKeyDown={async e => {- if (e.key === 'Enter' && bagInlineName.trim()) {- const newBag = await onCreateBag(bagInlineName.trim())- if (newBag) { try { await updatePackingItem(tripId, item.id, { bag_id: newBag.id }) } catch { toast.error(t('packing.toast.saveError')) } }- setBagInlineName(''); setBagInlineCreate(false); setShowBagPicker(false)- }- if (e.key === 'Escape') { setBagInlineCreate(false); setBagInlineName('') }- }}- placeholder={t('packing.bagName')}- style={{ flex: 1, minWidth: 0, padding: '6px 9px', borderRadius: 8, border: '1px solid var(--border-primary)', fontSize: 'calc(12px * var(--fs-scale-body, 1))', fontFamily: 'inherit', outline: 'none', color: 'var(--text-primary)', background: 'var(--bg-input)' }} />- <button type="button" aria-label={t('common.add')} onClick={async () => {- if (bagInlineName.trim()) {- const newBag = await onCreateBag(bagInlineName.trim())- if (newBag) { try { await updatePackingItem(tripId, item.id, { bag_id: newBag.id }) } catch { toast.error(t('packing.toast.saveError')) } }- setBagInlineName(''); setBagInlineCreate(false); setShowBagPicker(false)- }- }}- style={{ width: 30, borderRadius: 8, border: 'none', background: 'var(--accent)', color: 'var(--accent-text)', cursor: 'pointer', display: 'grid', placeItems: 'center', flexShrink: 0, opacity: bagInlineName.trim() ? 1 : 0.35 }}>- <Plus size={13} strokeWidth={2.5} />- </button>- </div>- ) : (- <PopoverItem icon={<Plus size={13} />} label={t('packing.addBag')} muted onClick={() => setBagInlineCreate(true)} />- )}- </div>- </>,- document.body,- )}- </div>- </>- )}- </div>-- {/* Deleting stays one click away; moving, sharing and renaming live in the- menu next to it, and a click on the name renames as well. */}- {canEdit && (- <div className="packing-row-inline-actions" style={{ display: 'flex', gap: 2, alignItems: 'center', flexShrink: 0, ...reveal(active) }}>- <button type="button" onClick={handleDelete} title={t('common.delete')} aria-label={t('common.delete')} style={{ background: 'none', border: 'none', cursor: 'pointer', padding: '3px 4px', borderRadius: 6, display: 'flex', color: 'var(--text-faint)' }}- onMouseEnter={e => e.currentTarget.style.color = '#ef4444'} onMouseLeave={e => e.currentTarget.style.color = 'var(--text-faint)'}>- <Trash2 size={13} />+ <button type="button" onClick={() => setOpen(true)} aria-haspopup="dialog" aria-expanded={open}+ className="flex min-w-0 flex-1 cursor-pointer items-center gap-2.5 rounded-md border-0 bg-transparent p-0 font-[inherit] outline-none [-webkit-tap-highlight-color:transparent] focus-visible:ring-2 focus-visible:ring-accent">+ <span style={nameStyle(!!item.checked, isPlaceholder)}>{item.name}</span>+ {!isPlaceholder && <RowFacts item={item} tripMembers={tripMembers} currentUserId={currentUserId} />}+ <ChevronRight size={14} aria-hidden className="shrink-0 text-content-faint transition-opacity" style={{ opacity: active ? 1 : 0 }} /></button>- </div>)}- {canEdit && (- <div className="packing-row-overflow" style={{ display: 'flex', flexShrink: 0, position: 'relative', ...reveal(active) }}>- <button type="button"- ref={itemMenuBtnRef}- onClick={() => (showItemMenu ? closeItemMenu() : setShowItemMenu(true))}- title={t('common.showMore')}- aria-label={t('common.showMore')} aria-expanded={showItemMenu}- style={{ width: 26, height: 26, borderRadius: 7, border: 'none', background: showItemMenu ? 'var(--bg-tertiary)' : 'transparent', cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center', color: 'var(--text-faint)', padding: 0 }}- >- <MoreHorizontal size={16} />- </button>- {showItemMenu && (() => {- const rect = itemMenuBtnRef.current?.getBoundingClientRect()- return (- <>- <div role="presentation" style={{ position: 'fixed', inset: 0, zIndex: 1098 }} onClick={closeItemMenu} />- <div className="trek-menu-enter" style={{- ...POPOVER,- position: 'fixed',- right: rect ? Math.max(8, window.innerWidth - rect.right) : 8,- top: rect ? rect.bottom + 6 : 0,- zIndex: 1099,- width: 'min(240px, calc(100vw - 16px))',- maxHeight: '70vh',- overflowY: 'auto',- }}>- {/* Quantity, weight and bag sit in the row itself on a wide screen. */}- <div className="packing-menu-phone-only">- <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12, padding: '6px 8px' }}>- <span style={{ fontSize: 'calc(11px * var(--fs-scale-caption, 1))', fontWeight: 700, color: 'var(--text-faint)', textTransform: 'uppercase', letterSpacing: 0 }}>{t('packing.quantity')}</span>- <QuantityInput value={item.quantity || 1} onSave={qty => updatePackingItem(tripId, item.id, { quantity: qty })} />- </div>-- {bagTrackingEnabled && (- <>- <div style={{ height: 1, background: 'var(--bg-tertiary)', margin: '4px 0' }} />- <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 12, padding: '6px 8px' }}>- <span style={{ fontSize: 'calc(11px * var(--fs-scale-caption, 1))', fontWeight: 700, color: 'var(--text-faint)', textTransform: 'uppercase', letterSpacing: 0 }}>{t('packing.totalWeight')}</span>- <div style={{ display: 'flex', alignItems: 'center', gap: 2, border: '1px solid var(--border-primary)', borderRadius: 8, padding: '3px 6px', background: 'transparent' }}>- <WeightInput value={item.weight_grams} readOnly={!canEdit} width={42} onSave={saveWeight} />- <span style={{ fontSize: 'calc(10px * var(--fs-scale-caption, 1))', color: 'var(--text-faint)', userSelect: 'none' }}>g</span>- </div>- </div>- <div style={{ padding: '2px 0' }}>- <PopoverItem icon={<Package size={13} />} label={selectedBag?.name || t('packing.noBag')} onClick={async () => {- if (item.bag_id) {- try { await updatePackingItem(tripId, item.id, { bag_id: null }) } catch { toast.error(t('packing.toast.saveError')) }- }- }} />- {bags.map(b => (- <PopoverItem key={b.id} icon={<span style={{ width: 10, height: 10, borderRadius: '50%', background: b.color, display: 'inline-block' }} />} label={b.name} active={item.bag_id === b.id} onClick={async () => {- setShowItemMenu(false)- try { await updatePackingItem(tripId, item.id, { bag_id: b.id }) } catch { toast.error(t('packing.toast.saveError')) }- }} />- ))}- </div>- </>- )}-- <div style={POPOVER_DIVIDER} />- </div>- <PopoverItem icon={<span style={{ width: 9, height: 9, borderRadius: '50%', background: katColor(item.category || t('packing.defaultCategory'), categories), display: 'inline-block' }} />} label={t('packing.changeCategory')} onClick={() => setShowMenuCategories(v => !v)}- trailing={showMenuCategories ? <ChevronDown size={13} style={{ color: 'var(--text-faint)', flexShrink: 0 }} /> : <ChevronRight size={13} style={{ color: 'var(--text-faint)', flexShrink: 0 }} />} />- {showMenuCategories && (- <div style={{ marginBlock: '2px 4px', marginInlineStart: 18, paddingInlineStart: 6, borderInlineStart: '1px solid var(--border-faint)' }}>- {categories.map(cat => (- <PopoverItem key={cat} icon={<span style={{ width: 8, height: 8, borderRadius: '50%', background: katColor(cat, categories), display: 'inline-block' }} />} label={cat} active={cat === (item.category || t('packing.defaultCategory'))} onClick={() => handleCatChange(cat)} />- ))}- </div>- )}-- {canPickBringers && (- <>- <PopoverItem icon={<HandHelping size={13} />} label={t('packing.bringersTitle')} onClick={() => setShowMenuBringers(v => !v)}- trailing={showMenuBringers ? <ChevronDown size={13} style={{ color: 'var(--text-faint)', flexShrink: 0 }} /> : <ChevronRight size={13} style={{ color: 'var(--text-faint)', flexShrink: 0 }} />} />- {showMenuBringers && (- <div style={{ marginBlock: '2px 4px', marginInlineStart: 18, paddingInlineStart: 6, borderInlineStart: '1px solid var(--border-faint)' }}>- {tripMembers.map(m => (- <PopoverItem key={m.id} icon={<BringerAvatar bringer={{ name: m.username, avatar: m.avatar_url ?? m.avatar ?? null }} />} label={m.username} active={isBringer(m.id)} onClick={() => toggleBringer(m.id)} />- ))}- </div>- )}- </>- )}-- {canShare && onClone && onJoin && onLeave && (- <PackingShareControl- variant="menu"- item={item}- tripMembers={tripMembers}- currentUserId={currentUserId}- onSetSharing={onSetSharing!}- onClone={onClone}- onJoin={onJoin}- onLeave={onLeave}- onAction={() => setShowItemMenu(false)}- />- )}-- <div style={POPOVER_DIVIDER} />- <PopoverItem icon={<Pencil size={13} />} label={t('common.rename')} onClick={() => { setEditing(true); setShowItemMenu(false) }} />- <PopoverItem icon={<Trash2 size={13} />} label={t('common.delete')} danger onClick={() => { setShowItemMenu(false); void handleDelete() }} />- </div>- </>- )- })()}- </div>+ {open && (+ <PackingItemDetail+ item={item} tripId={tripId} anchorRef={rowRef} onClose={() => setOpen(false)}+ categories={categories} canEdit={canEdit} bagTrackingEnabled={bagTrackingEnabled} bags={bags} onCreateBag={onCreateBag}+ tripMembers={tripMembers} currentUserId={currentUserId}+ onSetSharing={onSetSharing} onClone={onClone} onJoin={onJoin} onLeave={onLeave}+ onDelete={() => void handleDelete()}+ />)}</div>)diff --git a/client/src/components/Packing/PackingListPanelQuantityInput.test.tsx b/client/src/components/Packing/PackingListPanelQuantityInput.test.tsxdeleted file mode 100644index 736a36534..000000000--- a/client/src/components/Packing/PackingListPanelQuantityInput.test.tsx+++ /dev/null@@ -1,47 +0,0 @@-// FE-COMP-PACKING-082 to FE-COMP-PACKING-083-import { vi } from 'vitest';-import { render, screen, waitFor, fireEvent } from '../../../tests/helpers/render';-import { QuantityInput } from './PackingListPanelQuantityInput';--describe('QuantityInput', () => {- it('FE-COMP-PACKING-082: selects the current value on focus so typing replaces it', async () => {- render(<QuantityInput value={1} onSave={() => {}} />);- const input = screen.getByRole('textbox') as HTMLInputElement;-- fireEvent.focus(input);-- await waitFor(() => {- expect(input.selectionStart).toBe(0);- expect(input.selectionEnd).toBe(1);- });- });-- it('FE-COMP-PACKING-083: commits the typed quantity on blur', async () => {- const onSave = vi.fn();- render(<QuantityInput value={1} onSave={onSave} />);- const input = screen.getByRole('textbox') as HTMLInputElement;-- fireEvent.change(input, { target: { value: '6' } });- fireEvent.blur(input);-- await waitFor(() => expect(onSave).toHaveBeenCalledWith(6));- });-- it('FE-COMP-PACKING-084: #1513 focus-then-type replaces the value instead of appending to it', async () => {- // The end-to-end shape of the bug: with the caret parked at the end, typing 6 over a- // quantity of 1 committed 16. Selecting on focus makes the keystroke overwrite.- const onSave = vi.fn();- render(<QuantityInput value={1} onSave={onSave} />);- const input = screen.getByRole('textbox') as HTMLInputElement;-- fireEvent.focus(input);- await waitFor(() => expect(input.selectionEnd).toBe(1));-- // A selected value means the browser replaces it — simulate the resulting input event.- fireEvent.change(input, { target: { value: '6' } });- fireEvent.blur(input);-- await waitFor(() => expect(onSave).toHaveBeenCalledWith(6));- expect(onSave).not.toHaveBeenCalledWith(16);- });-});diff --git a/client/src/components/Packing/PackingListPanelQuantityInput.tsx b/client/src/components/Packing/PackingListPanelQuantityInput.tsxdeleted file mode 100644index 7f3197d6b..000000000--- a/client/src/components/Packing/PackingListPanelQuantityInput.tsx+++ /dev/null@@ -1,27 +0,0 @@-import { useState, useEffect, type CSSProperties } from 'react'-import { NumericInput } from '../shared/NumericInput'--/** `style` lays over the frame, for a row that wants the field quieter at rest. */-export function QuantityInput({ value, onSave, style }: { value: number; onSave: (qty: number) => void; style?: CSSProperties }) {- const [local, setLocal] = useState(String(value))- useEffect(() => setLocal(String(value)), [value])-- const commit = () => {- const qty = Math.max(1, Math.min(999, Number(local) || 1))- setLocal(String(qty))- if (qty !== value) onSave(qty)- }-- return (- <div style={{ display: 'flex', alignItems: 'center', gap: 2, border: '1px solid var(--border-primary)', borderRadius: 8, padding: '3px 6px', background: 'transparent', flexShrink: 0, ...style }}>- <NumericInput- value={local}- onValueChange={setLocal}- onBlur={commit}- onKeyDown={e => { if (e.key === 'Enter') { commit(); (e.target as HTMLInputElement).blur() } }}- style={{ width: 24, border: 'none', outline: 'none', background: 'transparent', fontSize: 'calc(12px * var(--fs-scale-body, 1))', textAlign: 'end', fontFamily: 'inherit', color: 'var(--text-secondary)', padding: 0 }}- />- <span style={{ fontSize: 'calc(10px * var(--fs-scale-caption, 1))', color: 'var(--text-faint)', fontWeight: 500 }}>x</span>- </div>- )-}diff --git a/client/src/components/Packing/PackingListPanelViewTabs.tsx b/client/src/components/Packing/PackingListPanelViewTabs.tsxindex 4178b094d..ba3aaef8a 100644--- a/client/src/components/Packing/PackingListPanelViewTabs.tsx+++ b/client/src/components/Packing/PackingListPanelViewTabs.tsx@@ -1,34 +1,28 @@-import { Users, UserRound, ArrowDownAZ } from 'lucide-react'+import { Users, UserRound, CheckCheck } from 'lucide-react'import type { PackingState } from './usePackingListPanel'/**- * One tab row: the three-tier view switch (Gemeinsam / Meine Liste, #858) on the- * left, then the all/open/done filter. Each sits in its own tinted track, the way- * the phone shows them, so the row reads as two questions (whose list, which- * state) rather than five pills of equal weight. The A-Z switch keeps to the far- * end in a track of its own: it changes the order, not what is listed.+ * One row above the lists: whose list (Gemeinsam / Meine Liste, #858) on the+ * left in a tinted track, and how far the packing has come on the right as a+ * line of text with a slim bar. Showing packed items and the order live in the+ * Lists menu, so the row asks one question and answers one.*/export function PackingViewTabs(S: PackingState) {- const { view, setView, filter, setFilter, sort, setSort, t, items } = S+ const { view, setView, t, items, abgehakt, viewTotal, fortschritt } = Sconst commonCount = items.filter(i => !i.is_private).lengthconst personalCount = items.filter(i => !!i.is_private).length- const track: React.CSSProperties = {- display: 'inline-flex', alignItems: 'center', gap: 2, padding: 3, borderRadius: 999, background: 'var(--bg-tertiary)',- }- const segment = (active: boolean): React.CSSProperties => ({- display: 'inline-flex', alignItems: 'center', gap: 6, height: 28, padding: '0 13px', borderRadius: 999,- border: 'none', cursor: 'pointer', fontFamily: 'inherit',- fontSize: 'calc(12.5px * var(--fs-scale-body, 1))', fontWeight: 600, transition: 'all 0.12s',- background: active ? 'var(--text-primary)' : 'transparent',- color: active ? 'var(--bg-primary)' : 'var(--text-muted)',- boxShadow: active ? '0 1px 2px rgba(0,0,0,0.12)' : 'none',- })-const viewPill = (id: 'common' | 'personal', icon: React.ReactNode, label: string, count: number) => {const active = view === idreturn (- <button type="button" onClick={() => setView(id)} style={segment(active)}>+ <button type="button" onClick={() => setView(id)} aria-pressed={active} style={{+ display: 'inline-flex', alignItems: 'center', gap: 6, height: 28, padding: '0 13px', borderRadius: 999,+ border: 'none', cursor: 'pointer', fontFamily: 'inherit',+ fontSize: 'calc(12.5px * var(--fs-scale-body, 1))', fontWeight: 600, transition: 'all 0.12s',+ background: active ? 'var(--text-primary)' : 'transparent',+ color: active ? 'var(--bg-primary)' : 'var(--text-muted)',+ boxShadow: active ? '0 1px 2px rgba(0,0,0,0.12)' : 'none',+ }}>{icon}{label}<span style={{fontSize: 'calc(10px * var(--fs-scale-caption, 1))', fontWeight: 700, borderRadius: 99, padding: '0 6px',@@ -39,30 +33,22 @@ export function PackingViewTabs(S: PackingState) {)}- const filterPill = (id: string, label: string) => (- <button type="button" key={id} onClick={() => setFilter(id)} style={segment(filter === id)}>{label}</button>- )-return (- <div style={{ display: 'flex', alignItems: 'center', gap: 8, padding: '10px 0 0', flexShrink: 0, flexWrap: 'wrap' }}>- <div style={track}>+ <div style={{ display: 'flex', alignItems: 'center', gap: 12, padding: '10px 0 0', flexShrink: 0, flexWrap: 'wrap' }}>+ <div style={{ display: 'inline-flex', alignItems: 'center', gap: 2, padding: 3, borderRadius: 999, background: 'var(--bg-tertiary)' }}>{viewPill('common', <Users size={14} />, t('packing.viewCommon'), commonCount)}{viewPill('personal', <UserRound size={14} />, t('packing.viewPersonal'), personalCount)}</div>- {items.length > 0 && (- <div style={track}>- {filterPill('alle', t('packing.filterAll'))}- {filterPill('offen', t('packing.filterOpen'))}- {filterPill('erledigt', t('packing.filterDone'))}- </div>- )}- {items.length > 0 && (- // A second click on the active switch goes back to the manual order.- <div role="group" aria-label={t('packing.sortBy')} style={{ ...track, marginInlineStart: 'auto' }}>- <button type="button" aria-pressed={sort === 'name'} title={t('packing.sortByName')}- onClick={() => setSort(sort === 'name' ? 'manual' : 'name')} style={segment(sort === 'name')}>- <ArrowDownAZ size={14} /><span className="hidden sm:inline">{t('packing.sortByName')}</span>- </button>+ {viewTotal > 0 && (+ <div className="ms-auto inline-flex items-center gap-2.5 text-caption tabular-nums text-content-muted">+ {fortschritt === 100 ? (+ <span className="inline-flex items-center gap-1.5 font-semibold text-success"><CheckCheck size={14} strokeWidth={2.5} />{t('packing.allPacked')}</span>+ ) : (+ <span>{t('packing.packedCount', { packed: abgehakt, total: viewTotal })}</span>+ )}+ <span aria-hidden className="h-1.5 w-[120px] overflow-hidden rounded-full bg-surface-tertiary">+ <span className={`block h-full rounded-full transition-[width] duration-500 ${fortschritt === 100 ? 'bg-success' : 'bg-accent'}`} style={{ width: `${fortschritt}%` }} />+ </span></div>)}</div>diff --git a/client/src/components/Packing/PackingListsMenu.test.tsx b/client/src/components/Packing/PackingListsMenu.test.tsxnew file mode 100644index 000000000..8acffb828--- /dev/null+++ b/client/src/components/Packing/PackingListsMenu.test.tsx@@ -0,0 +1,147 @@+// FE-PACKLISTSMENU-001 to FE-PACKLISTSMENU-008+import type { ComponentProps } from 'react';+import { beforeEach, describe, expect, it, vi } from 'vitest';+import { fireEvent, render, screen } from '../../../tests/helpers/render';+import { useAddonStore } from '../../store/addonStore';++const applyProps = vi.fn();+const exportProps = vi.fn();+vi.mock('./ApplyTemplateButton', () => ({+ default: (props: { onApplied?: () => void }) => {+ applyProps(props);+ return (+ <button type="button" onClick={props.onApplied}>+ Apply template+ </button>+ );+ },+}));+vi.mock('./PackingExportMenu', () => ({+ default: (props: { onChosen?: () => void }) => {+ exportProps(props);+ return (+ <button type="button" onClick={props.onChosen}>+ Print or save as PDF+ </button>+ );+ },+}));++import PackingListsMenu from './PackingListsMenu';++type Props = ComponentProps<typeof PackingListsMenu>;++function setup(overrides: Partial<Props> = {}) {+ const props: Props = {+ tripId: 4,+ view: 'common',+ canEdit: true,+ isAdmin: true,+ hasItems: true,+ packedCount: 0,+ sort: 'manual',+ onSortChange: vi.fn(),+ hideDone: false,+ onHideDoneChange: vi.fn(),+ onImport: vi.fn(),+ onSaveTemplate: vi.fn(),+ onClearChecked: vi.fn(),+ onOpenBags: vi.fn(),+ buttonClassName: 'btn',+ buttonStyle: {},+ ...overrides,+ };+ render(<PackingListsMenu {...props} />);+ const trigger = screen.getByRole('button', { name: 'Show more' });+ return { props, trigger, menu: () => screen.getByRole('menu', { hidden: true }) };+}++beforeEach(() => {+ vi.clearAllMocks();+ useAddonStore.setState({ bagTracking: false });+});++describe('PackingListsMenu', () => {+ it('FE-PACKLISTSMENU-001: the "..." opens and closes the menu, a click beside it closes it too', () => {+ const { trigger, menu } = setup();+ expect(menu()).not.toBeVisible();+ fireEvent.click(trigger);+ expect(trigger).toHaveAttribute('aria-expanded', 'true');+ expect(menu()).toBeVisible();+ fireEvent.click(document.querySelector('[role="presentation"]')!);+ expect(menu()).not.toBeVisible();+ });++ it('FE-PACKLISTSMENU-002: templates and export sit in it, for the view on screen, and close it once used', () => {+ const { trigger, menu } = setup({ view: 'personal' });+ expect(applyProps).toHaveBeenCalledWith(+ expect.objectContaining({ tripId: 4, visibility: 'personal', variant: 'menu' })+ );+ expect(exportProps).toHaveBeenCalledWith(expect.objectContaining({ tripId: 4, view: 'personal', variant: 'menu' }));+ fireEvent.click(trigger);+ fireEvent.click(screen.getByRole('button', { name: 'Apply template' }));+ expect(menu()).not.toBeVisible();+ fireEvent.click(trigger);+ fireEvent.click(screen.getByRole('button', { name: 'Print or save as PDF' }));+ expect(menu()).not.toBeVisible();+ });++ it('FE-PACKLISTSMENU-003: import and save as template hand over and close the menu', () => {+ const { trigger, props, menu } = setup();+ fireEvent.click(trigger);+ fireEvent.click(screen.getByRole('button', { name: 'Import' }));+ expect(props.onImport).toHaveBeenCalledTimes(1);+ expect(menu()).not.toBeVisible();+ fireEvent.click(trigger);+ fireEvent.click(screen.getByRole('button', { name: 'Save as template' }));+ expect(props.onSaveTemplate).toHaveBeenCalledTimes(1);+ });++ it('FE-PACKLISTSMENU-004: a reader gets no templates, import, save or clean-up', () => {+ setup({ canEdit: false, packedCount: 3 });+ expect(applyProps).not.toHaveBeenCalled();+ expect(screen.queryByRole('button', { name: 'Import', hidden: true })).toBeNull();+ expect(screen.queryByRole('button', { name: 'Save as template', hidden: true })).toBeNull();+ expect(screen.queryByRole('button', { name: /checked/, hidden: true })).toBeNull();+ expect(screen.getByRole('button', { name: /Print or save as PDF/, hidden: true })).toBeInTheDocument();+ });++ it('FE-PACKLISTSMENU-005: save as template is for admins with a list to save', () => {+ setup({ isAdmin: false });+ expect(screen.queryByRole('button', { name: 'Save as template', hidden: true })).toBeNull();+ });++ it('FE-PACKLISTSMENU-006: A to Z and hiding packed items toggle, and show a tick while on', () => {+ const { trigger, props } = setup({ sort: 'name', hideDone: true });+ fireEvent.click(trigger);+ const sort = screen.getByRole('button', { name: 'A to Z' });+ const hide = screen.getByRole('button', { name: 'Hide packed' });+ expect(sort.querySelector('svg.lucide-check')).not.toBeNull();+ expect(hide.querySelector('svg.lucide-check')).not.toBeNull();+ fireEvent.click(sort);+ fireEvent.click(hide);+ expect(props.onSortChange).toHaveBeenCalledWith('manual');+ expect(props.onHideDoneChange).toHaveBeenCalledWith(false);+ });++ it('FE-PACKLISTSMENU-007: an empty list offers no order or hiding, and nothing to clear', () => {+ setup({ hasItems: false });+ expect(screen.queryByRole('button', { name: 'A to Z', hidden: true })).toBeNull();+ expect(screen.queryByRole('button', { name: 'Hide packed', hidden: true })).toBeNull();+ expect(screen.queryByRole('button', { name: /checked/, hidden: true })).toBeNull();+ });++ it('FE-PACKLISTSMENU-008: bags come in with bag tracking, the clean-up with packed items', () => {+ useAddonStore.setState({ bagTracking: true });+ const { trigger, props } = setup({ sort: 'manual', packedCount: 2 });+ fireEvent.click(trigger);+ fireEvent.click(screen.getByRole('button', { name: 'A to Z' }));+ expect(props.onSortChange).toHaveBeenCalledWith('name');+ // The order is a switch: the menu stays open for the next choice.+ fireEvent.click(screen.getByRole('button', { name: 'Bags' }));+ expect(props.onOpenBags).toHaveBeenCalledTimes(1);+ fireEvent.click(trigger);+ fireEvent.click(screen.getByRole('button', { name: 'Remove 2 checked' }));+ expect(props.onClearChecked).toHaveBeenCalledTimes(1);+ });+});diff --git a/client/src/components/Packing/PackingListsMenu.tsx b/client/src/components/Packing/PackingListsMenu.tsxnew file mode 100644index 000000000..1cd018f09--- /dev/null+++ b/client/src/components/Packing/PackingListsMenu.tsx@@ -0,0 +1,133 @@+import { ArrowDownAZ, Check, Download, EyeOff, FolderPlus, Luggage, MoreHorizontal, Trash2 } from 'lucide-react';+import { useState, type CSSProperties } from 'react';+import { useTranslation } from '../../i18n';+import { useAddonStore } from '../../store/addonStore';+import ApplyTemplateButton from './ApplyTemplateButton';+import PackingExportMenu from './PackingExportMenu';+import { PopoverItem } from './PackingPopover';+import { POPOVER, POPOVER_DIVIDER } from './packingPopoverStyles';+import type { PackingSort } from './usePackingListPanel';++interface PackingListsMenuProps {+ tripId: number;+ view: 'common' | 'personal';+ canEdit: boolean;+ isAdmin: boolean;+ hasItems: boolean;+ /** Packed items in the view on screen, for the clean-up line. */+ packedCount: number;+ sort: PackingSort;+ onSortChange: (next: PackingSort) => void;+ hideDone: boolean;+ onHideDoneChange: (next: boolean) => void;+ onImport: () => void;+ onSaveTemplate: () => void;+ onClearChecked: () => void;+ onOpenBags: () => void;+ buttonClassName: string;+ buttonStyle: CSSProperties;+}++/**+ * Everything the packing list needs now and then, behind one "..." beside Add+ * list: templates, import and export, the order, hiding what is packed, the bag+ * overview on a screen too narrow for its sidebar, and clearing the packed items.+ * The panel stays mounted while closed, so a print preview opened from it lives on.+ */+export default function PackingListsMenu(props: Readonly<PackingListsMenuProps>) {+ const {+ tripId,+ view,+ canEdit,+ isAdmin,+ hasItems,+ packedCount,+ sort,+ onSortChange,+ hideDone,+ onHideDoneChange,+ onImport,+ onSaveTemplate,+ onClearChecked,+ onOpenBags,+ buttonClassName,+ buttonStyle,+ } = props;+ const { t } = useTranslation();+ const bagTracking = useAddonStore((s) => s.bagTracking);+ const [open, setOpen] = useState(false);+ const close = () => setOpen(false);+ const run = (action: () => void) => () => {+ close();+ action();+ };+ const tick = (on: boolean) => (on ? <Check size={13} className="shrink-0 text-content-muted" /> : null);++ return (+ <div className="relative flex">+ <button+ type="button"+ onClick={() => setOpen((v) => !v)}+ aria-haspopup="menu"+ aria-expanded={open}+ aria-label={t('common.showMore')}+ title={t('common.showMore')}+ className={buttonClassName}+ style={buttonStyle}+ >+ <MoreHorizontal size={14} strokeWidth={2.5} />+ </button>+ {open && <div role="presentation" className="fixed inset-0 z-[99]" onClick={close} />}+ <div+ role="menu"+ hidden={!open}+ className="trek-menu-enter absolute end-0 top-full z-[100] mt-1.5 w-[260px] origin-top-right"+ style={POPOVER}+ >+ {canEdit && <ApplyTemplateButton tripId={tripId} visibility={view} variant="menu" onApplied={close} />}+ {canEdit && isAdmin && hasItems && (+ <PopoverItem+ icon={<FolderPlus size={13} />}+ label={t('packing.saveAsTemplate')}+ onClick={run(onSaveTemplate)}+ />+ )}+ {canEdit && <PopoverItem icon={<Download size={13} />} label={t('packing.import')} onClick={run(onImport)} />}+ <PackingExportMenu tripId={tripId} view={view} variant="menu" onChosen={close} />+ {hasItems && (+ <>+ <div style={POPOVER_DIVIDER} />+ <PopoverItem+ icon={<ArrowDownAZ size={13} />}+ label={t('packing.sortByName')}+ trailing={tick(sort === 'name')}+ onClick={() => onSortChange(sort === 'name' ? 'manual' : 'name')}+ />+ <PopoverItem+ icon={<EyeOff size={13} />}+ label={t('packing.hideDone')}+ trailing={tick(hideDone)}+ onClick={() => onHideDoneChange(!hideDone)}+ />+ </>+ )}+ {bagTracking && (+ <div className="xl:hidden">+ <PopoverItem icon={<Luggage size={13} />} label={t('packing.bags')} onClick={run(onOpenBags)} />+ </div>+ )}+ {canEdit && packedCount > 0 && (+ <>+ <div style={POPOVER_DIVIDER} />+ <PopoverItem+ icon={<Trash2 size={13} />}+ label={t('packing.clearChecked', { count: packedCount })}+ danger+ onClick={run(onClearChecked)}+ />+ </>+ )}+ </div>+ </div>+ );+}diff --git a/client/src/components/Packing/PackingShareControl.test.tsx b/client/src/components/Packing/PackingShareControl.test.tsxdeleted file mode 100644index 9f5aefba2..000000000--- a/client/src/components/Packing/PackingShareControl.test.tsx+++ /dev/null@@ -1,318 +0,0 @@-// FE-W4PSC-001 to FE-W4PSC-015, FE-W5PSC-001 to FE-W5PSC-009-import { describe, it, expect, vi } from 'vitest'-import type { PackingItem } from '../../types'-import { render, screen, fireEvent } from '../../../tests/helpers/render'-import PackingShareControl from './PackingShareControl'-import type { TripMember } from './usePackingListPanel'--const MEMBERS = [- { id: 1, username: 'ada' },- { id: 2, username: 'bob' },- { id: 3, username: 'cleo' },-] as unknown as TripMember[]--function item(overrides: Partial<PackingItem> = {}): PackingItem {- return { id: 5, name: 'Tent', is_private: 0, owner_id: 1, recipients: [], contributors: [], ...overrides } as unknown as PackingItem-}--function setup(it_: PackingItem, currentUserId = 1) {- const onSetSharing = vi.fn()- const onClone = vi.fn()- const onJoin = vi.fn()- const onLeave = vi.fn()- const utils = render(- <PackingShareControl- item={it_} tripMembers={MEMBERS} currentUserId={currentUserId}- onSetSharing={onSetSharing} onClone={onClone} onJoin={onJoin} onLeave={onLeave}- />,- )- return { onSetSharing, onClone, onJoin, onLeave, ...utils }-}--describe('PackingShareControl — owner', () => {- it('FE-W4PSC-001: shows the share trigger for the owner of a common item', () => {- setup(item())-- expect(screen.getByRole('button', { name: /sharing/i })).toBeInTheDocument()- })-- it('FE-W4PSC-002: opening the menu lists both tiers plus every other member', () => {- setup(item())-- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))-- expect(screen.getByText(/^Shared$/)).toBeInTheDocument()- expect(screen.getByText(/^Personal$/)).toBeInTheDocument()- expect(screen.getByRole('button', { name: /bob/ })).toBeInTheDocument()- expect(screen.getByRole('button', { name: /cleo/ })).toBeInTheDocument()- // Neither the owner nor the current user is offered as a recipient.- expect(screen.queryByRole('button', { name: /ada/ })).toBeNull()- })-- it('FE-W4PSC-003: picking Personal reports the tier and closes the menu', () => {- const { onSetSharing } = setup(item())- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))-- fireEvent.click(screen.getByText(/^Personal$/))-- expect(onSetSharing).toHaveBeenCalledWith(5, 'personal', [])- expect(screen.queryByText(/^Personal$/)).toBeNull()- })-- it('FE-W4PSC-004: picking the common tier reports it', () => {- const { onSetSharing } = setup(item({ is_private: 1 } as Partial<PackingItem>))- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))-- fireEvent.click(screen.getByText(/^Shared$/))-- expect(onSetSharing).toHaveBeenCalledWith(5, 'common', [])- })-- it('FE-W4PSC-005: toggling a member on shares the item with them', () => {- const { onSetSharing } = setup(item({ is_private: 1 } as Partial<PackingItem>))- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))-- fireEvent.click(screen.getByRole('button', { name: /bob/ }))-- expect(onSetSharing).toHaveBeenCalledWith(5, 'shared', [2])- })-- it('FE-W4PSC-006: toggling an existing recipient off removes them', () => {- const { onSetSharing } = setup(item({ is_private: 1, recipients: [{ user_id: 2 }, { user_id: 3 }] } as unknown as Partial<PackingItem>))- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))-- fireEvent.click(screen.getByRole('button', { name: /bob/ }))-- expect(onSetSharing).toHaveBeenCalledWith(5, 'shared', [3])- })-- it('FE-W4PSC-007: an item with recipients reads as the shared tier', () => {- setup(item({ is_private: 1, recipients: [{ user_id: 2 }] } as unknown as Partial<PackingItem>))- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))-- // The chosen recipient carries the check mark.- expect(screen.getByRole('button', { name: /bob/ }).querySelector('svg')).not.toBeNull()- })-- it('FE-W4PSC-008: shows a hint when there is nobody else to share with', () => {- render(- <PackingShareControl- item={item()} tripMembers={[MEMBERS[0]]} currentUserId={1}- onSetSharing={() => {}} onClone={() => {}} onJoin={() => {}} onLeave={() => {}}- />,- )- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))-- expect(screen.getByText(/no one/i)).toBeInTheDocument()- })-- it('FE-W4PSC-009: the scrim closes the menu', () => {- const { baseElement } = setup(item())- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))-- // The scrim is the portaled full-screen layer that sits just under the menu.- fireEvent.click(baseElement.querySelector('div[style*="z-index: 1099"]')!)-- expect(screen.queryByText(/^Personal$/)).toBeNull()- })-- it('FE-W4PSC-010: the trigger toggles the menu closed again', () => {- setup(item())- const trigger = screen.getByRole('button', { name: /sharing/i })-- fireEvent.click(trigger)- expect(screen.getByText(/^Personal$/)).toBeInTheDocument()-- fireEvent.click(trigger)- expect(screen.queryByText(/^Personal$/)).toBeNull()- })-- it('FE-W4PSC-011: an unowned item is treated as the current user own', () => {- setup(item({ owner_id: null } as unknown as Partial<PackingItem>), 9)-- expect(screen.getByRole('button', { name: /sharing/i })).toBeInTheDocument()- })-})--describe('PackingShareControl — other members', () => {- it('FE-W4PSC-012: a non-owner can pledge to co-bring a common item', () => {- const { onJoin } = setup(item(), 2)-- const buttons = screen.getAllByRole('button')- expect(buttons).toHaveLength(2)- fireEvent.click(buttons[0])-- expect(onJoin).toHaveBeenCalledWith(5)- })-- it('FE-W4PSC-013: a pledged contributor can withdraw again', () => {- const { onLeave } = setup(item({ contributors: [{ user_id: 2 }] } as unknown as Partial<PackingItem>), 2)-- fireEvent.click(screen.getAllByRole('button')[0])-- expect(onLeave).toHaveBeenCalledWith(5, 2)- })-- it('FE-W4PSC-014: a non-owner can clone a common item to their own list', () => {- const { onClone } = setup(item(), 2)-- fireEvent.click(screen.getAllByRole('button')[1])-- expect(onClone).toHaveBeenCalledWith(5)- })-- it('FE-W4PSC-015: a recipient of a shared item gets no controls', () => {- const { container } = setup(item({ is_private: 1, recipients: [{ user_id: 2 }] } as unknown as Partial<PackingItem>), 2)-- expect(container).toBeEmptyDOMElement()- })-})--describe('PackingShareControl — hover affordances', () => {- it('FE-W5PSC-001: the trigger of a common item highlights on hover and resets on leave', () => {- setup(item())- const trigger = screen.getByRole('button', { name: /sharing/i })-- fireEvent.mouseEnter(trigger)- expect(trigger.style.color).toBe('var(--text-secondary)')-- fireEvent.mouseLeave(trigger)- expect(trigger.style.color).toBe('var(--text-faint)')- })-- it('FE-W5PSC-002: a non-common item keeps its accent colour while hovered', () => {- setup(item({ is_private: 1 } as Partial<PackingItem>))- const trigger = screen.getByRole('button', { name: /sharing/i })-- fireEvent.mouseEnter(trigger)- expect(trigger.style.color).toBe('var(--accent)')-- fireEvent.mouseLeave(trigger)- expect(trigger.style.color).toBe('var(--accent)')- })-- it('FE-W5PSC-003: the inactive tier row takes a hover background and drops it again', () => {- setup(item())- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))- // The item is Common, so the Personal row is the inactive one.- const personalRow = screen.getByText(/^Personal$/).closest('button')!-- fireEvent.mouseEnter(personalRow)- expect(personalRow.style.background).toBe('var(--bg-tertiary)')-- fireEvent.mouseLeave(personalRow)- expect(personalRow.style.background).toBe('none')- })-- it('FE-W5PSC-004: the active tier row ignores hover', () => {- setup(item())- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))- const commonRow = screen.getByText(/^Shared$/).closest('button')!- const before = commonRow.style.background-- fireEvent.mouseEnter(commonRow)- fireEvent.mouseLeave(commonRow)-- expect(commonRow.style.background).toBe(before)- })-- it('FE-W5PSC-005: a recipient row highlights on hover', () => {- setup(item({ is_private: 1 } as Partial<PackingItem>))- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))- const bob = screen.getByRole('button', { name: /bob/ })-- fireEvent.mouseEnter(bob)- expect(bob.style.background).toBe('var(--bg-tertiary)')-- fireEvent.mouseLeave(bob)- expect(bob.style.background).toBe('none')- })-- it('FE-W5PSC-006: the co-bring button of a non-contributor highlights on hover', () => {- setup(item(), 2)- const pledge = screen.getAllByRole('button')[0]-- fireEvent.mouseEnter(pledge)- expect(pledge.style.color).toBe('var(--text-secondary)')-- fireEvent.mouseLeave(pledge)- expect(pledge.style.color).toBe('var(--text-faint)')- })-- it('FE-W5PSC-007: an already pledged contributor keeps the accent colour while hovered', () => {- setup(item({ contributors: [{ user_id: 2 }] } as unknown as Partial<PackingItem>), 2)- const pledge = screen.getAllByRole('button')[0]-- fireEvent.mouseEnter(pledge)- fireEvent.mouseLeave(pledge)-- expect(pledge.style.color).toBe('var(--accent)')- })-})--describe('PackingShareControl — optional fields', () => {- it('FE-W5PSC-008: an item without recipients or contributors reads as the common tier', () => {- const bare = { id: 7, name: 'Stove', is_private: 0, owner_id: 1 } as unknown as PackingItem- const onSetSharing = vi.fn()- render(- <PackingShareControl- item={bare} tripMembers={MEMBERS} currentUserId={1}- onSetSharing={onSetSharing} onClone={() => {}} onJoin={() => {}} onLeave={() => {}}- />,- )-- fireEvent.click(screen.getByRole('button', { name: /sharing/i }))- fireEvent.click(screen.getByRole('button', { name: /bob/ }))-- expect(onSetSharing).toHaveBeenCalledWith(7, 'shared', [2])- })-- it('FE-W5PSC-009: a non-owner without a contributor list can still pledge', () => {- const bare = { id: 8, name: 'Stove', is_private: 0, owner_id: 1 } as unknown as PackingItem- const onJoin = vi.fn()- render(- <PackingShareControl- item={bare} tripMembers={MEMBERS} currentUserId={3}- onSetSharing={() => {}} onClone={() => {}} onJoin={onJoin} onLeave={() => {}}- />,- )-- fireEvent.click(screen.getAllByRole('button')[0])-- expect(onJoin).toHaveBeenCalledWith(8)- })-})--describe('PackingShareControl — menu variant', () => {- function setupMenu(it_: PackingItem, currentUserId = 1) {- const handlers = { onSetSharing: vi.fn(), onClone: vi.fn(), onJoin: vi.fn(), onLeave: vi.fn(), onAction: vi.fn() }- render(<PackingShareControl variant="menu" item={it_} tripMembers={MEMBERS} currentUserId={currentUserId} {...handlers} />)- return handlers- }-- it('FE-W6PSC-001: the owner gets one whole line naming the current tier', () => {- setupMenu(item())- const line = screen.getByText('Sharing').closest('button')!-- expect(line).toHaveTextContent('Shared')- fireEvent.click(line)- expect(screen.getByText(/^Personal$/)).toBeInTheDocument()- })-- it('FE-W6PSC-002: someone else pledges or copies from full lines, and the menu closes after', () => {- const h = setupMenu(item({ owner_id: 2 }))-- fireEvent.click(screen.getByRole('button', { name: 'I can bring that too' }))- fireEvent.click(screen.getByRole('button', { name: 'Copy to my list' }))- expect(h.onJoin).toHaveBeenCalledWith(5)- expect(h.onClone).toHaveBeenCalledWith(5)- expect(h.onAction).toHaveBeenCalledTimes(2)- })-- it('FE-W6PSC-003: a co-bringer takes the pledge back from the same line', () => {- const h = setupMenu(item({ owner_id: 2, contributors: [{ user_id: 1, username: 'ada' }] } as Partial<PackingItem>))-- fireEvent.click(screen.getByRole('button', { name: "I'm not bringing it" }))- expect(h.onLeave).toHaveBeenCalledWith(5, 1)- })-})diff --git a/client/src/components/Packing/PackingShareControl.tsx b/client/src/components/Packing/PackingShareControl.tsxdeleted file mode 100644index 21e87183f..000000000--- a/client/src/components/Packing/PackingShareControl.tsx+++ /dev/null@@ -1,170 +0,0 @@-import { useState, useRef } from 'react'-import { createPortal } from 'react-dom'-import { Users, UserRound, Share2, Check, Copy, HandHelping } from 'lucide-react'-import { useTranslation } from '../../i18n'-import type { PackingItem } from '../../types'-import type { TripMember } from './usePackingListPanel'--interface Props {- item: PackingItem- tripMembers: TripMember[]- currentUserId?: number- onSetSharing: (id: number, visibility: 'common' | 'personal' | 'shared', recipientIds: number[]) => void- onClone: (id: number) => void- onJoin: (id: number) => void- onLeave: (id: number, userId: number) => void- /**- * 'menu' draws the control as full-width rows for an overflow menu, where the- * whole line is the target instead of a lone icon. `onAction` then closes that- * menu after a pledge or a copy.- */- variant?: 'icon' | 'menu'- onAction?: () => void-}--/**- * Per-item sharing control for the three-tier packing model (#858). The owner- * (bringer) sets the tier — Common / Personal / Shared with specific people — via- * a dropdown; everyone else can pledge to co-bring a Common item ("I can bring- * that too") or clone it onto their own list.- */-export default function PackingShareControl({ item, tripMembers, currentUserId, onSetSharing, onClone, onJoin, onLeave, variant = 'icon', onAction }: Props) {- const { t } = useTranslation()- const [open, setOpen] = useState(false)- const [pos, setPos] = useState<{ top: number; right: number } | null>(null)- const btnRef = useRef<HTMLButtonElement>(null)-- // The dropdown is portaled to <body> and fixed-positioned from the button so it- // can't be clipped by the packing panel's overflow.- const toggle = () => {- if (open) { setOpen(false); return }- const r = btnRef.current?.getBoundingClientRect()- if (r) setPos({ top: r.bottom + 4, right: window.innerWidth - r.right })- setOpen(true)- }-- const isCommon = !item.is_private- const isOwner = item.owner_id == null || item.owner_id === currentUserId- const recipientIds = (item.recipients || []).map(r => r.user_id)- const visibility: 'common' | 'personal' | 'shared' = isCommon ? 'common' : recipientIds.length > 0 ? 'shared' : 'personal'- const iAmContributor = (item.contributors || []).some(c => c.user_id === currentUserId)- const others = tripMembers.filter(m => m.id !== item.owner_id && m.id !== currentUserId)-- const toggleRecipient = (uid: number) => {- const next = recipientIds.includes(uid) ? recipientIds.filter(x => x !== uid) : [...recipientIds, uid]- onSetSharing(item.id, 'shared', next)- }-- const btn = (onClick: () => void, title: string, active: boolean, node: React.ReactNode) => (- <button type="button" onClick={onClick} title={title}- style={{ background: 'none', border: 'none', cursor: 'pointer', padding: '3px 4px', borderRadius: 6, display: 'flex', color: active ? 'var(--accent)' : 'var(--text-faint)' }}- onMouseEnter={e => { if (!active) e.currentTarget.style.color = 'var(--text-secondary)' }}- onMouseLeave={e => { if (!active) e.currentTarget.style.color = 'var(--text-faint)' }}>- {node}- </button>- )-- const pledge = () => (iAmContributor ? onLeave(item.id, currentUserId!) : onJoin(item.id))- const pledgeLabel = iAmContributor ? t('packing.alsoBringingStop') : t('packing.alsoBring')-- // Non-owner on a Common item: pledge to co-bring + clone to personal list.- if (!isOwner && isCommon) {- if (variant === 'menu') return (- <>- <MenuRow icon={<HandHelping size={13} />} label={pledgeLabel} active={iAmContributor} onClick={() => { pledge(); onAction?.() }} />- <MenuRow icon={<Copy size={13} />} label={t('packing.cloneToMine')} onClick={() => { onClone(item.id); onAction?.() }} />- </>- )- return (- <div style={{ display: 'flex', alignItems: 'center', gap: 2 }}>- {btn(pledge, pledgeLabel, iAmContributor, <HandHelping size={14} />)}- {btn(() => onClone(item.id), t('packing.cloneToMine'), false, <Copy size={13} />)}- </div>- )- }- // A recipient of a shared item has no controls (it's the owner's responsibility).- if (!isOwner) return null-- const tierLabel = visibility === 'common' ? t('packing.viewCommon') : visibility === 'personal' ? t('packing.tierPersonal') : t('packing.tierShared')-- return (- <div style={{ display: 'flex' }}>- {variant === 'menu' ? (- <MenuRow buttonRef={btnRef} icon={<Share2 size={13} />} label={t('packing.share')} hint={tierLabel} active={open} onClick={toggle} />- ) : (- <button type="button" ref={btnRef} onClick={toggle} title={t('packing.share')}- style={{ background: 'none', border: 'none', cursor: 'pointer', padding: '3px 4px', borderRadius: 6, display: 'flex', color: visibility !== 'common' ? 'var(--accent)' : 'var(--text-faint)' }}- onMouseEnter={e => { if (visibility === 'common') e.currentTarget.style.color = 'var(--text-secondary)' }}- onMouseLeave={e => { if (visibility === 'common') e.currentTarget.style.color = 'var(--text-faint)' }}>- <Share2 size={14} />- </button>- )}- {open && pos && createPortal(- <>- <div role="presentation" style={{ position: 'fixed', inset: 0, zIndex: 1099 }} onClick={() => setOpen(false)} />- <div style={{- position: 'fixed', top: pos.top, right: pos.right, zIndex: 1100,- background: 'var(--bg-card)', border: '1px solid var(--border-primary)', borderRadius: 10,- boxShadow: '0 8px 28px rgba(0,0,0,0.18)', padding: 4, minWidth: 200, maxHeight: '60vh', overflowY: 'auto',- }}>- <Row icon={<Users size={13} />} label={t('packing.viewCommon')} sub={t('packing.tierCommonHint')} active={visibility === 'common'} onClick={() => { onSetSharing(item.id, 'common', []); setOpen(false) }} />- <Row icon={<UserRound size={13} />} label={t('packing.tierPersonal')} sub={t('packing.tierPersonalHint')} active={visibility === 'personal'} onClick={() => { onSetSharing(item.id, 'personal', []); setOpen(false) }} />- <div style={{ height: 1, background: 'var(--bg-tertiary)', margin: '4px 0' }} />- <div style={{ padding: '4px 10px 2px', fontSize: 'calc(10px * var(--fs-scale-caption, 1))', fontWeight: 700, color: 'var(--text-faint)', textTransform: 'uppercase', letterSpacing: '0.04em', display: 'flex', alignItems: 'center', gap: 5 }}>- <Share2 size={10} /> {t('packing.tierShared')}- </div>- {others.length === 0 ? (- <div style={{ padding: '4px 10px 6px', fontSize: 'calc(11px * var(--fs-scale-caption, 1))', color: 'var(--text-faint)' }}>{t('packing.noOneToShare')}</div>- ) : others.map(m => {- const on = recipientIds.includes(m.id)- return (- <button type="button" key={m.id} onClick={() => toggleRecipient(m.id)}- style={{ display: 'flex', alignItems: 'center', gap: 8, width: '100%', padding: '6px 10px', borderRadius: 7, border: 'none', cursor: 'pointer', background: 'none', fontFamily: 'inherit', fontSize: 'calc(12px * var(--fs-scale-body, 1))', color: 'var(--text-primary)' }}- onMouseEnter={e => e.currentTarget.style.background = 'var(--bg-tertiary)'}- onMouseLeave={e => e.currentTarget.style.background = 'none'}>- <span style={{ width: 18, height: 18, borderRadius: '50%', flexShrink: 0, background: `hsl(${(m.username.codePointAt(0) ?? 0) * 37 % 360}, 55%, 55%)`, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 'calc(9px * var(--fs-scale-caption, 1))', fontWeight: 700, color: 'white', textTransform: 'uppercase' }}>{m.username[0]}</span>- <span style={{ flex: 1, textAlign: 'start', overflow: 'hidden', textOverflow: 'ellipsis' }}>{m.username}</span>- {on && <Check size={13} className="text-content-muted" />}- </button>- )- })}- </div>- </>,- document.body,- )}- </div>- )-}--function Row({ icon, label, sub, active, onClick }: { icon: React.ReactNode; label: string; sub: string; active: boolean; onClick: () => void }) {- return (- <button type="button" onClick={onClick}- style={{ display: 'flex', alignItems: 'flex-start', gap: 8, width: '100%', padding: '7px 10px', borderRadius: 7, border: 'none', cursor: 'pointer', background: active ? 'var(--bg-tertiary)' : 'none', fontFamily: 'inherit', textAlign: 'start' }}- onMouseEnter={e => { if (!active) e.currentTarget.style.background = 'var(--bg-tertiary)' }}- onMouseLeave={e => { if (!active) e.currentTarget.style.background = 'none' }}>- <span style={{ color: active ? 'var(--accent)' : 'var(--text-muted)', marginTop: 1 }}>{icon}</span>- <span style={{ flex: 1, minWidth: 0 }}>- <span style={{ display: 'block', fontSize: 'calc(12.5px * var(--fs-scale-body, 1))', fontWeight: 600, color: 'var(--text-primary)' }}>{label}</span>- <span style={{ display: 'block', fontSize: 'calc(10.5px * var(--fs-scale-caption, 1))', color: 'var(--text-faint)' }}>{sub}</span>- </span>- {active && <Check size={13} className="text-content-muted" style={{ marginTop: 2 }} />}- </button>- )-}--/** A full-width line in an overflow menu, shaped like the item menu's own entries. */-function MenuRow({ icon, label, hint, active = false, onClick, buttonRef }: {- icon: React.ReactNode; label: string; hint?: string; active?: boolean; onClick: () => void- buttonRef?: React.Ref<HTMLButtonElement>-}) {- return (- <button type="button" ref={buttonRef} onClick={onClick}- style={{ display: 'flex', alignItems: 'center', gap: 9, width: '100%', padding: '8px 10px', borderRadius: 9, border: 'none', cursor: 'pointer', background: active ? 'var(--bg-tertiary)' : 'none', color: 'var(--text-primary)', fontFamily: 'inherit', fontSize: 'calc(12.5px * var(--fs-scale-body, 1))', fontWeight: 500, textAlign: 'start' }}- onMouseEnter={e => { if (!active) e.currentTarget.style.background = 'var(--bg-tertiary)' }}- onMouseLeave={e => { if (!active) e.currentTarget.style.background = 'none' }}>- <span style={{ width: 16, display: 'inline-flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0, color: 'var(--text-muted)' }}>{icon}</span>- <span style={{ flex: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{label}</span>- {hint && <span style={{ flexShrink: 0, fontSize: 'calc(11px * var(--fs-scale-caption, 1))', color: 'var(--text-faint)' }}>{hint}</span>}- </button>- )-}diff --git a/client/src/components/Packing/packingItemAccess.test.ts b/client/src/components/Packing/packingItemAccess.test.tsnew file mode 100644index 000000000..5058a4e76--- /dev/null+++ b/client/src/components/Packing/packingItemAccess.test.ts@@ -0,0 +1,48 @@+import { describe, expect, it } from 'vitest';+import { bringsItem, packingItemAccess, toggledRecipients } from './packingItemAccess';++describe('packingItemAccess', () => {+ it('FE-PACKACCESS-001: a common item of mine is mine to share, not to copy', () => {+ expect(packingItemAccess({ is_private: 0, owner_id: 1 }, 1)).toMatchObject({+ isCommon: true,+ isOwner: true,+ visibility: 'common',+ sharedToMe: false,+ canClone: false,+ recipientIds: [],+ });+ });++ it("FE-PACKACCESS-002: nobody owning it makes it everyone's to share", () => {+ expect(packingItemAccess({ is_private: 0, owner_id: null }, 5).isOwner).toBe(true);+ });++ it("FE-PACKACCESS-003: someone else's common item can be copied, their private one is theirs", () => {+ expect(packingItemAccess({ is_private: 0, owner_id: 2 }, 1)).toMatchObject({ canClone: true, sharedToMe: false });+ expect(packingItemAccess({ is_private: 1, owner_id: 2 }, 1)).toMatchObject({+ canClone: false,+ sharedToMe: true,+ visibility: 'personal',+ });+ });++ it('FE-PACKACCESS-004: a private item with people on it is shared', () => {+ const access = packingItemAccess({ is_private: 1, owner_id: 1, recipients: [{ user_id: 3, username: 'c' }] }, 1);+ expect(access.visibility).toBe('shared');+ expect(access.recipientIds).toEqual([3]);+ });++ it('FE-PACKACCESS-005: the owner and the co-bringers bring it, nobody else', () => {+ const item = { owner_id: 1, contributors: [{ user_id: 2, username: 'b', status: 'accepted' }] };+ expect(bringsItem(item, 1)).toBe(true);+ expect(bringsItem(item, 2)).toBe(true);+ expect(bringsItem(item, 3)).toBe(false);+ expect(bringsItem({ owner_id: null }, 3)).toBe(false);+ });++ it('FE-PACKACCESS-006: a tap adds or removes a person, and the last one out leaves it personal', () => {+ expect(toggledRecipients([3], 4)).toEqual({ visibility: 'shared', recipientIds: [3, 4] });+ expect(toggledRecipients([3, 4], 3)).toEqual({ visibility: 'shared', recipientIds: [4] });+ expect(toggledRecipients([3], 3)).toEqual({ visibility: 'personal', recipientIds: [] });+ });+});diff --git a/client/src/components/Packing/packingItemAccess.ts b/client/src/components/Packing/packingItemAccess.tsnew file mode 100644index 000000000..1b04c5f65--- /dev/null+++ b/client/src/components/Packing/packingItemAccess.ts@@ -0,0 +1,47 @@+import type { PackingItem } from '../../types';++export type PackingVisibility = 'common' | 'personal' | 'shared';++type AccessItem = Pick<PackingItem, 'is_private' | 'owner_id' | 'recipients' | 'contributors'>;++/**+ * Who may do what with one packing item, by the three tiers (#858): the owner+ * (or anyone, while nobody owns it) sets who sees it, everyone on the trip can+ * be put down as bringing a common item (#3098), and a private item shared with+ * me is the owner's to look after. The desktop window and the phone sheet both+ * read it from here.+ */+export function packingItemAccess(item: AccessItem, currentUserId: number | null | undefined) {+ const isCommon = !item.is_private;+ const isOwner = item.owner_id == null || item.owner_id === currentUserId;+ const recipientIds = (item.recipients || []).map((r) => r.user_id);+ const privateTier: PackingVisibility = recipientIds.length > 0 ? 'shared' : 'personal';+ const visibility: PackingVisibility = isCommon ? 'common' : privateTier;+ return {+ isCommon,+ isOwner,+ recipientIds,+ visibility,+ /** A private item somebody else owns: shown, but theirs to change. */+ sharedToMe: !isCommon && !isOwner,+ /** A common item somebody else owns can be copied onto my own list. */+ canClone: isCommon && !isOwner,+ };+}++/** True when the person brings the item, as its owner or alongside. */+export function bringsItem(item: Pick<PackingItem, 'owner_id' | 'contributors'>, userId: number): boolean {+ return item.owner_id === userId || (item.contributors || []).some((c) => c.user_id === userId);+}++/**+ * The sharing a tap on one person leads to: on or off the list of people who see+ * the item, and with nobody left it falls back to the owner alone.+ */+export function toggledRecipients(+ recipientIds: number[],+ userId: number+): { visibility: PackingVisibility; recipientIds: number[] } {+ const next = recipientIds.includes(userId) ? recipientIds.filter((id) => id !== userId) : [...recipientIds, userId];+ return { visibility: next.length ? 'shared' : 'personal', recipientIds: next };+}diff --git a/client/src/components/Packing/usePackingListPanel.ts b/client/src/components/Packing/usePackingListPanel.tsindex 1ed11588f..2902a0b6c 100644--- a/client/src/components/Packing/usePackingListPanel.ts+++ b/client/src/components/Packing/usePackingListPanel.ts@@ -45,6 +45,23 @@ export interface PackingListPanelProps {// Lifted so an out-of-panel Apply Template button knows the active view (#1565).view?: 'common' | 'personal'onViewChange?: (view: 'common' | 'personal') => void+ // Set from the Lists menu, which sits outside the panel.+ sort?: PackingSort+ hideDone?: boolean+ clearCheckedSignal?: number+ openBagsSignal?: number+}++/** A-Z or the manual order, remembered per browser. */+export function usePackingSortPreference(): [PackingSort, (next: PackingSort) => void] {+ const [sort, setSortState] = useState<PackingSort>(() => {+ try { return localStorage.getItem(PACKING_SORT_KEY) === 'name' ? 'name' : 'manual' } catch { return 'manual' }+ })+ const setSort = (next: PackingSort) => {+ setSortState(next)+ try { localStorage.setItem(PACKING_SORT_KEY, next) } catch { /* storage unavailable: the choice lasts until reload */ }+ }+ return [sort, setSort]}/**@@ -54,17 +71,14 @@ export interface PackingListPanelProps {* sections below render header, filters, the grouped list, the bag sidebar/* modal and the import dialog.*/-export function usePackingList({ tripId, items, openImportSignal = 0, addCategorySignal = 0, saveTemplateSignal = 0, inlineHeader = true, view: viewProp, onViewChange }: PackingListPanelProps) {- const [filter, setFilter] = useState('alle') // 'alle' | 'offen' | 'erledigt'+export function usePackingList({ tripId, items, openImportSignal = 0, addCategorySignal = 0, saveTemplateSignal = 0, inlineHeader = true, view: viewProp, onViewChange, sort: sortProp, hideDone, clearCheckedSignal = 0, openBagsSignal = 0 }: PackingListPanelProps) {+ const [ownFilter, setFilter] = useState('alle') // 'alle' | 'offen' | 'erledigt'+ // Under the Lists bar the menu decides whether packed items show.+ const filter = hideDone === undefined ? ownFilter : (hideDone ? 'offen' : 'alle')// A-Z only changes what is shown; the manual order stays stored underneath and- // comes back when the switch is turned off. Remembered per browser.- const [sort, setSortState] = useState<PackingSort>(() => {- try { return localStorage.getItem(PACKING_SORT_KEY) === 'name' ? 'name' : 'manual' } catch { return 'manual' }- })- const setSort = (next: PackingSort) => {- setSortState(next)- try { localStorage.setItem(PACKING_SORT_KEY, next) } catch { /* storage unavailable: the choice lasts until reload */ }- }+ // comes back when the switch is turned off.+ const [ownSort, setSort] = usePackingSortPreference()+ const sort = sortProp ?? ownSort// Three-tier sharing (#858): 'common' = the group pool (where existing items// live — non-breaking), 'personal' = my own list (private + shared-to-me).const [ownView, setOwnView] = useState<'common' | 'personal'>('common')@@ -136,6 +150,11 @@ export function usePackingList({ tripId, items, openImportSignal = 0, addCategorif (!confirm(t('packing.confirm.clearChecked', { count: abgehakt }))) returnawait clearChecked()}+ const lastClearSignal = useRef(clearCheckedSignal)+ useEffect(() => {+ if (clearCheckedSignal !== lastClearSignal.current && clearCheckedSignal > 0 && confirm(t('packing.confirm.clearChecked', { count: abgehakt }))) void clearChecked()+ lastClearSignal.current = clearCheckedSignal+ }, [clearCheckedSignal, abgehakt, clearChecked, t])// Bag tracking — the global toggle is a packing sub-flag surfaced to every// authenticated user via the addon store (loaded on app start), not the@@ -151,6 +170,13 @@ export function usePackingList({ tripId, items, openImportSignal = 0, addCategorif (!addonsLoaded) loadAddons()}, [addonsLoaded, loadAddons])+ // The Lists menu opens the bag overview on a screen too narrow for its sidebar.+ const lastBagsSignal = useRef(openBagsSignal)+ useEffect(() => {+ if (openBagsSignal !== lastBagsSignal.current && openBagsSignal > 0) setShowBagModal(true)+ lastBagsSignal.current = openBagsSignal+ }, [openBagsSignal])+const {bags, unassignedWeightGrams, serverWeightsFresh, tryCreateBag, createBag: handleCreateBagByName,deleteBag: handleDeleteBag, updateBag: handleUpdateBag, setBagMembers: handleSetBagMembers,diff --git a/client/src/mobile/screens/trip/tabs/MPackItemSheet.tsx b/client/src/mobile/screens/trip/tabs/MPackItemSheet.tsxindex 076da61d7..eea87ce54 100644--- a/client/src/mobile/screens/trip/tabs/MPackItemSheet.tsx+++ b/client/src/mobile/screens/trip/tabs/MPackItemSheet.tsx@@ -1,11 +1,13 @@-import { useEffect, useRef, useState } from 'react'-import { Check, Copy, HandHelping, Share2, UserRound, Users } from 'lucide-react'+import { useRef, useState, type ReactNode } from 'react'+import { Check, ChevronDown, Copy, Minus, Plus, Trash2 } from 'lucide-react'import MSheet from '../../../components/MSheet'-import { Eyebrow, FIELD_CLS, FormSheetBody, FormSheetFooter, FormSheetHeader } from '../sheets/PlSheetChrome'+import { FIELD_CLS, FormSheetBody, FormSheetHeader } from '../sheets/PlSheetChrome'import { avatarSrc } from '../../../../utils/avatarSrc'-import type { PackingItem, TripMember } from '../../../../types'+import type { PackingBag, PackingItem, TripMember } from '../../../../types'import type { TripPlanner } from '../MTripShell'import { isPackingPlaceholder } from '../../../../components/Packing/packingListModel'+import { katColor, packedOf } from '../../../../components/Packing/packingListPanel.helpers'+import { bringsItem, packingItemAccess, toggledRecipients, type PackingVisibility } from '../../../../components/Packing/packingItemAccess'import { packingBringerNames } from '../../../../components/Packing/packingBringers'export interface MPackItemSheetProps {@@ -16,227 +18,303 @@ export interface MPackItemSheetProps {bagTrackingEnabled: booleantripMembers: TripMember[]currentUserId: number | null+ categories: string[]+ bags: PackingBag[]+ onCreateBag: (name: string) => Promise<PackingBag | undefined>+ onDelete: (item: PackingItem) => voidonClose: () => void}+type ItemPatch = Partial<Pick<PackingItem, 'name' | 'category' | 'quantity' | 'weight_grams' | 'bag_id'>>+type Open = 'list' | 'bag' | 'bringers' | null++const PILL = 'inline-flex h-8 min-w-0 max-w-full items-center gap-1.5 rounded-full bg-m-ic text-caption font-semibold text-m-ink'+const STEP = 'flex h-8 w-8 items-center justify-center text-m-muted disabled:opacity-30'++/** One line of the sheet: what it is on the left, its value on the right. */+function Line({ label, children }: Readonly<{ label: string; children: ReactNode }>) {+ return (+ <div className="flex min-h-[46px] items-center gap-3 border-b border-m-rowbr py-[7px] last:border-b-0">+ <span className="w-[96px] flex-none text-caption font-medium text-m-muted">{label}</span>+ <div className="flex min-w-0 flex-1 justify-end">{children}</div>+ </div>+ )+}++/** A pill that opens its choices under the line, like a select. */+function ChoicePill({ open, onToggle, lead, text, disabled = false }: Readonly<{ open: boolean; onToggle: () => void; lead?: ReactNode; text: string; disabled?: boolean }>) {+ return (+ <button type="button" onClick={onToggle} disabled={disabled} aria-expanded={open} className={`${PILL} pe-2.5 ps-3`}>+ {lead}+ <span className="truncate">{text}</span>+ {!disabled && <ChevronDown size={14} strokeWidth={2.2} className={`flex-none text-m-faint transition-transform ${open ? 'rotate-180' : ''}`} />}+ </button>+ )+}++function Choices({ children }: Readonly<{ children: ReactNode }>) {+ return <div className="mb-2 flex flex-col overflow-hidden rounded-[14px] bg-m-ic">{children}</div>+}++function ChoiceRow({ lead, label, on, onClick, danger = false }: Readonly<{ lead?: ReactNode; label: string; on?: boolean; onClick: () => void; danger?: boolean }>) {+ return (+ <button type="button" onClick={onClick} className={`flex items-center gap-[10px] border-b border-m-rowbr px-3 py-[10px] text-start text-body font-medium last:border-b-0 ${danger ? 'text-[color:var(--m-st-danger)]' : 'text-m-ink'}`}>+ {lead && <span className="flex w-5 flex-none justify-center">{lead}</span>}+ <span className="min-w-0 flex-1 truncate">{label}</span>+ {on && <Check size={15} strokeWidth={2.4} className="flex-none" />}+ </button>+ )+}++function Dot({ color, dashed = false }: Readonly<{ color?: string; dashed?: boolean }>) {+ return <span aria-hidden className={`inline-block h-[9px] w-[9px] flex-none rounded-full ${dashed ? 'border border-dashed border-m-faint' : ''}`} style={dashed ? undefined : { background: color }} />+}++function Face({ member }: Readonly<{ member: TripMember }>) {+ const src = member.avatar_url || avatarSrc(member.avatar)+ return (+ <span aria-hidden className="flex h-[22px] w-[22px] flex-none items-center justify-center overflow-hidden rounded-full bg-m-act text-[0.625rem] font-bold text-m-actfg">+ {src ? <img src={src} alt="" className="h-full w-full object-cover" /> : member.username[0]?.toUpperCase()}+ </span>+ )+}++/** Minus, the number, plus: amount and pieces packed share the look. */+function Stepper({ value, min, max, display, label, lessLabel, moreLabel, onChange }: Readonly<{+ value: number; min: number; max: number; display: string; label: string; lessLabel: string; moreLabel: string; onChange: (next: number) => void+}>) {+ return (+ <div role="group" aria-label={label} className={PILL}>+ <button type="button" aria-label={lessLabel} disabled={value <= min} onClick={() => onChange(value - 1)} className={STEP}><Minus size={13} strokeWidth={2.6} /></button>+ <span className="min-w-[34px] text-center tabular-nums">{display}</span>+ <button type="button" aria-label={moreLabel} disabled={value >= max} onClick={() => onChange(value + 1)} className={STEP}><Plus size={13} strokeWidth={2.6} /></button>+ </div>+ )+}+/**- * Item editor (spec 03 §4.4 `r.edit`): name, quantity, weight (bag-tracking- * only) and the three-tier sharing control (#858) — Common / Personal /- * Shared-with-picker for the owner, a "bring it too" pledge + clone for a- * non-owner viewing a Common item, or a read-only note for a recipient.- * Category and bag stay on the row itself (colour dot / bag picker), not- * duplicated here.+ * Everything about one packing item, as one sheet: name, list, amount and+ * pieces packed, weight and bag, who brings it and who sees it, copy and delete.+ * Each change saves on its own, like the desktop window it mirrors; the rows of+ * the list itself stay short because all of this lives here.*/export default function MPackItemSheet({- planner, open, itemId, bagTrackingEnabled, tripMembers, currentUserId, onClose,+ planner, open, itemId, bagTrackingEnabled, tripMembers, currentUserId, categories, bags, onCreateBag, onDelete, onClose,}: MPackItemSheetProps) {const { t, toast, tripId, tripActions } = planner-const liveItem = itemId != null ? planner.packingItems.find(i => i.id === itemId) ?? null : nullconst heldRef = useRef<PackingItem | null>(null)if (liveItem) heldRef.current = liveItemconst item = liveItem ?? heldRef.current- const [name, setName] = useState('')- const [quantity, setQuantity] = useState('1')- const [weight, setWeight] = useState('')- const [saving, setSaving] = useState(false)-- // Keyed on the item id, not the object: packingSlice swaps the object on every- // update, and a WebSocket refresh must not overwrite what is being typed.- const heldId = item?.id- useEffect(() => {- if (!open || !item) return- setName(isPackingPlaceholder(item) ? '' : item.name)- setQuantity(String(item.quantity || 1))- setWeight(item.weight_grams != null ? String(item.weight_grams) : '')- // eslint-disable-next-line react-hooks/exhaustive-deps- }, [open, heldId])-- if (!item) {- return <MSheet open={false} onClose={onClose} />+ const [openChoice, setOpenChoice] = useState<Open>(null)+ const [nameDraft, setNameDraft] = useState<string | null>(null)+ const [weightDraft, setWeightDraft] = useState<string | null>(null)+ const [newBag, setNewBag] = useState('')+ const [picking, setPicking] = useState(false)++ if (!item) return <MSheet open={false} onClose={onClose} />++ const close = () => { setOpenChoice(null); setPicking(false); setNameDraft(null); onClose() }+ const save = async (patch: ItemPatch) => {+ try { await tripActions.updatePackingItem(tripId, item.id, patch) } catch { toast.error(t('packing.toast.saveError')) }}+ const toggleChoice = (which: Exclude<Open, null>) => setOpenChoice(c => (c === which ? null : which))const isPlaceholder = isPackingPlaceholder(item)- const isCommon = !item.is_private- const isOwner = item.owner_id == null || item.owner_id === currentUserId- const recipientIds = (item.recipients || []).map(r => r.user_id)- const visibility: 'common' | 'personal' | 'shared' = isCommon ? 'common' : recipientIds.length > 0 ? 'shared' : 'personal'- const iAmContributor = (item.contributors || []).some(c => c.user_id === currentUserId)+ const canEdit = planner.can('packing_edit', planner.trip)+ const access = packingItemAccess(item, currentUserId)+ const category = item.category || t('packing.defaultCategory')+ const quantity = item.quantity || 1+ const selectedBag = bags.find(b => b.id === item.bag_id)+ const shownVisibility: PackingVisibility = picking ? 'shared' : access.visibilityconst others = tripMembers.filter(m => m.id !== item.owner_id && m.id !== currentUserId)+ const bringerFaces = tripMembers.filter(m => bringsItem(item, m.id))- const setSharing = (nextVisibility: 'common' | 'personal' | 'shared', nextRecipients: number[]) => {- tripActions.setPackingItemSharing(tripId, item.id, nextVisibility, nextRecipients)+ const commitName = () => {+ const next = (nameDraft ?? '').trim()+ if (nameDraft !== null && next && next !== item.name) void save({ name: next })+ setNameDraft(null)}- const toggleRecipient = (userId: number) => {- const next = recipientIds.includes(userId) ? recipientIds.filter(id => id !== userId) : [...recipientIds, userId]- setSharing('shared', next)+ const commitWeight = () => {+ if (weightDraft === null) return+ const grams = weightDraft.trim() === '' ? null : Math.max(0, Number.parseInt(weightDraft, 10) || 0)+ setWeightDraft(null)+ if (grams !== (item.weight_grams ?? null)) void save({ weight_grams: grams })}- const toggleContribute = () => {- if (iAmContributor) {- if (currentUserId != null) tripActions.removePackingContributor(tripId, item.id, currentUserId)- } else {- tripActions.addPackingContributor(tripId, item.id)- }+ const createBag = async () => {+ const name = newBag.trim()+ if (!name) return+ const bag = await onCreateBag(name)+ if (bag) await save({ bag_id: bag.id })+ setNewBag(''); setOpenChoice(null)}- const cloneItem = () => {- tripActions.clonePackingItem(tripId, item.id)- onClose()+ const chooseVisibility = (next: PackingVisibility) => {+ setPicking(next === 'shared')+ if (next !== 'shared') tripActions.setPackingItemSharing(tripId, item.id, next, [])}-- const handleSave = async () => {- const trimmedName = name.trim()- setSaving(true)- try {- const qty = Math.max(1, Math.min(999, Number.parseInt(quantity, 10) || 1))- const weightVal = weight.trim() === '' ? null : Math.max(0, Number.parseInt(weight, 10) || 0)- await tripActions.updatePackingItem(tripId, item.id, {- name: trimmedName,- quantity: qty,- ...(bagTrackingEnabled ? { weight_grams: weightVal } : {}),- })- onClose()- } catch {- toast.error(t('packing.toast.saveError'))- } finally {- setSaving(false)- }+ const toggleRecipient = (userId: number) => {+ const next = toggledRecipients(access.recipientIds, userId)+ tripActions.setPackingItemSharing(tripId, item.id, next.visibility, next.recipientIds)}+ const toggleBringer = (userId: number) => (+ bringsItem(item, userId)+ ? tripActions.removePackingContributor(tripId, item.id, userId)+ : tripActions.addPackingContributor(tripId, item.id, userId)+ )- const pillCls = (active: boolean) =>- `flex flex-1 items-center justify-center gap-[6px] rounded-full px-3 py-[9px] text-[0.75rem] font-semibold ${- active ? 'bg-m-act text-m-actfg' : 'bg-[color:var(--m-ic)] text-m-muted'- }`+ const visibilityOptions: { id: PackingVisibility; label: string }[] = [+ { id: 'common', label: t('packing.filterAll') },+ { id: 'personal', label: t('packing.visibility.me') },+ { id: 'shared', label: t('packing.visibility.some') },+ ]return (- <MSheet open={open} onClose={onClose} form ariaLabel={t('packing.editItem')}>- <FormSheetHeader- title={t('packing.editItem')}- subtitle={item.category || t('packing.defaultCategory')}- onClose={onClose}- closeLabel={t('common.close')}- />-+ <MSheet open={open} onClose={close} form ariaLabel={t('packing.editItem')}>+ <FormSheetHeader title={t('packing.editItem')} subtitle={category} onClose={close} closeLabel={t('common.close')} /><FormSheetBody>- <Eyebrow className="mb-[5px] uppercase">{t('packing.itemName')}</Eyebrow><inputtype="text"- value={name}- onChange={e => setName(e.target.value)}- placeholder={isPlaceholder ? t('packing.addItemPlaceholder') : undefined}- className={FIELD_CLS}+ value={nameDraft ?? (isPlaceholder ? '' : item.name)}+ readOnly={!canEdit}+ onFocus={() => setNameDraft(isPlaceholder ? '' : item.name)}+ onChange={e => setNameDraft(e.target.value)}+ onBlur={commitName}+ onKeyDown={e => { if (e.key === 'Enter') e.currentTarget.blur() }}+ placeholder={t('packing.addItemPlaceholder')}+ aria-label={t('packing.itemName')}+ className={`${FIELD_CLS} mb-2`}/>- <div className="mt-3 flex gap-2">- <div className="min-w-0 flex-1">- <Eyebrow className="mb-[5px] uppercase">{t('packing.itemQuantity')}</Eyebrow>- <input- type="text"- inputMode="numeric"- value={quantity}- onChange={e => setQuantity(e.target.value.replace(/[^0-9]/g, ''))}- className={`${FIELD_CLS} text-center tabular-nums`}- />- </div>- {bagTrackingEnabled && (- <div className="min-w-0 flex-1">- <Eyebrow className="mb-[5px] uppercase">{t('packing.itemWeight')}</Eyebrow>+ <Line label={t('packing.detail.list')}>+ <ChoicePill open={openChoice === 'list'} disabled={!canEdit} onToggle={() => toggleChoice('list')} lead={<Dot color={katColor(category, categories)} />} text={category} />+ </Line>+ {openChoice === 'list' && (+ <Choices>+ {categories.map(cat => (+ <ChoiceRow key={cat} lead={<Dot color={katColor(cat, categories)} />} label={cat} on={cat === category}+ onClick={() => { setOpenChoice(null); if (cat !== category) void save({ category: cat }) }} />+ ))}+ </Choices>+ )}++ {canEdit && (+ <Line label={t('packing.quantity')}>+ <Stepper value={quantity} min={1} max={999} display={String(quantity)} label={t('packing.quantity')}+ lessLabel={t('packing.quantityLess')} moreLabel={t('packing.quantityMore')} onChange={qty => void save({ quantity: qty })} />+ </Line>+ )}+ {canEdit && quantity > 1 && (+ <Line label={t('packing.printPacked')}>+ <Stepper value={packedOf(item)} min={0} max={quantity} display={`${packedOf(item)}/${quantity}`} label={t('packing.printPacked')}+ lessLabel={t('packing.packedLess')} moreLabel={t('packing.packedMore')} onChange={count => tripActions.setPackedCount(tripId, item.id, count)} />+ </Line>+ )}+ {bagTrackingEnabled && (+ <Line label={t('packing.totalWeight')}>+ <div className={`${PILL} px-3`}><inputtype="text"inputMode="numeric"- value={weight}- onChange={e => setWeight(e.target.value.replace(/[^0-9]/g, ''))}+ value={weightDraft ?? (item.weight_grams != null ? String(item.weight_grams) : '')}+ readOnly={!canEdit}+ onFocus={() => setWeightDraft(item.weight_grams != null ? String(item.weight_grams) : '')}+ onChange={e => setWeightDraft(e.target.value.replace(/[^0-9]/g, ''))}+ onBlur={commitWeight}+ onKeyDown={e => { if (e.key === 'Enter') e.currentTarget.blur() }}placeholder="—"- className={`${FIELD_CLS} text-center tabular-nums`}+ aria-label={t('packing.totalWeight')}+ className="w-14 bg-transparent text-end tabular-nums text-m-ink outline-none placeholder:text-m-faint"/>+ <span className="text-m-faint">g</span></div>- )}- </div>-- {!isPlaceholder && (+ </Line>+ )}+ {bagTrackingEnabled && (<>- <Eyebrow className="mb-[6px] mt-4 uppercase">{t('packing.share')}</Eyebrow>-- {!isOwner && isCommon && (- <div className="rounded-[14px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] p-3">- {item.owner_username && (- <div className="mb-[9px] font-geist text-[0.6875rem] text-m-muted">- {t('packing.broughtBy', { name: packingBringerNames(item) })}- </div>- )}- <div className="flex gap-2">- <button type="button" onClick={toggleContribute} className={pillCls(iAmContributor)}>- <HandHelping size={13} strokeWidth={2} />- {iAmContributor ? t('packing.alsoBringingStop') : t('packing.alsoBring')}- </button>- <button type="button" onClick={cloneItem} className={pillCls(false)}>- <Copy size={13} strokeWidth={2} />- {t('packing.cloneToMine')}+ <Line label={t('packing.detail.bag')}>+ <ChoicePill open={openChoice === 'bag'} disabled={!canEdit} onToggle={() => toggleChoice('bag')}+ lead={selectedBag ? <Dot color={selectedBag.color} /> : undefined} text={selectedBag?.name || t('packing.noBag')} />+ </Line>+ {openChoice === 'bag' && (+ <Choices>+ <ChoiceRow lead={<Dot dashed />} label={t('packing.noBag')} on={!item.bag_id}+ onClick={() => { setOpenChoice(null); if (item.bag_id) void save({ bag_id: null }) }} />+ {bags.map(b => (+ <ChoiceRow key={b.id} lead={<Dot color={b.color} />} label={b.name} on={item.bag_id === b.id}+ onClick={() => { setOpenChoice(null); if (item.bag_id !== b.id) void save({ bag_id: b.id }) }} />+ ))}+ <div className="flex items-center gap-[10px] px-3 py-[7px]">+ <span aria-hidden className="flex w-5 flex-none justify-center text-m-faint"><Plus size={14} /></span>+ <input value={newBag} onChange={e => setNewBag(e.target.value)} placeholder={t('packing.addBag')} aria-label={t('packing.bagName')}+ onKeyDown={e => { if (e.key === 'Enter') void createBag() }}+ className="min-w-0 flex-1 bg-transparent text-body text-m-ink outline-none placeholder:text-m-faint" />+ <button type="button" onClick={() => void createBag()} disabled={!newBag.trim()} aria-label={t('packing.addBag')}+ className={`flex h-7 w-7 flex-none items-center justify-center rounded-full ${newBag.trim() ? 'bg-m-act text-m-actfg' : 'text-m-faint'}`}>+ <Plus size={14} strokeWidth={2.4} /></button></div>- </div>+ </Choices>)}+ </>+ )}- {!isOwner && !isCommon && (- <div className="rounded-[14px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] p-3 font-geist text-[0.6875rem] text-m-muted">- {item.owner_username ? t('packing.takenCareOf', { name: item.owner_username }) : t('packing.tierPersonalHint')}- </div>+ {canEdit && !isPlaceholder && access.isCommon && tripMembers.length > 0 && (+ <>+ <Line label={t('packing.bringersTitle')}>+ <ChoicePill open={openChoice === 'bringers'} onToggle={() => toggleChoice('bringers')}+ lead={bringerFaces.length > 0 ? <span className="-ms-1.5 flex"><Face member={bringerFaces[0]} /></span> : undefined}+ text={bringerFaces.length > 0 ? packingBringerNames(item) : t('packing.bringersNobody')} />+ </Line>+ {openChoice === 'bringers' && (+ <Choices>+ {tripMembers.map(m => (+ <ChoiceRow key={m.id} lead={<Face member={m} />} label={m.username} on={bringsItem(item, m.id)} onClick={() => toggleBringer(m.id)} />+ ))}+ </Choices>)}+ </>+ )}- {isOwner && (- <div className="flex flex-col gap-[6px]">- <div className="flex gap-[6px]">- <button type="button" onClick={() => setSharing('common', [])} className={pillCls(visibility === 'common')}>- <Users size={13} strokeWidth={2} />- {t('packing.viewCommon')}- </button>- <button type="button" onClick={() => setSharing('personal', [])} className={pillCls(visibility === 'personal')}>- <UserRound size={13} strokeWidth={2} />- {t('packing.tierPersonal')}+ {canEdit && !isPlaceholder && access.isOwner && (+ <>+ <Line label={t('packing.detail.visibility')}>+ <div role="radiogroup" aria-label={t('packing.detail.visibility')} className={`${PILL} gap-0 p-[3px]`}>+ {visibilityOptions.map(o => (+ <button key={o.id} type="button" role="radio" aria-checked={shownVisibility === o.id} onClick={() => chooseVisibility(o.id)}+ className={`h-[26px] whitespace-nowrap rounded-full px-2.5 ${shownVisibility === o.id ? 'bg-m-act text-m-actfg' : 'text-m-muted'}`}>+ {o.label}</button>- </div>-- <div className="mt-1 flex items-center gap-[5px] font-geist text-[0.625rem] font-bold uppercase tracking-[.06em] text-m-faint">- <Share2 size={11} strokeWidth={2.2} />- {t('packing.tierShared')}- </div>- <div className="flex flex-col gap-1 rounded-[12px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] p-[6px]">- {others.length === 0 ? (- <div className="px-2 py-1 font-geist text-[0.6875rem] text-m-faint">{t('packing.noOneToShare')}</div>- ) : (- others.map(m => {- const on = recipientIds.includes(m.id)- const src = m.avatar_url || avatarSrc(m.avatar)- return (- <button- key={m.id}- type="button"- onClick={() => toggleRecipient(m.id)}- className="flex items-center gap-[8px] rounded-[9px] px-[8px] py-[7px] text-start"- >- <span className="flex h-[22px] w-[22px] flex-none items-center justify-center overflow-hidden rounded-full bg-m-act text-[0.625rem] font-bold text-m-actfg">- {src ? <img src={src} alt="" className="h-full w-full object-cover" /> : m.username[0]?.toUpperCase()}- </span>- <span className="min-w-0 flex-1 truncate text-[0.78125rem] font-semibold text-m-ink">{m.username}</span>- {on && <Check size={14} strokeWidth={2.4} className="flex-none text-m-ink" />}- </button>- )- })- )}- </div>+ ))}</div>+ </Line>+ {shownVisibility === 'shared' && (+ <Choices>+ {others.length === 0+ ? <div className="px-3 py-[10px] text-caption text-m-faint">{t('packing.noOneToShare')}</div>+ : others.map(m => (+ <ChoiceRow key={m.id} lead={<Face member={m} />} label={m.username} on={access.recipientIds.includes(m.id)} onClick={() => toggleRecipient(m.id)} />+ ))}+ </Choices>)}</>)}- </FormSheetBody>- <FormSheetFooter- onCancel={onClose}- cancelLabel={t('common.cancel')}- onSubmit={handleSave}- submitLabel={t('common.save')}- submitDisabled={!name.trim() || saving}- />+ {access.sharedToMe && (+ <p className="my-2 text-caption text-m-muted">+ {item.owner_username ? t('packing.takenCareOf', { name: item.owner_username }) : t('packing.tierPersonalHint')}+ </p>+ )}++ {canEdit && (+ <div className="mt-3 flex flex-col overflow-hidden rounded-[14px] bg-m-ic">+ {access.canClone && !isPlaceholder && (+ <ChoiceRow lead={<Copy size={15} strokeWidth={2} />} label={t('packing.cloneToMine')} onClick={() => { tripActions.clonePackingItem(tripId, item.id); close() }} />+ )}+ <ChoiceRow lead={<Trash2 size={15} strokeWidth={2} />} label={t('common.delete')} danger onClick={() => { close(); onDelete(item) }} />+ </div>+ )}+ </FormSheetBody></MSheet>)}diff --git a/client/src/mobile/screens/trip/tabs/MPackingListTab.tsx b/client/src/mobile/screens/trip/tabs/MPackingListTab.tsxindex b15e74a78..a5c997281 100644--- a/client/src/mobile/screens/trip/tabs/MPackingListTab.tsx+++ b/client/src/mobile/screens/trip/tabs/MPackingListTab.tsx@@ -1,25 +1,26 @@-import { useMemo, useState } from 'react'+import { useMemo, useState, type ReactNode } from 'react'import { selectionHaptic } from '../../../../native/haptics'import type { LucideIcon } from 'lucide-react'import {- Briefcase, Check, CheckCheck, ChevronDown, ChevronUp, HandHelping, Minus,- Download, FileSpreadsheet, FileText, LayoutTemplate, MoreHorizontal, Package, Pencil, Plus, Printer, RotateCcw, Save as SaveIcon,- Share2, Trash2, UserPlus, UserRound, X,+ Briefcase, Check, CheckCheck, ChevronDown, ChevronUp, EyeOff, HandHelping,+ Download, FileSpreadsheet, FileText, LayoutTemplate, ListPlus, MoreHorizontal, Package, Pencil, Plus, Printer, RotateCcw,+ Save as SaveIcon, Share2, Trash2, UserRound, X,} from 'lucide-react'import MDancingTrek from '../../../components/MDancingTrek'import MSwipeRow, { type SwipeAction } from '../../../components/MSwipeRow'+import MSheet from '../../../components/MSheet'import { useAuthStore } from '../../../../store/authStore'import { useAddonStore } from '../../../../store/addonStore'-import type { PackingBag, PackingItem, TripMember } from '../../../../types'+import type { PackingItem, TripMember } from '../../../../types'import type { TripPlanner } from '../MTripShell'import MConfirmSheet from '../../settings/MConfirmSheet'-import { FIELD_CLS } from '../sheets/PlSheetChrome'+import { FIELD_CLS, FormSheetBody, FormSheetHeader } from '../sheets/PlSheetChrome'import { TabScroller } from './tabChrome'import { katColor, packedOf } from '../../../../components/Packing/packingListPanel.helpers'import {- formatWeight, groupPackingItems, isPackingPlaceholder,+ groupPackingItems, isPackingPlaceholder,packingCategoryOrder, packingProgress, packingViewItems,- type PackingCategoryGroup, type PackingStatusFilter, type PackingView,+ type PackingCategoryGroup, type PackingView,} from '../../../../components/Packing/packingListModel'import { usePackingBags } from '../../../../components/Packing/usePackingBags'import { usePackingTemplates } from '../../../../components/Packing/usePackingTemplates'@@ -37,11 +38,11 @@ import { packingBringerNames } from '../../../../components/Packing/packingBringtype ActionView = 'menu' | 'apply' | 'save'/**- * Packing sub-tab (spec 03 §4.1-4.4): progress card, action menu (remove- * checked / apply+save template / import), Shared|My-list + All|Open|Done- * filters, and the category cards. Category-level state (rename/menu/assign/- * add-item, bag picker) lives inside the row components below, mirroring how- * the desktop `KategorieGruppe`/`ArtikelZeile` keep it local too.+ * Packing sub-tab, shaped like the desktop list: a progress card with one "..."+ * that opens every rarely used action in a sheet, the Shared | My list switch,+ * and the category cards. A row shows its box, its name and only what is set;+ * a tap on the name opens the item sheet with everything else, and a list's own+ * actions open from its "..." as a sheet too, so nothing unfolds inside the page.*/export default function MPackingListTab({ planner }: { planner: TripPlanner }) {const { t, toast, tripId, packingItems: items, tripActions } = planner@@ -54,10 +55,7 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {const [view, setView] = useState<PackingView>('common')const packingExport = usePackingExport(tripId, view)- // Exporting changes nothing, so the menu is there for anyone with a list to take along.- const hasActions = canEdit || packingExport.hasItems- const [statusFilter, setStatusFilter] = useState<PackingStatusFilter>('all')- const [editMode, setEditMode] = useState(false)+ const [hideDone, setHideDone] = useState(false)const [actionsOpen, setActionsOpen] = useState(false)const [actionView, setActionView] = useState<ActionView>('menu')const [collapsed, setCollapsed] = useState<Record<string, boolean>>({})@@ -65,6 +63,8 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {const [showBagsSheet, setShowBagsSheet] = useState(false)const [showImportSheet, setShowImportSheet] = useState(false)const [confirmClear, setConfirmClear] = useState(false)+ const [menuCategory, setMenuCategory] = useState<string | null>(null)+ const [renamingCategory, setRenamingCategory] = useState<string | null>(null)const [deleteCategoryTarget, setDeleteCategoryTarget] = useState<{ name: string; items: PackingItem[] } | null>(null)const closeActions = () => {@@ -80,7 +80,7 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {const defaultCategory = t('packing.defaultCategory')const viewItems = useMemo(() => packingViewItems(items, view), [items, view])const categoryOrder = useMemo(() => packingCategoryOrder(viewItems, defaultCategory), [viewItems, defaultCategory])- const groups = useMemo(() => groupPackingItems(viewItems, statusFilter, defaultCategory), [viewItems, statusFilter, defaultCategory])+ const groups = useMemo(() => groupPackingItems(viewItems, hideDone ? 'open' : 'all', defaultCategory), [viewItems, hideDone, defaultCategory])const progress = packingProgress(viewItems)const checkedCount = viewItems.filter(i => i.checked).length@@ -99,167 +99,48 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {})const toggleCategory = (cat: string) => setCollapsed(c => ({ ...c, [cat]: !c[cat] }))-- const checkAllInCategory = async (catItems: PackingItem[]) => {- try {- for (const item of catItems) if (!item.checked) await tripActions.togglePackingItem(tripId, item.id, true)- } catch {- toast.error(t('packing.toast.saveError'))- }- }- const uncheckAllInCategory = async (catItems: PackingItem[]) => {+ const setAllInCategory = async (catItems: PackingItem[], checked: boolean) => {try {- for (const item of catItems) if (item.checked) await tripActions.togglePackingItem(tripId, item.id, false)+ for (const item of catItems) if (!!item.checked !== checked) await tripActions.togglePackingItem(tripId, item.id, checked)} catch {toast.error(t('packing.toast.saveError'))}}- // Two switches, each a segmented control of its own on its own track: whose- // list, and which items. As five loose pills in one row with two of them lit,- // they read as one control with two answers.- const filterTrackCls = 'flex min-w-0 gap-[2px] rounded-full bg-[color:var(--m-ic)] p-[3px] wide:flex-none'- const filterPillCls = (active: boolean) =>- `flex-1 whitespace-nowrap rounded-full px-2 py-[5px] text-center text-[0.71875rem] font-semibold wide:flex-none wide:px-[14px] ${- active ? 'bg-m-act text-m-actfg' : 'text-m-ink'- }`-const trueEmpty = items.length === 0const viewEmpty = viewItems.length === 0+ const menuGroup = menuCategory != null ? groups.find(g => g.category === menuCategory) : undefined+ const run = (action: () => void) => () => { closeActions(); action() }return (<TabScroller wide="full">- {/* ── Progress card (spec §4.1) ── */}- <div className="rounded-2xl border border-[color:var(--m-rowbr)] bg-m-sheetop px-[14px] py-[13px]">- <div className="flex items-baseline gap-[7px]">- <span className="font-geist text-[1rem] font-extrabold tabular-nums text-m-ink">{progress.checked}/{progress.total}</span>- <span className="font-geist text-[0.625rem] font-bold text-m-faint">{progress.pct}%</span>- <div className="ms-auto flex items-center gap-[6px]">- {bagTrackingEnabled && (- <button- type="button"- onClick={() => setShowBagsSheet(true)}- className="flex items-center gap-[5px] rounded-full border border-[color:var(--m-rowbr)] bg-[color:var(--m-ic)] px-[11px] py-[6px] text-[0.71875rem] font-semibold text-m-ink"- >- <Briefcase size={11} strokeWidth={2} />- {t('packing.bags')}- </button>- )}- {canEdit && (- <button- type="button"- onClick={() => setEditMode(v => !v)}- aria-pressed={editMode}- className={`flex items-center gap-[5px] rounded-full px-[11px] py-[6px] text-[0.71875rem] font-semibold ${- editMode ? 'bg-m-act text-m-actfg' : 'bg-[color:var(--m-ic)] text-m-muted'- }`}- >- <Pencil size={12} strokeWidth={2} />- {editMode ? t('packing.editDone') : t('common.edit')}- </button>- )}- {hasActions && (- <button- type="button"- onClick={() => setActionsOpen(v => !v)}- aria-label={t('packing.actions')}- aria-expanded={actionsOpen}- className="flex h-[26px] w-[26px] flex-none items-center justify-center rounded-full bg-[color:var(--m-ic)] text-m-muted"- >- <MoreHorizontal size={13} strokeWidth={2} />- </button>- )}+ {/* ── Progress card: the count, a slim bar and one button for the rest ── */}+ <div className="flex items-center gap-3 rounded-2xl border border-m-rowbr bg-m-sheetop px-[14px] py-[12px]">+ <div className="min-w-0 flex-1">+ <div className="text-caption font-semibold tabular-nums text-m-ink">+ {progress.total > 0 && progress.pct === 100+ ? t('packing.allPacked')+ : t('packing.packedCount', { packed: progress.checked, total: progress.total })}+ </div>+ <div className="mt-[7px] h-[5px] overflow-hidden rounded-full bg-m-ic">+ <div className="h-full rounded-full bg-m-act" style={{ width: `${progress.pct}%` }} /></div></div>- <div className="mt-[9px] h-[5px] overflow-hidden rounded-full bg-[color:var(--m-ic)]">- <div className="h-full rounded-full bg-m-act" style={{ width: `${progress.pct}%` }} />- </div>+ <button+ type="button"+ onClick={() => setActionsOpen(true)}+ aria-label={t('packing.actions')}+ aria-haspopup="dialog"+ className="flex h-9 w-9 flex-none items-center justify-center rounded-full bg-m-ic text-m-ink"+ >+ <MoreHorizontal size={17} strokeWidth={2.2} />+ </button></div>- {/* ── Action menu (spec §4.2) ── */}- {actionsOpen && hasActions && (- // On a wide window the menu drops from the button that opened it, at the- // width of a popover, instead of running across the whole page.- <div className="mt-[6px] overflow-hidden rounded-2xl border border-[color:var(--m-rowbr)] bg-[color:var(--m-glass)] backdrop-blur-[24px] wide:ms-auto wide:max-w-[380px]">- {actionView === 'menu' && (- <>- {canEdit && checkedCount > 0 && (- <ActionRow- icon={Trash2}- label={t('packing.clearChecked', { count: checkedCount })}- danger- onClick={() => { setActionsOpen(false); setConfirmClear(true) }}- />- )}- {canEdit && templates.length > 0 && (- <ActionRow icon={LayoutTemplate} label={t('packing.applyTemplate')} onClick={() => setActionView('apply')} />- )}- {canEdit && isAdmin && items.length > 0 && (- <ActionRow icon={SaveIcon} label={t('packing.saveAsTemplate')} onClick={() => setActionView('save')} />- )}- {canEdit && (- <ActionRow icon={Download} label={t('packing.import')} onClick={() => { setActionsOpen(false); setShowImportSheet(true) }} />- )}- {packingExport.hasItems && (- <>- <ActionRow icon={Printer} label={t('packing.exportPrint')} onClick={() => { setActionsOpen(false); void packingExport.openPrint() }} />- <ActionRow icon={FileText} label={t('packing.exportMarkdown')} onClick={() => { setActionsOpen(false); packingExport.exportMarkdown() }} />- <ActionRow icon={FileSpreadsheet} label={t('packing.exportCsv')} onClick={() => { setActionsOpen(false); void packingExport.exportCsv() }} />- </>- )}- </>- )}- {actionView === 'apply' && (- <div className="p-[6px]">- {templates.map(tmpl => (- <button- key={tmpl.id}- type="button"- onClick={() => applyTemplate(tmpl.id)}- className="flex w-full items-center gap-[9px] rounded-[10px] px-[10px] py-[9px] text-start"- >- <Package size={14} strokeWidth={2} className="flex-none text-m-muted" />- <span className="min-w-0 flex-1">- <span className="block truncate text-[0.78125rem] font-semibold text-m-ink">{tmpl.name}</span>- <span className="block font-geist text-[0.625rem] text-m-faint">{tmpl.item_count} {t('admin.packingTemplates.items', { count: tmpl.item_count })}</span>- </span>- </button>- ))}- </div>- )}- {actionView === 'save' && (- <div className="flex items-center gap-2 p-[10px]">- <input- type="text"- autoFocus- value={saveTemplateName}- onChange={e => setSaveTemplateName(e.target.value)}- onKeyDown={e => { if (e.key === 'Enter') void saveAsTemplate() }}- placeholder={t('packing.templateName')}- className={`${FIELD_CLS} flex-1`}- />- <button- type="button"- onClick={saveAsTemplate}- disabled={!saveTemplateName.trim()}- aria-label={t('common.save')}- className="flex h-10 w-10 flex-none items-center justify-center rounded-[12px] bg-m-act text-m-actfg disabled:opacity-40"- >- <Check size={15} strokeWidth={2.4} />- </button>- </div>- )}- </div>- )}-- {/* ── Add list — sits directly under the progress card (instead of at the- very bottom) so it's reachable without scrolling past every category.- Same dashed-pill style as before, just relocated. ── */}- {canEdit && (editMode || trueEmpty) && (+ {/* ── Add list: in place under the card once asked for from the menu, or on an empty list ── */}+ {canEdit && (addingCategory || trueEmpty) && (addingCategory ? (- // One card like the lists below it: the name typed in place, the way- // out and the add on its end, so the row reads as the list it becomes.- <div className="mt-[10px] flex items-center gap-1.5 rounded-[16px] border border-[color:var(--m-rowbr)] bg-m-card py-[5px] pe-[5px] ps-[14px]">+ <div className="mt-[10px] flex items-center gap-1.5 rounded-[16px] border border-m-rowbr bg-m-card py-[5px] pe-[5px] ps-[14px]"><inputtype="text"autoFocus@@ -295,7 +176,7 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {<buttontype="button"onClick={() => setAddingCategory(true)}- className="mt-[10px] flex w-full items-center justify-center gap-[5px] rounded-full border-[1.5px] border-dashed border-[color:var(--m-trackoff)] py-[10px] font-geist text-[0.6875rem] font-semibold text-m-muted"+ className="mt-[10px] flex w-full items-center justify-center gap-[5px] rounded-full border-[1.5px] border-dashed border-m-trackoff py-[10px] text-caption font-semibold text-m-muted"><Plus size={12} strokeWidth={2.2} />{t('packing.addCategory')}@@ -303,68 +184,151 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {))}- {/* ── Filters (spec §4.3) ── */}+ {/* ── Whose list: the one switch above the lists ── */}{!trueEmpty && (- <div className="mt-[10px] flex items-center gap-[10px]">- <div className={`${filterTrackCls} flex-[2]`}>- <button type="button" aria-pressed={view === 'common'} onClick={() => setView('common')} className={filterPillCls(view === 'common')}>{t('packing.viewCommon')}</button>- <button type="button" aria-pressed={view === 'personal'} onClick={() => setView('personal')} className={filterPillCls(view === 'personal')}>{t('packing.viewPersonal')}</button>- </div>- <div className={`${filterTrackCls} flex-[3]`}>- <button type="button" aria-pressed={statusFilter === 'all'} onClick={() => setStatusFilter('all')} className={filterPillCls(statusFilter === 'all')}>{t('packing.filterAll')}</button>- <button type="button" aria-pressed={statusFilter === 'open'} onClick={() => setStatusFilter('open')} className={filterPillCls(statusFilter === 'open')}>{t('packing.filterOpen')}</button>- <button type="button" aria-pressed={statusFilter === 'done'} onClick={() => setStatusFilter('done')} className={filterPillCls(statusFilter === 'done')}>{t('packing.filterDone')}</button>- </div>+ <div className="mt-[10px] flex gap-[2px] rounded-full bg-m-ic p-[3px] wide:max-w-[360px]">+ {(['common', 'personal'] as const).map(id => (+ <button+ key={id}+ type="button"+ aria-pressed={view === id}+ onClick={() => setView(id)}+ className={`flex-1 whitespace-nowrap rounded-full py-[6px] text-center text-caption font-semibold ${view === id ? 'bg-m-act text-m-actfg' : 'text-m-ink'}`}+ >+ {id === 'common' ? t('packing.viewCommon') : t('packing.viewPersonal')}+ </button>+ ))}</div>)}- {/* ── Categories + items (spec §4.4) ── */}+ {/* ── Categories + items ── */}{trueEmpty ? (<div className="flex min-h-[60vh] flex-col items-center justify-center px-8 py-10 text-center"><MDancingTrek scene="packing" className="mb-2" />- <p className="font-geist text-[0.8125rem] font-medium text-m-muted">{t('packing.emptyTitle')}</p>+ <p className="text-body font-medium text-m-muted">{t('packing.emptyTitle')}</p></div>) : viewEmpty ? (- <div className="px-[30px] py-[26px] text-center font-geist text-[0.6875rem] leading-relaxed text-m-faint">+ <div className="px-[30px] py-[26px] text-center text-caption leading-relaxed text-m-faint">{t('packing.personalEmptyHint')}</div>) : groups.length === 0 ? (- <div className="px-[30px] py-[26px] text-center font-geist text-[0.6875rem] leading-relaxed text-m-faint">+ <div className="px-[30px] py-[26px] text-center text-caption leading-relaxed text-m-faint">{t('packing.emptyFiltered')}</div>) : (// Categories stand in columns on a wide window, as many as the page// holds, each card whole in its column like a masonry board.<div className="wide:mt-[10px] wide:columns-[300px] wide:gap-3">- {groups.map(group => (- <PackingCategoryCard- key={group.category}- group={group}- categoryOrder={categoryOrder}- open={!collapsed[group.category]}- onToggle={() => toggleCategory(group.category)}- editMode={editMode}- canEdit={canEdit}+ {groups.map(group => (+ <PackingCategoryCard+ key={group.category}+ group={group}+ categoryOrder={categoryOrder}+ open={!collapsed[group.category]}+ onToggle={() => toggleCategory(group.category)}+ canEdit={canEdit}+ planner={planner}+ currentUserId={currentUserId}+ assignees={categoryAssignees[group.category] || []}+ onOpenMenu={() => setMenuCategory(group.category)}+ onRename={newName => renameCategory(group.category, newName)}+ renameSignal={renamingCategory === group.category}+ onRenamed={() => setRenamingCategory(null)}+ onAddItem={name => addItemToCategory(group.category, name)}+ onEditItem={id => setEditingItemId(id)}+ onDeleteItem={deleteItem}+ />+ ))}+ </div>+ )}++ {/* ── The list's own actions, as a sheet ── */}+ <MSheet open={menuGroup != null} onClose={() => setMenuCategory(null)} ariaLabel={t('packing.categoryOptions')}>+ {menuGroup && (+ <CategoryMenuplanner={planner}- currentUserId={currentUserId}- assignees={categoryAssignees[group.category] || []}+ group={menuGroup}+ canEdit={canEdit}+ assignees={categoryAssignees[menuGroup.category] || []}tripMembers={tripMembers}- onSetAssignees={userIds => setCategoryAssigneesFor(group.category, userIds)}- onRename={newName => renameCategory(group.category, newName)}- onCheckAll={() => checkAllInCategory(group.items)}- onUncheckAll={() => uncheckAllInCategory(group.items)}- onShareCategory={() => categorySharing.openFor(group.category)}- onDeleteCategory={() => setDeleteCategoryTarget({ name: group.category, items: items.filter(i => (i.category || defaultCategory) === group.category) })}- onAddItem={name => addItemToCategory(group.category, name)}- onEditItem={id => setEditingItemId(id)}- onDeleteItem={deleteItem}- bagTrackingEnabled={bagTrackingEnabled}- bags={bags}- onCreateBag={createBag}+ onClose={() => setMenuCategory(null)}+ onRename={() => { setMenuCategory(null); setRenamingCategory(menuGroup.category) }}+ onSetAssignees={userIds => setCategoryAssigneesFor(menuGroup.category, userIds)}+ onCheckAll={() => { setMenuCategory(null); void setAllInCategory(menuGroup.items, true) }}+ onUncheckAll={() => { setMenuCategory(null); void setAllInCategory(menuGroup.items, false) }}+ onShare={() => { setMenuCategory(null); categorySharing.openFor(menuGroup.category) }}+ onDelete={() => {+ setMenuCategory(null)+ setDeleteCategoryTarget({ name: menuGroup.category, items: items.filter(i => (i.category || defaultCategory) === menuGroup.category) })+ }}/>- ))}- </div>- )}+ )}+ </MSheet>++ {/* ── Everything else the list does, as one sheet ── */}+ <MSheet open={actionsOpen} onClose={closeActions} ariaLabel={t('packing.actions')}>+ <FormSheetHeader title={t('packing.title')} onClose={closeActions} closeLabel={t('common.close')} />+ <FormSheetBody>+ {actionView === 'menu' && (+ <>+ <ActionGroup>+ {canEdit && <ActionRow icon={ListPlus} label={t('packing.addCategory')} onClick={run(() => setAddingCategory(true))} />}+ {canEdit && templates.length > 0 && <ActionRow icon={LayoutTemplate} label={t('packing.applyTemplate')} onClick={() => setActionView('apply')} />}+ {canEdit && isAdmin && items.length > 0 && <ActionRow icon={SaveIcon} label={t('packing.saveAsTemplate')} onClick={() => setActionView('save')} />}+ {canEdit && <ActionRow icon={Download} label={t('packing.import')} onClick={run(() => setShowImportSheet(true))} />}+ </ActionGroup>+ {packingExport.hasItems && (+ <ActionGroup>+ <ActionRow icon={Printer} label={t('packing.exportPrint')} onClick={run(() => void packingExport.openPrint())} />+ <ActionRow icon={FileText} label={t('packing.exportMarkdown')} onClick={run(() => packingExport.exportMarkdown())} />+ <ActionRow icon={FileSpreadsheet} label={t('packing.exportCsv')} onClick={run(() => void packingExport.exportCsv())} />+ </ActionGroup>+ )}+ <ActionGroup>+ {!trueEmpty && (+ <ActionRow icon={EyeOff} label={t('packing.hideDone')} trailing={hideDone ? <Check size={15} strokeWidth={2.4} /> : undefined}+ onClick={() => setHideDone(v => !v)} />+ )}+ {bagTrackingEnabled && <ActionRow icon={Briefcase} label={t('packing.bags')} onClick={run(() => setShowBagsSheet(true))} />}+ {canEdit && checkedCount > 0 && (+ <ActionRow icon={Trash2} label={t('packing.clearChecked', { count: checkedCount })} danger onClick={run(() => setConfirmClear(true))} />+ )}+ </ActionGroup>+ </>+ )}+ {actionView === 'apply' && (+ <ActionGroup>+ {templates.map(tmpl => (+ <ActionRow key={tmpl.id} icon={Package} label={tmpl.name}+ trailing={<span className="text-caption text-m-faint">{tmpl.item_count}</span>}+ onClick={() => applyTemplate(tmpl.id)} />+ ))}+ </ActionGroup>+ )}+ {actionView === 'save' && (+ <div className="flex items-center gap-2">+ <input+ type="text"+ autoFocus+ value={saveTemplateName}+ onChange={e => setSaveTemplateName(e.target.value)}+ onKeyDown={e => { if (e.key === 'Enter') void saveAsTemplate() }}+ placeholder={t('packing.templateName')}+ className={`${FIELD_CLS} flex-1`}+ />+ <button+ type="button"+ onClick={saveAsTemplate}+ disabled={!saveTemplateName.trim()}+ aria-label={t('common.save')}+ className="flex h-10 w-10 flex-none items-center justify-center rounded-full bg-m-act text-m-actfg disabled:opacity-40"+ >+ <Check size={15} strokeWidth={2.4} />+ </button>+ </div>+ )}+ </FormSheetBody>+ </MSheet><MBagsSheetplanner={planner}@@ -390,6 +354,10 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {bagTrackingEnabled={bagTrackingEnabled}tripMembers={tripMembers}currentUserId={currentUserId}+ categories={categoryOrder}+ bags={bags}+ onCreateBag={createBag}+ onDelete={item => void deleteItem(item)}onClose={() => setEditingItemId(null)}/>@@ -428,74 +396,125 @@ export default function MPackingListTab({ planner }: { planner: TripPlanner }) {)}-function ActionRow({ icon: Icon, label, onClick, danger = false }: {+function ActionGroup({ children }: Readonly<{ children: ReactNode }>) {+ return <div className="mb-3 flex flex-col overflow-hidden rounded-[16px] bg-m-ic empty:hidden">{children}</div>+}++function ActionRow({ icon: Icon, label, onClick, danger = false, trailing }: Readonly<{icon: LucideIconlabel: stringonClick: () => voiddanger?: boolean-}) {+ trailing?: ReactNode+}>) {return (<buttontype="button"onClick={onClick}- className={`flex w-full items-center gap-[9px] border-b border-[color:var(--m-rowbr)] px-[13px] py-[11px] text-start text-[0.78125rem] font-semibold last:border-b-0 ${+ className={`flex w-full items-center gap-[11px] border-b border-m-rowbr px-[14px] py-[12px] text-start text-body font-medium last:border-b-0 ${danger ? 'text-[color:var(--m-st-danger)]' : 'text-m-ink'}`}>- <Icon size={14} strokeWidth={2} />- {label}+ <Icon size={16} strokeWidth={2} className="flex-none" />+ <span className="min-w-0 flex-1 truncate">{label}</span>+ {trailing}</button>)}+// ── A list's own menu ───────────────────────────────────────────────────++function CategoryMenu({+ planner, group, canEdit, assignees, tripMembers, onClose, onRename, onSetAssignees, onCheckAll, onUncheckAll, onShare, onDelete,+}: Readonly<{+ planner: TripPlanner+ group: PackingCategoryGroup+ canEdit: boolean+ assignees: CategoryAssignee[]+ tripMembers: TripMember[]+ onClose: () => void+ onRename: () => void+ onSetAssignees: (userIds: number[]) => void+ onCheckAll: () => void+ onUncheckAll: () => void+ onShare: () => void+ onDelete: () => void+}>) {+ const { t } = planner+ const toggleAssignee = (userId: number) => {+ const assigned = assignees.some(a => a.user_id === userId)+ onSetAssignees(assigned ? assignees.filter(a => a.user_id !== userId).map(a => a.user_id) : [...assignees.map(a => a.user_id), userId])+ }+ return (+ <>+ <FormSheetHeader title={group.category} onClose={onClose} closeLabel={t('common.close')} />+ <FormSheetBody>+ <ActionGroup>+ {canEdit && <ActionRow icon={Pencil} label={t('packing.menuRename')} onClick={onRename} />}+ <ActionRow icon={CheckCheck} label={t('packing.menuCheckAll')} onClick={onCheckAll} />+ <ActionRow icon={RotateCcw} label={t('packing.menuUncheckAll')} onClick={onUncheckAll} />+ {canEdit && <ActionRow icon={Share2} label={t('packing.menuShareCat')} onClick={onShare} />}+ </ActionGroup>+ {canEdit && (+ <>+ <div className="mb-[6px] ps-1 text-caption font-semibold text-m-muted">{t('packing.assignMembers')}</div>+ <ActionGroup>+ {tripMembers.length === 0+ ? <div className="px-[14px] py-[12px] text-caption text-m-faint">{t('packing.noMembers')}</div>+ : tripMembers.map(m => (+ <ActionRow key={m.id} icon={UserRound} label={m.username}+ trailing={assignees.some(a => a.user_id === m.id) ? <Check size={15} strokeWidth={2.4} /> : undefined}+ onClick={() => toggleAssignee(m.id)} />+ ))}+ </ActionGroup>+ <ActionGroup>+ <ActionRow icon={Trash2} label={t('packing.menuDeleteCat')} danger onClick={onDelete} />+ </ActionGroup>+ </>+ )}+ </FormSheetBody>+ </>+ )+}+// ── Category card ───────────────────────────────────────────────────────function PackingCategoryCard({- group, categoryOrder, open, onToggle, editMode, canEdit, planner, currentUserId, assignees, tripMembers,- onSetAssignees, onRename, onCheckAll, onUncheckAll, onShareCategory, onDeleteCategory, onAddItem, onEditItem, onDeleteItem,- bagTrackingEnabled, bags, onCreateBag,-}: {+ group, categoryOrder, open, onToggle, canEdit, planner, currentUserId, assignees,+ onOpenMenu, onRename, renameSignal, onRenamed, onAddItem, onEditItem, onDeleteItem,+}: Readonly<{group: PackingCategoryGroupcategoryOrder: string[]open: booleanonToggle: () => void- editMode: booleancanEdit: booleanplanner: TripPlannercurrentUserId: number | nullassignees: CategoryAssignee[]- tripMembers: TripMember[]- onSetAssignees: (userIds: number[]) => void+ onOpenMenu: () => voidonRename: (newName: string) => void- onCheckAll: () => void- onUncheckAll: () => void- onShareCategory: () => void- onDeleteCategory: () => void+ /** Rename was picked in the list's menu: the name turns into a field in place. */+ renameSignal: boolean+ onRenamed: () => voidonAddItem: (name: string) => voidonEditItem: (itemId: number) => voidonDeleteItem: (item: PackingItem) => Promise<void>- bagTrackingEnabled: boolean- bags: PackingBag[]- onCreateBag: (name: string) => Promise<PackingBag | undefined>-}) {+}>) {const { t } = planner- const [renaming, setRenaming] = useState(false)- const [renameDraft, setRenameDraft] = useState(group.category)- const [menuOpen, setMenuOpen] = useState(false)- const [assignOpen, setAssignOpen] = useState(false)+ const [renameDraft, setRenameDraft] = useState<string | null>(null)const [addingItem, setAddingItem] = useState(false)const [newItemName, setNewItemName] = useState('')+ const renaming = renameDraft !== null || renameSignalconst dot = katColor(group.category, categoryOrder)const checkedCount = group.items.filter(i => i.checked).lengthconst commitRename = () => {- const trimmed = renameDraft.trim()+ const trimmed = (renameDraft ?? group.category).trim()if (trimmed && trimmed !== group.category) onRename(trimmed)- else setRenameDraft(group.category)- setRenaming(false)+ setRenameDraft(null)+ onRenamed()}-const submitAddItem = () => {const trimmed = newItemName.trim()if (!trimmed) return@@ -504,101 +523,52 @@ function PackingCategoryCard({}return (- <div className="mt-[10px] overflow-hidden rounded-2xl border border-[color:var(--m-rowbr)] bg-m-sheetop wide:mb-[10px] wide:mt-0 wide:inline-block wide:w-full wide:break-inside-avoid wide:align-top">- {/* A <div role="button"> rather than a real <button type="button"> — the rename input and- the assign/menu triggers below are interactive elements a <button type="button"> may- not contain (invalid HTML); this stays keyboard-operable via onKeyDown. */}- <div- role="button"- tabIndex={0}- onClick={onToggle}- onKeyDown={e => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); onToggle() } }}- aria-expanded={open}- className="flex w-full items-center gap-[8px] bg-[color:var(--m-ic)] px-[13px] py-[9px] text-start"- >+ <div className="mt-[10px] overflow-hidden rounded-2xl border border-m-rowbr bg-m-sheetop wide:mb-[10px] wide:mt-0 wide:inline-block wide:w-full wide:break-inside-avoid wide:align-top">+ <div className="flex w-full items-center gap-[8px] bg-m-ic py-[7px] pe-[8px] ps-[13px]"><span className="h-[9px] w-[9px] flex-none rounded-full" style={{ background: dot }} />{renaming ? (<inputtype="text"autoFocus- value={renameDraft}- onClick={e => e.stopPropagation()}+ value={renameDraft ?? group.category}onChange={e => setRenameDraft(e.target.value)}onBlur={commitRename}onKeyDown={e => {- e.stopPropagation()if (e.key === 'Enter') commitRename()- if (e.key === 'Escape') { setRenaming(false); setRenameDraft(group.category) }+ if (e.key === 'Escape') { setRenameDraft(null); onRenamed() }}}- className="min-w-0 flex-1 border-b border-[color:var(--m-rowbr)] bg-transparent text-[0.875rem] font-bold text-m-ink outline-none"+ aria-label={t('packing.menuRename')}+ className="min-w-0 flex-1 border-b border-m-rowbr bg-transparent text-body font-bold text-m-ink outline-none"/>) : (- <span dir="auto" className="min-w-0 flex-1 truncate text-[0.875rem] font-bold text-m-ink">{group.category}</span>- )}- {editMode && (- <button- type="button"- onClick={e => { e.stopPropagation(); setAssignOpen(v => !v) }}- aria-label={t('packing.assignMembers')}- className="flex-none text-m-faint"- >- <UserPlus size={13} strokeWidth={2} />- </button>- )}- <span className="flex-none whitespace-nowrap rounded-full bg-[color:var(--m-ic)] px-2 py-[2px] font-geist text-[0.59375rem] font-bold text-m-muted">- {checkedCount}/{group.items.length}- </span>- {editMode && (- <button- type="button"- onClick={e => { e.stopPropagation(); setMenuOpen(v => !v) }}- aria-label={t('packing.categoryOptions')}- className="flex h-7 w-7 flex-none items-center justify-center rounded-full bg-[color:var(--m-ic)] text-m-muted"- >- <MoreHorizontal size={12} strokeWidth={2} />+ <button type="button" onClick={onToggle} aria-expanded={open} className="flex min-w-0 flex-1 items-center gap-[8px] text-start">+ <span dir="auto" className="min-w-0 truncate text-body font-bold text-m-ink">{group.category}</span>+ {assignees.length > 0 && (+ <span className="flex flex-none" aria-label={assignees.map(a => a.username).join(', ')}>+ {assignees.slice(0, 3).map(a => (+ <span key={a.user_id} aria-hidden className="-ms-1 flex h-[18px] w-[18px] items-center justify-center rounded-full border-2 border-m-sheetop bg-m-act text-[0.5625rem] font-bold uppercase text-m-actfg first:ms-0">+ {a.username[0]}+ </span>+ ))}+ </span>+ )}+ <span className="ms-auto flex-none whitespace-nowrap rounded-full bg-m-sheetop px-2 py-[2px] text-caption font-bold tabular-nums text-m-muted">+ {checkedCount}/{group.items.length}+ </span>+ {open ? <ChevronUp size={14} strokeWidth={2} className="flex-none text-m-faint" /> : <ChevronDown size={14} strokeWidth={2} className="flex-none text-m-faint" />}</button>)}- {open ? <ChevronUp size={13} strokeWidth={2} className="flex-none text-m-faint" /> : <ChevronDown size={13} strokeWidth={2} className="flex-none text-m-faint" />}+ <button+ type="button"+ onClick={onOpenMenu}+ aria-label={t('packing.categoryOptions')}+ aria-haspopup="dialog"+ className="flex h-8 w-8 flex-none items-center justify-center rounded-full text-m-muted"+ >+ <MoreHorizontal size={16} strokeWidth={2} />+ </button></div>- {assignOpen && editMode && (- <div className="border-b border-[color:var(--m-rowbr)] bg-m-sheetop px-[13px] py-[10px]">- <div className="mb-[6px] font-geist text-[0.625rem] font-bold uppercase tracking-[.06em] text-m-faint">{t('packing.assignMembers')}</div>- {tripMembers.length === 0 ? (- <div className="font-geist text-[0.6875rem] text-m-faint">{t('packing.noMembers')}</div>- ) : (- <div className="flex flex-wrap gap-[6px]">- {tripMembers.map(m => {- const assigned = assignees.some(a => a.user_id === m.id)- return (- <button- key={m.id}- type="button"- onClick={() => onSetAssignees(assigned ? assignees.filter(a => a.user_id !== m.id).map(a => a.user_id) : [...assignees.map(a => a.user_id), m.id])}- className={`flex items-center gap-[5px] rounded-full px-[10px] py-[5px] text-[0.71875rem] font-semibold ${- assigned ? 'bg-m-act text-m-actfg' : 'bg-[color:var(--m-ic)] text-m-muted'- }`}- >- {m.username}- {assigned && <Check size={11} strokeWidth={2.4} />}- </button>- )- })}- </div>- )}- </div>- )}-- {menuOpen && editMode && (- <div className="border-b border-[color:var(--m-rowbr)]">- <ActionRow icon={Pencil} label={t('packing.menuRename')} onClick={() => { setMenuOpen(false); setRenaming(true) }} />- <ActionRow icon={CheckCheck} label={t('packing.menuCheckAll')} onClick={() => { setMenuOpen(false); onCheckAll() }} />- <ActionRow icon={RotateCcw} label={t('packing.menuUncheckAll')} onClick={() => { setMenuOpen(false); onUncheckAll() }} />- {canEdit && <ActionRow icon={Share2} label={t('packing.menuShareCat')} onClick={() => { setMenuOpen(false); onShareCategory() }} />}- <ActionRow icon={Trash2} label={t('packing.menuDeleteCat')} danger onClick={() => { setMenuOpen(false); onDeleteCategory() }} />- </div>- )}-{open && (<div className="px-[13px] pb-[8px]">{group.items.map(item => (@@ -607,52 +577,52 @@ function PackingCategoryCard({item={item}planner={planner}currentUserId={currentUserId}- editMode={editMode}canEdit={canEdit}- bagTrackingEnabled={bagTrackingEnabled}- bags={bags}- onCreateBag={onCreateBag}onEdit={() => onEditItem(item.id)}onDelete={() => onDeleteItem(item)}/>))}- {editMode && canEdit && (- addingItem ? (- <div className="flex items-center gap-[6px] py-[8px]">- <input- type="text"- autoFocus- value={newItemName}- onChange={e => setNewItemName(e.target.value)}- onKeyDown={e => {- if (e.key === 'Enter') submitAddItem()- if (e.key === 'Escape') { setAddingItem(false); setNewItemName('') }- }}- placeholder={t('packing.addItemPlaceholder')}- className={`${FIELD_CLS} flex-1 py-[7px]`}- />- <button- type="button"- onClick={submitAddItem}- disabled={!newItemName.trim()}- aria-label={t('common.add')}- className="flex h-8 w-8 flex-none items-center justify-center rounded-[10px] bg-m-act text-m-actfg disabled:opacity-40"- >- <Plus size={14} strokeWidth={2.4} />- </button>- </div>- ) : (+ {/* Like the desktop: the add row turns into the field in place, no frame. */}+ {canEdit && (addingItem ? (+ <div className="mt-[6px] flex items-center gap-[10px] rounded-[12px] bg-m-ic py-[5px] pe-[6px] ps-[11px]">+ <span aria-hidden className="h-[22px] w-[22px] flex-none rounded-[7px] border-[1.5px] border-[color:var(--m-checkbr)]" />+ <input+ type="text"+ autoFocus+ value={newItemName}+ onChange={e => setNewItemName(e.target.value)}+ onBlur={() => { if (!newItemName.trim()) { setAddingItem(false); setNewItemName('') } }}+ onKeyDown={e => {+ if (e.key === 'Enter') submitAddItem()+ if (e.key === 'Escape') { setAddingItem(false); setNewItemName('') }+ }}+ placeholder={t('packing.addItemPlaceholder')}+ aria-label={t('packing.addItemPlaceholder')}+ className="min-w-0 flex-1 bg-transparent py-[5px] text-body text-m-ink outline-none placeholder:text-m-faint"+ /><buttontype="button"- onClick={() => setAddingItem(true)}- className="flex items-center gap-[6px] py-[8px] font-geist text-[0.6875rem] font-semibold text-m-muted"+ onClick={submitAddItem}+ disabled={!newItemName.trim()}+ aria-label={t('common.add')}+ className={`flex h-7 w-7 flex-none items-center justify-center rounded-full ${newItemName.trim() ? 'bg-m-act text-m-actfg' : 'text-m-faint'}`}>- <Plus size={12} strokeWidth={2.2} />- {t('packing.addItem')}+ <Plus size={14} strokeWidth={2.4} /></button>- )- )}+ </div>+ ) : (+ <button+ type="button"+ onClick={() => setAddingItem(true)}+ className="mt-[6px] flex w-full items-center gap-[10px] rounded-[12px] bg-m-ic px-[11px] py-[9px] text-start text-body font-medium text-m-faint"+ >+ <span aria-hidden className="flex h-[22px] w-[22px] flex-none items-center justify-center rounded-[7px] border-[1.5px] border-dashed border-current">+ <Plus size={12} strokeWidth={2.4} />+ </span>+ {t('packing.addItem')}+ </button>+ ))}</div>)}</div>@@ -661,40 +631,29 @@ function PackingCategoryCard({// ── Item row ────────────────────────────────────────────────────────────-function PackingItemRow({ item, planner, currentUserId, editMode, canEdit, bagTrackingEnabled, bags, onCreateBag, onEdit, onDelete }: {+function PackingItemRow({ item, planner, currentUserId, canEdit, onEdit, onDelete }: Readonly<{item: PackingItemplanner: TripPlannercurrentUserId: number | null- editMode: booleancanEdit: boolean- bagTrackingEnabled: boolean- bags: PackingBag[]- onCreateBag: (name: string) => Promise<PackingBag | undefined>onEdit: () => voidonDelete: () => void-}) {+}>) {const { t, tripId, tripActions } = planner- const [bagPickerOpen, setBagPickerOpen] = useState(false)- const [menuOpen, setMenuOpen] = useState(false)- const [creatingBag, setCreatingBag] = useState(false)- const [newBagName, setNewBagName] = useState('')-const isPlaceholder = isPackingPlaceholder(item)- const bag = item.bag_id != null ? bags.find(b => b.id === item.bag_id) : undefined- // Sharing badges (#858) mirror ArtikelZeile: is_private + ownership split the- // three states, so exactly one (or none) ever applies.+ // Sharing badges (#858) mirror the desktop row: is_private + ownership split+ // the three states, so exactly one (or none) ever applies.const recipients = item.recipients || []const contributors = item.contributors || []const badgeSharedToMe = !!item.is_private && item.owner_id != null && item.owner_id !== currentUserIdconst badgeSharedByMe = !!item.is_private && item.owner_id === currentUserId && recipients.length > 0- const badgeBroughtBy = !item.is_private && item.owner_username ? item.owner_username : null- // Owner is shown as a compact avatar instead of the full username (saves space- // on the row). Resolve the picture from the trip members, falling back to the- // signed-in user for their own items, then to initials.+ const bringerName = !item.is_private ? (item.owner_username || contributors[0]?.username || null) : null+ const bringerId = item.owner_username ? item.owner_id : contributors[0]?.user_idconst me = useAuthStore(s => s.user)- const ownerMember = planner.tripMembers.find(m => m.id === item.owner_id)- const ownerAvatarUrl = ownerMember?.avatar_url ?? (item.owner_id === me?.id ? me?.avatar_url ?? null : null)+ const bringerMember = planner.tripMembers.find(m => m.id === bringerId)+ const bringerAvatarUrl = bringerMember?.avatar_url ?? (bringerId === me?.id ? me?.avatar_url ?? null : null)+ const moreBringers = item.owner_username ? contributors.length : Math.max(0, contributors.length - 1)const toggle = () => {selectionHaptic()@@ -705,20 +664,7 @@ function PackingItemRow({ item, planner, currentUserId, editMode, canEdit, bagTrconst packed = packedOf(item)const partlyPacked = !item.checked && packed > 0- const assignBag = async (bagId: number | null) => {- setBagPickerOpen(false)- try { await tripActions.updatePackingItem(tripId, item.id, { bag_id: bagId }) } catch { planner.toast.error(t('packing.toast.saveError')) }- }-- const submitNewBag = async () => {- if (!newBagName.trim()) return- const created = await onCreateBag(newBagName.trim())- if (created) await assignBag(created.id)- setNewBagName('')- setCreatingBag(false)- }-- // A swipe does what the row's own controls do: tick it off, or edit and delete it.+ // A swipe does what the item sheet does: tick it off, or edit and delete it.const swipeTrailing: SwipeAction[] = canEdit && !isPlaceholder? [{ label: t('common.delete'), icon: Trash2, tone: 'danger', onAction: onDelete },@@ -732,15 +678,14 @@ function PackingItemRow({ item, planner, currentUserId, editMode, canEdit, bagTr: { label: t('packing.filterDone'), icon: Check, tone: 'accent', onAction: () => void toggle() }return (- <>- <MSwipeRow- leading={swipeLeading}- trailing={swipeTrailing}- surface="bg-m-sheetop"- inset={4}- className="border-t border-[color:var(--m-rowbr)] first:border-t-0"- >- <div className="flex items-center gap-[9px] py-2">+ <MSwipeRow+ leading={swipeLeading}+ trailing={swipeTrailing}+ surface="bg-m-sheetop"+ inset={4}+ className="border-t border-m-rowbr first:border-t-0"+ >+ <div className="flex items-center gap-[10px] py-[9px]"><buttontype="button"onClick={toggle}@@ -753,158 +698,43 @@ function PackingItemRow({ item, planner, currentUserId, editMode, canEdit, bagTr<Check size={12} strokeWidth={3} /></button>- <span className={`min-w-0 flex-1 truncate text-[0.8125rem] font-medium ${item.checked ? 'text-m-faint line-through opacity-45' : 'text-m-ink'}`}>- {isPlaceholder ? t('packing.addItemPlaceholder') : item.name}- </span>-- {/* Sharing state is an icon, not a sentence (#1525): "Taken care of by- Alexander" spelled out took a third of the row away from the item- name. The full wording lives on the pill as its label. */}- {badgeSharedToMe && (- <span- className="flex h-5 w-5 flex-none items-center justify-center rounded-full bg-[color:var(--m-ic)] text-m-muted"- title={t('packing.takenCareOf', { name: item.owner_username || '' })}- aria-label={t('packing.takenCareOf', { name: item.owner_username || '' })}- >- <HandHelping size={11} strokeWidth={2.2} />- </span>- )}- {!badgeSharedToMe && badgeSharedByMe && (- <span- className="flex flex-none items-center gap-[2px] rounded-full bg-[color:var(--m-ic)] px-[5px] py-[3px] font-geist text-[0.59375rem] font-bold text-m-muted"- title={t('packing.sharedWithCount', { count: recipients.length })}- aria-label={t('packing.sharedWithCount', { count: recipients.length })}- >- <UserRound size={10} strokeWidth={2.2} />- {recipients.length}- </span>- )}- {!badgeSharedToMe && !badgeSharedByMe && badgeBroughtBy && (- <span className="flex flex-none items-center gap-[3px]" title={t('packing.broughtBy', { name: packingBringerNames(item) })} aria-label={t('packing.broughtBy', { name: packingBringerNames(item) })}>- {ownerAvatarUrl- ? <img src={ownerAvatarUrl} alt={item.owner_username || ''} className="h-5 w-5 flex-none rounded-full object-cover" />- : <span className="flex h-5 w-5 flex-none items-center justify-center rounded-full bg-[color:var(--m-ic)] font-geist text-[0.5625rem] font-bold text-m-muted">{(item.owner_username || '?')[0]?.toUpperCase()}</span>}- {contributors.length > 0 && (- <span className="font-geist text-[0.59375rem] font-bold text-m-faint">+{contributors.length}</span>- )}- </span>- )}-- {quantity > 1 && (canEdit && !isPlaceholder ? (- <span- role="group"- aria-label={t('packing.packedCount', { packed, total: quantity })}- className={`flex flex-none items-center rounded-full font-geist text-[0.625rem] font-bold tabular-nums ${partlyPacked ? 'bg-[color:color-mix(in_srgb,var(--m-act)_14%,transparent)] text-m-ink' : 'bg-[color:var(--m-ic)] text-m-muted'}`}- >- <button type="button" aria-label={t('packing.packedLess')} disabled={packed <= 0} onClick={() => tripActions.setPackedCount(tripId, item.id, packed - 1)}- className="flex h-[22px] w-[22px] items-center justify-center disabled:opacity-30">- <Minus size={11} strokeWidth={2.6} />- </button>- <span className="min-w-[26px] text-center">{packed}/{quantity}</span>- <button type="button" aria-label={t('packing.packedMore')} disabled={packed >= quantity} onClick={() => tripActions.setPackedCount(tripId, item.id, packed + 1)}- className="flex h-[22px] w-[22px] items-center justify-center disabled:opacity-30">- <Plus size={11} strokeWidth={2.6} />- </button>- </span>- ) : (- <span className="flex-none rounded-full bg-[color:var(--m-ic)] px-2 py-[2px] font-geist text-[0.625rem] font-bold tabular-nums text-m-muted">- {partlyPacked ? `${packed}/${quantity}` : `${quantity}×`}- </span>- ))}-- {/* A weight nobody entered is not worth a column: "— g" on every row- cost as much width as a real value (#1525). */}- {editMode && bagTrackingEnabled && item.weight_grams != null && (- <span className="flex-none font-geist text-[0.625rem] font-semibold tabular-nums text-m-faint">- {formatWeight(item.weight_grams)}+ {/* The rest of the row opens the item sheet: everything about it lives there. */}+ <button type="button" onClick={onEdit} aria-haspopup="dialog" aria-label={`${isPlaceholder ? t('packing.addItemPlaceholder') : item.name}, ${t('packing.editItem')}`} className="flex min-w-0 flex-1 items-center gap-[8px] rounded-[10px] text-start outline-none [-webkit-tap-highlight-color:transparent] focus-visible:ring-2 focus-visible:ring-m-act">+ <span className={`min-w-0 flex-1 truncate text-body font-medium ${item.checked ? 'text-m-faint line-through opacity-45' : 'text-m-ink'}`}>+ {isPlaceholder ? t('packing.addItemPlaceholder') : item.name}</span>- )}-- {bagTrackingEnabled && (- <button- type="button"- onClick={() => { setMenuOpen(false); setBagPickerOpen(v => !v) }}- aria-label={t('packing.bags')}- className="h-[18px] w-[18px] flex-none rounded-full"- style={bag- ? { border: `2.5px solid ${bag.color}`, background: 'transparent' }- : { border: '2px dashed var(--m-faint)', opacity: 0.55 }}- />- )}- {/* Edit and delete moved behind one button (#1525): two round targets- plus their gaps were the widest thing on an edit-mode row, and- neither is used often enough to earn a permanent seat. */}- {editMode && canEdit && (- <button- type="button"- onClick={() => { setBagPickerOpen(false); setMenuOpen(v => !v) }}- aria-label={t('mobileTrip.more')}- aria-expanded={menuOpen}- className={`flex h-7 w-7 flex-none items-center justify-center rounded-full bg-[color:var(--m-ic)] ${menuOpen ? 'text-m-ink' : 'text-m-muted'}`}- >- <MoreHorizontal size={13} strokeWidth={2} />- </button>- )}- </div>- </MSwipeRow>+ {partlyPacked && <span className="flex-none text-caption font-semibold tabular-nums text-m-muted">{packed}/{quantity}</span>}+ {!partlyPacked && quantity > 1 && <span className="flex-none text-caption font-medium tabular-nums text-m-faint">×{quantity}</span>}- {menuOpen && editMode && canEdit && (- <div className="mb-[6px] ms-[28px] overflow-hidden rounded-[13px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-glass)] backdrop-blur-[24px]">- <button- type="button"- onClick={() => { setMenuOpen(false); onEdit() }}- className="flex w-full items-center gap-[9px] border-b border-[color:var(--m-rowbr)] px-3 py-2 text-start text-[0.75rem] font-medium text-m-ink"- >- <Pencil size={12} strokeWidth={2} />- {t('common.edit')}- </button>- <button- type="button"- onClick={() => { setMenuOpen(false); onDelete() }}- className="flex w-full items-center gap-[9px] px-3 py-2 text-start text-[0.75rem] font-medium text-[color:var(--m-st-danger)]"- >- <Trash2 size={12} strokeWidth={2} />- {t('common.delete')}- </button>- </div>- )}-- {bagPickerOpen && bagTrackingEnabled && (- <div className="mb-[6px] ms-[28px] overflow-hidden rounded-[13px] border border-[color:var(--m-rowbr)] bg-[color:var(--m-glass)] backdrop-blur-[24px]">- <button type="button" onClick={() => assignBag(null)} className="flex w-full items-center gap-[9px] border-b border-[color:var(--m-rowbr)] px-3 py-2 text-start text-[0.75rem] font-medium text-m-muted">- <span className="h-[9px] w-[9px] flex-none rounded-full border border-dashed border-[color:var(--m-faint)]" />- {t('packing.noBag')}- </button>- {bags.map(b => (- <button key={b.id} type="button" onClick={() => assignBag(b.id)} className="flex w-full items-center gap-[9px] border-b border-[color:var(--m-rowbr)] px-3 py-2 text-start text-[0.75rem] font-medium text-m-ink">- <span className="h-[9px] w-[9px] flex-none rounded-full" style={{ background: b.color }} />- {b.name}- </button>- ))}- {creatingBag ? (- <div className="flex items-center gap-[6px] p-[8px]">- <input- type="text"- autoFocus- value={newBagName}- onChange={e => setNewBagName(e.target.value)}- onKeyDown={e => { if (e.key === 'Enter') void submitNewBag(); if (e.key === 'Escape') { setCreatingBag(false); setNewBagName('') } }}- placeholder={t('packing.bagName')}- className={`${FIELD_CLS} flex-1 py-[6px] text-[0.75rem]`}- />- <button type="button" onClick={submitNewBag} disabled={!newBagName.trim()} aria-label={t('common.add')} className="flex h-7 w-7 flex-none items-center justify-center rounded-[9px] bg-m-act text-m-actfg disabled:opacity-40">- <Plus size={12} strokeWidth={2.4} />- </button>- </div>- ) : (- <button type="button" onClick={() => setCreatingBag(true)} className="flex w-full items-center gap-[7px] px-3 py-2 text-start font-geist text-[0.6875rem] font-semibold text-m-muted">- <Plus size={11} strokeWidth={2.2} />- {t('packing.addBag')}- </button>+ {badgeSharedToMe && (+ <span+ className="flex h-5 w-5 flex-none items-center justify-center rounded-full bg-m-ic text-m-muted"+ aria-label={t('packing.takenCareOf', { name: item.owner_username || '' })}+ >+ <HandHelping size={11} strokeWidth={2.2} />+ </span>)}- </div>- )}- </>+ {!badgeSharedToMe && badgeSharedByMe && (+ <span+ className="flex flex-none items-center gap-[2px] rounded-full bg-m-ic px-[6px] py-[3px] text-caption font-bold text-m-muted"+ aria-label={t('packing.sharedWithCount', { count: recipients.length })}+ >+ <UserRound size={10} strokeWidth={2.2} />+ {recipients.length}+ </span>+ )}+ {!badgeSharedToMe && !badgeSharedByMe && bringerName && (+ <span className="flex flex-none items-center gap-[3px]" aria-label={t('packing.broughtBy', { name: packingBringerNames(item) })}>+ {bringerAvatarUrl+ ? <img src={bringerAvatarUrl} alt="" className="h-5 w-5 flex-none rounded-full object-cover" />+ : <span aria-hidden className="flex h-5 w-5 flex-none items-center justify-center rounded-full bg-m-ic text-[0.5625rem] font-bold text-m-muted">{bringerName[0]?.toUpperCase()}</span>}+ {moreBringers > 0 && <span aria-hidden className="text-caption font-bold text-m-faint">+{moreBringers}</span>}+ </span>+ )}+ </button>+ </div>+ </MSwipeRow>)}+diff --git a/client/src/pages/tripPlanner/ListsContainer.test.tsx b/client/src/pages/tripPlanner/ListsContainer.test.tsxindex f0d892c5e..7a139aaa1 100644--- a/client/src/pages/tripPlanner/ListsContainer.test.tsx+++ b/client/src/pages/tripPlanner/ListsContainer.test.tsx@@ -1,4 +1,4 @@-// FE-PAGE-PLANNER-LISTS-001 to FE-PAGE-PLANNER-LISTS-006+// FE-PAGE-PLANNER-LISTS-001 to FE-PAGE-PLANNER-LISTS-007import { render, screen, fireEvent, act } from '../../../tests/helpers/render'import { resetAllStores, seedStore } from '../../../tests/helpers/store'import { buildUser, buildTrip, buildPackingItem, buildTodoItem } from '../../../tests/helpers/factories'@@ -15,8 +15,13 @@ const stub = vi.hoisted(() => (name: string) => (props: Record<string, unknown>)})vi.mock('../../components/Packing/PackingListPanel', () => ({ default: stub('packingPanel') }))vi.mock('../../components/Todo/TodoListPanel', () => ({ default: stub('todoPanel') }))-vi.mock('../../components/Packing/ApplyTemplateButton', () => ({ default: stub('applyTemplate') }))-vi.mock('../../components/Packing/PackingExportMenu', () => ({ default: stub('exportMenu') }))+vi.mock('../../components/Packing/PackingListsMenu', () => ({ default: stub('listsMenu') }))++type MenuProps = {+ onImport: () => void; onSaveTemplate: () => void; onClearChecked: () => void; onOpenBags: () => void+ onSortChange: (s: 'manual' | 'name') => void; onHideDoneChange: (v: boolean) => void+}+const menu = () => captured.listsMenu as unknown as MenuProps/** The props a lazily loaded panel was last rendered with, once its chunk is in. */function loaded<T = Record<string, unknown>>(name: string): Promise<T> {@@ -42,6 +47,7 @@ function renderLists(packing = [buildPackingItem(), buildPackingItem()], todos =beforeEach(() => {resetAllStores()sessionStorage.clear()+ localStorage.removeItem('trek:packing-sort')for (const key of Object.keys(captured)) delete captured[key]})@@ -85,39 +91,52 @@ describe('ListsContainer', () => {expect(await loaded('todoPanel')).toMatchObject({ addItemSignal: 2 })})- it('FE-PAGE-PLANNER-LISTS-004: without the packing right there is no Add list, the other tools stay', async () => {+ it('FE-PAGE-PLANNER-LISTS-004: without the packing right there is no Add list, the menu still imports', async () => {seed({ packingPermission: 'trip_owner' })renderLists()expect(screen.queryByRole('button', { name: 'Add list' })).toBeNull()- expect(screen.getByRole('button', { name: 'Import' })).toBeInTheDocument()+ expect(captured.listsMenu).toMatchObject({ canEdit: false, tripId: TRIP_ID })await loaded('packingPanel')- fireEvent.click(screen.getByRole('button', { name: 'Import' }))+ act(() => { menu().onImport() })expect(captured.packingPanel).toMatchObject({ openImportSignal: 1, addCategorySignal: 0 })})it('FE-PAGE-PLANNER-LISTS-005: an admin saves a template only when the list has items', async () => {seed({ role: 'admin' })const { unmount } = renderLists([])- expect(screen.queryByRole('button', { name: 'Save as template' })).toBeNull()+ expect(captured.listsMenu).toMatchObject({ isAdmin: true, hasItems: false })unmount()renderLists()- fireEvent.click(screen.getByRole('button', { name: 'Save as template' }))+ expect(captured.listsMenu).toMatchObject({ hasItems: true })+ act(() => { menu().onSaveTemplate() })fireEvent.click(screen.getByRole('button', { name: 'Add list' }))expect(await loaded('packingPanel')).toMatchObject({ saveTemplateSignal: 1, addCategorySignal: 1 })})- it('FE-PAGE-PLANNER-LISTS-006: the panel switches the view the template and export tools work on', async () => {+ it('FE-PAGE-PLANNER-LISTS-006: the panel switches the view the menu works on, and the packed count follows it', async () => {seed()- renderLists()+ renderLists([buildPackingItem({ checked: 1 }), buildPackingItem({ is_private: 1, checked: 1 }), buildPackingItem({ is_private: 1 })])const panel = await loaded<{ onViewChange: (v: string) => void }>('packingPanel')- expect(captured.applyTemplate).toMatchObject({ tripId: TRIP_ID, visibility: 'common' })- expect(captured.exportMenu).toMatchObject({ tripId: TRIP_ID, view: 'common' })+ expect(captured.listsMenu).toMatchObject({ tripId: TRIP_ID, view: 'common', packedCount: 1 })act(() => { panel.onViewChange('personal') })- expect(captured.applyTemplate).toMatchObject({ visibility: 'personal' })- expect(captured.exportMenu).toMatchObject({ view: 'personal' })+ expect(captured.listsMenu).toMatchObject({ view: 'personal', packedCount: 1 })expect(captured.packingPanel).toMatchObject({ view: 'personal' })})++ it('FE-PAGE-PLANNER-LISTS-007: order, hiding packed items, the clean-up and the bags reach the panel from the menu', async () => {+ seed()+ renderLists()+ await loaded('packingPanel')+ expect(captured.packingPanel).toMatchObject({ sort: 'manual', hideDone: false, clearCheckedSignal: 0, openBagsSignal: 0 })++ act(() => { menu().onSortChange('name') })+ act(() => { menu().onHideDoneChange(true) })+ act(() => { menu().onClearChecked() })+ act(() => { menu().onOpenBags() })+ expect(captured.packingPanel).toMatchObject({ sort: 'name', hideDone: true, clearCheckedSignal: 1, openBagsSignal: 1 })+ expect(localStorage.getItem('trek:packing-sort')).toBe('name')+ })})diff --git a/client/src/pages/tripPlanner/ListsContainer.tsx b/client/src/pages/tripPlanner/ListsContainer.tsxindex 80cba31eb..a05c7562a 100644--- a/client/src/pages/tripPlanner/ListsContainer.tsx+++ b/client/src/pages/tripPlanner/ListsContainer.tsx@@ -1,7 +1,8 @@import React, { useState } from 'react'-import { PackageCheck, ListTodo, ListPlus, Download, Plus, FolderPlus } from 'lucide-react'-import ApplyTemplateButton from '../../components/Packing/ApplyTemplateButton'-import PackingExportMenu from '../../components/Packing/PackingExportMenu'+import { PackageCheck, ListTodo, ListPlus, Plus } from 'lucide-react'+import PackingListsMenu from '../../components/Packing/PackingListsMenu'+import { usePackingSortPreference } from '../../components/Packing/usePackingListPanel'+import { packingProgress, packingViewItems } from '../../components/Packing/packingListModel'import { useTranslation } from '../../i18n'import { useAuthStore } from '../../store/authStore'import { useTripStore } from '../../store/tripStore'@@ -18,6 +19,12 @@ export function ListsContainer({ tripId, packingItems, todoItems }: Readonly<{ tconst [saveTemplateSignal, setSaveTemplateSignal] = useState(0)const [addTodoSignal, setAddTodoSignal] = useState(0)const [packingView, setPackingView] = useState<'common' | 'personal'>('common')+ // The Lists menu sets these; the panel below reads them.+ const [packingSort, setPackingSort] = usePackingSortPreference()+ const [hideDone, setHideDone] = useState(false)+ const [clearCheckedSignal, setClearCheckedSignal] = useState(0)+ const [openBagsSignal, setOpenBagsSignal] = useState(0)+ const packedInView = packingProgress(packingViewItems(packingItems, packingView)).checkedconst { t } = useTranslation()const isAdmin = useAuthStore(s => s.user?.role === 'admin')const trip = useTripStore(s => s.trip)@@ -71,48 +78,29 @@ export function ListsContainer({ tripId, packingItems, todoItems }: Readonly<{ t</div>{subTab === 'packing' && (() => {- const sharedBtnClass = 'inline-flex items-center gap-1.5 px-2.5 sm:px-[14px] py-[7px] sm:py-[9px] hover:opacity-[0.88]'- // Export and Import carry only their icon, with the name as tooltip and label.- const iconBtnClass = 'inline-flex items-center justify-center px-2.5 py-[7px] sm:py-[9px] hover:opacity-[0.88] bg-accent text-accent-text'- const sharedBtnStyle: React.CSSProperties = {+ const btnClass = 'inline-flex items-center gap-1.5 px-2.5 sm:px-[14px] py-[7px] sm:py-[9px] hover:opacity-[0.88] bg-accent text-accent-text'+ const btnStyle: React.CSSProperties = {appearance: 'none', border: 'none', cursor: 'pointer', fontFamily: 'inherit',borderRadius: 10, fontSize: 'calc(13px * var(--fs-scale-body, 1))', fontWeight: 500,}+ // One button for what is done often, everything else in the menu beside it.return (- <div style={{ display: 'flex', gap: 6, flexShrink: 0, marginInlineStart: 'auto', flexWrap: 'wrap' }}>+ <div style={{ display: 'flex', gap: 6, flexShrink: 0, marginInlineStart: 'auto' }}>{canEditPacking && (- <button type="button" onClick={() => setAddCategorySignal(s => s + 1)}- className={`${sharedBtnClass} bg-accent text-accent-text`}- style={sharedBtnStyle}- >+ <button type="button" onClick={() => setAddCategorySignal(s => s + 1)} className={btnClass} style={btnStyle}><ListPlus size={14} strokeWidth={2.5} /><span className="hidden sm:inline">{t('packing.addCategory')}</span></button>)}- <ApplyTemplateButton- tripId={tripId}- visibility={packingView}- className={`${sharedBtnClass} bg-accent text-accent-text`}- style={sharedBtnStyle}+ <PackingListsMenu+ tripId={tripId} view={packingView} canEdit={canEditPacking} isAdmin={isAdmin}+ hasItems={packingItems.length > 0} packedCount={packedInView}+ sort={packingSort} onSortChange={setPackingSort} hideDone={hideDone} onHideDoneChange={setHideDone}+ onImport={() => setImportPackingSignal(s => s + 1)} onSaveTemplate={() => setSaveTemplateSignal(s => s + 1)}+ onClearChecked={() => setClearCheckedSignal(s => s + 1)} onOpenBags={() => setOpenBagsSignal(s => s + 1)}+ buttonClassName="inline-flex items-center justify-center px-2.5 py-[7px] sm:py-[9px] hover:opacity-[0.88] bg-accent text-accent-text"+ buttonStyle={btnStyle}/>- {isAdmin && packingItems.length > 0 && (- <button type="button" onClick={() => setSaveTemplateSignal(s => s + 1)}- className={`${sharedBtnClass} bg-accent text-accent-text`}- style={sharedBtnStyle}- >- <FolderPlus size={14} strokeWidth={2.5} />- <span className="hidden sm:inline">{t('packing.saveAsTemplate')}</span>- </button>- )}- <PackingExportMenu tripId={tripId} view={packingView} className={iconBtnClass} style={sharedBtnStyle} />- <button type="button" onClick={() => setImportPackingSignal(s => s + 1)}- className={iconBtnClass}- style={sharedBtnStyle}- aria-label={t('packing.import')}- title={t('packing.import')}- >- <Download size={14} strokeWidth={2.5} />- </button></div>)})()}@@ -136,7 +124,8 @@ export function ListsContainer({ tripId, packingItems, todoItems }: Readonly<{ t<div style={fill ? { padding: '16px 28px 16px', flex: 1, minHeight: 0 } : { padding: '16px 28px 0' }} className="max-md:!px-4">{subTab === 'packing' && (<LazyPanel id="packing">- <PackingListPanel tripId={tripId} items={packingItems} openImportSignal={importPackingSignal} addCategorySignal={addCategorySignal} saveTemplateSignal={saveTemplateSignal} inlineHeader={false} view={packingView} onViewChange={setPackingView} />+ <PackingListPanel tripId={tripId} items={packingItems} openImportSignal={importPackingSignal} addCategorySignal={addCategorySignal} saveTemplateSignal={saveTemplateSignal} inlineHeader={false} view={packingView} onViewChange={setPackingView}+ sort={packingSort} hideDone={hideDone} clearCheckedSignal={clearCheckedSignal} openBagsSignal={openBagsSignal} /></LazyPanel>)}{subTab === 'todo' && (diff --git a/client/tests/unit/mobile/trip/MPackItemSheet.test.tsx b/client/tests/unit/mobile/trip/MPackItemSheet.test.tsxindex b4874bd0c..7a5c31346 100644--- a/client/tests/unit/mobile/trip/MPackItemSheet.test.tsx+++ b/client/tests/unit/mobile/trip/MPackItemSheet.test.tsx@@ -1,9 +1,9 @@import { describe, expect, it, vi } from 'vitest'import type { ComponentProps } from 'react'import MPackItemSheet from '../../../../src/mobile/screens/trip/tabs/MPackItemSheet'-import type { PackingItem, TripMember } from '../../../../src/types'+import type { PackingBag, PackingItem, TripMember } from '../../../../src/types'import { buildPlanner } from '../../../helpers/mobileTrip'-import { fireEvent, render, screen, waitFor } from '../../../helpers/render'+import { fireEvent, render, screen, waitFor, within } from '../../../helpers/render'// FE-MOB-PACKITEM-001 to FE-MOB-PACKITEM-024@@ -11,6 +11,10 @@ const ME = 7const ANNA = { id: 11, username: 'anna', avatar: 'anna.png', avatar_url: null } as unknown as TripMemberconst BEN = { id: 12, username: 'ben', avatar: null, avatar_url: 'https://cdn.example/ben.png' } as unknown as TripMemberconst OWNER = { id: 21, username: 'owner', avatar: null, avatar_url: null } as unknown as TripMember+const BAGS = [+ { id: 71, name: 'Backpack', color: '#6366f1' },+ { id: 72, name: 'Duffel', color: '#ec4899' },+] as unknown as PackingBag[]function packItem(overrides: Partial<PackingItem> = {}): PackingItem {return {@@ -29,6 +33,10 @@ function setup(overrides: Partial<ComponentProps<typeof MPackItemSheet>> = {}, ibagTrackingEnabled: true,tripMembers: [ANNA, BEN],currentUserId: ME,+ categories: ['Clothing', 'Documents'],+ bags: BAGS,+ onCreateBag: vi.fn(async () => undefined),+ onDelete: vi.fn(),onClose: vi.fn(),...overrides,}@@ -36,215 +44,242 @@ function setup(overrides: Partial<ComponentProps<typeof MPackItemSheet>> = {}, ireturn { ...props, planner, view }}+const sheet = () => within(screen.getByRole('dialog', { name: 'packing.editItem' }))+describe('MPackItemSheet', () => {it('FE-MOB-PACKITEM-001: renders nothing without a resolvable item', () => {setup({ itemId: null })expect(screen.queryByRole('dialog')).toBeNull()- })-- it('FE-MOB-PACKITEM-002: renders nothing when the id is unknown', () => {setup({ itemId: 99 })expect(screen.queryByRole('dialog')).toBeNull()})- it('FE-MOB-PACKITEM-003: prefills name, quantity and weight', () => {+ it('FE-MOB-PACKITEM-002: shows the name, the list, the amount and the weight, with no save button', () => {setup()- expect(screen.getByRole('dialog')).toHaveAttribute('aria-label', 'packing.editItem')- expect(screen.getByText('Clothing')).toBeInTheDocument()- expect(screen.getByDisplayValue('Rain jacket')).toBeInTheDocument()- expect(screen.getByDisplayValue('2')).toBeInTheDocument()- expect(screen.getByDisplayValue('450')).toBeInTheDocument()+ expect(sheet().getByDisplayValue('Rain jacket')).toBeInTheDocument()+ expect(sheet().getAllByText('Clothing').length).toBeGreaterThan(0)+ expect(within(sheet().getByRole('group', { name: 'packing.quantity' })).getByText('2')).toBeInTheDocument()+ expect(sheet().getByDisplayValue('450')).toBeInTheDocument()+ expect(sheet().queryByRole('button', { name: 'common.save' })).toBeNull()})- it('FE-MOB-PACKITEM-004: falls back to the default category in the subtitle', () => {+ it('FE-MOB-PACKITEM-003: falls back to the default list', () => {setup({}, [packItem({ category: null })])- expect(screen.getByText('packing.defaultCategory')).toBeInTheDocument()+ expect(sheet().getAllByText('packing.defaultCategory').length).toBeGreaterThan(0)})- it('FE-MOB-PACKITEM-005: hides the weight field when bag tracking is off', () => {- setup({ bagTrackingEnabled: false })- expect(screen.queryByText('packing.itemWeight')).toBeNull()- expect(screen.queryByDisplayValue('450')).toBeNull()+ it('FE-MOB-PACKITEM-004: a renamed item saves when the field lets go, a blank or unchanged name does not', async () => {+ const { planner } = setup()+ const name = sheet().getByRole('textbox', { name: 'packing.itemName' })+ fireEvent.focus(name)+ fireEvent.blur(name)+ fireEvent.focus(name)+ fireEvent.change(name, { target: { value: ' ' } })+ fireEvent.blur(name)+ expect(planner.tripActions.updatePackingItem).not.toHaveBeenCalled()++ fireEvent.focus(name)+ fireEvent.change(name, { target: { value: ' Poncho ' } })+ fireEvent.keyDown(name, { key: 'Enter' })+ fireEvent.blur(name)+ await waitFor(() => expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, { name: 'Poncho' }))})- it('FE-MOB-PACKITEM-006: starts a placeholder row with an empty name and no sharing block', () => {- setup({}, [packItem({ name: '...', quantity: 1, weight_grams: null })])- const name = screen.getByPlaceholderText('packing.addItemPlaceholder')- expect(name).toHaveValue('')- expect(screen.getByRole('button', { name: 'common.save' })).toBeDisabled()- expect(screen.queryByText('packing.share')).toBeNull()+ it('FE-MOB-PACKITEM-005: a failing save is reported', async () => {+ const { planner } = setup()+ ;(planner.tripActions.updatePackingItem as unknown as ReturnType<typeof vi.fn>).mockRejectedValueOnce(new Error('nope'))+ fireEvent.click(sheet().getByRole('button', { name: 'packing.quantityMore' }))+ await waitFor(() => expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.saveError'))})- it('FE-MOB-PACKITEM-007: strips non-digits from quantity and weight', () => {- setup()-- fireEvent.change(screen.getByDisplayValue('2'), { target: { value: '1a2' } })- fireEvent.change(screen.getByDisplayValue('450'), { target: { value: '4x5' } })-- expect(screen.getByDisplayValue('12')).toBeInTheDocument()- expect(screen.getByDisplayValue('45')).toBeInTheDocument()+ it('FE-MOB-PACKITEM-006: the amount steps within one and 999', () => {+ const { planner } = setup({}, [packItem({ quantity: 1 })])+ expect(sheet().getByRole('button', { name: 'packing.quantityLess' })).toBeDisabled()+ fireEvent.click(sheet().getByRole('button', { name: 'packing.quantityMore' }))+ expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, { quantity: 2 })})- it('FE-MOB-PACKITEM-008: saves name, clamped quantity and weight', async () => {- const { planner, onClose } = setup()-- fireEvent.change(screen.getByDisplayValue('Rain jacket'), { target: { value: ' Poncho ' } })- fireEvent.change(screen.getByDisplayValue('2'), { target: { value: '1500' } })- fireEvent.click(screen.getByRole('button', { name: 'common.save' }))-- await waitFor(() => expect(onClose).toHaveBeenCalled())- expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, {- name: 'Poncho', quantity: 999, weight_grams: 450,- })+ it('FE-MOB-PACKITEM-007: several pieces bring the packed counter, one piece does not', () => {+ const { planner, view } = setup({}, [packItem({ quantity: 3, packed_quantity: 1 } as Partial<PackingItem>)])+ const packed = within(sheet().getByRole('group', { name: 'packing.printPacked' }))+ expect(packed.getByText('1/3')).toBeInTheDocument()+ fireEvent.click(packed.getByRole('button', { name: 'packing.packedMore' }))+ expect(planner.tripActions.setPackedCount).toHaveBeenCalledWith(3, 1, 2)+ fireEvent.click(packed.getByRole('button', { name: 'packing.packedLess' }))+ expect(planner.tripActions.setPackedCount).toHaveBeenCalledWith(3, 1, 0)++ view.unmount()+ setup({}, [packItem({ quantity: 1 })])+ expect(screen.queryByRole('group', { name: 'packing.printPacked' })).toBeNull()})- it('FE-MOB-PACKITEM-009: treats an empty quantity as 1 and an empty weight as null', async () => {+ it('FE-MOB-PACKITEM-008: the weight takes digits only and saves on leaving, empty is no weight', async () => {const { planner } = setup()-- fireEvent.change(screen.getByDisplayValue('2'), { target: { value: '' } })- fireEvent.change(screen.getByDisplayValue('450'), { target: { value: '' } })- fireEvent.click(screen.getByRole('button', { name: 'common.save' }))-- await waitFor(() => expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, {- name: 'Rain jacket', quantity: 1, weight_grams: null,- }))+ const weight = sheet().getByRole('textbox', { name: 'packing.totalWeight' })+ fireEvent.focus(weight)+ fireEvent.change(weight, { target: { value: '4x5' } })+ expect(weight).toHaveValue('45')+ fireEvent.blur(weight)+ await waitFor(() => expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, { weight_grams: 45 }))++ fireEvent.focus(weight)+ fireEvent.change(weight, { target: { value: '' } })+ fireEvent.keyDown(weight, { key: 'Enter' })+ fireEvent.blur(weight)+ await waitFor(() => expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, { weight_grams: null }))})- it('FE-MOB-PACKITEM-010: omits weight entirely without bag tracking', async () => {- const { planner } = setup({ bagTrackingEnabled: false })-- fireEvent.click(screen.getByRole('button', { name: 'common.save' }))-- await waitFor(() => expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, {- name: 'Rain jacket', quantity: 2,- }))+ it('FE-MOB-PACKITEM-009: without bag tracking there is no weight and no bag', () => {+ setup({ bagTrackingEnabled: false })+ expect(sheet().queryByRole('textbox', { name: 'packing.totalWeight' })).toBeNull()+ expect(sheet().queryByRole('button', { name: /packing.noBag/ })).toBeNull()})- it('FE-MOB-PACKITEM-011: reports a failed save and keeps the sheet open', async () => {- const { planner, onClose } = setup()- const update = planner.tripActions.updatePackingItem as unknown as ReturnType<typeof vi.fn>- update.mockRejectedValueOnce(new Error('nope'))-- fireEvent.click(screen.getByRole('button', { name: 'common.save' }))-- await waitFor(() => expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.saveError'))- expect(onClose).not.toHaveBeenCalled()+ it('FE-MOB-PACKITEM-010: the list choice moves the item, the current list changes nothing', () => {+ const { planner } = setup()+ fireEvent.click(sheet().getByRole('button', { name: /Clothing/, expanded: false }))+ fireEvent.click(sheet().getAllByRole('button', { name: /Clothing/ })[1])+ expect(planner.tripActions.updatePackingItem).not.toHaveBeenCalled()+ fireEvent.click(sheet().getByRole('button', { name: /Clothing/, expanded: false }))+ fireEvent.click(sheet().getByRole('button', { name: /Documents/ }))+ expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, { category: 'Documents' })})- it('FE-MOB-PACKITEM-012: disables save for a blank name', () => {- setup()-- fireEvent.change(screen.getByDisplayValue('Rain jacket'), { target: { value: ' ' } })+ it('FE-MOB-PACKITEM-011: the bag choice assigns, clears and creates bags', async () => {+ const created = { id: 73, name: 'Tote', color: '#10b981' } as unknown as PackingBag+ const onCreateBag = vi.fn(async () => created)+ const { planner } = setup({ onCreateBag }, [packItem({ bag_id: 71 } as Partial<PackingItem>)])++ fireEvent.click(sheet().getByRole('button', { name: /Backpack/ }))+ fireEvent.click(sheet().getByRole('button', { name: /Duffel/ }))+ expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, { bag_id: 72 })++ fireEvent.click(sheet().getByRole('button', { name: /Backpack/ }))+ fireEvent.click(sheet().getByRole('button', { name: /packing.noBag/ }))+ expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, { bag_id: null })++ fireEvent.click(sheet().getByRole('button', { name: /Backpack/ }))+ const field = sheet().getByRole('textbox', { name: 'packing.bagName' })+ expect(sheet().getByRole('button', { name: 'packing.addBag' })).toBeDisabled()+ fireEvent.keyDown(field, { key: 'Enter' })+ expect(onCreateBag).not.toHaveBeenCalled()+ fireEvent.change(field, { target: { value: 'Tote' } })+ fireEvent.click(sheet().getByRole('button', { name: 'packing.addBag' }))+ await waitFor(() => expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 1, { bag_id: 73 }))+ })- expect(screen.getByRole('button', { name: 'common.save' })).toBeDisabled()+ it('FE-MOB-PACKITEM-012: a bag that could not be created assigns nothing', async () => {+ const { planner } = setup()+ fireEvent.click(sheet().getByRole('button', { name: /packing.noBag/ }))+ const field = sheet().getByRole('textbox', { name: 'packing.bagName' })+ fireEvent.change(field, { target: { value: 'Tote' } })+ fireEvent.keyDown(field, { key: 'Enter' })+ await waitFor(() => expect(sheet().queryByRole('textbox', { name: 'packing.bagName' })).toBeNull())+ expect(planner.tripActions.updatePackingItem).not.toHaveBeenCalled()})- it('FE-MOB-PACKITEM-013: keeps rendering the last item after it disappears from the store', () => {- const { view, planner, ...props } = setup()- const drained = buildPlanner({ tripId: 3, packingItems: [], t: planner.t })+ it('FE-MOB-PACKITEM-013: the bringer choice ticks anyone on or off (#3098)', () => {+ const item = packItem({ owner_id: 21, owner_username: 'owner', contributors: [{ user_id: 12, username: 'ben', status: 'accepted' }] })+ const { planner } = setup({ tripMembers: [ANNA, BEN, OWNER] }, [item])- view.rerender(<MPackItemSheet {...props} planner={drained} />)+ fireEvent.click(sheet().getByRole('button', { name: /owner, ben/ }))+ fireEvent.click(sheet().getByRole('button', { name: 'anna' }))+ expect(planner.tripActions.addPackingContributor).toHaveBeenCalledWith(3, 1, 11)+ fireEvent.click(sheet().getByRole('button', { name: 'ben' }))+ expect(planner.tripActions.removePackingContributor).toHaveBeenCalledWith(3, 1, 12)+ })- expect(screen.getByDisplayValue('Rain jacket')).toBeInTheDocument()+ it('FE-MOB-PACKITEM-014: nobody bringing it reads as such', () => {+ setup({}, [packItem({ owner_id: null })])+ expect(sheet().getByRole('button', { name: /packing.bringersNobody/ })).toBeInTheDocument()})- it('FE-MOB-PACKITEM-014: owner switches the item to personal and back to common', () => {+ it('FE-MOB-PACKITEM-015: the owner switches who sees the item', () => {const { planner } = setup()-- fireEvent.click(screen.getByRole('button', { name: 'packing.tierPersonal' }))- fireEvent.click(screen.getByRole('button', { name: 'packing.viewCommon' }))-- expect(planner.tripActions.setPackingItemSharing).toHaveBeenNthCalledWith(1, 3, 1, 'personal', [])- expect(planner.tripActions.setPackingItemSharing).toHaveBeenNthCalledWith(2, 3, 1, 'common', [])+ const group = within(sheet().getByRole('radiogroup', { name: 'packing.detail.visibility' }))+ expect(group.getByRole('radio', { name: 'packing.filterAll' })).toHaveAttribute('aria-checked', 'true')+ fireEvent.click(group.getByRole('radio', { name: 'packing.visibility.me' }))+ expect(planner.tripActions.setPackingItemSharing).toHaveBeenCalledWith(3, 1, 'personal', [])+ fireEvent.click(group.getByRole('radio', { name: 'packing.visibility.some' }))+ fireEvent.click(sheet().getByRole('button', { name: 'ben' }))+ expect(planner.tripActions.setPackingItemSharing).toHaveBeenCalledWith(3, 1, 'shared', [12])+ fireEvent.click(group.getByRole('radio', { name: 'packing.filterAll' }))+ expect(planner.tripActions.setPackingItemSharing).toHaveBeenLastCalledWith(3, 1, 'common', [])})- it('FE-MOB-PACKITEM-015: owner adds and removes a share recipient', () => {+ it('FE-MOB-PACKITEM-016: the owner adds and removes a person on a shared item', () => {const item = packItem({ is_private: 1, recipients: [{ user_id: 11, username: 'anna' }] })const { planner } = setup({}, [item])-- fireEvent.click(screen.getByRole('button', { name: 'ben' }))+ fireEvent.click(sheet().getByRole('button', { name: 'ben' }))expect(planner.tripActions.setPackingItemSharing).toHaveBeenCalledWith(3, 1, 'shared', [11, 12])-- fireEvent.click(screen.getByRole('button', { name: 'anna' }))- expect(planner.tripActions.setPackingItemSharing).toHaveBeenCalledWith(3, 1, 'shared', [])+ fireEvent.click(sheet().getByRole('button', { name: 'anna' }))+ expect(planner.tripActions.setPackingItemSharing).toHaveBeenCalledWith(3, 1, 'personal', [])})- it('FE-MOB-PACKITEM-016: renders member avatars and initials in the share picker', () => {- const { view } = setup()+ it('FE-MOB-PACKITEM-017: member pictures and initials show in the pickers', () => {+ const { view } = setup({}, [packItem({ is_private: 1, recipients: [{ user_id: 11, username: 'anna' }] })])const srcs = Array.from(view.baseElement.querySelectorAll('img')).map(i => i.getAttribute('src'))expect(srcs).toContain('/uploads/avatars/anna.png')expect(srcs).toContain('https://cdn.example/ben.png')})- it('FE-MOB-PACKITEM-017: tells the owner when there is nobody to share with', () => {+ it('FE-MOB-PACKITEM-018: alone on the trip there is nobody to share with', () => {setup({ tripMembers: [] })- expect(screen.getByText('packing.noOneToShare')).toBeInTheDocument()+ fireEvent.click(sheet().getByRole('radio', { name: 'packing.visibility.some' }))+ expect(sheet().getByText('packing.noOneToShare')).toBeInTheDocument()})- it('FE-MOB-PACKITEM-018: a non-owner can pledge to bring a common item too', () => {- const item = packItem({ owner_id: 21, owner_username: 'owner' })- const { planner } = setup({ tripMembers: [ANNA, BEN, OWNER] }, [item])-- expect(screen.getByText('packing.broughtBy:owner')).toBeInTheDocument()- fireEvent.click(screen.getByRole('button', { name: 'packing.alsoBring' }))-- expect(planner.tripActions.addPackingContributor).toHaveBeenCalledWith(3, 1)- })-- it('FE-MOB-PACKITEM-019: a pledged contributor can withdraw and can clone the item', () => {- const item = packItem({- owner_id: 21, owner_username: 'owner',- contributors: [{ user_id: ME, username: 'me', status: 'pledged' }],- })- const { planner, onClose } = setup({}, [item])-- fireEvent.click(screen.getByRole('button', { name: 'packing.alsoBringingStop' }))- expect(planner.tripActions.removePackingContributor).toHaveBeenCalledWith(3, 1, ME)-- fireEvent.click(screen.getByRole('button', { name: 'packing.cloneToMine' }))+ it('FE-MOB-PACKITEM-019: someone else\'s common item can be copied to my list', () => {+ const { planner, onClose } = setup({}, [packItem({ owner_id: 21, owner_username: 'owner' })])+ expect(sheet().queryByRole('radiogroup')).toBeNull()+ fireEvent.click(sheet().getByRole('button', { name: 'packing.cloneToMine' }))expect(planner.tripActions.clonePackingItem).toHaveBeenCalledWith(3, 1)expect(onClose).toHaveBeenCalled()})- it('FE-MOB-PACKITEM-020: a recipient sees a read-only note instead of the tier pills', () => {- const item = packItem({ is_private: 1, owner_id: 21, owner_username: 'owner' })- setup({}, [item])-- expect(screen.getByText('packing.takenCareOf:owner')).toBeInTheDocument()- expect(screen.queryByRole('button', { name: 'packing.tierPersonal' })).toBeNull()+ it('FE-MOB-PACKITEM-020: a private item shared with me says whose it is, or the generic hint', () => {+ const { view } = setup({}, [packItem({ is_private: 1, owner_id: 21, owner_username: 'owner' })])+ expect(sheet().getByText('packing.takenCareOf:owner')).toBeInTheDocument()+ expect(sheet().queryByRole('radiogroup')).toBeNull()+ view.unmount()+ setup({}, [packItem({ is_private: 1, owner_id: 21, owner_username: null })])+ expect(sheet().getByText('packing.tierPersonalHint')).toBeInTheDocument()})- it('FE-MOB-PACKITEM-021: falls back to the generic hint when the owner is unknown', () => {- const item = packItem({ is_private: 1, owner_id: 21, owner_username: null })- setup({}, [item])-- expect(screen.getByText('packing.tierPersonalHint')).toBeInTheDocument()+ it('FE-MOB-PACKITEM-021: a placeholder starts with an empty name and no people', () => {+ setup({}, [packItem({ name: '...', quantity: 1, weight_grams: null })])+ expect(sheet().getByPlaceholderText('packing.addItemPlaceholder')).toHaveValue('')+ expect(sheet().queryByRole('radiogroup')).toBeNull()})- it('FE-MOB-PACKITEM-022: an unowned item is treated as the viewer\'s own', () => {- const item = packItem({ owner_id: null })- setup({}, [item])-- expect(screen.getByRole('button', { name: 'packing.tierPersonal' })).toBeInTheDocument()+ it('FE-MOB-PACKITEM-022: a reader sees the item without anything to change', () => {+ const planner = buildPlanner({ tripId: 3, packingItems: [packItem()], can: vi.fn(() => false) })+ setup({ planner })+ expect(sheet().getByDisplayValue('Rain jacket')).toHaveAttribute('readonly')+ expect(sheet().queryByRole('group', { name: 'packing.quantity' })).toBeNull()+ expect(sheet().queryByRole('button', { name: 'common.delete' })).toBeNull()})- it('FE-MOB-PACKITEM-023: closes from the header and the cancel button', () => {- const { onClose } = setup()-- fireEvent.click(screen.getByRole('button', { name: 'common.close' }))- fireEvent.click(screen.getByRole('button', { name: 'common.cancel' }))-+ it('FE-MOB-PACKITEM-023: delete closes the sheet and hands over, close closes', () => {+ const { onClose, onDelete } = setup()+ fireEvent.click(sheet().getByRole('button', { name: 'common.delete' }))+ expect(onClose).toHaveBeenCalledTimes(1)+ expect(onDelete).toHaveBeenCalledWith(expect.objectContaining({ id: 1 }))+ fireEvent.click(sheet().getByRole('button', { name: 'common.close' }))expect(onClose).toHaveBeenCalledTimes(2)})- it('FE-MOB-PACKITEM-024: a store refresh of the open item keeps the typed draft', () => {+ it('FE-MOB-PACKITEM-024: keeps showing the last item after it left the store, and a typed name survives a refresh', () => {const { view, planner, ...props } = setup()- fireEvent.change(screen.getByDisplayValue('Rain jacket'), { target: { value: 'Rain shell' } })- // packingSlice replaces the item object on every update, so a WebSocket- // refresh of the same id must not reseed the fields.+ const name = sheet().getByRole('textbox', { name: 'packing.itemName' })+ fireEvent.focus(name)+ fireEvent.change(name, { target: { value: 'Rain shell' } })const refreshed = buildPlanner({ tripId: 3, packingItems: [packItem()], t: planner.t })view.rerender(<MPackItemSheet {...props} planner={refreshed} />)+ expect(screen.getByDisplayValue('Rain shell')).toBeInTheDocument()+ const drained = buildPlanner({ tripId: 3, packingItems: [], t: planner.t })+ view.rerender(<MPackItemSheet {...props} planner={drained} />)expect(screen.getByDisplayValue('Rain shell')).toBeInTheDocument()})})diff --git a/client/tests/unit/mobile/trip/MPackingListTab.test.tsx b/client/tests/unit/mobile/trip/MPackingListTab.test.tsxindex 0c79f78d6..76adec68e 100644--- a/client/tests/unit/mobile/trip/MPackingListTab.test.tsx+++ b/client/tests/unit/mobile/trip/MPackingListTab.test.tsx@@ -13,7 +13,7 @@ import { resetAllStores, seedStore } from '../../../helpers/store'import { act, fireEvent, render, screen, waitFor, within } from '../../../helpers/render'import * as fileDownload from '../../../../src/utils/fileDownload'-// FE-MOB-PACKTAB-001 to FE-MOB-PACKTAB-046 (plus 060-071)+// FE-MOB-PACKTAB-001 to FE-MOB-PACKTAB-066const ME = 7const ANNA = { id: 11, username: 'anna', avatar: null, avatar_url: 'https://cdn.example/anna.png' } as unknown as TripMember@@ -60,9 +60,9 @@ async function setup(opts: SetupOptions = {}) {return { planner, view }}-/** The category card that owns the given title. */+/** The category card that owns the given title (the card comes before any sheet naming it). */function card(category: string): HTMLElement {- return screen.getByText(category).closest('div.rounded-2xl') as HTMLElement+ return screen.getAllByText(category)[0].closest('div.rounded-2xl') as HTMLElement}/** The row of an item, found via its checkbox (aria-label = item name). */@@ -74,14 +74,14 @@ function openActions() {fireEvent.click(screen.getByRole('button', { name: 'packing.actions' }))}-function enterEditMode() {- fireEvent.click(screen.getByRole('button', { name: /common.edit/ }))-}-function openCategoryMenu(category: string) {fireEvent.click(within(card(category)).getByRole('button', { name: 'packing.categoryOptions' }))}+function openItem(name: string) {+ fireEvent.click(screen.getByRole('button', { name: `${name}, packing.editItem` }))+}+function asMock(fn: unknown): ReturnType<typeof vi.fn> {return fn as ReturnType<typeof vi.fn>}@@ -99,46 +99,44 @@ describe('MPackingListTab', () => {vi.restoreAllMocks()})- // ── Progress card + chrome ────────────────────────────────────────────+ // ── Progress card ─────────────────────────────────────────────────────- it('FE-MOB-PACKTAB-001: shows checked/total and the percentage of the common list', async () => {+ it('FE-MOB-PACKTAB-001: the card says how much of the common list is packed, with one button for the rest', async () => {await setup()- expect(screen.getByText('2/4')).toBeInTheDocument()- expect(screen.getByText('50%')).toBeInTheDocument()+ expect(screen.getByText('packing.packedCount:2,4')).toBeInTheDocument()+ expect(screen.queryByRole('button', { name: 'common.edit' })).toBeNull()+ expect(screen.getByRole('button', { name: 'packing.actions' })).toHaveAttribute('aria-haspopup', 'dialog')+ })++ it('FE-MOB-PACKTAB-002: all packed reads as done', async () => {+ await setup({ items: [packItem({ id: 1, checked: 1 })] })+ expect(screen.getByText('packing.allPacked')).toBeInTheDocument()})- it('FE-MOB-PACKTAB-002: hides the bags button while bag tracking is off', async () => {+ it('FE-MOB-PACKTAB-003: without bag tracking the menu has no bags and nothing is loaded', async () => {await setup()+ openActions()expect(screen.queryByRole('button', { name: 'packing.bags' })).toBeNull()expect(packingApi.listBags).not.toHaveBeenCalled()})- it('FE-MOB-PACKTAB-003: loads the bags and opens the bags sheet', async () => {+ it('FE-MOB-PACKTAB-004: with bag tracking the menu opens the bags sheet', async () => {await setup({ bagTracking: true })expect(packingApi.listBags).toHaveBeenCalledWith(3)+ openActions()+ fireEvent.click(screen.getByRole('button', { name: 'packing.bags' }))- fireEvent.click(screen.getAllByRole('button', { name: 'packing.bags' })[0])-- const dialog = screen.getByRole('dialog')- expect(dialog).toHaveAttribute('aria-label', 'packing.bags')+ const dialog = screen.getByRole('dialog', { name: 'packing.bags' })expect(within(dialog).getByText('Backpack')).toBeInTheDocument()})- it('FE-MOB-PACKTAB-004: toggles edit mode', async () => {- await setup()- const toggle = screen.getByRole('button', { name: 'common.edit' })- expect(toggle).toHaveAttribute('aria-pressed', 'false')-- fireEvent.click(toggle)-- expect(screen.getByRole('button', { name: 'packing.editDone' })).toHaveAttribute('aria-pressed', 'true')- })-- it('FE-MOB-PACKTAB-005: read-only members get neither edit nor the action menu', async () => {+ it('FE-MOB-PACKTAB-005: read-only members get no editing in the menu, no add row, no list menu actions', async () => {await setup({ planner: { can: vi.fn(() => false) } as Partial<TripPlanner> })- expect(screen.queryByRole('button', { name: 'common.edit' })).toBeNull()- expect(screen.queryByRole('button', { name: 'packing.actions' })).toBeNull()+ openActions()expect(screen.queryByRole('button', { name: 'packing.addCategory' })).toBeNull()+ expect(screen.queryByRole('button', { name: 'packing.import' })).toBeNull()+ expect(screen.queryByRole('button', { name: 'packing.addItem' })).toBeNull()+ expect(screen.getByRole('button', { name: 'packing.hideDone' })).toBeInTheDocument()})it('FE-MOB-PACKTAB-006: survives failing mount requests', async () => {@@ -149,17 +147,19 @@ describe('MPackingListTab', () => {await setup({ bagTracking: true })openActions()- expect(screen.getByText('2/4')).toBeInTheDocument()+ expect(screen.getByText('packing.packedCount:2,4')).toBeInTheDocument()expect(screen.getByRole('button', { name: 'packing.import' })).toBeInTheDocument()expect(screen.queryByRole('button', { name: 'packing.applyTemplate' })).toBeNull()})- // ── Action menu ───────────────────────────────────────────────────────+ // ── Action sheet ──────────────────────────────────────────────────────- it('FE-MOB-PACKTAB-007: the action menu offers clear/apply/import to a non-admin', async () => {+ it('FE-MOB-PACKTAB-007: the action sheet offers add list, apply, import and clear to a non-admin', async () => {await setup()openActions()+ expect(screen.getByRole('dialog', { name: 'packing.actions' })).toBeInTheDocument()+ expect(screen.getByRole('button', { name: 'packing.addCategory' })).toBeInTheDocument()expect(screen.getByRole('button', { name: 'packing.clearChecked:2' })).toBeInTheDocument()expect(screen.getByRole('button', { name: 'packing.applyTemplate' })).toBeInTheDocument()expect(screen.getByRole('button', { name: 'packing.import' })).toBeInTheDocument()@@ -187,7 +187,7 @@ describe('MPackingListTab', () => {openActions()fireEvent.click(screen.getByRole('button', { name: 'packing.clearChecked:2' }))- const dialog = screen.getByRole('dialog')+ const dialog = await screen.findByRole('dialog', { name: 'packing.clearChecked:2' })expect(within(dialog).getByText('packing.confirm.clearChecked:2')).toBeInTheDocument()fireEvent.click(within(dialog).getByRole('button', { name: 'common.delete' }))@@ -196,35 +196,27 @@ describe('MPackingListTab', () => {expect(planner.tripActions.deletePackingItem).toHaveBeenCalledWith(3, 4)})- it('FE-MOB-PACKTAB-011: a failed clear surfaces the delete error', async () => {+ it('FE-MOB-PACKTAB-011: a failed clear surfaces the delete error, a cancelled one deletes nothing', async () => {const { planner } = await setup()- asMock(planner.tripActions.deletePackingItem).mockRejectedValueOnce(new Error('x'))openActions()-fireEvent.click(screen.getByRole('button', { name: 'packing.clearChecked:2' }))- fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', { name: 'common.delete' }))-- await waitFor(() => expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.deleteError'))- })+ fireEvent.click(within(await screen.findByRole('dialog', { name: 'packing.clearChecked:2' })).getByRole('button', { name: 'common.cancel' }))+ expect(planner.tripActions.deletePackingItem).not.toHaveBeenCalled()- it('FE-MOB-PACKTAB-012: cancelling the clear dialog deletes nothing', async () => {- const { planner } = await setup()+ asMock(planner.tripActions.deletePackingItem).mockRejectedValueOnce(new Error('x'))openActions()-fireEvent.click(screen.getByRole('button', { name: 'packing.clearChecked:2' }))- fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', { name: 'common.cancel' }))-- expect(planner.tripActions.deletePackingItem).not.toHaveBeenCalled()+ fireEvent.click(within(await screen.findByRole('dialog', { name: 'packing.clearChecked:2' })).getByRole('button', { name: 'common.delete' }))+ await waitFor(() => expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.deleteError'))})- it('FE-MOB-PACKTAB-013: applies a template and appends its items to the store', async () => {+ it('FE-MOB-PACKTAB-012: applies a template and appends its items to the store', async () => {const applied = [packItem({ id: 30, name: 'Towel', category: 'Beach' })]vi.spyOn(packingApi, 'applyTemplate').mockResolvedValue({ items: applied, count: 1 })const { planner } = await setup()openActions()fireEvent.click(screen.getByRole('button', { name: 'packing.applyTemplate' }))- expect(screen.getByText('12 admin.packingTemplates.items:12')).toBeInTheDocument()await act(async () => { fireEvent.click(screen.getByRole('button', { name: /Beach trip/ })) })// The visibility follows the Shared|My-list toggle so the items land where@@ -232,10 +224,9 @@ describe('MPackingListTab', () => {expect(packingApi.applyTemplate).toHaveBeenCalledWith(3, 91, 'common')expect(planner.toast.success).toHaveBeenCalledWith('packing.templateApplied:1')expect(useTripStore.getState().packingItems.map(i => i.id)).toEqual([30])- expect(screen.queryByRole('button', { name: /Beach trip/ })).toBeNull()})- it('FE-MOB-PACKTAB-014: reports a failing template', async () => {+ it('FE-MOB-PACKTAB-013: reports a failing template', async () => {vi.spyOn(packingApi, 'applyTemplate').mockRejectedValue(new Error('x'))const { planner } = await setup()@@ -246,119 +237,94 @@ describe('MPackingListTab', () => {expect(planner.toast.error).toHaveBeenCalledWith('packing.templateError')})- it('FE-MOB-PACKTAB-015: saves the list as a template and reloads the template list', async () => {+ it('FE-MOB-PACKTAB-014: saves the list as a template, Enter included, a blank name does nothing', async () => {vi.spyOn(packingApi, 'saveAsTemplate').mockResolvedValue({ ok: true })const { planner } = await setup({ admin: true })openActions()fireEvent.click(screen.getByRole('button', { name: 'packing.saveAsTemplate' }))expect(screen.getByRole('button', { name: 'common.save' })).toBeDisabled()+ const input = screen.getByPlaceholderText('packing.templateName')+ fireEvent.keyDown(input, { key: 'Enter' })+ expect(packingApi.saveAsTemplate).not.toHaveBeenCalled()- fireEvent.change(screen.getByPlaceholderText('packing.templateName'), { target: { value: ' Summer ' } })+ fireEvent.change(input, { target: { value: ' Summer ' } })await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.save' })) })-expect(packingApi.saveAsTemplate).toHaveBeenCalledWith(3, 'Summer')expect(planner.toast.success).toHaveBeenCalledWith('packing.templateSaved')expect(packingApi.listTemplates).toHaveBeenCalledTimes(2)})- it('FE-MOB-PACKTAB-016: Enter submits the template name, blank input does nothing', async () => {- vi.spyOn(packingApi, 'saveAsTemplate').mockResolvedValue({ ok: true })- await setup({ admin: true })-- openActions()- fireEvent.click(screen.getByRole('button', { name: 'packing.saveAsTemplate' }))- const input = screen.getByPlaceholderText('packing.templateName')- fireEvent.keyDown(input, { key: 'Enter' })- expect(packingApi.saveAsTemplate).not.toHaveBeenCalled()-- fireEvent.change(input, { target: { value: 'Winter' } })- await act(async () => { fireEvent.keyDown(input, { key: 'Enter' }) })-- expect(packingApi.saveAsTemplate).toHaveBeenCalledWith(3, 'Winter')- })-- it('FE-MOB-PACKTAB-017: reports a failing template save', async () => {+ it('FE-MOB-PACKTAB-015: reports a failing template save', async () => {vi.spyOn(packingApi, 'saveAsTemplate').mockRejectedValue(new Error('x'))const { planner } = await setup({ admin: true })openActions()fireEvent.click(screen.getByRole('button', { name: 'packing.saveAsTemplate' }))fireEvent.change(screen.getByPlaceholderText('packing.templateName'), { target: { value: 'Summer' } })- await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.save' })) })+ await act(async () => { fireEvent.keyDown(screen.getByPlaceholderText('packing.templateName'), { key: 'Enter' }) })expect(planner.toast.error).toHaveBeenCalledWith('common.error')})- it('FE-MOB-PACKTAB-018: the import row opens the import sheet', async () => {+ it('FE-MOB-PACKTAB-016: the import row opens the import sheet', async () => {await setup()openActions()fireEvent.click(screen.getByRole('button', { name: 'packing.import' }))- expect(screen.getByRole('dialog')).toHaveAttribute('aria-label', 'packing.importTitle')+ expect(await screen.findByRole('dialog', { name: 'packing.importTitle' })).toBeInTheDocument()})- // ── Filters + empty states ────────────────────────────────────────────+ // ── Views, hiding packed items, empty states ──────────────────────────- it('FE-MOB-PACKTAB-019: the personal view shows only private items', async () => {+ it('FE-MOB-PACKTAB-017: the personal view shows only private items', async () => {await setup()expect(screen.queryByText('Diary')).toBeNull()fireEvent.click(screen.getByRole('button', { name: 'packing.viewPersonal' }))-expect(screen.getByText('Diary')).toBeInTheDocument()expect(screen.queryByText('Passport')).toBeNull()- expect(screen.getByText('0%')).toBeInTheDocument()+ expect(screen.getByText('packing.packedCount:0,1')).toBeInTheDocument()fireEvent.click(screen.getByRole('button', { name: 'packing.viewCommon' }))-expect(screen.getByText('Passport')).toBeInTheDocument()- expect(screen.queryByText('Diary')).toBeNull()})- it('FE-MOB-PACKTAB-020: an empty personal list shows its own hint', async () => {+ it('FE-MOB-PACKTAB-018: an empty personal list shows its own hint', async () => {await setup({ items: ITEMS.filter(i => !i.is_private) })-fireEvent.click(screen.getByRole('button', { name: 'packing.viewPersonal' }))-expect(screen.getByText('packing.personalEmptyHint')).toBeInTheDocument()})- it('FE-MOB-PACKTAB-021: the open/done filters narrow the categories', async () => {+ it('FE-MOB-PACKTAB-019: hiding packed items from the menu narrows the lists, and back', async () => {await setup()-- fireEvent.click(screen.getByRole('button', { name: 'packing.filterDone' }))- expect(screen.getByText('Passport')).toBeInTheDocument()- expect(screen.queryByText('Visa')).toBeNull()-- fireEvent.click(screen.getByRole('button', { name: 'packing.filterOpen' }))- expect(screen.getByText('Visa')).toBeInTheDocument()+ openActions()+ fireEvent.click(screen.getByRole('button', { name: 'packing.hideDone' }))expect(screen.queryByText('Passport')).toBeNull()+ expect(screen.getByText('Visa')).toBeInTheDocument()- fireEvent.click(screen.getByRole('button', { name: 'packing.filterAll' }))+ fireEvent.click(screen.getByRole('button', { name: 'packing.hideDone' }))expect(screen.getByText('Passport')).toBeInTheDocument()})- it('FE-MOB-PACKTAB-022: a filter that matches nothing shows the filtered-empty hint', async () => {- await setup({ items: [packItem({ id: 1, name: 'Visa' })] })-- fireEvent.click(screen.getByRole('button', { name: 'packing.filterDone' }))-+ it('FE-MOB-PACKTAB-020: hiding everything shows the filtered-empty hint', async () => {+ await setup({ items: [packItem({ id: 1, name: 'Visa', checked: 1 })] })+ openActions()+ fireEvent.click(screen.getByRole('button', { name: 'packing.hideDone' }))expect(screen.getByText('packing.emptyFiltered')).toBeInTheDocument()})- it('FE-MOB-PACKTAB-023: an empty list shows the mascot empty state and no filters', async () => {+ it('FE-MOB-PACKTAB-021: an empty list shows the mascot, no view switch, and the add-list button', async () => {await setup({ items: [] })-expect(screen.getByText('packing.emptyTitle')).toBeInTheDocument()- expect(screen.queryByRole('button', { name: 'packing.filterAll' })).toBeNull()+ expect(screen.queryByRole('button', { name: 'packing.viewCommon' })).toBeNull()expect(screen.getByRole('button', { name: 'packing.addCategory' })).toBeInTheDocument()})- // ── Categories ────────────────────────────────────────────────────────+ // ── Lists ─────────────────────────────────────────────────────────────- it('FE-MOB-PACKTAB-024: adds a category as a placeholder item', async () => {+ it('FE-MOB-PACKTAB-022: adds a list as a placeholder item', async () => {const { planner } = await setup({ items: [] })fireEvent.click(screen.getByRole('button', { name: 'packing.addCategory' }))@@ -366,78 +332,73 @@ describe('MPackingListTab', () => {fireEvent.change(screen.getByPlaceholderText('packing.newCategoryPlaceholder'), { target: { value: ' Gear ' } })await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.add' })) })- expect(planner.tripActions.addPackingItem).toHaveBeenCalledWith(3, {- name: '...', category: 'Gear', visibility: 'common',- })- expect(screen.getByRole('button', { name: 'packing.addCategory' })).toBeInTheDocument()+ expect(planner.tripActions.addPackingItem).toHaveBeenCalledWith(3, { name: '...', category: 'Gear', visibility: 'common' })})- it('FE-MOB-PACKTAB-025: a duplicate category name is disambiguated', async () => {+ it('FE-MOB-PACKTAB-023: a list added from the menu with a taken name is disambiguated', async () => {const { planner } = await setup()- enterEditMode()-+ openActions()fireEvent.click(screen.getByRole('button', { name: 'packing.addCategory' }))+const input = screen.getByPlaceholderText('packing.newCategoryPlaceholder')fireEvent.change(input, { target: { value: 'Documents' } })await act(async () => { fireEvent.keyDown(input, { key: 'Enter' }) })- expect(planner.tripActions.addPackingItem).toHaveBeenCalledWith(3, {- name: '...', category: `Documents${ZERO_WIDTH}`, visibility: 'common',- })+ expect(planner.tripActions.addPackingItem).toHaveBeenCalledWith(3, { name: '...', category: `Documents${ZERO_WIDTH}`, visibility: 'common' })})- it('FE-MOB-PACKTAB-026: a category added from the personal view is private', async () => {+ it('FE-MOB-PACKTAB-024: a list added from the personal view is private', async () => {const { planner } = await setup()- enterEditMode()fireEvent.click(screen.getByRole('button', { name: 'packing.viewPersonal' }))-+ openActions()fireEvent.click(screen.getByRole('button', { name: 'packing.addCategory' }))fireEvent.change(screen.getByPlaceholderText('packing.newCategoryPlaceholder'), { target: { value: 'Books' } })await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.add' })) })- expect(planner.tripActions.addPackingItem).toHaveBeenCalledWith(3, {- name: '...', category: 'Books', visibility: 'personal',- })+ expect(planner.tripActions.addPackingItem).toHaveBeenCalledWith(3, { name: '...', category: 'Books', visibility: 'personal' })})- it('FE-MOB-PACKTAB-027: Escape aborts the new-category field and errors are reported', async () => {+ it('FE-MOB-PACKTAB-025: Escape aborts the new-list field and errors are reported', async () => {const { planner } = await setup({ items: [] })asMock(planner.tripActions.addPackingItem).mockRejectedValueOnce(new Error('x'))fireEvent.click(screen.getByRole('button', { name: 'packing.addCategory' }))- fireEvent.change(screen.getByPlaceholderText('packing.newCategoryPlaceholder'), { target: { value: 'Gear' } })- await act(async () => { fireEvent.keyDown(screen.getByPlaceholderText('packing.newCategoryPlaceholder'), { key: 'Enter' }) })+ const field = screen.getByPlaceholderText('packing.newCategoryPlaceholder')+ fireEvent.change(field, { target: { value: 'Gear' } })+ await act(async () => { fireEvent.keyDown(field, { key: 'Enter' }) })expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.addError')fireEvent.keyDown(screen.getByPlaceholderText('packing.newCategoryPlaceholder'), { key: 'Escape' })expect(screen.getByRole('button', { name: 'packing.addCategory' })).toBeInTheDocument()+ fireEvent.click(screen.getByRole('button', { name: 'packing.addCategory' }))+ fireEvent.click(screen.getByRole('button', { name: 'common.cancel' }))+ expect(screen.queryByPlaceholderText('packing.newCategoryPlaceholder')).toBeNull()})- it('FE-MOB-PACKTAB-028: collapses a category by click and by keyboard', async () => {+ it('FE-MOB-PACKTAB-026: a tap on the list head folds it', async () => {await setup()const header = within(card('Documents')).getByRole('button', { expanded: true })-fireEvent.click(header)expect(screen.queryByText('Passport')).toBeNull()-- fireEvent.keyDown(header, { key: 'Enter' })+ fireEvent.click(within(card('Documents')).getByRole('button', { expanded: false }))expect(screen.getByText('Passport')).toBeInTheDocument()+ })- fireEvent.keyDown(header, { key: ' ' })- expect(screen.queryByText('Passport')).toBeNull()-- fireEvent.keyDown(header, { key: 'a' })- expect(screen.queryByText('Passport')).toBeNull()+ it('FE-MOB-PACKTAB-027: the list menu is a sheet named after the list', async () => {+ await setup()+ openCategoryMenu('Documents')+ const sheet = screen.getByRole('dialog', { name: 'packing.categoryOptions' })+ expect(within(sheet).getByText('Documents')).toBeInTheDocument()+ fireEvent.click(within(sheet).getByRole('button', { name: 'common.close' }))+ await waitFor(() => expect(screen.queryByRole('dialog', { name: 'packing.categoryOptions' })).toBeNull())})- it('FE-MOB-PACKTAB-029: renames a category across all its items', async () => {+ it('FE-MOB-PACKTAB-028: renames a list across all its items', async () => {const { planner } = await setup()- enterEditMode()openCategoryMenu('Documents')-fireEvent.click(screen.getByRole('button', { name: 'packing.menuRename' }))- const input = screen.getByDisplayValue('Documents')- fireEvent.click(input)++ const input = screen.getByRole('textbox', { name: 'packing.menuRename' })fireEvent.change(input, { target: { value: 'Papers' } })await act(async () => { fireEvent.keyDown(input, { key: 'Enter' }) })@@ -445,43 +406,36 @@ describe('MPackingListTab', () => {expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 2, { category: 'Papers' })})- it('FE-MOB-PACKTAB-030: an unchanged or blank rename is dropped, Escape reverts', async () => {+ it('FE-MOB-PACKTAB-029: an unchanged rename is dropped, Escape reverts', async () => {const { planner } = await setup()- enterEditMode()openCategoryMenu('Documents')-fireEvent.click(screen.getByRole('button', { name: 'packing.menuRename' }))- fireEvent.blur(screen.getByDisplayValue('Documents'))+ fireEvent.blur(screen.getByRole('textbox', { name: 'packing.menuRename' }))expect(planner.tripActions.updatePackingItem).not.toHaveBeenCalled()openCategoryMenu('Documents')fireEvent.click(screen.getByRole('button', { name: 'packing.menuRename' }))- const input = screen.getByDisplayValue('Documents')+ const input = screen.getByRole('textbox', { name: 'packing.menuRename' })fireEvent.change(input, { target: { value: 'Nope' } })fireEvent.keyDown(input, { key: 'Escape' })-expect(planner.tripActions.updatePackingItem).not.toHaveBeenCalled()expect(screen.getByText('Documents')).toBeInTheDocument()})- it('FE-MOB-PACKTAB-031: a failing rename surfaces the rename error', async () => {+ it('FE-MOB-PACKTAB-030: a failing rename surfaces the rename error', async () => {const { planner } = await setup()asMock(planner.tripActions.updatePackingItem).mockRejectedValueOnce(new Error('x'))- enterEditMode()openCategoryMenu('Documents')-fireEvent.click(screen.getByRole('button', { name: 'packing.menuRename' }))- const input = screen.getByDisplayValue('Documents')+ const input = screen.getByRole('textbox', { name: 'packing.menuRename' })fireEvent.change(input, { target: { value: 'Papers' } })await act(async () => { fireEvent.keyDown(input, { key: 'Enter' }) })expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.renameError')})- it('FE-MOB-PACKTAB-032: checks and unchecks a whole category', async () => {+ it('FE-MOB-PACKTAB-031: checks and unchecks a whole list', async () => {const { planner } = await setup()- enterEditMode()-openCategoryMenu('Documents')await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'packing.menuCheckAll' })) })expect(planner.tripActions.togglePackingItem).toHaveBeenCalledTimes(1)@@ -492,36 +446,25 @@ describe('MPackingListTab', () => {expect(planner.tripActions.togglePackingItem).toHaveBeenCalledWith(3, 1, false)})- it('FE-MOB-PACKTAB-033: a failing bulk check surfaces the save error', async () => {+ it('FE-MOB-PACKTAB-032: a failing bulk check surfaces the save error', async () => {const { planner } = await setup()asMock(planner.tripActions.togglePackingItem).mockRejectedValueOnce(new Error('x'))- enterEditMode()-openCategoryMenu('Documents')await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'packing.menuCheckAll' })) })-expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.saveError')})- it('FE-MOB-PACKTAB-034: a failing bulk uncheck surfaces the save error', async () => {+ it('FE-MOB-PACKTAB-033: deleting a list removes every item after confirmation, cancelling keeps them', async () => {const { planner } = await setup()- asMock(planner.tripActions.togglePackingItem).mockRejectedValueOnce(new Error('x'))- enterEditMode()-openCategoryMenu('Documents')- await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'packing.menuUncheckAll' })) })-- expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.saveError')- })+ fireEvent.click(screen.getByRole('button', { name: 'packing.menuDeleteCat' }))+ fireEvent.click(within(await screen.findByRole('dialog', { name: 'packing.menuDeleteCat' })).getByRole('button', { name: 'common.cancel' }))+ expect(planner.tripActions.deletePackingItem).not.toHaveBeenCalled()- it('FE-MOB-PACKTAB-035: deleting a category removes every item after confirmation', async () => {- const { planner } = await setup()asMock(planner.tripActions.deletePackingItem).mockRejectedValueOnce(new Error('x'))- enterEditMode()-openCategoryMenu('Documents')fireEvent.click(screen.getByRole('button', { name: 'packing.menuDeleteCat' }))- const dialog = screen.getByRole('dialog')+ const dialog = await screen.findByRole('dialog', { name: 'packing.menuDeleteCat' })expect(within(dialog).getByText('packing.confirm.deleteCat:Documents,2')).toBeInTheDocument()fireEvent.click(within(dialog).getByRole('button', { name: 'common.delete' }))@@ -529,77 +472,67 @@ describe('MPackingListTab', () => {expect(planner.tripActions.deletePackingItem).toHaveBeenCalledTimes(2)})- it('FE-MOB-PACKTAB-036: cancelling the category delete keeps the items', async () => {- const { planner } = await setup()- enterEditMode()-+ it('FE-MOB-PACKTAB-034: the list menu moves the whole list to my list, one write per item (#2961)', async () => {+ const { planner } = await setup({ planner: { tripMembers: [ANNA, BEN] } })openCategoryMenu('Documents')- fireEvent.click(screen.getByRole('button', { name: 'packing.menuDeleteCat' }))- fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', { name: 'common.cancel' }))+ fireEvent.click(screen.getByRole('button', { name: 'packing.menuShareCat' }))+ const sheet = await screen.findByRole('dialog', { name: 'packing.menuShareCat' })+ fireEvent.click(within(sheet).getByRole('button', { name: /^packing.tierPersonal/ }))+ await act(async () => { fireEvent.click(within(sheet).getByRole('button', { name: 'packing.shareCat.apply' })) })- expect(planner.tripActions.deletePackingItem).not.toHaveBeenCalled()+ expect(asMock(planner.tripActions.setPackingItemSharing).mock.calls).toEqual([+ [3, 1, 'personal', []],+ [3, 2, 'personal', []],+ ])})- // ── Category assignees ────────────────────────────────────────────────+ // ── Who looks after a list ────────────────────────────────────────────- it('FE-MOB-PACKTAB-037: assigns and unassigns members of a category', async () => {+ it('FE-MOB-PACKTAB-035: assigns and unassigns people from the list menu, and shows them on the head', async () => {const both = [{ user_id: 11, username: 'anna' }, { user_id: 12, username: 'ben' }]vi.mocked(packingApi.getCategoryAssignees).mockResolvedValue({ assignees: { Documents: [both[0]] } })const setAssignees = vi.spyOn(packingApi, 'setCategoryAssignees').mockResolvedValue({ assignees: both })await setup({ planner: { tripMembers: [ANNA, BEN] } as Partial<TripPlanner> })- enterEditMode()+ expect(within(card('Documents')).getByLabelText('anna')).toBeInTheDocument()- fireEvent.click(within(card('Documents')).getByRole('button', { name: 'packing.assignMembers' }))- await act(async () => { fireEvent.click(within(card('Documents')).getByRole('button', { name: 'ben' })) })+ openCategoryMenu('Documents')+ const sheet = screen.getByRole('dialog', { name: 'packing.categoryOptions' })+ await act(async () => { fireEvent.click(within(sheet).getByRole('button', { name: 'ben' })) })expect(setAssignees).toHaveBeenCalledWith(3, 'Documents', [11, 12])- // The response made both members assigned — tapping anna now removes her.- await act(async () => { fireEvent.click(within(card('Documents')).getByRole('button', { name: 'anna' })) })+ await act(async () => { fireEvent.click(within(sheet).getByRole('button', { name: 'anna' })) })expect(setAssignees).toHaveBeenLastCalledWith(3, 'Documents', [12])})- it('FE-MOB-PACKTAB-038: a failing assignee update surfaces the save error', async () => {+ it('FE-MOB-PACKTAB-036: a failing assignee update surfaces the save error, no members shows the hint', async () => {vi.spyOn(packingApi, 'setCategoryAssignees').mockRejectedValue(new Error('x'))- const { planner } = await setup({ planner: { tripMembers: [ANNA] } as Partial<TripPlanner> })- enterEditMode()-- fireEvent.click(within(card('Documents')).getByRole('button', { name: 'packing.assignMembers' }))- await act(async () => { fireEvent.click(within(card('Documents')).getByRole('button', { name: 'anna' })) })-+ const { planner, view } = await setup({ planner: { tripMembers: [ANNA] } as Partial<TripPlanner> })+ openCategoryMenu('Documents')+ await act(async () => { fireEvent.click(within(screen.getByRole('dialog', { name: 'packing.categoryOptions' })).getByRole('button', { name: 'anna' })) })expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.saveError')- })- it('FE-MOB-PACKTAB-039: a trip without members shows the assign hint', async () => {+ view.unmount()await setup()- enterEditMode()-- fireEvent.click(within(card('Documents')).getByRole('button', { name: 'packing.assignMembers' }))-+ openCategoryMenu('Documents')expect(screen.getByText('packing.noMembers')).toBeInTheDocument()})- // ── Items ─────────────────────────────────────────────────────────────+ // ── Adding items ──────────────────────────────────────────────────────- it('FE-MOB-PACKTAB-040: adds an item to a category', async () => {+ it('FE-MOB-PACKTAB-037: adds an item to a list from the row at its end', async () => {const { planner } = await setup()- enterEditMode()-fireEvent.click(within(card('Clothing')).getByRole('button', { name: 'packing.addItem' }))const input = within(card('Clothing')).getByPlaceholderText('packing.addItemPlaceholder')expect(within(card('Clothing')).getByRole('button', { name: 'common.add' })).toBeDisabled()fireEvent.change(input, { target: { value: ' Hat ' } })await act(async () => { fireEvent.click(within(card('Clothing')).getByRole('button', { name: 'common.add' })) })- expect(planner.tripActions.addPackingItem).toHaveBeenCalledWith(3, {- name: 'Hat', category: 'Clothing', visibility: 'common',- })+ expect(planner.tripActions.addPackingItem).toHaveBeenCalledWith(3, { name: 'Hat', category: 'Clothing', visibility: 'common' })})- it('FE-MOB-PACKTAB-041: a category placeholder is renamed instead of adding a second row', async () => {+ it('FE-MOB-PACKTAB-038: a list placeholder is renamed instead of adding a second row', async () => {const items = [packItem({ id: 1, name: 'Passport', category: 'Documents' }), packItem({ id: 9, name: '...', category: 'Gear' })]const { planner } = await setup({ items })- enterEditMode()-fireEvent.click(within(card('Gear')).getByRole('button', { name: 'packing.addItem' }))const input = within(card('Gear')).getByPlaceholderText('packing.addItemPlaceholder')fireEvent.change(input, { target: { value: 'Rope' } })@@ -609,11 +542,9 @@ describe('MPackingListTab', () => {expect(planner.tripActions.addPackingItem).not.toHaveBeenCalled()})- it('FE-MOB-PACKTAB-042: Escape aborts the add-item field and failures are reported', async () => {+ it('FE-MOB-PACKTAB-039: Escape and an empty blur close the add field, failures are reported', async () => {const { planner } = await setup()asMock(planner.tripActions.addPackingItem).mockRejectedValueOnce(new Error('x'))- enterEditMode()-fireEvent.click(within(card('Clothing')).getByRole('button', { name: 'packing.addItem' }))const input = within(card('Clothing')).getByPlaceholderText('packing.addItemPlaceholder')fireEvent.keyDown(input, { key: 'Enter' })@@ -625,210 +556,129 @@ describe('MPackingListTab', () => {fireEvent.keyDown(input, { key: 'Escape' })expect(within(card('Clothing')).getByRole('button', { name: 'packing.addItem' })).toBeInTheDocument()+ fireEvent.click(within(card('Clothing')).getByRole('button', { name: 'packing.addItem' }))+ fireEvent.blur(within(card('Clothing')).getByPlaceholderText('packing.addItemPlaceholder'))+ expect(within(card('Clothing')).getByRole('button', { name: 'packing.addItem' })).toBeInTheDocument()})- it('FE-MOB-PACKTAB-043: toggles an item and shows its quantity badge', async () => {- const { planner } = await setup()+ // ── Rows ──────────────────────────────────────────────────────────────+ it('FE-MOB-PACKTAB-040: toggles an item; the row says the amount and nothing else unset', async () => {+ const { planner } = await setup({ bagTracking: true })fireEvent.click(screen.getByRole('button', { name: 'Socks' }))expect(planner.tripActions.togglePackingItem).toHaveBeenCalledWith(3, 3, true)-fireEvent.click(screen.getByRole('button', { name: 'Passport' }))expect(planner.tripActions.togglePackingItem).toHaveBeenCalledWith(3, 1, false)- expect(within(itemRow('Socks')).getByText('0/3')).toBeInTheDocument()+ expect(within(itemRow('Socks')).getByText('×3')).toBeInTheDocument()+ expect(within(itemRow('Socks')).queryByText('120 g')).toBeNull()+ expect(within(itemRow('Socks')).queryByRole('button', { name: 'packing.bags' })).toBeNull()expect(screen.getByRole('button', { name: 'Passport' })).toHaveAttribute('aria-pressed', 'true')})- it('FE-MOB-PACKTAB-044: shows the placeholder label instead of the sentinel name', async () => {- await setup({ items: [packItem({ id: 9, name: '...', category: 'Gear' })] })- expect(screen.getByText('packing.addItemPlaceholder')).toBeInTheDocument()+ it('FE-MOB-PACKTAB-041: a partly packed item shows its pieces instead of the amount (#2296)', async () => {+ await setup({ items: [packItem({ id: 3, name: 'Socks', category: 'Clothing', quantity: 3, packed_quantity: 1 })] })+ expect(within(itemRow('Socks')).getByText('1/3')).toBeInTheDocument()+ expect(within(itemRow('Socks')).queryByText('×3')).toBeNull()})- it('FE-MOB-PACKTAB-045: shows weights in edit mode while bag tracking is on', async () => {- await setup({ bagTracking: true })- enterEditMode()-- // The row shows the unit weight, not quantity x weight; a row without one- // says nothing rather than spending width on a dash (#1525).- expect(within(itemRow('Socks')).getByText('120 g')).toBeInTheDocument()- expect(within(itemRow('Shirt')).queryByText('— g')).not.toBeInTheDocument()+ it('FE-MOB-PACKTAB-042: shows the placeholder label instead of the sentinel name', async () => {+ await setup({ items: [packItem({ id: 9, name: '...', category: 'Gear' })] })+ expect(screen.getByText('packing.addItemPlaceholder')).toBeInTheDocument()})- it('FE-MOB-PACKTAB-046: opens the item editor from the row', async () => {+ it('FE-MOB-PACKTAB-043: a tap on the name opens the item sheet, which closes again', async () => {await setup()- enterEditMode()-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'mobileTrip.more' }))- fireEvent.click(screen.getByRole('button', { name: 'common.edit' }))-- expect(screen.getByRole('dialog')).toHaveAttribute('aria-label', 'packing.editItem')+ openItem('Socks')+ const dialog = screen.getByRole('dialog', { name: 'packing.editItem' })+ fireEvent.click(within(dialog).getByRole('button', { name: 'common.close' }))+ await waitFor(() => expect(screen.queryByRole('dialog', { name: 'packing.editItem' })).toBeNull())})- it('FE-MOB-PACKTAB-047: deletes a normal item outright', async () => {+ it('FE-MOB-PACKTAB-044: deletes a normal item from its sheet', async () => {const { planner } = await setup()- enterEditMode()-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'mobileTrip.more' }))- await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.delete' })) })-+ openItem('Socks')+ await act(async () => { fireEvent.click(within(screen.getByRole('dialog', { name: 'packing.editItem' })).getByRole('button', { name: 'common.delete' })) })expect(planner.tripActions.deletePackingItem).toHaveBeenCalledWith(3, 3)})- it('FE-MOB-PACKTAB-048: the last item of a custom category is reset to a placeholder', async () => {+ it('FE-MOB-PACKTAB-045: the last item of a custom list is reset to a placeholder', async () => {const items = [packItem({ id: 1, name: 'Passport', category: 'Documents' }),packItem({ id: 8, name: 'Rope', category: 'Gear', checked: 1, quantity: 2, weight_grams: 90 }),]const { planner } = await setup({ items })- enterEditMode()-- fireEvent.click(within(itemRow('Rope')).getByRole('button', { name: 'mobileTrip.more' }))- await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.delete' })) })+ openItem('Rope')+ await act(async () => { fireEvent.click(within(screen.getByRole('dialog', { name: 'packing.editItem' })).getByRole('button', { name: 'common.delete' })) })expect(planner.tripActions.togglePackingItem).toHaveBeenCalledWith(3, 8, false)- expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 8, {- name: '...', weight_grams: null, bag_id: null, quantity: 1,- })+ expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 8, { name: '...', weight_grams: null, bag_id: null, quantity: 1 })expect(planner.tripActions.deletePackingItem).not.toHaveBeenCalled()})- it('FE-MOB-PACKTAB-049: a failing item delete surfaces the delete error', async () => {+ it('FE-MOB-PACKTAB-046: a failing item delete surfaces the delete error', async () => {const { planner } = await setup()asMock(planner.tripActions.deletePackingItem).mockRejectedValueOnce(new Error('x'))- enterEditMode()-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'mobileTrip.more' }))- await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.delete' })) })-+ openItem('Socks')+ await act(async () => { fireEvent.click(within(screen.getByRole('dialog', { name: 'packing.editItem' })).getByRole('button', { name: 'common.delete' })) })expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.deleteError')})// ── Sharing badges ────────────────────────────────────────────────────- it('FE-MOB-PACKTAB-050: badges an item somebody else takes care of', async () => {- const items = [packItem({ id: 1, name: 'Tent', is_private: 1, owner_id: 21, owner_username: 'owner' })]- await setup({ items })-+ it('FE-MOB-PACKTAB-047: badges an item somebody else takes care of, as an icon not a sentence', async () => {+ await setup({ items: [packItem({ id: 1, name: 'Tent', is_private: 1, owner_id: 21, owner_username: 'owner' })] })fireEvent.click(screen.getByRole('button', { name: 'packing.viewPersonal' }))-+ expect(screen.queryByText('packing.takenCareOf:owner')).not.toBeInTheDocument()expect(screen.getByLabelText('packing.takenCareOf:owner')).toBeInTheDocument()})- it('FE-MOB-PACKTAB-051: badges how many people my shared item covers', async () => {- const items = [packItem({+ it('FE-MOB-PACKTAB-048: badges how many people my shared item covers', async () => {+ await setup({ items: [packItem({id: 1, name: 'Tent', is_private: 1, owner_id: ME, owner_username: 'me',recipients: [{ user_id: 11, username: 'anna' }, { user_id: 12, username: 'ben' }],- })]- await setup({ items })-+ })] })fireEvent.click(screen.getByRole('button', { name: 'packing.viewPersonal' }))-expect(screen.getByLabelText('packing.sharedWithCount:2')).toBeInTheDocument()})- it('FE-MOB-PACKTAB-052: shows the owner avatar and the contributor count on a common item', async () => {+ it('FE-MOB-PACKTAB-049: shows the bringer picture and how many more bring it', async () => {const items = [packItem({id: 1, name: 'Tent', owner_id: 11, owner_username: 'anna',contributors: [{ user_id: 12, username: 'ben', status: 'pledged' }],})]- const member = { ...ANNA, avatar_url: 'https://cdn.example/anna.png' } as unknown as TripMember- await setup({ items, planner: { tripMembers: [member] } as Partial<TripPlanner> })-- expect(within(itemRow('Tent')).getByAltText('anna')).toHaveAttribute('src', 'https://cdn.example/anna.png')+ await setup({ items, planner: { tripMembers: [ANNA] } as Partial<TripPlanner> })+ expect(itemRow('Tent').querySelector('img')).toHaveAttribute('src', 'https://cdn.example/anna.png')expect(within(itemRow('Tent')).getByText('+1')).toBeInTheDocument()+ expect(screen.getByLabelText('packing.broughtBy:anna, ben')).toBeInTheDocument()})- it('FE-MOB-PACKTAB-053: falls back to the owner initial when there is no avatar', async () => {- const items = [packItem({ id: 1, name: 'Tent', owner_id: 99, owner_username: 'zoe' })]- await setup({ items })-+ it('FE-MOB-PACKTAB-050: falls back to the initial, and co-bringers alone still show', async () => {+ await setup({ items: [+ packItem({ id: 1, name: 'Tent', owner_id: 99, owner_username: 'zoe' }),+ packItem({ id: 2, name: 'Stove', owner_id: null, contributors: [{ user_id: 12, username: 'ben', status: 'pledged' }] }),+ ] })expect(within(itemRow('Tent')).getByText('Z')).toBeInTheDocument()- })-- // ── Bag picker on the row ─────────────────────────────────────────────-- it('FE-MOB-PACKTAB-054: assigns and clears the bag of an item', async () => {- const { planner } = await setup({ bagTracking: true })-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'packing.bags' }))- await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'Backpack' })) })- expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 3, { bag_id: 71 })-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'packing.bags' }))- await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'packing.noBag' })) })- expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 3, { bag_id: null })- })-- it('FE-MOB-PACKTAB-055: a failing bag assignment surfaces the save error', async () => {- const { planner } = await setup({ bagTracking: true })- asMock(planner.tripActions.updatePackingItem).mockRejectedValueOnce(new Error('x'))-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'packing.bags' }))- await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'Backpack' })) })-- expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.saveError')- })-- it('FE-MOB-PACKTAB-056: creates a bag from the row picker and assigns it right away', async () => {- const created = { id: 72, trip_id: 3, name: 'Duffel', color: '#ec4899', sort_order: 1 } as PackingBag- vi.spyOn(packingApi, 'createBag').mockResolvedValue({ bag: created })- const { planner } = await setup({ bagTracking: true })-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'packing.bags' }))- fireEvent.click(screen.getByRole('button', { name: 'packing.addBag' }))- const input = screen.getByPlaceholderText('packing.bagName')- fireEvent.keyDown(input, { key: 'Enter' })- expect(packingApi.createBag).not.toHaveBeenCalled()-- fireEvent.change(input, { target: { value: 'Duffel' } })- await act(async () => { fireEvent.keyDown(input, { key: 'Enter' }) })-- expect(packingApi.createBag).toHaveBeenCalledWith(3, { name: 'Duffel', color: '#ec4899' })- expect(planner.tripActions.updatePackingItem).toHaveBeenCalledWith(3, 3, { bag_id: 72 })- })-- it('FE-MOB-PACKTAB-057: a failing bag creation is reported and assigns nothing', async () => {- vi.spyOn(packingApi, 'createBag').mockRejectedValue(new Error('x'))- const { planner } = await setup({ bagTracking: true })-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'packing.bags' }))- fireEvent.click(screen.getByRole('button', { name: 'packing.addBag' }))- fireEvent.change(screen.getByPlaceholderText('packing.bagName'), { target: { value: 'Duffel' } })- await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'common.add' })) })-- expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.saveError')- expect(planner.tripActions.updatePackingItem).not.toHaveBeenCalled()- })-- it('FE-MOB-PACKTAB-058: Escape closes the inline bag field', async () => {- await setup({ bagTracking: true })-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'packing.bags' }))- fireEvent.click(screen.getByRole('button', { name: 'packing.addBag' }))- fireEvent.change(screen.getByPlaceholderText('packing.bagName'), { target: { value: 'x' } })- fireEvent.keyDown(screen.getByPlaceholderText('packing.bagName'), { key: 'Escape' })-- expect(screen.getByRole('button', { name: 'packing.addBag' })).toBeInTheDocument()+ expect(within(itemRow('Stove')).getByText('B')).toBeInTheDocument()})// ── Bags sheet plumbing ───────────────────────────────────────────────- it('FE-MOB-PACKTAB-059: renames, deletes and re-crews a bag through the sheet', async () => {+ it('FE-MOB-PACKTAB-051: renames, deletes and re-crews a bag through the sheet', async () => {vi.spyOn(packingApi, 'updateBag').mockResolvedValue({ bag: { ...BAGS[0], name: 'Daypack' } })vi.spyOn(packingApi, 'setBagMembers').mockResolvedValue({ members: [{ user_id: 11, username: 'anna', avatar: null }] })vi.spyOn(packingApi, 'deleteBag').mockResolvedValue({ ok: true })await setup({ bagTracking: true, planner: { tripMembers: [ANNA] } as Partial<TripPlanner> })- fireEvent.click(screen.getAllByRole('button', { name: 'packing.bags' })[0])- const dialog = screen.getByRole('dialog')+ openActions()+ fireEvent.click(screen.getByRole('button', { name: 'packing.bags' }))+ const dialog = await screen.findByRole('dialog', { name: 'packing.bags' })fireEvent.click(within(dialog).getByRole('button', { name: 'Backpack' }))const nameInput = within(dialog).getByDisplayValue('Backpack')fireEvent.change(nameInput, { target: { value: 'Daypack' } })await act(async () => { fireEvent.keyDown(nameInput, { key: 'Enter' }) })expect(packingApi.updateBag).toHaveBeenCalledWith(3, 71, { name: 'Daypack' })- expect(within(dialog).getByRole('button', { name: 'Daypack' })).toBeInTheDocument()fireEvent.click(within(dialog).getByRole('button', { name: 'common.add' }))await act(async () => { fireEvent.click(within(dialog).getByRole('button', { name: 'anna' })) })@@ -836,39 +686,16 @@ describe('MPackingListTab', () => {await act(async () => { fireEvent.click(within(dialog).getByRole('button', { name: 'common.delete' })) })expect(packingApi.deleteBag).toHaveBeenCalledWith(3, 71)- expect(within(dialog).queryByRole('button', { name: 'Daypack' })).toBeNull()- })-- it('FE-MOB-PACKTAB-060: reports failures of the bag sheet mutations', async () => {- vi.spyOn(packingApi, 'updateBag').mockRejectedValue(new Error('x'))- vi.spyOn(packingApi, 'setBagMembers').mockRejectedValue(new Error('x'))- vi.spyOn(packingApi, 'deleteBag').mockRejectedValue(new Error('x'))- const { planner } = await setup({ bagTracking: true, planner: { tripMembers: [ANNA] } as Partial<TripPlanner> })-- fireEvent.click(screen.getAllByRole('button', { name: 'packing.bags' })[0])- const dialog = screen.getByRole('dialog')-- fireEvent.click(within(dialog).getByRole('button', { name: 'Backpack' }))- const nameInput = within(dialog).getByDisplayValue('Backpack')- fireEvent.change(nameInput, { target: { value: 'Daypack' } })- await act(async () => { fireEvent.keyDown(nameInput, { key: 'Enter' }) })-- fireEvent.click(within(dialog).getByRole('button', { name: 'common.add' }))- await act(async () => { fireEvent.click(within(dialog).getByRole('button', { name: 'anna' })) })-- await act(async () => { fireEvent.click(within(dialog).getByRole('button', { name: 'common.delete' })) })-- expect(planner.toast.error).toHaveBeenCalledWith('common.error')- expect(planner.toast.error).toHaveBeenCalledWith('packing.toast.deleteError')})- it('FE-MOB-PACKTAB-061: creates a bag from the sheet with the next palette colour', async () => {+ it('FE-MOB-PACKTAB-052: creates a bag from the sheet with the next palette colour', async () => {const created = { id: 72, trip_id: 3, name: 'Duffel', color: '#ec4899', sort_order: 1 } as PackingBagvi.spyOn(packingApi, 'createBag').mockResolvedValue({ bag: created })await setup({ bagTracking: true })- fireEvent.click(screen.getAllByRole('button', { name: 'packing.bags' })[0])- const dialog = screen.getByRole('dialog')+ openActions()+ fireEvent.click(screen.getByRole('button', { name: 'packing.bags' }))+ const dialog = await screen.findByRole('dialog', { name: 'packing.bags' })fireEvent.click(within(dialog).getByRole('button', { name: 'packing.addBag' }))const field = within(dialog).getByPlaceholderText('packing.bagName')fireEvent.change(field, { target: { value: 'Duffel' } })@@ -876,90 +703,43 @@ describe('MPackingListTab', () => {await act(async () => { fireEvent.click(within(addRow).getByRole('button', { name: 'common.add' })) })expect(packingApi.createBag).toHaveBeenCalledWith(3, { name: 'Duffel', color: '#ec4899' })- expect(within(dialog).getByRole('button', { name: 'Duffel' })).toBeInTheDocument()})- it('FE-MOB-PACKTAB-062: every sheet the tab owns can be dismissed again', async () => {- await setup({ bagTracking: true })-- fireEvent.click(screen.getAllByRole('button', { name: 'packing.bags' })[0])- fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', { name: 'common.close' }))- await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull())+ it('FE-MOB-PACKTAB-053: the action sheet and the import sheet can be dismissed again', async () => {+ await setup()+ openActions()+ fireEvent.click(within(screen.getByRole('dialog', { name: 'packing.actions' })).getByRole('button', { name: 'common.close' }))+ await waitFor(() => expect(screen.queryByRole('dialog', { name: 'packing.actions' })).toBeNull())openActions()fireEvent.click(screen.getByRole('button', { name: 'packing.import' }))- fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', { name: 'common.cancel' }))- await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull())-- enterEditMode()- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'mobileTrip.more' }))- fireEvent.click(screen.getByRole('button', { name: 'common.edit' }))- fireEvent.click(within(screen.getByRole('dialog')).getByRole('button', { name: 'common.close' }))- await waitFor(() => expect(screen.queryByRole('dialog')).toBeNull())- })-- // ── Row width (#1525) ─────────────────────────────────────────────────-- it('FE-MOB-PACKTAB-063: the row actions stay behind one button until it is opened', async () => {- await setup()- enterEditMode()-- expect(screen.queryByRole('button', { name: 'common.edit' })).not.toBeInTheDocument()- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'mobileTrip.more' }))- expect(screen.getByRole('button', { name: 'common.edit' })).toBeInTheDocument()- expect(screen.getByRole('button', { name: 'common.delete' })).toBeInTheDocument()-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'mobileTrip.more' }))- expect(screen.queryByRole('button', { name: 'common.edit' })).not.toBeInTheDocument()- })-- it('FE-MOB-PACKTAB-064: the menu and the bag picker never stand open together', async () => {- await setup({ bagTracking: true })- enterEditMode()-- fireEvent.click(within(itemRow('Socks')).getByRole('button', { name: 'mobileTrip.more' }))- expect(screen.getByRole('button', { name: 'common.edit' })).toBeInTheDocument()-- // Opening the bag picker on the same row closes the action menu.- fireEvent.click(within(itemRow('Socks')).getAllByRole('button', { name: 'packing.bags' })[0])- expect(screen.queryByRole('button', { name: 'common.edit' })).not.toBeInTheDocument()- expect(screen.getByRole('button', { name: /packing.noBag/ })).toBeInTheDocument()- })-- it('FE-MOB-PACKTAB-065: the sharing state is an icon on the row, not a sentence', async () => {- const items = [packItem({ id: 1, name: 'Tent', is_private: 1, owner_id: 21, owner_username: 'owner' })]- await setup({ items })- fireEvent.click(screen.getByRole('button', { name: 'packing.viewPersonal' }))-- // The wording is still reachable — it just does not eat the row any more.- expect(screen.queryByText('packing.takenCareOf:owner')).not.toBeInTheDocument()- expect(screen.getByLabelText('packing.takenCareOf:owner')).toBeInTheDocument()+ fireEvent.click(within(await screen.findByRole('dialog', { name: 'packing.importTitle' })).getByRole('button', { name: 'common.cancel' }))+ await waitFor(() => expect(screen.queryByRole('dialog', { name: 'packing.importTitle' })).toBeNull())})// ── Export (#875, #1420) ──────────────────────────────────────────────- it('FE-MOB-PACKTAB-066: offers the three exports in the action menu, after Import', async () => {+ it('FE-MOB-PACKTAB-054: offers the three exports in the action sheet, right after Import', async () => {seedStore(useTripStore, { packingItems: ITEMS })await setup()openActions()- const labels = screen.getAllByRole('button').map(b => b.textContent)+ const labels = within(screen.getByRole('dialog', { name: 'packing.actions' })).getAllByRole('button').map(b => b.textContent)const importAt = labels.indexOf('packing.import')expect(labels.slice(importAt, importAt + 4)).toEqual(['packing.import', 'packing.exportPrint', 'packing.exportMarkdown', 'packing.exportCsv',])})- it('FE-MOB-PACKTAB-067: a member who may not edit still gets the menu, with the exports and nothing else', async () => {+ it('FE-MOB-PACKTAB-055: a member who may not edit still gets the exports and nothing that changes the list', async () => {seedStore(useTripStore, { packingItems: ITEMS })await setup({ planner: { can: vi.fn(() => false) } })openActions()expect(screen.getByRole('button', { name: 'packing.exportMarkdown' })).toBeInTheDocument()- expect(screen.queryByRole('button', { name: 'packing.import' })).not.toBeInTheDocument()expect(screen.queryByRole('button', { name: /packing.clearChecked/ })).not.toBeInTheDocument()expect(screen.queryByRole('button', { name: 'packing.applyTemplate' })).not.toBeInTheDocument()})- it('FE-MOB-PACKTAB-068: downloads the open view as Markdown, and opens the print preview', async () => {+ it('FE-MOB-PACKTAB-056: downloads the open view as Markdown, and opens the print preview', async () => {const download = vi.spyOn(fileDownload, 'downloadBlob').mockImplementation(() => {})seedStore(useTripStore, { packingItems: ITEMS })await setup()@@ -970,52 +750,18 @@ describe('MPackingListTab', () => {expect(name).toMatch(/^packing-list.*\.md$/)const text = await (blob as Blob).text()expect(text).toContain('- [x] Passport')- expect(text).toContain('- [ ] 3 × Socks (120 g)')expect(text).not.toContain('Diary')- expect(screen.queryByRole('button', { name: 'packing.exportMarkdown' })).not.toBeInTheDocument()openActions()await act(async () => { fireEvent.click(screen.getByRole('button', { name: 'packing.exportPrint' })) })expect(await screen.findByTitle(/Packing List/)).toBeInTheDocument()})- it('FE-MOB-PACKTAB-069: counts the packed pieces of a multi-piece item, read-only for a viewer (#2296)', async () => {- const socks = packItem({ id: 3, name: 'Socks', category: 'Clothing', quantity: 3, packed_quantity: 1 })- const { planner, view } = await setup({ items: [socks] })- const row = itemRow('Socks')- expect(within(row).getByRole('group', { name: 'packing.packedCount:1,3' })).toBeInTheDocument()- fireEvent.click(within(row).getByRole('button', { name: 'packing.packedMore' }))- expect(planner.tripActions.setPackedCount).toHaveBeenCalledWith(3, 3, 2)- fireEvent.click(within(row).getByRole('button', { name: 'packing.packedLess' }))- expect(planner.tripActions.setPackedCount).toHaveBeenCalledWith(3, 3, 0)-- view.unmount()- await setup({ items: [socks], planner: { can: vi.fn(() => false) } })- expect(within(itemRow('Socks')).getByText('1/3')).toBeInTheDocument()- expect(screen.queryByRole('button', { name: 'packing.packedMore' })).not.toBeInTheDocument()- })-- it('FE-MOB-PACKTAB-070: on a wide window the categories stand in columns, each card whole', async () => {+ it('FE-MOB-PACKTAB-057: on a wide window the lists stand in columns, each card whole', async () => {await setup()- const card = screen.getAllByRole('button', { expanded: true })[0].parentElement as HTMLElement- expect(card.className).toContain('wide:break-inside-avoid')- expect(card.className).toContain('wide:inline-block')- expect((card.parentElement as HTMLElement).className).toContain('wide:columns-[300px]')- })- it('FE-MOB-PACKTAB-071: the list menu moves the whole list to my list, one write per item (#2961)', async () => {- const { planner } = await setup({ planner: { tripMembers: [ANNA, BEN] } })- enterEditMode()-- openCategoryMenu('Documents')- fireEvent.click(screen.getByRole('button', { name: 'packing.menuShareCat' }))- const sheet = screen.getByRole('dialog', { name: 'packing.menuShareCat' })- fireEvent.click(within(sheet).getByRole('button', { name: /^packing.tierPersonal/ }))- await act(async () => { fireEvent.click(within(sheet).getByRole('button', { name: 'packing.shareCat.apply' })) })-- expect(asMock(planner.tripActions.setPackingItemSharing).mock.calls).toEqual([- [3, 1, 'personal', []],- [3, 2, 'personal', []],- ])- expect(planner.toast.success).toHaveBeenCalledWith(expect.stringContaining('packing.shareCat.done'))+ const listCard = card('Documents')+ expect(listCard.className).toContain('wide:break-inside-avoid')+ expect(listCard.className).toContain('wide:inline-block')+ expect((listCard.parentElement as HTMLElement).className).toContain('wide:columns-[300px]')})})diff --git a/shared/src/i18n/ar/packing.ts b/shared/src/i18n/ar/packing.tsindex 0112f0dfd..080efb050 100644--- a/shared/src/i18n/ar/packing.ts+++ b/shared/src/i18n/ar/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'خيارات القائمة','packing.editItem': 'تعديل العنصر','packing.itemName': 'الاسم',- 'packing.itemQuantity': 'الكمية','packing.packedCount': 'تم حزم {packed} من {total}','packing.packedMore': 'حزم قطعة أخرى','packing.packedLess': 'حزم قطعة أقل',- 'packing.itemWeight': 'الوزن (غ)','packing.title': 'قائمة التجهيز','packing.empty': 'قائمة التجهيز فارغة','packing.import': 'استيراد',@@ -63,7 +61,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'الكل','packing.filterOpen': 'مفتوح','packing.filterDone': 'تم',- 'packing.sortBy': 'ترتيب حسب','packing.sortByName': 'أ إلى ي','packing.emptyTitle': 'قائمة التجهيز فارغة','packing.emptyFiltered': 'لا توجد عناصر مطابقة لهذا الفلتر',@@ -105,7 +102,6 @@ const packing: TranslationStrings = {'packing.quantity': 'الكمية','packing.bagName': 'الاسم...','packing.addBag': 'إضافة أمتعة',- 'packing.changeCategory': 'نقل إلى قائمة','packing.confirm.clearChecked': 'هل تريد إزالة {count} عنصر محدد؟','packing.confirm.clearChecked.zero': 'لا توجد عناصر محددة لإزالتها.','packing.confirm.clearChecked.one': 'هل تريد إزالة العنصر المحدد؟',@@ -129,7 +125,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'خاص — مرئي لك فقط','packing.viewCommon': 'مشترك','packing.viewPersonal': 'قائمتي',- 'packing.share': 'المشاركة','packing.tierCommonHint': 'في مجموعة الفريق، مرئي للجميع','packing.tierPersonal': 'شخصي','packing.tierPersonalHint': 'خاص — أنت فقط تراه',@@ -144,10 +139,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.many': 'مشترك مع {count} شخصًا','packing.broughtBy': 'يحضره {name}','packing.bringersTitle': 'يحضره',- 'packing.alsoBring': 'يمكنني إحضاره أيضًا',- 'packing.alsoBringingStop': 'لن أحضره','packing.cloneToMine': 'نسخ إلى قائمتي','packing.bagLimit': 'حد الوزن','packing.setBagLimit': 'تعيين حد',+ 'packing.hideDone': 'إخفاء ما تم حزمه',+ 'packing.detail.list': 'القائمة',+ 'packing.detail.bag': 'الحقيبة',+ 'packing.detail.visibility': 'مرئي لـ',+ 'packing.visibility.me': 'أنا فقط',+ 'packing.visibility.some': 'أشخاص محددون',+ 'packing.bringersNobody': 'لا أحد بعد',+ 'packing.quantityLess': 'واحد أقل',+ 'packing.quantityMore': 'واحد أكثر',};export default packing;diff --git a/shared/src/i18n/az/packing.ts b/shared/src/i18n/az/packing.tsindex eaa63bcb5..1e7c0be65 100644--- a/shared/src/i18n/az/packing.ts+++ b/shared/src/i18n/az/packing.ts@@ -9,11 +9,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Siyahı seçimləri','packing.editItem': 'Elementi redaktə et','packing.itemName': 'Ad',- 'packing.itemQuantity': 'Say','packing.packedCount': '{total} ədəddən {packed} yığılıb','packing.packedMore': 'Bir ədəd çox yığ','packing.packedLess': 'Bir ədəd az yığ',- 'packing.itemWeight': 'Çəki (qram)','packing.title': 'Baqaj siyahısı','packing.empty': 'Baqaj siyahısı boşdur',@@ -52,7 +50,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Hamısı','packing.filterOpen': 'Hazır deyil','packing.filterDone': 'Hazırdır',- 'packing.sortBy': 'Sıralama','packing.sortByName': 'A-dan Z-yə','packing.emptyTitle': 'Baqaj siyahısı boşdur',@@ -98,14 +95,12 @@ const packing: TranslationStrings = {'packing.quantity': 'Say','packing.bagName': 'Çantanın adı...','packing.addBag': 'Çanta əlavə et',- 'packing.changeCategory': 'Siyahıya köçür','packing.makePrivate': 'Şəxsi et','packing.makePublic': 'Paylaşılan et','packing.privateHint': 'Şəxsi — yalnız sizə görünür','packing.viewCommon': 'Paylaşılan','packing.viewPersonal': 'Mənim siyahım',- 'packing.share': 'Paylaşım','packing.tierCommonHint': 'Ümumi siyahıdadır və hər kəsə görünür','packing.tierPersonal': 'Şəxsi','packing.tierPersonalHint': 'Şəxsi — yalnız siz görə bilərsiniz',@@ -117,8 +112,6 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': '{count} nəfərlə paylaşılıb','packing.broughtBy': '{name} gətirir','packing.bringersTitle': 'Gətirənlər',- 'packing.alsoBring': 'Mən də bunu gətirə bilərəm',- 'packing.alsoBringingStop': 'Mən bunu gətirməyəcəyəm','packing.cloneToMine': 'Mənim siyahıma köçür','packing.confirm.clearChecked': 'İşarələnmiş {count} elementi silmək istədiyinizə əminsiniz?',@@ -137,6 +130,15 @@ const packing: TranslationStrings = {'packing.bagLimit': 'Çəki limiti','packing.setBagLimit': 'Limit təyin et',+ 'packing.hideDone': 'Yığılanları gizlət',+ 'packing.detail.list': 'Siyahı',+ 'packing.detail.bag': 'Çanta',+ 'packing.detail.visibility': 'Görə bilənlər',+ 'packing.visibility.me': 'Yalnız mən',+ 'packing.visibility.some': 'Seçilənlər',+ 'packing.bringersNobody': 'Hələ heç kim',+ 'packing.quantityLess': 'Bir ədəd az',+ 'packing.quantityMore': 'Bir ədəd çox',};export default packing;diff --git a/shared/src/i18n/br/packing.ts b/shared/src/i18n/br/packing.tsindex 91dc3eeb4..c9ee45524 100644--- a/shared/src/i18n/br/packing.ts+++ b/shared/src/i18n/br/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Opções da lista','packing.editItem': 'Editar item','packing.itemName': 'Nome',- 'packing.itemQuantity': 'Quantidade','packing.packedCount': '{packed} de {total} na mala','packing.packedMore': 'Pôr mais um na mala','packing.packedLess': 'Tirar um da mala',- 'packing.itemWeight': 'Peso (g)','packing.title': 'Lista de mala','packing.empty': 'A lista de mala está vazia','packing.import': 'Importar',@@ -49,7 +47,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Todos','packing.filterOpen': 'Abertos','packing.filterDone': 'Prontos',- 'packing.sortBy': 'Ordenar por','packing.sortByName': 'A a Z','packing.emptyTitle': 'A lista de mala está vazia','packing.emptyFiltered': 'Nenhum item corresponde ao filtro',@@ -87,7 +84,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Qtd.','packing.bagName': 'Nome da mala...','packing.addBag': 'Adicionar mala',- 'packing.changeCategory': 'Mover para lista','packing.confirm.clearChecked': 'Remover {count} itens marcados?','packing.confirm.clearChecked.one': 'Remover {count} item marcado?','packing.confirm.deleteCat': 'Tem certeza de que deseja excluir a lista "{name}" com {count} itens?',@@ -103,7 +99,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Privado — visível apenas para você','packing.viewCommon': 'Compartilhado','packing.viewPersonal': 'Minha lista',- 'packing.share': 'Compartilhar','packing.tierCommonHint': 'No grupo, visível para todos','packing.tierPersonal': 'Pessoal','packing.tierPersonalHint': 'Privado — só você vê',@@ -114,10 +109,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'compartilhado com {count}','packing.broughtBy': 'trazido por {name}','packing.bringersTitle': 'Quem leva',- 'packing.alsoBring': 'Eu também posso levar',- 'packing.alsoBringingStop': 'Não vou levar','packing.cloneToMine': 'Copiar para minha lista','packing.bagLimit': 'Limite de peso','packing.setBagLimit': 'Definir limite',+ 'packing.hideDone': 'Ocultar o que já está na mala',+ 'packing.detail.list': 'Lista',+ 'packing.detail.bag': 'Mala',+ 'packing.detail.visibility': 'Visível para',+ 'packing.visibility.me': 'Só eu',+ 'packing.visibility.some': 'Seleção',+ 'packing.bringersNobody': 'Ninguém ainda',+ 'packing.quantityLess': 'Um a menos',+ 'packing.quantityMore': 'Um a mais',};export default packing;diff --git a/shared/src/i18n/ca/packing.ts b/shared/src/i18n/ca/packing.tsindex b0b7e4a52..0369598ef 100644--- a/shared/src/i18n/ca/packing.ts+++ b/shared/src/i18n/ca/packing.ts@@ -35,7 +35,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Tot','packing.filterOpen': 'Pendents','packing.filterDone': 'Fet',- 'packing.sortBy': 'Ordena per','packing.sortByName': 'A a Z','packing.emptyTitle': "La llista d'equipatge és buida",'packing.emptyFiltered': 'Cap element coincideix amb aquest filtre',@@ -75,7 +74,6 @@ const packing: TranslationStrings = {'packing.perPersonSharedHint': "Inclou la part d'una bossa que porten diverses persones, repartida a parts iguals",'packing.bagName': 'Nom...','packing.addBag': 'Afegeix equipatge',- 'packing.changeCategory': 'Canvia la categoria','packing.confirm.clearChecked': 'Segur que vols eliminar {count} elements marcats?','packing.confirm.clearChecked.one': 'Segur que vols eliminar {count} element marcat?','packing.confirm.deleteCat': 'Segur que vols eliminar la categoria "{name}" amb {count} elements?',@@ -92,7 +90,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Privat — només visible per a tu','packing.viewCommon': 'Compartit','packing.viewPersonal': 'La meva llista',- 'packing.share': 'Compartir','packing.tierCommonHint': 'Al fons comú del grup, visible per a tothom','packing.tierPersonal': 'Personal', // same-as-en'packing.tierPersonalHint': 'Privat — només tu ho pots veure',@@ -103,8 +100,6 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'compartit amb {count}','packing.broughtBy': 'portat per {name}','packing.bringersTitle': 'Ho porta',- 'packing.alsoBring': 'Jo també puc portar això',- 'packing.alsoBringingStop': 'Ja no ho porto','packing.cloneToMine': 'Copiar a la meva llista','packing.quantity': 'Quant.','packing.actions': 'Accions',@@ -115,12 +110,19 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Opcions de la llista','packing.editItem': "Edita l'element",'packing.itemName': 'Nom',- 'packing.itemQuantity': 'Quantitat','packing.packedCount': '{packed} de {total} preparats','packing.packedMore': 'Prepara’n un més','packing.packedLess': 'Prepara’n un menys',- 'packing.itemWeight': 'Pes (g)','packing.bagLimit': 'Límit de pes','packing.setBagLimit': 'Defineix un límit',+ 'packing.hideDone': "Amaga el que s'ha empaquetat",+ 'packing.detail.list': 'Llista',+ 'packing.detail.bag': 'Bossa',+ 'packing.detail.visibility': 'Visible per a',+ 'packing.visibility.me': 'Només jo',+ 'packing.visibility.some': 'Selecció',+ 'packing.bringersNobody': 'Encara ningú',+ 'packing.quantityLess': 'Un menys',+ 'packing.quantityMore': 'Un més',};export default packing;diff --git a/shared/src/i18n/cs/packing.ts b/shared/src/i18n/cs/packing.tsindex 64abd0ee6..ac3d13885 100644--- a/shared/src/i18n/cs/packing.ts+++ b/shared/src/i18n/cs/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Možnosti seznamu','packing.editItem': 'Upravit položku','packing.itemName': 'Název',- 'packing.itemQuantity': 'Množství','packing.packedCount': '{packed} z {total} zabaleno','packing.packedMore': 'Zabalit o jeden víc','packing.packedLess': 'Zabalit o jeden méně',- 'packing.itemWeight': 'Hmotnost (g)','packing.title': 'Seznam věcí','packing.empty': 'Seznam věcí je prázdný','packing.import': 'Importovat',@@ -51,7 +49,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Vše','packing.filterOpen': 'K zabalení','packing.filterDone': 'Hotovo',- 'packing.sortBy': 'Seřadit podle','packing.sortByName': 'A až Z','packing.emptyTitle': 'Seznam věcí je prázdný','packing.emptyFiltered': 'Žádné položky neodpovídají filtru',@@ -91,7 +88,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Počet','packing.bagName': 'Název zavazadla...','packing.addBag': 'Přidat zavazadlo',- 'packing.changeCategory': 'Přesunout do seznamu','packing.confirm.clearChecked': 'Opravdu chcete odstranit {count} zabalených položek?','packing.confirm.clearChecked.one': 'Opravdu chcete odstranit {count} zabalenou položku?','packing.confirm.clearChecked.few': 'Opravdu chcete odstranit {count} zabalené položky?',@@ -109,7 +105,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Soukromé — vidíte jen vy','packing.viewCommon': 'Sdílené','packing.viewPersonal': 'Můj seznam',- 'packing.share': 'Sdílení','packing.tierCommonHint': 'Ve společném fondu, viditelné pro všechny','packing.tierPersonal': 'Osobní','packing.tierPersonalHint': 'Soukromé — vidíte jen vy',@@ -121,10 +116,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.few': 'sdíleno s {count} osobami','packing.broughtBy': 'přináší {name}','packing.bringersTitle': 'Přinese',- 'packing.alsoBring': 'Můžu to vzít taky',- 'packing.alsoBringingStop': 'Neberu to','packing.cloneToMine': 'Kopírovat do mého seznamu','packing.bagLimit': 'Hmotnostní limit','packing.setBagLimit': 'Nastavit limit',+ 'packing.hideDone': 'Skrýt zabalené',+ 'packing.detail.list': 'Seznam',+ 'packing.detail.bag': 'Taška',+ 'packing.detail.visibility': 'Viditelné pro',+ 'packing.visibility.me': 'Jen já',+ 'packing.visibility.some': 'Výběr',+ 'packing.bringersNobody': 'Zatím nikdo',+ 'packing.quantityLess': 'O jeden méně',+ 'packing.quantityMore': 'O jeden více',};export default packing;diff --git a/shared/src/i18n/de/packing.ts b/shared/src/i18n/de/packing.tsindex a716dbacf..7de055e2b 100644--- a/shared/src/i18n/de/packing.ts+++ b/shared/src/i18n/de/packing.ts@@ -9,11 +9,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Listenoptionen','packing.editItem': 'Objekt bearbeiten','packing.itemName': 'Name', // same-as-en- 'packing.itemQuantity': 'Menge','packing.packedCount': '{packed} von {total} gepackt','packing.packedMore': 'Eins mehr packen','packing.packedLess': 'Eins weniger packen',- 'packing.itemWeight': 'Gewicht (g)','packing.title': 'Packliste','packing.empty': 'Packliste ist leer','packing.import': 'Importieren',@@ -48,7 +46,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Alle','packing.filterOpen': 'Offen','packing.filterDone': 'Erledigt',- 'packing.sortBy': 'Sortieren nach','packing.sortByName': 'A bis Z','packing.emptyTitle': 'Packliste ist leer','packing.emptyFiltered': 'Keine Gegenstände in diesem Filter',@@ -89,13 +86,11 @@ const packing: TranslationStrings = {'packing.quantity': 'Menge','packing.bagName': 'Name...','packing.addBag': 'Gepäck hinzufügen',- 'packing.changeCategory': 'In Liste verschieben','packing.makePrivate': 'Privat machen','packing.makePublic': 'Teilen','packing.privateHint': 'Privat — nur für dich sichtbar','packing.viewCommon': 'Gemeinsam','packing.viewPersonal': 'Meine Liste',- 'packing.share': 'Teilen','packing.tierCommonHint': 'Im Gruppen-Pool, für alle sichtbar','packing.tierPersonal': 'Persönlich','packing.tierPersonalHint': 'Privat — nur du siehst es',@@ -106,8 +101,6 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'geteilt mit {count}','packing.broughtBy': 'bringt {name}','packing.bringersTitle': 'Bringt mit',- 'packing.alsoBring': 'Bring ich auch mit',- 'packing.alsoBringingStop': 'Bring ich doch nicht mit','packing.cloneToMine': 'In meine Liste kopieren','packing.confirm.clearChecked': 'Möchtest du {count} abgehakte Gegenstände wirklich entfernen?','packing.confirm.clearChecked.one': 'Möchtest du {count} abgehakten Gegenstand wirklich entfernen?',@@ -121,5 +114,14 @@ const packing: TranslationStrings = {'packing.toast.addError': 'Fehler beim Hinzufügen','packing.bagLimit': 'Gewichtslimit','packing.setBagLimit': 'Limit setzen',+ 'packing.hideDone': 'Gepacktes ausblenden',+ 'packing.detail.list': 'Liste',+ 'packing.detail.bag': 'Tasche',+ 'packing.detail.visibility': 'Sichtbar für',+ 'packing.visibility.me': 'Nur ich',+ 'packing.visibility.some': 'Auswahl',+ 'packing.bringersNobody': 'Noch niemand',+ 'packing.quantityLess': 'Eins weniger',+ 'packing.quantityMore': 'Eins mehr',};export default packing;diff --git a/shared/src/i18n/en/packing.ts b/shared/src/i18n/en/packing.tsindex 8a650d6e6..eaa35fe27 100644--- a/shared/src/i18n/en/packing.ts+++ b/shared/src/i18n/en/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'List options','packing.editItem': 'Edit item','packing.itemName': 'Name',- 'packing.itemQuantity': 'Quantity','packing.packedCount': '{packed} of {total} packed','packing.packedMore': 'Pack one more','packing.packedLess': 'Pack one less',- 'packing.itemWeight': 'Weight (g)','packing.title': 'Packing List','packing.empty': 'Packing list is empty','packing.import': 'Import',@@ -47,7 +45,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'All','packing.filterOpen': 'Open','packing.filterDone': 'Done',- 'packing.sortBy': 'Sort by','packing.sortByName': 'A to Z','packing.emptyTitle': 'Packing list is empty','packing.emptyFiltered': 'No items match this filter',@@ -85,13 +82,11 @@ const packing: TranslationStrings = {'packing.quantity': 'Qty','packing.bagName': 'Bag name...','packing.addBag': 'Add bag',- 'packing.changeCategory': 'Move to List','packing.makePrivate': 'Make private','packing.makePublic': 'Make shared','packing.privateHint': 'Private — only visible to you','packing.viewCommon': 'Shared','packing.viewPersonal': 'My list',- 'packing.share': 'Sharing','packing.tierCommonHint': 'In the group pool, visible to everyone','packing.tierPersonal': 'Personal','packing.tierPersonalHint': 'Private — only you can see it',@@ -102,8 +97,6 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'shared with {count}','packing.broughtBy': 'brought by {name}','packing.bringersTitle': 'Brought by',- 'packing.alsoBring': 'I can bring that too',- 'packing.alsoBringingStop': "I'm not bringing it",'packing.cloneToMine': 'Copy to my list','packing.confirm.clearChecked': 'Are you sure you want to remove {count} checked items?','packing.confirm.clearChecked.one': 'Are you sure you want to remove {count} checked item?',@@ -117,5 +110,14 @@ const packing: TranslationStrings = {'packing.toast.addError': 'Failed to add','packing.bagLimit': 'Weight limit','packing.setBagLimit': 'Set limit',+ 'packing.hideDone': 'Hide packed',+ 'packing.detail.list': 'List',+ 'packing.detail.bag': 'Bag',+ 'packing.detail.visibility': 'Visible to',+ 'packing.visibility.me': 'Only me',+ 'packing.visibility.some': 'Selected',+ 'packing.bringersNobody': 'Nobody yet',+ 'packing.quantityLess': 'One less',+ 'packing.quantityMore': 'One more',};export default packing;diff --git a/shared/src/i18n/es/packing.ts b/shared/src/i18n/es/packing.tsindex 672d2ae8e..4c434d9b5 100644--- a/shared/src/i18n/es/packing.ts+++ b/shared/src/i18n/es/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Opciones de la lista','packing.editItem': 'Editar objeto','packing.itemName': 'Nombre',- 'packing.itemQuantity': 'Cantidad','packing.packedCount': '{packed} de {total} preparados','packing.packedMore': 'Preparar uno más','packing.packedLess': 'Preparar uno menos',- 'packing.itemWeight': 'Peso (g)','packing.title': 'Lista de equipaje','packing.empty': 'La lista de equipaje está vacía','packing.import': 'Importar',@@ -47,7 +45,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Todo','packing.filterOpen': 'Pendientes','packing.filterDone': 'Hecho',- 'packing.sortBy': 'Ordenar por','packing.sortByName': 'A a Z','packing.emptyTitle': 'La lista de equipaje está vacía','packing.emptyFiltered': 'Ningún elemento coincide con este filtro',@@ -88,7 +85,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Cant.','packing.bagName': 'Nombre...','packing.addBag': 'Añadir equipaje',- 'packing.changeCategory': 'Mover a lista','packing.confirm.clearChecked': '¿Seguro que quieres eliminar {count} elementos marcados?','packing.confirm.clearChecked.one': '¿Seguro que quieres eliminar {count} elemento marcado?','packing.confirm.deleteCat': '¿Seguro que quieres eliminar la lista "{name}" con {count} elementos?',@@ -104,7 +100,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Privado — solo visible para ti','packing.viewCommon': 'Compartido','packing.viewPersonal': 'Mi lista',- 'packing.share': 'Compartir','packing.tierCommonHint': 'En el grupo, visible para todos','packing.tierPersonal': 'Personal', // same-as-en'packing.tierPersonalHint': 'Privado — solo tú lo ves',@@ -115,10 +110,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'compartido con {count}','packing.broughtBy': 'lo trae {name}','packing.bringersTitle': 'Lo lleva',- 'packing.alsoBring': 'Yo también puedo llevarlo',- 'packing.alsoBringingStop': 'No lo llevo','packing.cloneToMine': 'Copiar a mi lista','packing.bagLimit': 'Límite de peso','packing.setBagLimit': 'Definir límite',+ 'packing.hideDone': 'Ocultar lo empacado',+ 'packing.detail.list': 'Lista',+ 'packing.detail.bag': 'Bolsa',+ 'packing.detail.visibility': 'Visible para',+ 'packing.visibility.me': 'Solo yo',+ 'packing.visibility.some': 'Selección',+ 'packing.bringersNobody': 'Nadie aún',+ 'packing.quantityLess': 'Uno menos',+ 'packing.quantityMore': 'Uno más',};export default packing;diff --git a/shared/src/i18n/et/packing.ts b/shared/src/i18n/et/packing.tsindex d643b41ce..55274dbc5 100644--- a/shared/src/i18n/et/packing.ts+++ b/shared/src/i18n/et/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Nimekirja valikud','packing.editItem': 'Muuda eset','packing.itemName': 'Nimi',- 'packing.itemQuantity': 'Kogus','packing.packedCount': '{packed} / {total} pakitud','packing.packedMore': 'Paki üks rohkem','packing.packedLess': 'Paki üks vähem',- 'packing.itemWeight': 'Kaal (g)','packing.title': 'Pakkimisnimekiri','packing.empty': 'Pakkimisnimekiri on tühi','packing.import': 'Impordi',@@ -47,7 +45,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Kõik','packing.filterOpen': 'Pakkimata','packing.filterDone': 'Pakitud',- 'packing.sortBy': 'Sordi','packing.sortByName': 'A kuni Ü','packing.emptyTitle': 'Pakkimisnimekiri on tühi','packing.emptyFiltered': 'Ükski ese ei vasta sellele filtrile',@@ -86,13 +83,11 @@ const packing: TranslationStrings = {'packing.quantity': 'Kogus','packing.bagName': 'Koti nimi...','packing.addBag': 'Lisa kott',- 'packing.changeCategory': 'Teisalda nimekirja','packing.makePrivate': 'Muuda privaatseks','packing.makePublic': 'Muuda ühiseks','packing.privateHint': 'Privaatne — nähtav ainult sulle','packing.viewCommon': 'Ühine','packing.viewPersonal': 'Minu nimekiri',- 'packing.share': 'Jagamine','packing.tierCommonHint': 'Rühma ühises nimekirjas, kõigile nähtav','packing.tierPersonal': 'Isiklik','packing.tierPersonalHint': 'Privaatne — ainult sina näed seda',@@ -103,8 +98,6 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'jagatud {count} inimesega','packing.broughtBy': 'toob {name}','packing.bringersTitle': 'Toob kaasa',- 'packing.alsoBring': 'Võin selle ka kaasa võtta',- 'packing.alsoBringingStop': 'Ma ei võta seda kaasa','packing.cloneToMine': 'Kopeeri minu nimekirja','packing.confirm.clearChecked': 'Kas soovid kindlasti eemaldada {count} märgitud eset?','packing.confirm.clearChecked.one': 'Kas soovid kindlasti eemaldada {count} märgitud eseme?',@@ -118,5 +111,14 @@ const packing: TranslationStrings = {'packing.toast.addError': 'Lisamine ebaõnnestus','packing.bagLimit': 'Kaalupiirang','packing.setBagLimit': 'Määra piirang',+ 'packing.hideDone': 'Peida pakitud',+ 'packing.detail.list': 'Nimekiri',+ 'packing.detail.bag': 'Kott',+ 'packing.detail.visibility': 'Nähtav',+ 'packing.visibility.me': 'Ainult mina',+ 'packing.visibility.some': 'Valik',+ 'packing.bringersNobody': 'Veel mitte keegi',+ 'packing.quantityLess': 'Üks vähem',+ 'packing.quantityMore': 'Üks rohkem',};export default packing;diff --git a/shared/src/i18n/fr/packing.ts b/shared/src/i18n/fr/packing.tsindex 3417e2bde..50348534e 100644--- a/shared/src/i18n/fr/packing.ts+++ b/shared/src/i18n/fr/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Options de la liste','packing.editItem': "Modifier l'élément",'packing.itemName': 'Nom',- 'packing.itemQuantity': 'Quantité','packing.packedCount': '{packed} sur {total} emballés','packing.packedMore': 'Emballer un de plus','packing.packedLess': 'Emballer un de moins',- 'packing.itemWeight': 'Poids (g)','packing.title': 'Liste de bagages','packing.empty': 'La liste de bagages est vide','packing.import': 'Importer',@@ -47,7 +45,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Tous','packing.filterOpen': 'À faire','packing.filterDone': 'Fait',- 'packing.sortBy': 'Trier par','packing.sortByName': 'A à Z','packing.emptyTitle': 'La liste de bagages est vide','packing.emptyFiltered': 'Aucun article ne correspond à ce filtre',@@ -88,7 +85,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Qté','packing.bagName': 'Nom...','packing.addBag': 'Ajouter un bagage',- 'packing.changeCategory': 'Déplacer vers une liste','packing.confirm.clearChecked': 'Voulez-vous vraiment supprimer {count} articles cochés ?','packing.confirm.clearChecked.one': 'Voulez-vous vraiment supprimer {count} article coché ?','packing.confirm.deleteCat': 'Voulez-vous vraiment supprimer la liste « {name} » contenant {count} éléments ?',@@ -104,7 +100,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Privé — visible par vous uniquement','packing.viewCommon': 'Partagé','packing.viewPersonal': 'Ma liste',- 'packing.share': 'Partage','packing.tierCommonHint': 'Dans le groupe, visible par tous','packing.tierPersonal': 'Personnel','packing.tierPersonalHint': 'Privé — vous seul le voyez',@@ -115,10 +110,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'partagé avec {count}','packing.broughtBy': 'apporté par {name}','packing.bringersTitle': 'Apporté par',- 'packing.alsoBring': "Je peux l'apporter aussi",- 'packing.alsoBringingStop': "Je ne l'apporte pas",'packing.cloneToMine': 'Copier dans ma liste','packing.bagLimit': 'Limite de poids','packing.setBagLimit': 'Définir une limite',+ 'packing.hideDone': 'Masquer les objets emballés',+ 'packing.detail.list': 'Liste',+ 'packing.detail.bag': 'Sac',+ 'packing.detail.visibility': 'Visible par',+ 'packing.visibility.me': 'Moi seul',+ 'packing.visibility.some': 'Sélection',+ 'packing.bringersNobody': 'Personne pour l’instant',+ 'packing.quantityLess': 'Un de moins',+ 'packing.quantityMore': 'Un de plus',};export default packing;diff --git a/shared/src/i18n/gr/packing.ts b/shared/src/i18n/gr/packing.tsindex d44f5021c..9267dee02 100644--- a/shared/src/i18n/gr/packing.ts+++ b/shared/src/i18n/gr/packing.ts@@ -9,11 +9,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Επιλογές λίστας','packing.editItem': 'Επεξεργασία στοιχείου','packing.itemName': 'Όνομα',- 'packing.itemQuantity': 'Ποσότητα','packing.packedCount': '{packed} από {total} πακεταρισμένα','packing.packedMore': 'Πακετάρισμα ενός ακόμη','packing.packedLess': 'Πακετάρισμα ενός λιγότερου',- 'packing.itemWeight': 'Βάρος (γρ)','packing.title': 'Λίστα Αποσκευών','packing.empty': 'Η λίστα αποσκευών είναι κενή','packing.import': 'Εισαγωγή',@@ -48,7 +46,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Όλα','packing.filterOpen': 'Ανοιχτά','packing.filterDone': 'Ολοκληρωμένα',- 'packing.sortBy': 'Ταξινόμηση κατά','packing.sortByName': 'Α έως Ω','packing.emptyTitle': 'Η λίστα αποσκευών είναι κενή','packing.emptyFiltered': 'Κανένα αντικείμενο δεν ταιριάζει με αυτό το φίλτρο',@@ -89,7 +86,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Ποσ.','packing.bagName': 'Όνομα τσάντας...','packing.addBag': 'Προσθήκη τσάντας',- 'packing.changeCategory': 'Μετακίνηση σε λίστα','packing.confirm.clearChecked': 'Είστε σίγουροι ότι θέλετε να αφαιρέσετε {count} επιλεγμένα αντικείμενα;','packing.confirm.clearChecked.one': 'Είστε σίγουροι ότι θέλετε να αφαιρέσετε {count} επιλεγμένο αντικείμενο;','packing.confirm.deleteCat': 'Είστε βέβαιοι ότι θέλετε να διαγράψετε τη λίστα "{name}" με {count} στοιχεία;',@@ -105,7 +101,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Ιδιωτικό — ορατό μόνο σε εσάς','packing.viewCommon': 'Κοινό','packing.viewPersonal': 'Η λίστα μου',- 'packing.share': 'Κοινή χρήση','packing.tierCommonHint': 'Στην ομάδα, ορατό σε όλους','packing.tierPersonal': 'Προσωπικό','packing.tierPersonalHint': 'Ιδιωτικό — μόνο εσείς το βλέπετε',@@ -116,10 +111,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'κοινό με {count} άτομο','packing.broughtBy': 'φέρνει ο/η {name}','packing.bringersTitle': 'Το φέρνει',- 'packing.alsoBring': 'Μπορώ να το φέρω κι εγώ',- 'packing.alsoBringingStop': 'Δεν το φέρνω','packing.cloneToMine': 'Αντιγραφή στη λίστα μου','packing.bagLimit': 'Όριο βάρους','packing.setBagLimit': 'Ορισμός ορίου',+ 'packing.hideDone': 'Απόκρυψη πακεταρισμένων',+ 'packing.detail.list': 'Λίστα',+ 'packing.detail.bag': 'Τσάντα',+ 'packing.detail.visibility': 'Ορατό σε',+ 'packing.visibility.me': 'Μόνο εγώ',+ 'packing.visibility.some': 'Επιλεγμένοι',+ 'packing.bringersNobody': 'Κανείς ακόμη',+ 'packing.quantityLess': 'Ένα λιγότερο',+ 'packing.quantityMore': 'Ένα ακόμη',};export default packing;diff --git a/shared/src/i18n/he/packing.ts b/shared/src/i18n/he/packing.tsindex 4fcd52b5d..3e4f9556e 100644--- a/shared/src/i18n/he/packing.ts+++ b/shared/src/i18n/he/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'אפשרויות רשימה','packing.editItem': 'עריכת פריט','packing.itemName': 'שם',- 'packing.itemQuantity': 'כמות','packing.packedCount': '{packed} מתוך {total} נארזו','packing.packedMore': 'לארוז עוד אחד','packing.packedLess': 'לארוז אחד פחות',- 'packing.itemWeight': 'משקל (גרם)','packing.title': 'רשימת אריזה','packing.empty': 'רשימת האריזה ריקה','packing.import': 'ייבוא',@@ -51,7 +49,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'הכל','packing.filterOpen': 'פתוחים','packing.filterDone': 'ארוזים',- 'packing.sortBy': 'מיון לפי','packing.sortByName': 'א עד ת','packing.emptyTitle': 'רשימת האריזה ריקה','packing.emptyFiltered': 'אין פריטים שתואמים לסינון',@@ -90,13 +87,11 @@ const packing: TranslationStrings = {'packing.quantity': 'כמות','packing.bagName': 'שם התיק...','packing.addBag': 'הוספת תיק',- 'packing.changeCategory': 'העברה לרשימה','packing.makePrivate': 'הפיכה לפרטי','packing.makePublic': 'הפיכה למשותף','packing.privateHint': 'פרטי — גלוי רק לכם','packing.viewCommon': 'משותף','packing.viewPersonal': 'הרשימה שלי',- 'packing.share': 'שיתוף','packing.tierCommonHint': 'במאגר הקבוצתי, גלוי לכולם','packing.tierPersonal': 'אישי','packing.tierPersonalHint': 'פרטי — רק אתם רואים',@@ -108,8 +103,6 @@ const packing: TranslationStrings = {'packing.sharedWithCount.two': 'משותף עם שני אנשים','packing.broughtBy': '{name} מביא/ה','packing.bringersTitle': 'מביאים',- 'packing.alsoBring': 'גם אני יכול/ה להביא',- 'packing.alsoBringingStop': 'אני לא מביא/ה','packing.cloneToMine': 'העתקה לרשימה שלי','packing.confirm.clearChecked': 'להסיר {count} פריטים מסומנים?','packing.confirm.clearChecked.one': 'האם להסיר את הפריט המסומן?',@@ -125,6 +118,15 @@ const packing: TranslationStrings = {'packing.toast.addError': 'ההוספה נכשלה','packing.bagLimit': 'מגבלת משקל','packing.setBagLimit': 'הגדרת מגבלה',+ 'packing.hideDone': 'הסתרת פריטים ארוזים',+ 'packing.detail.list': 'רשימה',+ 'packing.detail.bag': 'תיק',+ 'packing.detail.visibility': 'גלוי ל',+ 'packing.visibility.me': 'רק אני',+ 'packing.visibility.some': 'נבחרים',+ 'packing.bringersNobody': 'עדיין אף אחד',+ 'packing.quantityLess': 'אחד פחות',+ 'packing.quantityMore': 'אחד יותר',};export default packing;diff --git a/shared/src/i18n/hu/packing.ts b/shared/src/i18n/hu/packing.tsindex 20f2f0cd4..423cdfb35 100644--- a/shared/src/i18n/hu/packing.ts+++ b/shared/src/i18n/hu/packing.ts@@ -9,11 +9,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Lista beállításai','packing.editItem': 'Elem szerkesztése','packing.itemName': 'Név',- 'packing.itemQuantity': 'Mennyiség','packing.packedCount': '{packed} / {total} becsomagolva','packing.packedMore': 'Eggyel több becsomagolása','packing.packedLess': 'Eggyel kevesebb becsomagolása',- 'packing.itemWeight': 'Súly (g)','packing.title': 'Csomagolási lista','packing.empty': 'A csomagolási lista üres','packing.import': 'Importálás',@@ -48,7 +46,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Összes','packing.filterOpen': 'Nyitott','packing.filterDone': 'Kész',- 'packing.sortBy': 'Rendezés','packing.sortByName': 'A-tól Z-ig','packing.emptyTitle': 'A csomagolási lista üres','packing.emptyFiltered': 'Nincs elem ebben a szűrőben',@@ -87,7 +84,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Menny.','packing.bagName': 'Táska neve...','packing.addBag': 'Táska hozzáadása',- 'packing.changeCategory': 'Áthelyezés listába','packing.confirm.clearChecked': 'Biztosan el szeretnéd távolítani a kipipált {count} tárgyat?','packing.confirm.clearChecked.one': 'Biztosan el szeretnéd távolítani a kipipált tárgyat?','packing.confirm.deleteCat': 'Biztosan törölni szeretnéd a(z) „{name}” listát a benne lévő {count} elemmel együtt?',@@ -104,7 +100,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Privát — csak Ön látja','packing.viewCommon': 'Megosztott','packing.viewPersonal': 'Saját lista',- 'packing.share': 'Megosztás','packing.tierCommonHint': 'A csoportban, mindenki láthatja','packing.tierPersonal': 'Személyes','packing.tierPersonalHint': 'Privát — csak Ön látja',@@ -115,10 +110,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'megosztva {count} fővel','packing.broughtBy': 'hozza: {name}','packing.bringersTitle': 'Hozza',- 'packing.alsoBring': 'Én is tudom hozni',- 'packing.alsoBringingStop': 'Mégsem hozom','packing.cloneToMine': 'Másolás a listámra','packing.bagLimit': 'Súlykorlát','packing.setBagLimit': 'Korlát beállítása',+ 'packing.hideDone': 'Becsomagoltak elrejtése',+ 'packing.detail.list': 'Lista',+ 'packing.detail.bag': 'Táska',+ 'packing.detail.visibility': 'Látható',+ 'packing.visibility.me': 'Csak én',+ 'packing.visibility.some': 'Kiválasztottak',+ 'packing.bringersNobody': 'Még senki',+ 'packing.quantityLess': 'Eggyel kevesebb',+ 'packing.quantityMore': 'Eggyel több',};export default packing;diff --git a/shared/src/i18n/id/packing.ts b/shared/src/i18n/id/packing.tsindex 6f4f9e540..640b06dc4 100644--- a/shared/src/i18n/id/packing.ts+++ b/shared/src/i18n/id/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Opsi daftar','packing.editItem': 'Edit barang','packing.itemName': 'Nama',- 'packing.itemQuantity': 'Jumlah','packing.packedCount': '{packed} dari {total} sudah dikemas','packing.packedMore': 'Kemas satu lagi','packing.packedLess': 'Kurangi satu yang dikemas',- 'packing.itemWeight': 'Berat (g)','packing.title': 'Daftar Bawaan','packing.empty': 'Daftar bawaan kosong','packing.import': 'Impor',@@ -43,7 +41,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Semua','packing.filterOpen': 'Belum','packing.filterDone': 'Selesai',- 'packing.sortBy': 'Urutkan','packing.sortByName': 'A ke Z','packing.emptyTitle': 'Daftar bawaan kosong','packing.emptyFiltered': 'Tidak ada item yang cocok dengan filter ini',@@ -83,7 +80,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Jml','packing.bagName': 'Nama tas...','packing.addBag': 'Tambah tas',- 'packing.changeCategory': 'Pindahkan ke daftar','packing.confirm.clearChecked': 'Yakin ingin menghapus {count} item yang dicentang?','packing.confirm.deleteCat': 'Yakin ingin menghapus daftar "{name}" dengan {count} item?','packing.defaultCategory': 'Lainnya',@@ -97,7 +93,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Pribadi — hanya terlihat oleh Anda','packing.viewCommon': 'Bersama','packing.viewPersonal': 'Daftar saya',- 'packing.share': 'Berbagi','packing.tierCommonHint': 'Di grup, terlihat oleh semua','packing.tierPersonal': 'Pribadi','packing.tierPersonalHint': 'Privat — hanya Anda yang melihat',@@ -107,10 +102,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount': 'dibagikan dengan {count}','packing.broughtBy': 'dibawa oleh {name}','packing.bringersTitle': 'Dibawa oleh',- 'packing.alsoBring': 'Saya juga bisa membawanya',- 'packing.alsoBringingStop': 'Saya tidak membawanya','packing.cloneToMine': 'Salin ke daftar saya','packing.bagLimit': 'Batas berat','packing.setBagLimit': 'Atur batas',+ 'packing.hideDone': 'Sembunyikan yang sudah dikemas',+ 'packing.detail.list': 'Daftar',+ 'packing.detail.bag': 'Tas',+ 'packing.detail.visibility': 'Terlihat oleh',+ 'packing.visibility.me': 'Hanya saya',+ 'packing.visibility.some': 'Pilihan',+ 'packing.bringersNobody': 'Belum ada',+ 'packing.quantityLess': 'Kurangi satu',+ 'packing.quantityMore': 'Tambah satu',};export default packing;diff --git a/shared/src/i18n/it/packing.ts b/shared/src/i18n/it/packing.tsindex 24ebbc510..234729795 100644--- a/shared/src/i18n/it/packing.ts+++ b/shared/src/i18n/it/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Opzioni elenco','packing.editItem': 'Modifica elemento','packing.itemName': 'Nome',- 'packing.itemQuantity': 'Quantità','packing.packedCount': '{packed} di {total} in valigia','packing.packedMore': 'Uno in più in valigia','packing.packedLess': 'Uno in meno in valigia',- 'packing.itemWeight': 'Peso (g)','packing.title': 'Lista valigia','packing.empty': 'La lista valigia è vuota','packing.import': 'Importa',@@ -47,7 +45,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Tutti','packing.filterOpen': 'Da fare','packing.filterDone': 'Fatto',- 'packing.sortBy': 'Ordina per','packing.sortByName': 'A-Z','packing.emptyTitle': 'La lista valigia è vuota','packing.emptyFiltered': 'Nessun elemento corrisponde a questo filtro',@@ -88,7 +85,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Qtà','packing.bagName': 'Nome valigia...','packing.addBag': 'Aggiungi valigia',- 'packing.changeCategory': 'Sposta nella lista','packing.confirm.clearChecked': 'Sei sicuro di voler rimuovere {count} elementi spuntati?','packing.confirm.clearChecked.one': 'Sei sicuro di voler rimuovere {count} elemento spuntato?','packing.confirm.deleteCat': 'Vuoi davvero eliminare la lista "{name}" con {count} elementi?',@@ -104,7 +100,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Privato — visibile solo a te','packing.viewCommon': 'Condiviso','packing.viewPersonal': 'La mia lista',- 'packing.share': 'Condivisione','packing.tierCommonHint': 'Nel gruppo, visibile a tutti','packing.tierPersonal': 'Personale','packing.tierPersonalHint': 'Privato — lo vedi solo tu',@@ -115,10 +110,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'condiviso con {count}','packing.broughtBy': 'lo porta {name}','packing.bringersTitle': 'Lo porta',- 'packing.alsoBring': "Posso portarlo anch'io",- 'packing.alsoBringingStop': 'Non lo porto','packing.cloneToMine': 'Copia nella mia lista','packing.bagLimit': 'Limite di peso','packing.setBagLimit': 'Imposta limite',+ 'packing.hideDone': 'Nascondi ciò che è in valigia',+ 'packing.detail.list': 'Lista',+ 'packing.detail.bag': 'Borsa',+ 'packing.detail.visibility': 'Visibile a',+ 'packing.visibility.me': 'Solo io',+ 'packing.visibility.some': 'Selezione',+ 'packing.bringersNobody': 'Ancora nessuno',+ 'packing.quantityLess': 'Uno in meno',+ 'packing.quantityMore': 'Uno in più',};export default packing;diff --git a/shared/src/i18n/ja/packing.ts b/shared/src/i18n/ja/packing.tsindex 0d259c3f5..157db3f59 100644--- a/shared/src/i18n/ja/packing.ts+++ b/shared/src/i18n/ja/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'リストオプション','packing.editItem': 'アイテムを編集','packing.itemName': '名前',- 'packing.itemQuantity': '数量','packing.packedCount': '{total}個中{packed}個を荷造り済み','packing.packedMore': '1個多く荷造り','packing.packedLess': '1個少なく荷造り',- 'packing.itemWeight': '重さ(g)','packing.title': '持ち物リスト','packing.empty': '持ち物リストは空です','packing.import': 'インポート',@@ -42,7 +40,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'すべて','packing.filterOpen': '未完了','packing.filterDone': '完了',- 'packing.sortBy': '並べ替え','packing.sortByName': '名前順','packing.emptyTitle': '持ち物リストは空です','packing.emptyFiltered': 'このフィルターに一致する項目はありません',@@ -80,7 +77,6 @@ const packing: TranslationStrings = {'packing.quantity': '数量','packing.bagName': 'バッグ名...','packing.addBag': 'バッグを追加',- 'packing.changeCategory': 'リストへ移動','packing.confirm.clearChecked': 'チェック済み{count}件を削除しますか?','packing.confirm.deleteCat': 'リスト「{name}」({count}件)を削除してもよろしいですか?','packing.defaultCategory': 'その他',@@ -94,7 +90,6 @@ const packing: TranslationStrings = {'packing.privateHint': '非公開 — 自分のみ表示','packing.viewCommon': 'みんなで','packing.viewPersonal': 'マイリスト',- 'packing.share': '共有','packing.tierCommonHint': 'グループの共有プール、全員に表示','packing.tierPersonal': '個人','packing.tierPersonalHint': '非公開 — 自分だけ',@@ -104,10 +99,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount': '{count} 人と共有','packing.broughtBy': '{name} さんが持参','packing.bringersTitle': '持っていく人',- 'packing.alsoBring': '私も持っていけます',- 'packing.alsoBringingStop': 'やっぱり持っていきません','packing.cloneToMine': 'マイリストにコピー','packing.bagLimit': '重量制限','packing.setBagLimit': '制限を設定',+ 'packing.hideDone': '詰めた物を隠す',+ 'packing.detail.list': 'リスト',+ 'packing.detail.bag': 'バッグ',+ 'packing.detail.visibility': '公開範囲',+ 'packing.visibility.me': '自分のみ',+ 'packing.visibility.some': '選択した人',+ 'packing.bringersNobody': 'まだ誰もいません',+ 'packing.quantityLess': '1つ減らす',+ 'packing.quantityMore': '1つ増やす',};export default packing;diff --git a/shared/src/i18n/ko/packing.ts b/shared/src/i18n/ko/packing.tsindex 4d08ce1de..1290017ef 100644--- a/shared/src/i18n/ko/packing.ts+++ b/shared/src/i18n/ko/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': '목록 옵션','packing.editItem': '항목 편집','packing.itemName': '이름',- 'packing.itemQuantity': '수량','packing.packedCount': '{total}개 중 {packed}개 챙김','packing.packedMore': '하나 더 챙기기','packing.packedLess': '하나 덜 챙기기',- 'packing.itemWeight': '무게(g)','packing.title': '짐 목록','packing.empty': '짐 목록이 비어 있습니다','packing.import': '가져오기',@@ -42,7 +40,6 @@ const packing: TranslationStrings = {'packing.filterAll': '전체','packing.filterOpen': '미완료','packing.filterDone': '완료',- 'packing.sortBy': '정렬','packing.sortByName': '가나다순','packing.emptyTitle': '짐 목록이 비어 있습니다','packing.emptyFiltered': '이 필터와 일치하는 항목이 없습니다',@@ -79,7 +76,6 @@ const packing: TranslationStrings = {'packing.quantity': '수량','packing.bagName': '가방 이름...','packing.addBag': '가방 추가',- 'packing.changeCategory': '목록으로 이동','packing.confirm.clearChecked': '체크된 {count}개 항목을 제거할까요?','packing.confirm.deleteCat': '"{name}" 목록({count}개 항목)을 삭제하시겠습니까?','packing.defaultCategory': '기타',@@ -93,7 +89,6 @@ const packing: TranslationStrings = {'packing.privateHint': '비공개 — 나만 볼 수 있음','packing.viewCommon': '공동','packing.viewPersonal': '내 목록',- 'packing.share': '공유','packing.tierCommonHint': '그룹 공용, 모두에게 표시','packing.tierPersonal': '개인','packing.tierPersonalHint': '비공개 — 나만 볼 수 있음',@@ -103,10 +98,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount': '{count}명과 공유','packing.broughtBy': '{name}님이 가져옴','packing.bringersTitle': '가져오는 사람',- 'packing.alsoBring': '저도 가져갈 수 있어요',- 'packing.alsoBringingStop': '안 가져갈게요','packing.cloneToMine': '내 목록으로 복사','packing.bagLimit': '무게 제한','packing.setBagLimit': '제한 설정',+ 'packing.hideDone': '챙긴 항목 숨기기',+ 'packing.detail.list': '목록',+ 'packing.detail.bag': '가방',+ 'packing.detail.visibility': '공개 대상',+ 'packing.visibility.me': '나만',+ 'packing.visibility.some': '선택한 사람',+ 'packing.bringersNobody': '아직 없음',+ 'packing.quantityLess': '하나 줄이기',+ 'packing.quantityMore': '하나 늘리기',};export default packing;diff --git a/shared/src/i18n/nl/packing.ts b/shared/src/i18n/nl/packing.tsindex 0c299e0ff..baec456db 100644--- a/shared/src/i18n/nl/packing.ts+++ b/shared/src/i18n/nl/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Lijstopties','packing.editItem': 'Item bewerken','packing.itemName': 'Naam',- 'packing.itemQuantity': 'Aantal','packing.packedCount': '{packed} van {total} ingepakt','packing.packedMore': 'Eén meer inpakken','packing.packedLess': 'Eén minder inpakken',- 'packing.itemWeight': 'Gewicht (g)','packing.title': 'Inpaklijst','packing.empty': 'Inpaklijst is leeg','packing.import': 'Importeren',@@ -47,7 +45,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Alle','packing.filterOpen': 'Openstaand','packing.filterDone': 'Klaar',- 'packing.sortBy': 'Sorteren op','packing.sortByName': 'A tot Z','packing.emptyTitle': 'Inpaklijst is leeg','packing.emptyFiltered': 'Geen items gevonden voor dit filter',@@ -88,7 +85,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Aantal','packing.bagName': 'Naam...','packing.addBag': 'Bagage toevoegen',- 'packing.changeCategory': 'Naar lijst verplaatsen','packing.confirm.clearChecked': 'Weet je zeker dat je {count} aangevinkte items wilt verwijderen?','packing.confirm.clearChecked.one': 'Weet je zeker dat je {count} aangevinkt item wilt verwijderen?','packing.confirm.deleteCat': 'Weet je zeker dat je de lijst "{name}" met {count} items wilt verwijderen?',@@ -104,7 +100,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Privé — alleen zichtbaar voor jou','packing.viewCommon': 'Gedeeld','packing.viewPersonal': 'Mijn lijst',- 'packing.share': 'Delen','packing.tierCommonHint': 'In de groep, voor iedereen zichtbaar','packing.tierPersonal': 'Persoonlijk','packing.tierPersonalHint': 'Privé — alleen jij ziet het',@@ -115,10 +110,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'gedeeld met {count}','packing.broughtBy': 'meegenomen door {name}','packing.bringersTitle': 'Neemt mee',- 'packing.alsoBring': 'Ik kan het ook meenemen',- 'packing.alsoBringingStop': 'Ik neem het niet mee','packing.cloneToMine': 'Kopiëren naar mijn lijst','packing.bagLimit': 'Gewichtslimiet','packing.setBagLimit': 'Limiet instellen',+ 'packing.hideDone': 'Ingepakte verbergen',+ 'packing.detail.list': 'Lijst',+ 'packing.detail.bag': 'Tas',+ 'packing.detail.visibility': 'Zichtbaar voor',+ 'packing.visibility.me': 'Alleen ik',+ 'packing.visibility.some': 'Selectie',+ 'packing.bringersNobody': 'Nog niemand',+ 'packing.quantityLess': 'Eén minder',+ 'packing.quantityMore': 'Eén meer',};export default packing;diff --git a/shared/src/i18n/pl/packing.ts b/shared/src/i18n/pl/packing.tsindex 00645938c..901a40971 100644--- a/shared/src/i18n/pl/packing.ts+++ b/shared/src/i18n/pl/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Opcje listy','packing.editItem': 'Edytuj przedmiot','packing.itemName': 'Nazwa',- 'packing.itemQuantity': 'Ilość','packing.packedCount': '{packed} z {total} spakowane','packing.packedMore': 'Spakuj o jeden więcej','packing.packedLess': 'Spakuj o jeden mniej',- 'packing.itemWeight': 'Waga (g)','packing.title': 'Lista pakowania','packing.empty': 'Lista pakowania jest pusta','packing.import': 'Importuj',@@ -55,7 +53,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Wszystkie','packing.filterOpen': 'Do spakowania','packing.filterDone': 'Spakowane',- 'packing.sortBy': 'Sortuj według','packing.sortByName': 'Od A do Z','packing.emptyTitle': 'Lista pakowania jest pusta','packing.emptyFiltered': 'Brak przedmiotów pasujących do filtra',@@ -97,7 +94,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Ilość','packing.bagName': 'Nazwa torby...','packing.addBag': 'Dodaj torbę',- 'packing.changeCategory': 'Przenieś do listy','packing.confirm.clearChecked': 'Czy na pewno chcesz usunąć {count} spakowanego przedmiotu?','packing.confirm.clearChecked.one': 'Czy na pewno chcesz usunąć {count} spakowany przedmiot?','packing.confirm.clearChecked.few': 'Czy na pewno chcesz usunąć {count} spakowane przedmioty?',@@ -117,7 +113,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Prywatne — widoczne tylko dla Ciebie','packing.viewCommon': 'Wspólne','packing.viewPersonal': 'Moja lista',- 'packing.share': 'Udostępnianie','packing.tierCommonHint': 'W puli grupy, widoczne dla wszystkich','packing.tierPersonal': 'Osobiste','packing.tierPersonalHint': 'Prywatne — widzisz tylko Ty',@@ -130,10 +125,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.many': 'udostępniono {count} osobom','packing.broughtBy': 'przynosi {name}','packing.bringersTitle': 'Przyniesie',- 'packing.alsoBring': 'Ja też mogę to wziąć',- 'packing.alsoBringingStop': 'Jednak nie biorę','packing.cloneToMine': 'Kopiuj do mojej listy','packing.bagLimit': 'Limit wagi','packing.setBagLimit': 'Ustaw limit',+ 'packing.hideDone': 'Ukryj spakowane',+ 'packing.detail.list': 'Lista',+ 'packing.detail.bag': 'Torba',+ 'packing.detail.visibility': 'Widoczne dla',+ 'packing.visibility.me': 'Tylko ja',+ 'packing.visibility.some': 'Wybrane osoby',+ 'packing.bringersNobody': 'Jeszcze nikt',+ 'packing.quantityLess': 'O jeden mniej',+ 'packing.quantityMore': 'O jeden więcej',};export default packing;diff --git a/shared/src/i18n/ru/packing.ts b/shared/src/i18n/ru/packing.tsindex feb825b98..9b5ec6adf 100644--- a/shared/src/i18n/ru/packing.ts+++ b/shared/src/i18n/ru/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Параметры списка','packing.editItem': 'Изменить предмет','packing.itemName': 'Название',- 'packing.itemQuantity': 'Количество','packing.packedCount': 'Упаковано {packed} из {total}','packing.packedMore': 'Упаковать ещё одну','packing.packedLess': 'Упаковать на одну меньше',- 'packing.itemWeight': 'Вес (г)','packing.title': 'Список вещей','packing.empty': 'Список вещей пуст','packing.import': 'Импорт',@@ -55,7 +53,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Все','packing.filterOpen': 'Не собрано','packing.filterDone': 'Собрано',- 'packing.sortBy': 'Сортировка','packing.sortByName': 'От А до Я','packing.emptyTitle': 'Список вещей пуст','packing.emptyFiltered': 'Нет вещей, соответствующих фильтру',@@ -95,7 +92,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Кол-во','packing.bagName': 'Название...','packing.addBag': 'Добавить багаж',- 'packing.changeCategory': 'Переместить в список','packing.confirm.clearChecked': 'Вы уверены, что хотите удалить {count} отмеченной вещи?','packing.confirm.clearChecked.one': 'Вы уверены, что хотите удалить {count} отмеченную вещь?','packing.confirm.clearChecked.few': 'Вы уверены, что хотите удалить {count} отмеченные вещи?',@@ -115,7 +111,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Личное — видно только вам','packing.viewCommon': 'Общий','packing.viewPersonal': 'Мой список',- 'packing.share': 'Доступ','packing.tierCommonHint': 'В общем пуле, виден всем','packing.tierPersonal': 'Личный','packing.tierPersonalHint': 'Личное — видите только вы',@@ -128,10 +123,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.many': 'доступно {count} участникам','packing.broughtBy': 'приносит {name}','packing.bringersTitle': 'Возьмёт',- 'packing.alsoBring': 'Я тоже могу принести',- 'packing.alsoBringingStop': 'Я не принесу','packing.cloneToMine': 'Копировать в мой список','packing.bagLimit': 'Ограничение веса','packing.setBagLimit': 'Задать лимит',+ 'packing.hideDone': 'Скрыть упакованное',+ 'packing.detail.list': 'Список',+ 'packing.detail.bag': 'Сумка',+ 'packing.detail.visibility': 'Видно',+ 'packing.visibility.me': 'Только я',+ 'packing.visibility.some': 'Выбранным',+ 'packing.bringersNobody': 'Пока никто',+ 'packing.quantityLess': 'На один меньше',+ 'packing.quantityMore': 'На один больше',};export default packing;diff --git a/shared/src/i18n/sk/packing.ts b/shared/src/i18n/sk/packing.tsindex aa7121597..b0e0483b6 100644--- a/shared/src/i18n/sk/packing.ts+++ b/shared/src/i18n/sk/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Možnosti zoznamu','packing.editItem': 'Upraviť položku','packing.itemName': 'Názov',- 'packing.itemQuantity': 'Množstvo','packing.packedCount': '{packed} z {total} zbalené','packing.packedMore': 'Zbaliť o jeden viac','packing.packedLess': 'Zbaliť o jeden menej',- 'packing.itemWeight': 'Hmotnosť (g)','packing.title': 'Zoznam vecí','packing.empty': 'Zoznam vecí je prázdny','packing.import': 'Importovať',@@ -51,7 +49,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Všetko','packing.filterOpen': 'Na zabalenie','packing.filterDone': 'Hotovo',- 'packing.sortBy': 'Zoradiť podľa','packing.sortByName': 'A až Z','packing.emptyTitle': 'Zoznam vecí je prázdny','packing.emptyFiltered': 'Žiadne položky nezodpovedajú tomuto filtru',@@ -91,13 +88,11 @@ const packing: TranslationStrings = {'packing.quantity': 'Počet','packing.bagName': 'Názov zavazadla...','packing.addBag': 'Pridať zavazadlo',- 'packing.changeCategory': 'Presunúť do zoznamu','packing.makePrivate': 'Nastaviť ako súkromné','packing.makePublic': 'Zdieľať','packing.privateHint': 'Súkromné — vidíte len vy','packing.viewCommon': 'Zdieľané','packing.viewPersonal': 'Môj zoznam',- 'packing.share': 'Zdieľanie','packing.tierCommonHint': 'V spoločnom fonde, viditeľné pre všetkých','packing.tierPersonal': 'Osobné','packing.tierPersonalHint': 'Súkromné — vidíte to len vy',@@ -109,8 +104,6 @@ const packing: TranslationStrings = {'packing.sharedWithCount.few': 'zdieľané s {count} osobami','packing.broughtBy': 'prináša {name}','packing.bringersTitle': 'Prinesie',- 'packing.alsoBring': 'Môžem to vziať tiež',- 'packing.alsoBringingStop': 'Neberiem to','packing.cloneToMine': 'Kopírovať do môjho zoznamu','packing.confirm.clearChecked': 'Naozaj chcete odstrániť {count} označených položiek?','packing.confirm.clearChecked.one': 'Naozaj chcete odstrániť {count} označenú položku?',@@ -126,5 +119,14 @@ const packing: TranslationStrings = {'packing.toast.addError': 'Pridanie zlyhalo','packing.bagLimit': 'Hmotnostný limit','packing.setBagLimit': 'Nastaviť limit',+ 'packing.hideDone': 'Skryť zbalené',+ 'packing.detail.list': 'Zoznam',+ 'packing.detail.bag': 'Taška',+ 'packing.detail.visibility': 'Viditeľné pre',+ 'packing.visibility.me': 'Iba ja',+ 'packing.visibility.some': 'Výber',+ 'packing.bringersNobody': 'Zatiaľ nikto',+ 'packing.quantityLess': 'O jeden menej',+ 'packing.quantityMore': 'O jeden viac',};export default packing;diff --git a/shared/src/i18n/sv/packing.ts b/shared/src/i18n/sv/packing.tsindex f78662241..231961b82 100644--- a/shared/src/i18n/sv/packing.ts+++ b/shared/src/i18n/sv/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Listalternativ','packing.editItem': 'Redigera objekt','packing.itemName': 'Namn',- 'packing.itemQuantity': 'Antal','packing.packedCount': '{packed} av {total} packade','packing.packedMore': 'Packa en till','packing.packedLess': 'Packa en mindre',- 'packing.itemWeight': 'Vikt (g)','packing.title': 'Packlista','packing.empty': 'Packlistan är tom','packing.import': 'Importera',@@ -47,7 +45,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Alla','packing.filterOpen': 'Öppna','packing.filterDone': 'Klar',- 'packing.sortBy': 'Sortera efter','packing.sortByName': 'A till Ö','packing.emptyTitle': 'Packlistan är tom','packing.emptyFiltered': 'Inga föremål matchar detta filter',@@ -86,7 +83,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Antal','packing.bagName': 'Väskans namn...','packing.addBag': 'Lägg till väska',- 'packing.changeCategory': 'Flytta till lista','packing.confirm.clearChecked': 'Är du säker på att du vill ta bort {count} markerade föremål?','packing.confirm.clearChecked.one': 'Är du säker på att du vill ta bort {count} markerat föremål?','packing.confirm.deleteCat': 'Är du säker på att du vill ta bort listan "{name}" med {count} föremål?',@@ -102,7 +98,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Privat — endast synligt för dig','packing.viewCommon': 'Delat','packing.viewPersonal': 'Min lista',- 'packing.share': 'Delning','packing.tierCommonHint': 'I grupp-poolen, synligt för alla','packing.tierPersonal': 'Personlig','packing.tierPersonalHint': 'Privat — bara du ser det',@@ -113,10 +108,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': 'delat med {count}','packing.broughtBy': 'tas med av {name}','packing.bringersTitle': 'Tar med',- 'packing.alsoBring': 'Jag kan ta med det också',- 'packing.alsoBringingStop': 'Jag tar inte med det','packing.cloneToMine': 'Kopiera till min lista','packing.bagLimit': 'Viktgräns','packing.setBagLimit': 'Ange gräns',+ 'packing.hideDone': 'Dölj packat',+ 'packing.detail.list': 'Lista',+ 'packing.detail.bag': 'Väska',+ 'packing.detail.visibility': 'Synlig för',+ 'packing.visibility.me': 'Bara jag',+ 'packing.visibility.some': 'Urval',+ 'packing.bringersNobody': 'Ingen än',+ 'packing.quantityLess': 'En färre',+ 'packing.quantityMore': 'En till',};export default packing;diff --git a/shared/src/i18n/th/packing.ts b/shared/src/i18n/th/packing.tsindex 429c6019b..8106e61fd 100644--- a/shared/src/i18n/th/packing.ts+++ b/shared/src/i18n/th/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'ตัวเลือกรายการ','packing.editItem': 'แก้ไขรายการ','packing.itemName': 'ชื่อ',- 'packing.itemQuantity': 'ปริมาณ','packing.packedCount': 'แพ็กแล้ว {packed} จาก {total}','packing.packedMore': 'แพ็กเพิ่มอีกหนึ่งชิ้น','packing.packedLess': 'แพ็กลดลงหนึ่งชิ้น',- 'packing.itemWeight': 'น้ำหนัก (กรัม)','packing.title': 'รายการจัดกระเป๋า','packing.empty': 'รายการจัดกระเป๋าว่างเปล่า','packing.import': 'นำเข้า',@@ -43,7 +41,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'ทั้งหมด','packing.filterOpen': 'ยังไม่ได้จัด','packing.filterDone': 'เสร็จแล้ว',- 'packing.sortBy': 'เรียงตาม','packing.sortByName': 'ก ถึง ฮ','packing.emptyTitle': 'รายการจัดกระเป๋าว่างเปล่า','packing.emptyFiltered': 'ไม่มีรายการที่ตรงกับตัวกรองนี้',@@ -80,13 +77,11 @@ const packing: TranslationStrings = {'packing.quantity': 'จำนวน','packing.bagName': 'ชื่อกระเป๋า...','packing.addBag': 'เพิ่มกระเป๋า',- 'packing.changeCategory': 'ย้ายไปที่รายการ','packing.makePrivate': 'ทำให้เป็นส่วนตัว','packing.makePublic': 'ทำให้แชร์ได้','packing.privateHint': 'ส่วนตัว — ปรากฏให้คุณเท่านั้น','packing.viewCommon': 'แชร์แล้ว','packing.viewPersonal': 'รายการของฉัน',- 'packing.share': 'การแชร์','packing.tierCommonHint': 'อยู่ในรายการส่วนกลางที่ทุกคนมองเห็นได้','packing.tierPersonal': 'ส่วนตัว','packing.tierPersonalHint': 'ส่วนตัว — มีเพียงคุณเท่านั้นที่สามารถเห็นได้',@@ -96,8 +91,6 @@ const packing: TranslationStrings = {'packing.sharedWithCount': 'แชร์กับ {count}','packing.broughtBy': '{name} จะนำมา','packing.bringersTitle': 'ผู้นำมา',- 'packing.alsoBring': 'ฉันก็สามารถนำสิ่งนั้นมาได้เช่นกัน',- 'packing.alsoBringingStop': 'ฉันไม่เอามันมา','packing.cloneToMine': 'คัดลอกไปยังรายการของฉัน','packing.confirm.clearChecked': 'คุณแน่ใจหรือไม่ว่าต้องการลบรายการที่ทำเครื่องหมายแล้ว {count} รายการ','packing.confirm.deleteCat': 'คุณแน่ใจหรือไม่ว่าต้องการลบรายการ "{name}" ที่มี {count} รายการ',@@ -109,5 +102,14 @@ const packing: TranslationStrings = {'packing.toast.addError': 'เพิ่มไม่สำเร็จ','packing.bagLimit': 'จำกัดน้ำหนัก','packing.setBagLimit': 'กำหนดขีดจำกัด',+ 'packing.hideDone': 'ซ่อนที่แพ็กแล้ว',+ 'packing.detail.list': 'รายการ',+ 'packing.detail.bag': 'กระเป๋า',+ 'packing.detail.visibility': 'มองเห็นได้โดย',+ 'packing.visibility.me': 'เฉพาะฉัน',+ 'packing.visibility.some': 'ที่เลือก',+ 'packing.bringersNobody': 'ยังไม่มีใคร',+ 'packing.quantityLess': 'ลดหนึ่ง',+ 'packing.quantityMore': 'เพิ่มหนึ่ง',};export default packing;diff --git a/shared/src/i18n/tr/packing.ts b/shared/src/i18n/tr/packing.tsindex 3cf0c4f73..be7186e12 100644--- a/shared/src/i18n/tr/packing.ts+++ b/shared/src/i18n/tr/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Liste seçenekleri','packing.editItem': 'Öğeyi düzenle','packing.itemName': 'Ad',- 'packing.itemQuantity': 'Miktar','packing.packedCount': '{total} öğeden {packed} tanesi paketlendi','packing.packedMore': 'Bir tane daha paketle','packing.packedLess': 'Bir tane daha az paketle',- 'packing.itemWeight': 'Ağırlık (g)','packing.title': 'Paket Listesi','packing.empty': 'Paket listesi boş','packing.import': 'İçe aktar',@@ -47,7 +45,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Tüm','packing.filterOpen': 'Açık','packing.filterDone': 'Tamamlamak',- 'packing.sortBy': 'Sırala','packing.sortByName': "A'dan Z'ye",'packing.emptyTitle': 'Paket listesi boş','packing.emptyFiltered': 'Bu filtreye uyan öğe yok',@@ -87,7 +84,6 @@ const packing: TranslationStrings = {'packing.quantity': 'Adet','packing.bagName': 'Çanta adı...','packing.addBag': 'Çanta ekle',- 'packing.changeCategory': 'Listeye taşı','packing.confirm.clearChecked': 'İşaretli {count} öğeyi kaldırmak istediğinizden emin misiniz?','packing.confirm.clearChecked.one': 'İşaretli {count} öğeyi kaldırmak istediğinizden emin misiniz?','packing.confirm.deleteCat': '"{name}" listesini {count} öğesiyle birlikte silmek istediğinizden emin misiniz?',@@ -103,7 +99,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Gizli — yalnızca siz görebilirsiniz','packing.viewCommon': 'Ortak','packing.viewPersonal': 'Listem',- 'packing.share': 'Paylaşım','packing.tierCommonHint': 'Grup havuzunda, herkese görünür','packing.tierPersonal': 'Kişisel','packing.tierPersonalHint': 'Özel — yalnızca siz görürsünüz',@@ -114,10 +109,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.one': '{count} kişiyle paylaşıldı','packing.broughtBy': '{name} getiriyor','packing.bringersTitle': 'Getiren',- 'packing.alsoBring': 'Ben de getirebilirim',- 'packing.alsoBringingStop': 'Getirmiyorum','packing.cloneToMine': 'Listeme kopyala','packing.bagLimit': 'Ağırlık limiti','packing.setBagLimit': 'Limit belirle',+ 'packing.hideDone': 'Paketlenenleri gizle',+ 'packing.detail.list': 'Liste',+ 'packing.detail.bag': 'Çanta',+ 'packing.detail.visibility': 'Görebilenler',+ 'packing.visibility.me': 'Yalnızca ben',+ 'packing.visibility.some': 'Seçilenler',+ 'packing.bringersNobody': 'Henüz kimse',+ 'packing.quantityLess': 'Bir eksik',+ 'packing.quantityMore': 'Bir fazla',};export default packing;diff --git a/shared/src/i18n/uk/packing.ts b/shared/src/i18n/uk/packing.tsindex 154b14ac4..1268a6765 100644--- a/shared/src/i18n/uk/packing.ts+++ b/shared/src/i18n/uk/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Параметри списку','packing.editItem': 'Редагувати елемент','packing.itemName': 'Назва',- 'packing.itemQuantity': 'Кількість','packing.packedCount': 'Спаковано {packed} з {total}','packing.packedMore': 'Спакувати ще одну','packing.packedLess': 'Спакувати на одну менше',- 'packing.itemWeight': 'Вага (г)','packing.title': 'Список речей','packing.empty': 'Список речей порожній','packing.import': 'Імпорт',@@ -55,7 +53,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Усі','packing.filterOpen': 'Не зібрано','packing.filterDone': 'Зібрано',- 'packing.sortBy': 'Сортування','packing.sortByName': 'Від А до Я','packing.emptyTitle': 'Список речей порожній','packing.emptyFiltered': 'Немає речей, що відповідають фільтру',@@ -95,7 +92,6 @@ const packing: TranslationStrings = {'packing.quantity': 'К-сть','packing.bagName': 'Назва...','packing.addBag': 'Додати багаж',- 'packing.changeCategory': 'Перемістити до списку','packing.confirm.clearChecked': 'Ви впевнені, що хочете видалити {count} позначеної речі?','packing.confirm.clearChecked.one': 'Ви впевнені, що хочете видалити {count} позначену річ?','packing.confirm.clearChecked.few': 'Ви впевнені, що хочете видалити {count} позначені речі?',@@ -115,7 +111,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Приватне — бачите лише ви','packing.viewCommon': 'Спільне','packing.viewPersonal': 'Мій список',- 'packing.share': 'Доступ','packing.tierCommonHint': 'У спільному пулі, видно всім','packing.tierPersonal': 'Особисте','packing.tierPersonalHint': 'Приватне — бачите лише ви',@@ -128,10 +123,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount.many': 'надано {count} учасникам','packing.broughtBy': 'приносить {name}','packing.bringersTitle': 'Візьме',- 'packing.alsoBring': 'Я теж можу принести',- 'packing.alsoBringingStop': 'Я не принесу','packing.cloneToMine': 'Копіювати до мого списку','packing.bagLimit': 'Обмеження ваги','packing.setBagLimit': 'Задати ліміт',+ 'packing.hideDone': 'Сховати спаковане',+ 'packing.detail.list': 'Список',+ 'packing.detail.bag': 'Сумка',+ 'packing.detail.visibility': 'Видно',+ 'packing.visibility.me': 'Лише я',+ 'packing.visibility.some': 'Вибраним',+ 'packing.bringersNobody': 'Поки ніхто',+ 'packing.quantityLess': 'На один менше',+ 'packing.quantityMore': 'На один більше',};export default packing;diff --git a/shared/src/i18n/vi/packing.ts b/shared/src/i18n/vi/packing.tsindex 7115bde55..3b7dec7b3 100644--- a/shared/src/i18n/vi/packing.ts+++ b/shared/src/i18n/vi/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': 'Tùy chọn danh sách','packing.editItem': 'Chỉnh sửa mục','packing.itemName': 'Tên',- 'packing.itemQuantity': 'Số lượng','packing.packedCount': 'Đã xếp {packed}/{total}','packing.packedMore': 'Xếp thêm một','packing.packedLess': 'Bớt một món đã xếp',- 'packing.itemWeight': 'Trọng lượng (g)','packing.title': 'Danh sách đóng gói','packing.empty': 'Danh sách đóng gói trống','packing.import': 'Nhập',@@ -43,7 +41,6 @@ const packing: TranslationStrings = {'packing.filterAll': 'Tất cả','packing.filterOpen': 'Mở','packing.filterDone': 'Xong',- 'packing.sortBy': 'Sắp xếp theo','packing.sortByName': 'A đến Z','packing.emptyTitle': 'Danh sách đóng gói trống','packing.emptyFiltered': 'Không có mục nào phù hợp với bộ lọc này',@@ -81,7 +78,6 @@ const packing: TranslationStrings = {'packing.quantity': 'SL','packing.bagName': 'Tên túi...','packing.addBag': 'Thêm túi',- 'packing.changeCategory': 'Chuyển sang danh sách','packing.confirm.clearChecked': 'Bạn có chắc chắn muốn xóa {count} mục đã chọn không?','packing.confirm.deleteCat': 'Bạn có chắc muốn xóa danh sách "{name}" với {count} mục không?','packing.defaultCategory': 'Khác',@@ -95,7 +91,6 @@ const packing: TranslationStrings = {'packing.privateHint': 'Riêng tư — chỉ mình bạn thấy','packing.viewCommon': 'Chung','packing.viewPersonal': 'Danh sách của tôi',- 'packing.share': 'Chia sẻ','packing.tierCommonHint': 'Trong nhóm, mọi người đều thấy','packing.tierPersonal': 'Cá nhân','packing.tierPersonalHint': 'Riêng tư — chỉ bạn thấy',@@ -105,10 +100,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount': 'chia sẻ với {count}','packing.broughtBy': '{name} mang','packing.bringersTitle': 'Người mang',- 'packing.alsoBring': 'Tôi cũng có thể mang',- 'packing.alsoBringingStop': 'Tôi không mang','packing.cloneToMine': 'Sao chép vào danh sách của tôi','packing.bagLimit': 'Giới hạn cân nặng','packing.setBagLimit': 'Đặt giới hạn',+ 'packing.hideDone': 'Ẩn đồ đã xếp',+ 'packing.detail.list': 'Danh sách',+ 'packing.detail.bag': 'Túi',+ 'packing.detail.visibility': 'Ai thấy được',+ 'packing.visibility.me': 'Chỉ mình tôi',+ 'packing.visibility.some': 'Người được chọn',+ 'packing.bringersNobody': 'Chưa có ai',+ 'packing.quantityLess': 'Bớt một',+ 'packing.quantityMore': 'Thêm một',};export default packing;diff --git a/shared/src/i18n/zh-TW/packing.ts b/shared/src/i18n/zh-TW/packing.tsindex d900ddd3c..6d11b62f8 100644--- a/shared/src/i18n/zh-TW/packing.ts+++ b/shared/src/i18n/zh-TW/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': '清單選項','packing.editItem': '編輯物品','packing.itemName': '名稱',- 'packing.itemQuantity': '數量','packing.packedCount': '已打包 {packed}/{total}','packing.packedMore': '多打包一件','packing.packedLess': '少打包一件',- 'packing.itemWeight': '重量(克)','packing.title': '行李清單','packing.empty': '行李清單為空','packing.import': '匯入',@@ -42,7 +40,6 @@ const packing: TranslationStrings = {'packing.filterAll': '全部','packing.filterOpen': '未完成','packing.filterDone': '已完成',- 'packing.sortBy': '排序方式','packing.sortByName': '依名稱','packing.emptyTitle': '行李清單為空','packing.emptyFiltered': '沒有匹配的物品',@@ -79,7 +76,6 @@ const packing: TranslationStrings = {'packing.quantity': '數量','packing.bagName': '名稱...','packing.addBag': '新增行李',- 'packing.changeCategory': '移動到清單','packing.confirm.clearChecked': '確定移除 {count} 個已勾選的物品?','packing.confirm.deleteCat': '確定要刪除清單「{name}」及其 {count} 個物品嗎?','packing.defaultCategory': '其他',@@ -93,7 +89,6 @@ const packing: TranslationStrings = {'packing.privateHint': '私密 — 僅你可見','packing.viewCommon': '共用','packing.viewPersonal': '我的清單',- 'packing.share': '共用','packing.tierCommonHint': '在群組共用區,所有人可見','packing.tierPersonal': '個人','packing.tierPersonalHint': '私密 — 僅你可見',@@ -103,10 +98,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount': '已共用給 {count} 人','packing.broughtBy': '由 {name} 帶','packing.bringersTitle': '攜帶者',- 'packing.alsoBring': '我也可以帶',- 'packing.alsoBringingStop': '我不帶了','packing.cloneToMine': '複製到我的清單','packing.bagLimit': '重量限制','packing.setBagLimit': '設定限制',+ 'packing.hideDone': '隱藏已打包',+ 'packing.detail.list': '清單',+ 'packing.detail.bag': '包包',+ 'packing.detail.visibility': '可見範圍',+ 'packing.visibility.me': '僅自己',+ 'packing.visibility.some': '指定成員',+ 'packing.bringersNobody': '尚無',+ 'packing.quantityLess': '減少一個',+ 'packing.quantityMore': '增加一個',};export default packing;diff --git a/shared/src/i18n/zh/packing.ts b/shared/src/i18n/zh/packing.tsindex bd58b656d..edf5df000 100644--- a/shared/src/i18n/zh/packing.ts+++ b/shared/src/i18n/zh/packing.ts@@ -8,11 +8,9 @@ const packing: TranslationStrings = {'packing.categoryOptions': '列表选项','packing.editItem': '编辑物品','packing.itemName': '名称',- 'packing.itemQuantity': '数量','packing.packedCount': '已打包 {packed}/{total}','packing.packedMore': '多打包一件','packing.packedLess': '少打包一件',- 'packing.itemWeight': '重量(克)','packing.title': '行李清单','packing.empty': '行李清单为空','packing.import': '导入',@@ -42,7 +40,6 @@ const packing: TranslationStrings = {'packing.filterAll': '全部','packing.filterOpen': '未完成','packing.filterDone': '已完成',- 'packing.sortBy': '排序方式','packing.sortByName': '按名称','packing.emptyTitle': '行李清单为空','packing.emptyFiltered': '没有匹配的物品',@@ -79,7 +76,6 @@ const packing: TranslationStrings = {'packing.quantity': '数量','packing.bagName': '名称...','packing.addBag': '添加行李',- 'packing.changeCategory': '移动到清单','packing.confirm.clearChecked': '确定移除 {count} 个已勾选的物品?','packing.confirm.deleteCat': '确定要删除清单“{name}”及其 {count} 个物品吗?','packing.defaultCategory': '其他',@@ -93,7 +89,6 @@ const packing: TranslationStrings = {'packing.privateHint': '私密 — 仅你可见','packing.viewCommon': '共享','packing.viewPersonal': '我的清单',- 'packing.share': '共享','packing.tierCommonHint': '在小组共享池中,所有人可见','packing.tierPersonal': '个人','packing.tierPersonalHint': '私密 — 仅你可见',@@ -103,10 +98,17 @@ const packing: TranslationStrings = {'packing.sharedWithCount': '已共享给 {count} 人','packing.broughtBy': '由 {name} 带','packing.bringersTitle': '携带者',- 'packing.alsoBring': '我也可以带',- 'packing.alsoBringingStop': '我不带了','packing.cloneToMine': '复制到我的清单','packing.bagLimit': '重量限制','packing.setBagLimit': '设置限制',+ 'packing.hideDone': '隐藏已打包',+ 'packing.detail.list': '清单',+ 'packing.detail.bag': '包',+ 'packing.detail.visibility': '可见范围',+ 'packing.visibility.me': '仅自己',+ 'packing.visibility.some': '指定成员',+ 'packing.bringersNobody': '暂无',+ 'packing.quantityLess': '减少一个',+ 'packing.quantityMore': '增加一个',};export default packing;