diff --git a/continuedev/src/continuedev/core/autopilot.py b/continuedev/src/continuedev/core/autopilot.py
index 49fbacc51..e59c6ed49 100644
--- a/continuedev/src/continuedev/core/autopilot.py
+++ b/continuedev/src/continuedev/core/autopilot.py
@@ -12,7 +12,7 @@ from .observation import Observation, InternalErrorObservation
from ..server.ide_protocol import AbstractIdeProtocolServer
from ..libs.util.queue import AsyncSubscriptionQueue
from ..models.main import ContinueBaseModel
-from .main import Context, ContinueCustomException, Policy, History, FullState, Step, HistoryNode
+from .main import Context, ContinueCustomException, HighlightedRangeContext, Policy, History, FullState, Step, HistoryNode
from ..steps.core.core import ReversibleStep, ManualEditStep, UserInputStep
from ..libs.util.telemetry import capture_event
from .sdk import ContinueSDK
@@ -140,11 +140,24 @@ class Autopilot(ContinueBaseModel):
tb_step.step_name, {"output": output, **tb_step.params})
await self._run_singular_step(step)
- _highlighted_ranges: List[RangeInFileWithContents] = []
+ _highlighted_ranges: List[HighlightedRangeContext] = []
_adding_highlighted_code: bool = False
+ def _make_sure_is_editing_range(self):
+ """If none of the highlighted ranges are currently being edited, the first should be selected"""
+ if len(self._highlighted_ranges) == 0:
+ return
+ if not any(map(lambda x: x.editing, self._highlighted_ranges)):
+ self._highlighted_ranges[0].editing = True
+
async def handle_highlighted_code(self, range_in_files: List[RangeInFileWithContents]):
- if not self._adding_highlighted_code:
+ if not self._adding_highlighted_code and len(self._highlighted_ranges) > 0:
+ return
+
+ # If un-highlighting, then remove the range
+ if len(self._highlighted_ranges) == 1 and len(range_in_files) == 1 and range_in_files[0].range.start == range_in_files[0].range.end:
+ self._highlighted_ranges = []
+ await self.update_subscribers()
return
# Filter out rifs from ~/.continue/diffs folder
@@ -160,20 +173,25 @@ class Autopilot(ContinueBaseModel):
for i, rif in enumerate(self._highlighted_ranges):
found_overlap = False
for new_rif in range_in_files:
- if rif.filepath == new_rif.filepath and rif.range.overlaps_with(new_rif.range):
+ if rif.range.filepath == new_rif.filepath and rif.range.range.overlaps_with(new_rif.range):
found_overlap = True
break
# Also don't allow multiple ranges in same file with same content. This is useless to the model, and avoids
# the bug where cmd+f causes repeated highlights
- if rif.filepath == new_rif.filepath and rif.contents == new_rif.contents:
+ if rif.range.filepath == new_rif.filepath and rif.range.contents == new_rif.contents:
found_overlap = True
break
if not found_overlap:
new_ranges.append(rif)
- self._highlighted_ranges = new_ranges + range_in_files
+ self._highlighted_ranges = new_ranges + [HighlightedRangeContext(
+ range=rif, editing=False, pinned=False
+ ) for rif in range_in_files]
+
+ self._make_sure_is_editing_range()
+
await self.update_subscribers()
_step_depth: int = 0
@@ -193,12 +211,25 @@ class Autopilot(ContinueBaseModel):
if i not in indices:
kept_ranges.append(rif)
self._highlighted_ranges = kept_ranges
+
+ self._make_sure_is_editing_range()
+
await self.update_subscribers()
async def toggle_adding_highlighted_code(self):
self._adding_highlighted_code = not self._adding_highlighted_code
await self.update_subscribers()
+ async def set_editing_at_indices(self, indices: List[int]):
+ for i in range(len(self._highlighted_ranges)):
+ self._highlighted_ranges[i].editing = i in indices
+ await self.update_subscribers()
+
+ async def set_pinned_at_indices(self, indices: List[int]):
+ for i in range(len(self._highlighted_ranges)):
+ self._highlighted_ranges[i].pinned = i in indices
+ await self.update_subscribers()
+
async def _run_singular_step(self, step: "Step", is_future_step: bool = False) -> Coroutine[Observation, None, None]:
# Allow config to set disallowed steps
if step.__class__.__name__ in self.continue_sdk.config.disallowed_steps:
@@ -359,6 +390,10 @@ class Autopilot(ContinueBaseModel):
if len(self._main_user_input_queue) > 1:
return
+ # Remove context unless pinned
+ self._highlighted_ranges = [
+ hr for hr in self._highlighted_ranges if hr.pinned]
+
# await self._request_halt()
# Just run the step that takes user input, and
# then up to the policy to decide how to deal with it.
diff --git a/continuedev/src/continuedev/core/main.py b/continuedev/src/continuedev/core/main.py
index 28fd964e2..62cc49360 100644
--- a/continuedev/src/continuedev/core/main.py
+++ b/continuedev/src/continuedev/core/main.py
@@ -199,13 +199,20 @@ class SlashCommandDescription(ContinueBaseModel):
description: str
+class HighlightedRangeContext(ContinueBaseModel):
+ """Context for a highlighted range"""
+ range: RangeInFileWithContents
+ editing: bool
+ pinned: bool
+
+
class FullState(ContinueBaseModel):
"""A full state of the program, including the history"""
history: History
active: bool
user_input_queue: List[str]
default_model: str
- highlighted_ranges: List[RangeInFileWithContents]
+ highlighted_ranges: List[HighlightedRangeContext]
slash_commands: List[SlashCommandDescription]
adding_highlighted_code: bool
diff --git a/continuedev/src/continuedev/models/generate_json_schema.py b/continuedev/src/continuedev/models/generate_json_schema.py
index 080787a57..6cebf429f 100644
--- a/continuedev/src/continuedev/models/generate_json_schema.py
+++ b/continuedev/src/continuedev/models/generate_json_schema.py
@@ -1,7 +1,7 @@
from .main import *
from .filesystem import RangeInFile, FileEdit
from .filesystem_edit import FileEditWithFullContents
-from ..core.main import History, HistoryNode
+from ..core.main import History, HistoryNode, FullState
from pydantic import schema_json_of
import os
@@ -12,7 +12,7 @@ MODELS_TO_GENERATE = [
] + [
FileEditWithFullContents
] + [
- History, HistoryNode
+ History, HistoryNode, FullState
]
RENAMES = {
diff --git a/continuedev/src/continuedev/server/gui.py b/continuedev/src/continuedev/server/gui.py
index fa573b37b..8e9b1fb92 100644
--- a/continuedev/src/continuedev/server/gui.py
+++ b/continuedev/src/continuedev/server/gui.py
@@ -87,6 +87,10 @@ class GUIProtocolServer(AbstractGUIProtocolServer):
self.on_delete_context_at_indices(data["indices"])
elif message_type == "toggle_adding_highlighted_code":
self.on_toggle_adding_highlighted_code()
+ elif message_type == "set_editing_at_indices":
+ self.on_set_editing_at_indices(data["indices"])
+ elif message_type == "set_pinned_at_indices":
+ self.on_set_pinned_at_indices(data["indices"])
except Exception as e:
print(e)
@@ -135,6 +139,16 @@ class GUIProtocolServer(AbstractGUIProtocolServer):
self.session.autopilot.toggle_adding_highlighted_code()
)
+ def on_set_editing_at_indices(self, indices: List[int]):
+ asyncio.create_task(
+ self.session.autopilot.set_editing_at_indices(indices)
+ )
+
+ def on_set_pinned_at_indices(self, indices: List[int]):
+ asyncio.create_task(
+ self.session.autopilot.set_pinned_at_indices(indices)
+ )
+
@router.websocket("/ws")
async def websocket_endpoint(websocket: WebSocket, session: Session = Depends(websocket_session)):
diff --git a/continuedev/src/continuedev/steps/core/core.py b/continuedev/src/continuedev/steps/core/core.py
index 3a7c88764..cbf0fe5e1 100644
--- a/continuedev/src/continuedev/steps/core/core.py
+++ b/continuedev/src/continuedev/steps/core/core.py
@@ -453,7 +453,7 @@ class DefaultModelEditCodeStep(Step):
lines.extend(map(lambda l: common_whitespace + l, chunk_lines))
if True:
- await sendDiffUpdate(lines, sdk)
+ await sendDiffUpdate(lines + [common_whitespace + unfinished_line], sdk)
# Deal with newly accumulated lines
for line in chunk_lines:
diff --git a/continuedev/src/continuedev/steps/main.py b/continuedev/src/continuedev/steps/main.py
index 3cf78c40f..5ccffbfe7 100644
--- a/continuedev/src/continuedev/steps/main.py
+++ b/continuedev/src/continuedev/steps/main.py
@@ -270,7 +270,7 @@ class EditHighlightedCodeStep(Step):
if len(range_in_files) == 0:
# Create a new file
new_file_path = "new_file.txt"
- await sdk.add_file(new_file_path)
+ await sdk.add_file(new_file_path, "")
range_in_files = [RangeInFile.from_entire_file(new_file_path, "")]
await sdk.run_step(DefaultModelEditCodeStep(user_input=self.user_input, range_in_files=range_in_files))
diff --git a/extension/media/Lexend/Lexend-VariableFont_wght.ttf b/extension/media/Lexend/Lexend-VariableFont_wght.ttf
new file mode 100644
index 000000000..b294dc840
Binary files /dev/null and b/extension/media/Lexend/Lexend-VariableFont_wght.ttf differ
diff --git a/extension/media/Lexend/OFL.txt b/extension/media/Lexend/OFL.txt
new file mode 100644
index 000000000..6b6792485
--- /dev/null
+++ b/extension/media/Lexend/OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2018 The Lexend Project Authors (https://github.com/googlefonts/lexend), with Reserved Font Name “RevReading Lexend”.
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/extension/media/Lexend/README.txt b/extension/media/Lexend/README.txt
new file mode 100644
index 000000000..f2966dfed
--- /dev/null
+++ b/extension/media/Lexend/README.txt
@@ -0,0 +1,71 @@
+Lexend Variable Font
+====================
+
+This download contains Lexend as both a variable font and static fonts.
+
+Lexend is a variable font with this axis:
+ wght
+
+This means all the styles are contained in a single file:
+ Lexend-VariableFont_wght.ttf
+
+If your app fully supports variable fonts, you can now pick intermediate styles
+that aren’t available as static fonts. Not all apps support variable fonts, and
+in those cases you can use the static font files for Lexend:
+ static/Lexend-Thin.ttf
+ static/Lexend-ExtraLight.ttf
+ static/Lexend-Light.ttf
+ static/Lexend-Regular.ttf
+ static/Lexend-Medium.ttf
+ static/Lexend-SemiBold.ttf
+ static/Lexend-Bold.ttf
+ static/Lexend-ExtraBold.ttf
+ static/Lexend-Black.ttf
+
+Get started
+-----------
+
+1. Install the font files you want to use
+
+2. Use your app's font picker to view the font family and all the
+available styles
+
+Learn more about variable fonts
+-------------------------------
+
+ https://developers.google.com/web/fundamentals/design-and-ux/typography/variable-fonts
+ https://variablefonts.typenetwork.com
+ https://medium.com/variable-fonts
+
+In desktop apps
+
+ https://theblog.adobe.com/can-variable-fonts-illustrator-cc
+ https://helpx.adobe.com/nz/photoshop/using/fonts.html#variable_fonts
+
+Online
+
+ https://developers.google.com/fonts/docs/getting_started
+ https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Fonts/Variable_Fonts_Guide
+ https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts
+
+Installing fonts
+
+ MacOS: https://support.apple.com/en-us/HT201749
+ Linux: https://www.google.com/search?q=how+to+install+a+font+on+gnu%2Blinux
+ Windows: https://support.microsoft.com/en-us/help/314960/how-to-install-or-remove-a-font-in-windows
+
+Android Apps
+
+ https://developers.google.com/fonts/docs/android
+ https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts
+
+License
+-------
+Please read the full license text (OFL.txt) to understand the permissions,
+restrictions and requirements for usage, redistribution, and modification.
+
+You can use them in your products & projects – print or digital,
+commercial or otherwise.
+
+This isn't legal advice, please consider consulting a lawyer and see the full
+license for all details.
diff --git a/extension/media/Lexend/static/Lexend-Black.ttf b/extension/media/Lexend/static/Lexend-Black.ttf
new file mode 100644
index 000000000..2fea087c2
Binary files /dev/null and b/extension/media/Lexend/static/Lexend-Black.ttf differ
diff --git a/extension/media/Lexend/static/Lexend-Bold.ttf b/extension/media/Lexend/static/Lexend-Bold.ttf
new file mode 100644
index 000000000..95884f6e5
Binary files /dev/null and b/extension/media/Lexend/static/Lexend-Bold.ttf differ
diff --git a/extension/media/Lexend/static/Lexend-ExtraBold.ttf b/extension/media/Lexend/static/Lexend-ExtraBold.ttf
new file mode 100644
index 000000000..02f84ed31
Binary files /dev/null and b/extension/media/Lexend/static/Lexend-ExtraBold.ttf differ
diff --git a/extension/media/Lexend/static/Lexend-ExtraLight.ttf b/extension/media/Lexend/static/Lexend-ExtraLight.ttf
new file mode 100644
index 000000000..20e7068d0
Binary files /dev/null and b/extension/media/Lexend/static/Lexend-ExtraLight.ttf differ
diff --git a/extension/media/Lexend/static/Lexend-Light.ttf b/extension/media/Lexend/static/Lexend-Light.ttf
new file mode 100644
index 000000000..fb6d097ce
Binary files /dev/null and b/extension/media/Lexend/static/Lexend-Light.ttf differ
diff --git a/extension/media/Lexend/static/Lexend-Medium.ttf b/extension/media/Lexend/static/Lexend-Medium.ttf
new file mode 100644
index 000000000..d91a86735
Binary files /dev/null and b/extension/media/Lexend/static/Lexend-Medium.ttf differ
diff --git a/extension/media/Lexend/static/Lexend-Regular.ttf b/extension/media/Lexend/static/Lexend-Regular.ttf
new file mode 100644
index 000000000..b423d3ab7
Binary files /dev/null and b/extension/media/Lexend/static/Lexend-Regular.ttf differ
diff --git a/extension/media/Lexend/static/Lexend-SemiBold.ttf b/extension/media/Lexend/static/Lexend-SemiBold.ttf
new file mode 100644
index 000000000..9dcb82141
Binary files /dev/null and b/extension/media/Lexend/static/Lexend-SemiBold.ttf differ
diff --git a/extension/media/Lexend/static/Lexend-Thin.ttf b/extension/media/Lexend/static/Lexend-Thin.ttf
new file mode 100644
index 000000000..0d7df8813
Binary files /dev/null and b/extension/media/Lexend/static/Lexend-Thin.ttf differ
diff --git a/extension/package-lock.json b/extension/package-lock.json
index b322acb7e..b34d1c614 100644
--- a/extension/package-lock.json
+++ b/extension/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "continue",
- "version": "0.0.113",
+ "version": "0.0.114",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "continue",
- "version": "0.0.113",
+ "version": "0.0.114",
"license": "Apache-2.0",
"dependencies": {
"@electron/rebuild": "^3.2.10",
diff --git a/extension/package.json b/extension/package.json
index 09703da46..4c972e86d 100644
--- a/extension/package.json
+++ b/extension/package.json
@@ -14,7 +14,7 @@
"displayName": "Continue",
"pricing": "Free",
"description": "The open-source coding autopilot",
- "version": "0.0.113",
+ "version": "0.0.114",
"publisher": "Continue",
"engines": {
"vscode": "^1.67.0"
diff --git a/extension/react-app/package-lock.json b/extension/react-app/package-lock.json
index fb13dffda..7316581dd 100644
--- a/extension/react-app/package-lock.json
+++ b/extension/react-app/package-lock.json
@@ -20,6 +20,7 @@
"react-redux": "^8.0.5",
"react-switch": "^7.0.0",
"react-syntax-highlighter": "^15.5.0",
+ "react-tooltip": "^5.18.0",
"styled-components": "^5.3.6",
"vscode-webview": "^1.0.1-beta.1"
},
@@ -597,6 +598,19 @@
"node": ">=12"
}
},
+ "node_modules/@floating-ui/core": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.3.1.tgz",
+ "integrity": "sha512-Bu+AMaXNjrpjh41znzHqaz3r2Nr8hHuHZT6V2LBKMhyMl0FgKA62PNYbqnfgmzOhoWZj70Zecisbo4H1rotP5g=="
+ },
+ "node_modules/@floating-ui/dom": {
+ "version": "1.4.4",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.4.4.tgz",
+ "integrity": "sha512-21hhDEPOiWkGp0Ys4Wi6Neriah7HweToKra626CIK712B5m9qkdz54OP9gVldUg+URnBTpv/j/bi/skmGdstXQ==",
+ "dependencies": {
+ "@floating-ui/core": "^1.3.1"
+ }
+ },
"node_modules/@jridgewell/gen-mapping": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
@@ -1310,6 +1324,11 @@
"node": ">= 6"
}
},
+ "node_modules/classnames": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz",
+ "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw=="
+ },
"node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
@@ -2967,6 +2986,19 @@
"react": ">= 0.14.0"
}
},
+ "node_modules/react-tooltip": {
+ "version": "5.18.0",
+ "resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-5.18.0.tgz",
+ "integrity": "sha512-qjDK/skUJJ27sc9lTWeNxp2rLzmenBTskSsRiDOCPnupGSz2GhL5IZxDizK/sOsk0hn5iSCywt+3jKxUJ3Y4Sw==",
+ "dependencies": {
+ "@floating-ui/dom": "^1.0.0",
+ "classnames": "^2.3.0"
+ },
+ "peerDependencies": {
+ "react": ">=16.14.0",
+ "react-dom": ">=16.14.0"
+ }
+ },
"node_modules/read-cache": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
@@ -3886,6 +3918,19 @@
"dev": true,
"optional": true
},
+ "@floating-ui/core": {
+ "version": "1.3.1",
+ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.3.1.tgz",
+ "integrity": "sha512-Bu+AMaXNjrpjh41znzHqaz3r2Nr8hHuHZT6V2LBKMhyMl0FgKA62PNYbqnfgmzOhoWZj70Zecisbo4H1rotP5g=="
+ },
+ "@floating-ui/dom": {
+ "version": "1.4.4",
+ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.4.4.tgz",
+ "integrity": "sha512-21hhDEPOiWkGp0Ys4Wi6Neriah7HweToKra626CIK712B5m9qkdz54OP9gVldUg+URnBTpv/j/bi/skmGdstXQ==",
+ "requires": {
+ "@floating-ui/core": "^1.3.1"
+ }
+ },
"@jridgewell/gen-mapping": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz",
@@ -4350,6 +4395,11 @@
}
}
},
+ "classnames": {
+ "version": "2.3.2",
+ "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz",
+ "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw=="
+ },
"color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
@@ -5411,6 +5461,15 @@
"refractor": "^3.6.0"
}
},
+ "react-tooltip": {
+ "version": "5.18.0",
+ "resolved": "https://registry.npmjs.org/react-tooltip/-/react-tooltip-5.18.0.tgz",
+ "integrity": "sha512-qjDK/skUJJ27sc9lTWeNxp2rLzmenBTskSsRiDOCPnupGSz2GhL5IZxDizK/sOsk0hn5iSCywt+3jKxUJ3Y4Sw==",
+ "requires": {
+ "@floating-ui/dom": "^1.0.0",
+ "classnames": "^2.3.0"
+ }
+ },
"read-cache": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/read-cache/-/read-cache-1.0.0.tgz",
diff --git a/extension/react-app/package.json b/extension/react-app/package.json
index 12701906f..4bedb8134 100644
--- a/extension/react-app/package.json
+++ b/extension/react-app/package.json
@@ -21,6 +21,7 @@
"react-redux": "^8.0.5",
"react-switch": "^7.0.0",
"react-syntax-highlighter": "^15.5.0",
+ "react-tooltip": "^5.18.0",
"styled-components": "^5.3.6",
"vscode-webview": "^1.0.1-beta.1"
},
diff --git a/extension/react-app/src/App.tsx b/extension/react-app/src/App.tsx
index a51541d0e..8785f88f8 100644
--- a/extension/react-app/src/App.tsx
+++ b/extension/react-app/src/App.tsx
@@ -1,28 +1,33 @@
import DebugPanel from "./components/DebugPanel";
import MainTab from "./tabs/main";
-import { Provider } from "react-redux";
-import store from "./redux/store";
import WelcomeTab from "./tabs/welcome";
import ChatTab from "./tabs/chat";
import GUI from "./tabs/gui";
+import { createContext } from "react";
+import useContinueGUIProtocol from "./hooks/useWebsocket";
+import ContinueGUIClientProtocol from "./hooks/useContinueGUIProtocol";
+
+export const GUIClientContext = createContext<
+ ContinueGUIClientProtocol | undefined
+>(undefined);
function App() {
+ const client = useContinueGUIProtocol();
+
return (
- <>
-
- ,
- title: "GUI",
- },
- // { element: , title: "Debug Panel" },
- // { element: , title: "Welcome" },
- // { element: , title: "Chat" },
- ]}
- >
-
- >
+
+ ,
+ title: "GUI",
+ },
+ // { element: , title: "Debug Panel" },
+ // { element: , title: "Welcome" },
+ // { element: , title: "Chat" },
+ ]}
+ />
+
);
}
diff --git a/extension/react-app/src/components/CodeBlock.tsx b/extension/react-app/src/components/CodeBlock.tsx
index 17f5626b9..fe9b3a950 100644
--- a/extension/react-app/src/components/CodeBlock.tsx
+++ b/extension/react-app/src/components/CodeBlock.tsx
@@ -52,9 +52,9 @@ function CopyButton(props: { textToCopy: string; visible: boolean }) {
}}
>
{clicked ? (
-
+
) : (
-
+
)}
>
diff --git a/extension/react-app/src/components/ComboBox.tsx b/extension/react-app/src/components/ComboBox.tsx
index 81b148b91..af673b42d 100644
--- a/extension/react-app/src/components/ComboBox.tsx
+++ b/extension/react-app/src/components/ComboBox.tsx
@@ -4,6 +4,7 @@ import styled from "styled-components";
import {
buttonColor,
defaultBorderRadius,
+ lightGray,
secondaryDark,
vscBackground,
} from ".";
@@ -16,11 +17,32 @@ import {
LockClosed,
LockOpen,
Plus,
+ DocumentPlus,
} from "@styled-icons/heroicons-outline";
+import { HighlightedRangeContext } from "../../../schema/FullState";
// #region styled components
const mainInputFontSize = 16;
+const EmptyPillDiv = styled.div`
+ padding: 8px;
+ border-radius: ${defaultBorderRadius};
+ border: 1px dashed ${lightGray};
+ color: ${lightGray};
+ background-color: ${vscBackground};
+ overflow: hidden;
+ display: flex;
+ align-items: center;
+ text-align: center;
+ cursor: pointer;
+ font-size: 13px;
+
+ &:hover {
+ background-color: ${lightGray};
+ color: ${vscBackground};
+ }
+`;
+
const ContextDropdown = styled.div`
position: absolute;
padding: 4px;
@@ -41,21 +63,23 @@ const MainTextInput = styled.textarea`
padding: 8px;
font-size: ${mainInputFontSize}px;
+ font-family: inherit;
+ border: 1px solid transparent;
border-radius: ${defaultBorderRadius};
- border: 1px solid white;
margin: 8px auto;
+ height: auto;
width: 100%;
- background-color: ${vscBackground};
+ background-color: ${secondaryDark};
color: white;
z-index: 1;
&:focus {
+ outline: 1px solid #ff000066;
border: 1px solid transparent;
- outline: 1px solid orange;
}
`;
-const UlMaxHeight = 400;
+const UlMaxHeight = 300;
const Ul = styled.ul<{
hidden: boolean;
showAbove: boolean;
@@ -69,15 +93,21 @@ const Ul = styled.ul<{
background: ${vscBackground};
background-color: ${secondaryDark};
color: white;
- font-family: "Fira Code", monospace;
max-height: ${UlMaxHeight}px;
- overflow: scroll;
+ overflow-y: scroll;
+ overflow-x: hidden;
padding: 0;
${({ hidden }) => hidden && "display: none;"}
border-radius: ${defaultBorderRadius};
- overflow: hidden;
border: 0.5px solid gray;
z-index: 2;
+ // Get rid of scrollbar and its padding
+ scrollbar-width: none;
+ -ms-overflow-style: none;
+ &::-webkit-scrollbar {
+ width: 0px;
+ background: transparent; /* make scrollbar transparent */
+ }
`;
const Li = styled.li<{
@@ -85,7 +115,7 @@ const Li = styled.li<{
selected: boolean;
isLastItem: boolean;
}>`
- ${({ highlighted }) => highlighted && "background: #aa0000;"}
+ ${({ highlighted }) => highlighted && "background: #ff000066;"}
${({ selected }) => selected && "font-weight: bold;"}
padding: 0.5rem 0.75rem;
display: flex;
@@ -102,7 +132,7 @@ interface ComboBoxProps {
onInputValueChange: (inputValue: string) => void;
disabled?: boolean;
onEnter: (e: React.KeyboardEvent) => void;
- highlightedCodeSections: (RangeInFile & { contents: string })[];
+ highlightedCodeSections: HighlightedRangeContext[];
deleteContextItems: (indices: number[]) => void;
onTogglePin: () => void;
onToggleAddContext: () => void;
@@ -119,16 +149,7 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
React.useState(false);
const [pinned, setPinned] = useState(false);
const [highlightedCodeSections, setHighlightedCodeSections] = React.useState(
- props.highlightedCodeSections || [
- {
- filepath: "test.ts",
- range: {
- start: { line: 0, character: 0 },
- end: { line: 0, character: 0 },
- },
- contents: "import * as a from 'a';",
- },
- ]
+ props.highlightedCodeSections || []
);
useEffect(() => {
@@ -169,6 +190,71 @@ const ComboBox = React.forwardRef((props: ComboBoxProps, ref) => {
return (
<>
+