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

Automation Editor, Script Editor and Template Editor Issues #12982

Closed
3 tasks done
Daniel-dev22 opened this issue Jun 19, 2022 · 22 comments · Fixed by #14969
Closed
3 tasks done

Automation Editor, Script Editor and Template Editor Issues #12982

Daniel-dev22 opened this issue Jun 19, 2022 · 22 comments · Fixed by #14969

Comments

@Daniel-dev22
Copy link

Daniel-dev22 commented Jun 19, 2022

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

The automation editor, script Editor and Template Editor has a problem. On the forums I create a post and the android developer stated he believed it may be a frontend issue.

Home Assistant Forum Post Per the post someone with the same exact phone is experiencing similar issues.

It will start to create 2 lines by pressing return on the keyboard. It will double space when pressing the spacebar sometimes. At times when highlighting code for deletion or pasting and either clicking delete or paste it will make what seems to be at least 3 times the code rather than doing what it should.
Example.
{{ foo }}
Will become
{{ foo }}{{ foo }}{{ foo }}{{ foo }}{{ foo }}{{ foo }}{{ foo }} when trying to paste over it or delete it.

I’m on Android 12 Galaxy s22 Ultra. Home Assistant runs without issues.

Describe the behavior you expected

I expected it to drop 1 line when pressing enter. A real 1 line not appear as 2 or truly drop 2. Delete or replace whatever is selected not replicate it 30 times.
Screenshot_20220619-082519_Home Assistant
Screenshot_20220616-045509_Home Assistant

Steps to reproduce the issue

  1. Android 12 Galaxy s22
  2. Automation editor, script Editor or template editor
  3. Press return on keyboard and it will double create a line below or stretch a line into what appears to be 2
  4. Attempt to replace or delete highlighted code and not all the time but sometimes it will replicate the code instead or delete 1 letter from the end as if it was never highlighted.
  5. Sometimes when attempting to use the spacebar it will double space code when it should be single spacing.
    ...

What version of Home Assistant Core has the issue?

2022.6.3

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Android Latest Version

Which operating system are you using to run this browser?

Android 12

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@Scoff123
Copy link

I'm seeing this exact same behaviour on my Samasung S22 Plus running Android 12. I have also managed to recreate the extended/stretched line using the latest Chrome browser on my phone too, when editing the yaml of an automation, and typing two curly brackets followed by the return key on the on-screen keyboard.

Screenshot_20220617-115818_Chrome

So it seems to be a frontend issue that spans both the HA companion app as well as android Web browser (Chrome at least). I will check other android browsers for the behaviour and confirm.

@bramkragten
Copy link
Member

This is only an issue on Android? You can't reproduce it in Chrome on a desktop?

@Daniel-dev22
Copy link
Author

This is only an issue on Android? You can't reproduce it in Chrome on a desktop?

Only an issue on android for chrome and the companion app. Unable to reproduce on desktop chrome.

@Daniel-dev22
Copy link
Author

Daniel-dev22 commented Jul 7, 2022

This is only an issue on Android? You can't reproduce it in Chrome on a desktop?

Here's another example in the companion app. I tried to type something and then go back with the x button and this happened. I couldn't delete that without highlighting it otherwise it just kept generating more. Sometimes even highlighting doesn't work I just have to close out and reopen.
Screenshot_20220707-054900_Home Assistant

@Scoff123
Copy link

Scoff123 commented Jul 9, 2022

I've also found in the Terminal and SSH addon, typing a # symbol results in 2 # symbols being inserted

Screenshot_20220709-151120_Home Assistant

@Daniel-dev22
Copy link
Author

This is only an issue on Android? You can't reproduce it in Chrome on a desktop?

Any luck on finding the cause of our issues?

@Daniel-dev22
Copy link
Author

Daniel-dev22 commented Jul 22, 2022

