Skip to content

Switch to opt-in digit grouping#344

Merged
eluberoff merged 2 commits intomainfrom
eli/switch-to-show-grouping
Mar 10, 2026
Merged

Switch to opt-in digit grouping#344
eluberoff merged 2 commits intomainfrom
eli/switch-to-show-grouping

Conversation

@eluberoff
Copy link
Copy Markdown
Member

Situation: when you have an "ans" inside of an editable math in the scientific calculator, the digits inside of the ans switch into and out of digit grouping as you type, which is surprising and disconcerting.

Change of design is to have a timeout for editable math to make digit grouping visible, and to always have that turned on for a static math, so now a static math inside of an editable math will always permanent digit grouping.

Comment thread src/commands/math.ts
// `mathquillify` calls `createTextarea`
super.mathquillify('mq-math-mode');
if (this.__options.enableDigitGrouping) {
this.__controller.root.domFrag().addClass('mq-show-grouping');
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the key win here: static math immediately shows digit grouping, and editing around it doesn't impact it

Comment thread src/css/math.less Outdated
.mq-ellipsis-end {
margin-left: @ellipsis-internal-sep;
margin-right: @ellipsis-separator;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm struggling to see exactly what this file looked like before and what it looks like after. It seems like maybe .mq-ellipsses-* classes are now inside of .mq-show-grouping. And maybe they were global before and not changed by .mq-suppress-grouping. Does this mean that we are changing when those show up? Do we delay the ellipsis styling and is that intentional?

UPDATE - It does look like this is a change. I'm not positive it feels good to me. I prefer the ... padding immediately and not on delay. How do you feel about it? It changing later is a little jarring. The digit spacing is less jarring because we try to not update the width of the content. But the ... does change the width of the content.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shoot, great catch. I agree -- those should be immediate

@eluberoff eluberoff merged commit d6c7976 into main Mar 10, 2026
3 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