appsmithorg / appsmith

Platform to build admin panels, internal tools, and dashboards. Integrates with 25+ databases and any API.
https://www.appsmith.com
Apache License 2.0
32.3k stars 3.5k forks source link

[Bug]: Custom Widget HTML Tab - Comment Keyboard Shortcut adds JS Comment // instead of HTML<!-- #34310

Open GreenFlux opened 2 weeks ago

GreenFlux commented 2 weeks ago

Is there an existing issue for this?

Description

In the HTML tab of a custom widget, the keyboard shortcut to comment out selected text is active, but it uses the wrong value and doesn't actually comment out the code.

Steps To Reproduce

  1. Drag in a new custom widget and edit the source
  2. Select a line of code in the HTML tab
  3. Hit CMD+/ and see the // added instead of an HTML comment

Public Sample App

No response

Environment

Production

Severity

Low (Cosmetic UI issues)

Issue video log

No response

Version

Appsmith v1.28.0-SNAPSHOT

wisewizardofthestars commented 6 days ago

Hi! Can I get this assigned to me? Thanks

Nikhil-Nandagopal commented 6 days ago

@wisewizardofthestars Table widget issues are fairly complex so I don't recommend starting with this. Have a look at other good first issues & low bugs first before feature contribution.

wisewizardofthestars commented 6 days ago

Hi @Nikhil-Nandagopal,

Thank you for your insight on the issue!

I made some adjustments by adding a Ctrl-/ option to the CodeMirror setup for HTML. So far, the changes seem to be working locally, and the bug appears to be fixed. However, I would really appreciate it if you could review my code to ensure everything is set up correctly and to confirm that the bug is indeed resolved.

Here is a summary of what I did:

Change Made: Added a Ctrl-/ shortcut to the CodeMirror configuration on **app/client/src/components/editorComponents/CodeEditor/index.tsx**.
Testing Status: Running the client locally, the bug seems fixed, but I’m continuing to test for any issues.

I made a Github Gist with the code I edited (lines 397 to 408 added) in case you don't mind checking: here

If you think there are still improvements to be made or if something doesn’t seem quite right, please let me know. I’m open to working on other bugs if this one turns out to be more complex than anticipated.

Thanks again for your help!