I noticed this issue occurs in the card editor as well. Not sure if this will help but I am going to try turning on remote web vide debugging and getting the logs if possible to paste here when the issue is recreated.

@Daniel-dev22
Copy link
Author

Still happening on 2022.9.1

@raemsey
Copy link

raemsey commented Oct 25, 2022

Same problem on my S21, Android 12, Home Assistant 2022.10.5 and Companion App 2022.10.1

@Daniel-dev22
Copy link
Author

Daniel-dev22 commented Oct 25, 2022

Still happening for me as well @bramkragten

Latest stable android companion app
Latest stable home assistant release.

Happening with 2 different home assistant instances. (I also have companion app minimal).

@steverep
Copy link
Member

steverep commented Jan 3, 2023

I submitted a change to upgrade CodeMirror to the latest version (#14969). Some of the bug fixes may solve or improve this issue. This will probably go into 2023.2, but if anyone can test that branch ahead of time, it would certainly be useful.

@Daniel-dev22
Copy link
Author

I submitted a change to upgrade CodeMirror to the latest version (#14969). Some of the bug fixes may solve or improve this issue. This will probably go into 2023.2, but if anyone can test that branch ahead of time, it would certainly be useful.

You're a legend if this fixes the issue. This seems to happen across a lot of code editors. Including portainer for example.

@Scoff123
Copy link

Scoff123 commented Jan 3, 2023

Agreed! This issue has seemingly become worse of late, with the most recent HA updates. Opening any editor from within the HA Android app, and placing the cursor anywhere, starts adding new line after new line endlessly to the bottom of the code, every second or so. It's become totally unusable so any improvement would be welcome!

@steverep
Copy link
Member

steverep commented Jan 3, 2023

To be clear, that change just upgrades the CodeMirror packages used in HA, so nothing legendary. 🦸🏻‍♂️

But the fact that it occurs for you outside HA points to a bug in CodeMirror as the problem. For example, Portainer looks to use an older version of CodeMirror as well.

There are a couple android-specific fixes mentioned in their changelog which sort of sound like they might solve this, but I do not have HA on android to test.

@Daniel-dev22
Copy link
Author

Daniel-dev22 commented Jan 9, 2023

To be clear, that change just upgrades the CodeMirror packages used in HA, so nothing legendary. 🦸🏻‍♂️

But the fact that it occurs for you outside HA points to a bug in CodeMirror as the problem. For example, Portainer looks to use an older version of CodeMirror as well.

There are a couple android-specific fixes mentioned in their changelog which sort of sound like they might solve this, but I do not have HA on android to test.

I wouldn't say all the issues are fixed by this (I'm on 2023.2) but it definitely seems better which is better than nothing.

@steverep
Copy link
Member

steverep commented Jan 9, 2023

You are running the dev branch? What's better and what isn't? Need specifics, preferably repeatable, to diagnose and fix anything.

@Daniel-dev22
Copy link
Author

Daniel-dev22 commented Jan 10, 2023

You are running the dev branch? What's better and what isn't? Need specifics, preferably repeatable, to diagnose and fix anything.

Oops 2022.1.2 not dev. I will try messing with it to see what's better.

@steverep
Copy link
Member

Reminder: If you're a beta tester, please look to see if this is resolved.

@Daniel-dev22
Copy link
Author

Daniel-dev22 commented Jan 25, 2023

Were there more changes that may help with this issue?

I'm going to be deploying the beta soon.

@steverep
Copy link
Member

Just the upgrade to CodeMirror

@Daniel-dev22
Copy link
Author

Just the upgrade to CodeMirror

I'm running the beta and the improvement is already noticeable. I'll keep this open while I test but things are looking good thank you.

@steverep steverep linked a pull request Jan 27, 2023 that will close this issue
9 tasks
@Daniel-dev22
Copy link
Author

@steverep thank you. I never thought this issue would get fixed as it was an issue since May/June. Thank you for finding the culprit and pushing an update.

@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants