Skip to content

always show active file in input toolbar, not codebase #5868

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions extensions/vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

50 changes: 21 additions & 29 deletions gui/src/components/mainInput/InputToolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ import {
} from "../../redux/selectors/selectCurrentToolCall";
import { selectSelectedChatModel } from "../../redux/slices/configSlice";
import { exitEdit } from "../../redux/thunks/edit";
import {
getAltKeyLabel,
getMetaKeyLabel,
isMetaEquivalentKeyPressed,
} from "../../util";
import { getAltKeyLabel, isMetaEquivalentKeyPressed } from "../../util";
import { ToolTip } from "../gui/Tooltip";
import ModelSelect from "../modelSelection/ModelSelect";
import { ModeSelect } from "../ModeSelect";
Expand Down Expand Up @@ -160,32 +156,28 @@ function InputToolbar(props: InputToolbarProps) {
<div
className={`${toolsSupported ? "md:flex" : "int:flex"} hover:underline" hidden transition-colors duration-200`}
>
{props.activeKey === "Alt" ? (
<HoverItem className="underline">
{`${getAltKeyLabel()}⏎
${useActiveFile ? "No active file" : "Active file"}`}
</HoverItem>
) : (
<HoverItem
className={props.activeKey === "Meta" ? "underline" : ""}
onClick={(e) =>
props.onEnter?.({
useCodebase: true,
noContext: !useActiveFile,
})
}
>
<span data-tooltip-id="add-codebase-context-tooltip">
{getMetaKeyLabel()}⏎ @codebase
</span>
<ToolTip id="add-codebase-context-tooltip" place="top-end">
Send With Codebase as Context ({getMetaKeyLabel()}⏎)
</ToolTip>
</HoverItem>
)}
<HoverItem
className={props.activeKey === "Alt" ? "underline" : ""}
onClick={(e) =>
props.onEnter?.({
useCodebase: false,
noContext: !useActiveFile,
})
}
>
<span data-tooltip-id="add-active-file-context-tooltip">
{getAltKeyLabel()}⏎{" "}
{useActiveFile ? "No active file" : "Active file"}
</span>
<ToolTip id="add-active-file-context-tooltip" place="top-end">
{useActiveFile
? "Send Without Active File"
: "Send With Active File"}{" "}
({getAltKeyLabel()}⏎)
</ToolTip>
</HoverItem>
</div>
)}

{isInEdit && (
<HoverItem
className="hidden hover:underline sm:flex"
Expand Down
Loading