Skip to content

Commit 358af80

Browse files
tofikwestclaude
andauthored
refactor(devices): drop inline synced-ago text, neutral re-sync button (#3386)
The dropdown's info block already shows last/next sync times, so the inline 'Synced Xh ago' text was redundant. The icon-only re-sync button goes back to the neutral outline variant — a lone refresh icon doesn't warrant primary emphasis. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 425fd61 commit 358af80

2 files changed

Lines changed: 7 additions & 18 deletions

File tree

‎apps/app/src/app/(app)/[orgId]/people/devices/components/DeviceSyncProviderSelector.test.tsx‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,14 @@ describe('DeviceSyncProviderSelector — last synced text', () => {
146146
);
147147
});
148148

149-
it('shows "Synced Xh ago" next to the control when the selected provider has synced', () => {
149+
it('shows no inline synced text — sync times live inside the dropdown info block', () => {
150150
const threeHoursAgo = new Date(Date.now() - 3 * 60 * 60 * 1000).toISOString();
151151
mockHook({
152152
availableProviders: [{ ...provider, lastSyncAt: threeHoursAgo }],
153153
});
154154

155155
render(<DeviceSyncProviderSelector />);
156156

157-
expect(screen.getByText('Synced 3h ago')).toBeInTheDocument();
158-
});
159-
160-
it('shows no synced text when the provider has never synced', () => {
161-
render(<DeviceSyncProviderSelector />);
162-
163157
expect(screen.queryByText(/^Synced /)).not.toBeInTheDocument();
164158
});
165159
});

‎apps/app/src/app/(app)/[orgId]/people/devices/components/DeviceSyncProviderSelector.tsx‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import {
1414
} from '@trycompai/design-system';
1515
import { InProgress, Renew } from '@trycompai/design-system/icons';
1616
import { usePermissions } from '@/hooks/use-permissions';
17-
import { formatTimeAgo } from '../lib/device-source';
1817
import { useDeviceSync } from '../hooks/useDeviceSync';
1918

2019
const NO_SYNC_VALUE = '__no_sync__';
@@ -100,15 +99,10 @@ export function DeviceSyncProviderSelector() {
10099
};
101100

102101
return (
103-
// Right-aligned inline row: "Synced Xh ago · [provider select] · [↻]".
104-
// The provider name + refresh affordance say what this is; the last-synced
105-
// text gives the freshness at a glance without opening the dropdown.
102+
// Right-aligned inline row: [provider select] · [↻]. The provider name +
103+
// refresh affordance say what this is; last/next sync times live inside
104+
// the dropdown's info block.
106105
<div className="flex flex-wrap items-center justify-end gap-2">
107-
{selected?.lastSyncAt && (
108-
<span className="text-xs text-muted-foreground">
109-
Synced {formatTimeAgo(selected.lastSyncAt)}
110-
</span>
111-
)}
112106
<div className="w-full max-w-[240px]">
113107
{/* Uncontrolled on purpose — mirrors the (working) people-sync select. */}
114108
<Select onValueChange={handleValueChange} disabled={isSyncing}>
@@ -222,9 +216,10 @@ export function DeviceSyncProviderSelector() {
222216
</div>
223217

224218
{selected && (
225-
// Icon-only re-sync in the brand primary: the select already says
226-
// what's syncing — aria-label + title keep it accessible.
219+
// Icon-only re-sync, neutral outline — a lone refresh icon doesn't
220+
// warrant primary emphasis. aria-label + title keep it accessible.
227221
<Button
222+
variant="outline"
228223
size="icon-lg"
229224
onClick={handleSyncNow}
230225
disabled={isSyncing}

0 commit comments

Comments
 (0)