The open-source AI receptionist for businesses. Answers every call, books the appointment and hands over to a person when needed. You own the code and the data.
TypeScript ai-receptionistanswering-serviceappointment-bookinglivekitlocal-firstmcpopen-sourceself-hostedsiptelephonytypescriptvoice-agentvoice-ai
Settings: one SettingRow and FeatureLine in ui/ for every setting row (PR 1914)
Janik51804d3dfe65
diff --git a/apps/web/src/admin/Billing.test.tsx b/apps/web/src/admin/Billing.test.tsxindex 245d4d3e..45d41242 100644--- a/apps/web/src/admin/Billing.test.tsx+++ b/apps/web/src/admin/Billing.test.tsx@@ -218,10 +218,10 @@ test("Billing's own page: lines like Features under Operations and Setup, each aautomaticTax: false,}const html = renderList(null)- expect(html).toContain('<h3 class="adm-feature-group">Operations</h3>')- expect(html).toContain('<h3 class="adm-feature-group">Setup</h3>')+ expect(html).toContain('<h3 class="k-line-group">Operations</h3>')+ expect(html).toContain('<h3 class="k-line-group">Setup</h3>')expect(html.indexOf('Operations')).toBeLessThan(html.indexOf('Setup'))- expect(html.match(/class="k-card adm-feature"/g)).toHaveLength(6)+ expect(html.match(/class="k-card k-feature"/g)).toHaveLength(6)// Each line's button is a link to its page: Connect for Stripe not connected, Change for Prices and rules.expect(html).toContain('<a class="k-btn k-btn-secondary k-btn-sm" href="#admin/billing/stripe"><span>Connect</span></a>',diff --git a/apps/web/src/admin/Billing.tsx b/apps/web/src/admin/Billing.tsxindex c0ad85dd..8c65a030 100644--- a/apps/web/src/admin/Billing.tsx+++ b/apps/web/src/admin/Billing.tsx@@ -31,6 +31,7 @@ import { refreshQuery, setQueryData, useQuery } from '../cachedQuery.ts'import { fmt } from '../i18n/format.ts'import { AppLink, appLink, LinkButton } from '../ui/AppLink.tsx'import { Checkbox, Select, type SelectOption, Switch } from '../ui/controls.tsx'+import { LineGroup, LinkLine } from '../ui/FeatureLine.tsx'import {Card,CardInline,@@ -45,6 +46,7 @@ import {} from '../ui/form.tsx'import { Badge, Button, cx, Note } from '../ui/kit.tsx'import { Loading, Skeleton, SkeletonRows, SkeletonText } from '../ui/LoadStates.tsx'+import { SettingRow, SkeletonSettingRow } from '../ui/SettingRow.tsx'import { AdminList, type Column, type ListKeys } from './AdminList.tsx'import { ActionBar, type AdminAction } from './actions.tsx'import type { AdminData } from './api.ts'@@ -89,7 +91,6 @@ import {usdOfMicros,usdSymbol,} from './billingModel.ts'-import { LineGroup, LinkLine } from './FeatureLine.tsx'import { errorText, type Notify } from './notify.ts'import { day, EMPTY, when } from './parts.tsx'import { type BillingTab, billingTab } from './route.ts'@@ -307,14 +308,8 @@ function HubSkeleton() {<Fragment key={label}><LineGroup>{label}</LineGroup>{[0, 1, 2].map(line => (- <section key={line} className="k-card adm-feature">- <div className="adm-feature-line">- <div className="adm-feature-text">- <Skeleton shape="text" width={90} />- <Skeleton shape="text" width={200 + line * 30} />- </div>- <Skeleton width={56} height={28} />- </div>+ <section key={line} className="k-card k-feature">+ <SkeletonSettingRow index={line} control="button" /></section>))}</Fragment>@@ -783,24 +778,22 @@ function TaxCard({ notify }: { notify: Notify }) {const taxAddress = useQuery(asking === true ? TAX_ADDRESS : null, loadTaxAddress)return (<Card id="adm-stripe-tax" title={t('admin.bills.rules.group.tax')} className="adm-detail">- <div className="swrow adm-swrow-first">- <div>- <b>- {t('admin.bills.rules.automaticTax')}- <HelpTip text={t('admin.bills.rules.automaticTax.help')} />- </b>- <span className="help">{t('admin.bills.rules.automaticTax.short')}</span>- </div>- <Loading- what={t('admin.bills.rules.automaticTax')}- loading={on === undefined}- error={query.error}- onRetry={() => void query.reload()}- skeleton={<Skeleton width={34} height={20} className="sk-round" />}- >- <Switch on={on ?? false} onChange={setAsking} label={t('admin.bills.rules.automaticTax')} />- </Loading>- </div>+ <SettingRow+ title={t('admin.bills.rules.automaticTax')}+ help={t('admin.bills.rules.automaticTax.help')}+ description={t('admin.bills.rules.automaticTax.short')}+ control={+ <Loading+ what={t('admin.bills.rules.automaticTax')}+ loading={on === undefined}+ error={query.error}+ onRetry={() => void query.reload()}+ skeleton={<Skeleton width={34} height={20} className="sk-round" />}+ >+ <Switch on={on ?? false} onChange={setAsking} label={t('admin.bills.rules.automaticTax')} />+ </Loading>+ }+ />{asking !== null && query.data && (<ReasonDialogtitle={t(asking ? 'admin.bills.tax.confirmOn' : 'admin.bills.tax.confirmOff')}@@ -851,33 +844,33 @@ export function SelfServeCard({ notify }: { notify: Notify }) {}className="adm-detail">- <div className="swrow">- <div>- <b>{t('admin.bills.selfServe.switch')}</b>- <span className="help">- {data && !data.billingInEffect && !data.on- ? t('admin.bills.selfServe.needsBilling')- : data?.open- ? t('admin.bills.selfServe.openNow')- : t('admin.bills.selfServe.help')}- </span>- </div>- <Loading- what={t('admin.bills.selfServe.switch')}- loading={!data}- error={query.error}- onRetry={() => void query.reload()}- skeleton={<Skeleton width={34} height={20} className="sk-round" />}- >- <Switch- on={data?.on ?? false}- onChange={setAsking}- label={t('admin.bills.selfServe.switch')}- // Off always works; on needs billing through Stripe in effect and the terms set (A9).- disabled={!data || (!data.on && (!data.billingInEffect || data.termsMissing.length > 0))}- />- </Loading>- </div>+ <SettingRow+ title={t('admin.bills.selfServe.switch')}+ description={+ data && !data.billingInEffect && !data.on+ ? t('admin.bills.selfServe.needsBilling')+ : data?.open+ ? t('admin.bills.selfServe.openNow')+ : t('admin.bills.selfServe.help')+ }+ control={+ <Loading+ what={t('admin.bills.selfServe.switch')}+ loading={!data}+ error={query.error}+ onRetry={() => void query.reload()}+ skeleton={<Skeleton width={34} height={20} className="sk-round" />}+ >+ <Switch+ on={data?.on ?? false}+ onChange={setAsking}+ label={t('admin.bills.selfServe.switch')}+ // Off always works; on needs billing through Stripe in effect and the terms set (A9).+ disabled={!data || (!data.on && (!data.billingInEffect || data.termsMissing.length > 0))}+ />+ </Loading>+ }+ />{data?.on && data.closedBecause === 'bot_check_missing' && (<Note tone="danger"><T k="admin.bills.selfServe.closed.botCheck" values={{ link: appLink('#admin/providers/bot_check') }} />@@ -1119,27 +1112,26 @@ export function SignupRulesCard({ notify }: { notify: Notify }) {{data.problems.length > 0 && (<Note tone="warning">{t('admin.bills.signupRules.ignored', { fields: data.problems.join(', ') })}</Note>)}- <div className="swrow adm-swrow-first">- <div>- <b>- {t('admin.bills.signupRules.turnstile')}- <HelpTip text={t('admin.bills.signupRules.turnstile.help')} />- </b>- {form.turnstile && !data.turnstileReady && (- <span className="help">- <T- k="admin.bills.signupRules.turnstile.noKeys"- values={{ link: appLink('#admin/providers/bot_check') }}- />- </span>- )}- </div>- <Switch- on={form.turnstile}- onChange={on => setForm(f => f && { ...f, turnstile: on })}- label={t('admin.bills.signupRules.turnstile')}- />- </div>+ <SettingRow+ title={t('admin.bills.signupRules.turnstile')}+ help={t('admin.bills.signupRules.turnstile.help')}+ description={+ form.turnstile &&+ !data.turnstileReady && (+ <T+ k="admin.bills.signupRules.turnstile.noKeys"+ values={{ link: appLink('#admin/providers/bot_check') }}+ />+ )+ }+ control={+ <Switch+ on={form.turnstile}+ onChange={on => setForm(f => f && { ...f, turnstile: on })}+ label={t('admin.bills.signupRules.turnstile')}+ />+ }+ />{!form.turnstile && <Note tone="warning">{t('admin.bills.signupRules.turnstile.offWarning')}</Note>}<FormFieldid="adm-signup-domains"diff --git a/apps/web/src/admin/BillingSwitch.tsx b/apps/web/src/admin/BillingSwitch.tsxindex 81e05333..23ced877 100644--- a/apps/web/src/admin/BillingSwitch.tsx+++ b/apps/web/src/admin/BillingSwitch.tsx@@ -7,9 +7,10 @@ import { type MessageKey, msg } from '@linedesk/i18n'import { useT } from '@linedesk/i18n/react'import { useEffect, useState } from 'react'import { setQueryData, useQuery } from '../cachedQuery.ts'-import { Switch } from '../ui/controls.tsx'import { useSupportAccess } from '../supportAccess.ts'+import { Switch } from '../ui/controls.tsx'import { Loading, Skeleton } from '../ui/LoadStates.tsx'+import { SettingRow } from '../ui/SettingRow.tsx'import { type AdminData, runAdmin } from './api.ts'const BILLING = 'admin.billingEnabled'@@ -55,33 +56,35 @@ export function BillingSwitch({ data: admin }: { data: AdminData }) {const blocked = !!data && (!data.connected || (data.mode === 'live' && !data.liveAllowed))return (- <div className="swrow">- <div>- <b>{t('admin.billing.switch')}</b>- <span className="help">- {supportAccess ? t('settings.readOnly.supportAccess') : data ? t(stateLine(data)) : t('admin.billing.help')}- </span>- {problem && (+ <SettingRow+ title={t('admin.billing.switch')}+ description={+ supportAccess ? t('settings.readOnly.supportAccess') : data ? t(stateLine(data)) : t('admin.billing.help')+ }+ note={+ problem && (<span className="k-field-msg" role="alert">{problem}</span>- )}- </div>- <Loading- what={t('admin.billing.switch')}- loading={!data && !supportAccess}- error={query.error}- onRetry={() => void query.reload()}- skeleton={<Skeleton width={34} height={20} className="sk-round" />}- >- <Switch- on={on}- onChange={v => void change(v)}- label={t('admin.billing.switch')}- // Turning it off always works; on needs usable keys.- disabled={supportAccess || !data || (!on && blocked)}- />- </Loading>- </div>+ )+ }+ control={+ <Loading+ what={t('admin.billing.switch')}+ loading={!data && !supportAccess}+ error={query.error}+ onRetry={() => void query.reload()}+ skeleton={<Skeleton width={34} height={20} className="sk-round" />}+ >+ <Switch+ on={on}+ onChange={v => void change(v)}+ label={t('admin.billing.switch')}+ // Turning it off always works; on needs usable keys.+ disabled={supportAccess || !data || (!on && blocked)}+ />+ </Loading>+ }+ />)}diff --git a/apps/web/src/admin/Branding.tsx b/apps/web/src/admin/Branding.tsxindex 6eff11cf..dda0b917 100644--- a/apps/web/src/admin/Branding.tsx+++ b/apps/web/src/admin/Branding.tsx@@ -16,11 +16,11 @@ import { type MessageKey, msg } from '@linedesk/i18n'import { useT } from '@linedesk/i18n/react'import { type FormEvent, useRef, useState } from 'react'import { setBrand, useBrand } from '../brand.ts'+import { i18n } from '../i18n/index.tsx'import { Switch } from '../ui/controls.tsx'import { Card, Dialog, FormField, FormMessage, Input, onSaveKey, SaveBar } from '../ui/form.tsx'-import { HelpTip } from '../ui/HelpTip.tsx'import { Button, Icon, LogoMark } from '../ui/kit.tsx'-import { i18n } from '../i18n/index.tsx'+import { SettingRow } from '../ui/SettingRow.tsx'import { runAdmin } from './api.ts'const DEFAULT_COLOR = '#1c1917'@@ -220,15 +220,7 @@ function SupportSwitch({on: booleanonChange: (on: boolean) => void}) {- return (- <div className="swrow">- <span className="adm-brand-label">- <b>{label}</b>- <HelpTip text={help} />- </span>- <Switch on={on} onChange={onChange} label={label} />- </div>- )+ return <SettingRow title={label} help={help} control={<Switch on={on} onChange={onChange} label={label} />} />}/**@@ -258,7 +250,7 @@ export function SupportCard({}description={t('admin.branding.supportDescription', { brand: DEFAULT_PRODUCT_NAME })}>- <div className="st-swlist">+ <div className="k-setrows"><SupportSwitchlabel={t('admin.branding.starPrompt')}help={t('admin.branding.starPromptHelp', { brand: DEFAULT_PRODUCT_NAME })}diff --git a/apps/web/src/admin/CalendarTools.tsx b/apps/web/src/admin/CalendarTools.tsxindex 204063f4..7c0a7c9e 100644--- a/apps/web/src/admin/CalendarTools.tsx+++ b/apps/web/src/admin/CalendarTools.tsx@@ -6,9 +6,10 @@ import { type MessageKey, msg } from '@linedesk/i18n'import { useT } from '@linedesk/i18n/react'import { useState } from 'react'import { setQueryData, useQuery } from '../cachedQuery.ts'-import { SelectRow, SkeletonSelectRow } from '../settings/fields.tsx'-import { Loading } from '../ui/LoadStates.tsx'import type { SelectOption } from '../ui/controls.tsx'+import { Select } from '../ui/controls.tsx'+import { Loading } from '../ui/LoadStates.tsx'+import { SettingRow, SkeletonSettingRow } from '../ui/SettingRow.tsx'import { runAdmin } from './api.ts'export const TOOLS_QUERY = 'admin.calendarTools'@@ -107,24 +108,25 @@ export function CalendarTools() {loading={!data}error={query.error}onRetry={() => void query.reload()}- skeleton={- <>- {tools.map(tool => (- <SkeletonSelectRow key={tool} title={t(TOOL[tool].title)} />- ))}- </>- }+ skeleton={tools.map(tool => <SkeletonSettingRow key={tool} title={t(TOOL[tool].title)} control="select" />)}>{data &&tools.map(tool => (- <SelectRow+ <SettingRowkey={tool}- id={`adm-calendar-${tool}`}title={t(TOOL[tool].title)}description={describe(t, tool, data.modes[tool])}- value={data.modes[tool]}- options={optionsOf(t, tool, data.apps.includes(tool))}- onChange={mode => void change(tool, mode)}+ control={+ <Select+ id={`adm-calendar-${tool}`}+ size="sm"+ align="end"+ value={data.modes[tool]}+ options={optionsOf(t, tool, data.apps.includes(tool))}+ onChange={mode => void change(tool, mode)}+ label={t(TOOL[tool].title)}+ />+ }/>))}</Loading>diff --git a/apps/web/src/admin/CallQuality.tsx b/apps/web/src/admin/CallQuality.tsxindex 5c9abfba..c1b50467 100644--- a/apps/web/src/admin/CallQuality.tsx+++ b/apps/web/src/admin/CallQuality.tsx@@ -15,13 +15,13 @@ import { T, useT } from '@linedesk/i18n/react'import { useState } from 'react'import { setQueryData, useQuery } from '../cachedQuery.ts'import { i18n } from '../i18n/index.tsx'-import { SelectRow, SkeletonSelectRow, SwitchRow } from '../settings/fields.tsx'import { pricePerMinute } from '../settings/levelModel.ts'import { appLink } from '../ui/AppLink.tsx'-import type { SelectOption } from '../ui/controls.tsx'+import { Select, type SelectOption, Switch } from '../ui/controls.tsx'import { Card } from '../ui/form.tsx'import { Badge, Icon } from '../ui/kit.tsx'import { Loading } from '../ui/LoadStates.tsx'+import { SettingRow, SkeletonSettingRow } from '../ui/SettingRow.tsx'import { type AdminInputs, runAdmin } from './api.ts'import { errorText, type Notify } from './notify.ts'@@ -109,41 +109,56 @@ export function CallQualityCard({ notify }: { notify: Notify }) {onRetry={() => void query.reload()}skeleton={<>- <SkeletonSelectRow title={CALL_QUALITY_LABELS.standard} />- <SkeletonSelectRow title={CALL_QUALITY_LABELS.premium} />- <SkeletonSelectRow title={CALL_QUALITY_LABELS.ultra} />+ <SkeletonSettingRow title={CALL_QUALITY_LABELS.standard} control="none" />+ <SkeletonSettingRow title={CALL_QUALITY_LABELS.premium} />+ <SkeletonSettingRow title={CALL_QUALITY_LABELS.ultra} /></>}>{data && (<>- <div className="swrow">- <div>- <b>{CALL_QUALITY_LABELS.standard}</b>- <span className="help">{lineOf(data, 'standard')}</span>- </div>- <span className="adm-cq-always">{t('admin.callQuality.alwaysOn')}</span>- </div>- <SwitchRow+ <SettingRow+ title={CALL_QUALITY_LABELS.standard}+ description={lineOf(data, 'standard')}+ control={<span className="adm-cq-always">{t('admin.callQuality.alwaysOn')}</span>}+ />+ <SettingRowtitle={CALL_QUALITY_LABELS.premium}description={lineOf(data, 'premium')}- on={data.settings.premium}- onChange={on => void change({ premium: on }, on ? undefined : 'premium')}+ control={+ <Switch+ label={CALL_QUALITY_LABELS.premium}+ on={data.settings.premium}+ onChange={on => void change({ premium: on }, on ? undefined : 'premium')}+ />+ }/>- <SwitchRow+ <SettingRowtitle={CALL_QUALITY_LABELS.ultra}description={data.realtimeSetUp ? lineOf(data, 'ultra') : t('admin.callQuality.ultraNeedsRealtime')}- on={data.realtimeSetUp && data.settings.ultra}- disabled={!data.realtimeSetUp}- onChange={on => void change({ ultra: on }, on ? undefined : 'ultra')}+ control={+ <Switch+ label={CALL_QUALITY_LABELS.ultra}+ on={data.realtimeSetUp && data.settings.ultra}+ onChange={on => void change({ ultra: on }, on ? undefined : 'ultra')}+ disabled={!data.realtimeSetUp}+ />+ }/>- <SelectRow- id="adm-cq-default"+ <SettingRowtitle={t('admin.callQuality.newAssistants')}description={t('admin.callQuality.newAssistantsHelp')}- value={data.settings.default}- options={enabledLevels.map(l => ({ value: l, label: CALL_QUALITY_LABELS[l] }))}- onChange={next => void change({ default: next })}+ control={+ <Select+ id="adm-cq-default"+ size="sm"+ align="end"+ value={data.settings.default}+ options={enabledLevels.map(l => ({ value: l, label: CALL_QUALITY_LABELS[l] }))}+ onChange={next => void change({ default: next })}+ label={t('admin.callQuality.newAssistants')}+ />+ }/><details className="vp-more adm-cq-models" open={open} onToggle={e => setOpen(e.currentTarget.open)}><summary>@@ -188,35 +203,60 @@ function StageModels({ level, change }: ModelsProps) {<div className="adm-cq-group"><GroupHead level={level} />{level.models.length > 0 && (- <SelectRow- id={`adm-cq-${l}-llm`}+ <SettingRowtitle={t('admin.callQuality.languageModel')}- value={level.defaults.llm ?? ''}- options={choices(level.models, level.defaults.llm)}- onChange={llm => void change({ models: { [l]: { llm } } })}+ control={+ <Select+ id={`adm-cq-${l}-llm`}+ size="sm"+ align="end"+ value={level.defaults.llm ?? ''}+ options={choices(level.models, level.defaults.llm)}+ onChange={llm => void change({ models: { [l]: { llm } } })}+ label={t('admin.callQuality.languageModel')}+ />+ }/>)}{voices.map(([provider, list]) => (- <SelectRow+ <SettingRowkey={provider}- id={`adm-cq-${l}-voice-${provider}`}title={voices.length > 1? t('admin.callQuality.voiceModelOf', { provider: providerLabel(provider) }): t('admin.callQuality.voiceModel')}- value={level.defaults.voice[provider] ?? ''}- options={choices(list, level.defaults.voice[provider] ?? null)}- onChange={model => void change({ models: { [l]: { voice: { [provider]: model } } } })}+ control={+ <Select+ id={`adm-cq-${l}-voice-${provider}`}+ size="sm"+ align="end"+ value={level.defaults.voice[provider] ?? ''}+ options={choices(list, level.defaults.voice[provider] ?? null)}+ onChange={model => void change({ models: { [l]: { voice: { [provider]: model } } } })}+ label={+ voices.length > 1+ ? t('admin.callQuality.voiceModelOf', { provider: providerLabel(provider) })+ : t('admin.callQuality.voiceModel')+ }+ />+ }/>))}{level.sttModels.length > 0 && (- <SelectRow- id={`adm-cq-${l}-stt`}+ <SettingRowtitle={t('admin.callQuality.speechRecognition')}- value={level.defaults.stt ?? ''}- options={choices(level.sttModels, level.defaults.stt)}- onChange={stt => void change({ models: { [l]: { stt } } })}+ control={+ <Select+ id={`adm-cq-${l}-stt`}+ size="sm"+ align="end"+ value={level.defaults.stt ?? ''}+ options={choices(level.sttModels, level.defaults.stt)}+ onChange={stt => void change({ models: { [l]: { stt } } })}+ label={t('admin.callQuality.speechRecognition')}+ />+ }/>)}</div>@@ -230,12 +270,19 @@ function UltraModels({ level, change }: ModelsProps) {return (<div className="adm-cq-group"><GroupHead level={level} />- <SelectRow- id="adm-cq-ultra-realtime"+ <SettingRowtitle={t('admin.callQuality.realtimeModel')}- value={level.defaults.realtime ?? ''}- options={choices(level.realtimeModels, level.defaults.realtime)}- onChange={realtime => void change({ models: { ultra: { realtime } } })}+ control={+ <Select+ id="adm-cq-ultra-realtime"+ size="sm"+ align="end"+ value={level.defaults.realtime ?? ''}+ options={choices(level.realtimeModels, level.defaults.realtime)}+ onChange={realtime => void change({ models: { ultra: { realtime } } })}+ label={t('admin.callQuality.realtimeModel')}+ />+ }/></div>)diff --git a/apps/web/src/admin/Features.tsx b/apps/web/src/admin/Features.tsxindex 4b58a49d..894a9d68 100644--- a/apps/web/src/admin/Features.tsx+++ b/apps/web/src/admin/Features.tsx@@ -6,9 +6,9 @@ import { T, useT } from '@linedesk/i18n/react'import { brandName } from '../brand.ts'import { useQuery } from '../cachedQuery.ts'import { appLink } from '../ui/AppLink.tsx'+import { FeatureLine, LineGroup, type LineState, onOff, useOpenLines } from '../ui/FeatureLine.tsx'import { Card } from '../ui/form.tsx'import { CalendarTools, loadTools, TOOLS_QUERY } from './CalendarTools.tsx'-import { FeatureLine, LineGroup, type LineState, onOff, useOpenLines } from './FeatureLine.tsx'import { InternationalTransfers, loadTransfers, TRANSFERS_QUERY } from './InternationalTransfers.tsx'import { ZAPIER_SETTING } from './route.ts'import {diff --git a/apps/web/src/admin/Funnel.tsx b/apps/web/src/admin/Funnel.tsxindex 7a0d958b..61663b20 100644--- a/apps/web/src/admin/Funnel.tsx+++ b/apps/web/src/admin/Funnel.tsx@@ -5,9 +5,9 @@ import { useFormat, useT } from '@linedesk/i18n/react'import { useState } from 'react'import { useQuery } from '../cachedQuery.ts'import { Select } from '../ui/controls.tsx'+import { FeatureLine } from '../ui/FeatureLine.tsx'import { Loading, Skeleton, SkeletonRows } from '../ui/LoadStates.tsx'import { type FunnelCounts, loadFunnel } from './api.ts'-import { FeatureLine } from './FeatureLine.tsx'const RANGES = ['4', '8', '12', '26'] as consttype Range = (typeof RANGES)[number]diff --git a/apps/web/src/admin/Onboarding.tsx b/apps/web/src/admin/Onboarding.tsxindex 48ef37ad..6e21ac8a 100644--- a/apps/web/src/admin/Onboarding.tsx+++ b/apps/web/src/admin/Onboarding.tsx@@ -13,6 +13,7 @@ import { Select, Switch } from '../ui/controls.tsx'import { Card, Input } from '../ui/form.tsx'import { Button } from '../ui/kit.tsx'import { Loading, Skeleton, SkeletonRows } from '../ui/LoadStates.tsx'+import { SettingRow } from '../ui/SettingRow.tsx'import { AdminList, type Column, type ListKeys } from './AdminList.tsx'import { type AtRiskWorkspace, loadAtRisk, runAdmin } from './api.ts'import { day, when } from './parts.tsx'@@ -51,26 +52,26 @@ export function SetupEmails() {title={t('admin.onboarding.setupEmails')}help={t('admin.onboarding.setupEmailsHelp', { partner: data?.partnerDirectoryUrl ? 'yes' : 'no' })}>- <div className="swrow">- <div>- <b>{t('admin.onboarding.sendSetupEmails')}</b>- {note && <span className="help">{t(note)}</span>}- </div>- <Loading- what={t('admin.onboarding.setupEmails')}- loading={!data}- error={query.error}- onRetry={() => void query.reload()}- skeleton={<Skeleton width={34} height={20} className="sk-round" />}- >- <Switch- on={on}- onChange={v => void change(v)}- label={t('admin.onboarding.sendSetupEmails')}- disabled={!data || (!on && !data.emailConnected)}- />- </Loading>- </div>+ <SettingRow+ title={t('admin.onboarding.sendSetupEmails')}+ description={note && t(note)}+ control={+ <Loading+ what={t('admin.onboarding.setupEmails')}+ loading={!data}+ error={query.error}+ onRetry={() => void query.reload()}+ skeleton={<Skeleton width={34} height={20} className="sk-round" />}+ >+ <Switch+ on={on}+ onChange={v => void change(v)}+ label={t('admin.onboarding.sendSetupEmails')}+ disabled={!data || (!on && !data.emailConnected)}+ />+ </Loading>+ }+ />{problem && (<p className="k-field-msg" role="alert">{problem}@@ -161,18 +162,18 @@ export function FounderEmail() {)}</form><p className="help">{t('admin.onboarding.founderAddressHelp')}</p>- <div className="swrow">- <div>- <b>{t('admin.onboarding.sendFounderEmail')}</b>- {!data.emailConnected && <span className="help">{t(notConnectedLine(on))}</span>}- </div>- <Switch- on={on}- onChange={v => void save(v ? typed : null)}- label={t('admin.onboarding.sendFounderEmail')}- disabled={busy || (!on && (!valid || !data.emailConnected))}- />- </div>+ <SettingRow+ title={t('admin.onboarding.sendFounderEmail')}+ description={!data.emailConnected && t(notConnectedLine(on))}+ control={+ <Switch+ on={on}+ onChange={v => void save(v ? typed : null)}+ label={t('admin.onboarding.sendFounderEmail')}+ disabled={busy || (!on && (!valid || !data.emailConnected))}+ />+ }+ /></>)}</Loading>diff --git a/apps/web/src/admin/Overview.tsx b/apps/web/src/admin/Overview.tsxindex f2d60ed2..bb9087b6 100644--- a/apps/web/src/admin/Overview.tsx+++ b/apps/web/src/admin/Overview.tsx@@ -5,15 +5,15 @@ import { providerCategoryLabel } from '@linedesk/actions'import { T, useT } from '@linedesk/i18n/react'import type { ReactNode } from 'react'import { useQuery } from '../cachedQuery.ts'+import { fmt } from '../i18n/format.ts'+import { i18n } from '../i18n/index.tsx'+import { FeatureLine, useOpenLines } from '../ui/FeatureLine.tsx'import { cx } from '../ui/kit.tsx'import { LoadProblem, Skeleton, useLoading } from '../ui/LoadStates.tsx'import { type AdminOverview, loadOverview } from './api.ts'-import { ShopifySetups } from './ShopifySetups.tsx'-import { fmt } from '../i18n/format.ts'-import { i18n } from '../i18n/index.tsx'-import { EMPTY } from './parts.tsx'-import { FeatureLine, useOpenLines } from './FeatureLine.tsx'import { Funnel } from './Funnel.tsx'+import { EMPTY } from './parts.tsx'+import { ShopifySetups } from './ShopifySetups.tsx'const usd = (amount: number) => fmt().currency(amount, 'USD', { minimumFractionDigits: 2, maximumFractionDigits: 2 })const money = (amount: number) =>diff --git a/apps/web/src/admin/ProviderGroup.tsx b/apps/web/src/admin/ProviderGroup.tsxindex 7a0d22db..1752cb51 100644--- a/apps/web/src/admin/ProviderGroup.tsx+++ b/apps/web/src/admin/ProviderGroup.tsx@@ -26,6 +26,7 @@ import { type MessageKey, msg } from '@linedesk/i18n'import { useT } from '@linedesk/i18n/react'import { useState } from 'react'import { i18n } from '../i18n/index.tsx'+import { LineGroup } from '../ui/FeatureLine.tsx'import { HelpTip } from '../ui/form.tsx'import { Button, cx } from '../ui/kit.tsx'import { StatusMark } from '../ui/StatusMark.tsx'@@ -132,7 +133,7 @@ type Props = {}export function ProviderGroup({ group, data, lines, health, onOpen, onOneKey, embedded, folds }: Props) {- const t = useT()+ const _t = useT()// Answering shows one of its two ways at a time (tabs); the other groups all their lists.const [pickedWay, setPickedWay] = useState<VoicePipeline | null>(null)const answering = group.id === 'answering'@@ -151,11 +152,9 @@ export function ProviderGroup({ group, data, lines, health, onOpen, onOneKey, emreturn (<section id={groupAnchor(group.id)} className="adm-provcat" aria-label={group.label}>{!embedded && (- <h2>- <span className="adm-provcat-label">{group.label}</span>- {status}- {help && <HelpTip text={help} />}- </h2>+ <LineGroup as="h2" after={status} help={help || undefined}>+ {group.label}+ </LineGroup>)}{embedded && status && <p className="adm-group-status">{status}</p>}{note && (diff --git a/apps/web/src/admin/Settings.tsx b/apps/web/src/admin/Settings.tsxindex 8e52c87c..71f2cad7 100644--- a/apps/web/src/admin/Settings.tsx+++ b/apps/web/src/admin/Settings.tsx@@ -6,13 +6,13 @@ import { CALL_QUALITY_LABELS, transcriptServiceLabels } from '@linedesk/actions'import { useT } from '@linedesk/i18n/react'import { useQuery } from '../cachedQuery.ts'import { fmt } from '../i18n/format.ts'+import { FeatureLine, LineGroup, type LineState, useOpenLines } from '../ui/FeatureLine.tsx'import { Card } from '../ui/form.tsx'import { SkeletonRows } from '../ui/LoadStates.tsx'import { AFTER_CALL, AfterCallTranscript, loadAfterCall } from './AfterCallTranscript.tsx'import { type AdminData, loadLatency } from './api.ts'import { CALL_QUALITY, CallQualityCard, loadCallQuality } from './CallQuality.tsx'import { CallReviews, loadAllReviews, REVIEWS_ALL } from './CallReviews.tsx'-import { FeatureLine, LineGroup, type LineState, useOpenLines } from './FeatureLine.tsx'import type { Notify } from './notify.ts'import type { ProviderStatusState } from './providerStatus.ts'import { LATENCY, ReplyDelay, replyMedian } from './ReplyDelay.tsx'diff --git a/apps/web/src/admin/SettingsCards.tsx b/apps/web/src/admin/SettingsCards.tsxindex de06ceaf..da821d7c 100644--- a/apps/web/src/admin/SettingsCards.tsx+++ b/apps/web/src/admin/SettingsCards.tsx@@ -22,18 +22,17 @@ import { T, useFormat, useT } from '@linedesk/i18n/react'import { type ReactNode, useState } from 'react'import { brandName } from '../brand.ts'import { setQueryData, useQuery } from '../cachedQuery.ts'+import { agentLabel } from '../onboarding/AgentPicker.tsx'+import { Field } from '../settings/fields.tsx'import { externalLink } from '../settings/ZapierGuide.tsx'import { appLink, ExternalLink, LinkButton } from '../ui/AppLink.tsx'import { Switch } from '../ui/controls.tsx'-import { Field } from '../settings/fields.tsx'import { Card, Input } from '../ui/form.tsx'import { Badge, Button, cx } from '../ui/kit.tsx'import { Loading, Skeleton, SkeletonRows } from '../ui/LoadStates.tsx'+import { SettingRow } from '../ui/SettingRow.tsx'import { StatusMark } from '../ui/StatusMark.tsx'-import { type LivekitStatus, loadLivekitStatus, runAdmin, type ServiceStatus } from './api.ts'-import { agentLabel } from '../onboarding/AgentPicker.tsx'-import { InternationalTransfers } from './InternationalTransfers.tsx'-import { SignupAccess } from './SignupAccess.tsx'+import { runAdmin } from './api.ts'export const CLONING = 'admin.voiceCloning'export const loadCloning = async () => (await runAdmin('voiceCloning.get', {})) as VoiceCloningData@@ -56,25 +55,25 @@ export function VoiceCloning() {}return (<Card title={t('admin.system.cloning')} help={t('admin.system.cloningHelp', { brand: brandName() })}>- <div className="swrow">- <div>- <b>{t('admin.system.cloningAllow')}</b>- </div>- <Loading- what={t('admin.system.cloning')}- loading={!query.data}- error={query.error}- onRetry={() => void query.reload()}- skeleton={<Skeleton width={34} height={20} className="sk-round" />}- >- <Switch- on={on}- onChange={v => void change(v)}- label={t('admin.system.cloningAllow')}- disabled={!query.data}- />- </Loading>- </div>+ <SettingRow+ title={t('admin.system.cloningAllow')}+ control={+ <Loading+ what={t('admin.system.cloning')}+ loading={!query.data}+ error={query.error}+ onRetry={() => void query.reload()}+ skeleton={<Skeleton width={34} height={20} className="sk-round" />}+ >+ <Switch+ on={on}+ onChange={v => void change(v)}+ label={t('admin.system.cloningAllow')}+ disabled={!query.data}+ />+ </Loading>+ }+ />{problem && (<p className="k-field-msg" role="alert">{problem}@@ -271,28 +270,26 @@ export function GermanNumbers() {(askCodes && typedCodes.join(',') !== data.savedAreaCodes.join(',')))return (<Card title={t('admin.system.germanNumbers')} help={t('admin.system.germanNumbersHelp')}>- <div className="swrow">- <div>- <b>{t('admin.system.germanNumbersOn')}</b>- {data?.on && !data.requirementGroupId && (- <span className="help">{t('admin.system.germanNumbersNoGroup')}</span>- )}- </div>- <Loading- what={t('admin.system.germanNumbers')}- loading={!data}- error={query.error}- onRetry={() => void query.reload()}- skeleton={<Skeleton width={34} height={20} className="sk-round" />}- >- <Switch- on={data?.on ?? false}- onChange={v => void save({ on: v })}- label={t('admin.system.germanNumbersOn')}- disabled={!data || saving}- />- </Loading>- </div>+ <SettingRow+ title={t('admin.system.germanNumbersOn')}+ description={data?.on && !data.requirementGroupId && t('admin.system.germanNumbersNoGroup')}+ control={+ <Loading+ what={t('admin.system.germanNumbers')}+ loading={!data}+ error={query.error}+ onRetry={() => void query.reload()}+ skeleton={<Skeleton width={34} height={20} className="sk-round" />}+ >+ <Switch+ on={data?.on ?? false}+ onChange={v => void save({ on: v })}+ label={t('admin.system.germanNumbersOn')}+ disabled={!data || saving}+ />+ </Loading>+ }+ />{data && (<formclassName="adm-german-numbers"diff --git a/apps/web/src/admin/SignupAccessPage.tsx b/apps/web/src/admin/SignupAccessPage.tsxindex caf72e46..ad6c30b6 100644--- a/apps/web/src/admin/SignupAccessPage.tsx+++ b/apps/web/src/admin/SignupAccessPage.tsx@@ -3,8 +3,8 @@// founder. Each is one line with its state; Change opens its card in place.import { useT } from '@linedesk/i18n/react'import { useQuery } from '../cachedQuery.ts'+import { FeatureLine, LineGroup, type LineState, onOff, useOpenLines } from '../ui/FeatureLine.tsx'import { KEPT, loadSelfServe, SELF_SERVE, SelfServeCard, SignupRulesCard } from './Billing.tsx'-import { FeatureLine, LineGroup, type LineState, onOff, useOpenLines } from './FeatureLine.tsx'import type { Notify } from './notify.ts'import {FOUNDER_EMAIL,diff --git a/apps/web/src/admin/SystemPrompt.tsx b/apps/web/src/admin/SystemPrompt.tsxindex a79ae480..32405645 100644--- a/apps/web/src/admin/SystemPrompt.tsx+++ b/apps/web/src/admin/SystemPrompt.tsx@@ -16,6 +16,7 @@ import { type MessageKey, msg } from '@linedesk/i18n'import { useT } from '@linedesk/i18n/react'import { type FocusEvent, type FormEvent, type KeyboardEvent, useRef, useState } from 'react'import { setQueryData, useQuery } from '../cachedQuery.ts'+import { LineGroup } from '../ui/FeatureLine.tsx'import { Badge, Button, cx, Icon, Note } from '../ui/kit.tsx'import { Loading, SkeletonRows } from '../ui/LoadStates.tsx'import { runAdmin } from './api.ts'@@ -395,7 +396,7 @@ export function SystemPrompt() {>{GROUPS.map(group => (<div key={group.label} className="adm-prompt-group">- <h2 className="adm-prompt-group-label">{t(group.label)}</h2>+ <LineGroup as="h2">{t(group.label)}</LineGroup>{group.sections.map(section => {const keys = PROMPT_TEXT_KEYS.filter(key => PROMPT_TEXTS[key].section === section)const edited = keys.filter(key => edits.has(key)).lengthdiff --git a/apps/web/src/admin/admin.css b/apps/web/src/admin/admin.cssindex 866902c8..08c031f1 100644--- a/apps/web/src/admin/admin.css+++ b/apps/web/src/admin/admin.css@@ -616,28 +616,6 @@.adm-provlists > * {min-width: 0;}-/* A group's heading: its label looks like the Features area labels (.adm-feature-group, LIN-833); the status note- and the (?) after it stay in normal case. */-.adm-provcat h2 {- display: flex;- flex-wrap: wrap;- align-items: center;- gap: 4px 8px;- margin: 8px 2px 0;- font-size: 12px;- line-height: 16px;- font-weight: 400;- color: var(--ink-muted);-}-.adm-provcat:first-of-type h2 {- margin-top: 0;-}-.adm-provcat-label {- font-size: 10.5px;- font-weight: 600;- letter-spacing: 0.08em;- text-transform: uppercase;-}.adm-provcat-note {display: inline-flex;align-items: center;@@ -1713,13 +1691,8 @@gap: 6px;margin-top: 10px;}-.adm-prompt-group-label {- margin: 0 0 2px 2px;- color: var(--ink-muted);- font-size: 11px;- font-weight: 600;- letter-spacing: 0.06em;- text-transform: uppercase;+.adm-prompt-group > .k-line-group {+ margin-bottom: 2px;}.adm-prompt-section {gap: 2px;@@ -1918,7 +1891,7 @@grid-template-columns: minmax(0, 1fr);gap: 12px;}-.adm-billhome > .adm-feature-group:first-of-type {+.adm-billhome > .k-line-group:first-of-type {margin-top: 0;}/* The bills filter: one chip per status that has bills, with its count. */@@ -2002,14 +1975,6 @@ a.adm-chip {font-size: 12px;color: var(--ink-muted);}-/* A card's first switch row has no line above it. */-.swrow.adm-swrow-first {- padding-top: 0;- border-top: 0;-}-.swrow b .k-help {- vertical-align: middle;-}.adm-checks-row {display: flex;flex-wrap: wrap;@@ -2080,7 +2045,7 @@ a.adm-chip {padding-top: 10px;border-top: 1px solid var(--line);}-.adm-cq-group > .selrow {+.adm-cq-group > .k-setrow {padding-top: 0;border-top: 0;}@@ -2091,8 +2056,7 @@ a.adm-chip {font-size: 12.5px;font-weight: 600;}-.adm-cq > .k-card-head + .swrow,-.adm-cq > .k-card-head + * > .swrow:first-child {+.adm-cq > .k-card-head + * > .k-setrow:first-child {padding-top: 0;border-top: 0;}@@ -2355,49 +2319,6 @@ a.adm-chip {}}-/* Server admin › Features (LIN-810): features under area headings, each one line until Change opens it. */-.adm-feature-group {- margin: 8px 2px -4px;- font-size: 10.5px;- font-weight: 600;- color: var(--ink-muted);- letter-spacing: 0.08em;- text-transform: uppercase;-}-.adm-feature-group:first-child {- margin-top: 0;-}-.adm-feature-line {- display: flex;- align-items: center;- gap: 12px;- min-width: 0;-}-.adm-feature-text {- display: grid;- gap: 2px;- flex: 1;- min-width: 0;-}-.adm-feature-text b {- display: inline-flex;- align-items: center;- gap: 4px;-}-.adm-feature-body {- display: grid;- gap: 12px;- padding-top: 12px;- border-top: 1px solid var(--line);-}-@media (max-width: 560px) {- .adm-feature-line {- flex-wrap: wrap;- }- .adm-feature-text {- flex-basis: 100%;- }-}/* Sign-up limits under their line on Sign-up & access: each group a heading in the one form. */.adm-rules-sub {display: grid;diff --git a/apps/web/src/admin/billingModel.ts b/apps/web/src/admin/billingModel.tsindex a6aaa89d..a7070123 100644--- a/apps/web/src/admin/billingModel.ts+++ b/apps/web/src/admin/billingModel.ts@@ -7,7 +7,7 @@ import { SIGNUP_RULE_RANGES } from '@linedesk/db/types'import { type MessageKey, msg } from '@linedesk/i18n'import { fmt, intlLocale } from '../i18n/format.ts'import { i18n } from '../i18n/index.tsx'-import type { LineState } from './FeatureLine.tsx'+import type { LineState } from '../ui/FeatureLine.tsx'import { formatUsd } from './model.ts'import { stripeEventsHref } from './route.ts'diff --git a/apps/web/src/app.css b/apps/web/src/app.cssindex 9e56b056..d1f0cac9 100644--- a/apps/web/src/app.css+++ b/apps/web/src/app.css@@ -540,7 +540,7 @@ a.auth-switch {padding-top: 14px;border-top: 1px solid var(--line);}-/* Sign-in & security: one block per method, its name and state at the left, its one button at the right (LIN-766). */+/* Sign-in & security: one block per method, its SettingRow on top and what it opens below it (LIN-766). */.ac-methods {display: grid;gap: 14px;@@ -549,49 +549,6 @@ a.auth-switch {padding-top: 0;border-top: 0;}-.ac-method-head {- display: flex;- align-items: center;- justify-content: space-between;- gap: 16px;- min-height: 32px;-}-.ac-method-text {- display: grid;- gap: 2px;- min-width: 0;-}-.ac-method-title {- display: flex;- align-items: center;- gap: 8px;- flex-wrap: wrap;-}-.ac-method-title h3 {- margin: 0;- font-size: 13.5px;- font-weight: 600;-}-.ac-method-head > .ac-actions {- flex: none;-}-/* The passkeys under their header: quiet grey rows, Remove as a ghost button. */-.ac-quiet-list {- gap: 4px;-}-.ac-quiet-list .ac-session,-.ac-quiet-list .ac-session:first-child {- min-height: 0;- padding: 8px 6px 8px 12px;- border-top: 0;- border-radius: var(--radius-sm);- background: var(--surface-hover);-}-@media (max-width: 640px) {- .ac-method-head {- flex-wrap: wrap;- }-}.ac-inline {display: flex;align-items: center;@@ -614,8 +571,7 @@ a.auth-switch {overflow: hidden;text-overflow: ellipsis;}-.ac-actions,-.ac-row-actions {+.ac-actions {display: flex;align-items: center;justify-content: flex-end;@@ -631,28 +587,7 @@ a.auth-switch {margin: 0;padding: 0;display: grid;-}-.ac-session {- display: flex;- align-items: center;- justify-content: space-between;- gap: 16px;- min-height: 48px;- padding: 8px 0;- border-top: 1px solid var(--line);-}-.ac-session:first-child {- border-top: 0;- padding-top: 0;-}-.ac-session > div:first-child {- display: grid;- gap: 2px;- min-width: 0;-}-.ac-session b {- font-size: 13.5px;- font-weight: 500;+ gap: 10px;}/* "Show N more" under the sessions: the ghost button's label starts at the list's left edge. */#ac-sessions > div:not([class]) > .k-btn-ghost:only-child {@@ -2995,9 +2930,9 @@ button.k-link {line-height: 22px;overflow-wrap: anywhere;}-.ws-identity .adm-feature-body {+.ws-identity .k-feature-body {margin-top: 14px;}-.ws-general > .adm-feature-group {+.ws-general > .k-line-group {margin-top: 12px;}diff --git a/apps/web/src/integrations/ConnectedApp.tsx b/apps/web/src/integrations/ConnectedApp.tsxindex 06c14304..31335625 100644--- a/apps/web/src/integrations/ConnectedApp.tsx+++ b/apps/web/src/integrations/ConnectedApp.tsx@@ -27,13 +27,14 @@ import { useFormat, useT } from '@linedesk/i18n/react'import { useEffect, useState } from 'react'import { refreshQuery, useQuery } from '../cachedQuery.ts'import { refreshOnReturn } from '../refreshOnReturn.ts'-import { Section, SwitchRow } from '../settings/fields.tsx'+import { Section } from '../settings/fields.tsx'import { callAction, readAction, useWriteAction } from '../settings/settings-api.ts'import { useRows, useRun } from '../store.tsx'-import { Checkbox } from '../ui/controls.tsx'+import { Checkbox, Switch } from '../ui/controls.tsx'import { Badge, Button, Icon } from '../ui/kit.tsx'import { Loading, SkeletonList, useLoadState } from '../ui/LoadStates.tsx'import { List, ListEmpty, ListRow } from '../ui/list.tsx'+import { SettingRow } from '../ui/SettingRow.tsx'import { appConnectErrorKey, appConnectResult, appPushErrorKey, appSettingsWith, nameKey } from './catalog.ts'import { SHOPIFY_SETUP, ShopifyNotConnected, shopToConnect, withoutConnect } from './ShopifySetup.tsx'@@ -481,16 +482,21 @@ function AppSettings({const text = settingText(app, id)const inverted = INVERTED.includes(id)return (- <SwitchRow+ <SettingRowkey={id}title={t(text.title)}description={t(text.help, { name })}- tip={t(text.tip, { name })}- on={inverted ? !on(id) : on(id)}- onChange={value => set(id, inverted ? !value : value)}- disabled={!canEdit}- nested={AFTER_LOG_CALLS.includes(id)}dimmed={AFTER_LOG_CALLS.includes(id) && !logging}+ nested={AFTER_LOG_CALLS.includes(id)}+ control={+ <Switch+ label={t(text.title)}+ on={inverted ? !on(id) : on(id)}+ onChange={value => set(id, inverted ? !value : value)}+ disabled={!canEdit}+ title={t(text.tip, { name })}+ />+ }/>)}@@ -551,7 +557,7 @@ function AppSettings({<section key={g.title} className="ig-swgroup" aria-label={t(g.title)}><h3>{t(g.title)}</h3>{g.help && <p className="help">{t(g.help, { name })}</p>}- <div className="st-swlist">{g.ids.map(row)}</div>+ <div className="k-setrows">{g.ids.map(row)}</div></section>))}{app === 'shopify' && (@@ -569,7 +575,7 @@ function AppSettings({)}</div>) : (- <div className="st-swlist">{APP_SETTINGS[app].map(row)}</div>+ <div className="k-setrows">{APP_SETTINGS[app].map(row)}</div>)}{app === 'shopify' && (<div className="ig-setup-done">diff --git a/apps/web/src/integrations/catalog.test.ts b/apps/web/src/integrations/catalog.test.tsindex 3779650f..79d49fb9 100644--- a/apps/web/src/integrations/catalog.test.ts+++ b/apps/web/src/integrations/catalog.test.ts@@ -2,41 +2,42 @@ import { appConnectErrors } from '@linedesk/actions'import { appErrorCodes } from '@linedesk/db/types'import { type MessageKey, msg } from '@linedesk/i18n'import en from '@linedesk/i18n/locales/en/settings.json'+import { createElement } from 'react'+import { renderToStaticMarkup } from 'react-dom/server'import { describe, expect, it, test } from 'vitest'+import { Switch } from '../ui/controls.tsx'+import { SettingRow } from '../ui/SettingRow.tsx'import {appConnectErrorKey,- catalogView,- SUGGESTED_FOR_TRAIT,- SUGGESTED_MAX,- suggestedFor,appConnectResult,appPushErrorKey,appSettingsWith,byCategory,CATALOG,CATEGORIES,+ catalogView,claudeCodeCommand,claudeCodeKeyCommand,- codexCommand,claudeInstallLink,+ codexCommand,cursorInstallLink,- geminiCommand,- vscodeInstallLink,DETAIL_IDS,- IN_PROGRESS_IDS,type Facts,+ geminiCommand,+ IN_PROGRESS_IDS,lineKey,+ mailConnectResult,mcpJson,nameKey,placeOf,- searchIntegrations,type Status,+ SUGGESTED_FOR_TRAIT,+ SUGGESTED_MAX,+ searchIntegrations,statusOf,- mailConnectResult,+ suggestedFor,+ vscodeInstallLink,} from './catalog.ts'-import { createElement } from 'react'-import { renderToStaticMarkup } from 'react-dom/server'-import { SwitchRow } from '../settings/fields.tsx'const text = (key: MessageKey) => (en as Record<string, string>)[key.replace(/^settings\./, '')] ?? keyconst ids = (list: readonly { id: string }[]) => list.map(i => i.id)@@ -389,17 +390,20 @@ describe('What Linedesk does (app switches, LIN-367)', () => {it('each switch is a keyboard-reachable button with its tooltip; the options under logging are nested', () => {const html = renderToStaticMarkup(- createElement(SwitchRow, {+ createElement(SettingRow, {title: 'Add new callers as contacts',- tip: 'Turn adding new callers to HubSpot on or off',- on: false,- onChange: () => {},nested: true,+ control: createElement(Switch, {+ label: 'Add new callers as contacts',+ title: 'Turn adding new callers to HubSpot on or off',+ on: false,+ onChange: () => {},+ }),}),)expect(html).toContain('<button type="button" role="switch" class="sw" aria-checked="false"')expect(html).toContain('title="Turn adding new callers to HubSpot on or off"')- expect(html).toContain('swrow is-nested')+ expect(html).toContain('k-setrow is-nested')})it('a skipped call says why', () => {diff --git a/apps/web/src/integrations/integrations.css b/apps/web/src/integrations/integrations.cssindex 56327645..b96a4016 100644--- a/apps/web/src/integrations/integrations.css+++ b/apps/web/src/integrations/integrations.css@@ -314,7 +314,7 @@.ig-swgroup > .help {margin: 0 0 10px;}-.ig-swgroup > h3 + .st-swlist {+.ig-swgroup > h3 + .k-setrows {margin-top: 8px;}diff --git a/apps/web/src/partner/ClientSettingsDialog.tsx b/apps/web/src/partner/ClientSettingsDialog.tsxindex 779ca28f..a1f29460 100644--- a/apps/web/src/partner/ClientSettingsDialog.tsx+++ b/apps/web/src/partner/ClientSettingsDialog.tsx@@ -12,10 +12,11 @@ import {import { useFormat, useT } from '@linedesk/i18n/react'import { useState } from 'react'import { useQuery } from '../cachedQuery.ts'-import { SwitchRow } from '../settings/fields.tsx'import { callAction } from '../settings/settings-api.ts'+import { Switch } from '../ui/controls.tsx'import { Dialog, FormField, Input } from '../ui/form.tsx'import { Button, cx, Note } from '../ui/kit.tsx'+import { SettingRow } from '../ui/SettingRow.tsx'import { barWidth, usageTone } from './clientModel.ts'import { keysErrorText, PARTNER_KEYS_QUERY } from './PartnerKeys.tsx'@@ -121,17 +122,21 @@ export function ClientSettingsDialog({ partnerId, client, owner, onClose, onSaveonChange={e => setLimit(e.target.value)}/></FormField>- <SwitchRow+ <SettingRowtitle={t('team.partner.clients.callQuality.title')}description={owner || client.clientCallQuality? t('team.partner.clients.callQuality.help'): t('team.partner.clients.callQuality.helpAdmin')}- on={clientQuality}- onChange={setClientQuality}- // Giving it to the client is the partner's owner's; anyone on the team takes it back.- disabled={!owner && !client.clientCallQuality}+ control={+ <Switch+ label={t('team.partner.clients.callQuality.title')}+ on={clientQuality}+ onChange={setClientQuality}+ disabled={!owner && !client.clientCallQuality}+ />+ }/>{owner && client.billed && <OwnKeys partnerId={partnerId} client={client} on={ownKeys} onChange={setOwnKeys} />}{problem && (@@ -207,7 +212,7 @@ function OwnKeys({if (!anyKey && !client.ownKeys) return nullconst ready = !!keys && (keys.ready.threeStage || keys.ready.realtime)return (- <SwitchRow+ <SettingRowtitle={t('team.partner.clients.ownKeys.title')}description={!ready@@ -216,9 +221,14 @@ function OwnKeys({? t('team.partner.clients.ownKeys.help'): t('team.partner.clients.ownKeys.needsCarrier')}- on={on}- onChange={onChange}- disabled={!!keys?.disabled && !on}+ control={+ <Switch+ label={t('team.partner.clients.ownKeys.title')}+ on={on}+ onChange={onChange}+ disabled={!!keys?.disabled && !on}+ />+ }/>)}diff --git a/apps/web/src/settings/AssistantSettings.tsx b/apps/web/src/settings/AssistantSettings.tsxindex c69320ad..ee0b5c75 100644--- a/apps/web/src/settings/AssistantSettings.tsx+++ b/apps/web/src/settings/AssistantSettings.tsx@@ -10,7 +10,6 @@ import {type AiDisclosure,type AssistantLanguages,aiDisclosureRisk,- answeredQuestionLine,BEHAVIOURS,type BehaviourId,COMMUNICATION_STYLES,@@ -48,11 +47,12 @@ import { useOutboundCountries } from '../onboarding/outbound-number.ts'import { openGroupCount } from '../review/reviewModel.ts'import { useAssistants, useRows, useRun } from '../store.tsx'import { appLink } from '../ui/AppLink.tsx'-import { RadioCard } from '../ui/controls.tsx'+import { RadioCard, Select, Switch } from '../ui/controls.tsx'import { FormMessage, Input, onSaveKey, SaveBar, Textarea } from '../ui/form.tsx'import { Button, Icon, Note } from '../ui/kit.tsx'import { Loading, LoadProblem, Skeleton, useLoading, useLoadState } from '../ui/LoadStates.tsx'import { type SearchOption, SearchSelect } from '../ui/SearchSelect.tsx'+import { SettingRow } from '../ui/SettingRow.tsx'import { type PageSection, SettingsLayout, sectionHash, sectionParts, useSection } from '../ui/SettingsLayout.tsx'import { StatusMark } from '../ui/StatusMark.tsx'import { useWorkspaceCountry, useWorkspaceLanguage } from '../workspaceLocale.ts'@@ -105,9 +105,7 @@ import {FollowsLine,ReadOnlyNote,Section,- SelectRow,SkeletonSection,- SwitchRow,TextArea,TextInput,} from './fields.tsx'@@ -423,23 +421,35 @@ function Behaviours({ draft, set }: SectionProps) {description={t('settings.assistant.rules.description')}help={t('settings.assistant.rules.help', { name: assistantName(draft, t) })}>- <div className="as-checklist">+ <div className="k-setrows as-checklist"><AiDisclosureRow draft={draft} set={set} />- <SelectRow- id="as-style"+ <SettingRowtitle={t('settings.assistant.rules.style')}description={t('settings.assistant.rules.styleDescription', { name: nameInSentence(draft, t) })}- value={draft.communication_style}- options={COMMUNICATION_STYLES.map(style => ({ value: style, label: t(STYLE_LABELS[style]) }))}- onChange={style => set('communication_style', style)}+ control={+ <Select+ id="as-style"+ size="sm"+ align="end"+ value={draft.communication_style}+ options={COMMUNICATION_STYLES.map(style => ({ value: style, label: t(STYLE_LABELS[style]) }))}+ onChange={style => set('communication_style', style)}+ label={t('settings.assistant.rules.style')}+ />+ }/>{BEHAVIOURS.map(b => (- <SwitchRow+ <SettingRowkey={b.id}title={t(BEHAVIOUR_LABELS[b.id])}aside={draft.behaviours[b.id] === b.on ? undefined : t('settings.assistant.rules.changed')}- on={draft.behaviours[b.id]}- onChange={on => set('behaviours', { ...draft.behaviours, [b.id]: on })}+ control={+ <Switch+ label={t(BEHAVIOUR_LABELS[b.id])}+ on={draft.behaviours[b.id]}+ onChange={on => set('behaviours', { ...draft.behaviours, [b.id]: on })}+ />+ }/>))}</div>@@ -560,14 +570,21 @@ export function AiDisclosureRow({ draft, set }: SectionProps) {: nullreturn (<>- <SelectRow- id="as-ai-disclosure"+ <SettingRowtitle={t('settings.assistant.disclosure.title')}description={t('settings.assistant.disclosure.description', { name })}note={lawHint}- value={draft.ai_disclosure}- options={AI_DISCLOSURE_MODES.map(mode => ({ value: mode, label: t(DISCLOSURE_LABELS[mode]) }))}- onChange={pick}+ control={+ <Select+ id="as-ai-disclosure"+ size="sm"+ align="end"+ value={draft.ai_disclosure}+ options={AI_DISCLOSURE_MODES.map(mode => ({ value: mode, label: t(DISCLOSURE_LABELS[mode]) }))}+ onChange={pick}+ label={t('settings.assistant.disclosure.title')}+ />+ }/>{risk.level === 'strong' && (<Note tone="warning">diff --git a/apps/web/src/settings/Billing.test.tsx b/apps/web/src/settings/Billing.test.tsxindex 9ad0655d..b7e110c9 100644--- a/apps/web/src/settings/Billing.test.tsx+++ b/apps/web/src/settings/Billing.test.tsx@@ -674,7 +674,7 @@ test('a partner bill speaks of client workspaces: numbers, calls at the same timexpect(pastDue).toContain('Each 5 more cost $5 a month; you can add them once your plan is paid.')expect(pastDue).not.toContain('after the trial')expect(html).not.toContain('Your assistant answers')- expect(html).toContain('<b>Brightwater Plumbing & Heating</b>')+ expect(html).toContain('<b class="k-setrow-title">Brightwater Plumbing & Heating</b>')expect(html).toContain('Calls at the same time in Brightwater Plumbing & Heating')// Free of charge: counted in client workspaces.const comped = render({ billingOn: true, bill: partner({ status: 'comped', workspaces: 2 }) })diff --git a/apps/web/src/settings/Billing.tsx b/apps/web/src/settings/Billing.tsxindex 81b98406..f080a6f7 100644--- a/apps/web/src/settings/Billing.tsx+++ b/apps/web/src/settings/Billing.tsx@@ -38,7 +38,7 @@ import { useAssistantNameIfAny } from '../store.tsx'import { tabWorkspace } from '../tabWorkspace.ts'import { readTrialLink, takeAlreadyRunning } from '../trialLink.ts'import { appLink, ExternalLink, LinkButton } from '../ui/AppLink.tsx'-import { Select } from '../ui/controls.tsx'+import { Select, Switch } from '../ui/controls.tsx'import { DangerConfirmDialog } from '../ui/DangerConfirmDialog.tsx'import { Dialog, FormField, Input } from '../ui/form.tsx'import { Badge, Button, Note } from '../ui/kit.tsx'@@ -46,6 +46,7 @@ import { Loading, Skeleton } from '../ui/LoadStates.tsx'import { List, ListEmpty, ListRow } from '../ui/list.tsx'import { PlanCard, usePlanPrice } from '../ui/PlanCard.tsx'import { PriceLine, usePrice } from '../ui/price.tsx'+import { SettingRow } from '../ui/SettingRow.tsx'import {ADD_CALLS_PARAM,AMOUNT_CHOICES,@@ -80,7 +81,7 @@ import {yearlyRefundLine,} from './billingModel.ts'import { loadOverview, loadState, loadWorkspaceUsage, OVERVIEW, STATE, WORKSPACE_USAGE } from './billingQueries.ts'-import { Section, SwitchRow } from './fields.tsx'+import { Section } from './fields.tsx'import { callAction } from './settings-api.ts'import { zoneCity } from './timeZones.ts'import './billing.css'@@ -903,45 +904,50 @@ function CallsCard({ bill, toast }: { bill: BillingOverviewBill; toast: (text: s}>{calls.workspaces.map(w => (- <div className="swrow billing-calls-row" key={w.workspaceId}>- <div>- <b>{several ? w.name : t('settings.billing.calls.rowTitle')}</b>- <span className="help">- {w.extraCalls- ? t(- // Added at activation in a trial: charged with the plan, and in use, from the trial's end.- bill.status === 'trialing'- ? 'settings.billing.calls.rowExtraTrial'- : 'settings.billing.calls.rowExtra',- { count: w.limit, price: price(w.extraCalls) },- )- : t('settings.billing.calls.rowIncluded', { count: w.limit })}- </span>- {w.busyCallers > 0 && (+ <SettingRow+ key={w.workspaceId}+ title={several ? w.name : t('settings.billing.calls.rowTitle')}+ description={+ w.extraCalls+ ? t(+ // Added at activation in a trial: charged with the plan, and in use, from the trial's end.+ bill.status === 'trialing'+ ? 'settings.billing.calls.rowExtraTrial'+ : 'settings.billing.calls.rowExtra',+ { count: w.limit, price: price(w.extraCalls) },+ )+ : t('settings.billing.calls.rowIncluded', { count: w.limit })+ }+ note={+ w.busyCallers > 0 && (<span className="help">{t('settings.billing.calls.busyCallers', { count: w.busyCallers, days: BUSY_WINDOW_DAYS })}</span>- )}- </div>- <Select- id={`billing-calls-${w.workspaceId}`}- size="sm"- align="end"- value={String(w.extraCalls)}- disabled={!editable}- label={several ? t('settings.billing.calls.labelFor', { name: w.name }) : t('settings.billing.calls.label')}- options={extraCallChoices(calls, w.extraCalls).map(extra => ({- value: String(extra),- label: t('settings.billing.calls.option', { count: calls.includedPerWorkspace + extra }),- description:- extra === 0- ? t('settings.billing.calls.optionIncluded')- : t('settings.billing.calls.optionPrice', { price: price(extra) }),- disabled: extra > w.extraCalls && !calls.canAdd,- }))}- onChange={v => setAsking({ workspaceId: w.workspaceId, name: w.name, from: w.extraCalls, to: Number(v) })}- />- </div>+ )+ }+ control={+ <Select+ id={`billing-calls-${w.workspaceId}`}+ size="sm"+ align="end"+ value={String(w.extraCalls)}+ disabled={!editable}+ label={+ several ? t('settings.billing.calls.labelFor', { name: w.name }) : t('settings.billing.calls.label')+ }+ options={extraCallChoices(calls, w.extraCalls).map(extra => ({+ value: String(extra),+ label: t('settings.billing.calls.option', { count: calls.includedPerWorkspace + extra }),+ description:+ extra === 0+ ? t('settings.billing.calls.optionIncluded')+ : t('settings.billing.calls.optionPrice', { price: price(extra) }),+ disabled: extra > w.extraCalls && !calls.canAdd,+ }))}+ onChange={v => setAsking({ workspaceId: w.workspaceId, name: w.name, from: w.extraCalls, to: Number(v) })}+ />+ }+ />))}{!calls.canAdd && editable && (<span className="help">@@ -1586,7 +1592,7 @@ function AutoRechargeCard({ bill, toast }: { bill: BillingOverviewBill; toast: (return (<Section id="billing-auto" title={t('settings.billing.auto.title')}>- <SwitchRow+ <SettingRowtitle={t('settings.billing.auto.switch')}description={auto.on@@ -1596,9 +1602,14 @@ function AutoRechargeCard({ bill, toast }: { bill: BillingOverviewBill; toast: (}): terms}- on={auto.on}- disabled={!editable}- onChange={on => void save({ ...auto, on })}+ control={+ <Switch+ label={t('settings.billing.auto.switch')}+ on={auto.on}+ onChange={on => void save({ ...auto, on })}+ disabled={!editable}+ />+ }/>{auto.on && (<div className="billing-row">@@ -1634,25 +1645,23 @@ function AutoRechargeCard({ bill, toast }: { bill: BillingOverviewBill; toast: (</FormField></div>)}- <div className="swrow">- <div>- <b>{t('settings.billing.cap.title')}</b>- <span className="help">- {t(bill.taxed ? 'settings.billing.cap.textTaxed' : 'settings.billing.cap.text', {- cap: money(bill.cap.effectiveCents),- used: money(bill.cap.usedThisMonthCents),- })}- </span>- </div>- <Button- size="sm"- disabled={!editable}- title={t('settings.billing.cap.buttonTip')}- onClick={() => setCapOpen(true)}- >- {t('settings.billing.cap.button')}- </Button>- </div>+ <SettingRow+ title={t('settings.billing.cap.title')}+ description={t(bill.taxed ? 'settings.billing.cap.textTaxed' : 'settings.billing.cap.text', {+ cap: money(bill.cap.effectiveCents),+ used: money(bill.cap.usedThisMonthCents),+ })}+ control={+ <Button+ size="sm"+ disabled={!editable}+ title={t('settings.billing.cap.buttonTip')}+ onClick={() => setCapOpen(true)}+ >+ {t('settings.billing.cap.button')}+ </Button>+ }+ />{capOpen && <CapDialog bill={bill} onClose={() => setCapOpen(false)} toast={toast} />}</Section>)diff --git a/apps/web/src/settings/CallQuality.tsx b/apps/web/src/settings/CallQuality.tsxindex a7c64ca9..f2ccaf39 100644--- a/apps/web/src/settings/CallQuality.tsx+++ b/apps/web/src/settings/CallQuality.tsx@@ -17,10 +17,11 @@ import { useT } from '@linedesk/i18n/react'import { useState } from 'react'import { i18n } from '../i18n/index.tsx'import { LinkButton } from '../ui/AppLink.tsx'-import { RadioCard, type SelectOption } from '../ui/controls.tsx'+import { RadioCard, Select, type SelectOption } from '../ui/controls.tsx'import { Badge, Icon } from '../ui/kit.tsx'+import { SettingRow } from '../ui/SettingRow.tsx'import type { Draft } from './assistantDraft.ts'-import { Section, SelectRow } from './fields.tsx'+import { Section } from './fields.tsx'import { DEFAULT_CHOICE, levelName, levelPrice, pricePerMinute } from './levelModel.ts'import { useVoiceOptions } from './VoiceSettings.tsx'@@ -141,38 +142,59 @@ export function CallQualitySettings({ picks, onChange, name, savedLevel }: Props</summary><div className="vp-more-body">{level === 'ultra' ? (- <SelectRow- id="as-realtime-model"+ <SettingRowtitle={t('settings.voice.quality.realtimeModel')}description={t('settings.voice.quality.realtimeModelHelp')}- value={picks.realtime_model}- options={modelOptions(current.realtimeModels, current.defaults.realtime, picks.realtime_model)}- onChange={realtime_model => onChange({ ...picks, realtime_model })}+ control={+ <Select+ id="as-realtime-model"+ size="sm"+ align="end"+ value={picks.realtime_model}+ options={modelOptions(current.realtimeModels, current.defaults.realtime, picks.realtime_model)}+ onChange={realtime_model => onChange({ ...picks, realtime_model })}+ label={t('settings.voice.quality.realtimeModel')}+ />+ }/>) : (<>{current.models.length > 0 && (- <SelectRow- id="as-llm-model"+ <SettingRowtitle={t('settings.voice.quality.languageModel')}description={t('settings.voice.quality.languageModelHelp', { name })}- value={picks.llm_model}- options={modelOptions(current.models, current.defaults.llm, picks.llm_model)}- onChange={llm_model => onChange({ ...picks, llm_model })}+ control={+ <Select+ id="as-llm-model"+ size="sm"+ align="end"+ value={picks.llm_model}+ options={modelOptions(current.models, current.defaults.llm, picks.llm_model)}+ onChange={llm_model => onChange({ ...picks, llm_model })}+ label={t('settings.voice.quality.languageModel')}+ />+ }/>)}{voiceChoices.length > 0 && (- <SelectRow- id="as-voice-model"+ <SettingRowtitle={t('settings.voice.quality.voiceModel')}description={t('settings.voice.quality.voiceModelHelp')}- value={picks.voice.model}- options={modelOptions(- voiceChoices,- current.defaults.voice[picks.voice.provider],- picks.voice.model,- )}- onChange={model => onChange({ ...picks, voice: { ...picks.voice, model } })}+ control={+ <Select+ id="as-voice-model"+ size="sm"+ align="end"+ value={picks.voice.model}+ options={modelOptions(+ voiceChoices,+ current.defaults.voice[picks.voice.provider],+ picks.voice.model,+ )}+ onChange={model => onChange({ ...picks, voice: { ...picks.voice, model } })}+ label={t('settings.voice.quality.voiceModel')}+ />+ }/>)}</>diff --git a/apps/web/src/settings/Holidays.tsx b/apps/web/src/settings/Holidays.tsxindex aae7c741..856375a4 100644--- a/apps/web/src/settings/Holidays.tsx+++ b/apps/web/src/settings/Holidays.tsx@@ -13,8 +13,9 @@ import { useRun } from '../store.tsx'import { Checkbox, Select, Switch } from '../ui/controls.tsx'import { DateInput, Dialog, Input } from '../ui/form.tsx'import { Button } from '../ui/kit.tsx'-import { List, ListEmpty, ListRow, MenuButton, type MenuItem } from '../ui/list.tsx'import { Loading, SkeletonList } from '../ui/LoadStates.tsx'+import { List, ListEmpty, ListRow, MenuButton, type MenuItem } from '../ui/list.tsx'+import { SettingRow, SkeletonSettingRow } from '../ui/SettingRow.tsx'import { endTimeOptions, startTimeOptions } from './businessHoursModel.ts'import {addDays,@@ -213,16 +214,14 @@ export function Holidays({ canEdit, toast }: Props) {<Loadingwhat={t('settings.holidays.publicHolidays')}loading={!loaded}- skeleton={<SkeletonList rows={1} action />}+ skeleton={<SkeletonSettingRow control="button" />}>- <List label={t('settings.holidays.publicHolidays')} className="hd-calendar">- <CalendarRow- calendar={calendar}- canEdit={canEdit}- onChoose={() => setChoosing(true)}- onToggle={on => calendar && setCalendar({ ...calendar, on })}- />- </List>+ <CalendarRow+ calendar={calendar}+ canEdit={canEdit}+ onChoose={() => setChoosing(true)}+ onToggle={on => calendar && setCalendar({ ...calendar, on })}+ /></Loading>{choosing && (<CalendarDialog@@ -308,10 +307,11 @@ function CalendarRow({const names = usePlaceNames(calendar)if (!calendar) {return (- <ListRow+ <SettingRow+ className="hd-calendar"title={t('settings.holidays.publicHolidays')}- sub={t('settings.holidays.calendar.notSet')}- actions={+ description={t('settings.holidays.calendar.notSet')}+ control={canEdit && (<Button size="sm" icon="calendar" onClick={onChoose}>{t('settings.holidays.calendar.choose')}@@ -322,17 +322,18 @@ function CalendarRow({)}return (- <ListRow- off={!calendar.on}+ <SettingRow+ className="hd-calendar"+ dimmed={!calendar.on}title={t('settings.holidays.publicHolidays')}- sub={+ description={calendar.on? names? calendarSummary(calendar, names.country, names.state): '…': t('settings.holidays.calendar.off')}- actions={+ control={<>{canEdit && (<Button size="sm" variant="ghost" onClick={onChoose}>@@ -446,11 +447,13 @@ function AddDay({min={today}onChange={setDate}aria-label={t('settings.holidays.add.day')}+ size="sm"className="hd-date"/><Inputvalue={name}onChange={e => setName(e.target.value)}+ size="sm"placeholder={t('settings.holidays.add.namePlaceholder')}aria-label={t('settings.holidays.add.name')}maxLength={80}@@ -458,7 +461,7 @@ function AddDay({<Checkbox checked={yearly} onChange={setYearly} className="hd-yearly">{t('settings.holidays.everyYear')}</Checkbox>- <Button type="submit" disabled={!date}>+ <Button size="sm" type="submit" disabled={!date}>{t('settings.holidays.add.button')}</Button></form>diff --git a/apps/web/src/settings/Notifications.tsx b/apps/web/src/settings/Notifications.tsxindex ec7dd1d0..f276e323 100644--- a/apps/web/src/settings/Notifications.tsx+++ b/apps/web/src/settings/Notifications.tsx@@ -3,23 +3,24 @@// permission itself) and setup emails. Call emails (also for assigned calls) are set in one place for the whole team, Assistant ›// Email notifications (CallEmails.tsx); the line under the switches links there.import type { NotificationSettingsData } from '@linedesk/actions'+import { T, useT } from '@linedesk/i18n/react'import { type ReactNode, useEffect, useState } from 'react'import { brandName } from '../brand.ts'+import { i18n } from '../i18n/index.tsx'import { currentSubscription, pushSupport, subscribeThisBrowser, thisDeviceId } from '../push.ts'import {browserNotificationsSupported,setNotificationSettings,useNotificationQuery,} from '../shell/useCallNotifications.ts'+import { useWorkspaces } from '../shell/WorkspaceSwitcher.tsx'import { useRun } from '../store.tsx'import { changedByLabel } from '../team/team-model.ts'-import { useWorkspaces } from '../shell/WorkspaceSwitcher.tsx'+import { appLink } from '../ui/AppLink.tsx'+import { Switch } from '../ui/controls.tsx'import { Loading } from '../ui/LoadStates.tsx'-import { SkeletonSwitchRows, SwitchRow } from './fields.tsx'+import { SettingRow, SkeletonSettingRows } from '../ui/SettingRow.tsx'import { permissionText, useNotificationPermission } from './notificationPermission.ts'-import { T, useT } from '@linedesk/i18n/react'-import { appLink } from '../ui/AppLink.tsx'-import { i18n } from '../i18n/index.tsx'/** Where call emails are set for the whole team: Assistant › Email notifications (the first assistant's). */export const WHO_HEARS_HASH = '#assistant/emails'@@ -167,7 +168,7 @@ export function Notifications() {loadingerror={error}onRetry={() => void query.reload()}- skeleton={<SkeletonSwitchRows rows={2} />}+ skeleton={<SkeletonSettingRows rows={2} />}>{null}</Loading>@@ -218,24 +219,34 @@ export function NotificationSwitches({}) {const t = useT()return (- <div className="st-swlist">+ <div className="k-setrows">{device}{pushOn && (- <SwitchRow- nested={!!device}+ <SettingRowtitle={them ? t('account.notify.summaryThem') : t('account.notify.summaryMe')}description={them ? t('account.notify.summaryThemDescription') : t('account.notify.summaryMeDescription')}- on={settings.push.summary}- onChange={pushSummary => onChange({ pushSummary })}- disabled={pushSummaryOffOnly && !settings.push.summary}+ nested={!!device}+ control={+ <Switch+ label={them ? t('account.notify.summaryThem') : t('account.notify.summaryMe')}+ on={settings.push.summary}+ onChange={pushSummary => onChange({ pushSummary })}+ disabled={pushSummaryOffOnly && !settings.push.summary}+ />+ }/>)}{settings.setupEmails !== null && (- <SwitchRow+ <SettingRowtitle={t('account.notify.setupEmails')}description={them ? t('account.notify.setupEmailsThem') : t('account.notify.setupEmailsMe')}- on={settings.setupEmails}- onChange={setupEmails => onChange({ setupEmails })}+ control={+ <Switch+ label={t('account.notify.setupEmails')}+ on={settings.setupEmails}+ onChange={setupEmails => onChange({ setupEmails })}+ />+ }/>)}</div>@@ -263,13 +274,18 @@ function OwnNotifications({ settings }: { settings: NotificationSettingsData })pushOn={device.pushOn}onChange={change}device={- <SwitchRow+ <SettingRowtitle={t('account.notify.thisDevice')}description={device.note}- on={device.on}- onChange={on => void device.set(on)}- disabled={device.disabled}dimmed={device.disabled}+ control={+ <Switch+ label={t('account.notify.thisDevice')}+ on={device.on}+ onChange={on => void device.set(on)}+ disabled={device.disabled}+ />+ }/>}/>diff --git a/apps/web/src/settings/Recordings.tsx b/apps/web/src/settings/Recordings.tsxindex 1847a491..c5169ca0 100644--- a/apps/web/src/settings/Recordings.tsx+++ b/apps/web/src/settings/Recordings.tsx@@ -2,18 +2,19 @@// recordings are deleted by a daily job on the server; the call itself, its transcript and summary stay. With recording// off on the server (no recording store) the choice stays as saved but greyed out: nothing is recorded until recording// is turned on. The notice the assistant says after the greeting is each assistant's own (Assistant › Rules, LIN-710).-import { useReadOnlyNote } from './readOnly.ts'+import { inEeaOrUk, RECORDINGS_NOT_KEPT, recordingRetentionChoices } from '@linedesk/actions'import { T, useT } from '@linedesk/i18n/react'-import { appLink } from '../ui/AppLink.tsx'import { providerAudience } from '../providerAudience.ts'import { useRun } from '../store.tsx'+import { appLink } from '../ui/AppLink.tsx'import { Select, type SelectOption } from '../ui/controls.tsx'+import type { LineState } from '../ui/FeatureLine.tsx'import { Note } from '../ui/kit.tsx'import { Loading, Skeleton } from '../ui/LoadStates.tsx'import { Field } from './fields.tsx'+import { useReadOnlyNote } from './readOnly.ts'import { patchWorkspaceSettings, useWorkspaceSettings } from './settings-api.ts'-import type { LineState } from '../admin/FeatureLine.tsx'type Days = (typeof recordingRetentionChoices)[number]type Choice = `${Days}` | 'forever'diff --git a/apps/web/src/settings/Webhooks.tsx b/apps/web/src/settings/Webhooks.tsxindex d28c4c00..eae0ebad 100644--- a/apps/web/src/settings/Webhooks.tsx+++ b/apps/web/src/settings/Webhooks.tsx@@ -19,19 +19,20 @@ import { useT } from '@linedesk/i18n/react'import { type FormEvent, Fragment, useEffect, useState } from 'react'import { useRows, useRun } from '../store.tsx'import { useSupportAccess } from '../supportAccess.ts'-import { Loading, SkeletonList, SkeletonRows, useLoadState } from '../ui/LoadStates.tsx'import { Checkbox, Switch } from '../ui/controls.tsx'+import { DangerConfirmDialog } from '../ui/DangerConfirmDialog.tsx'import { Dialog, Input } from '../ui/form.tsx'import type { HelpContent } from '../ui/HelpTip.tsx'import { Badge, Button } from '../ui/kit.tsx'-import { StatusMark } from '../ui/StatusMark.tsx'-import { DangerConfirmDialog } from '../ui/DangerConfirmDialog.tsx'+import { Loading, SkeletonList, SkeletonRows, useLoadState } from '../ui/LoadStates.tsx'import { List, ListEmpty, ListRow, MenuButton } from '../ui/list.tsx'-import { Field, Section, SwitchRow } from './fields.tsx'+import { StatusMark } from '../ui/StatusMark.tsx'+import { Field, Section } from './fields.tsx'import { callAction, readAction, useWriteAction } from './settings-api.ts'import { lookupTestText, WebhookLookups } from './WebhookLookups.tsx'import './webhooks.css'import { fmt } from '../i18n/format.ts'+import { SettingRow } from '../ui/SettingRow.tsx'/** Each hook's name (the switch, the Send checkbox) and its test item in the row's menu. */const HOOK_LABEL: Record<WebhookHook, MessageKey> = {@@ -149,12 +150,13 @@ function HookSwitches({ endpoint, toast }: { endpoint: WebhookEndpoint; toast: P<div className="wh-hooks">{webhookHooks.map(hook => (<Fragment key={hook}>- <SwitchRow+ <SettingRowtitle={t(HOOK_LABEL[hook])}description={hookLine(t, hook)}help={hookTip(t, hook)}- on={endpoint.hooks.includes(hook)}- onChange={on => set(hook, on)}+ control={+ <Switch label={t(HOOK_LABEL[hook])} on={endpoint.hooks.includes(hook)} onChange={on => set(hook, on)} />+ }/>{hook === 'during_call' && endpoint.hooks.includes(hook) && (<WebhookLookups endpoint={endpoint} toast={toast} />diff --git a/apps/web/src/settings/WorkspaceGeneral.tsx b/apps/web/src/settings/WorkspaceGeneral.tsxindex 0e558bc7..ed7b5d2f 100644--- a/apps/web/src/settings/WorkspaceGeneral.tsx+++ b/apps/web/src/settings/WorkspaceGeneral.tsx@@ -6,18 +6,34 @@// change them; members see them, with one note on top saying why they can't. Under Calls, lines as on Server admin ›// Features: Recordings and, for owners and admins, Export calls. `#workspace/general/edit`, `…/recordings` and// `…/export` open the part they name.-import { type KeyboardEvent, type ReactNode, useEffect, useMemo, useRef, useState } from 'react'++import { type BusinessKind, phoneCountryName, type WorkspaceCountrySource } from '@linedesk/actions'import { useT } from '@linedesk/i18n/react'+import { type KeyboardEvent, type ReactNode, useEffect, useMemo, useRef, useState } from 'react'+import { i18n } from '../i18n/index.tsx'+import { refreshGoLiveChecklist } from '../inbox/GoLiveChecklist.tsx'import { showAppointmentValue } from '../insights/Insights.tsx'+import { rejectionText } from '../shell/rejections.ts'+import { movedHash } from '../shell/useRoute.ts'+import { WorkspaceMark, workspaceIconOf } from '../shell/WorkspaceMark.tsx'+import { useWorkspaces } from '../shell/WorkspaceSwitcher.tsx'import { useRun } from '../store.tsx'-import { Input } from '../ui/form.tsx'+import { tabWorkspace } from '../tabWorkspace.ts'import { LinkButton } from '../ui/AppLink.tsx'+import { Select } from '../ui/controls.tsx'+import { FeatureLine, LineGroup, useOpenLines } from '../ui/FeatureLine.tsx'+import { Input } from '../ui/form.tsx'+import { Button } from '../ui/kit.tsx'import { Loading, Skeleton } from '../ui/LoadStates.tsx'+import { sectionParts } from '../ui/SettingsLayout.tsx'import { AppointmentValue } from './AppointmentValue.tsx'import { useAppointmentsInUse } from './appointmentsInUse.ts'import { TimeZoneSelect } from './BusinessHours.tsx'+import { kindLabel, kindOptions } from './businessKind.ts'+import { CountrySelect } from './CountrySelect.tsx'+import { ExportCalls } from './ExportCalls.tsx'import { Field, FollowsLine, ReadOnlyNote } from './fields.tsx'-import { rejectionText } from '../shell/rejections.ts'+import { Recordings, useRecordingState } from './Recordings.tsx'import {callAction,patchWorkspaceSettings,@@ -25,28 +41,11 @@ import {useWorkspaceSettings,useWriteAction,} from './settings-api.ts'+import { useNow } from './TimeZonePicker.tsx'+import { clockIn, timeZoneLabel, zoneCity } from './timeZones.ts'+import { WorkspaceIconField } from './WorkspaceIconField.tsx'import { renameCheck, saveRename } from './workspaceGeneral.ts'-import { CountrySelect } from './CountrySelect.tsx'-import { clockIn, timeZoneLabel } from './timeZones.ts'import { AUTOMATIC, explicitCountryPatch } from './workspaceLocaleModel.ts'-import { WorkspaceIconField } from './WorkspaceIconField.tsx'-import { refreshGoLiveChecklist } from '../inbox/GoLiveChecklist.tsx'-import { Select } from '../ui/controls.tsx'-import { kindLabel, kindOptions } from './businessKind.ts'-import { type BusinessKind, phoneCountryName, type WorkspaceCountrySource } from '@linedesk/actions'-import { i18n } from '../i18n/index.tsx'-import { useNow } from './TimeZonePicker.tsx'-import { FeatureLine, LineGroup, useOpenLines } from '../admin/FeatureLine.tsx'-import '../admin/admin.css'-import { WorkspaceMark, workspaceIconOf } from '../shell/WorkspaceMark.tsx'-import { useWorkspaces } from '../shell/WorkspaceSwitcher.tsx'-import { tabWorkspace } from '../tabWorkspace.ts'-import { Button } from '../ui/kit.tsx'-import { sectionParts } from '../ui/SettingsLayout.tsx'-import { movedHash } from '../shell/useRoute.ts'-import { ExportCalls } from './ExportCalls.tsx'-import { Recordings, useRecordingState } from './Recordings.tsx'-import { zoneCity } from './timeZones.ts'/** Where an automatic country comes from ("from your assistant's number"); null when there is nothing to name. */const countrySourceLabel = (source: WorkspaceCountrySource): string | null =>@@ -176,7 +175,7 @@ export function WorkspaceGeneral({ canEdit, name, onRenamed, toast }: Props) {</Button></div>{editing && (- <div id="ws-general-fields" className="adm-feature-body">+ <div id="ws-general-fields" className="k-feature-body"><GeneralFields canEdit={canEdit} name={name} onRenamed={onRenamed} toast={toast} /></div>)}diff --git a/apps/web/src/settings/account/Preferences.tsx b/apps/web/src/settings/account/Preferences.tsxindex 41ac3cd1..9f5f8bba 100644--- a/apps/web/src/settings/account/Preferences.tsx+++ b/apps/web/src/settings/account/Preferences.tsx@@ -17,10 +17,9 @@ import {LanguageSelect,useLanguageOptions,} from '../../i18n/LanguageSelect.tsx'-import { FeatureLine, LineGroup } from '../../admin/FeatureLine.tsx'-import '../../admin/admin.css'import { browserLanguages, missingBrowserLanguage } from '../../i18n/locale.ts'import { chooseLocale } from '../../i18n/user.ts'+import { FeatureLine, LineGroup } from '../../ui/FeatureLine.tsx'import { Button, Note } from '../../ui/kit.tsx'import { Notifications } from '../Notifications.tsx'diff --git a/apps/web/src/settings/account/index.tsx b/apps/web/src/settings/account/index.tsxindex dd83a019..29686d3a 100644--- a/apps/web/src/settings/account/index.tsx+++ b/apps/web/src/settings/account/index.tsx@@ -3,24 +3,25 @@// not go through the outbox; notifications are per workspace (settings/Notifications.tsx).import type { MessageKey } from '@linedesk/i18n'import { useT } from '@linedesk/i18n/react'-import { type FormEvent, type KeyboardEvent, type ReactNode, useCallback, useEffect, useMemo, useState } from 'react'+import { type FormEvent, type KeyboardEvent, useCallback, useEffect, useMemo, useState } from 'react'import { auth, fetchMe, passkeySupported } from '../../auth.ts'import { removeAuthenticator } from '../../authenticator-api.ts'import { ConfirmEmail } from '../../ConfirmEmail.tsx'import { refreshQuery, useQuery } from '../../cachedQuery.ts'import { signInAgain } from '../../localData.ts'-import { CODE_LENGTH, normalizeCode, RESEND_AFTER_S } from '../../sign-in-code.ts'+import { movedHash } from '../../shell/useRoute.ts'import { useLegalLinks } from '../../shell/WorkspaceMenu.tsx'+import { CODE_LENGTH, normalizeCode, RESEND_AFTER_S } from '../../sign-in-code.ts'import { useImpersonating } from '../../supportAccess.ts'import { refreshTeam } from '../../team/team-api.ts'import { changedByLabel } from '../../team/team-model.ts'import { dateTimeLabel } from '../../time.ts'+import { DangerConfirmDialog } from '../../ui/DangerConfirmDialog.tsx'import { CardInline, Input, onSaveKey, SaveBar } from '../../ui/form.tsx'import { Avatar, Badge, Button, Note } from '../../ui/kit.tsx'-import { HelpTip } from '../../ui/HelpTip.tsx'import { Loading, Skeleton, SkeletonText } from '../../ui/LoadStates.tsx'+import { SettingRow, SkeletonSettingRow, SkeletonSettingRows } from '../../ui/SettingRow.tsx'import { type PageSection, SettingsLayout, sectionParts, useSection } from '../../ui/SettingsLayout.tsx'-import { movedHash } from '../../shell/useRoute.ts'import { Field, Section, TextInput } from '../fields.tsx'import { AvatarField } from './AvatarField.tsx'import {@@ -241,7 +242,7 @@ function ProfilePage({ account, reload, hasWorkspace }: SectionProps & { hasWork</Button></div>{editing && (- <div id="ac-profile-fields" className="adm-feature-body">+ <div id="ac-profile-fields" className="k-feature-body"><CardInline.Provider value={true}><Profile account={account} reload={reload} hasWorkspace={hasWorkspace} /></CardInline.Provider>@@ -491,38 +492,6 @@ function ChangeEmail({)}-/**- * One sign-in method's header line: its name (a badge, the "?"), its state under it, and its one button at the right.- * Sign-in & security is a list of these, each with what it opens below it (LIN-766).- */-function MethodHead({- title,- badge,- tip,- state,- action,-}: {- title: string- badge?: ReactNode- tip?: string- state?: ReactNode- action?: ReactNode-}) {- return (- <div className="ac-method-head">- <div className="ac-method-text">- <span className="ac-method-title">- <h3>{title}</h3>- {badge}- {tip && <HelpTip text={tip} />}- </span>- {state && <span className="help">{state}</span>}- </div>- {action && <div className="ac-actions">{action}</div>}- </div>- )-}-/** Password: Set or Not set, and Change (or Set password) opening the form in place; Esc or Cancel closes it. */function PasswordForm({ account, reload }: SectionProps) {const t = useT()@@ -553,12 +522,13 @@ function PasswordForm({ account, reload }: SectionProps) {}return (<div className="ac-form ac-divided">- <MethodHead+ <SettingRowtitle={t('account.password.title')}- state={exists ? t('account.password.stateSet') : t('account.password.stateNotSet')}- action={+ description={exists ? t('account.password.stateSet') : t('account.password.stateNotSet')}+ control={!open && (<Button+ size="sm"title={exists ? t('account.password.changeTitle') : t('account.password.setTitle')}onClick={() => {request.dismiss()@@ -681,14 +651,15 @@ function Passkeys() {return (<div className="ac-form">- <MethodHead+ <SettingRowtitle={t('account.passkeys.title')}- tip={t('account.passkeys.tip')}- badge={<Badge>{t('account.passkeys.recommended')}</Badge>}- state={none ? t('auth.addPasskey.why') : undefined}- action={+ help={t('account.passkeys.tip')}+ aside={t('account.passkeys.recommended')}+ description={none ? t('auth.addPasskey.why') : undefined}+ control={!waiting && (<Button+ size="sm"variant={none ? 'primary' : undefined}title={t('account.passkeys.addTitle')}disabled={request.busy}@@ -704,41 +675,19 @@ function Passkeys() {loading={!list}error={passkeys.error}onRetry={() => void load()}- skeleton={<ListSkeleton rows={1} quiet />}+ skeleton={<SkeletonSettingRow control="button" />}>{list && list.length > 0 && (- <ul className="ac-list ac-quiet-list">+ <ul className="ac-list">{list.map(p => (- <li key={p.id} className="ac-session">- <div>- <b>{p.name}</b>- {p.added && (- <span className="help">{t('account.passkeys.addedAt', { when: dateTimeLabel(p.added) })}</span>- )}- </div>- <div className="ac-row-actions">- {waiting ? null : confirming === p.id ? (- <>- <span className="help">{t('account.passkeys.removeQuestion')}</span>- <Button- size="sm"- variant="ghost"- title={t('account.passkeys.keep')}- onClick={() => setConfirming(null)}- >- {t('common.action.cancel')}- </Button>- <Button- size="sm"- variant="danger"- title={t('account.passkeys.removeTitle')}- disabled={request.busy}- onClick={() => void remove(p.id)}- >- {t('account.passkeys.remove')}- </Button>- </>- ) : (+ <SettingRow+ as="li"+ key={p.id}+ nested+ title={p.name}+ description={p.added && t('account.passkeys.addedAt', { when: dateTimeLabel(p.added) })}+ control={+ !waiting && (<Buttonsize="sm"variant="ghost"@@ -747,13 +696,25 @@ function Passkeys() {>{t('account.passkeys.remove')}</Button>- )}- </div>- </li>+ )+ }+ />))}</ul>)}</Loading>+ {confirming && (+ <DangerConfirmDialog+ confirm={{+ text: t('account.passkeys.removeQuestion'),+ action: t('account.passkeys.remove'),+ dismiss: t('account.passkeys.keep'),+ variant: 'danger',+ }}+ run={async () => void remove(confirming)}+ onClose={() => setConfirming(null)}+ />+ )}{needsCode && (<Field label={t('account.passkeys.enrolmentCode')} tip={t('account.passkeys.enrolmentTip')}><TextInput@@ -811,21 +772,22 @@ function Authenticator() {return (<div className="ac-form ac-divided">- <MethodHead+ <SettingRowtitle={t('account.authenticator.title')}- tip={t('account.authenticator.tip')}- state={+ help={t('account.authenticator.tip')}+ description={data.hasAuthenticator? t('account.authenticator.stateOn', { hours: AUTHENTICATOR_HOURS }): noPasskey? t('account.authenticator.stateNeedsPasskey'): t('account.authenticator.stateNone')}- action={+ control={idle && (<>{!data.hasAuthenticator && !noPasskey && (<Button+ size="sm"title={t('account.authenticator.addTitle')}disabled={request.busy || setup.busy}onClick={() => void start()}@@ -833,31 +795,30 @@ function Authenticator() {{t('account.authenticator.setUp')}</Button>)}- {data.hasAuthenticator && !confirming && (- <Button title={t('account.authenticator.removeTitle')} onClick={() => setConfirming(true)}>+ {data.hasAuthenticator && (+ <Button size="sm" title={t('account.authenticator.removeTitle')} onClick={() => setConfirming(true)}>{t('account.authenticator.remove')}</Button>)}- {data.hasAuthenticator && confirming && (- <>- <span className="help">{t('account.authenticator.removeQuestion')}</span>- <Button variant="ghost" title={t('account.authenticator.keep')} onClick={() => setConfirming(false)}>- {t('common.action.cancel')}- </Button>- <Button- variant="danger"- title={t('account.authenticator.removeTitle')}- disabled={request.busy}- onClick={() => void remove()}- >- {t('account.authenticator.remove')}- </Button>- </>- )}</>)}/>+ {confirming && (+ <DangerConfirmDialog+ confirm={{+ text: t('account.authenticator.removeQuestion'),+ action: t('account.authenticator.remove'),+ dismiss: t('account.authenticator.keep'),+ variant: 'danger',+ }}+ run={async () => {+ setConfirming(false)+ void remove()+ }}+ onClose={() => setConfirming(false)}+ />+ )}{setup.started && (<formclassName="ac-form"@@ -907,32 +868,6 @@ function Authenticator() {)}-/** A question with Cancel and a confirming button, in place of the button that asked it. */-function Confirm({- question,- busy,- onCancel,- onConfirm,-}: {- question: string- busy: boolean- onCancel: () => void- onConfirm: () => void-}) {- const t = useT()- return (- <>- <span className="help">{question}</span>- <Button size="sm" variant="ghost" title={t('account.sessions.keep')} onClick={onCancel}>- {t('common.action.cancel')}- </Button>- <Button size="sm" variant="primary" title={t('account.sessions.signOutNow')} disabled={busy} onClick={onConfirm}>- {t('account.sessions.signOut')}- </Button>- </>- )-}-/** Sessions in the order shown; SignInAgain when the session is too old to list them. */async function loadSessionList(): Promise<SessionRow[] | 'signInAgain'> {try {@@ -943,43 +878,15 @@ async function loadSessionList(): Promise<SessionRow[] | 'signInAgain'> {}}-/** Grey rows where a list of sessions or passkeys will be: the rows' own name, line under it and button. */-function ListSkeleton({ rows = 3, quiet = false }: { rows?: number; quiet?: boolean }) {- return (- <ul className={quiet ? 'ac-list ac-quiet-list' : 'ac-list'} aria-hidden="true">- {Array.from({ length: rows }, (_, i) => (- // biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows never reorder- <li key={i} className="ac-session">- <div>- <Skeleton shape="text" width={110 + ((i * 29) % 40)} />- <Skeleton shape="text" width={150} />- </div>- <Skeleton width={64} height={28} />- </li>- ))}- </ul>- )-}-/** A section of the account while the account itself loads: its title at once, its fields in grey. */function AccountSkeleton({ current, error, retry }: { current: SectionId; error: string | null; retry: () => void }) {const t = useT()const skeleton =current === 'security' ? (<div className="ac-methods">- <div className="ac-method-head">- <div className="ac-method-text">- <Skeleton shape="text" width={120} />- <Skeleton shape="text" width={220} />- </div>- <Skeleton width={96} height={32} />- </div>- <div className="ac-method-head ac-divided">- <div className="ac-method-text">- <Skeleton shape="text" width={80} />- <Skeleton shape="text" width={40} />- </div>- <Skeleton width={72} height={32} />+ <SkeletonSettingRow control="button" />+ <div className="ac-divided">+ <SkeletonSettingRow index={1} control="button" /></div></div>) : null@@ -1018,17 +925,15 @@ function Sessions() {const t = useT()const query = useQuery(SESSIONS, loadSessionList)const list = query.data- /** A session id, or 'others'. */- const [confirming, setConfirming] = useState<string | null>(null)const [showAll, setShowAll] = useState(false)const request = useRequest()const load = query.reloadconst sessions = Array.isArray(list) ? list : null+ // Signing a device out acts at once (rule 5): it is signed in again with its next sign-in.const signOut = (action: () => Promise<void>, doneText: string) =>request.run(async () => {await action()- setConfirming(null)await load()}, doneText)@@ -1036,49 +941,38 @@ function Sessions() {return (<Section id="ac-sessions" title={t('account.nav.sessions.label')}>{list === 'signInAgain' && (- <div className="ac-inline">- <span className="help">{t('account.sessions.signInAgain')}</span>- <SignInAgainButton />- </div>+ <SettingRow title={t('account.sessions.signInAgain')} control={<SignInAgainButton />} />)}<Loadingwhat={t('account.nav.sessions.label')}loading={!list}error={query.error}onRetry={() => void load()}- skeleton={<ListSkeleton rows={3} />}+ skeleton={<SkeletonSettingRows rows={3} control="button" />}>{sessions && (<ul className="ac-list">{(showAll ? sessions : sessions.slice(0, SESSIONS_SHOWN)).map(s => (- <li key={s.id} className="ac-session">- <div>- <b>{s.device}</b>- <span className="help">- {t('account.sessions.lastActive', { when: dateTimeLabel(s.lastActive) })}- </span>- </div>- <div className="ac-row-actions">- {s.current ? (+ <SettingRow+ as="li"+ key={s.id}+ title={s.device}+ description={t('account.sessions.lastActive', { when: dateTimeLabel(s.lastActive) })}+ control={+ s.current ? (<Badge>{t('account.sessions.thisDevice')}</Badge>- ) : confirming === s.id ? (- <Confirm- question={t('account.sessions.signOutQuestion')}- busy={request.busy}- onCancel={() => setConfirming(null)}- onConfirm={() => void signOut(() => signOutSession(s.id), t('account.sessions.signedOut'))}- />) : (<Buttonsize="sm"title={t('account.sessions.signOutDevice', { device: s.device })}- onClick={() => setConfirming(s.id)}+ disabled={request.busy}+ onClick={() => void signOut(() => signOutSession(s.id), t('account.sessions.signedOut'))}>{t('account.sessions.signOut')}</Button>- )}- </div>- </li>+ )+ }+ />))}</ul>)}@@ -1093,18 +987,14 @@ function Sessions() {<FormStatus request={request} />{others > 0 && (<div className="ac-actions">- {confirming === 'others' ? (- <Confirm- question={t('account.sessions.signOutOthersQuestion', { count: others })}- busy={request.busy}- onCancel={() => setConfirming(null)}- onConfirm={() => void signOut(signOutOtherSessions, t('account.sessions.othersSignedOut'))}- />- ) : (- <Button title={t('account.sessions.signOutOthersTitle')} onClick={() => setConfirming('others')}>- {t('account.sessions.signOutOthers')}- </Button>- )}+ <Button+ size="sm"+ title={t('account.sessions.signOutOthersTitle')}+ disabled={request.busy}+ onClick={() => void signOut(signOutOtherSessions, t('account.sessions.othersSignedOut'))}+ >+ {t('account.sessions.signOutOthers')}+ </Button></div>)}</Section>diff --git a/apps/web/src/settings/assistant.css b/apps/web/src/settings/assistant.cssindex b64ead2b..00134037 100644--- a/apps/web/src/settings/assistant.css+++ b/apps/web/src/settings/assistant.css@@ -807,16 +807,6 @@ a.as-chip:hover {}}-/* Calls & transfers: the behaviour checklist, one switch per line */-.as-checklist {- display: grid;- gap: 10px;-}-.as-checklist > .swrow:first-child {- padding-top: 0;- border-top: 0;-}-/* Hours & holidays: add a day, vacation mode */.hd-add {margin-top: 4px;@@ -886,46 +876,6 @@ a.as-chip:hover {margin: 0;}-/* A setting with a dropdown in place of a switch (SelectRow): AI disclosure, communication style */-.selrow {- display: flex;- align-items: center;- justify-content: space-between;- gap: 16px;- padding-top: 10px;- border-top: 1px solid var(--line);-}-.as-checklist > .selrow:first-child {- padding-top: 0;- border-top: 0;-}-.selrow-text {- display: grid;- gap: 2px;- min-width: 0;-}-.selrow-text b {- display: flex;- align-items: center;- gap: 6px;- font-size: 12.5px;- font-weight: 500;-}-.selrow > .k-select {- flex: none;-}-.selrow-note {- margin-top: 2px;- font-style: italic;-}-@media (max-width: 560px) {- .selrow {- flex-direction: column;- align-items: stretch;- gap: 8px;- }-}-/* Settings > Assistant > History: versions on the left, what one differs from now on the right. */.ah {display: grid;@@ -1221,10 +1171,6 @@ a.as-chip:hover {.hd-calendar {margin-bottom: 16px;}-/* Its one-line description wraps instead of ending in "…" on a phone (one row, nothing below to keep in line). */-.hd-calendar .k-row-sub {- white-space: normal;-}.hd-heading {margin: 0 0 4px;font-size: 13px;@@ -1298,4 +1244,3 @@ a.as-chip:hover {padding-top: 10px;border-top: 1px solid var(--line);}-diff --git a/apps/web/src/settings/billing.css b/apps/web/src/settings/billing.cssindex 05c316be..b06964c0 100644--- a/apps/web/src/settings/billing.css+++ b/apps/web/src/settings/billing.css@@ -45,13 +45,6 @@.billing-choices {grid-template-columns: repeat(2, minmax(0, 1fr));}- /* Calls at the same time on a phone: the choice goes under its row's words instead of past the card's edge. */- .billing-calls-row {- flex-wrap: wrap;- }- .billing-calls-row .k-select {- width: 100%;- }}/* A business's plan that ended (LIN-781): since when, as large as a price, then Start plan again with its price. */diff --git a/apps/web/src/settings/fields.tsx b/apps/web/src/settings/fields.tsxindex 2d170081..de595a83 100644--- a/apps/web/src/settings/fields.tsx+++ b/apps/web/src/settings/fields.tsx@@ -1,10 +1,11 @@// Settings pages build on the kit's form pieces (ui/form.tsx); these keep the short names they use.-import { type ReactNode, useCallback, useState } from 'react'+import { useT } from '@linedesk/i18n/react'+import { type ReactNode, useCallback, useState } from 'react'import { LinkButton } from '../ui/AppLink.tsx'-import { Select, type SelectOption, Switch } from '../ui/controls.tsx'+import type { SelectOption } from '../ui/controls.tsx'import { Card, FormField, Input, Textarea } from '../ui/form.tsx'-import { type HelpContent, HelpTip, helpContent } from '../ui/HelpTip.tsx'+import type { HelpContent } from '../ui/HelpTip.tsx'import { Note } from '../ui/kit.tsx'import { Skeleton, SkeletonFields } from '../ui/LoadStates.tsx'import { useReadOnlySection } from './readOnly.ts'@@ -109,62 +110,6 @@ export function TextArea({ id, value, onChange, placeholder, label, tall, invali)}-type SwitchRowProps = {- title: string- description?: string- /** A quiet line under the description: where the value comes from (FollowsLine). */- note?: ReactNode- /** Quiet note next to the title, e.g. "Team default". */- aside?: string- /** Detail behind a (?) next to the title. */- help?: HelpContent- on: boolean- onChange: (on: boolean) => void- disabled?: boolean- /** Greyed out: it has no effect yet (browser notifications before the browser allows them). */- dimmed?: boolean- /** An option of the row above: indented under it, without the line between them. */- nested?: boolean- /** The switch's hover tooltip. */- tip?: string- /** Before the words: a 24px avatar where the row is a person (Email notifications). */- lead?: ReactNode-}--export function SwitchRow({- title,- description,- note,- aside,- help,- on,- onChange,- disabled,- dimmed,- nested,- tip,- lead,-}: SwitchRowProps) {- const className = ['swrow', dimmed && 'is-dimmed', nested && 'is-nested', lead && 'has-lead']- .filter(Boolean)- .join(' ')- return (- <div className={className}>- {lead}- <div>- <b>- {title}- {help && <HelpTip {...helpContent(help)} />}- {aside && <span className="swrow-aside">{aside}</span>}- </b>- {description && <span className="help">{description}</span>}- {note}- </div>- <Switch on={on} onChange={onChange} label={title} disabled={disabled} title={tip} />- </div>- )-}-/*** A settings card whose title is not known yet (a whole section waits for data): the card itself, a short* grey title and `fields` labelled controls, each as tall as a Field with its input.@@ -178,52 +123,6 @@ export function SkeletonSection({ fields = 2 }: { fields?: number }) {)}-/**- * A SelectRow whose value is not read yet: its title at once (words that don't need the data), the description's line- * and the dropdown as grey shapes, the same height as the row that comes.- */-export function SkeletonSelectRow({ title, description = true }: { title: ReactNode; description?: boolean }) {- return (- <div className="selrow">- <div className="selrow-text">- <b>{title}</b>- {description && <Skeleton shape="text" width={260} />}- </div>- <Skeleton width={150} height={28} />- </div>- )-}--/**- * SwitchRows while they load (ui/LoadStates.tsx): the same rows and gaps, the switch a grey pill; `lead`: each row- * starts with a 24px avatar (SwitchRow's `lead`).- */-export function SkeletonSwitchRows({- rows = 2,- description = true,- lead = false,-}: {- rows?: number- description?: boolean- lead?: boolean-}) {- return (- <div className="st-swlist" aria-hidden="true">- {Array.from({ length: rows }, (_, i) => (- // biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows never reorder- <div key={i} className={lead ? 'swrow has-lead' : 'swrow'}>- {lead && <Skeleton width={24} height={24} className="sk-round" />}- <div>- <Skeleton shape="text" width={120 + ((i * 37) % 60)} />- {description && <Skeleton shape="text" width={220 + ((i * 53) % 90)} />}- </div>- <Skeleton width={34} height={20} className="sk-round" />- </div>- ))}- </div>- )-}-/** An open/closed state (an Advanced disclosure) remembered in this browser; works without storage too. */export function useRemembered(key: string): [boolean, (open: boolean) => void] {const [open, setOpen] = useState(() => {@@ -247,45 +146,6 @@ export function useRemembered(key: string): [boolean, (open: boolean) => void] {return [open, remember]}-type SelectRowProps<T extends string> = {- id: string- title: string- description?: string- /** More about the setting: a "?" next to the title. */- help?: HelpContent- /** A quiet line under the description (e.g. what callers hear). */- note?: ReactNode- value: T- options: readonly SelectOption<T>[]- onChange: (value: T) => void-}--/** Like SwitchRow, with a dropdown at the right; on a phone the dropdown goes under the text. */-export function SelectRow<T extends string>({- id,- title,- description,- help,- note,- value,- options,- onChange,-}: SelectRowProps<T>) {- return (- <div className="selrow">- <div className="selrow-text">- <b>- {title}- {help && <HelpTip {...helpContent(help)} />}- </b>- {description && <span className="help">{description}</span>}- {note && <span className="help selrow-note">{note}</span>}- </div>- <Select id={id} size="sm" align="end" value={value} options={options} onChange={onChange} label={title} />- </div>- )-}-/*** The options of a field that follows the workspace's country, the country's own one marked: "Eastern Time (country* default)". The mark stays whether the field follows or was set by hand; none while the country's value is unknown.@@ -315,7 +175,7 @@ type FollowsLineProps = {what?: 'currency'/** Goes back to following; none: the viewer can't change it, and the line says what the default is instead. */onReset?: () => void- /** In a SwitchRow: a span under its description. */+ /** In a SettingRow: a span under its description. */inline?: boolean/** The field's control: it gets the focus after the reset (the reset button itself goes away). */controlId?: stringdiff --git a/apps/web/src/settings/webhooks.css b/apps/web/src/settings/webhooks.cssindex d54ba0ca..fb3abc88 100644--- a/apps/web/src/settings/webhooks.css+++ b/apps/web/src/settings/webhooks.css@@ -59,7 +59,7 @@margin: 0;}-/* The during-call lookups: a sub-list under its switch, indented like a nested switch row (.swrow.is-nested);+/* The during-call lookups: a sub-list under its switch, indented like a nested setting row (.k-setrow.is-nested);a lookup's fields in its dialog, one row each. */.wh-lookups {margin: 2px 0 12px 14px;diff --git a/apps/web/src/styles.css b/apps/web/src/styles.cssindex e079d06a..077d6976 100644--- a/apps/web/src/styles.css+++ b/apps/web/src/styles.css@@ -484,17 +484,6 @@ span.mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mut.opt input { margin: 3px 0 0; accent-color: var(--signal); }.opt b { display: block; font-size: 13.5px; font-weight: 500; }.opt span { font-size: 12px; color: var(--ink-muted); }-.swrow { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 10px; border-top: 1px solid var(--line); }-.swrow div { display: grid; gap: 2px; min-width: 0; }-.swrow b { font-size: 13.5px; font-weight: 500; }-.swrow.is-dimmed b, .swrow.is-dimmed .help { color: var(--ink-disabled); }-/* An option of the row above (Settings › Notifications: the call line in this device's notifications). */-.swrow.is-nested { margin-left: 14px; padding-left: 12px; padding-top: 0; border-top: 0; border-left: 2px solid var(--line); }-/* A row that is a person (Who hears about calls): the avatar, then the words taking the room, the switch at the end. */-.swrow.has-lead { justify-content: flex-start; gap: 12px; }-.swrow.has-lead > :nth-child(2) { flex: 1; }-.swrow.has-lead > :last-child { margin-left: 4px; }-.swrow-ok { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--ink-muted); white-space: nowrap; }.sw { position: relative; flex: none; width: 34px; height: 20px; border: 0; border-radius: var(--radius-full); background: var(--line-control); cursor: pointer; padding: 0; }.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: var(--radius-full); background: var(--surface-raised); }.sw[aria-checked="true"] { background: var(--signal); }@@ -644,7 +633,7 @@ body { font-size: 13px; }.sec { padding: 14px 16px; gap: 12px; }.sec h2 { font-size: 14px; }-.sec > p, .field label, .swrow b, .opt b { font-size: 12.5px; }+.sec > p, .field label, .opt b { font-size: 12.5px; }.help { font-size: 11.5px; }.opt { padding: 10px; }.k-badge { height: 18px; font-size: 11px; }@@ -1052,7 +1041,7 @@ span.mono, .facts dd.mono, .ib-tab .n, .ib-mode .n, .nav-n, .cv-who .sub, .k-met.help, .page-head p, .sec > p, .opt span, .side-who span, .ob-choice span, .ws-me small,.k-cmd-foot, .help-foot, .side-facts, .sc-top, .ob-newnum span { font-size: 12px; }/* 13: body / UI */-.row, .facts, .field label, .swrow b, .opt b, .help-row, .ib-mode, .side-who b, .ob-choice b,+.row, .facts, .field label, .opt b, .help-row, .ib-mode, .side-who b, .ob-choice b,.ob-foot .k-btn, .empty, .ws-me b, .cv .k-bubble, .ob-row, .ob-open-h { font-size: 13px; }.sum-h > b, .tr-h b { font-size: 13px; font-weight: 600; }/* 14: titles */@@ -1369,9 +1358,6 @@ mark { background: rgb(250 204 21 / 0.38); color: inherit; border-radius: 2px; p.st-member-t .help { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.st-role { padding: 0 8px; }-/* notifications: first row without the hairline */-.st-swlist { display: grid; gap: 10px; }-.st-swlist > .swrow:first-child, .k-card-head + .swrow { padding-top: 0; border-top: 0; }/* providers */.st-rec { margin-left: 6px; vertical-align: 1px; }diff --git a/apps/web/src/admin/FeatureLine.tsx b/apps/web/src/ui/FeatureLine.tsxsimilarity index 63%rename from apps/web/src/admin/FeatureLine.tsxrename to apps/web/src/ui/FeatureLine.tsxindex 7a6e7b3f..c3ed5f60 100644--- a/apps/web/src/admin/FeatureLine.tsx+++ b/apps/web/src/ui/FeatureLine.tsx@@ -1,13 +1,14 @@-// One line per setting, as on Server admin › Features (LIN-810), also used by Call quality, Sign-up & access and-// Workspace settings › General (Calls, LIN-837): its name, what it does and its state, with Change opening its-// settings in place. The settings are the cards they always were, shown without their own title (CardInline). Billing's own page uses the same line as a link to a page of its-// own (`LinkLine`).+// One line per setting in its own card, as on Server admin › Features (LIN-810), Call quality, Sign-up & access,+// Billing and Workspace and User settings (LIN-837): a SettingRow (its name, what it does, its state as a badge) with+// Change opening its settings in place. The settings are the cards they always were, shown without their own title+// (CardInline). A line that opens a page of its own is a `LinkLine`; an area's label above its lines a `LineGroup`.import { useT } from '@linedesk/i18n/react'import { type ReactNode, useId, useState } from 'react'-import { CardInline, type HelpContent, HelpTip } from '../ui/form.tsx'-import { helpContent } from '../ui/HelpTip.tsx'-import { Badge, Button } from '../ui/kit.tsx'-import { Skeleton } from '../ui/LoadStates.tsx'+import { CardInline } from './form.tsx'+import { type HelpContent, HelpTip, helpContent } from './HelpTip.tsx'+import { Badge, Button } from './kit.tsx'+import { Skeleton } from './LoadStates.tsx'+import { SettingRow } from './SettingRow.tsx'/*** A line's state in a word or two; null while it loads. `danger` for a state that needs the admin (sign-up closed),@@ -27,24 +28,24 @@ type HeadProps = {action: ReactNode}-/** The line itself: name and what it does, its state as a badge, and its button at the right. */+/** The line itself: a SettingRow with its state as a badge and its button at the right. */function LineHead({ title, summary, help, state, action }: HeadProps) {return (- <div className="adm-feature-line">- <div className="adm-feature-text">- <b>- {title}- {help && <HelpTip {...helpContent(help)} />}- </b>- <span className="help">{summary}</span>- </div>- {state ? (- <Badge tone={stateTone(state)}>{state.text}</Badge>- ) : (- state === null && <Skeleton width={72} height={20} className="sk-round" />- )}- {action}- </div>+ <SettingRow+ title={title}+ description={summary}+ help={help}+ control={+ <>+ {state ? (+ <Badge tone={stateTone(state)}>{state.text}</Badge>+ ) : (+ state === null && <Skeleton width={72} height={20} className="sk-round" />+ )}+ {action}+ </>+ }+ />)}@@ -68,7 +69,7 @@ export function FeatureLine({ title, summary, help, state, open, onToggle, view,const t = useT()const bodyId = useId()return (- <section className="k-card adm-feature" aria-label={title}>+ <section className="k-card k-feature" aria-label={title}><LineHeadtitle={title}summary={summary}@@ -89,7 +90,7 @@ export function FeatureLine({ title, summary, help, state, open, onToggle, view,}/>{open && (- <div id={bodyId} className="adm-feature-body">+ <div id={bodyId} className="k-feature-body"><CardInline.Provider value={true}>{children}</CardInline.Provider></div>)}@@ -107,7 +108,7 @@ type LinkLineProps = Omit<HeadProps, 'action'> & {/** A line that opens a page of its own instead of settings in place (Billing's parts): its button is a link. */export function LinkLine({ href, label, ...head }: LinkLineProps) {return (- <section className="k-card adm-feature" aria-label={head.title}>+ <section className="k-card k-feature" aria-label={head.title}><LineHead{...head}action={@@ -120,8 +121,29 @@ export function LinkLine({ href, label, ...head }: LinkLineProps) {)}-/** An area's heading above its lines (Phone, Voice, …). */-export const LineGroup = ({ children }: { children: ReactNode }) => <h3 className="adm-feature-group">{children}</h3>+/**+ * An area's label above its lines or cards (Phone, Voice, …; Providers' categories, the Prompt's groups): quiet words,+ * never capitals. `after`: a status in normal weight after the label; `help`: a (?) at the end.+ */+export function LineGroup({+ children,+ after,+ help,+ as: Tag = 'h3',+}: {+ children: ReactNode+ after?: ReactNode+ help?: HelpContent+ as?: 'h2' | 'h3'+}) {+ return (+ <Tag className="k-line-group">+ {after || help ? <span>{children}</span> : children}+ {after && <span className="k-line-group-after">{after}</span>}+ {help && <HelpTip {...helpContent(help)} />}+ </Tag>+ )+}/** Which lines of a page are open; `first` opens some on arrival (a link to one setting). */export function useOpenLines<Id extends string>(first: readonly Id[] = []) {diff --git a/apps/web/src/ui/SettingRow.tsx b/apps/web/src/ui/SettingRow.tsxnew file mode 100644index 00000000..23f11c02--- /dev/null+++ b/apps/web/src/ui/SettingRow.tsx@@ -0,0 +1,152 @@+// The one row for a setting, everywhere (Server admin, workspace, assistant and account settings): its name (13px,+// bold), at most one grey line under it, and its control at the right end: a switch, a select, a button, a badge.+// Rows in a list are divided by hairlines. FeatureLine (ui/FeatureLine.tsx) is this row in its own card, with Change+// opening its settings under it. Styles in setting-row.css.+import type { ReactNode } from 'react'+import { type HelpContent, HelpTip, helpContent } from './HelpTip.tsx'+import { cx } from './kit.tsx'+import { Skeleton } from './LoadStates.tsx'+import './setting-row.css'++type SettingRowProps = {+ title: ReactNode+ /** One grey line under the title. */+ description?: ReactNode+ /** A quiet line under the description: where the value comes from (FollowsLine), what callers hear. */+ note?: ReactNode+ /** Quiet words next to the title ("Team default"). */+ aside?: ReactNode+ /** Detail behind a (?) next to the title. */+ help?: HelpContent+ /** The control at the right end: a Switch, a Select (size sm), a Button (size sm), a Badge, or several of them. */+ control?: ReactNode+ /** Before the words: a 24px avatar where the row is a person. */+ lead?: ReactNode+ /** Greyed out: it has no effect yet (browser notifications before the browser allows them). */+ dimmed?: boolean+ /** An option of the row above: indented under it, without the line between them. */+ nested?: boolean+ id?: string+ className?: string+ /** `li` for a row in a `<ul>` (sessions, passkeys). */+ as?: 'div' | 'li'+}++export function SettingRow({+ title,+ description,+ note,+ aside,+ help,+ control,+ lead,+ dimmed,+ nested,+ id,+ className,+ as: Tag = 'div',+}: SettingRowProps) {+ return (+ <Tag+ id={id}+ className={cx('k-setrow', dimmed && 'is-dimmed', nested && 'is-nested', lead != null && 'has-lead', className)}+ >+ {lead}+ <div className="k-setrow-text">+ <b className="k-setrow-title">+ {title}+ {help && <HelpTip {...helpContent(help)} />}+ {aside && <span className="k-setrow-aside">{aside}</span>}+ </b>+ {description && <span className="help">{description}</span>}+ {note}+ </div>+ {control != null && control !== false && <div className="k-setrow-end">{control}</div>}+ </Tag>+ )+}++/** Rows divided by hairlines, the first without one (a card's or a fold-out's list of settings). */+export function SettingRows({ className, children }: { className?: string; children: ReactNode }) {+ return <div className={cx('k-setrows', className)}>{children}</div>+}++/** The control a loading row will have, as its grey shape. */+export type SkeletonControl = 'switch' | 'select' | 'button' | 'badge-button' | 'none'++const controlShape = (control: SkeletonControl) =>+ control === 'switch' ? (+ <Skeleton width={34} height={20} className="sk-round" />+ ) : control === 'select' ? (+ <Skeleton width={150} height={28} />+ ) : control === 'button' ? (+ <Skeleton width={64} height={28} />+ ) : control === 'badge-button' ? (+ <>+ <Skeleton width={72} height={20} className="sk-round" />+ <Skeleton width={64} height={28} />+ </>+ ) : null++/**+ * A SettingRow whose value is not read yet: its title at once when it is known (words that don't need the data), the+ * description's line and the control as grey shapes, the same height as the row that comes.+ */+export function SkeletonSettingRow({+ title,+ description = true,+ control = 'switch',+ lead = false,+ index = 0,+}: {+ title?: ReactNode+ description?: boolean+ control?: SkeletonControl+ lead?: boolean+ /** Varies the bars' widths from row to row. */+ index?: number+}) {+ const shape = controlShape(control)+ return (+ <div className={cx('k-setrow', lead && 'has-lead')} aria-hidden={title ? undefined : 'true'}>+ {lead && <Skeleton width={24} height={24} className="sk-round" />}+ <div className="k-setrow-text">+ {title ? (+ <b className="k-setrow-title">{title}</b>+ ) : (+ <Skeleton shape="text" width={120 + ((index * 37) % 60)} />+ )}+ {description && <Skeleton shape="text" width={220 + ((index * 53) % 90)} />}+ </div>+ {shape && <div className="k-setrow-end">{shape}</div>}+ </div>+ )+}++/** `rows` SettingRows while they load, divided like the list that comes. */+export function SkeletonSettingRows({+ rows = 2,+ description = true,+ control = 'switch',+ lead = false,+}: {+ rows?: number+ description?: boolean+ control?: SkeletonControl+ lead?: boolean+}) {+ return (+ <div className="k-setrows" aria-hidden="true">+ {Array.from({ length: rows }, (_, i) => (+ <SkeletonSettingRow+ // biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows never reorder+ key={i}+ index={i}+ description={description}+ control={control}+ lead={lead}+ />+ ))}+ </div>+ )+}diff --git a/apps/web/src/ui/form.css b/apps/web/src/ui/form.cssindex 1c7d7e11..371739e1 100644--- a/apps/web/src/ui/form.css+++ b/apps/web/src/ui/form.css@@ -576,14 +576,6 @@}}-/* A switch row's quiet note next to its title ("Team default"). */-.swrow-aside {- margin-left: 8px;- font-size: 12px;- font-weight: 400;- color: var(--ink-muted);-}-/* A danger confirmation's list of what it affects (ui/DangerConfirmDialog.tsx: deleting a workspace). */.danger-confirm-list {margin: 0;diff --git a/apps/web/src/ui/setting-row.css b/apps/web/src/ui/setting-row.cssnew file mode 100644index 00000000..30bd8020--- /dev/null+++ b/apps/web/src/ui/setting-row.css@@ -0,0 +1,106 @@+/* SettingRow (SettingRow.tsx) and FeatureLine (FeatureLine.tsx): the one row for a setting, its name, one grey line and+ its control at the right end; rows in a list divided by hairlines. */+.k-setrow {+ display: flex;+ align-items: center;+ gap: 12px;+ min-width: 0;+ padding-top: 10px;+ border-top: 1px solid var(--line);+}+.k-setrow:first-child,+.k-card-head + .k-setrow {+ padding-top: 0;+ border-top: 0;+}+.k-setrow-text {+ display: grid;+ gap: 2px;+ flex: 1;+ min-width: 0;+}+.k-setrow-title {+ display: inline-flex;+ flex-wrap: wrap;+ align-items: center;+ gap: 4px;+ font-size: 13px;+ line-height: 18px;+ font-weight: 600;+}+.k-setrow-aside {+ margin-left: 4px;+ font-size: 12px;+ font-weight: 400;+ color: var(--ink-muted);+}+.k-setrow-end {+ display: flex;+ flex: none;+ align-items: center;+ gap: 8px;+}+.k-setrow.is-dimmed .k-setrow-title,+.k-setrow.is-dimmed .help {+ color: var(--ink-disabled);+}+/* An option of the row above: indented under it, without the line between them. */+.k-setrow.is-nested {+ margin-left: 14px;+ padding-top: 0;+ padding-left: 12px;+ border-top: 0;+ border-left: 2px solid var(--line);+}+/* A row that is a person: the 24px avatar first. */+.k-setrow.has-lead > :first-child {+ flex: none;+}+/* Rows of a list: the gap between them is the row's own top padding. */+.k-setrows {+ display: grid;+ gap: 10px;+ min-width: 0;+}+/* Phone: a wide control (a select, or a badge with a button) goes under the words; a switch, one button or one badge+ stays at the right end. */+@media (max-width: 560px) {+ .k-setrow:has(> .k-setrow-end > .k-select),+ .k-setrow:has(> .k-setrow-end > :nth-child(2)) {+ flex-wrap: wrap;+ }+ .k-setrow:has(> .k-setrow-end > .k-select) > .k-setrow-text,+ .k-setrow:has(> .k-setrow-end > :nth-child(2)) > .k-setrow-text {+ flex-basis: calc(100% - 36px);+ }+}++/* FeatureLine: the row in its own card; Change opens its settings under a hairline. */+.k-feature-body {+ display: grid;+ gap: 12px;+ padding-top: 12px;+ border-top: 1px solid var(--line);+}+/* An area's label above its lines (Phone, Voice, …): quiet words, never capitals. */+.k-line-group {+ display: flex;+ flex-wrap: wrap;+ align-items: center;+ gap: 4px 8px;+ margin: 8px 2px -4px;+ font-size: 12.5px;+ line-height: 18px;+ font-weight: 600;+ color: var(--ink-muted);+}+.k-line-group:first-child {+ margin-top: 0;+}+.k-line-group-after {+ display: inline-flex;+ align-items: center;+ gap: 4px;+ font-size: 12px;+ font-weight: 400;+}diff --git a/packages/i18n/locales/de/account.json b/packages/i18n/locales/de/account.jsonindex cd95beee..1e385ea6 100644--- a/packages/i18n/locales/de/account.json+++ b/packages/i18n/locales/de/account.json@@ -188,7 +188,6 @@"passkeys.removeFailed": "Der Passkey konnte nicht entfernt werden.","passkeys.removeNamed": "{name} entfernen","passkeys.removeQuestion": "Diesen Passkey entfernen?",- "passkeys.removeTitle": "Entfernen; er meldet dich dann nicht mehr an","passkeys.removed": "Passkey entfernt.","passkeys.synced": "Synchronisierter Passkey","passkeys.tip": "Mit einem Passkey meldest du dich per Fingerabdruck, Gesicht oder Geräte-PIN an statt mit Code oder Passwort.",@@ -241,7 +240,6 @@"profile.nameSaveFailed": "Dein Name konnte nicht gespeichert werden.","profile.nameSaved": "Name gespeichert.","sessions.gone": "Diese Sitzung gibt es nicht mehr.",- "sessions.keep": "Angemeldet lassen","sessions.lastActive": "Zuletzt aktiv {when}","sessions.loadFailed": "Deine Sitzungen konnten nicht geladen werden.","sessions.othersSignedOut": "Andere Sitzungen abgemeldet.",@@ -250,12 +248,9 @@"sessions.signOut": "Abmelden","sessions.signOutDevice": "{device} abmelden","sessions.signOutFailed": "Diese Sitzung konnte nicht abgemeldet werden.",- "sessions.signOutNow": "Jetzt abmelden","sessions.signOutOthers": "Alle anderen Sitzungen abmelden","sessions.signOutOthersFailed": "Die anderen Sitzungen konnten nicht abgemeldet werden.",- "sessions.signOutOthersQuestion": "{count, plural, one {# andere Sitzung} other {# andere Sitzungen}} abmelden?","sessions.signOutOthersTitle": "Überall abmelden außer auf diesem Gerät",- "sessions.signOutQuestion": "Dieses Gerät abmelden?","sessions.signedOut": "Sitzung abgemeldet.","sessions.thisDevice": "Dieses Gerät","signInAgain.button": "Erneut anmelden",diff --git a/packages/i18n/locales/en/account.json b/packages/i18n/locales/en/account.jsonindex 6b190933..6dda6c68 100644--- a/packages/i18n/locales/en/account.json+++ b/packages/i18n/locales/en/account.json@@ -190,7 +190,6 @@"passkeys.removeFailed": "Could not remove the passkey.","passkeys.removeNamed": "Remove {name}","passkeys.removeQuestion": "Remove this passkey?",- "passkeys.removeTitle": "Remove it; it no longer signs you in","passkeys.removed": "Passkey removed.","passkeys.synced": "Synced passkey","passkeys.tip": "A passkey lets you sign in with your fingerprint, face or device PIN instead of a code or password.",@@ -243,7 +242,6 @@"profile.nameSaveFailed": "Could not save your name.","profile.nameSaved": "Name saved.","sessions.gone": "That session is no longer there.",- "sessions.keep": "Keep it signed in","sessions.lastActive": "Last active {when}","sessions.loadFailed": "Could not load your sessions.","sessions.othersSignedOut": "Other sessions signed out.",@@ -252,12 +250,9 @@"sessions.signOut": "Sign out","sessions.signOutDevice": "Sign out {device}","sessions.signOutFailed": "Could not sign that session out.",- "sessions.signOutNow": "Sign out now","sessions.signOutOthers": "Sign out all other sessions","sessions.signOutOthersFailed": "Could not sign the other sessions out.",- "sessions.signOutOthersQuestion": "Sign out {count, plural, one {# other session} other {# other sessions}}?","sessions.signOutOthersTitle": "Sign out everywhere except this device",- "sessions.signOutQuestion": "Sign this device out?","sessions.signedOut": "Session signed out.","sessions.thisDevice": "This device","signInAgain.button": "Sign in again",diff --git a/packages/i18n/locales/es/account.json b/packages/i18n/locales/es/account.jsonindex 2e8cfaa8..1c8d8d24 100644--- a/packages/i18n/locales/es/account.json+++ b/packages/i18n/locales/es/account.json@@ -188,7 +188,6 @@"passkeys.removeFailed": "No se pudo quitar la llave de acceso.","passkeys.removeNamed": "Quitar {name}","passkeys.removeQuestion": "¿Quitar esta llave de acceso?",- "passkeys.removeTitle": "Quitarla; ya no te sirve para iniciar sesión","passkeys.removed": "Llave de acceso quitada.","passkeys.synced": "Llave de acceso sincronizada","passkeys.tip": "Una llave de acceso te permite iniciar sesión con tu huella, tu rostro o el PIN del dispositivo en lugar de un código o una contraseña.",@@ -241,7 +240,6 @@"profile.nameSaveFailed": "No se pudo guardar tu nombre.","profile.nameSaved": "Nombre guardado.","sessions.gone": "Esa sesión ya no existe.",- "sessions.keep": "Mantener la sesión iniciada","sessions.lastActive": "Última actividad {when}","sessions.loadFailed": "No se pudieron cargar tus sesiones.","sessions.othersSignedOut": "Se cerraron las otras sesiones.",@@ -250,12 +248,9 @@"sessions.signOut": "Cerrar sesión","sessions.signOutDevice": "Cerrar sesión en {device}","sessions.signOutFailed": "No se pudo cerrar esa sesión.",- "sessions.signOutNow": "Cerrar sesión ahora","sessions.signOutOthers": "Cerrar todas las demás sesiones","sessions.signOutOthersFailed": "No se pudieron cerrar las otras sesiones.",- "sessions.signOutOthersQuestion": "¿Cerrar {count, plural, one {# sesión más} many {# sesiones más} other {# sesiones más}}?","sessions.signOutOthersTitle": "Cerrar sesión en todas partes excepto en este dispositivo",- "sessions.signOutQuestion": "¿Cerrar sesión en este dispositivo?","sessions.signedOut": "Sesión cerrada.","sessions.thisDevice": "Este dispositivo","signInAgain.button": "Volver a iniciar sesión",diff --git a/packages/i18n/locales/fr/account.json b/packages/i18n/locales/fr/account.jsonindex 4cba9274..31ccd40b 100644--- a/packages/i18n/locales/fr/account.json+++ b/packages/i18n/locales/fr/account.json@@ -188,7 +188,6 @@"passkeys.removeFailed": "Impossible de retirer la clé d'accès.","passkeys.removeNamed": "Retirer {name}","passkeys.removeQuestion": "Retirer cette clé d'accès ?",- "passkeys.removeTitle": "La retirer ; elle ne vous connectera plus","passkeys.removed": "Clé d'accès retirée.","passkeys.synced": "Clé d'accès synchronisée","passkeys.tip": "Une clé d'accès vous permet de vous connecter avec votre empreinte, votre visage ou le code PIN de l'appareil au lieu d'un code ou d'un mot de passe.",@@ -241,7 +240,6 @@"profile.nameSaveFailed": "Impossible d'enregistrer votre nom.","profile.nameSaved": "Nom enregistré.","sessions.gone": "Cette session n'existe plus.",- "sessions.keep": "Rester connecté","sessions.lastActive": "Dernière activité {when}","sessions.loadFailed": "Impossible de charger vos sessions.","sessions.othersSignedOut": "Autres sessions déconnectées.",@@ -250,12 +248,9 @@"sessions.signOut": "Déconnecter","sessions.signOutDevice": "Déconnecter {device}","sessions.signOutFailed": "Impossible de déconnecter cette session.",- "sessions.signOutNow": "Déconnecter maintenant","sessions.signOutOthers": "Déconnecter toutes les autres sessions","sessions.signOutOthersFailed": "Impossible de déconnecter les autres sessions.",- "sessions.signOutOthersQuestion": "Déconnecter {count, plural, one {# autre session} many {# autres sessions} other {# autres sessions}} ?","sessions.signOutOthersTitle": "Se déconnecter partout sauf sur cet appareil",- "sessions.signOutQuestion": "Déconnecter cet appareil ?","sessions.signedOut": "Session déconnectée.","sessions.thisDevice": "Cet appareil","signInAgain.button": "Se reconnecter",diff --git a/packages/i18n/locales/ja/account.json b/packages/i18n/locales/ja/account.jsonindex 96c4c095..73ae724f 100644--- a/packages/i18n/locales/ja/account.json+++ b/packages/i18n/locales/ja/account.json@@ -188,7 +188,6 @@"passkeys.removeFailed": "パスキーを削除できませんでした。","passkeys.removeNamed": "{name}を削除","passkeys.removeQuestion": "このパスキーを削除しますか?",- "passkeys.removeTitle": "削除すると、このパスキーではサインインできなくなります","passkeys.removed": "パスキーを削除しました。","passkeys.synced": "同期されたパスキー","passkeys.tip": "パスキーを使うと、コードやパスワードの代わりに指紋、顔、端末のPINでサインインできます。",@@ -241,7 +240,6 @@"profile.nameSaveFailed": "名前を保存できませんでした。","profile.nameSaved": "名前を保存しました。","sessions.gone": "そのセッションはもう存在しません。",- "sessions.keep": "サインインしたままにする","sessions.lastActive": "最終アクティブ {when}","sessions.loadFailed": "セッションを読み込めませんでした。","sessions.othersSignedOut": "他のセッションをサインアウトしました。",@@ -250,12 +248,9 @@"sessions.signOut": "サインアウト","sessions.signOutDevice": "{device}からサインアウト","sessions.signOutFailed": "そのセッションをサインアウトできませんでした。",- "sessions.signOutNow": "今すぐサインアウト","sessions.signOutOthers": "他のすべてのセッションからサインアウト","sessions.signOutOthersFailed": "他のセッションをサインアウトできませんでした。",- "sessions.signOutOthersQuestion": "他の{count, plural, other {#件のセッション}}からサインアウトしますか?","sessions.signOutOthersTitle": "この端末以外のすべてからサインアウト",- "sessions.signOutQuestion": "この端末からサインアウトしますか?","sessions.signedOut": "セッションをサインアウトしました。","sessions.thisDevice": "この端末","signInAgain.button": "もう一度サインイン",diff --git a/packages/i18n/locales/pt-BR/account.json b/packages/i18n/locales/pt-BR/account.jsonindex 9e77f275..5791b3ce 100644--- a/packages/i18n/locales/pt-BR/account.json+++ b/packages/i18n/locales/pt-BR/account.json@@ -188,7 +188,6 @@"passkeys.removeFailed": "Não foi possível remover a chave de acesso.","passkeys.removeNamed": "Remover {name}","passkeys.removeQuestion": "Remover esta chave de acesso?",- "passkeys.removeTitle": "Remover; ela não fará mais seu login","passkeys.removed": "Chave de acesso removida.","passkeys.synced": "Chave de acesso sincronizada","passkeys.tip": "Uma chave de acesso permite entrar com sua digital, seu rosto ou o PIN do dispositivo em vez de um código ou senha.",@@ -241,7 +240,6 @@"profile.nameSaveFailed": "Não foi possível salvar seu nome.","profile.nameSaved": "Nome salvo.","sessions.gone": "Essa sessão não existe mais.",- "sessions.keep": "Manter conectado","sessions.lastActive": "Última atividade {when}","sessions.loadFailed": "Não foi possível carregar suas sessões.","sessions.othersSignedOut": "Outras sessões encerradas.",@@ -250,12 +248,9 @@"sessions.signOut": "Sair","sessions.signOutDevice": "Sair de {device}","sessions.signOutFailed": "Não foi possível encerrar essa sessão.",- "sessions.signOutNow": "Sair agora","sessions.signOutOthers": "Encerrar todas as outras sessões","sessions.signOutOthersFailed": "Não foi possível encerrar as outras sessões.",- "sessions.signOutOthersQuestion": "Encerrar {count, plural, one {# outra sessão} many {# outras sessões} other {# outras sessões}}?","sessions.signOutOthersTitle": "Sair de todos os lugares, exceto deste dispositivo",- "sessions.signOutQuestion": "Sair deste dispositivo?","sessions.signedOut": "Sessão encerrada.","sessions.thisDevice": "Este dispositivo","signInAgain.button": "Entrar novamente",