mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 12:24:30 +01:00
feat(frontend): dock the mobile composer as a solid full-width strip and enlarge the mic and tools buttons
This commit is contained in:
1 parent
32102cca3e
commit
570e528ba1
7 files changed
+29
-26
No files matched your search
@@ -41,14 +41,14 @@ describe('ComposerActivityBar', () => {
|
||||
expect(container).toBeEmptyDOMElement()
|
||||
})
|
||||
|
||||
it('anchors a pointer-transparent progressbar in the gap below the composer', () => {
|
||||
it('sits inside the docked composer on mobile and below the composer on desktop', () => {
|
||||
useSessionStatus.getState().setStatus('session-a', { type: 'busy' })
|
||||
|
||||
render(<ComposerActivityBar sessionID="session-a" />)
|
||||
|
||||
const bar = screen.getByRole('progressbar', { name: 'Session working' })
|
||||
expect(bar).toHaveClass('pointer-events-none', 'flex')
|
||||
expect(bar).toHaveClass('absolute', 'inset-x-3', '-bottom-[10px]', 'md:-bottom-[11px]')
|
||||
expect(bar).toHaveClass('absolute', 'inset-x-3', 'bottom-1', 'md:-bottom-[11px]')
|
||||
expect(bar).not.toHaveClass('fixed')
|
||||
})
|
||||
|
||||
|
||||
@@ -25,8 +25,9 @@ const ACTIVITY_PRESENTATION = {
|
||||
} as const satisfies Record<string, { label: string; tone: ScannerTone }>
|
||||
|
||||
/**
|
||||
* Session activity scanner anchored in the gap below the composer frame. A fading lit window of
|
||||
* 4x8px segments sweeps across the strip. Renders nothing while the session is idle and has no
|
||||
* Session activity scanner shown by the composer. On mobile it sits inside the bottom edge of the
|
||||
* docked composer; from `md` it is anchored in the gap below the composer frame. A fading lit window
|
||||
* of 4x8px segments sweeps across the strip. Renders nothing while the session is idle and has no
|
||||
* background activity; otherwise announces the current activity through an indeterminate
|
||||
* progressbar.
|
||||
*/
|
||||
@@ -51,7 +52,7 @@ export function ComposerActivityBar({ sessionID }: ComposerActivityBarProps) {
|
||||
aria-label={label}
|
||||
aria-valuemin={0}
|
||||
aria-valuemax={100}
|
||||
className="pointer-events-none absolute inset-x-3 -bottom-[10px] flex md:-bottom-[11px]"
|
||||
className="pointer-events-none absolute inset-x-3 bottom-1 flex md:-bottom-[11px]"
|
||||
>
|
||||
<ScannerBars tone={activity.tone} />
|
||||
</div>
|
||||
|
||||
@@ -249,12 +249,12 @@ describe('ComposerToolsMenu', () => {
|
||||
expect(props.onAttachFile).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('uses the 36px control size for the trigger', () => {
|
||||
it('uses the 40px control size for the trigger', () => {
|
||||
mockPermissionMode()
|
||||
renderMenu()
|
||||
|
||||
const trigger = screen.getByRole('button', { name: 'Composer options' })
|
||||
expect(trigger).toHaveClass('size-9', 'p-0')
|
||||
expect(trigger).toHaveClass('size-10', 'p-0')
|
||||
expect(trigger).not.toHaveClass('p-2')
|
||||
})
|
||||
})
|
||||
|
||||
@@ -56,7 +56,7 @@ export function ComposerToolsMenu({
|
||||
type="button"
|
||||
aria-label="Composer options"
|
||||
title="Composer options"
|
||||
className={cn(getIconToggleButtonClassName(permission.isAuto || sandbox.isSandboxed || goalArmed), 'flex items-center justify-center size-9 p-0')}
|
||||
className={cn(getIconToggleButtonClassName(permission.isAuto || sandbox.isSandboxed || goalArmed), 'flex items-center justify-center size-10 p-0')}
|
||||
>
|
||||
<Plus className="w-5 h-5" />
|
||||
</button>
|
||||
|
||||
@@ -291,7 +291,7 @@ describe('PromptInput composer layout', () => {
|
||||
renderComponent({ showScrollButton: true, onScrollToBottom })
|
||||
|
||||
const arrow = screen.getByRole('button', { name: 'Scroll to bottom' })
|
||||
expect(arrow).toHaveClass('size-9', 'p-0')
|
||||
expect(arrow).toHaveClass('size-10', 'p-0')
|
||||
|
||||
fireEvent.click(arrow)
|
||||
|
||||
@@ -359,18 +359,18 @@ describe('PromptInput composer layout', () => {
|
||||
})
|
||||
|
||||
describe('control sizing', () => {
|
||||
it('keeps the mic at 36px before and after the prompt gains focus on mobile', () => {
|
||||
it('keeps the mic at 40px before and after the prompt gains focus on mobile', () => {
|
||||
mocks.useMobile.mockReturnValue(true)
|
||||
renderComponent()
|
||||
|
||||
const micBeforeFocus = mobileVoiceButton() as HTMLElement
|
||||
expect(micBeforeFocus).toHaveClass('min-h-9', 'min-w-9')
|
||||
expect(micBeforeFocus).toHaveClass('min-h-10', 'min-w-10')
|
||||
expect(micBeforeFocus).not.toHaveClass('min-h-[44px]')
|
||||
|
||||
fireEvent.focus(promptInput())
|
||||
|
||||
const micAfterFocus = mobileVoiceButton() as HTMLElement
|
||||
expect(micAfterFocus).toHaveClass('min-h-9', 'min-w-9')
|
||||
expect(micAfterFocus).toHaveClass('min-h-10', 'min-w-10')
|
||||
expect(micAfterFocus).not.toHaveClass('min-h-[44px]')
|
||||
})
|
||||
|
||||
|
||||
@@ -1413,7 +1413,7 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read)
|
||||
? 'bg-destructive hover:bg-destructive/90 text-destructive-foreground border-destructive/60 animate-pulse'
|
||||
: 'bg-muted hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground border-border'
|
||||
}`
|
||||
: `min-h-9 min-w-9 px-0 rounded-lg transition-all duration-150 flex items-center justify-center border touch-none select-none ${
|
||||
: `min-h-10 min-w-10 px-0 rounded-lg transition-all duration-150 flex items-center justify-center border touch-none select-none ${
|
||||
isBusy
|
||||
? 'bg-success text-success-foreground border-success/70 shadow-lg shadow-success/40'
|
||||
: 'bg-muted hover:bg-muted-foreground/20 text-muted-foreground hover:text-foreground border-border active:bg-muted-foreground/30 active:scale-95'
|
||||
@@ -1520,7 +1520,7 @@ if (isIOS && isSecureContext && navigator.clipboard && navigator.clipboard.read)
|
||||
: ''
|
||||
|
||||
return (
|
||||
<div className={`relative isolate border border-border dark:border-border/30 rounded-xl p-2 md:p-3 mb-4 md:mb-3 w-full before:pointer-events-none before:absolute before:-inset-px before:-z-10 before:rounded-xl before:bg-background/95 before:backdrop-blur-md before:content-[''] ${hasPendingPermissionForSession ? 'border-highlight/50 ring-1 ring-highlight/30' : composerModeStyle?.frame ?? ''} ${isTakeoverOpen ? 'z-[60]' : ''}`}>
|
||||
<div className={`relative isolate border-t md:border border-border dark:border-border/30 rounded-t-xl md:rounded-xl p-2 pb-4 md:p-3 md:mb-3 w-full before:pointer-events-none before:absolute before:-inset-px before:-z-10 before:rounded-t-xl md:before:rounded-xl before:bg-background md:before:bg-background/95 before:backdrop-blur-md before:content-[''] ${hasPendingPermissionForSession ? 'border-highlight/50 ring-1 ring-highlight/30' : composerModeStyle?.frame ?? ''} ${isTakeoverOpen ? 'z-[60]' : ''}`}>
|
||||
<div role="status" aria-live="polite" className="sr-only">
|
||||
{sessionActivityAnnouncement}
|
||||
</div>
|
||||
@@ -1681,7 +1681,7 @@ return (
|
||||
title="Scroll to bottom"
|
||||
onMouseDown={(e) => e.preventDefault()}
|
||||
onClick={onScrollToBottom}
|
||||
className={cn(getIconToggleButtonClassName(false), 'flex items-center justify-center size-9 p-0')}
|
||||
className={cn(getIconToggleButtonClassName(false), 'flex items-center justify-center size-10 p-0')}
|
||||
>
|
||||
<ArrowDown className="w-5 h-5" />
|
||||
</button>
|
||||
|
||||
@@ -896,11 +896,11 @@ export function SessionDetail() {
|
||||
"relative pointer-events-auto",
|
||||
isFormSheetOpen
|
||||
? "flex w-full flex-1 min-h-0 flex-col"
|
||||
: cn("w-[94%] md:max-w-4xl", isFormOpen && "flex max-h-full min-h-0 flex-col"),
|
||||
: cn("w-full md:w-[94%] md:max-w-4xl", isFormOpen && "flex max-h-full min-h-0 flex-col"),
|
||||
)}
|
||||
>
|
||||
{!isFormSheetOpen && (
|
||||
<div className="absolute bottom-full right-0 mb-2 z-50 flex flex-col items-end gap-2">
|
||||
<div className="absolute bottom-full right-[3%] md:right-0 mb-2 z-50 flex flex-col items-end gap-2">
|
||||
{ttsEnabled && !hasPromptContent && !isSessionActive && latestPlayableAssistant && (
|
||||
<FloatingTTSButton
|
||||
messageId={latestPlayableAssistant.messageId}
|
||||
@@ -955,15 +955,17 @@ export function SessionDetail() {
|
||||
/>
|
||||
)}
|
||||
<div className={cn(isFormSheetOpen && "shrink-0 bg-background px-[3%]")}>
|
||||
<SessionSendErrorBanner sessionId={sessionId} isConnected={streamConnected} isReconnecting={streamReconnecting} />
|
||||
<SessionGoalBar sessionID={sessionId} />
|
||||
<BackgroundWorkBar
|
||||
sessionID={sessionId}
|
||||
directory={sessionDirectory}
|
||||
messages={messages}
|
||||
isSessionActive={isSessionActive}
|
||||
onChildSessionClick={handleChildSessionClick}
|
||||
/>
|
||||
<div className={cn(!isFormSheetOpen && "px-[3%] md:px-0")}>
|
||||
<SessionSendErrorBanner sessionId={sessionId} isConnected={streamConnected} isReconnecting={streamReconnecting} />
|
||||
<SessionGoalBar sessionID={sessionId} />
|
||||
<BackgroundWorkBar
|
||||
sessionID={sessionId}
|
||||
directory={sessionDirectory}
|
||||
messages={messages}
|
||||
isSessionActive={isSessionActive}
|
||||
onChildSessionClick={handleChildSessionClick}
|
||||
/>
|
||||
</div>
|
||||
<PromptInput
|
||||
ref={promptInputRef}
|
||||
directory={sessionDirectory}
|
||||
|
||||
Reference in new issue
Block a user