Skip to content

Ribbon: Font Size is a box you type into, the sizes behind its arrow - #952

Merged
aiongg merged 3 commits into
storytold:mainfrom
marcoarnulfo:fix/font-size-typeable-box
Oct 22, 2026
Merged

aiongg merged 3 commits into
storytold:mainfrom
marcoarnulfo:fix/font-size-typeable-box

Conversation

@marcoarnulfo

Copy link
Copy Markdown
Contributor

Fixes #932.

Thanks @richard1912 for the precise report and the key-by-key table. The size control borrowed the font-name dropdown: on Enter it applied the highlighted row of a substring-filtered list, so typing 6 landed on 36. Font Size is now a text box like Excel's: click it or press Alt, H, F, S and the size is selected, typing replaces it, Enter applies exactly the number typed, and Esc or clicking away reverts. Values outside 1 to 409 still go through home.fontSize, which already refuses them with "The number must be between 1 and 409." and rounds to 0.5; text that isn't a number just reverts. The arrow next to the box opens the plain list of standard sizes (no filter field), with the current size highlighted, arrows and Enter to pick. The list reuses the existing combo popup with the filter switched off, so the font, number format and sheet navigator combos are unchanged.

The font name box has the same Enter issue (the comment on #932); I left editable_combo itself alone here to keep the diff small. Happy to fix it in this PR or a follow-up, whichever you prefer.

Validation:

  • cargo test -p gridcraft-ui-egui --test font_size_box: on main, typing 6 + Enter gives 36 and there is no separate arrow; passes here (6, 2 and 10.5 applied to the whole selection, 500 refused with the message, abc and Esc revert, list click and Down + Enter pick)
  • cargo test -p gridcraft-ui-egui --test keytips (the custom-size check now reads the box value)
  • cargo clippy -p gridcraft-ui-egui --all-targets -- -D warnings, cargo fmt --all -- --check
  • Looked at the rendered ribbon, the open list and the box while typing
  • (macOS, Apple silicon)

A separate commit adds my own entry to contributors/people.toml (real name only), as AGENTS.md suggests.

@richard1912

Copy link
Copy Markdown
Contributor

Thanks @marcoarnulfo, great turnaround! Tested this branch (5a7fbfa) on Windows 11 at 150% scaling with real key presses and mouse clicks; size read back with cell.get, starting from 11 each time:

Input Result
Alt, H, F, S then 6 / 2 / 7 / 1 + Enter 6 / 2 / 7 / 1 (were 36 / 24 / 72 / 14 on v0.6.1)
Alt, H, F, S then 13 / 10.5 / 72 + Enter 13 / 10.5 / 72
Click the box, 6 / 9 + Enter 6 / 9
6 then Esc 11 (reverted)
Click the box, 6, click away on the grid 11 (reverted)
abc + Enter 11 (reverted)
500 + Enter 11, with "The number must be between 1 and 409."
Arrow, Down, Enter 12
A1:C3 selected, 6 + Enter 6 on all three cells

The arrow's list is plain (no filter field) with the current size highlighted. All as expected.

On your question: a follow-up PR for the font name box sounds good, to keep this one small. Since this PR closes #932, could you mention the follow-up there or link it to #933 (the font list issue), so the font-name Enter bug from my #932 comment isn't lost?

One small thing: the PR title is "Contributors: add my real name", from the second commit (contributors/people.toml), rather than the Font Size change. You may want to retitle it, or split that commit out, so it's clear for review.

@marcoarnulfo marcoarnulfo changed the title Contributors: add my real name Ribbon: Font Size is a box you type into, the sizes behind its arrow Oct 13, 2026
@marcoarnulfo

Copy link
Copy Markdown
Contributor Author

Thanks for testing it so thoroughly! Good catch on the title, fixed (it had picked up the second commit). I'll do the font name box's Enter in a follow-up PR linked to #933, so the bug from your #932 comment isn't lost.

The size box is one frame with the Font name box's fill, border, height and
corners, with the text field and the dropdown arrow inside it (focus shows
the selection stroke). The size list drops directly below the box and is as
wide as it, instead of opening 220 pt wide under the arrow.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ut3hr3a13szpQdQ7gbYbfc
@richard1912

Copy link
Copy Markdown
Contributor

Thanks @marcoarnulfo, and thanks for taking the font name box in a follow-up!

One more small thing after trying it by hand: the new size box didn't quite match the Font name box beside it (different background, shorter height, arrow outside the box, and the list opened offset under the arrow rather than directly below the box). I've put a small follow-up into your branch as marcoarnulfo#1 (only ribbon.rs; tests, clippy and fmt pass). Feel free to squash it in or reshape it.

@marcoarnulfo

Copy link
Copy Markdown
Contributor Author

Thank you, @richard1912, that's a nice touch. I merged your marcoarnulfo#1 into this branch as is (merge commit, so your commits keep your name); the size box now matches the font name box and the list drops right under it. Tests, clippy and fmt pass here too.

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.

fix(ribbon): Font Size should be a typeable box, not a filtered list (typing 6 gives 36)

3 participants