Skip to content

The agent that grows with you

fix(desktop): remove composer input backdrop blur

yuexiong7b81848ce587
diff --git a/apps/desktop/src/app/chat/composer/fallback.test.tsx b/apps/desktop/src/app/chat/composer/fallback.test.tsx
new file mode 100644
index 00000000000..0ccb752c0bf
--- /dev/null
+++ b/apps/desktop/src/app/chat/composer/fallback.test.tsx
@@ -0,0 +1,20 @@
+import { render } from '@testing-library/react'
+import { describe, expect, it } from 'vitest'
+
+import { composerInputSurface } from '@/components/chat/composer-dock'
+
+import { ChatBarFallback } from './index'
+
+const hasBackdropFilter = (classes: string) =>
+ classes.includes('backdrop-blur') || classes.includes('backdrop-saturate') || classes.includes('backdrop-filter')
+
+describe('ChatBarFallback', () => {
+ it('uses the same filter-free surface treatment as the hydrated composer', () => {
+ const { container } = render(<ChatBarFallback />)
+ const paint = container.querySelector<HTMLElement>('[aria-hidden="true"]')
+
+ expect(paint).not.toBeNull()
+ expect(paint?.className).toContain(composerInputSurface)
+ expect(hasBackdropFilter(paint?.className ?? '')).toBe(false)
+ })
+})
diff --git a/apps/desktop/src/app/chat/composer/index.tsx b/apps/desktop/src/app/chat/composer/index.tsx
index 5d1381fbe4a..053ee617b81 100644
--- a/apps/desktop/src/app/chat/composer/index.tsx
+++ b/apps/desktop/src/app/chat/composer/index.tsx
@@ -4,7 +4,7 @@ import { type ClipboardEvent, type FormEvent, type KeyboardEvent, useCallback, u
import { useTourMarker } from '@/app/chat/tour-marker'
import { useHudComposerDrag } from '@/app/hud/composer-drag'
-import { composerFill, composerFloatingStrip, composerSurfaceGlass } from '@/components/chat/composer-dock'
+import { composerFloatingStrip, composerInputSurface } from '@/components/chat/composer-dock'
import { $chatOnboardingSolo, $chatOnboardingThreadIds } from '@/components/onboarding-chat/assembly'
import { OnboardingSkip } from '@/components/onboarding-chat/skip'
import { OnboardingStart } from '@/components/onboarding-chat/start'
@@ -1407,11 +1407,7 @@ export function ChatBar({
>
<div
aria-hidden
- className={cn(
- 'pointer-events-none absolute inset-0 -z-10 rounded-[inherit]',
- composerFill,
- composerSurfaceGlass
- )}
+ className={cn('pointer-events-none absolute inset-0 -z-10 rounded-[inherit]', composerInputSurface)}
/>
{!guidedChat && (
<CodingStatusRow
@@ -1532,11 +1528,7 @@ export function ChatBarFallback() {
<div className="composer-fallback-surface relative isolate h-(--composer-fallback-height) w-full rounded-[inherit] border border-[color-mix(in_srgb,var(--dt-composer-ring)_calc(18%*var(--composer-ring-strength)),var(--dt-input))]">
<div
aria-hidden
- className={cn(
- 'pointer-events-none absolute inset-0 -z-10 rounded-[inherit]',
- composerFill,
- composerSurfaceGlass
- )}
+ className={cn('pointer-events-none absolute inset-0 -z-10 rounded-[inherit]', composerInputSurface)}
/>
</div>
</div>
diff --git a/apps/desktop/src/components/chat/composer-dock.test.ts b/apps/desktop/src/components/chat/composer-dock.test.ts
new file mode 100644
index 00000000000..6f9d44431a2
--- /dev/null
+++ b/apps/desktop/src/components/chat/composer-dock.test.ts
@@ -0,0 +1,23 @@
+import { describe, expect, it } from 'vitest'
+
+import {
+ composerDockCard,
+ composerFill,
+ composerInputSurface,
+ composerPanelCard
+} from '@/components/chat/composer-dock'
+
+const hasBackdropFilter = (classes: string) =>
+ classes.includes('backdrop-blur') || classes.includes('backdrop-saturate') || classes.includes('backdrop-filter')
+
+describe('composer surface treatments', () => {
+ it('keeps the frequently repainting input surface free of backdrop filters', () => {
+ expect(composerInputSurface).toContain(composerFill)
+ expect(hasBackdropFilter(composerInputSurface)).toBe(false)
+ })
+
+ it('retains the glass treatment on non-input composer chrome', () => {
+ expect(hasBackdropFilter(composerDockCard())).toBe(true)
+ expect(hasBackdropFilter(composerPanelCard)).toBe(true)
+ })
+})
diff --git a/apps/desktop/src/components/chat/composer-dock.ts b/apps/desktop/src/components/chat/composer-dock.ts
index 8a05b0afe00..27684cc4ee0 100644
--- a/apps/desktop/src/components/chat/composer-dock.ts
+++ b/apps/desktop/src/components/chat/composer-dock.ts
@@ -7,11 +7,17 @@ import { cn } from '@/lib/utils'
*/
export const composerFill = 'bg-(--composer-fill)'
-/** Backdrop treatment for the composer input surface. Harmless when the fill
+const composerFillTransition = 'transition-[background-color] duration-150 ease-out'
+
+/** Paint for the frequently repainting editable surface. Keep backdrop filters
+ * off this hot path so typing does not re-blur the transcript each frame. */
+export const composerInputSurface = cn(composerFill, composerFillTransition)
+
+/** Backdrop treatment for non-input composer chrome. Harmless when the fill
* goes opaque (drawer open) — nothing shows through to blur. */
export const composerSurfaceGlass = cn(
'backdrop-blur-[0.75rem] backdrop-saturate-[1.12] [-webkit-backdrop-filter:blur(0.75rem)_saturate(1.12)]',
- 'transition-[background-color] duration-150 ease-out'
+ composerFillTransition
)
const composerDockEdge = (edge: 'bottom' | 'top') =>