Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script editor: Add commenting/uncommenting with Ctrl-/ and Cmd-/ #2322

Merged
merged 1 commit into from Feb 7, 2024

Conversation

jimtng
Copy link
Contributor

@jimtng jimtng commented Feb 7, 2024

Resolve #1336

Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
@jimtng jimtng requested a review from a team as a code owner February 7, 2024 16:08
Copy link

relativeci bot commented Feb 7, 2024

Job #1454: Bundle Size — 11MiB (+0.03%).

0a98c9f(current) vs 362d9f3 main#1449(baseline)

Warning

Bundle contains 19 duplicate packages – View duplicate packages

Bundle metrics  Change 3 changes Regression 1 regression
                 Current
Job #1454
     Baseline
Job #1449
Regression  Initial JS 1.84MiB(~+0.01%) 1.84MiB
No change  Initial CSS 607.73KiB 607.73KiB
Change  Cache Invalidation 19.66% 16.98%
No change  Chunks 220 220
No change  Assets 242 242
Change  Modules 3075(+0.03%) 3074
No change  Duplicate Modules 159 159
No change  Duplicate Code 1.74% 1.74%
No change  Packages 150 150
No change  Duplicate Packages 18 18
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #1454
     Baseline
Job #1449
Regression  JS 9.19MiB (+0.04%) 9.19MiB
Not changed  CSS 888.86KiB 888.86KiB
Not changed  Fonts 526.1KiB 526.1KiB
Not changed  Media 295.6KiB 295.6KiB
Not changed  IMG 140.74KiB 140.74KiB
Not changed  HTML 1.24KiB 1.24KiB
Not changed  Other 871B 871B

View job #1454 reportView jimtng:code-editor-commenting branch activityView project dashboard

@jimtng jimtng changed the title Enable commenting/uncommenting with Ctrl-/ and Cmd-/ Add commenting/uncommenting with Ctrl-/ and Cmd-/ Feb 7, 2024
Copy link
Contributor

@florian-h05 florian-h05 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.
Using these keyboard shortcuts sounds reasonable.

Do you think this should be documented somewhere?

@florian-h05 florian-h05 added this to the 4.2 milestone Feb 7, 2024
@florian-h05 florian-h05 added enhancement New feature or request main ui Main UI labels Feb 7, 2024
@florian-h05 florian-h05 merged commit b49ab25 into openhab:main Feb 7, 2024
6 checks passed
@florian-h05 florian-h05 changed the title Add commenting/uncommenting with Ctrl-/ and Cmd-/ Script editor: Add commenting/uncommenting with Ctrl-/ and Cmd-/ Feb 7, 2024
@jimtng
Copy link
Contributor Author

jimtng commented Feb 7, 2024

Do you think this should be documented somewhere?

I am unfamiliar with the documentation in general. Where should it go?
Even better, is to show a list/table of shortcut keys on the UI itself, with a little question mark icon or something. That would get read far more than if it's buried somewhere in openhab.org/docs/ somewhere.

@jimtng jimtng deleted the code-editor-commenting branch February 7, 2024 17:08
@florian-h05
Copy link
Contributor

In #2253 I migrated the docs of the UI-integrated help feature (which is opened by clicking the question mark in the upper right corner) to the docs repo.
The UI now loads the docs from the docs repo (see openhab/openhab-docs#2199), so I wonder if we could utilise this feature for your suggested shortcuts list.

We can now create a page in the docs, which is displayed on the website and accessible inside the UI, we just need to figure out how the help feature can determine that currently the script editor is open. If we have a reliable way to check that, we just have to write the docs and add a one-liner to the UI and we will have the docs.

@rkoshak
Copy link

rkoshak commented Feb 7, 2024

Maybe this could be integrated with the Help tab in the Developer Sidebar too?

image

@florian-h05
Copy link
Contributor

Maybe this could be integrated with the Help tab in the Developer Sidebar too?

This is what I was talking about ;-)

@florian-h05
Copy link
Contributor

@jimtng See #2331 and the linked docs PR for the docs.

@jimtng
Copy link
Contributor Author

jimtng commented Feb 16, 2024

@florian-h05 in the sidebar help for script editor, it has a link to Codemirror docs, but it's broken. Can't click on it.

image

@florian-h05
Copy link
Contributor

@jimtng Please have a look at #2368 for the fix.

@jimtng
Copy link
Contributor Author

jimtng commented Feb 17, 2024

@jimtng Please have a look at #2368 for the fix.

Thanks! That seems to have fixed it

florian-h05 added a commit that referenced this pull request Feb 17, 2024
- Fixes an issue reported in
#2322 (comment)
where external anchor hrefs did not work.
- Fixes an issue where the script editor docs were shown on the
`/settings/scripts/` page.

---------

Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request main ui Main UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add comment/uncomment shortcut key
3 participants