Skip to content

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.

Web app onto the shared ui/ blocks: fold-outs, links, status marks, values (PR 1928)

Janikc160cfb7c4a8
diff --git a/apps/web/src/admin/AdminList.tsx b/apps/web/src/admin/AdminList.tsx
index 089c7ea2..2caa7eda 100644
--- a/apps/web/src/admin/AdminList.tsx
+++ b/apps/web/src/admin/AdminList.tsx
@@ -109,6 +109,7 @@ export function ListTable<T>({
>
<ColumnHeads
table
+ flat
className="adm-row adm-row-head"
labels={columns.map(c => ({
label: c.label,
diff --git a/apps/web/src/admin/admin.css b/apps/web/src/admin/admin.css
index 1efff842..364c5b80 100644
--- a/apps/web/src/admin/admin.css
+++ b/apps/web/src/admin/admin.css
@@ -257,13 +257,10 @@
cursor: pointer;
outline: none;
}
-/* The headings (ColumnHeads): the list's own grid and padding; the hairline under them is the first row's line. */
-.ib-cols.adm-row-head {
- position: static;
+/* The headings (ColumnHeads flat): the list's own grid and padding; the hairline under them is the first row's line. */
+.adm-list > .ib-cols.adm-row-head {
min-height: 0;
padding: 0 12px;
- border-radius: 0;
- background: none;
cursor: default;
}
.adm-row-head + .adm-row {
diff --git a/apps/web/src/app.css b/apps/web/src/app.css
index 2403b6c5..9f19894b 100644
--- a/apps/web/src/app.css
+++ b/apps/web/src/app.css
@@ -227,8 +227,7 @@ body,
a.auth-switch {
text-decoration: none;
}
-.auth-switch:focus-visible,
-.auth-inline:focus-visible {
+.auth-switch:focus-visible {
outline: 2px solid var(--focus);
outline-offset: 2px;
border-radius: 2px;
@@ -263,17 +262,6 @@ a.auth-switch {
gap: 12px;
text-align: center;
}
-.auth-inline {
- border: 0;
- padding: 0;
- background: none;
- font: inherit;
- color: var(--ink);
- font-weight: 500;
- text-decoration: underline;
- text-underline-offset: 3px;
- cursor: pointer;
-}
/* Offline bar: the last row of the app, so it never covers the list; the toast moves up while it shows. */
.sync-bar {
@@ -1487,42 +1475,21 @@ a.k-btn {
outline: 2px solid var(--focus);
outline-offset: 1px;
}
-/* Reminders · N and Not needed · N under the open steps, collapsed; one click on a step brings it back. */
+/* Reminders · N and Not needed · N under the open steps, each a FoldOut, one open at a time; one click on a step
+ brings it back. */
.golive-set {
display: none;
padding: 2px 0 4px;
}
.golive.is-open .golive-set {
display: grid;
- gap: 2px;
-}
-.golive-more {
- display: flex;
- align-items: center;
- gap: 6px;
- padding: 4px 6px;
- margin-left: -6px;
- border: 0;
- border-radius: var(--radius-sm);
- background: transparent;
- color: var(--ink-muted);
- font: inherit;
- font-size: 12px;
- text-align: left;
- cursor: pointer;
+ gap: 8px;
}
-.golive-more:hover,
.golive-back:hover {
background: var(--surface-hover);
}
-.golive-more[aria-expanded="false"] .k-icon {
- transform: rotate(-90deg);
-}
-.golive-more span {
- color: var(--ink-muted);
-}
.golive-set ul {
- margin: 0 0 4px;
+ margin: 0;
padding: 0 0 0 18px;
list-style: none;
}
@@ -1555,7 +1522,6 @@ a.k-btn {
grid-column: 2;
color: var(--ink-muted);
}
-.golive-more:focus-visible,
.golive-back:focus-visible {
outline: 2px solid var(--focus);
outline-offset: 1px;
@@ -1813,7 +1779,6 @@ a.k-btn {
background: var(--line-control);
}
/* The one link inside text (ui/AppLink.tsx: AppLink, LinkButton; docs/design-principles.md, rule 18). */
-.ib-maya-fix,
.k-link {
color: var(--ink);
text-decoration: underline;
@@ -1827,6 +1792,10 @@ button.k-link {
font: inherit;
cursor: pointer;
}
+button.k-link:disabled {
+ color: var(--ink-disabled);
+ cursor: not-allowed;
+}
.k-link:focus-visible {
outline: 2px solid var(--focus);
outline-offset: 2px;
@@ -2412,8 +2381,8 @@ button.k-link {
gap: 8px;
padding: 12px 16px;
background: var(--surface);
- border: 1px solid var(--line);
- border-radius: var(--radius-md);
+ border-radius: var(--radius-lg);
+ box-shadow: var(--shadow-card);
}
.evc-empty {
display: flex;
diff --git a/apps/web/src/inbox/GoLiveChecklist.tsx b/apps/web/src/inbox/GoLiveChecklist.tsx
index b48eb73e..17cf97f9 100644
--- a/apps/web/src/inbox/GoLiveChecklist.tsx
+++ b/apps/web/src/inbox/GoLiveChecklist.tsx
@@ -31,6 +31,7 @@ import { useAssistantName, useRows, useRun } from '../store.tsx'
import { useTeam } from '../team/team-api.ts'
import { Backdrop } from '../ui/Backdrop.tsx'
import { type CommandItem, CommandMenu } from '../ui/CommandMenu.tsx'
+import { FoldOut } from '../ui/FoldOut.tsx'
import { Button, cx, Icon } from '../ui/kit.tsx'
import { useLoadState } from '../ui/LoadStates.tsx'
import { MarkGlyph } from '../ui/StatusMark.tsx'
@@ -378,7 +379,6 @@ export function GoLiveChecklist({
setOpen(false)
event.currentTarget.querySelector<HTMLButtonElement>('.golive-toggle')?.focus()
}
- const toggleSet = (set: 'later' | 'skipped') => setExpanded(e => (e === set ? null : set))
// ⇧H on a reminded step clears its reminder (as on a call), ⇧⌫ on a step not needed brings it back (the opposite of ⌫).
function onBackKey(event: KeyboardEvent<HTMLElement>, id: GoLiveId, key: 'H' | 'Backspace') {
if (quiet || !event.shiftKey || event.metaKey || event.ctrlKey || event.altKey || event.key !== key) return
@@ -482,77 +482,67 @@ export function GoLiveChecklist({
{(view.later.length > 0 || view.skipped.length > 0) && (
<div className="golive-set">
{view.later.length > 0 && (
- <>
- <button
- type="button"
- className="golive-more"
- aria-expanded={expanded === 'later'}
- title={t('common.withKey', {
- label: expanded === 'later' ? t('inbox.goLive.hideReminders') : t('inbox.goLive.showReminders'),
- key: 'Enter',
- })}
- onClick={() => toggleSet('later')}
- >
- <Icon name="down" size={12} />
- {t('inbox.goLive.reminders', { count: view.later.length })}
- <span>{t('inbox.goLive.nextOn', { date: goLiveDate(view.later[0]!.until) })}</span>
- </button>
- {expanded === 'later' && (
- <ul>
- {view.later.map(({ item, until }) => (
- <li key={item.id}>
- <button
- type="button"
- className="golive-back"
- title={t('common.withKey', { label: t('inbox.goLive.clearReminder'), key: '⇧H' })}
- onClick={() => restore(item.id)}
- onKeyDown={event => onBackKey(event, item.id, 'H')}
- >
- <b>{item.label}</b>
- <span>{t('inbox.goLive.backOn', { date: goLiveDate(until) })}</span>
- <Icon name="restart" size={12} />
- </button>
- </li>
- ))}
- </ul>
- )}
- </>
+ <FoldOut
+ open={expanded === 'later'}
+ onToggle={open => setExpanded(now => (open ? 'later' : now === 'later' ? null : now))}
+ title={t('common.withKey', {
+ label: expanded === 'later' ? t('inbox.goLive.hideReminders') : t('inbox.goLive.showReminders'),
+ key: 'Enter',
+ })}
+ summary={
+ <>
+ {t('inbox.goLive.reminders', { count: view.later.length })}{' '}
+ <span>{t('inbox.goLive.nextOn', { date: goLiveDate(view.later[0]!.until) })}</span>
+ </>
+ }
+ >
+ <ul>
+ {view.later.map(({ item, until }) => (
+ <li key={item.id}>
+ <button
+ type="button"
+ className="golive-back"
+ title={t('common.withKey', { label: t('inbox.goLive.clearReminder'), key: '⇧H' })}
+ onClick={() => restore(item.id)}
+ onKeyDown={event => onBackKey(event, item.id, 'H')}
+ >
+ <b>{item.label}</b>
+ <span>{t('inbox.goLive.backOn', { date: goLiveDate(until) })}</span>
+ <Icon name="restart" size={12} />
+ </button>
+ </li>
+ ))}
+ </ul>
+ </FoldOut>
)}
{view.skipped.length > 0 && (
- <>
- <button
- type="button"
- className="golive-more"
- aria-expanded={expanded === 'skipped'}
- title={t('common.withKey', {
- label: expanded === 'skipped' ? t('inbox.goLive.hideSkipped') : t('inbox.goLive.showSkipped'),
- key: 'Enter',
- })}
- onClick={() => toggleSet('skipped')}
- >
- <Icon name="down" size={12} />
- {t('inbox.goLive.skipped', { count: view.skipped.length })}
- </button>
- {expanded === 'skipped' && (
- <ul>
- {view.skipped.map(item => (
- <li key={item.id}>
- <button
- type="button"
- className="golive-back"
- title={t('common.withKey', { label: t('inbox.goLive.neededAfterAll'), key: '⇧⌫' })}
- onClick={() => restore(item.id)}
- onKeyDown={event => onBackKey(event, item.id, 'Backspace')}
- >
- <b>{item.label}</b>
- <span>{t('inbox.goLive.bringBack')}</span>
- <Icon name="restart" size={12} />
- </button>
- </li>
- ))}
- </ul>
- )}
- </>
+ <FoldOut
+ open={expanded === 'skipped'}
+ onToggle={open => setExpanded(now => (open ? 'skipped' : now === 'skipped' ? null : now))}
+ title={t('common.withKey', {
+ label: expanded === 'skipped' ? t('inbox.goLive.hideSkipped') : t('inbox.goLive.showSkipped'),
+ key: 'Enter',
+ })}
+ summary={t('inbox.goLive.skipped', { count: view.skipped.length })}
+ >
+ <ul>
+ {view.skipped.map(item => (
+ <li key={item.id}>
+ <button
+ type="button"
+ className="golive-back"
+ title={t('common.withKey', { label: t('inbox.goLive.neededAfterAll'), key: '⇧⌫' })}
+ onClick={() => restore(item.id)}
+ onKeyDown={event => onBackKey(event, item.id, 'Backspace')}
+ >
+ <b>{item.label}</b>
+ <span>{t('inbox.goLive.bringBack')}</span>
+ <Icon name="restart" size={12} />
+ </button>
+ </li>
+ ))}
+ </ul>
+ </FoldOut>
)}
</div>
)}
diff --git a/apps/web/src/inbox/InboxHead.tsx b/apps/web/src/inbox/InboxHead.tsx
index 7917b616..52e17694 100644
--- a/apps/web/src/inbox/InboxHead.tsx
+++ b/apps/web/src/inbox/InboxHead.tsx
@@ -7,7 +7,7 @@ import { usePresence } from '../shell/presence.ts'
import { useNow } from '../shell/useNow.ts'
import { useAssistantName, useAssistantNameOrNull, useContact } from '../store.tsx'
import { clock, parseTs } from '../time.ts'
-import { appLink } from '../ui/AppLink.tsx'
+import { AppLink, appLink } from '../ui/AppLink.tsx'
import { Button, Icon } from '../ui/kit.tsx'
import { useElapsed } from '../ui/LiveIndicator.tsx'
import { SkeletonText } from '../ui/LoadStates.tsx'
@@ -202,11 +202,7 @@ function Presence({ liveCall, onOpen, canFixVoice }: Pick<InboxHeadProps, 'liveC
{/* Whether calls are answered is a status: the mark, never a bare grey dot (design-principles.md, Messages). */}
<StatusMark state={failing ? 'failing' : 'missing'} label={why} />
<span className="ib-maya-t">{reason.title}</span>
- {reason.fix && (
- <a className="ib-maya-fix" href={reason.fix.href}>
- {reason.fix.label}
- </a>
- )}
+ {reason.fix && <AppLink to={reason.fix.href}>{reason.fix.label}</AppLink>}
</span>
)
}
diff --git a/apps/web/src/integrations/ConnectedApp.tsx b/apps/web/src/integrations/ConnectedApp.tsx
index 31335625..906d2fb9 100644
--- a/apps/web/src/integrations/ConnectedApp.tsx
+++ b/apps/web/src/integrations/ConnectedApp.tsx
@@ -32,6 +32,7 @@ import { callAction, readAction, useWriteAction } from '../settings/settings-api
import { useRows, useRun } from '../store.tsx'
import { Checkbox, Switch } from '../ui/controls.tsx'
import { Badge, Button, Icon } from '../ui/kit.tsx'
+import { StatusMark } from '../ui/StatusMark.tsx'
import { Loading, SkeletonList, useLoadState } from '../ui/LoadStates.tsx'
import { List, ListEmpty, ListRow } from '../ui/list.tsx'
import { SettingRow } from '../ui/SettingRow.tsx'
@@ -262,13 +263,15 @@ function Connection({ app, connection, canEdit, toast }: Props & { connection: A
sub={sub}
aside={
attention ? (
- <Badge tone="danger" dot title={t('settings.integrations.status.needsAttentionTip')}>
+ <>
+ <StatusMark state="failing" label={t('settings.integrations.status.needsAttentionTip')} />
{t('settings.integrations.status.needsAttention')}
- </Badge>
+ </>
) : (
- <Badge tone="ok" dot>
+ <>
+ <StatusMark state="works" label={t('settings.integrations.status.connected')} />
{t('settings.integrations.status.connected')}
- </Badge>
+ </>
)
}
actions={
@@ -565,7 +568,7 @@ function AppSettings({
<h3>
<Icon name="shield" size={14} />
{t('settings.integrations.app.shopify.group.verify')}
- <Badge tone="outline">{t('settings.integrations.app.shopify.verify.badge')}</Badge>
+ <span className="k-value">{t('settings.integrations.app.shopify.verify.badge')}</span>
</h3>
<p className="help">{t('settings.integrations.app.shopify.group.verifyHelp')}</p>
{!changing && <p className="help">{t('settings.integrations.app.shopify.verify.idle')}</p>}
@@ -623,13 +626,13 @@ function ShopifySetupSummary({
const changes = SHOP_CHANGE_SETTINGS.filter(on)
const checks = SHOP_VERIFY_SETTINGS.filter(on)
const badge = (
- <Badge tone={recommended ? 'ok' : 'outline'}>
+ <b>
{t(
recommended
? 'settings.integrations.app.shopify.setup.recommended'
: 'settings.integrations.app.shopify.setup.custom',
)}
- </Badge>
+ </b>
)
const actions = canEdit && (
<div className="ig-setup-actions">
diff --git a/apps/web/src/integrations/Developers.tsx b/apps/web/src/integrations/Developers.tsx
index 9c4a42c7..9f54a6f1 100644
--- a/apps/web/src/integrations/Developers.tsx
+++ b/apps/web/src/integrations/Developers.tsx
@@ -297,11 +297,7 @@ function KeyRow({ apiKey, toast }: { apiKey: ApiKeySummary; toast: Props['toast'
: t('settings.developers.neverUsed', { created: day(apiKey.created_at) })}
</>
}
- aside={
- <Badge tone="outline">
- {apiKey.role === 'admin' ? t('settings.developers.role.admin') : t('settings.developers.role.member')}
- </Badge>
- }
+ aside={apiKey.role === 'admin' ? t('settings.developers.role.admin') : t('settings.developers.role.member')}
below={
apiKey.created_during_support && (
<p className="dev-support" title={t('settings.developers.supportAccessTip')}>
diff --git a/apps/web/src/integrations/MailReview.tsx b/apps/web/src/integrations/MailReview.tsx
index 5f213c14..27e72129 100644
--- a/apps/web/src/integrations/MailReview.tsx
+++ b/apps/web/src/integrations/MailReview.tsx
@@ -9,8 +9,9 @@ import { type KeyboardEvent, useState } from 'react'
import { Section } from '../settings/fields.tsx'
import { useRows } from '../store.tsx'
import { appLink } from '../ui/AppLink.tsx'
-import { Input, Textarea } from '../ui/form.tsx'
-import { Badge, Button, cx, Icon, Note, Spinner } from '../ui/kit.tsx'
+import { Select } from '../ui/controls.tsx'
+import { FormField, Input, Textarea } from '../ui/form.tsx'
+import { Button, cx, Icon, Note, Spinner } from '../ui/kit.tsx'
import { Loading, SkeletonList } from '../ui/LoadStates.tsx'
import {
analysisErrorKey,
@@ -187,7 +188,7 @@ function SoFar({ topics }: { topics: MailTopic[] }) {
{topics.map(topic => (
<li key={topic.title}>
<span>{topic.title}</span>
- <CountBadge topic={topic} />
+ <ConversationCount topic={topic} />
</li>
))}
</ul>
@@ -224,16 +225,15 @@ function Done({ analysis, review }: { analysis: MailAnalysis; review: Review })
</span>
</div>
{assistants.length > 1 && target && (
- <label className="mr-target">
- <span>{t('settings.integrations.mailReview.addTo')}</span>
- <select value={target.id} onChange={e => setAssistantId(e.target.value)}>
- {assistants.map(a => (
- <option key={a.id} value={a.id}>
- {a.name}
- </option>
- ))}
- </select>
- </label>
+ <div className="mr-target">
+ <span aria-hidden="true">{t('settings.integrations.mailReview.addTo')}</span>
+ <Select
+ value={target.id}
+ options={assistants.map(a => ({ value: a.id, label: a.name }))}
+ onChange={setAssistantId}
+ label={t('settings.integrations.mailReview.addTo')}
+ />
+ </div>
)}
{analysis.topics.length === 0 ? (
<p className="help">{t('settings.integrations.mailReview.noTopics')}</p>
@@ -259,11 +259,13 @@ function useDrafts(topics: MailTopic[]) {
}
}
-/** "Mentioned in 18 conversations". */
-function CountBadge({ topic }: { topic: MailTopic }) {
+/** "18 conversations": a value, so grey text, not a badge. */
+function ConversationCount({ topic }: { topic: MailTopic }) {
const t = useT()
return (
- <Badge tone="outline">{t('settings.integrations.mailReview.conversations', { count: topic.conversations })}</Badge>
+ <span className="k-value">
+ {t('settings.integrations.mailReview.conversations', { count: topic.conversations })}
+ </span>
)
}
@@ -284,17 +286,15 @@ function TopicEditor({
const t = useT()
return (
<div className="mr-editor">
- <label className="mr-field" htmlFor={`${id}-q`}>
- <span>{t('settings.integrations.mailReview.question')}</span>
+ <FormField id={`${id}-q`} label={t('settings.integrations.mailReview.question')}>
<Input
id={`${id}-q`}
value={draft.question}
disabled={disabled}
onChange={e => onChange({ ...draft, question: e.target.value })}
/>
- </label>
- <label className="mr-field" htmlFor={`${id}-a`}>
- <span>{t('settings.integrations.mailReview.answer')}</span>
+ </FormField>
+ <FormField id={`${id}-a`} label={t('settings.integrations.mailReview.answer')}>
<Textarea
id={`${id}-a`}
rows={3}
@@ -302,7 +302,7 @@ function TopicEditor({
disabled={disabled}
onChange={e => onChange({ ...draft, answer: e.target.value })}
/>
- </label>
+ </FormField>
</div>
)
}
@@ -491,7 +491,7 @@ function Split({ analysis, review, assistant }: LayoutProps) {
{t('settings.integrations.mailReview.position', { at: at + 1, count: last + 1 })}
</span>
<b>{topic.title}</b>
- <CountBadge topic={topic} />
+ <ConversationCount topic={topic} />
</div>
{stateOf(topic) === 'open' ? (
<>
diff --git a/apps/web/src/integrations/SupportEmail.tsx b/apps/web/src/integrations/SupportEmail.tsx
index a97fbd42..8bdf8201 100644
--- a/apps/web/src/integrations/SupportEmail.tsx
+++ b/apps/web/src/integrations/SupportEmail.tsx
@@ -14,7 +14,8 @@ import { Section } from '../settings/fields.tsx'
import { callAction, useWriteAction } from '../settings/settings-api.ts'
import { useRows } from '../store.tsx'
import { SignInMark } from '../ui/brand-logos.tsx'
-import { Badge, Button } from '../ui/kit.tsx'
+import { Button } from '../ui/kit.tsx'
+import { StatusMark } from '../ui/StatusMark.tsx'
import { Loading, SkeletonList, useLoadState } from '../ui/LoadStates.tsx'
import { List, ListEmpty, ListRow } from '../ui/list.tsx'
import { mailConnectErrorKey, mailConnectResult } from './catalog.ts'
@@ -169,13 +170,15 @@ function Mailbox({
sub={attention ? t('settings.integrations.mail.needsReconnect', { provider }) : provider}
aside={
attention ? (
- <Badge tone="danger" dot title={t('settings.integrations.mail.needsReconnectTip', { provider })}>
+ <>
+ <StatusMark state="failing" label={t('settings.integrations.mail.needsReconnectTip', { provider })} />
{t('settings.integrations.status.needsAttention')}
- </Badge>
+ </>
) : (
- <Badge tone="ok" dot>
+ <>
+ <StatusMark state="works" label={t('settings.integrations.status.connected')} />
{t('settings.integrations.status.connected')}
- </Badge>
+ </>
)
}
actions={
diff --git a/apps/web/src/integrations/connectPlan.test.tsx b/apps/web/src/integrations/connectPlan.test.tsx
index 9004d055..9a14855c 100644
--- a/apps/web/src/integrations/connectPlan.test.tsx
+++ b/apps/web/src/integrations/connectPlan.test.tsx
@@ -31,12 +31,14 @@ describe('Settings › Integrations › MCP: the setup page picker and steps, wi
expect(cursor).toMatch(
/<a class="k-btn k-btn-primary k-btn-md" href="cursor:\/\/[^"]+" title="[^"]+">Add to Cursor<\/a>/,
)
- expect(cursor).toContain('<details class="as-other-way"><summary>Or add it by hand</summary>')
+ expect(cursor).toMatch(
+ /<details class="k-fold"><summary><svg[^>]*k-fold-chevron[\s\S]*?<\/svg><span class="k-fold-closed">Or add it by hand<\/span><\/summary>/,
+ )
expect(render('copilot')).toMatch(/href="vscode:[^"]+"[^>]*>Add to VS Code</)
expect(render('copilot')).toMatch(/href="vscode-insiders:[^"]+"[^>]*>Add to VS Code Insiders</)
const claude = render('claude')
expect(claude).toMatch(/k-btn-primary[^>]*href="https:\/\/claude\.ai[^"]+"[^>]*>Open in Claude</)
- expect(claude).toContain('<summary>Claude Team or Enterprise?</summary>')
+ expect(claude).toContain('<span class="k-fold-closed">Claude Team or Enterprise?</span></summary>')
})
test('ChatGPT: three numbered steps, its form drawn filled in with the address, OAuth picked', () => {
diff --git a/apps/web/src/integrations/mail-review.css b/apps/web/src/integrations/mail-review.css
index d91e11fc..49516a09 100644
--- a/apps/web/src/integrations/mail-review.css
+++ b/apps/web/src/integrations/mail-review.css
@@ -209,14 +209,6 @@
gap: var(--space-3);
margin-top: var(--space-3);
}
-.mr-field {
- display: grid;
- gap: 4px;
-}
-.mr-field > span {
- font-size: 12.5px;
- color: var(--ink-muted);
-}
.mr-actions {
display: flex;
align-items: center;
diff --git a/apps/web/src/onboarding/AgentForm.tsx b/apps/web/src/onboarding/AgentForm.tsx
index 251e1137..51f1fe30 100644
--- a/apps/web/src/onboarding/AgentForm.tsx
+++ b/apps/web/src/onboarding/AgentForm.tsx
@@ -6,6 +6,7 @@ import type { StartForm, StartPlan, StartStep } from '@linedesk/actions'
import { useState } from 'react'
import { useT } from '@linedesk/i18n/react'
import { ClientLink } from '../ui/ClientLink.tsx'
+import { FoldOut } from '../ui/FoldOut.tsx'
import { Button, Icon } from '../ui/kit.tsx'
import { CopyButton } from './Frame.tsx'
import './agent-form.css'
@@ -70,18 +71,15 @@ export function AgentSteps({ plan }: { plan: StartPlan }) {
)
// Only for when the step before did not work as expected: folded away below it.
const fallback = (step: StartStep, i: number) => (
- <details key={step.text} className="as-other-way as-fallback">
- <summary>{step.summary ?? step.text}</summary>
- <div className="as-other-way-body">
- {step.summary && <span>{step.text}</span>}
- {step.code && (
- <div className="as-code">
- <code>{step.code}</code>
- <CopyButton text={step.code} variant={lead(i) ? 'primary' : 'secondary'} />
- </div>
- )}
- </div>
- </details>
+ <FoldOut key={step.text} className="as-fallback" summary={step.summary ?? step.text}>
+ {step.summary && <span>{step.text}</span>}
+ {step.code && (
+ <div className="as-code">
+ <code>{step.code}</code>
+ <CopyButton text={step.code} variant={lead(i) ? 'primary' : 'secondary'} />
+ </div>
+ )}
+ </FoldOut>
)
// Steps done one after the other get their number (1, 2, 3), a fallback goes inside the step it belongs to.
const stepList = numbered ? (
@@ -123,10 +121,7 @@ export function AgentSteps({ plan }: { plan: StartPlan }) {
<ClientLink href={open.href} label={open.label} title={open.title} variant="primary" size="md" />
<span className="as-small">{open.text}</span>
</div>
- <details className="as-other-way">
- <summary>{otherWay}</summary>
- <div className="as-other-way-body">{stepList}</div>
- </details>
+ <FoldOut summary={otherWay}>{stepList}</FoldOut>
</div>
)
}
diff --git a/apps/web/src/onboarding/AgentSetup.tsx b/apps/web/src/onboarding/AgentSetup.tsx
index 697a8b47..add09e48 100644
--- a/apps/web/src/onboarding/AgentSetup.tsx
+++ b/apps/web/src/onboarding/AgentSetup.tsx
@@ -56,9 +56,10 @@ import { dateTimeLabel, untilLabel } from '../time.ts'
import { Select } from '../ui/controls.tsx'
import { AppLink } from '../ui/AppLink.tsx'
import { HelpTip } from '../ui/HelpTip.tsx'
+import { FoldOut } from '../ui/FoldOut.tsx'
import { Button, cx, Icon, Note, Spinner } from '../ui/kit.tsx'
import { LoadProblem, Skeleton, SkeletonPart, useLoading } from '../ui/LoadStates.tsx'
-import { MarkGlyph } from '../ui/StatusMark.tsx'
+import { MarkGlyph, StatusMark } from '../ui/StatusMark.tsx'
import { AgentSteps } from './AgentForm.tsx'
import { AgentPicker, agentLabel, saveClient, savedClient } from './AgentPicker.tsx'
import { installPartsMissing } from './agent-setup-passkey.ts'
@@ -579,18 +580,15 @@ export function AgentSetup({
{cloudBlocked ? (
// A cloud agent cannot reach this install: its steps would not work here, so they wait behind a
// quiet "Show the steps anyway" (for whoever puts a public address in front of it first).
- <details className="as-other-way">
- <summary>{t('onboarding.agentSetup.cloudBlocked.showSteps')}</summary>
- <div className="as-other-way-body">
- <StartAgent
- client={client}
- url={created.url}
- scope={scope}
- change={change}
- edit={editInstall}
- />
- </div>
- </details>
+ <FoldOut summary={t('onboarding.agentSetup.cloudBlocked.showSteps')}>
+ <StartAgent
+ client={client}
+ url={created.url}
+ scope={scope}
+ change={change}
+ edit={editInstall}
+ />
+ </FoldOut>
) : (
<StartAgent client={client} url={created.url} scope={scope} change={change} edit={editInstall} />
)}
@@ -1175,7 +1173,8 @@ export function AgentConnectedBar({ until, onOpen }: { until: string; onOpen: ()
return (
<section className="as-card as-connected" aria-label={t('onboarding.agentSetup.yourAgent')}>
<b className="as-connected-what">
- <span className="as-dot" aria-hidden /> {t('onboarding.agentSetup.progress.connected')}
+ <StatusMark state="works" label={t('onboarding.agentSetup.progress.connected')} />
+ {t('onboarding.agentSetup.progress.connected')}
</b>
<span className="as-small as-connected-until">{t('onboarding.agentSetup.connected.until', { until })}</span>
<Button
diff --git a/apps/web/src/onboarding/BusinessStep.tsx b/apps/web/src/onboarding/BusinessStep.tsx
index 3eb6aa39..d2cd26c8 100644
--- a/apps/web/src/onboarding/BusinessStep.tsx
+++ b/apps/web/src/onboarding/BusinessStep.tsx
@@ -28,6 +28,7 @@ import { explicitCountryPatch } from '../settings/workspaceLocaleModel.ts'
import { useAssistantOf, useRun } from '../store.tsx'
import { appLink, LinkButton } from '../ui/AppLink.tsx'
import { Checkbox, Select } from '../ui/controls.tsx'
+import { FoldOut } from '../ui/FoldOut.tsx'
import { Button, Icon, Note } from '../ui/kit.tsx'
import { PhoneInput } from '../ui/PhoneInput.tsx'
import { flagOf } from '../ui/phoneInputModel.ts'
@@ -832,12 +833,15 @@ function ReviewProfile({
)}
{/* What callers hear about the business: filled in from the listing or the kind of business, so it folds away
under the basics; the owner opens it to check or change it. */}
- <details className="ob-more">
- <summary title={t('onboarding.business.more.tip')}>
- <Icon name="down" size={14} className="ob-more-chevron" />
- <b>{t('onboarding.business.more.title')}</b>
- <span>{t('onboarding.business.more.what')}</span>
- </summary>
+ <FoldOut
+ className="ob-more"
+ title={t('onboarding.business.more.tip')}
+ summary={
+ <>
+ <b>{t('onboarding.business.more.title')}</b> {t('onboarding.business.more.what')}
+ </>
+ }
+ >
<div className="ob-more-body">
<FormField
id="ob-biz-services"
@@ -866,7 +870,7 @@ function ReviewProfile({
<TextArea id="ob-biz-calls" value={draft.useCases} onChange={v => set({ useCases: v })} tall />
</FormField>
</div>
- </details>
+ </FoldOut>
{/* The greeting with the business's name is saved too; the owner hears and edits it in the next step. */}
{fromGoogle && <GoogleMapsCredit />}
</div>
diff --git a/apps/web/src/onboarding/ForwardingCheck.tsx b/apps/web/src/onboarding/ForwardingCheck.tsx
index 8500826b..f7ab9731 100644
--- a/apps/web/src/onboarding/ForwardingCheck.tsx
+++ b/apps/web/src/onboarding/ForwardingCheck.tsx
@@ -15,6 +15,7 @@ import { callAction, readAction, useWriteAction } from '../settings/settings-api
import { refreshGoLiveChecklist } from '../inbox/GoLiveChecklist.tsx'
import { codeOf, rejectionText } from '../shell/rejections.ts'
import { useAssistantName, useRun } from '../store.tsx'
+import { LinkButton } from '../ui/AppLink.tsx'
import { Button, cx, Icon, Note } from '../ui/kit.tsx'
import { PhoneInput } from '../ui/PhoneInput.tsx'
import {
@@ -258,9 +259,9 @@ export function ForwardingCheck({
{suggested && (
<p className="ob2-note fc-suggest">
{t('onboarding.forwardingCheck.suggestCarrier', { carrier: suggested.name })}{' '}
- <button type="button" className="fc-switch" onClick={() => onCarrier?.(suggested.id, 'owner')}>
+ <LinkButton onClick={() => onCarrier?.(suggested.id, 'owner')}>
{t('onboarding.forwardingCheck.switchGuide')}
- </button>
+ </LinkButton>
</p>
)}
{children}
@@ -282,16 +283,14 @@ export function ForwardingCheck({
{lost && (
<Note tone="danger" className="fc-lost">
{dialing ? t('onboarding.forwardingCheck.lostResult') : t('onboarding.forwardingCheck.lostLast')}{' '}
- <button
- type="button"
- className="fc-switch"
+ <LinkButton
onClick={() => {
setLost(false)
setReread(n => n + 1)
}}
>
{t('onboarding.forwardingCheck.checkAgain')}
- </button>
+ </LinkButton>
</Note>
)}
{result && (
diff --git a/apps/web/src/onboarding/ForwardingGuide.tsx b/apps/web/src/onboarding/ForwardingGuide.tsx
index a3cdb344..98a642ce 100644
--- a/apps/web/src/onboarding/ForwardingGuide.tsx
+++ b/apps/web/src/onboarding/ForwardingGuide.tsx
@@ -29,6 +29,7 @@ import { i18n } from '../i18n/index.tsx'
import { useWorkspaceSettings } from '../settings/settings-api.ts'
import { useAssistants } from '../store.tsx'
import { useActiveOptionInView, useAnchoredList } from '../ui/floating.ts'
+import { FoldOut } from '../ui/FoldOut.tsx'
import { Icon, cx } from '../ui/kit.tsx'
import { encodeQr, qrPath } from '../ui/qr.ts'
import { useMediaQuery } from '../ui/useMediaQuery.ts'
@@ -548,8 +549,7 @@ export function ForwardingSteps({
)}
{guide.note && <p className="fg-meta">{guide.note}</p>}
{(guide.pitfalls.length > 0 || (mobile && !compact)) && (
- <details className="fg-more" open={!compact}>
- <summary>{t('onboarding.forwarding.goodToKnow')}</summary>
+ <FoldOut className="fg-more" defaultOpen={!compact} summary={t('onboarding.forwarding.goodToKnow')}>
<ul>
{guide.pitfalls.map(p => (
<li key={p}>{p}</li>
@@ -558,7 +558,7 @@ export function ForwardingSteps({
<li>{t('onboarding.forwarding.checklist', { checklist: phoneChecklist.join(' ') })}</li>
)}
</ul>
- </details>
+ </FoldOut>
)}
<Sources guide={guide} />
</div>
diff --git a/apps/web/src/onboarding/InstallSetup.tsx b/apps/web/src/onboarding/InstallSetup.tsx
index f491c910..09fdefe8 100644
--- a/apps/web/src/onboarding/InstallSetup.tsx
+++ b/apps/web/src/onboarding/InstallSetup.tsx
@@ -32,7 +32,7 @@ import { TryOut } from '../admin/TryOut.tsx'
import { useAdminData } from '../admin/useAdminData.ts'
import type { AdminSecondFactor } from '../auth.ts'
import { brandName } from '../brand.ts'
-import { Badge, Button, cx, Note } from '../ui/kit.tsx'
+import { Button, cx, Note } from '../ui/kit.tsx'
import { Loading, problemText, SkeletonFields } from '../ui/LoadStates.tsx'
import { MarkGlyph } from '../ui/StatusMark.tsx'
import { HostingNote } from './AgentSetup.tsx'
@@ -406,11 +406,7 @@ function PartStep({ step, data, status, setup, reloadAll, onBack, onNext, onSkip
return (
<>
<div className="ob-body">
- {optional && (
- <div className="is-tag">
- <Badge tone="outline">{t('onboarding.install.optionalTag')}</Badge>
- </div>
- )}
+ {optional && <div className="is-tag k-value">{t('onboarding.install.optionalTag')}</div>}
<h1>{group.label}</h1>
<p className="ob-lede">
{t(groupSpec(group.id).whyKey)}
@@ -495,9 +491,7 @@ function OptionalIntro({
return (
<>
<div className="ob-body">
- <div className="is-tag">
- <Badge tone="outline">{t('onboarding.install.optionalTag')}</Badge>
- </div>
+ <div className="is-tag k-value">{t('onboarding.install.optionalTag')}</div>
<h1>{t('onboarding.install.optional.title')}</h1>
<p className="ob-lede">{t('onboarding.install.optional.lede')}</p>
</div>
diff --git a/apps/web/src/onboarding/PhoneStep.tsx b/apps/web/src/onboarding/PhoneStep.tsx
index 7440850a..4720f594 100644
--- a/apps/web/src/onboarding/PhoneStep.tsx
+++ b/apps/web/src/onboarding/PhoneStep.tsx
@@ -12,7 +12,7 @@ import { CarrierNumberInput } from '../settings/CarrierNumberInput.tsx'
import { NearbyAreaCodes } from '../settings/NearbyAreaCodes.tsx'
import { useWorkspaceSettings, useWriteAction } from '../settings/settings-api.ts'
import { useAssistant, useAssistantName, useRows, useRun } from '../store.tsx'
-import { appLink } from '../ui/AppLink.tsx'
+import { appLink, LinkButton } from '../ui/AppLink.tsx'
import { RadioCard } from '../ui/controls.tsx'
import { Button, Note } from '../ui/kit.tsx'
import { useWorkspaceCountry } from '../workspaceLocale.ts'
@@ -263,9 +263,9 @@ function Choose({
))}
</div>
{canAttach && (
- <button type="button" className="ob-link" onClick={() => pick('existing')}>
- {existingLinkText(carrier)}
- </button>
+ <p className="ob2-note">
+ <LinkButton onClick={() => pick('existing')}>{existingLinkText(carrier)}</LinkButton>
+ </p>
)}
</>
)}
@@ -288,14 +288,11 @@ function Choose({
/>
</FormField>
{buyable && (
- <button
- type="button"
- className="ob-link"
- onClick={toChoices}
- title={t('onboarding.phone.choose.backToChoicesTip', { key: 'Esc' })}
- >
- {t('onboarding.phone.choose.backToChoices')}
- </button>
+ <p className="ob2-note">
+ <LinkButton onClick={toChoices} title={t('onboarding.phone.choose.backToChoicesTip', { key: 'Esc' })}>
+ {t('onboarding.phone.choose.backToChoices')}
+ </LinkButton>
+ </p>
)}
</>
) : (
diff --git a/apps/web/src/onboarding/StartAgent.test.tsx b/apps/web/src/onboarding/StartAgent.test.tsx
index e2371e9b..7d693d9c 100644
--- a/apps/web/src/onboarding/StartAgent.test.tsx
+++ b/apps/web/src/onboarding/StartAgent.test.tsx
@@ -5,6 +5,11 @@ import { SetUpYourself, StartAgent } from './AgentSetup.tsx'
const URL = 'https://desk.example.com/mcp/setup/lds_abcdefghijklmnopqrstuvwxyz0123456789ABCDEFG'
const render = (client: AgentClient) => renderToStaticMarkup(<StartAgent client={client} url={URL} />)
+/** The shared FoldOut (ui/FoldOut.tsx), closed, with these words on its line. */
+const foldOut = (summary: string, className = 'k-fold') =>
+ new RegExp(
+ `<details class="${className}"><summary><svg[^>]*k-fold-chevron[\\s\\S]*?</svg><span class="k-fold-closed">${summary}</span></summary>`,
+ )
/** Where the first match sits in the markup: earlier means higher on the page. */
const at = (html: string, pattern: RegExp) => html.search(pattern)
@@ -24,7 +29,7 @@ describe('StartAgent: the open link first where there is one', () => {
// One line on what happens, right after the button.
expect(html).toMatch(new RegExp(`${label}</a><span class="as-small">Opens [^<]+</span>`))
// The other way: below the button, in a disclosure that starts closed, with nothing primary in it.
- expect(html).toContain(`<details class="as-other-way"><summary>${otherWay}</summary>`)
+ expect(html).toMatch(foldOut(otherWay))
expect(html).not.toMatch(/<details[^>]* open/)
expect(at(html, /<details/)).toBeGreaterThan(button)
expect(html.match(/k-btn-primary/g)).toHaveLength(1)
@@ -52,7 +57,7 @@ describe('StartAgent: the open link first where there is one', () => {
expect(without).toEqual(['claude', 'chatgpt', 'codex', 'gemini', 'other'])
for (const client of without) {
const html = render(client)
- expect(html.replaceAll('<details class="as-other-way as-fallback">', ''), client).not.toContain('<details')
+ expect(html.replaceAll('<details class="k-fold as-fallback">', ''), client).not.toContain('<details')
expect(html, client).not.toContain('as-open')
// At most one primary: the first step's copy or link (Claude and ChatGPT start with a step to do in their app).
expect((html.match(/k-btn-primary/g) ?? []).length, client).toBeLessThanOrEqual(1)
@@ -93,7 +98,7 @@ describe("StartAgent: direct links to the cloud apps' own settings", () => {
// The address to copy stays, below the link, in case the link did not fill it in.
// Folded away: only for when the link did not fill it in.
expect(settings).toBeLessThan(
- at(claude, /<details class="as-other-way as-fallback"><summary>Link didn&#x27;t fill in the URL\? Copy it here</),
+ at(claude, foldOut('Link didn&#x27;t fill in the URL\\? Copy it here', 'k-fold as-fallback')),
)
expect(claude).toContain(`<code>${URL}</code>`)
// Numbered: 1 the connector, 2 the chat.
diff --git a/apps/web/src/onboarding/agent-form.css b/apps/web/src/onboarding/agent-form.css
index 12c03694..70103e9b 100644
--- a/apps/web/src/onboarding/agent-form.css
+++ b/apps/web/src/onboarding/agent-form.css
@@ -47,10 +47,6 @@
font-weight: 600;
font-variant-numeric: tabular-nums;
}
-/* Only for when the step's link did not work: folded away, opened on request. */
-.as-fallback > summary {
- justify-self: start;
-}
/* The agent's own form, drawn filled in (AgentForm): a picture of it, not a form of this page. A dashed frame on the
page tone with an "Example" tag; the agent's radio, checkbox and button are drawn grey and inert (only Copy is real).
Dense: one line per field, the label beside the value (above it on a narrow screen), the checkbox and the button on
@@ -270,31 +266,6 @@
justify-items: start;
gap: 6px;
}
-.as-other-way > summary {
- display: inline-block;
- font-size: 12px;
- color: var(--ink-muted);
- cursor: pointer;
- list-style: none;
- text-decoration: underline;
- text-underline-offset: 3px;
-}
-.as-other-way > summary::-webkit-details-marker {
- display: none;
-}
-.as-other-way > summary:hover {
- color: var(--ink);
-}
-.as-other-way > summary:focus-visible {
- outline: 2px solid var(--focus);
- outline-offset: 2px;
- border-radius: 2px;
-}
-.as-other-way-body {
- display: grid;
- gap: 12px;
- margin-top: 10px;
-}
/* A quiet fold (Show prompt, Hide). */
.as-fold {
gap: 4px;
diff --git a/apps/web/src/onboarding/agent-setup.css b/apps/web/src/onboarding/agent-setup.css
index a4ff835b..3e7cc174 100644
--- a/apps/web/src/onboarding/agent-setup.css
+++ b/apps/web/src/onboarding/agent-setup.css
@@ -23,7 +23,6 @@
gap: 14px;
padding: 18px;
background: var(--surface);
- border: 1px solid var(--line);
border-radius: var(--radius-lg);
box-shadow: var(--shadow-card);
}
@@ -67,12 +66,6 @@
.as-waiting {
color: var(--ink-muted);
}
-.as-dot {
- width: 8px;
- height: 8px;
- border-radius: 50%;
- background: var(--live-ok);
-}
/* One part of the setup (This server, Workspace, Partner account): a group label over its steps, in sentence case. */
.as-group {
display: grid;
diff --git a/apps/web/src/onboarding/forwarding-guide.css b/apps/web/src/onboarding/forwarding-guide.css
index f2c93fc9..3ac8f2fc 100644
--- a/apps/web/src/onboarding/forwarding-guide.css
+++ b/apps/web/src/onboarding/forwarding-guide.css
@@ -159,15 +159,10 @@
font-size: 12.5px;
color: var(--ink-muted);
}
-.fg-more summary {
- cursor: pointer;
- font-weight: 500;
- color: var(--ink);
-}
.fg-more ul {
display: grid;
gap: 4px;
- margin: 6px 0 0;
+ margin: 0;
padding-left: 18px;
}
.fg-src {
diff --git a/apps/web/src/onboarding/onboarding.css b/apps/web/src/onboarding/onboarding.css
index bb8b064a..18438679 100644
--- a/apps/web/src/onboarding/onboarding.css
+++ b/apps/web/src/onboarding/onboarding.css
@@ -280,26 +280,6 @@
color: var(--ink);
}
/* The phone step: a quiet link (to a number already in the carrier account, and back to the choices). */
-.ob-link {
- justify-self: start;
- padding: 0;
- border: 0;
- background: none;
- font: inherit;
- font-size: 12.5px;
- color: var(--ink-muted);
- text-decoration: underline;
- text-underline-offset: 2px;
- cursor: pointer;
-}
-.ob-link:hover {
- color: var(--ink);
-}
-.ob-link:focus-visible {
- outline: 2px solid var(--focus);
- outline-offset: 2px;
- border-radius: 2px;
-}
.ob-existing {
display: grid;
gap: 2px;
@@ -321,10 +301,6 @@
display: grid;
gap: 4px;
}
-.ob-left .ob-link {
- font-size: 13px;
- color: var(--ink);
-}
/* Business step: the country set when the workspace was made, with Change to pick another (CountrySelect). */
.ob-biz-country {
@@ -403,40 +379,15 @@
font-size: 12.5px;
color: var(--ink-muted);
}
-/* Business details: what callers hear (services, about, common calls) folds away under the basics. */
+/* Business details: what callers hear (services, about, common calls) folds away under the basics (FoldOut), below a
+ line; its fields keep the form's spacing. */
.ob-more {
border-top: 1px solid var(--line);
padding-top: 14px;
}
-.ob-more > summary {
- display: flex;
- align-items: center;
- gap: 8px;
- cursor: pointer;
- list-style: none;
- font-size: 13px;
-}
-.ob-more > summary::-webkit-details-marker {
- display: none;
-}
-.ob-more > summary > span {
- color: var(--ink-muted);
-}
-.ob-more > summary:hover > span {
- color: var(--ink);
-}
-.ob-more-chevron {
- transform: rotate(-90deg);
- transition: transform 120ms ease;
- color: var(--ink-muted);
-}
-.ob-more[open] .ob-more-chevron {
- transform: none;
-}
.ob-more-body {
display: grid;
gap: 16px;
- margin-top: 16px;
}
/* The last step: what is left before calls are answered, one row each with the way back to it (Onboarding.tsx). */
.ob-left {
diff --git a/apps/web/src/partner/ClientTable.tsx b/apps/web/src/partner/ClientTable.tsx
index 023b8fa0..07194057 100644
--- a/apps/web/src/partner/ClientTable.tsx
+++ b/apps/web/src/partner/ClientTable.tsx
@@ -74,7 +74,7 @@ export function ClientList({
if (data.clients.length === 0) return <ListEmpty>{t('team.partner.clients.empty')}</ListEmpty>
return (
<div className="pc-list">
- <ColumnHeads className="pc-cols" labels={[t('team.partner.clients.col.business'), usageHead]} />
+ <ColumnHeads flat className="pc-cols" labels={[t('team.partner.clients.col.business'), usageHead]} />
<Loading
what={t('team.partner.clients.loadClients')}
loading={!list}
diff --git a/apps/web/src/partner/partner-area.css b/apps/web/src/partner/partner-area.css
index e0710b1e..3aa985e2 100644
--- a/apps/web/src/partner/partner-area.css
+++ b/apps/web/src/partner/partner-area.css
@@ -12,11 +12,7 @@
align-items: center;
}
.pc-cols.ib-cols {
- position: static;
height: 24px;
- padding: 0;
- background: none;
- border-radius: 0;
}
.pc-rows {
display: grid;
diff --git a/apps/web/src/settings/Knowledge.tsx b/apps/web/src/settings/Knowledge.tsx
index f49cfab2..6c7f516b 100644
--- a/apps/web/src/settings/Knowledge.tsx
+++ b/apps/web/src/settings/Knowledge.tsx
@@ -8,6 +8,7 @@ import { useT } from '@linedesk/i18n/react'
import { useEffect, useMemo, useRef, useState } from 'react'
import { fmt } from '../i18n/format.ts'
import { Input, Textarea, FormField } from '../ui/form.tsx'
+import { LinkButton } from '../ui/AppLink.tsx'
import { Badge, Button, cx, Icon } from '../ui/kit.tsx'
import { ListLine } from '../ui/FeatureLine.tsx'
import {
@@ -229,12 +230,7 @@ function Questions(props: QuestionsProps) {
</button>
)
const more = (n: number, label: string, onClick: () => void) =>
- !whole &&
- n > 0 && (
- <button type="button" className="kn-more" onClick={onClick}>
- {label}
- </button>
- )
+ !whole && n > 0 && <LinkButton onClick={onClick}>{label}</LinkButton>
const nothing = parts.questions.length === 0 && groups.length === 0 && suggestions.length === 0
return (
@@ -563,18 +559,17 @@ function TryQuestion(
<b>{name}:</b> {result.answer}
</p>
{from ? (
- <button type="button" className="kn-try-from" onClick={() => props.onOpen(from.key)}>
- {t('settings.knowledge.try.from', { question: from.question })}
- </button>
+ <p className="kn-try-from">
+ <LinkButton onClick={() => props.onOpen(from.key)}>
+ {t('settings.knowledge.try.from', { question: from.question })}
+ </LinkButton>
+ </p>
) : (
- <button
- type="button"
- className="kn-try-from"
- disabled={!canEdit}
- onClick={() => props.onAdd(result.question)}
- >
- {t('settings.knowledge.try.addAsQuestion')}
- </button>
+ <p className="kn-try-from">
+ <LinkButton disabled={!canEdit} onClick={() => props.onAdd(result.question)}>
+ {t('settings.knowledge.try.addAsQuestion')}
+ </LinkButton>
+ </p>
)}
</div>
)}
diff --git a/apps/web/src/settings/TransferContacts.tsx b/apps/web/src/settings/TransferContacts.tsx
index f22d0c17..e35867aa 100644
--- a/apps/web/src/settings/TransferContacts.tsx
+++ b/apps/web/src/settings/TransferContacts.tsx
@@ -479,17 +479,15 @@ export function ContactRow(props: RowProps) {
<span className="tc-examples">
{t('settings.transfer.examples')}
{EXAMPLES.map(example => (
- <button
+ <LinkButton
key={example.label}
- type="button"
- className="tc-example"
onClick={() => {
onChange({ condition: t(example.condition) })
setTimeout(() => condition.current?.focus(), 0)
}}
>
{t(example.label)}
- </button>
+ </LinkButton>
))}
</span>
)}
diff --git a/apps/web/src/settings/assistant.css b/apps/web/src/settings/assistant.css
index ac744b24..8364dc40 100644
--- a/apps/web/src/settings/assistant.css
+++ b/apps/web/src/settings/assistant.css
@@ -578,20 +578,6 @@ a.as-chip:hover {
font-size: 12px;
line-height: 16px;
}
-.tc-example {
- padding: 0;
- border: 0;
- background: none;
- color: var(--ink-muted);
- font: inherit;
- text-decoration: underline;
- text-decoration-color: var(--line-control);
- text-underline-offset: 2px;
- cursor: pointer;
-}
-.tc-example:hover {
- color: var(--ink);
-}
.tc-foot {
display: flex;
flex-wrap: wrap;
diff --git a/apps/web/src/settings/knowledge.css b/apps/web/src/settings/knowledge.css
index 51f576ca..358d9479 100644
--- a/apps/web/src/settings/knowledge.css
+++ b/apps/web/src/settings/knowledge.css
@@ -246,15 +246,9 @@ a.kn-sub:hover {
white-space: pre-line;
}
.kn-try-from {
- justify-self: start;
- padding: 0;
- border: 0;
- background: transparent;
- color: var(--ink-muted);
- font: inherit;
+ margin: 0;
font-size: 12.5px;
- text-decoration: underline;
- cursor: pointer;
+ color: var(--ink-muted);
}
.kn-qa {
margin-top: var(--space-4);
@@ -273,18 +267,3 @@ a.kn-sub:hover {
.kn-mores:empty {
display: none;
}
-.kn-more {
- padding: 4px 0;
- border: 0;
- background: transparent;
- color: var(--ink);
- font: inherit;
- font-size: 13px;
- font-weight: 500;
- text-decoration: underline;
- cursor: pointer;
-}
-.kn-more:focus-visible {
- outline: 2px solid var(--focus);
- outline-offset: 1px;
-}
diff --git a/apps/web/src/styles.css b/apps/web/src/styles.css
index 0ccbf1ca..7012941d 100644
--- a/apps/web/src/styles.css
+++ b/apps/web/src/styles.css
@@ -472,6 +472,8 @@ span.mono { font-family: var(--font-mono); font-size: 12px; color: var(--ink-mut
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; }
.help { font-size: 12.5px; color: var(--ink-muted); }
+/* A value beside a title or over a step (a count, "Optional", a key's role): grey text, never a badge (badges are for status). */
+.k-value { font-size: 12.5px; font-weight: 400; color: var(--ink-muted); white-space: nowrap; }
/* A plan's price a month and its yearly note right under it (ui/price.tsx): one group in the plan boxes. */
.price-line { display: grid; gap: 1px; }
/* A plain link inside helper text looks like every other link (.k-link), never the browser's blue. */
@@ -1593,8 +1595,6 @@ dd.copy:hover { text-decoration: underline; text-underline-offset: 2px; }
.fm-bar-edit { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 2px 4px; margin-left: -4px; font: inherit; color: inherit; background: transparent; border: 0; border-radius: var(--radius-xs); cursor: pointer; text-align: left; }
.fm-bar-edit b { font-weight: 500; }
.fm-bar-edit:hover { background: var(--surface-hover); }
-.fm-bar-clear { flex: none; padding: 2px 4px; font: inherit; font-weight: 500; color: var(--ink); background: transparent; border: 0; border-radius: var(--radius-xs); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-soft); }
-.fm-bar-clear:hover { background: var(--surface-hover); }
.ib-cols .ib-col-caller { grid-column: 1 / 3; }
@@ -1697,7 +1697,6 @@ dd.copy:hover { text-decoration: underline; text-underline-offset: 2px; }
/* Forwarding check (onboarding phone step and Settings, Phone numbers) */
.fc { display: grid; gap: 8px; }
-.fc-switch { padding: 0; border: 0; background: none; color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.fc-result { display: flex; gap: 8px; align-items: center; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-hover); font-size: 13px; line-height: 19px; }
.fc-result.ok { background: var(--highlight); color: var(--highlight-ink); }
.fc-result > span { display: grid; gap: 2px; }
diff --git a/apps/web/src/ui/AppLink.tsx b/apps/web/src/ui/AppLink.tsx
index 7ccff641..8b1ce596 100644
--- a/apps/web/src/ui/AppLink.tsx
+++ b/apps/web/src/ui/AppLink.tsx
@@ -44,16 +44,18 @@ export function LinkButton({
onClick,
title,
id,
+ disabled,
children,
}: {
onClick: () => void
title?: string
/** To put the focus back on it. */
id?: string
+ disabled?: boolean
children: ReactNode
}) {
return (
- <button type="button" id={id} className="k-link" title={title} onClick={onClick}>
+ <button type="button" id={id} className="k-link" title={title} disabled={disabled} onClick={onClick}>
{children}
</button>
)
diff --git a/apps/web/src/ui/linkStandard.test.ts b/apps/web/src/ui/linkStandard.test.ts
index 9b6c04a1..1644acfc 100644
--- a/apps/web/src/ui/linkStandard.test.ts
+++ b/apps/web/src/ui/linkStandard.test.ts
@@ -15,6 +15,18 @@ function sources(dir = SRC): string[] {
})
}
const files = sources().map(path => ({ path, text: readFileSync(join(SRC, path), 'utf8') }))
+
+function styleSheets(dir = SRC): string[] {
+ return readdirSync(dir, { withFileTypes: true }).flatMap(entry => {
+ const path = join(dir, entry.name)
+ if (entry.isDirectory()) return styleSheets(path)
+ return entry.name.endsWith('.css') ? [relative(SRC, path)] : []
+ })
+}
+const sheets = styleSheets().map(path => ({
+ path,
+ text: readFileSync(join(SRC, path), 'utf8').replace(/\/\*[\s\S]*?\*\//g, ''),
+}))
const code = (text: string) => text.replace(/\/\*[\s\S]*?\*\//g, '').replace(/(^|[^:'"`])\/\/.*$/gm, '$1')
/**
@@ -30,6 +42,39 @@ test('the link look comes from AppLink or LinkButton, never a hand-made class',
expect(found, 'Use AppLink (a place in the app) or LinkButton (an action) from ui/AppLink.tsx').toEqual([])
})
+/**
+ * Classes that may be underlined all the time, besides the link itself: HelpTip's "Learn more" (a page outside the
+ * app, inside the tooltip's own look), and the help report's links (feedback/ReportDialog.tsx, being redesigned in its
+ * own work; it moves to LinkButton there).
+ */
+const OWN_UNDERLINE = new Set(['k-link', 'k-help-more', 'fb-link'])
+
+/** The classes of a selector's last part (the element it styles), without :not(…) and pseudo-classes. */
+function styledClasses(selector: string): string[] {
+ const last =
+ selector
+ .trim()
+ .split(/\s*[\s>+~]\s*/)
+ .at(-1) ?? ''
+ return [...last.replace(/:not\([^)]*\)/g, '').matchAll(/\.([\w-]+)/g)].map(m => m[1]!)
+}
+
+test('no class draws the link look by hand: an underline that is always there is AppLink or LinkButton', () => {
+ const found = sheets.flatMap(sheet =>
+ [...sheet.text.matchAll(/([^{}]+)\{([^{}]*)\}/g)]
+ .filter(([, , body]) => /text-decoration:\s*underline/.test(body!))
+ .flatMap(([, selectors]) =>
+ selectors!
+ .split(',')
+ .filter(selector => !/:(hover|focus|active)/.test(selector))
+ .flatMap(styledClasses)
+ .filter(name => !OWN_UNDERLINE.has(name))
+ .map(name => `${sheet.path}: .${name}`),
+ ),
+ )
+ expect(found, 'Use AppLink (a place in the app) or LinkButton (an action) from ui/AppLink.tsx').toEqual([])
+})
+
test('a place named in a message is rendered by appLink or adminLink, not an <a> written in the tag', () => {
const inAppTag = /chunks\s*=>\s*\(?\s*<a\b[^>]*href=(["'`{]+)#/
const found = files.filter(f => inAppTag.test(code(f.text))).map(f => f.path)
diff --git a/apps/web/src/ui/list.css b/apps/web/src/ui/list.css
index 6dbf9557..d4783d93 100644
--- a/apps/web/src/ui/list.css
+++ b/apps/web/src/ui/list.css
@@ -210,3 +210,11 @@
.k-sort span {
width: 8px;
}
+/* ColumnHeads `flat`: the headings of a list inside a card, not sticky and without a band of their own; the rows
+ give the padding (a list may set its own on top). */
+.ib-cols.ib-cols-flat {
+ position: static;
+ padding: 0;
+ background: none;
+ border-radius: 0;
+}
diff --git a/apps/web/src/ui/list.tsx b/apps/web/src/ui/list.tsx
index 5638c6e2..5466b55e 100644
--- a/apps/web/src/ui/list.tsx
+++ b/apps/web/src/ui/list.tsx
@@ -78,13 +78,15 @@ export type ColumnHead = {
* styles.css and app.css). Phones stack the rows, so the headings are hidden there. Screen readers skip them: each
* row already says what it is. `lead` sits in the rows' gutter, where their checkboxes are (the inbox's select-all
* box). `table`: the headings of a `role="table"` list (a row of column headers, a heading with `onSort` a button);
- * `trailing`: an empty heading over the rows' actions.
+ * `trailing`: an empty heading over the rows' actions. `flat`: a list inside a card (Server admin's lists, the partner's
+ * clients): not sticky, no band of their own, on the rows' own padding.
*/
export function ColumnHeads({
labels,
lead,
table,
trailing,
+ flat,
className,
ref,
}: {
@@ -92,13 +94,15 @@ export function ColumnHeads({
lead?: ReactNode
table?: boolean
trailing?: ReactNode
+ flat?: boolean
className?: string
ref?: Ref<HTMLDivElement>
}) {
const heads = labels.map(l => (typeof l === 'string' ? { label: l } : l))
+ const classes = cx('ib-cols', flat && 'ib-cols-flat', className)
if (table)
return (
- <div className={cx('ib-cols', className)} role="row" ref={ref}>
+ <div className={classes} role="row" ref={ref}>
{lead}
{heads.map(h => (
<div
@@ -121,7 +125,7 @@ export function ColumnHeads({
</div>
)
return (
- <div className={cx('ib-cols', className)} role="presentation" ref={ref}>
+ <div className={classes} role="presentation" ref={ref}>
{lead}
{heads.map(h => (
<span key={h.label} aria-hidden="true" className={h.className}>
diff --git a/docs/design-principles.md b/docs/design-principles.md
index 0d6bd54d..5492fba4 100644
--- a/docs/design-principles.md
+++ b/docs/design-principles.md
@@ -45,15 +45,16 @@ Linedesk should feel like a calm, native tool, not a dashboard. These rules come
18. **Links in text: every pointer to another place in the app is a link, one look everywhere.** When a help line, hint, note, banner, empty state or error names a place ("change that under Account › Preferences", "set Answered by under Advanced"), that name is a link to it: underlined, in the text's own ink, with the focus ring, never coloured or bold. It is a plain hash link, so it opens the place the way the menu does and ⌘-click opens a new tab. A place in Server admin is a link only for instance admins; everyone else reads the same words without a link. Walkthrough steps keep rule 14 (a hint, or a new tab). An action inside text ("Try again", "Change") looks the same but is a button. How: `AppLink` and `LinkButton` from `ui/AppLink.tsx`; in a message the place is a tag (`"change that under <link>Account › Preferences</link>"`) rendered with `<T values={{ link: appLink('#account/preferences') }} />` or `adminLink('#admin/providers/…')`, never a sentence split into pieces. `apps/web/src/ui/linkStandard.test.ts` fails on the link class written by hand and on an `<a>` built inside a message tag. Tooltips (`title`) stay plain words: they can't hold a link.
19. **Notice boxes: icon, text and actions vertically centered.** In every box of an icon, text and optional buttons or links (a `Note`, the setup line, a check result), the icon, the text block and the actions share one centre line (`align-items: center`), never the icon pinned to the first text line or a `margin-top`/`padding-top` nudge. When the actions wrap below the text on a narrow screen, the icon still centres with the text block. How: `Note` from `ui/kit.tsx`; a box built by hand gets the same `align-items: center`. `apps/web/src/ui/noticeStandard.test.ts` fails on a `.k-note` that goes back to top alignment.
-## Settings building blocks
+## Building blocks
-Server admin and the workspace, assistant and account settings are built from one set of pieces in `ui/`; a page adds its own element only where none of these fits, and says why in a comment.
+Every screen is built from one set of pieces in `ui/`: Server admin and the settings, and as much the inbox, a call, onboarding, the setup pages, integrations and the partner area. A page adds its own element only where none of these fits, and says why in a comment.
- `SettingRow` (`ui/SettingRow.tsx`): one setting as a row: its name, at most one grey line, its control at the right end (a switch, a select, an sm button, a status badge). Rows in a list are divided by hairlines (`SettingRows`).
- `FeatureLine`, `LinkLine`, `ListLine`, `LineGroup` (`ui/FeatureLine.tsx`): a SettingRow in its own card whose Change opens its settings in place, one that opens a page, the same Change/Close as one row of a list inside a card (transfer contacts, questions and answers), and the quiet label above a group of them.
- `Card` (`ui/form.tsx`) for every raised section; `FormField` for every labelled control; `SaveBar` for a form of several fields, only for the open page's own edits (a switch, a select or a pick saves at once, with Undo).
- `IdentityCard` (`ui/IdentityCard.tsx`): the workspace's or the person's card on top of General and Profile.
-- `FilterChips` (`ui/FilterChips.tsx`) above a list; `ColumnHeads` and `ListEmpty` (`ui/list.tsx`) for every list's headings and empty state; `FoldOut` (`ui/FoldOut.tsx`) for what most people don't need.
+- `FilterChips` (`ui/FilterChips.tsx`) above a list; `ColumnHeads` and `ListEmpty` (`ui/list.tsx`) for every list's headings and empty state (`flat` for a list inside a card: not sticky, no band of its own); `FoldOut` (`ui/FoldOut.tsx`) for what most people don't need ("More details", "Good to know", "Or copy the prompt", a walkthrough's fallback step), `FoldOutButton` for the same line that adds something in place.
+- A value next to a title or in a row (a count, "Optional", a key's role) is grey text (`.k-value`, or `SettingRow`'s value), never a badge; badges are for status (Messages below).
- `DangerConfirmDialog` only for a delete that can't be undone; everything else acts at once with undo (rule 5). Dialog footers: Cancel, then one primary verb.
## Control heights
@@ -64,13 +65,13 @@ Text fields, selects and buttons take their height from three tokens (styles.css
Every message in the app is one of these four. Don't add a new style; pick the kind, then the tone.
-| Kind | Use it for | How |
-| --- | --- | --- |
-| **Toast** | The result of what the user just did ("Key copied.", "Vacation mode is on.", an action that failed). Disappears on its own, with Undo where the action can be undone. | `toast(text)` / `toast(text, true)`; the one dark pill at the bottom (`.toast`). Never for a state that stays. |
-| **Note** | A state of the page that stays until something changes: a hint, a warning, an error loading or saving. | `<Note tone=… title=… action=…>` from `ui/kit.tsx`. |
-| **Field error** | One field that can't be saved as it is. | `error` on `FormField`, or `FormMessage`: one red line right under the field. |
-| **Badge** | The status of one item in a list ("Failing", "Off"). | `<Badge tone=…>`. |
-| **Status mark** | Whether something works: a provider, a group, a server part, a connection. | `<StatusMark state=…>` from `ui/StatusMark.tsx`, next to its words. |
+| Kind | Use it for | How |
+| --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
+| **Toast** | The result of what the user just did ("Key copied.", "Vacation mode is on.", an action that failed). Disappears on its own, with Undo where the action can be undone. | `toast(text)` / `toast(text, true)`; the one dark pill at the bottom (`.toast`). Never for a state that stays. |
+| **Note** | A state of the page that stays until something changes: a hint, a warning, an error loading or saving. | `<Note tone=… title=… action=…>` from `ui/kit.tsx`. |
+| **Field error** | One field that can't be saved as it is. | `error` on `FormField`, or `FormMessage`: one red line right under the field. |
+| **Badge** | The status of one item in a list ("Failing", "Off"). | `<Badge tone=…>`. |
+| **Status mark** | Whether something works: a provider, a group, a server part, a connection. | `<StatusMark state=…>` from `ui/StatusMark.tsx`, next to its words. |
Note tones, from quiet to loud: