A big number of bugs

44 views
Skip to first unread message

Oleksandr

unread,
Feb 25, 2024, 2:13:27 PMFeb 25
to Ukelele Users
Hello, all,

Before I start I want to say a big thank you for making this useful app. I cannot imagine how much effort you put into making it. I'm a long-time user, but sadly I noticed that the app's quality degraded even noticeably with the latest release, so I decided to give feedback as the app became almost unusable. For most of the described issues, I recorded and uploaded a video on YouTube.

I'm using Ukelele 3.5.11 (387)

Details.

1. The keyboard's view occasionally doesn't fit into the window upon the app's start and the window gets a scrollbar. (seen on video) Fixable with changing zoom but it's very annoying.

2. Switching keyboard types in settings doesn't work. (seen on video)

3. Resetting settings to default doesn't reset XML saving options. (seen on video)

4. Duplicating a keyboard layout doesn't duplicate icon and language settings. (seen on video)

5. Filter box for languages retains a text from previous searches.

6. It's not possible to "drag and drop" a key into an empty place while it works for non-empty places. (seen on video) It makes a huge problem when you want to create a layout from scratch full of empty keys.

7. I believe this one is the most important: macOS doesn't work with certain layouts if they were exported with the "XML has characters" setting. I spent two days chasing this bug until I realized I needed to switch to the "XML has code points" setting. I believe it's because Ukelele is using plain characters for action IDs and macOS cannot deal with some IDs. That's only my guess. I attached both bundles. I know, action names can be renamed, but this functionality is done most inconveniently by repeating Keyboard menu > Change action name > Rename. I have ≈50 actions and it's a pain for me to rename all of them. This bug isn't recorded on video.

The attached gzip contains two bundles: correct and incorrect. Layouts itself should appear in English > Latin — Tandem and Russian > Cyrillic — Tandem.

Best wishes,
Oleksandr

Oleksandr

unread,
Feb 25, 2024, 3:44:59 PMFeb 25
to Ukelele Users
Here is the file I forgot to attach.
layouts.tar.gz

John Brownie

unread,
Feb 26, 2024, 2:50:03 AMFeb 26
to ukelel...@googlegroups.com
Hi Oleksandr,

Thank you for pointing out the bugs. As the maxim goes, if I don’t know a bug is there, I can’t fix it. The video was helpful, too. As a general comment, the code base is pretty old by now, and I have slowly been working on a new version based on more recent technologies, but I’ve kept coming up on roadblocks, as well as the limited time I have to work on programming, which means that the current version doesn’t get much more than bug fixes these days.

So let me go through point by point and comment.

1. The keyboard's view occasionally doesn't fit into the window upon the app's start and the window gets a scrollbar. (seen on video) Fixable with changing zoom but it's very annoying.

This is a stupid problem with Apple’s code, as far as I can tell. I set the window to the exact dimensions required, but the window creation sometimes decides that it needs a scrollbar in one dimension, which takes up space that means it really does require a scrollbar. I’ll have another look at the code, and see if there’s anything I can do.

2. Switching keyboard types in settings doesn't work. (seen on video)

That’s unexpected, so I’ll look at it. I think that, if you select “Always use this type”, it will behave as you expect, but I’ll have to verify that. My memory of how I expected this to work was that it would use the selected type if the current hardware keyboard was unknown, which is usually the case these days (Apple removed the publicly available keyboard types many years ago).

3. Resetting settings to default doesn't reset XML saving options. (seen on video)

That is clearly an oversight. I suspect that the XML savings options were added later, and I forgot to include them in the reset code.

4. Duplicating a keyboard layout doesn't duplicate icon and language settings. (seen on video)

Again, this is not working as expected, so I’ll be looking to fix it.

5. Filter box for languages retains a text from previous searches.

Some like this, some hate this. I’ll go and look at the code and see what my options are.

6. It's not possible to "drag and drop" a key into an empty place while it works for non-empty places. (seen on video) It makes a huge problem when you want to create a layout from scratch full of empty keys.

This was a surprise, obviously something I didn’t test.

7. I believe this one is the most important: macOS doesn't work with certain layouts if they were exported with the "XML has characters" setting. I spent two days chasing this bug until I realized I needed to switch to the "XML has code points" setting. I believe it's because Ukelele is using plain characters for action IDs and macOS cannot deal with some IDs. That's only my guess. I attached both bundles. I know, action names can be renamed, but this functionality is done most inconveniently by repeating Keyboard menu > Change action name > Rename. I have ≈50 actions and it's a pain for me to rename all of them. This bug isn't recorded on video.

