summaryrefslogtreecommitdiff
path: root/extension/react-app
diff options
context:
space:
mode:
authorNate Sesti <sestinj@gmail.com>2023-07-14 13:45:10 -0700
committerNate Sesti <sestinj@gmail.com>2023-07-14 13:45:10 -0700
commitf0b2597895920b7d714b53f2d70a3a5858f89d42 (patch)
treedf3e5d44b40e65a6853f2922f4cd7a8a76715e10 /extension/react-app
parenta16101b49950fba146e8627ffbce3a34e61bb061 (diff)
downloadsncontinue-f0b2597895920b7d714b53f2d70a3a5858f89d42.tar.gz
sncontinue-f0b2597895920b7d714b53f2d70a3a5858f89d42.tar.bz2
sncontinue-f0b2597895920b7d714b53f2d70a3a5858f89d42.zip
insidious client_state vs application_state err
Diffstat (limited to 'extension/react-app')
-rw-r--r--extension/react-app/src/components/ComboBox.tsx9
-rw-r--r--extension/react-app/src/components/StepContainer.tsx9
2 files changed, 14 insertions, 4 deletions
diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx
index 5d9b5109..754c9445 100644
--- a/extension/react-app/src/components/ComboBox.tsx
+++ b/extension/react-app/src/components/ComboBox.tsx
@@ -169,6 +169,7 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
useImperativeHandle(ref, () => downshiftProps, [downshiftProps]);
const [metaKeyPressed, setMetaKeyPressed] = useState(false);
+ const [focused, setFocused] = useState(false);
useEffect(() => {
const handleKeyDown = (e: KeyboardEvent) => {
if (e.key === "Meta") {
@@ -298,7 +299,11 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
// setShowContextDropdown(target.value.endsWith("@"));
},
+ onFocus: (e) => {
+ setFocused(true);
+ },
onBlur: (e) => {
+ setFocused(false);
postVscMessage("blurContinueInput", {});
},
onKeyDown: (event) => {
@@ -374,7 +379,9 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
</div>
{highlightedCodeSections.length === 0 &&
(downshiftProps.inputValue?.startsWith("/edit") ||
- (metaKeyPressed && downshiftProps.inputValue?.length > 0)) && (
+ (focused &&
+ metaKeyPressed &&
+ downshiftProps.inputValue?.length > 0)) && (
<div className="text-trueGray-400 pr-4 text-xs text-right">
Inserting at cursor
</div>
diff --git a/extension/react-app/src/components/StepContainer.tsx b/extension/react-app/src/components/StepContainer.tsx
index 6fa4ba13..14e9b854 100644
--- a/extension/react-app/src/components/StepContainer.tsx
+++ b/extension/react-app/src/components/StepContainer.tsx
@@ -253,9 +253,12 @@ function StepContainer(props: StepContainerProps) {
)}
{props.historyNode.observation?.error ? (
- <pre className="overflow-x-scroll">
- {props.historyNode.observation.error as string}
- </pre>
+ <details>
+ <summary>View Traceback</summary>
+ <pre className="overflow-x-scroll">
+ {props.historyNode.observation.error as string}
+ </pre>
+ </details>
) : (
<StyledMarkdownPreview
source={props.historyNode.step.description || ""}