quadratichq / quadratic

Quadratic | Spreadsheet with Python, SQL, and AI
https://QuadraticHQ.com
Other
3.03k stars 154 forks source link

bug: drag to select text in AI code editor doesn't work #1768

Open jimniels opened 2 months ago

jimniels commented 2 months ago

Try to drag to select specific text that is code in the AI assistant and it doesn't scroll down as you drag, which makes it impossible to select text off the screen.

https://github.com/user-attachments/assets/d92876e3-ed12-4acc-9a65-68056815ed01

AyushAgrawal-A2 commented 2 months ago

Monaco editor does not allow selecting text outside itself and it cannot scroll parent element while text selection.

One possible solution is to display the AI code as markdown code block, with language highlights. We can remove moncao here.

jimniels commented 2 months ago

That's probably the best idea.

Initially we just dumped it in Monaco because it had the same syntax highlighting as we used in the code editor (which is custom) so it was the quickest way to get something that felt unified with the code editor itself in terms of the display of code.

But it does bring all the baggage of Monaco. I think you're right, pulling out the display via Monaco is probably the best solution.

AyushAgrawal-A2 commented 1 week ago

Is this still required ? @jimniels

jimniels commented 1 week ago

It's still a bug — even in the AI branch. If generate code in the code editor AI and it overflows that area you can't drag to select it

AyushAgrawal-A2 commented 1 week ago

I meant the monaco editor is collapsed now in AI branch, user interaction with generated code will be different. Also @davidkircos still wants monaco in ai output, so not sure what is the way forward... we may keep this issue open, but I don't think it is actionable.