Skip to content

Commit 92ff1a3

Browse files
heavygeecursoragent
andcommitted
feat(web): opaque tooltip surface; drop redundant 'updated Nm ago' body
Two operator-feedback fixes on the new session-list HoverTooltip: 1. Tooltip background was bg-[var(--app-bg)] - the same variable as the session row underneath - so the tooltip looked translucent and the row text bled through. Switch to bg-[var(--app-secondary-bg)] (#2C2C2E dark / #f3f4f6 light, both opaque) and bump shadow-md -> shadow-lg. Telegram-themed clients still pick up tg-theme-secondary-bg-color so the tooltip stays on-theme. 2. The 'unread' attention dot tooltip rendered 'New activity / Updated 5m ago', but the relative-time pill ('5m ago') is already on the right edge of the same session row. The tooltip body just duplicated info. Render only the title for the unread case; drop the session.tooltip.unread.body i18n key from en + zh-CN. The other tooltip kinds (permission/input list tools, background lists task count) keep their bodies - those facts are not visible elsewhere on the row. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent c79288f commit 92ff1a3

5 files changed

Lines changed: 7 additions & 17 deletions

File tree

web/src/components/HoverTooltip.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export function HoverTooltip(props: {
4848
id={id}
4949
className={cn(
5050
'pointer-events-none absolute z-30 max-w-[14rem] whitespace-normal',
51-
'rounded-md border border-[var(--app-border)] bg-[var(--app-bg)]',
52-
'px-2 py-1 text-xs leading-snug text-[var(--app-fg)] shadow-md',
51+
'rounded-md border border-[var(--app-border)] bg-[var(--app-secondary-bg)]',
52+
'px-2 py-1 text-xs leading-snug text-[var(--app-fg)] shadow-lg',
5353
side === 'top' ? 'bottom-full mb-1' : 'top-full mt-1',
5454
alignClasses,
5555
'opacity-0 invisible',

web/src/components/SessionAttentionIndicator.test.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ describe('SessionAttentionIndicator tooltip', () => {
166166
expect(tooltip.textContent).toContain('3 tasks running')
167167
})
168168

169-
it('renders relative-time hint for unread attention', () => {
169+
it('renders only the title for unread attention (relative time is already on the row)', () => {
170170
const updatedAt = Date.now() - 5 * 60_000
171171
const summary = makeSummary({
172172
id: 's1',
@@ -183,7 +183,8 @@ describe('SessionAttentionIndicator tooltip', () => {
183183

184184
const tooltip = screen.getByRole('tooltip', { hidden: true })
185185
expect(tooltip.textContent).toContain('New activity')
186-
expect(tooltip.textContent).toMatch(/Updated .+ ago|Updated just now/)
186+
// The "Nm ago" pill in the session row already shows this; do not duplicate.
187+
expect(tooltip.textContent).not.toMatch(/Updated /)
187188
})
188189

189190
it('exposes aria-label on the dot for screen readers', () => {

web/src/components/SessionAttentionIndicator.tsx

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import type { SessionAttention } from '@/lib/sessionAttention'
33
import { getSessionAttentionLabelKey } from '@/lib/sessionAttention'
44
import { useTranslation } from '@/lib/use-translation'
55
import { HoverTooltip } from '@/components/HoverTooltip'
6-
import { formatRelativeTime } from '@/lib/relativeTime'
76

87
const ATTENTION_DOT_CLASS: Record<SessionAttention['kind'], string> = {
98
permission: 'bg-amber-500 animate-pulse',
@@ -122,16 +121,8 @@ function AttentionTooltipDetail(props: {
122121
)
123122
}
124123

125-
if (attention.kind === 'unread') {
126-
const time = formatRelativeTime(summary.updatedAt, t)
127-
if (!time) return null
128-
return (
129-
<span className="mt-1 block text-[var(--app-hint)]">
130-
{t('session.tooltip.unread.body', { time })}
131-
</span>
132-
)
133-
}
134-
124+
// 'unread' deliberately has no body: the relative-time pill is already
125+
// rendered in the session row, so a tooltip body would just duplicate it.
135126
return null
136127
}
137128

web/src/lib/locales/en.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ export default {
114114
'session.tooltip.input.body': 'Reply to:',
115115
'session.tooltip.background.count.one': '1 task running',
116116
'session.tooltip.background.count.other': '{count} tasks running',
117-
'session.tooltip.unread.body': 'Updated {time}',
118117
'session.tooltip.scheduled.body': 'Will fire when due.',
119118
'session.tooltip.moreCount': '+{count} more',
120119
'session.time.justNow': 'just now',

web/src/lib/locales/zh-CN.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ export default {
114114
'session.tooltip.input.body': '回复:',
115115
'session.tooltip.background.count.one': '1 个任务运行中',
116116
'session.tooltip.background.count.other': '{count} 个任务运行中',
117-
'session.tooltip.unread.body': '更新于 {time}',
118117
'session.tooltip.scheduled.body': '到时会自动发送。',
119118
'session.tooltip.moreCount': '另有 {count} 条',
120119
'session.time.justNow': '刚刚',

0 commit comments

Comments
 (0)