Skip to content

feat(ui): checkboxes on MoonUI's Sm tier with label and description - #552

Merged
kirillDevPro merged 5 commits into
Moonbot-Tech:mainfrom
ThusMad:feat/checkbox-sm-tier
Sep 13, 2026
Merged

feat(ui): checkboxes on MoonUI's Sm tier with label and description#552
kirillDevPro merged 5 commits into
Moonbot-Tech:mainfrom
ThusMad:feat/checkbox-sm-tier

Conversation

@ThusMad

@ThusMad ThusMad commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Depends on Moonbot-Tech/MoonUI#66 — merge that first. build.yml refreshes MoonUI to master on every run, so this PR's compiling jobs fail until #66 lands (no MoonSize export, no MoonCheckbox::description), then pass on a re-run.

What & why

MoonUI#66 replaces the checkbox with the reviewed design: MoonCheckboxSize::Compact/Normal give way to the shared MoonSize tiers (Sm = 16px box, 14px medium label, 20px line; Md = 20/16/24), the label gains a .description() line under it, and MoonUI now bundles Inter itself. #66 also makes the tiers follow only the UI zoom — the terminal's Font slider (+3 by default) no longer inflates an Sm checkbox to Md size, while every other component keeps the delta for now.

This PR moves the terminal onto that component, in five commits split by kind:

  1. refactor(ui) — every checkbox on Sm. Deprecated Compact/Normal are gone from the tree; the settings pages that asked for Normal get Sm too (Md reads larger than the section headings), and the import preview, which set no size, stops falling back to Md.
  2. fix(ui) — no clipping in fixed-width columns. The order-edit stop toggles and the manual-strategy slot column become minimum widths; the tuner time grid drops its hard-coded CHECK_COL and reserves the column in the slider rows with an invisible Sm checkbox, as bulk_check_slot already does.
  3. fix(ui) — measurement at the Sm geometry. The checkbox mirror in panels/common.rs still described the 12px compact box, so the Strategies and Assets settings popups came out too narrow. It now mirrors Sm, and the new design::ui_text_width_zoomed measures the label without the Font slider's delta, matching how MoonUI draws it.
  4. feat(ui) — titles and hints through .label() / .description(). Hints drawn as a separate muted element under a checkbox (General, Telegram Mini App, Security, Storage, chart graphics, manual strategy, tuner compose, core-settings expert, two core-expert rows) become its description; captions drawn beside a bare box (Strategies active-only, tuner round, News tag rows) become its label and so part of the hit target.
  5. refactor(startup) — Inter from MoonUI. The terminal embedded one variable Inter file three times under the same "Inter" family MoonUI now registers; the duplicate goes.

Notable decisions

  • General keeps its shortened hints. checkbox_with_hint shows settings_hint's first sentence as the description and moves the full text into the same wide tooltip, hosted on the whole checkbox since the description is no longer an element of its own.
  • The idle-close hint moves above the seconds stepper, under its checkbox: it defines "idle" for the checkbox, not for the stepper.
  • Active-only is now one labelled checkbox with one writer. The old caption-left-of-mark cluster had two click handlers; theme_contract/strategies.rs pinned that at two and now pins one handler plus the localized label. The caption moves to the right of the box.
  • Left as they are: the connections group header (an icon sits between box and name), the tuner grids' unlabelled master checkboxes (kept bare for column alignment, per the comment at filter/mod.rs), and hints that describe a whole group rather than one checkbox (detect note, candle colours, autostart "Not recommended!", autobuy example, Telegram consent).
  • Geist Mono stays embedded: MoonUI bundles only Regular and Bold, and the chart draws at 500 and 600.
  • The two checkboxes main added in the Telegram core reader after this work started (core_section.rs, login_steps.rs) are moved to Sm in commit 1.

Known limitations

  • The rows that are now larger by design (every checkbox that was compact grows from a 12px to a 16px box, label 9.5 → 14px) were checked on screen on the General, Lines, Badges, Interface tabs and the Strategies window during development, before fix(strategies): treat a slash inside a folder name as part of the name #66 took the Font slider out of the tier sizes. The final build was not re-inspected visually; worth a look at dense popups (layout, graphics, tuner) and the settings tabs above.
  • Geist Mono is still registered by both the terminal and MoonUI (Regular/Bold). Dropping the terminal's copy needs Medium and SemiBold cuts in MoonUI.
  • FireTest not run (no chart render or input path touched).

Issues

Checked all 16 open issues; none is addressed or affected. Nearest: the strategy tree's green checkbox reading as "running" and the tuner's «активные» checkbox semantics — neither the tone nor the meaning of those controls changes here.

