Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -1349,6 +1349,52 @@ select:disabled {
background: var(--surface-soft);
}


.order-flow-steps {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
padding: 0.8rem;
border-radius: var(--radius-lg);
background: color-mix(in srgb, var(--accent-soft) 46%, var(--surface));
border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
}

.order-flow-steps span {
display: inline-flex;
align-items: center;
min-height: 2rem;
padding: 0.3rem 0.65rem;
border-radius: var(--radius-pill);
background: var(--surface);
color: var(--ink-soft);
font-size: 0.84rem;
font-weight: 800;
}

.order-primary-section {
border-color: color-mix(in srgb, var(--accent) 28%, var(--border));
}

.optional-order-section {
background: color-mix(in srgb, var(--surface-soft) 78%, var(--surface));
}

.line-entry-card-empty {
padding: 0.85rem;
border-style: dashed;
background: color-mix(in srgb, var(--surface) 82%, var(--surface-soft));
box-shadow: none;
}

.line-entry-card-empty .line-entry-top {
padding-bottom: 0;
}

.line-entry-card-empty .line-grid {
gap: var(--space-3);
}

.line-editor-stack {
gap: var(--space-5);
}
Expand Down
2 changes: 1 addition & 1 deletion app/orders/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default async function NewOrderPage({

{params?.error ? <p className="inline-warning">{params.error}</p> : null}

<section className="page-context-card">
<section className="page-context-card support-section">
<OrdersIcon className="callout-icon" />
<div>
<strong>{t('orders.newPage.calloutTitle')}</strong>
Expand Down
5 changes: 3 additions & 2 deletions components/orders/line-items-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ function LineRow({
template?: boolean;
}) {
const { t } = useI18n();
const isEmptyDraft = !line.productLabel.trim() && !String(line.quantity).trim() && !line.note.trim();
const labels = {
line: t('orders.lineEditor.line'),
remove: t('orders.lineEditor.remove'),
Expand All @@ -118,14 +119,14 @@ function LineRow({

return (
<div
className="line-entry-card line-entry-card-structured"
className={`line-entry-card line-entry-card-structured ${isEmptyDraft && !template ? 'line-entry-card-empty' : ''}`}
data-line-row
data-template={template ? 'true' : 'false'}
>
<div className="line-entry-top">
<div>
<strong data-line-number>{`${labels.line} ${index + 1}`}</strong>
<p className="helper-text no-margin">{t('orders.lineEditor.rowHelp')}</p>
<p className="helper-text no-margin">{isEmptyDraft && !template ? 'Type the item and quantity. Add more lines only if needed.' : t('orders.lineEditor.rowHelp')}</p>
</div>
<div className="action-cluster wrap-cluster compact-actions">
{status ? <span className={`badge badge-${status.tone}`}>{status.label}</span> : null}
Expand Down
18 changes: 12 additions & 6 deletions components/orders/order-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function OrderForm({
}: OrderFormProps) {
const { t, locale } = useI18n();
const [selectedCustomerId, setSelectedCustomerId] = useState(order?.customerId ?? initialCustomerId ?? '');
const lineDrafts = getDefaultLineDrafts(order?.lines);
const lineDrafts = getDefaultLineDrafts(order?.lines, order ? Math.max(order.lines.length, 1) : 1);
const visibleCustomers = customers.filter((customer) => customer.active || customer.id === order?.customerId);
const selectedCustomer = useMemo(
() => visibleCustomers.find((customer) => customer.id === selectedCustomerId) ?? null,
Expand Down Expand Up @@ -142,8 +142,14 @@ export function OrderForm({
</div>
) : null}

<div className="order-flow-steps" aria-label="Fast order flow">
<span>1. Customer and date</span>
<span>2. Item and quantity</span>
<span>3. Save order</span>
</div>

<div className="field-section-grid">
<section className="field-section">
<section className="field-section order-primary-section line-span-2">
<div className="field-section-header">
<div>
<h3>{t('orders.orderForm.sections.whoAndWhen')}</h3>
Expand Down Expand Up @@ -295,7 +301,7 @@ export function OrderForm({
) : null}
</section>

<section className="field-section">
<section className="field-section optional-order-section support-section">
<div className="field-section-header">
<div>
<h3>{t('orders.orderForm.sections.dispatch')}</h3>
Expand Down Expand Up @@ -338,7 +344,7 @@ export function OrderForm({
<p className="helper-text no-margin">{t('orders.orderForm.dispatchHint.delivery')}</p>
</section>

<section className="field-section">
<section className="field-section optional-order-section support-section">
<div className="field-section-header">
<div>
<h3>{t('orders.orderForm.sections.visibility')}</h3>
Expand Down Expand Up @@ -385,7 +391,7 @@ export function OrderForm({
<div className="field-section-header">
<div>
<h3>{t('orders.orderForm.sections.lines')}</h3>
<p className="helper-text">{t('orders.orderForm.sections.linesHelp')}</p>
<p className="helper-text">Start with one item. Add another line only when this order needs it.</p>
</div>
</div>
<p className="helper-text no-margin">Confirmed products appear as suggestions, but you can still type a draft item when setup is incomplete. <Link href="/admin/setup?section=products#products" className="inline-link">Confirm products</Link>.</p>
Expand All @@ -395,7 +401,7 @@ export function OrderForm({
productSuggestions={productSuggestions}
lineTypeOptions={lineTypeOptions}
existingStatuses={existingStatuses}
sectionLabel={t('orders.orderForm.sections.linesHelp')}
sectionLabel="Freeform item names are allowed; product suggestions are optional."
/>
</section>
</section>
Expand Down
1 change: 1 addition & 0 deletions docs/mwp-readiness-audit.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ Do not include these in the first deploy readiness scope:

- Added a narrow product confirmation path in `/admin/setup` for MWP product name, default unit, optional category, and active state.
- Kept draft product order lines available so catalog setup does not block real work.
- Simplified new order capture so first use starts with one visible line, a clearer customer/date -> item -> save flow, and secondary dispatch details.
- Added operator-home runtime/demo visibility and a first-deploy workflow card.
- Added empty-state guidance to `/orders` for missing recurring templates and missing first orders.
- Added production entry links and clearer empty guidance for production boards with no visible orders.
Expand Down
Loading