It’s really hard to work out what is going wrong there, as the error message points to some random point in the XML, claiming that it is an illegal character, but that point is a perfectly legitimate character. As far as I can tell, the issue is the XML parser within Apple’s keyboard layout compiler, since Ukelele is able to parse the files using an open-source XML parser, and running the files through online XML parsers works OK. This is one reason that the option for code points  was added. I think I still have an open bug report with Apple about this issue. If so, I’ll update it with extra files. If not, I’ll file one.

So, in summary, there are several things to look at and fix. It probably will take some time to get through all the issues. Thank you again for reporting them!

John

John Brownie

unread,
Feb 29, 2024, 4:41:32 AMFeb 29
to ukelel...@googlegroups.com
Here’s the state of things now.

On 26 Feb 2024 at 09:49:59, John Brownie <john_b...@sil.org> wrote:
1. The keyboard's view occasionally doesn't fit into the window upon the app's start and the window gets a scrollbar. (seen on video) Fixable with changing zoom but it's very annoying.

This is a stupid problem with Apple’s code, as far as I can tell. I set the window to the exact dimensions required, but the window creation sometimes decides that it needs a scrollbar in one dimension, which takes up space that means it really does require a scrollbar. I’ll have another look at the code, and see if there’s anything I can do.

That was a wrong diagnosis. There is something going on that I haven’t been able to work out. My code generates the ideal size of the window, sets that (allowing for screen size and position), but then something changes that size before the window appears. So I have a nasty solution for now: put in a delayed resize of the window, which resets the size after a tenth of a second. It’s noticeable, which is not ideal, and may not always work, especially if there are several windows appearing at once. I’ll keep looking for a better answer, though.

2. Switching keyboard types in settings doesn't work. (seen on video)

That’s unexpected, so I’ll look at it. I think that, if you select “Always use this type”, it will behave as you expect, but I’ll have to verify that. My memory of how I expected this to work was that it would use the selected type if the current hardware keyboard was unknown, which is usually the case these days (Apple removed the publicly available keyboard types many years ago).

The code was wrong here, either using the selected keyboard type if “Always use this type” was set, or the default otherwise. It now uses the selected type as the first fallback if the current hardware keyboard doesn’t match one of the ones Ukelele knows about.

3. Resetting settings to default doesn't reset XML saving options. (seen on video)

That is clearly an oversight. I suspect that the XML savings options were added later, and I forgot to include them in the reset code.

Actually, this was working correctly, except that the user interface wasn’t being updated to reflect the change to the XML saving options. It’s now fixed.

4. Duplicating a keyboard layout doesn't duplicate icon and language settings. (seen on video)

Again, this is not working as expected, so I’ll be looking to fix it.

This is fixed.

5. Filter box for languages retains a text from previous searches.

Some like this, some hate this. I’ll go and look at the code and see what my options are.

I decided to go with removing the text in the search boxes, which is what I was doing with the locale dialog, which is very similar.

6. It's not possible to "drag and drop" a key into an empty place while it works for non-empty places. (seen on video) It makes a huge problem when you want to create a layout from scratch full of empty keys.

This was a surprise, obviously something I didn’t test.

This must have been around for years! I had misunderstood the intent of one system call, which had the effect of denying a key as a drag destination if it had no output (rather than denying it as a drag source, which was my intent). Anyway, that’s fixed.

7. I believe this one is the most important: macOS doesn't work with certain layouts if they were exported with the "XML has characters" setting. I spent two days chasing this bug until I realized I needed to switch to the "XML has code points" setting. I believe it's because Ukelele is using plain characters for action IDs and macOS cannot deal with some IDs. That's only my guess. I attached both bundles. I know, action names can be renamed, but this functionality is done most inconveniently by repeating Keyboard menu > Change action name > Rename. I have ≈50 actions and it's a pain for me to rename all of them. This bug isn't recorded on video.

It’s really hard to work out what is going wrong there, as the error message points to some random point in the XML, claiming that it is an illegal character, but that point is a perfectly legitimate character. As far as I can tell, the issue is the XML parser within Apple’s keyboard layout compiler, since Ukelele is able to parse the files using an open-source XML parser, and running the files through online XML parsers works OK. This is one reason that the option for code points  was added. I think I still have an open bug report with Apple about this issue. If so, I’ll update it with extra files. If not, I’ll file one.

The bug I filed with Apple is still open. I’ve updated it twice in recent years, but it’s not getting attention that I can see. However, Apple has a policy of not saying what is coming in future versions, so this may get fixed at some point, but I don’t know when.

It’s probably not the action names, but it’s difficult to tell, because the error message points to the wrong place (perhaps there is some transform done to the file before parsing), so it’s hard to know exactly what is the offending character. Using code points is the best solution for now.

John
Reply all
Reply to author
Forward
0 new messages