Skip to content

Commit 50b42f7

Browse files
authored
Merge pull request #5741 from continuedev/dallin/find-widget-alignment
Fix find widget alignment
2 parents 7d82935 + b55079e commit 50b42f7

File tree

6 files changed

+394
-306
lines changed

6 files changed

+394
-306
lines changed

gui/src/components/TabBar/TabBar.tsx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { XMarkIcon } from "@heroicons/react/24/outline";
2-
import { useCallback, useEffect } from "react";
2+
import React, { useCallback, useEffect } from "react";
33
import { useDispatch, useSelector } from "react-redux";
44
import styled from "styled-components";
55
import { defaultBorderRadius } from "..";
@@ -35,6 +35,8 @@ const TabBarContainer = styled.div`
3535
border-bottom: none;
3636
position: relative;
3737
margin-top: 2px;
38+
max-height: 100px;
39+
overflow: auto;
3840
3941
/* Hide scrollbar but keep functionality */
4042
scrollbar-width: none;
@@ -125,7 +127,7 @@ const TabBarSpace = styled.div`
125127
background-color: ${tabBackgroundVar};
126128
`;
127129

128-
export function TabBar() {
130+
export const TabBar = React.forwardRef<HTMLDivElement>((_, ref) => {
129131
const dispatch = useDispatch<AppDispatch>();
130132
const currentSessionId = useSelector((state: RootState) => state.session.id);
131133
const currentSessionTitle = useSelector(
@@ -141,7 +143,6 @@ export function TabBar() {
141143
return Date.now().toString(36) + Math.random().toString(36).substring(2);
142144
}, []);
143145

144-
// Handle session changes
145146
useEffect(() => {
146147
if (!currentSessionId) return;
147148

@@ -224,10 +225,13 @@ export function TabBar() {
224225
}
225226
};
226227

227-
return tabs.length === 1 ? (
228-
<></>
229-
) : (
230-
<TabBarContainer>
228+
return (
229+
<TabBarContainer
230+
ref={ref}
231+
style={{
232+
display: tabs.length === 1 ? "none" : "flex",
233+
}}
234+
>
231235
{tabs.map((tab) => (
232236
<Tab
233237
key={tab.id}
@@ -253,4 +257,4 @@ export function TabBar() {
253257
</TabBarSpace>
254258
</TabBarContainer>
255259
);
256-
}
260+
});

0 commit comments

Comments
 (0)