Repository navigation
doctor: match font names the way qt lists them - #3972
Conversation
|
/claude review |
Claude reviewOne regression to fix before merge.
|
|
Hello,
I understand that these changes will "break" some |
|
/claude review |
| _families = ["Default"].concat(DCommon.Fonts.selectableFamilies(root.defaultFamily)); | ||
| _enumerated = true; | ||
| DMSService.sendRequest("fonts.families", null, response => { | ||
| if (response.error || !Array.isArray(response.result)) { |
There was a problem hiding this comment.
If the request fails (socket not connected, or an older dms without fonts.families), _families stays ["Default"]. Because _enumerated is already true, it never retries, so the picker loses the bundled fonts and every installed font. The old code always had a list from Qt.fontFamilies().
Fix: fall back to the local list on error:
| if (response.error || !Array.isArray(response.result)) { | |
| if (response.error || !Array.isArray(response.result)) { | |
| root.log.error("Failed to load font families:", response.error); | |
| root._families = ["Default"].concat(DCommon.Fonts.selectableFamilies(root.defaultFamily)); | |
| return; | |
| } |
There was a problem hiding this comment.
I don't like this suggestione, if the system can't talk to the server it shouldn't show a list of fonts, even tho those are from Qt. Only Go should create the list and if that's not possible an error is shown (through commit "266ceae3ad9c") and a log will be stored too.
Claude reviewTwo issues to fix before merge.
|
|
/claude review |
Claude reviewNo new issues found. The empty-cache report is fixed in 8c6ed06. The earlier comment about the font picker having no fallback when |
8c6ed06 to
266ceae
Compare
|
Fixes that claude suggested are applied except the one regarding having a fallback for the font list since that wouldn't make sense in that we would end up having a different font / value in the end, if go can't return the font list an error is logged and through a Toast is shown. |
|
I gotta do some regression testing on this one, feels like I'm getting half the fonts that QTs list has available to choose from |
|
The font list is shorter (e.g. on my machine it went from 805 fonts to 339) but almost all of the missing fonts are duplicate names for the same font:
There are regressions which are worth mentioning:
However, these regressions account for 19 missing fonts on my machine, and they can be brought back if needed. the other 453 fonts were just duplicates. For reference the font list now matches Obsidian and Zed (apart from two Red Hat italics). |
|
I think I'd rather just fix the doctor matcher with this, and potentially trim the duplicates with QTs list, instead of relying on the go daemon for listing fonts |
266ceae to
be6429c
Compare
|
Sure thing, I have reverted my latest changes and only kept the ones that deal with matchint I will see about filtering Thank you. |
|
/claude review |
Claude reviewNo issues found. The revert to a doctor-only fix is clean, and the bare-name regression from the first review is fixed in 45e93c5. |
port 2.0 (cherry picked from commit b18fc38)
Description
This PR aims to fix the following problem mentioned in Issue #3935: when running the command
dms doctor -vand a font that exists in multiple foundries exists it will give out an error and say that the configured font is not infc-list.Cause: the problem arises in the fact that in qt qml
Qt.fontFamilies()is used while in the go code only the list fromfc-list : familyis checked and they give out different kind of listsFix: in the go code we now build a qt-like font list taking into account the fact that font families may come from different foundries
This PR doesn't aim to solve the other issue mentioned: when a dropdown list has an element that is wider than the given width the elements text will be cut off. The fix lives in dux-qml-common in the following PR: duxlabs-dev/dux-qml-common#33
Claude code was used to generate the code but I take responsibility for it since I have reviewed it, understood it and modified it.
Type of change
Related issues
Fixes #3935
Screenshots / video
Before this PR we can see that when selecting

RobotoMono Nerd Font [pyrs]dms doctor -vgives a warning:After my PR the warning is gone:

Checklist
I18n.tr()with translator context, reusing existing terms where possiblemake fmt, added/updated tests,make testpasses, andgo mod tidyis cleanmake lint-qmlwith no new warnings