summaryrefslogtreecommitdiff
path: root/extension/react-app/src
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
commitc5102b0997baa81ce544514d6b5b4d5a2eae804f (patch)
tree667890758eadb0be303e42eb90a494f515dffaf2 /extension/react-app/src
parentb19076ddb6d11acb5ffd54046d9e5cad549c00c1 (diff)
downloadsncontinue-c5102b0997baa81ce544514d6b5b4d5a2eae804f.tar.gz
sncontinue-c5102b0997baa81ce544514d6b5b4d5a2eae804f.tar.bz2
sncontinue-c5102b0997baa81ce544514d6b5b4d5a2eae804f.zip
insidious client_state vs application_state err
Diffstat (limited to 'extension/react-app/src')
-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 || ""}