Skip to content

🀯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

πŸ› fix: improve mobile acceptance rows and use standard controls (#19287)

Arvin Xua356dee46397
diff --git a/src/features/Acceptance/Viewer/Checks/AcceptanceCheckInventory.tsx b/src/features/Acceptance/Viewer/Checks/AcceptanceCheckInventory.tsx
index 51b2253b7fa..b44949195ab 100644
--- a/src/features/Acceptance/Viewer/Checks/AcceptanceCheckInventory.tsx
+++ b/src/features/Acceptance/Viewer/Checks/AcceptanceCheckInventory.tsx
@@ -2,7 +2,7 @@
import { Flexbox } from '@lobehub/ui';
import { ActionIcon, Select, Text, toast } from '@lobehub/ui/base-ui';
-import { useResponsive } from 'antd-style';
+import { createStaticStyles, useResponsive } from 'antd-style';
import { ChevronsDownUp, ChevronsUpDown } from 'lucide-react';
import type { ReactNode } from 'react';
import { useCallback, useEffect, useState } from 'react';
@@ -33,6 +33,28 @@ import {
} from './checkState';
import { EMPTY_ID_SET, setAggregateEntry } from './expandState';
+const styles = createStaticStyles(({ css }) => ({
+ filters: css`
+ @media (width <= 767px) {
+ width: 100%;
+ }
+ `,
+ filterSelect: css`
+ width: 118px;
+
+ @media (width <= 767px) {
+ flex: 1;
+ width: 0;
+ min-width: 0;
+ }
+ `,
+ toolbarHeading: css`
+ @media (width <= 767px) {
+ flex-basis: 100%;
+ }
+ `,
+}));
+
interface AcceptanceCheckInventoryProps {
children?: ReactNode;
onOpenTrace?: (verifierOperationId: string) => void | Promise<void>;
@@ -45,9 +67,8 @@ const AcceptanceCheckInventory = ({
toolbar,
}: AcceptanceCheckInventoryProps) => {
const { t } = useTranslation('verify');
- const { lg = true, md = true } = useResponsive();
+ const { md = true } = useResponsive();
const { acceptanceId, embedded } = useAcceptanceScope();
- const compactToolbar = embedded || !lg;
const { data, mutate } = useAcceptanceBundle(acceptanceId);
const [searchParams, setSearchParams] = useSearchParams();
const [localFilter, setLocalFilter] = useState<CheckFilter>('all');
@@ -193,59 +214,69 @@ const AcceptanceCheckInventory = ({
return (
<>
<Flexbox horizontal align={'center'} gap={8} wrap={'wrap'}>
- <Text strong style={{ fontSize: 14, whiteSpace: 'nowrap' }}>
- {t('acceptance.checks.title')}
- </Text>
- <Flexbox flex={1} />
- {toolbar}
- <Select
- size={'small'}
- style={{ height: compactToolbar ? 44 : 34, width: 118 }}
- value={filter}
- variant={'filled'}
- options={[
- { label: t('acceptance.filter.all', { count: counts.total }), value: 'all' },
- { label: t('acceptance.filter.pending', { count: counts.pending }), value: 'pending' },
- {
- label: t('acceptance.filter.needsFix', { count: counts.needsFix }),
- value: 'needsFix',
- },
- {
- label: t('acceptance.filter.accepted', { count: counts.accepted }),
- value: 'accepted',
- },
- { label: t('acceptance.filter.ignored', { count: counts.ignored }), value: 'ignored' },
- ]}
- onChange={(value) => setFilter(value as CheckFilter)}
- />
- {data.rounds.length > 1 && (
+ <Flexbox horizontal align={'center'} className={styles.toolbarHeading} flex={1} gap={8}>
+ <Text strong style={{ fontSize: 14, whiteSpace: 'nowrap' }}>
+ {t('acceptance.checks.title')}
+ </Text>
+ <Flexbox flex={1} />
+ {toolbar}
+ </Flexbox>
+ <Flexbox horizontal align={'center'} className={styles.filters} gap={8}>
<Select
- size={'small'}
- style={{ height: compactToolbar ? 44 : 34, width: 110 }}
- value={roundFilter === null ? 'all' : String(roundFilter)}
+ className={styles.filterSelect}
+ value={filter}
variant={'filled'}
options={[
- { label: t('acceptance.filter.roundAll'), value: 'all' },
- ...[...data.rounds].reverse().map((round) => ({
- label: t('acceptance.round', { round: round.run.roundIndex }),
- value: String(round.run.roundIndex),
- })),
+ { label: t('acceptance.filter.all', { count: counts.total }), value: 'all' },
+ {
+ label: t('acceptance.filter.pending', { count: counts.pending }),
+ value: 'pending',
+ },
+ {
+ label: t('acceptance.filter.needsFix', { count: counts.needsFix }),
+ value: 'needsFix',
+ },
+ {
+ label: t('acceptance.filter.accepted', { count: counts.accepted }),
+ value: 'accepted',
+ },
+ {
+ label: t('acceptance.filter.ignored', { count: counts.ignored }),
+ value: 'ignored',
+ },
]}
- onChange={(value) => setRoundFilter(value === 'all' ? null : Number(value))}
+ onChange={(value) => setFilter(value as CheckFilter)}
/>
- )}
- {grouped && (
- <ActionIcon
- icon={allGroupsCollapsed ? ChevronsUpDown : ChevronsDownUp}
- size={'small'}
- title={
- allGroupsCollapsed
- ? t('acceptance.group.expandAll')
- : t('acceptance.group.collapseAll')
- }
- onClick={() => setCollapsedGroups(allGroupsCollapsed ? new Set() : new Set(groupKeys))}
- />
- )}
+ {data.rounds.length > 1 && (
+ <Select
+ className={styles.filterSelect}
+ value={roundFilter === null ? 'all' : String(roundFilter)}
+ variant={'filled'}
+ options={[
+ { label: t('acceptance.filter.roundAll'), value: 'all' },
+ ...[...data.rounds].reverse().map((round) => ({
+ label: t('acceptance.round', { round: round.run.roundIndex }),
+ value: String(round.run.roundIndex),
+ })),
+ ]}
+ onChange={(value) => setRoundFilter(value === 'all' ? null : Number(value))}
+ />
+ )}
+ {grouped && (
+ <ActionIcon
+ icon={allGroupsCollapsed ? ChevronsUpDown : ChevronsDownUp}
+ size={'small'}
+ title={
+ allGroupsCollapsed
+ ? t('acceptance.group.expandAll')
+ : t('acceptance.group.collapseAll')
+ }
+ onClick={() =>
+ setCollapsedGroups(allGroupsCollapsed ? new Set() : new Set(groupKeys))
+ }
+ />
+ )}
+ </Flexbox>
</Flexbox>
{children}
<CheckList
diff --git a/src/features/Acceptance/Viewer/Checks/CheckRow.tsx b/src/features/Acceptance/Viewer/Checks/CheckRow.tsx
index 22befe8b9a0..dcddad8111f 100644
--- a/src/features/Acceptance/Viewer/Checks/CheckRow.tsx
+++ b/src/features/Acceptance/Viewer/Checks/CheckRow.tsx
@@ -301,6 +301,7 @@ export const AcceptanceCheckRow = memo<{
<Flexbox
horizontal
align={'center'}
+ className={styles.rowTitle}
flex={1}
gap={8}
style={{ minWidth: 0 }}
@@ -438,7 +439,7 @@ export const AcceptanceCheckRow = memo<{
</Tooltip>
)}
</Flexbox>
- <Flexbox align={'center'} height={22}>
+ <Flexbox align={'center'} className={styles.rowChevron} height={22}>
<Icon
color={cssVar.colorTextQuaternary}
icon={ChevronRight}
diff --git a/src/features/Acceptance/Viewer/Checks/styles.ts b/src/features/Acceptance/Viewer/Checks/styles.ts
index 92d45845877..257a5e12dc5 100644
--- a/src/features/Acceptance/Viewer/Checks/styles.ts
+++ b/src/features/Acceptance/Viewer/Checks/styles.ts
@@ -113,14 +113,35 @@ export const styles = createStaticStyles(({ css }) => ({
opacity: 0;
transition: opacity 0.2s;
`,
+ rowChevron: css`
+ @media (width <= 767px) {
+ grid-area: 1 / 4;
+ }
+ `,
rowMeta: css`
transition: opacity 0.2s;
+ @media (width <= 767px) {
+ grid-area: 1 / 3;
+ flex-wrap: wrap;
+ justify-content: flex-end;
+ min-width: 0;
+
+ &:empty {
+ display: none;
+ }
+ }
+
@media (hover: hover) and (pointer: fine) {
pointer-events: none;
opacity: 0;
}
`,
+ rowTitle: css`
+ @media (width <= 767px) {
+ grid-area: 2 / 1 / auto / -1;
+ }
+ `,
rowHeader: css`
cursor: pointer;
padding-block: 12px;
@@ -144,6 +165,15 @@ export const styles = createStaticStyles(({ css }) => ({
&:not([data-expanded]):hover {
background: ${cssVar.colorFillQuaternary};
}
+
+ @media (width <= 767px) {
+ display: grid;
+ grid-template-columns: 16px max-content minmax(0, 1fr) 14px;
+ row-gap: 4px;
+
+ padding-block: 8px;
+ padding-inline: 0;
+ }
`,
stepDot: css`
flex: none;
diff --git a/src/features/Acceptance/Viewer/Focus/AcceptanceEnterFocus.tsx b/src/features/Acceptance/Viewer/Focus/AcceptanceEnterFocus.tsx
index 801031d256c..6af1a2b5873 100644
--- a/src/features/Acceptance/Viewer/Focus/AcceptanceEnterFocus.tsx
+++ b/src/features/Acceptance/Viewer/Focus/AcceptanceEnterFocus.tsx
@@ -2,6 +2,7 @@
import { Icon } from '@lobehub/ui';
import { Button } from '@lobehub/ui/base-ui';
+import { createStaticStyles } from 'antd-style';
import { ChevronRight } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { useNavigate, useSearchParams } from 'react-router';
@@ -12,6 +13,14 @@ import { checksForTurn } from '../turnChecks';
import { useAcceptanceBundle } from '../useAcceptanceBundle';
import { readAcceptanceTurn } from '../useAcceptanceTurn';
+const styles = createStaticStyles(({ css }) => ({
+ button: css`
+ @media (width <= 767px) {
+ display: none;
+ }
+ `,
+}));
+
const AcceptanceEnterFocus = () => {
const { t } = useTranslation('verify');
const navigate = useNavigate();
@@ -23,6 +32,7 @@ const AcceptanceEnterFocus = () => {
return (
<Button
+ className={styles.button}
icon={<Icon icon={ChevronRight} />}
size={'small'}
style={{ alignSelf: 'flex-start', minHeight: 44 }}
diff --git a/src/features/Acceptance/Viewer/Header/AcceptanceTabs.tsx b/src/features/Acceptance/Viewer/Header/AcceptanceTabs.tsx
index 6f8e3d3919a..559025520dd 100644
--- a/src/features/Acceptance/Viewer/Header/AcceptanceTabs.tsx
+++ b/src/features/Acceptance/Viewer/Header/AcceptanceTabs.tsx
@@ -1,8 +1,7 @@
'use client';
import { Flexbox, Icon } from '@lobehub/ui';
-import { Button, Text } from '@lobehub/ui/base-ui';
-import { createStaticStyles, cssVar, cx } from 'antd-style';
+import { Tabs, Tag } from '@lobehub/ui/base-ui';
import { ListChecks, Paperclip, Route } from 'lucide-react';
import { useTranslation } from 'react-i18next';
@@ -16,47 +15,6 @@ interface AcceptanceTabsProps {
resourceCount: number;
}
-const styles = createStaticStyles(({ css }) => ({
- count: css`
- padding-block: 0;
- padding-inline: 6px;
- border-radius: 99px;
-
- font-size: 11px;
- color: ${cssVar.colorTextSecondary};
-
- background: ${cssVar.colorFillSecondary};
- `,
- tab: css`
- cursor: pointer;
-
- position: relative;
-
- padding-block: 8px;
- padding-inline: 10px;
-
- white-space: nowrap;
-
- &:hover {
- color: ${cssVar.colorText};
- }
- `,
- tabActive: css`
- &::after {
- content: '';
-
- position: absolute;
- inset-block-end: -1px;
- inset-inline: 6px;
-
- block-size: 2px;
- border-radius: 2px;
-
- background: ${cssVar.colorPrimary};
- }
- `,
-}));
-
/**
* The delivery's two faces: the checks a person judges, and the artefacts the
* rounds produced. They sit above the full-width rule so the rule reads as the
@@ -87,26 +45,24 @@ const AcceptanceTabs = ({
];
return (
- <Flexbox horizontal align={'center'} gap={2}>
- {tabs
+ <Tabs
+ activeKey={active}
+ style={{ minWidth: 0, overflowX: 'auto' }}
+ variant={'square'}
+ items={tabs
.filter((tab) => tab.key !== 'flow' || flowCount > 0)
- .map((tab) => (
- <Button
- aria-pressed={tab.key === active}
- className={cx(styles.tab, tab.key === active && styles.tabActive)}
- key={tab.key}
- style={{ minHeight: 44 }}
- type={'text'}
- onClick={() => onChange(tab.key)}
- >
- <Icon icon={tab.icon} size={14} style={{ color: cssVar.colorTextTertiary }} />
- <Text fontSize={13} weight={tab.key === active ? 600 : 400}>
+ .map((tab) => ({
+ icon: <Icon icon={tab.icon} size={16} />,
+ key: tab.key,
+ label: (
+ <Flexbox horizontal align={'center'} gap={6}>
{tab.label}
- </Text>
- <Text className={styles.count}>{tab.count}</Text>
- </Button>
- ))}
- </Flexbox>
+ <Tag shape={'round'}>{tab.count}</Tag>
+ </Flexbox>
+ ),
+ }))}
+ onChange={(key) => onChange(key as AcceptanceTabKey)}
+ />
);
};
diff --git a/src/features/Acceptance/Viewer/Review/DecisionBar.tsx b/src/features/Acceptance/Viewer/Review/DecisionBar.tsx
index 5442fb3e8a8..084ff214140 100644
--- a/src/features/Acceptance/Viewer/Review/DecisionBar.tsx
+++ b/src/features/Acceptance/Viewer/Review/DecisionBar.tsx
@@ -2,7 +2,7 @@
import { Flexbox, Icon } from '@lobehub/ui';
import { Button, Text } from '@lobehub/ui/base-ui';
-import { createStaticStyles, cssVar, useResponsive } from 'antd-style';
+import { createStaticStyles, cssVar } from 'antd-style';
import {
BadgeCheck,
CircleAlert,
@@ -26,7 +26,8 @@ const styles = createStaticStyles(({ css }) => ({
inset-block-end: 16px;
display: flex;
- gap: 10px;
+ flex-wrap: wrap;
+ gap: 12px;
align-items: center;
width: 100%;
@@ -35,29 +36,34 @@ const styles = createStaticStyles(({ css }) => ({
padding-block: 12px;
padding-inline: 16px;
border: 1px solid ${cssVar.colorBorderSecondary};
- border-radius: 14px;
+ border-radius: ${cssVar.borderRadiusLG};
background: ${cssVar.colorBgElevated};
box-shadow: ${cssVar.boxShadowTertiary};
@media (width <= 767px) {
inset-block-end: max(8px, env(safe-area-inset-bottom));
- flex-wrap: wrap;
- gap: 8px;
padding: 12px;
+ }
+ `,
+ summary: css`
+ flex: 1;
+ min-width: 160px;
+ `,
+ actions: css`
+ flex: none;
+ flex-wrap: wrap;
+ justify-content: flex-end;
- > button {
- min-height: 44px;
- }
+ > button {
+ flex: none;
+ }
- > .acceptance-decision-actions {
- flex-wrap: wrap;
- width: 100%;
- }
+ @media (width <= 480px) {
+ width: 100%;
- .acceptance-decision-actions > button {
+ > button {
flex: 1;
- min-height: 44px;
}
}
`,
@@ -225,7 +231,6 @@ const DecisionBar = memo<DecisionBarProps>(
totalCount,
}) => {
const { t } = useTranslation('verify');
- const { md = true } = useResponsive();
const stateMeta = {
accepted: { color: cssVar.colorSuccess, icon: BadgeCheck },
@@ -263,79 +268,68 @@ const DecisionBar = memo<DecisionBarProps>(
return (
<div className={styles.bar}>
- {stateMeta ? (
- // accepted / live / rejected β€” a plain coloured status mark.
- <Icon
- color={stateMeta.color}
- icon={stateMeta.icon}
- size={22}
- spin={state === 'live'}
- style={{ flex: 'none' }}
- />
- ) : allConfirmed ? (
- // Every check signed off β€” the same clean badge the accepted state carries.
- <Icon
- className={justCompleted ? styles.completePop : undefined}
- color={cssVar.colorSuccess}
- icon={BadgeCheck}
- size={22}
- style={{ flex: 'none' }}
- />
- ) : settledNeedsFix ? (
- <Icon
- className={justCompleted ? styles.completePop : undefined}
- color={cssVar.colorWarning}
- icon={CircleAlert}
- size={22}
- style={{ flex: 'none' }}
- />
- ) : (
- <ProgressRing done={decidedCount} total={totalCount} />
- )}
- <Flexbox gap={2} style={{ flex: '0 1 auto', minWidth: 0 }}>
- <Text ellipsis strong style={{ fontSize: 14 }}>
- {!md && state === 'settled'
- ? t('acceptance.bar.mobileProgress', { done: decidedCount, total: totalCount })
- : statusText}
- </Text>
- {subText && (
- <Text ellipsis fontSize={12} type={'secondary'}>
- {subText}
- </Text>
+ <Flexbox horizontal align={'center'} className={styles.summary} gap={8}>
+ {stateMeta ? (
+ // accepted / live / rejected β€” a plain coloured status mark.
+ <Icon
+ color={stateMeta.color}
+ icon={stateMeta.icon}
+ size={22}
+ spin={state === 'live'}
+ style={{ flex: 'none' }}
+ />
+ ) : allConfirmed ? (
+ // Every check signed off β€” the same clean badge the accepted state carries.
+ <Icon
+ className={justCompleted ? styles.completePop : undefined}
+ color={cssVar.colorSuccess}
+ icon={BadgeCheck}
+ size={22}
+ style={{ flex: 'none' }}
+ />
+ ) : settledNeedsFix ? (
+ <Icon
+ className={justCompleted ? styles.completePop : undefined}
+ color={cssVar.colorWarning}
+ icon={CircleAlert}
+ size={22}
+ style={{ flex: 'none' }}
+ />
+ ) : (
+ <ProgressRing done={decidedCount} total={totalCount} />
)}
- </Flexbox>
+ <Flexbox gap={2} style={{ flex: '0 1 auto', minWidth: 0 }}>
+ <Text ellipsis type={'secondary'}>
+ {statusText}
+ </Text>
+ {subText && (
+ <Text ellipsis fontSize={12} type={'secondary'}>
+ {subText}
+ </Text>
+ )}
+ </Flexbox>
- {/* The clearing list β€” every note this round queues for the next one.
+ {/* The clearing list β€” every note this round queues for the next one.
Sits with the status reading on the left: it explains that reading,
while the right side stays pure actions. */}
- {feedbackCount > 0 && (
- <Button
- icon={<Icon icon={ListTodo} />}
- size={'small'}
- style={{ flex: 'none' }}
- type={'text'}
- onClick={onOpenFeedback}
- >
- {t('acceptance.bar.feedback', { count: feedbackCount })}
- </Button>
- )}
-
- <Flexbox
- horizontal
- className={'acceptance-decision-actions'}
- gap={8}
- style={{ marginInlineStart: 'auto' }}
- >
+ {feedbackCount > 0 && (
+ <Button
+ icon={<Icon icon={ListTodo} />}
+ size={'small'}
+ style={{ flex: 'none' }}
+ type={'text'}
+ onClick={onOpenFeedback}
+ >
+ {t('acceptance.bar.feedback', { count: feedbackCount })}
+ </Button>
+ )}
+ </Flexbox>
+ <Flexbox horizontal className={styles.actions} gap={8}>
{/* A dispatched send-back (repairing) keeps the copy entry alive β€”
the reviewer may still hand the prompt to another agent. Embedded,
the composer beside it already receives the draft. */}
{state === 'live' && hasFeedback && !embedded && (
- <Button
- disabled={pending}
- style={{ flex: 'none' }}
- type={'fill'}
- onClick={onCopyReview}
- >
+ <Button disabled={pending} type={'fill'} onClick={onCopyReview}>
{t('acceptance.bar.copyReview')}
</Button>
)}
@@ -345,32 +339,25 @@ const DecisionBar = memo<DecisionBarProps>(
// Feedback is queued β€” the delivery isn't being accepted now; the
// bar's job is getting the repair round started.
<>
- {!embedded && (
- <Button
- disabled={pending}
- style={{ flex: 'none' }}
- type={'primary'}
- onClick={onCopyReview}
- >
- {t('acceptance.bar.copyReview')}
- </Button>
- )}
{/* Last words before the repair leaves β€” a global note the next
round reads, for what the queued per-check feedback missed. */}
<Button
disabled={pending}
icon={<Icon icon={MessageSquarePlus} />}
- style={{ flex: 'none' }}
type={'fill'}
onClick={onAddComment}
>
{t('acceptance.bar.addComment')}
</Button>
+ {!embedded && (
+ <Button disabled={pending} type={'primary'} onClick={onCopyReview}>
+ {t('acceptance.bar.copyReview')}
+ </Button>
+ )}
{embedded && rerunAvailable && (
<Button
disabled={pending}
loading={rerunPending}
- style={{ flex: 'none' }}
type={'primary'}
onClick={onRerun}
>
@@ -382,17 +369,11 @@ const DecisionBar = memo<DecisionBarProps>(
// Clean review β€” accept carries primary weight only once every
// check is signed off; before that it stays a quiet option.
<>
- <Button
- disabled={pending}
- style={{ flex: 'none' }}
- type={'text'}
- onClick={onRejectComment}
- >
+ <Button disabled={pending} type={'text'} onClick={onRejectComment}>
{t('acceptance.bar.rejectComment')}
</Button>
<Button
disabled={pending}
- style={{ flex: 'none' }}
type={allConfirmed ? 'primary' : 'fill'}
onClick={onAccept}
>