Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup ui for creator mode #4

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions gui/src/components/mainInput/InputToolbar.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import {
PhotoIcon as OutlinePhotoIcon,
PlusIcon,
PaperAirplaneIcon,
AtSymbolIcon,
BoltIcon,
} from "@heroicons/react/24/outline";
import { PhotoIcon as SolidPhotoIcon } from "@heroicons/react/24/solid";
import { InputModifiers } from "core";
Expand Down Expand Up @@ -52,8 +55,18 @@ const StyledDiv = styled.div<{ isHidden: boolean }>`
`;

const StyledSpan = styled.span`
padding: 3px 4px;
display: flex;
align-items: center;
border-radius: ${defaultBorderRadius};

font-size: ${() => `${getFontSize() - 2}px`};
color: ${lightGray};

&:hover {
background-color: ${vscBadgeBackground};
color: ${vscBadgeForeground};
}
`;

const EnterButton = styled.div<{ offFocus: boolean }>`
Expand Down Expand Up @@ -101,15 +114,34 @@ function InputToolbar(props: InputToolbarProps) {
onClick={props.onClick}
id="input-toolbar"
>
<span className="flex gap-2 items-center whitespace-nowrap">
<span className="flex gap-0.5 items-center whitespace-nowrap">
<ModelSelect />
<StyledSpan
onClick={(e) => {
props.onAddContextItem();
}}
className="hover:underline cursor-pointer"
>
Add Context <PlusIcon className="h-2.5 w-2.5" aria-hidden="true" />
<AtSymbolIcon className="h-4 w-4" aria-hidden="true" />
</StyledSpan>
<StyledSpan
style={{
color: props.usingCodebase ? vscBadgeBackground : lightGray,
backgroundColor: props.usingCodebase
? lightGray + "33"
: undefined,
borderRadius: defaultBorderRadius,
padding: "2px 4px",
}}
onClick={(e) => {
props.onEnter({
useCodebase: true,
noContext: !useActiveFile,
});
}}
className={"hover:underline cursor-pointer float-right"}
>
<BoltIcon className="h-4 w-4" aria-hidden="true" />
</StyledSpan>
{defaultModel &&
modelSupportsImages(
Expand Down Expand Up @@ -202,7 +234,7 @@ function InputToolbar(props: InputToolbarProps) {
});
}}
>
⏎ Enter
<PaperAirplaneIcon className="h-4 w-4" aria-hidden="true" />
</EnterButton>
</span>
</StyledDiv>
Expand Down
1 change: 0 additions & 1 deletion gui/src/components/mainInput/TipTapEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ const InputBoxDiv = styled.div`
background-color: ${vscInputBackground};
color: ${vscForeground};
z-index: 1;
border: 0.5px solid ${vscInputBorder};
outline: none;
font-size: ${getFontSize()}px;
&:focus {
Expand Down