Skip to content
This repository was archived by the owner on Jan 2, 2025. It is now read-only.

Commit c387128

Browse files
Minor fixes (#1222)
* focus first item on search changed * fix model param name * set focus on the panel where user types, fix scroll to line when clicking from chat * fix missing highlights in left sidebar for currently focused tab * fix long names in command bar items * don't add repos to project automatically, but add a button to 'indexing finished' toast
1 parent 477047a commit c387128

File tree

27 files changed

+206
-60
lines changed

27 files changed

+206
-60
lines changed

client/src/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ const toastOptions = {
2424
unStyled: true,
2525
classNames: {
2626
toast:
27-
'w-[20.75rem] p-4 pl-5 flex items-start gap-3 rounded-md border border-bg-border bg-bg-base shadow-high',
27+
'w-[20.75rem] p-4 pl-5 grid grid-cols-[1rem_1fr] items-start gap-3 rounded-md border border-bg-border bg-bg-base shadow-high',
2828
error: 'text-red',
2929
info: 'text-label-title',
3030
title: 'body-s-b',
3131
description: '!text-label-muted body-s mt-1.5',
32-
actionButton: 'bg-zinc-400',
32+
actionButton: 'col-span-full',
3333
cancelButton: 'bg-orange-400',
3434
closeButton:
3535
'!bg-bg-base !text-label-muted !border-none !left-[unset] !right-2 !top-6 !w-6 !h-6',

client/src/CommandBar/Body/Item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ const CommandBarItem = ({
141141
/>
142142
)}
143143
</div>
144-
<p className="flex-1 body-s-b">{label}</p>
144+
<p className="flex-1 body-s-b ellipsis">{label}</p>
145145
{!!shortcutKeys && (
146146
<div className="flex items-center gap-1">
147147
{shortcutKeys.map((k) => (

client/src/CommandBar/Body/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ const CommandBarBody = ({
2020
const { focusedIndex, setFocusedIndex, handleArrowKey, navContainerRef } =
2121
useArrowNavigation();
2222

23+
useEffect(() => {
24+
if (sections?.[0]?.items?.[0]) {
25+
setFocusedIndex(`${sections[0].key}-${sections[0].items[0].key}`);
26+
}
27+
}, [sections]);
28+
2329
useEffect(() => {
2430
if (onFocusedIndexChange) {
2531
onFocusedIndexChange(focusedIndex);

client/src/CommandBar/steps/ManageRepos/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,14 @@ const ManageRepos = ({ shouldShowTutorial }: Props) => {
105105
setTutorialStep(3);
106106
},
107107
onDone: () => {
108-
setOnBoardingState((prev) => ({
109-
...prev,
110-
isCommandBarTutorialFinished: true,
111-
}));
112108
setTutorialStep(4);
113109
},
114110
onAddToProject: () => {
115111
setOnBoardingState((prev) => ({
116112
...prev,
117113
isCommandBarTutorialFinished: true,
118114
}));
119-
setTutorialStep(4);
115+
setTutorialStep(5);
120116
},
121117
},
122118
key: r.ref,
@@ -234,7 +230,7 @@ const ManageRepos = ({ shouldShowTutorial }: Props) => {
234230
placeholder={t('')}
235231
disableKeyNav={isDropdownVisible}
236232
/>
237-
{shouldShowTutorial && tutorialStep < 4 ? (
233+
{shouldShowTutorial && tutorialStep < 5 ? (
238234
<TutorialTooltip
239235
content={
240236
<TutorialBody

client/src/CommandBar/steps/PrivateRepos/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,14 @@ const PrivateReposStep = ({ shouldShowTutorial }: Props) => {
6363
setTutorialStep(3);
6464
},
6565
onDone: () => {
66-
setOnBoardingState((prev) => ({
67-
...prev,
68-
isCommandBarTutorialFinished: true,
69-
}));
7066
setTutorialStep(4);
7167
},
7268
onAddToProject: () => {
7369
setOnBoardingState((prev) => ({
7470
...prev,
7571
isCommandBarTutorialFinished: true,
7672
}));
77-
setTutorialStep(4);
73+
setTutorialStep(5);
7874
},
7975
},
8076
key: r.ref,
@@ -131,7 +127,7 @@ const PrivateReposStep = ({ shouldShowTutorial }: Props) => {
131127
placeholder={t('Search private repos...')}
132128
disableKeyNav={isDropdownVisible}
133129
/>
134-
{shouldShowTutorial && tutorialStep < 4 ? (
130+
{shouldShowTutorial && tutorialStep < 5 ? (
135131
<TutorialTooltip
136132
content={
137133
<TutorialBody

client/src/CommandBar/steps/items/RepoItem.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ const RepoItem = ({
300300
{t(repoStatusMap[status].text)}
301301
{indexingStatus?.percentage !== null &&
302302
indexingStatus?.percentage !== undefined &&
303-
${indexingStatus?.percentage}%`}
303+
` · ${indexingStatus?.percentage}%`}
304304
</p>
305305
) : undefined
306306
}

client/src/Project/CurrentTabContent/ChatTab/ChatPersistentState.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ const ChatPersistentState = ({
246246
options ? `/explain` : ``
247247
}`;
248248
const queryParams: Record<string, string> = {
249-
model:
249+
answer_model:
250250
preferredAnswerSpeed === 'normal'
251-
? 'gpt-4'
251+
? 'gpt-4-turbo-24k'
252252
: 'gpt-3.5-turbo-finetuned',
253253
};
254254
if (conversationId) {

client/src/Project/CurrentTabContent/ChatTab/Input/index.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import { MentionOptionType } from '../../../../types/results';
2727
import { splitPath } from '../../../../utils';
2828
import { openTabsCache } from '../../../../services/cache';
2929
import { CommandBarContext } from '../../../../context/commandBarContext';
30+
import { UIContext } from '../../../../context/uiContext';
3031
import InputCore from './InputCore';
3132
import { mapEditorContentToInputValue } from './utils';
3233

@@ -76,6 +77,7 @@ const ConversationInput = ({
7677
const { t } = useTranslation();
7778
const { envConfig } = useContext(EnvContext);
7879
const { isVisible } = useContext(CommandBarContext.General);
80+
const { setIsLeftSidebarFocused } = useContext(UIContext.Focus);
7981
const [initialValue, setInitialValue] = useState<
8082
Record<string, any> | null | undefined
8183
>({
@@ -135,6 +137,7 @@ const ConversationInput = ({
135137

136138
const onChangeInput = useCallback((inputState: InputEditorContent[]) => {
137139
setInputValue(mapEditorContentToInputValue(inputState));
140+
setIsLeftSidebarFocused(false);
138141
}, []);
139142

140143
const onSubmitButtonClicked = useCallback(() => {

client/src/Project/CurrentTabContent/FileTab/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -643,6 +643,7 @@ const FileTab = ({
643643
<div
644644
className="flex-1 h-full max-w-full pl-4 py-4 overflow-auto"
645645
data-active={(focusedPanel === side).toString()}
646+
data-path={path}
646647
>
647648
{file?.lang === 'jupyter notebook' ? (
648649
<IpynbRenderer data={file.contents} />

client/src/Project/LeftSidebar/NavPanel/Conversations/CoversationEntry.tsx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,31 @@ import { useArrowNavigationItemProps } from '../../../../hooks/useArrowNavigatio
66

77
type Props = ConversationShortType & {
88
index: string;
9+
isCurrentPath?: boolean;
910
};
1011

11-
const ConversationEntry = ({ title, id, index }: Props) => {
12+
const ConversationEntry = ({ title, id, index, isCurrentPath }: Props) => {
1213
const { openNewTab } = useContext(TabsContext.Handlers);
1314

1415
const onClick = useCallback(() => {
1516
openNewTab({ type: TabTypesEnum.CHAT, conversationId: id, title });
1617
}, [openNewTab, id, title]);
1718

18-
const { isFocused, props } = useArrowNavigationItemProps<HTMLAnchorElement>(
19-
index,
20-
onClick,
21-
);
19+
const { isFocused, isLeftSidebarFocused, props } =
20+
useArrowNavigationItemProps<HTMLAnchorElement>(index, onClick);
2221

2322
return (
2423
<a
2524
href="#"
2625
className={`w-full text-left h-7 flex-shrink-0 flex items-center gap-3 pr-2 cursor-pointer
2726
ellipsis body-mini group pl-10.5 ${
28-
isFocused ? 'bg-bg-sub-hover text-label-title' : 'text-label-base'
27+
isCurrentPath
28+
? isLeftSidebarFocused
29+
? 'bg-bg-shade-hover text-label-title'
30+
: 'bg-bg-shade text-label-title'
31+
: isFocused
32+
? 'bg-bg-sub-hover text-label-title'
33+
: 'text-label-base'
2934
}`}
3035
{...props}
3136
>

0 commit comments

Comments
 (0)