feat(manager): help tips on the settings and fields people tend to misread
Owner 2026-11-23 (plan 6F.1b): 26 new tips in English and Greek: Operation (own shifts, hidden takings, card payments, closing tables, the serve step, courses, quick notes), Sign-in (waiter and device modes, usernames, one session, idle sign-out), venue language and time zone, the fiscal device, locking, the server's address, the product editor (unit, available, quick add, VAT group, cost), a device's sign-in, a person's role, the cash counted at a shift's end. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -23,7 +23,7 @@ export default function FiscalSettings() {
|
||||
return (
|
||||
<Columns testId="settings-fiscal">
|
||||
<SettingsCard title={t('settings.fiscal.title')} description={t('settings.fiscal.intro')}>
|
||||
<SettingRow label={t('settings.fiscal.enabled')} hint={t('settings.fiscal.enabledHint')}
|
||||
<SettingRow label={t('settings.fiscal.enabled')} hint={t('settings.fiscal.enabledHint')} tip={t('settings.fiscal.enabledTip')}
|
||||
warning={on ? t('settings.fiscal.onWarning') : undefined}>
|
||||
<Switch checked={on} disabled={s.saving} onChange={v => s.save('fiscal.enabled', v)} aria-label={t('settings.fiscal.enabled')} data-testid="setting-fiscal.enabled" />
|
||||
</SettingRow>
|
||||
|
||||
@@ -11,7 +11,7 @@ import { ArrowDown, ArrowUp, Plus, RefreshCw, Trash2 } from 'lucide-react'
|
||||
import { useModule } from '@xenia/access'
|
||||
import { errorMessage } from '@xenia/api'
|
||||
import { useTranslation } from '@xenia/i18n'
|
||||
import { Button, Columns, IconButton, Input, Spinner, Switch } from '@xenia/ui'
|
||||
import { Button, Columns, IconButton, InfoTip, Input, Spinner, Switch } from '@xenia/ui'
|
||||
import client from '../../../api/client'
|
||||
import QuickMessages from './QuickMessages'
|
||||
import RolePermissions from './RolePermissions'
|
||||
@@ -36,9 +36,9 @@ export default function OperationSettings() {
|
||||
)
|
||||
}
|
||||
|
||||
function Toggle({ s, k, fallback = 'false', label, hint }) {
|
||||
function Toggle({ s, k, fallback = 'false', label, hint, tip }) {
|
||||
return (
|
||||
<SettingRow label={label} hint={hint}>
|
||||
<SettingRow label={label} hint={hint} tip={tip}>
|
||||
<Switch checked={s.get(k, fallback) === 'true'} disabled={s.saving} onChange={v => s.save(k, v)} aria-label={label} data-testid={`setting-${k}`} />
|
||||
</SettingRow>
|
||||
)
|
||||
@@ -51,18 +51,18 @@ function OrderingSettings() {
|
||||
const o = k => t(`settings.ops.${k}`)
|
||||
return (<>
|
||||
<SettingsCard title={o('staffTitle')} description={o('staffIntro')} testId="settings-staff">
|
||||
<Toggle s={s} k="shifts.waiter_self_start" fallback="true" label={o('selfStart')} hint={o('selfStartHint')} />
|
||||
<Toggle s={s} k="shifts.waiter_self_end" fallback="true" label={o('selfEnd')} hint={o('selfEndHint')} />
|
||||
<Toggle s={s} k="shifts.hide_revenue_from_waiters" label={o('hideTakings')} hint={o('hideTakingsHint')} />
|
||||
<Toggle s={s} k="shifts.waiter_self_start" fallback="true" label={o('selfStart')} hint={o('selfStartHint')} tip={o('selfStartTip')} />
|
||||
<Toggle s={s} k="shifts.waiter_self_end" fallback="true" label={o('selfEnd')} hint={o('selfEndHint')} tip={o('selfEndTip')} />
|
||||
<Toggle s={s} k="shifts.hide_revenue_from_waiters" label={o('hideTakings')} hint={o('hideTakingsHint')} tip={o('hideTakingsTip')} />
|
||||
</SettingsCard>
|
||||
<SettingsCard title={o('paymentsTitle')} testId="settings-payments">
|
||||
<Toggle s={s} k="payments.card_enabled" label={o('card')} hint={o('cardHint')} />
|
||||
<Toggle s={s} k="payments.card_enabled" label={o('card')} hint={o('cardHint')} tip={o('cardTip')} />
|
||||
</SettingsCard>
|
||||
<SettingsCard title={o('ordersTitle')} description={o('ordersIntro')} testId="settings-orders">
|
||||
<Toggle s={s} k="orders.auto_close_on_full_payment" label={o('autoClose')} hint={o('autoCloseHint')} />
|
||||
<Toggle s={s} k="orders.close_with_unpaid" label={t('settings.operation.closeUnpaid')} hint={t('settings.operation.closeUnpaidHint')} />
|
||||
<Toggle s={s} k="orders.bypass_kds_serve" label={o('bypassKds')} hint={o('bypassKdsHint')} />
|
||||
<Toggle s={s} k="orders.courses_enabled" label={o('courses')} hint={o('coursesHint')} />
|
||||
<Toggle s={s} k="orders.auto_close_on_full_payment" label={o('autoClose')} hint={o('autoCloseHint')} tip={o('autoCloseTip')} />
|
||||
<Toggle s={s} k="orders.close_with_unpaid" label={t('settings.operation.closeUnpaid')} hint={t('settings.operation.closeUnpaidHint')} tip={t('settings.operation.closeUnpaidTip')} />
|
||||
<Toggle s={s} k="orders.bypass_kds_serve" label={o('bypassKds')} hint={o('bypassKdsHint')} tip={o('bypassKdsTip')} />
|
||||
<Toggle s={s} k="orders.courses_enabled" label={o('courses')} hint={o('coursesHint')} tip={o('coursesTip')} />
|
||||
{s.get('orders.courses_enabled') === 'true' && <Courses s={s} />}
|
||||
<QuickNotes s={s} />
|
||||
</SettingsCard>
|
||||
@@ -104,7 +104,7 @@ function QuickNotes({ s }) {
|
||||
const add = () => { if (typed.trim()) { save([...notes, typed]); setTyped('') } }
|
||||
return (
|
||||
<div className="px-5 py-3 grid gap-2" data-testid="settings-quick-notes">
|
||||
<span className="text-body font-medium text-ink">{t('settings.ops.quickNotes')}</span>
|
||||
<span className="flex items-center gap-1 text-body font-medium text-ink">{t('settings.ops.quickNotes')}<InfoTip>{t('settings.ops.quickNotesTip')}</InfoTip></span>
|
||||
<span className="text-label text-ink-2 -mt-1">{t('settings.ops.quickNotesHint')}</span>
|
||||
{notes.map((n, i) => (
|
||||
<div key={`${i}-${n}`} className="flex items-center gap-2">
|
||||
|
||||
@@ -39,7 +39,7 @@ function IdleSettings() {
|
||||
const options = current => [...new Set([...IDLE_STEPS, current])].sort((a, b) => a - b).map(v => ({ value: String(v), label: span(v) }))
|
||||
return (
|
||||
<SettingsCard title={t('settings.security.idleTitle')} description={t('settings.security.idleIntro')} testId="settings-idle">
|
||||
<SettingRow label={t('settings.security.lock')} hint={t('settings.security.lockHint')}>
|
||||
<SettingRow label={t('settings.security.lock')} hint={t('settings.security.lockHint')} tip={t('settings.security.lockTip')}>
|
||||
<Switch checked={lock} disabled={s.saving} onChange={v => s.save('security.auto_lock', v)} aria-label={t('settings.security.lock')} data-testid="setting-security.auto_lock" />
|
||||
</SettingRow>
|
||||
{lock && (
|
||||
|
||||
@@ -46,23 +46,23 @@ export default function SignInSettings() {
|
||||
<SettingRow label={t('settings.signIn.autofill')} hint={t('settings.signIn.autofillHint')}>
|
||||
{toggle('security.autofill_username', 'true', t('settings.signIn.autofill'))}
|
||||
</SettingRow>
|
||||
<SettingRow label={t('settings.signIn.waiter')} htmlFor={idWaiter}
|
||||
<SettingRow label={t('settings.signIn.waiter')} htmlFor={idWaiter} tip={t('settings.signIn.waiterTip')}
|
||||
warning={waiterMode === 'tap' ? t('settings.signIn.waiterTapWarning') : undefined}>
|
||||
{select('auth.waiter_login_mode', 'pin', opts(['pin', 'password', 'tap'], 'settings.mode'), idWaiter)}
|
||||
</SettingRow>
|
||||
<SettingRow label={t('settings.signIn.requireUsername')} hint={t('settings.signIn.requireUsernameHint')}>
|
||||
<SettingRow label={t('settings.signIn.requireUsername')} hint={t('settings.signIn.requireUsernameHint')} tip={t('settings.signIn.requireUsernameTip')}>
|
||||
{toggle('auth.waiter_require_username', 'false', t('settings.signIn.requireUsername'))}
|
||||
</SettingRow>
|
||||
<SettingRow label={t('settings.signIn.device')} htmlFor={idDevice} hint={t('settings.signIn.deviceHint')}>
|
||||
<SettingRow label={t('settings.signIn.device')} htmlFor={idDevice} hint={t('settings.signIn.deviceHint')} tip={t('settings.signIn.deviceTip')}>
|
||||
{select('auth.default_login_mode', 'pin', opts(['pin', 'password', 'tap', 'none'], 'settings.mode'), idDevice)}
|
||||
</SettingRow>
|
||||
<SettingRow label={t('settings.signIn.singleManager')} htmlFor={idSingleManager} tip={t('settings.signIn.singleTip')}>
|
||||
{select('auth.single_session_manager', 'off', opts(SESSION_RULES, 'settings.session'), idSingleManager)}
|
||||
</SettingRow>
|
||||
<SettingRow label={t('settings.signIn.singleWaiter')} htmlFor={idSingleWaiter}>
|
||||
<SettingRow label={t('settings.signIn.singleWaiter')} htmlFor={idSingleWaiter} tip={t('settings.signIn.singleTip')}>
|
||||
{select('auth.single_session_waiter', 'off', opts(SESSION_RULES, 'settings.session'), idSingleWaiter)}
|
||||
</SettingRow>
|
||||
<SettingRow label={t('settings.signIn.idle')} htmlFor={idIdle} hint={t('settings.signIn.idleHint')}>
|
||||
<SettingRow label={t('settings.signIn.idle')} htmlFor={idIdle} hint={t('settings.signIn.idleHint')} tip={t('settings.signIn.idleTip')}>
|
||||
{select('auth.idle_days', '14', idleOptions, idIdle)}
|
||||
</SettingRow>
|
||||
</SettingsCard>
|
||||
|
||||
@@ -132,7 +132,7 @@ function LanAccess({ status, onQr }) {
|
||||
</Button>
|
||||
</div>
|
||||
)}
|
||||
<SettingRow label={t('settings.lan.address')} hint={!ip ? t('settings.lan.unknown') : info && info.detection !== 'ok' && editing == null ? t(`settings.lan.detection.${info.detection}`, { defaultValue: '' }) : undefined}>
|
||||
<SettingRow label={t('settings.lan.address')} tip={t('settings.lan.addressTip')} hint={!ip ? t('settings.lan.unknown') : info && info.detection !== 'ok' && editing == null ? t(`settings.lan.detection.${info.detection}`, { defaultValue: '' }) : undefined}>
|
||||
{editing != null ? (
|
||||
<span className="grid gap-2">
|
||||
<Input value={editing} autoFocus className="font-mono" placeholder={info?.detected || '192.168.1.50'} onChange={e => setEditing(e.target.value)}
|
||||
|
||||
@@ -29,12 +29,12 @@ export default function VenueSettings() {
|
||||
|
||||
return (
|
||||
<SettingsCard title={t('settings.venue.title')} testId="settings-venue">
|
||||
<SettingRow label={t('settings.venue.language')} htmlFor={langId} hint={t('settings.venue.languageHint')}>
|
||||
<SettingRow label={t('settings.venue.language')} htmlFor={langId} hint={t('settings.venue.languageHint')} tip={t('settings.venue.languageTip')}>
|
||||
<Select id={langId} value={s.get('venue.language', 'en')} disabled={s.saving} data-testid="setting-venue.language"
|
||||
onChange={e => s.save('venue.language', e.target.value)}
|
||||
options={(languages || ['en', 'el']).map(l => ({ value: l, label: LANGUAGE_NAMES[l] || l }))} />
|
||||
</SettingRow>
|
||||
<SettingRow label={t('settings.venue.timezone')} htmlFor={tzId}
|
||||
<SettingRow label={t('settings.venue.timezone')} htmlFor={tzId} tip={t('settings.venue.timezoneTip')}
|
||||
hint={t('settings.venue.timezoneHint', { time: f.formatTime(new Date()) })}>
|
||||
<Select id={tzId} value={tz} disabled={s.saving} data-testid="setting-venue.timezone"
|
||||
onChange={e => s.save('venue.timezone', e.target.value)}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// expected (short / over / even), then "End the shift".
|
||||
import { useState } from 'react'
|
||||
import { useTranslation, useFormat, parseNumber } from '@xenia/i18n'
|
||||
import { Button, Dialog, Field, Input, Spinner, Textarea, cx } from '@xenia/ui'
|
||||
import { Button, Dialog, Field, InfoTip, Input, Spinner, Textarea, cx } from '@xenia/ui'
|
||||
import client from '../../api/client'
|
||||
import { useLiveQuery } from '../../live/useLiveQuery'
|
||||
import { ITEM_KINDS, cashCheck, hourBuckets, itemKind, itemShown, quickAmounts, shiftCounts, shiftMoney, shiftPairs } from './overviewLogic'
|
||||
@@ -127,7 +127,7 @@ export default function ShiftDialog({ shift, mode, onClose, onConfirm, busy }) {
|
||||
{closing && step === 2 && (
|
||||
<div className="grid gap-3">
|
||||
<h3 className="text-title font-semibold text-ink">{t('overview.shift.handover')}</h3>
|
||||
<Field label={t('overview.shift.counted')} hint={t('overview.shift.countedHint')}>
|
||||
<Field label={t('overview.shift.counted')} info={<InfoTip>{t('overview.shift.countedTip')}</InfoTip>} hint={t('overview.shift.countedHint')}>
|
||||
<Input inputMode="decimal" autoFocus value={counted} onChange={e => setCounted(e.target.value)}
|
||||
placeholder={String(money.expected.toFixed(2))} data-testid="shift-counted" />
|
||||
</Field>
|
||||
|
||||
@@ -15,7 +15,7 @@ import { MonitorSmartphone, Plus } from 'lucide-react'
|
||||
import { DeviceSupport } from './DeviceSupport'
|
||||
import { errorMessage, parseError } from '@xenia/api'
|
||||
import { useTranslation, useFormat } from '@xenia/i18n'
|
||||
import { Button, Dialog, EmptyState, Field, Input, Page, Select, Spinner } from '@xenia/ui'
|
||||
import { Button, Dialog, EmptyState, Field, InfoTip, Input, Page, Select, Spinner } from '@xenia/ui'
|
||||
import client from '../../api/client'
|
||||
import DeviceConfigFields from './DeviceConfigFields'
|
||||
import { configInitial, deviceStatus, deviceUsage, hasRoom, linkTargets, normalizeCode } from './devicesLogic'
|
||||
@@ -258,7 +258,7 @@ function PairDialog({ apps, usage, devices, appName, limitLabel, initialApp, onC
|
||||
<Input value={name} onChange={e => setName(e.target.value)} placeholder={t('devices.form.namePlaceholder')} maxLength={60} />
|
||||
</Field>
|
||||
{modes && (
|
||||
<Field label={t('devices.form.signIn')}>
|
||||
<Field label={t('devices.form.signIn')} info={<InfoTip>{t('devices.form.signInTip')}</InfoTip>}>
|
||||
<Select value={mode} onChange={e => setMode(e.target.value)} options={modes} />
|
||||
</Field>
|
||||
)}
|
||||
@@ -304,7 +304,7 @@ function EditDialog({ device, apps, devices, onClose, onSave }) {
|
||||
<Input value={name} onChange={e => setName(e.target.value)} maxLength={60} />
|
||||
</Field>
|
||||
{modes && (
|
||||
<Field label={t('devices.form.signIn')}>
|
||||
<Field label={t('devices.form.signIn')} info={<InfoTip>{t('devices.form.signInTip')}</InfoTip>}>
|
||||
<Select value={mode} onChange={e => setMode(e.target.value)} options={modes} />
|
||||
</Field>
|
||||
)}
|
||||
|
||||
@@ -31,7 +31,7 @@ export function InfoTab({ form, set, setForm, categories, prepZones }) {
|
||||
</Field>
|
||||
<Tags tags={form.tags} onChange={v => set('tags', v)} />
|
||||
<div className="grid gap-3 grid-cols-2">
|
||||
<Field label={t('products.editor.unit')} hint={WEIGHED.has(form.unit_type) ? t('products.editor.unitWeighed') : undefined}>
|
||||
<Field label={t('products.editor.unit')} info={<InfoTip>{t('products.editor.unitTip')}</InfoTip>} hint={WEIGHED.has(form.unit_type) ? t('products.editor.unitWeighed') : undefined}>
|
||||
<Dropdown value={form.unit_type} onChange={v => set('unit_type', v)} data-testid="product-unit" options={UNITS.map(u => ({ value: u, label: t(`products.unit.${u}`) }))} />
|
||||
</Field>
|
||||
<Field label={t('products.editor.price')} required>
|
||||
@@ -41,8 +41,8 @@ export function InfoTab({ form, set, setForm, categories, prepZones }) {
|
||||
<CategoriesField form={form} setForm={setForm} categories={categories} />
|
||||
<PrepZonesField form={form} set={set} prepZones={prepZones} />
|
||||
<AllergensField value={form.allergens} onChange={v => set('allergens', v)} />
|
||||
<Switch checked={form.is_available} onChange={v => set('is_available', v)} label={t('products.editor.available')} description={t('products.editor.availableHint')} />
|
||||
<Switch checked={form.quick_add_enabled} onChange={v => set('quick_add_enabled', v)} label={t('products.editor.quickAdd')} description={t('products.editor.quickAddHint')} />
|
||||
<Switch checked={form.is_available} onChange={v => set('is_available', v)} label={t('products.editor.available')} info={<InfoTip>{t('products.editor.availableTip')}</InfoTip>} description={t('products.editor.availableHint')} />
|
||||
<Switch checked={form.quick_add_enabled} onChange={v => set('quick_add_enabled', v)} label={t('products.editor.quickAdd')} info={<InfoTip>{t('products.editor.quickAddTip')}</InfoTip>} description={t('products.editor.quickAddHint')} />
|
||||
<MediaField value={form.image} onChange={image => set('image', image)} nameAfter={shownText(form.names, venue, form.name)} label={t('media.photo')} testid="product-photo" />
|
||||
</div>
|
||||
)
|
||||
@@ -158,7 +158,7 @@ export function CostTab({ form, set, setForm }) {
|
||||
))}
|
||||
</div>
|
||||
{form.cost_mode === 'simple' ? (
|
||||
<Field label={t('products.editor.costPerUnit')}><PriceInput className="w-full" value={form.cost_simple} onChange={v => set('cost_simple', v)} label={t('products.editor.costPerUnit')} /></Field>
|
||||
<Field label={t('products.editor.costPerUnit')} info={<InfoTip>{t('products.editor.costTip')}</InfoTip>}><PriceInput className="w-full" value={form.cost_simple} onChange={v => set('cost_simple', v)} label={t('products.editor.costPerUnit')} /></Field>
|
||||
) : (
|
||||
<div className="grid gap-2">
|
||||
{form.cost_breakdown.map((e, i) => (
|
||||
@@ -190,7 +190,7 @@ export function FiscalTab({ form, set, vatGroups }) {
|
||||
<Field label={t('products.editor.fiscalName')} hint={t('products.editor.fiscalNameHint')}>
|
||||
<Input className="font-mono uppercase" maxLength={30} value={form.fiscal_name} onChange={e => set('fiscal_name', e.target.value.toUpperCase())} placeholder={form.name.toUpperCase()} />
|
||||
</Field>
|
||||
<Field label={t('products.editor.vatGroup')} error={!form.fiscal_vat_group_id ? t('products.editor.vatGroupNeeded') : undefined}>
|
||||
<Field label={t('products.editor.vatGroup')} info={<InfoTip>{t('products.editor.vatGroupTip')}</InfoTip>} error={!form.fiscal_vat_group_id ? t('products.editor.vatGroupNeeded') : undefined}>
|
||||
{vatGroups.length === 0
|
||||
? <p className="text-label text-warning-ink">{t('products.editor.noVatGroups')}</p>
|
||||
: <Select value={form.fiscal_vat_group_id ?? ''} onChange={e => set('fiscal_vat_group_id', e.target.value ? Number(e.target.value) : null)}>
|
||||
|
||||
@@ -8,7 +8,7 @@ import { Camera, Trash2 } from 'lucide-react'
|
||||
import { useAccess } from '@xenia/access'
|
||||
import { errorMessage } from '@xenia/api'
|
||||
import { LANGUAGE_NAMES, useTranslation } from '@xenia/i18n'
|
||||
import { Button, Dialog, Field, Input, Select, Textarea } from '@xenia/ui'
|
||||
import { Button, Dialog, Field, InfoTip, Input, Select, Textarea } from '@xenia/ui'
|
||||
import client from '../../api/client'
|
||||
import { Avatar } from '../overview/parts'
|
||||
import { ROLES, displayName, staffBody, staffForm, staffProblems } from './staffLogic'
|
||||
@@ -67,7 +67,7 @@ export default function StaffDialog({ member, onClose, onSaved }) {
|
||||
<Field label={t('staff.username')} required hint={t('staff.usernameHint')} error={err('username')}>
|
||||
<Input value={form.username} autoCapitalize="none" onChange={e => set('username', e.target.value)} data-testid="staff-username" />
|
||||
</Field>
|
||||
<Field label={t('staff.role')} hint={isNew ? t('staff.roleHintNew') : t('staff.roleHintEdit')}>
|
||||
<Field label={t('staff.role')} info={<InfoTip>{t('staff.roleTip')}</InfoTip>} hint={isNew ? t('staff.roleHintNew') : t('staff.roleHintEdit')}>
|
||||
<Select value={form.role} onChange={e => set('role', e.target.value)} data-testid="staff-role"
|
||||
options={roles.map(r => ({ value: r, label: t(`roles.${r}`) }))} />
|
||||
</Field>
|
||||
|
||||
Reference in New Issue
Block a user