make cmd+enter use active file, remove codebase shortcut

This commit is contained in:
Nate 2025-08-12 20:12:42 -04:00
parent 18d0b423bf
commit 2ae40263db
3 changed files with 12 additions and 9 deletions

View file

@ -13,7 +13,7 @@ import { selectUseActiveFile } from "../../redux/selectors";
import { selectSelectedChatModel } from "../../redux/slices/configSlice";
import { setHasReasoningEnabled } from "../../redux/slices/sessionSlice";
import { exitEdit } from "../../redux/thunks/edit";
import { getAltKeyLabel, isMetaEquivalentKeyPressed } from "../../util";
import { getMetaKeyLabel, isMetaEquivalentKeyPressed } from "../../util";
import { ToolTip } from "../gui/Tooltip";
import ModelSelect from "../modelSelection/ModelSelect";
import { ModeSelect } from "../ModeSelect";
@ -179,7 +179,7 @@ function InputToolbar(props: InputToolbarProps) {
className={`hover:underline" hidden transition-colors duration-200 md:flex`}
>
<HoverItem
className={props.activeKey === "Alt" ? "underline" : ""}
className={props.activeKey === "Meta" || props.activeKey === "Control" || props.activeKey === "Alt" ? "underline" : ""}
onClick={(e) =>
props.onEnter?.({
useCodebase: false,
@ -188,14 +188,14 @@ function InputToolbar(props: InputToolbarProps) {
}
>
<span data-tooltip-id="add-active-file-context-tooltip">
{getAltKeyLabel()}⏎{" "}
{getMetaKeyLabel()}⏎{" "}
{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()}⏎)
({getMetaKeyLabel()}⏎ or Alt⏎)
</ToolTip>
</HoverItem>
</div>
@ -221,8 +221,8 @@ function InputToolbar(props: InputToolbarProps) {
onClick={async (e) => {
if (props.onEnter) {
props.onEnter({
useCodebase: isMetaEquivalentKeyPressed(e as any),
noContext: useActiveFile ? e.altKey : !e.altKey,
useCodebase: false,
noContext: useActiveFile ? !(isMetaEquivalentKeyPressed(e as any) || e.altKey) : (isMetaEquivalentKeyPressed(e as any) || e.altKey),
});
}
}}

View file

@ -208,10 +208,13 @@ export function createEditorConfig(options: {
},
"Mod-Enter": () => {
posthog.capture("gui_use_active_file_enter");
onEnterRef.current({
useCodebase: true,
noContext: !useActiveFile,
useCodebase: false,
noContext: !!useActiveFile,
});
return true;
},
"Alt-Enter": () => {

View file

@ -14,7 +14,7 @@ function logDomText() {
"",
);
cleaned = cleaned?.replace(
"Alt⏎ Active file⏎ Enter⏎Log in to access a free trial of theModels Add-OnLog in to Continue HubOr, configure your own models",
/[⌘Ctrl]+⏎ (?:No )?[Aa]ctive file⏎ Enter⏎Log in to access a free trial of theModels Add-OnLog in to Continue HubOr, configure your own models/,
"",
);
cleaned = cleaned.replaceAll("Select model", "");