Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix(cowork-ui): contain composer surface controls when preview is open

thinhlpg83f5ef5cd648
diff --git a/web-app/src/containers/ChatInput.tsx b/web-app/src/containers/ChatInput.tsx
index 21b7ffe31..2e88cd20e 100644
--- a/web-app/src/containers/ChatInput.tsx
+++ b/web-app/src/containers/ChatInput.tsx
@@ -2787,7 +2787,7 @@ const ChatInput = memo(function ChatInput({
})()}
</div>
{surfaceControls && (
- <div className="flex min-w-0 flex-1 items-center gap-1">
+ <div className="flex min-w-0 flex-1 items-center gap-1 overflow-x-auto scrollbar-hide">
<Separator
orientation="vertical"
className="mx-1 h-4 shrink-0"
diff --git a/web-app/src/containers/__tests__/ChatInput.test.tsx b/web-app/src/containers/__tests__/ChatInput.test.tsx
index 5c89f56f6..b46b7eee3 100644
--- a/web-app/src/containers/__tests__/ChatInput.test.tsx
+++ b/web-app/src/containers/__tests__/ChatInput.test.tsx
@@ -705,4 +705,19 @@ describe('ChatInput', () => {
expect(dimmed!.contains(screen.getByText('plan'))).toBe(false)
})
})
-})
+ it('contains surface controls within the composer control row', () => {
+ renderInput({
+ surfaceControls: (
+ <>
+ <button>folder</button>
+ <button>terminal</button>
+ <button>changes</button>
+ </>
+ ),
+ })
+
+ const controls = screen.getByText('folder').parentElement
+ expect(controls).toHaveClass('overflow-x-auto', 'scrollbar-hide')
+ expect(controls).toHaveClass('min-w-0', 'flex-1')
+ })
+ })