Skip to content

Allow customisation of hs.chooser font sizes. Closes #226 - #246

Merged
cmsj merged 2 commits into
mainfrom
fix-226
Oct 1, 2026
Merged

cmsj merged 2 commits into
mainfrom
fix-226

Conversation

@cmsj

@cmsj cmsj commented Sep 30, 2026

Copy link
Copy Markdown
Owner

Closes #226

@cmsj cmsj self-assigned this Sep 30, 2026
@greptile-apps

greptile-apps Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds customizable font sizes to the chooser UI.

The PR appears safe to merge; the remaining finding concerns regression-test coverage rather than demonstrated runtime behavior.

Findings

  1. P2 Assignment exceptions go undetected ▶
Fix with agent prompt
### Issue 1
Hammerspoon 2Tests/IntegrationTests/HSChooserIntegrationTests.swift:487-488
`expectTrue` starts a new JavaScript evaluation, which clears the exception recorded by the assignment block before `hasException` checks it. If an invalid assignment throws but leaves the size unchanged, this test still passes, so it does not verify that invalid values are ignored without an exception. Check `hasException` immediately after the assignment block. The subtext and query tests have the same pattern.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Summary

The PR adds configurable chooser title, subtitle, and query font sizes, adjusts row and panel sizing to match, and adds integration coverage. The latest changes reject invalid sizes and document that behavior.

Reviews (2) · Last reviewed commit: "Guard text sizes against being negative,..."

Comment thread Hammerspoon 2/Modules/hs.chooser/HSChooser.swift
Comment thread Hammerspoon 2/Modules/hs.chooser/Views/ChooserViewModel.swift
Comment thread Hammerspoon 2Tests/IntegrationTests/HSChooserIntegrationTests.swift
@cmsj

cmsj commented Sep 30, 2026

Copy link
Copy Markdown
Owner Author

@greptile

Comment on lines +487 to +488
harness.expectTrue("Math.abs(c.textSize - 18) < 0.01")
#expect(!harness.hasException)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Assignment exceptions go undetected

expectTrue starts a new JavaScript evaluation, which clears the exception recorded by the assignment block before hasException checks it. If an invalid assignment throws but leaves the size unchanged, this test still passes, so it does not verify that invalid values are ignored without an exception. Check hasException immediately after the assignment block. The subtext and query tests have the same pattern.

Prompt To Fix With AI
This is a comment left during a code review.
Path: Hammerspoon 2Tests/IntegrationTests/HSChooserIntegrationTests.swift
Line: 487-488

Comment:
**Assignment exceptions go undetected**

`expectTrue` starts a new JavaScript evaluation, which clears the exception recorded by the assignment block before `hasException` checks it. If an invalid assignment throws but leaves the size unchanged, this test still passes, so it does not verify that invalid values are ignored without an exception. Check `hasException` immediately after the assignment block. The subtext and query tests have the same pattern.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

@cmsj
cmsj merged commit 8c137a7 into main Oct 1, 2026
6 checks passed
@cmsj
cmsj deleted the fix-226 branch October 1, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hs.chooser: no way to set the text size

1 participant