Skip to content

Studio settings: size the composer Beta badge and the settings search offsets from the UI scale - #16524

Merged
danielhanchen merged 1 commit into
mainfrom
dh/settings-scale-tokens
Nov 3, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
dh/settings-scale-tokens

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

Summary

Two UI font scale guards are red on main, so every Studio PR fails three jobs at once: Repo tests (CPU, studio), Frontend build + bundle sanity and Frontend unit tests (Windows). In the last 30 PRs that is 18, 9 and 9 PRs respectively. Both reproduce on current main (99d1bc6686).

1. tests/studio/test_ui_font_scale_contract.py::test_no_raw_pixel_text_utilities

Raw px text utilities ignore the UI font size preference; use the text-ui-* / leading-ui-* tokens in index.css instead:
['features/settings/components/composer-settings.tsx: text-[10px]']

#16298 (63a3896459) added the composer's Beta badge with text-[10px]. Every other Beta badge of this shape uses h-4 px-1.5 text-ui-10, and utils.ts registers text-ui-* with tailwind-merge as a font size. --text-ui-10 is calc(0.625rem * var(--ui-font-scale, 1)), which is exactly 10px at the default size. The guard is right.

2. studio/frontend/tests/ui-font-size-scales-spacing.test.ts: "no hand-set length above a hairline skips the scale"

'features/settings/settings-dialog.tsx: left-[13.5px]',
'features/settings/settings-dialog.tsx: pl-[39.5px]',
'features/settings/settings-dialog.tsx: right-[12.5px]'

#16455 (adfd9e0cc9) added the settings search field. Its height is already h-[calc(36px*var(--ui-space-scale,1))], and its search and clear icons are size-4, which scales too. Only the three offsets that place the icons and the text inside the field were fixed pixels, so at a larger interface scale the icons and the text start would drift relative to a field that grew. The guard is right here too.

Change

  • composer-settings.tsx: text-[10px] becomes text-ui-10.
  • settings-dialog.tsx: the three offsets become calc(...px*var(--ui-space-scale,1)), the same form as the field's height on the same line.

At the default font size and interface scale, every changed value computes to the same length as before, so nothing moves for anyone on the defaults. At other scales, the badge text and the search field's contents now follow the scale like their neighbours. No behaviour, layout structure or copy changes.

Testing

  • studio/frontend/tests/ui-font-size-scales-spacing.test.ts: main gives 1 failed of 27 (the case above); this branch passes 27 of 27.
  • tests/studio/test_ui_font_scale_contract.py: main gives 1 failed of 12; this branch passes 12 of 12.
  • No screenshots: at the default scale, the computed lengths are identical by construction (calc(13.5px * 1) is 13.5px, and 0.625rem at a 16px root is 10px).

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T06:13:48.944906Z 57e929b Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 57e929be34

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit e8df6d5 into main Nov 3, 2026
@danielhanchen
danielhanchen deleted the dh/settings-scale-tokens branch November 3, 2026 06:24
danielhanchen added a commit that referenced this pull request Nov 3, 2026
…16535)

## Summary

`Tauri Linux debug build` fails intermittently on unrelated PRs in
`linux_gpu_supervisor::tests::pid_and_group_signals_reach_the_child_once`,
added in #15482. It hit #16524 today and `fix/opt-in-startup-warmup`
yesterday, 2 of about 41 completed runs since Nov 1, with the same panic
both times:

```
thread 'linux_gpu_supervisor::tests::pid_and_group_signals_reach_the_child_once' panicked at src/linux_gpu_supervisor.rs:1194:37:
index out of bounds: the len is 0 but the index is 0
```

**Cause.** The child writes its PIDs to `ready` with `std::fs::write`,
which creates the file and then writes to it. The parent polls with
`read_to_string`, and as soon as the read succeeds it parses the IDs. If
the poll lands between the create and the write, the parent reads an
empty string and indexes an empty list. The second panic in the log
(`NotFound` at line 1125) follows from the first: the parent's tempdir
is gone by the time the child writes `cleaned`. The parent polls
`cleaned` the same way, so that check has the same race.

The supervisor code under test is fine. Only the test's handshake was
racy.

## Change

`studio/src-tauri/src/linux_gpu_supervisor.rs`, test module only: a
small `publish` helper writes to `<name>.tmp` and renames it into place,
so the parent sees either no file or the whole contents. Both `ready`
and `cleaned` go through it. The signals, timeouts and assertions are
unchanged.

## Testing

- `cargo test --locked linux_gpu_supervisor`: 20 passed.
- Sabotage: I put a 100 ms sleep between the create and the write in the
original `std::fs::write` of `ready`. The test then fails with exactly
the CI panic above (`the len is 0 but the index is 0`).
- With this change and the same 100 ms sleep between writing `ready.tmp`
and the rename, the test passes 3 of 3.
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.

1 participant