feat(ui): checkboxes on MoonUI's Sm tier with label and description - #552
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on Moonbot-Tech/MoonUI#66 — merge that first.
build.ymlrefreshes MoonUI tomasteron every run, so this PR's compiling jobs fail until #66 lands (noMoonSizeexport, noMoonCheckbox::description), then pass on a re-run.What & why
MoonUI#66 replaces the checkbox with the reviewed design:
MoonCheckboxSize::Compact/Normalgive way to the sharedMoonSizetiers (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 anSmcheckbox toMdsize, while every other component keeps the delta for now.This PR moves the terminal onto that component, in five commits split by kind:
refactor(ui)— every checkbox onSm. DeprecatedCompact/Normalare gone from the tree; the settings pages that asked forNormalgetSmtoo (Mdreads larger than the section headings), and the import preview, which set no size, stops falling back toMd.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-codedCHECK_COLand reserves the column in the slider rows with an invisibleSmcheckbox, asbulk_check_slotalready does.fix(ui)— measurement at theSmgeometry. The checkbox mirror inpanels/common.rsstill described the 12px compact box, so the Strategies and Assets settings popups came out too narrow. It now mirrorsSm, and the newdesign::ui_text_width_zoomedmeasures the label without the Font slider's delta, matching how MoonUI draws it.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.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
checkbox_with_hintshowssettings_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.theme_contract/strategies.rspinned that at two and now pins one handler plus the localized label. The caption moves to the right of the box.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).mainadded in the Telegram core reader after this work started (core_section.rs,login_steps.rs) are moved toSmin commit 1.Known limitations
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.tomlpatch, asdocs/ARCHITECTURE.mddescribes):fmt
--checkexit 0 · clippy: 0 errors, no finding on a line this PR changes (the one finding in a touched file, a collapsibleifatsettings/telegram.rs:87, ismain'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-corediffers fromorigin/main). On this machine 4 of its tests fail identically regardless:update::discovery×3 andci_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