How to verify

Against a local MoonUI checkout of #66 (.cargo/config.toml patch, as docs/ARCHITECTURE.md describes):

cargo fmt --all -- --check
cargo clippy --workspace --all-targets
cargo test --workspace --no-fail-fast

fmt --check exit 0 · clippy: 0 errors, no finding on a line this PR changes (the one finding in a touched file, a collapsible if at settings/telegram.rs:87, is main's code) · tests: moon-ui-gpui 1816 passed + theme_contract 333 passed, moon-chart 123 passed, 0 failed.

moon-core is not touched by this PR (no file under crates/moon-core differs from origin/main). On this machine 4 of its tests fail identically regardless: update::discovery ×3 and ci_gate_contract::release_validator_orders_patch_tags_and_rejects_legacy_aliases (fatal: no tag message? from its git fixture) — environment, not this change.

🤖 Generated with Claude Code

ThusMad and others added 5 commits September 13, 2026 21:11
MoonUI replaces `MoonCheckboxSize::Compact`/`Normal` with the shared `MoonSize` scale
(`.size()` now takes `impl Into<MoonCheckboxSize>`). Every terminal checkbox moves to
`MoonSize::Sm`, including the settings pages that asked for `Normal` - the new `Md` tier is
a 20px box with a 16px label, which reads larger than the section headings - and the import
preview, which set no size and fell back to MoonUI's `Md` default.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Three wrappers still sized for the old 12px compact box. The order-edit stop toggles and the
manual-strategy slot column become minimum widths, so the rows keep their column alignment
while a longer (localized) label is never cut off. The tuner time grid drops its hard-coded
`CHECK_COL` width: the checkboxes size themselves, and the slider rows reserve the same column
with an invisible `Sm` checkbox - the strategy tree's `bulk_check_slot` technique - so the
columns match MoonUI's own box at any UI zoom.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two settings popups size themselves from a mirror of the checkbox's geometry in
`panels/common.rs`, and a few rows copy its label face. That mirror still described the old
compact box (12px mark, 6px gap, 9.5px label), so the popups came out too narrow for the new
`Sm` checkbox. It now mirrors `Sm` (16px box, 8px gap, 14px medium label).

MoonUI fixes a tier checkbox's text: it follows the UI zoom but not the Font slider. Measuring
it through `ui_text_width` would add the slider's delta, so `design::ui_text_width_zoomed`
measures at `ui(base)` instead, sharing the glyph-advance cache. The Strategies and Assets popups
measure their checkbox labels with it, and the rows that copy the label face size their text with
`ui_px` rather than the font-scaled `text_px`.

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

MoonUI's checkbox now renders supporting text under its label (`.description()`). Every place
that drew a checkbox's hint as a separate muted element below it, or its title as separate text
beside a bare box, now hands that text to the checkbox itself, so the title is part of the hit
target and the hint aligns under it in the standard muted style.

- Descriptions: General (split tabs, control zones, idle close, file log), Telegram Mini App,
  Security launch and servers.enc passwords, Storage strategy history, chart graphics hide
  toggles, manual-strategy stop logic, tuner compose, core-settings expert mode, and the core
  expert Telegram premium and debug-data rows (via a new `flag_described` helper).
- General keeps `settings_hint`'s first-sentence shortening: `checkbox_with_hint` shows the
  short text as the description and hosts the full text in the same wide tooltip over the whole
  control.
- Labels: the Strategies active-only filter (one labelled checkbox instead of a caption and a
  mark with two click handlers; the contract test now requires that), the tuner round-results
  toggle, and the News untagged and `#tag` visibility rows (mono label for tag identifiers).

Left alone on purpose: the connections group header (an icon sits between box and name), the
tuner grids' unlabelled master checkboxes (kept bare for column alignment), and hints that
describe a group of controls rather than one checkbox.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`moon_ui::init` now registers MoonUI's static Inter cuts (Regular, Medium, SemiBold, Bold) under
the `"Inter"` family its theme and `design::ui_font` name. The terminal registered its own
`"Inter"` on top: one variable font file embedded three times as Inter-400/500/600. Two faces
under one family compete for every weight, and the Medium cut is the one the new checkbox label
needs, so the terminal's copy goes and MoonUI's is the only Inter.

Geist Mono stays: MoonUI ships only its Regular and Bold, while the chart draws at 500 and 600.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kirillDevPro
kirillDevPro merged commit 01e6bb1 into Moonbot-Tech:main Sep 13, 2026
9 of 12 checks passed
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