Commit Graph

112 Commits

Author SHA1 Message Date
Johannes Rieken
3218292d9d remove ExpTextButtons setting and logic but keep make buttons more dynamic (#225495) 2024-08-13 16:00:26 +02:00
Benjamin Pasero
b18a8c5495 esm - reduce diff (#224388) 2024-07-31 15:59:06 +02:00
Johannes Rieken
53c0b5ac53 Joh/mental-koi (#217004)
* hightlight first button only when inline chat has a prompt

* rename "Cancel Request" to "Stop Request"

* mark `inlineChat.experimental.textButtons` as experimental

* show all "input" command when not using text btns

* When cancelling, undo untill before the request
2024-06-24 13:06:53 +02:00
Johannes Rieken
a2cab7255c don't move inline chat zone into selection when changes aren't far away (#216809)
* return (?) of the info icon

* don't move inline chat zone into selection when changes aren't far away
2024-06-21 15:41:43 +02:00
David Dossett
0bb8c91f56 More polish 2024-06-20 16:28:47 -07:00
Johannes Rieken
a11602734b inline chat positioning polish (#216630)
* make sure to show close button when having just message responses

* * no more intented rendering of inline chat
* make sure the top of the view zone is always revealed
2024-06-19 18:10:43 +02:00
Johannes Rieken
5e2e40c42e tweak accept or discard message (#216384) 2024-06-18 10:00:46 +02:00
Johannes Rieken
2e98100d22 Joh/homely-damselfly (#213376)
* chore - `ReplyResponse` cleanup

* associate hunk data with response id

* Associate hunk data with response state so that accepting hunks updates the text edit group

* first cut of moving N-edits conversion from inline chat to panel
2024-05-24 11:14:49 +02:00
Johannes Rieken
a54e247fba Enable roaming of inflight chat requests (#213239)
This enables to remove the special handling for `/explain`

- fixes https://github.com/microsoft/vscode-copilot/issues/2192
- fixes https://github.com/microsoft/vscode/issues/208706 because inline chat now closes on "view in chat"
- fixes https://github.com/microsoft/vscode-copilot/issues/5288
2024-05-22 18:47:03 +02:00
Johannes Rieken
89eb8a767f make sure to push an undo stop after each request (#213137)
fixes https://github.com/microsoft/vscode-copilot/issues/5736
2024-05-21 12:16:33 +02:00
David Dossett
d1cc483e03 Initial inline chat polish (#212755)
* Initial inline chat polish

* Fix widget padding

* More tweaks
2024-05-15 14:37:04 -07:00
Johannes Rieken
703b81086a Editable chat code compare blocks (#210986)
Have a `DefaultChatTextEditor` that applies chat text edits using the diff editor if possible, normal edits otherwise. The former makes it possible to tweak the diff/changes before applying
2024-04-22 20:00:12 -07:00
Johannes Rieken
3c1a47dc74 inline chat should render outside edits with the new embedded diff rendering (#210980) 2024-04-22 17:10:32 -07:00
Johannes Rieken
ba65916262 improve CodeCompareBlockPart (#210964)
* polish code compare block for chat widgets

* show edits unless applied
* show summary after applying
* know when original file has changed

* don't double apply edits

* separate `IChatTextEdit` (progress chunk) and `IChatTextEditGroup` (response value) so that latter can hold extra state and allows for groups of edits

* fix compile errors
2024-04-23 00:28:59 +02:00
Johannes Rieken
7b91c2d1ba Live mode uses chat widget rendering (#210157)
* reveal editor after making changes

* also give preview models a path component

* workaround errors in diff computer fyi @hediet

* * make live mode be a rendering mode
* render new files with the chat widget and not with a separate zone

* 💄

* fix tests
2024-04-11 14:43:53 +02:00
Johannes Rieken
250ab2f640 render inline chat change decoration also inside minimap (#209414) 2024-04-03 09:38:19 +02:00
Johannes Rieken
dda7e5ead2 inline - fix toggle state of Show Changes (#208899) 2024-03-27 12:45:58 +01:00
Johannes Rieken
ad5a40fb18 Inline chat fixes/feature (#208393)
* only show slash command as detected when not having typed one

* use clearer message that hunks need to be accepted or discard, also add hover with more details

fixes https://github.com/microsoft/vscode/issues/206939
2024-03-22 13:24:07 +01:00
Johannes Rieken
df09a73143 More inline chat fixes and polish (#208387)
* align preview and live mode for previewing new/untitled files

* fix layout when having preview-only changes

* increate max speed of progressive text edits

* History entries are tracked by object identity. Make sure `acceptInput` finds and updates previous entries by text

fyi @roblourens

fixes https://github.com/microsoft/vscode/issues/208386
2024-03-22 11:04:21 +01:00
Johannes Rieken
9626fb0cd2 Inline chat widget tweaks (#206954)
* make status menu configurable

https://github.com/microsoft/vscode/issues/206940

* pull inline chat zone widget into its own file

* 💄

* remove expand/crop feature

* make chat message contents scrollable
2024-03-06 12:51:50 +01:00
Johannes Rieken
95e10d938f Remove livePreview and its implementation (#206073)
* Remove `livePreview` and its implementation

fixes https://github.com/microsoft/vscode/issues/205535

* make compiler happy
2024-02-23 15:19:33 +01:00
Johannes Rieken
2411a9c913 add inlineChat.accessibleDiffView setting (#205837)
fixes https://github.com/microsoft/vscode/issues/205714
2024-02-21 11:06:38 +01:00
Johannes
f439a7d9c5 wip - use accessible diff viewer for hunk info 2024-02-16 14:52:45 +01:00
Johannes Rieken
7215958b3c add commands to navigate between hunks (#205293)
https://github.com/microsoft/vscode/issues/203349
2024-02-15 15:57:24 +01:00
Matt Bierner
531cc0ee62 Don't accidentally create InlineChatFileCreatePreviewWidget when hiding it (#203830) 2024-01-30 12:31:38 -08:00
Johannes Rieken
6be4d6cc52 Don't let actual decorations grow, but still grow the "ambient" background decoration (#203546)
fixes https://github.com/microsoft/vscode-copilot/issues/3713
2024-01-26 18:03:09 +01:00
Johannes Rieken
6eb3213066 inline chat work (#203534)
* debt - use hunks to render preview diff

* add `InteractiveEditorRequest#previewDocument` to indicate for which document edits are previewed before being applied
2024-01-26 15:40:43 +01:00
Johannes Rieken
1f607d67c5 fix https://github.com/microsoft/vscode-copilot/issues/3652 (#203305) 2024-01-24 13:08:06 +01:00
Johannes Rieken
4217af7696 restore stashed sessions for when accidentially dismissing a session (#203006) 2024-01-22 14:31:23 +01:00
Johannes Rieken
053bbeb47c Use hunks also for livePreview and preview mode (#202843)
* more test coverage

* - Session has textModelN and targetUri where they must not always be equal
- for preview mode create textModelN copy so that AI edits can always be applied
- let preview mode work with hunk information

* - live preview uses hunk information
- tweak utils

* fix live-mode toggle diff
2024-01-19 13:14:28 +01:00
Johannes Rieken
e5a7abbc6a Mirror user edits into base model (#202723) 2024-01-18 14:51:52 +01:00
Johannes Rieken
b8b5a4aad0 Move hunk computation into sessions, let strategies render them (#202578)
* chore - move chat session service implementation and interface into their own files

* chore - move chat saving service implementation and interface into their own files

* - move hunks into session (instead of strategy)
- recompute them after receiving AI changes
- accept& discard moves hunks from textModelN to textModel0 and vice versa
- service renames
- tests

* - session doesn't know about an editor, only service does
- allow to "move" session to a different editor
- let controller pickup session after move to its editor
- session saving picks up orphand sessions

* try to restore editors when group is still valid

* ctrl - don't pause when cancellation happens during session create

* fix tests
2024-01-16 14:50:19 +01:00
Johannes Rieken
02580fd00c Make sure AI generate code gets accepted/discarded before saving (#202347)
* add inline chat save logic that ensures AI generated changes are only saved after consent

* live - when cancelling don't undo until start version but revert changes

* add setting to control save participation

* fix typo

* stub new services, fixes tests
2024-01-12 16:29:12 +01:00
Johannes Rieken
b0abf6638b fix https://github.com/microsoft/vscode/issues/202164 (#202317)
* remove start-method from strategies

* rename - activeSession to session

* keep strategy alive when pausing session, let strategy participate in pause, allow to call LiveStrategy#renderChanges repeatedly without recomputing hunks

* reset diff toggled state

* make sure to reset hunk display on done (dipose, accept, discard)

* reset diff state in pause, not hide function
2024-01-12 09:11:05 +01:00
Johannes Rieken
115155df62 Add test that asserts stream is done when the request is done (#202184)
test that asserts stream is done when the request is done

manifests fixing https://github.com/microsoft/vscode-copilot/issues/3345
2024-01-10 10:48:10 -08:00
Johannes Rieken
8ffbf09e31 Clear edit queue when request errors, tweak Queue/Limiter, tests (#202157)
* don't drag targetWindow all the way across all the layers

* add `ILimiter#clear`, add tests and define onDrain and clear behaviour

* fix compilo

* Queue/Limit - clarify onDrain timing, make sure it fires only once, add whenIdle

* chat - clear edit queue on error, adopt whenIdle

* add test to ensure progress edit stream stop on being cancelled
2024-01-10 15:27:09 +01:00
Johannes Rieken
77ca6ccd41 Joh/mysterious-octopus (#202079)
* debt - don't use extra buttons for accept/discard hunk

* - inline chat history shouldn't loop
- preserve the initial value and restore it

fixes https://github.com/microsoft/vscode-copilot-release/issues/671
2024-01-09 15:43:26 +01:00
Benjamin Pasero
35c44eeb27 Aux window: reduce $window usage (#195888) 2023-12-30 01:41:14 +01:00
Johannes Rieken
0603a4682b allow strategies to control whole range deco, let live not render it (#201224) 2023-12-19 19:20:27 +01:00
Johannes Rieken
595e7d4275 fix https://github.com/microsoft/vscode/issues/201197 (#201221) 2023-12-19 17:55:40 +01:00
Johannes Rieken
43fe3c9456 update changes count as hunks get accepted or rejected (#201188) 2023-12-19 10:47:21 +01:00
Johannes Rieken
0ad1502bee Improve live mode (#201147)
* simpler highlighting as changes are made, when rendering changes only compute diff once and use decorations to track inserts and further edits

* signal accept when at least one hunk was accepted
2023-12-18 19:19:51 +01:00
Johannes Rieken
3369508fe7 inline chat tweaks (#201126)
* streamline tel data

* rename to LiveStrategy

* fix up highlights
2023-12-18 15:17:26 +01:00
Johannes
42daedfd6c add overview ruler decorations for inline chat insertions, only show line level decoration but not word level changes 2023-12-18 12:22:54 +01:00
Johannes
8bfb30d567 don't reveal UI during streaming or when diff was recomputed
fixes https://github.com/microsoft/vscode-copilot/issues/3350
2023-12-18 11:46:28 +01:00
Johannes Rieken
a33752f9f0 clean up strategies (#200938) 2023-12-15 10:57:40 +01:00
Johannes Rieken
054c9129f8 live3 becomes live (#200866) 2023-12-14 18:24:38 +01:00
Johannes Rieken
2018d1523e await undo, reuse code (#200349)
* Revert "protect against faulty `canUndo` result"

This reverts commit cc629533b9.

* await undo, reuse code

https://github.com/microsoft/vscode/issues/200223
2023-12-08 14:41:43 +01:00
Johannes Rieken
2d826896fc protect against faulty canUndo result (#200323)
https://github.com/microsoft/vscode/issues/200223
2023-12-08 11:19:31 +01:00
Johannes Rieken
f746843c72 update diff when document changes but don't auto-accept change regions (#200061)
https://github.com/microsoft/vscode-copilot/issues/3206
2023-12-05 18:59:17 +01:00