Skip to content

fix(settings): drop a stale custom terminal-weight entry on reopen - #427

Closed
Ark0N wants to merge 1 commit into
masterfrom
fix/font-weight-custom-option
Closed

Ark0N wants to merge 1 commit into
masterfrom
fix/font-weight-custom-option

Conversation

@Ark0N

@Ark0N Ark0N commented Sep 14, 2026

Copy link
Copy Markdown
Owner

Follow-up to #417, found by reviewing it with the DeepSeek Harness on the local RTX 5090.

The bug

populateTerminalFontWeight adds an option for a stored weight the picker does not list, so a hand-set 350 survives being looked at rather than being silently reset by the next save. It never removed the entry a previous open added, and App Settings is opened again and again.

A device that held 350, then 200, then 400 ended up with a picker offering all three, none of which was the stored value. Measured in a browser against the shipped code:

open stored options
1 350 …,800,900,350
2 222 …,800,900,350,222
3 275 …,800,900,350,222,275

Cosmetic, and only reachable by hand-editing the stored value, which is exactly the case the custom entry exists to serve.

The fix

Each custom entry is marked (data-custom="1") and cleared at the top of the next populate. The clear runs before the add, or it removes the entry it just made. Same run after the fix:

open stored options
1 350 …,800,900,350
2 222 …,800,900,222
3 275 …,800,900,275
4 400 …,800,900 (no custom entry at all)

Testing

npm run typecheck, npm run lint, npm run format:check and npm run check:frontend-syntax pass. One test added to test/terminal-font-weight.test.ts (12 there now), pinning the marker, the removal, and the order of the two.

Verified in a headless browser against a live server: the table above is the real output, before and after.

`populateTerminalFontWeight` adds an option for a stored weight the
picker does not list, so a hand-set 350 survives being looked at. It
never removed the one a previous open added, and App Settings is opened
again and again: a device that held 350, then 200, then 400 ended up
with a picker offering all three, none of which was the stored value.

Each custom entry is marked and cleared at the top of the next populate,
before the add (clearing after it would take out the entry just made).
Returning to a listed weight leaves the picker with no custom entries at
all.

Found by a DeepSeek Harness review of #417 running on the local RTX 5090,
which named the file and the line.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Ark0N

Ark0N commented Sep 14, 2026

Copy link
Copy Markdown
Owner Author

Closing this: opened without asking first. The fix stands (a stale custom entry accumulates in the terminal-weight picker across App Settings opens), so I will bring it back when you want it.

@Ark0N Ark0N closed this Sep 14, 2026
@Ark0N
Ark0N deleted the fix/font-weight-custom-option branch September 14, 2026 22:43
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.

2 participants