feat(chart): own captions for comparisons and a per-kind default reset - #408
Merged
Conversation
A comparison tab draws the same coin several times over, each pane a third of the usual width, and it followed the main chart's captions: the volume block, the cursor-measuring block, the session counters and funding were printed once per pane, in the space where the pane's own identity should be. So a comparison now ships a caption set of its own, the way the trade-detail window already does — the instrument, the Y-scale badge, what is open on this venue, the venue roster and the spread against the anchor. Transcribed from a comparison tab in daily use rather than assembled: two font multipliers come with it, stated as steps from LABEL_SIZE_MULT_DEFAULT so they still follow that number if it moves. The second half is the way back. Once a default has been stored for a kind, that value shadows the shipped one forever, and the first press of "make default" on ANY kind freezes every other kind at what it was showing — so a profile that ever used the feature could not reach a shipped set again. The ⧉ row therefore gains a "Reset" beside "Make default", which empties the ticked kinds' stored default: a kind that ships a set of its own gets it back, the rest follow Main again. It clears those kinds' tab overrides through the same path the store press uses, so the change is visible without a restart. Resetting Main is the one case that cannot empty anything — Main's default IS the base field — so it takes the shipped value through the setter, whose separation pass holds the other kinds where they are. That costs a stored copy for a kind that held none, and it is the deliberate half of the trade: moving those kinds instead would redress tabs the reader never ticked. The walk visits Main first for that reason, and ChartTabKind::RESET_ORDER states the order in moon-core where a test can pin it. The row also wraps now, at both levels. A popover is a fixed width and neither a button nor a checkbox shrinks, so four ticks beside two buttons had a hard minimum wider than the popup in Spanish. Neither button carries a tooltip: this fork paints a tooltip under the popover that owns it, so the sentence above the row is the only explanation either button can have, and it says what both do.
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.
What & why
A comparison tab was wearing the main chart's captions. It draws the same coin several times over, each pane a third of the usual width, so the live default's per-market blocks — the minute's volumes, the cursor-measuring block, the session counters, funding — were printed once per pane, in the space where the pane's own identity belongs. A comparison now ships a caption set of its own, the way the trade-detail window already does: the instrument, the Y-scale badge, what is open on this venue, the venue roster, and the spread against the anchor.
The set is transcribed from a comparison tab in daily use rather than assembled, exactly as
ChartLabelsCfg::default()was transcribed from a main chart. Its two font multipliers are stated as steps fromLABEL_SIZE_MULT_DEFAULT(badge a step up, roster a step down) so they keep following that number if it ever moves.The second half is the way back. Once a default is stored for a kind it shadows the shipped one forever, and the first "make default" press on ANY kind freezes every other kind at what it was showing — so a profile that ever used the feature could not reach a shipped set again. The apply row therefore gains Reset beside Make default: it empties the ticked kinds' stored default, so a kind that ships a set of its own gets it back and the rest follow Main again. It clears those kinds' tab overrides through the same path the store press uses, so the result is visible without a restart.
Notable decisions
ChartTabKind::RESET_ORDERstates that order inmoon-core, where a test pins it.ApplyMode::ResetDefaultcarries its slots rather than reading them out of the press's values: a reset lands on what the terminal ships, so a value it carried could only be noise — and aChartLabelsCfgis over six kilobytes, copied on every render of the row.docs-internal/FORK_BUGS.md). The sentence above the row is the only explanation these buttons can have, and it now says what both of them do.MoonButtonnorMoonCheckboxshrinks, so four ticks beside two buttons had a hard minimum that was past the popup's edge in Spanish.Known limitations
CONTRIBUTING's "an upgrade never silently drops what the user already reads".How to verify
In the app: open the labels popup on a comparison tab, press the apply button, tick "Comparisons", press Reset — the panes adopt the shipped comparison set without a restart, and the stored default is gone from
layout.toml.